webim-adapter 1.1.1 → 1.1.2
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 +1111 -659
- package/build/webim-embed.js +32 -13
- package/build/webim-ssr.js +1136 -684
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -259,36 +259,36 @@ function P(e) {
|
|
|
259
259
|
color: O,
|
|
260
260
|
inset: k
|
|
261
261
|
})), A.length && (t.boxShadow = A.join(", "));
|
|
262
|
-
let P = (e) => e.type === "blur" ? `blur(${M(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:
|
|
262
|
+
let P = (e) => e.type === "blur" ? `blur(${M(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: ee, filterSaturate: V } = t;
|
|
263
263
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
264
264
|
let H = F(I);
|
|
265
|
-
R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`),
|
|
265
|
+
R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), ee !== void 0 && H.push(`contrast(${ee}%)`), V !== void 0 && H.push(`saturate(${V}%)`), H.length && (t.filter = H.join(" "));
|
|
266
266
|
let te = F(L);
|
|
267
267
|
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
268
|
-
let { textStrokeWidth:
|
|
269
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
270
|
-
let { clipText:
|
|
271
|
-
delete t.clipText,
|
|
272
|
-
let { transitions:
|
|
268
|
+
let { textStrokeWidth: ne, textStrokeColor: re } = t;
|
|
269
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || re !== void 0) && (t.WebkitTextStroke = `${M(ne ?? 1)} ${re || "currentColor"}`);
|
|
270
|
+
let { clipText: ie } = t;
|
|
271
|
+
delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
+
let { transitions: ae, transitionDuration: U, transitionEasing: oe, transitionProperty: se } = t, ce = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
273
273
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
274
|
+
let le = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ce(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (U !== void 0 && le.push(`${se || "all"} ${ce(U)} ${oe || "ease"}`), le.length && (t.transition = le.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
276
276
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
277
277
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
278
278
|
}
|
|
279
279
|
delete t.backgroundVideo;
|
|
280
|
-
let { overlayColor:
|
|
281
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
282
|
-
let e = `color-mix(in srgb, ${
|
|
280
|
+
let { overlayColor: W, overlayOpacity: ue } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, W) {
|
|
282
|
+
let e = `color-mix(in srgb, ${W} ${ue ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
283
283
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
284
284
|
}
|
|
285
285
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
286
|
-
let { backgroundLayers:
|
|
286
|
+
let { backgroundLayers: G } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let de = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (de.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of de) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
292
292
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
293
293
|
else {
|
|
294
294
|
if (!t.src) continue;
|
|
@@ -322,7 +322,7 @@ var F = {
|
|
|
322
322
|
"submit",
|
|
323
323
|
"keydown",
|
|
324
324
|
"inview"
|
|
325
|
-
], B = ["load", "pagescroll"],
|
|
325
|
+
], B = ["load", "pagescroll"], ee = [...z, ...B], V = /^[A-Za-z_$][\w$]*$/;
|
|
326
326
|
function H(e, t) {
|
|
327
327
|
let n = String(t ?? "").trim();
|
|
328
328
|
if (!n) return [e];
|
|
@@ -340,7 +340,7 @@ function te(e, t) {
|
|
|
340
340
|
let n = [];
|
|
341
341
|
for (let r of t ?? []) {
|
|
342
342
|
let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
|
|
343
|
-
if (!
|
|
343
|
+
if (!ee.includes(t) || (i ? !a.length : !V.test(o))) continue;
|
|
344
344
|
let s = (t) => {
|
|
345
345
|
if (i) {
|
|
346
346
|
for (let t of H(e, r?.target)) x(t, a);
|
|
@@ -366,7 +366,7 @@ function te(e, t) {
|
|
|
366
366
|
}
|
|
367
367
|
e.__webimEvents = n;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function ne(e, t, n = []) {
|
|
370
370
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
371
371
|
let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
|
|
372
372
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
@@ -380,15 +380,15 @@ function U(e, t, n = []) {
|
|
|
380
380
|
}
|
|
381
381
|
return a;
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let i = Object.entries(P(t)).map(([e, t]) => `${
|
|
383
|
+
var re = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
384
|
+
function ie(e, t, n, r = !1) {
|
|
385
|
+
let i = Object.entries(P(t)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
return Object.entries(F).map(([r, i]) =>
|
|
388
|
+
function ae(e, t, n) {
|
|
389
|
+
return Object.entries(F).map(([r, i]) => ie(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var U = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var ie = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], oe = (e) => Object.entries(P(e)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function se(e, t) {
|
|
406
|
+
return U.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? oe(t[n]) : "";
|
|
408
408
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
409
409
|
}).filter(Boolean).join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ce(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = se(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,10 +419,10 @@ 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
|
-
function
|
|
422
|
+
function le(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = ae(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,7 +430,15 @@ function se(e, t) {
|
|
|
430
430
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
431
431
|
return n.join("\n");
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ue = {
|
|
434
|
+
fontFamily: W,
|
|
435
|
+
fontStyle: "normal",
|
|
436
|
+
fontWeight: 400,
|
|
437
|
+
letterSpacing: "normal",
|
|
438
|
+
textTransform: "none",
|
|
439
|
+
lineHeight: 1.4,
|
|
440
|
+
textShadow: "none"
|
|
441
|
+
}, G = {
|
|
434
442
|
light: {
|
|
435
443
|
background: "#f2f2f2",
|
|
436
444
|
surface: "#f2f2f2",
|
|
@@ -471,23 +479,23 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
471
479
|
contrastText: "#052e2b"
|
|
472
480
|
}
|
|
473
481
|
}
|
|
474
|
-
},
|
|
482
|
+
}, de = {
|
|
475
483
|
font: "system",
|
|
476
484
|
headingFont: "inherit",
|
|
477
|
-
light:
|
|
478
|
-
dark:
|
|
479
|
-
},
|
|
485
|
+
light: G.light,
|
|
486
|
+
dark: G.dark
|
|
487
|
+
}, fe = {
|
|
480
488
|
system: {
|
|
481
489
|
label: "System",
|
|
482
|
-
value:
|
|
490
|
+
value: W
|
|
483
491
|
},
|
|
484
492
|
inter: {
|
|
485
493
|
label: "Inter",
|
|
486
|
-
value: `"Inter", ${
|
|
494
|
+
value: `"Inter", ${W}`
|
|
487
495
|
},
|
|
488
496
|
outfit: {
|
|
489
497
|
label: "Outfit",
|
|
490
|
-
value: `"Outfit", ${
|
|
498
|
+
value: `"Outfit", ${W}`
|
|
491
499
|
},
|
|
492
500
|
serif: {
|
|
493
501
|
label: "Serif",
|
|
@@ -497,7 +505,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
497
505
|
label: "Mono",
|
|
498
506
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
499
507
|
}
|
|
500
|
-
},
|
|
508
|
+
}, pe = (e, t) => fe[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), me = (e, ...t) => {
|
|
501
509
|
let n = Object.assign({}, e, ...t);
|
|
502
510
|
return n.primary = {
|
|
503
511
|
...e.primary,
|
|
@@ -513,20 +521,20 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
513
521
|
}), {})
|
|
514
522
|
}, n;
|
|
515
523
|
};
|
|
516
|
-
function
|
|
524
|
+
function K(e) {
|
|
517
525
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
518
526
|
return {
|
|
519
|
-
font: r ??
|
|
520
|
-
headingFont: i ??
|
|
521
|
-
light:
|
|
522
|
-
dark:
|
|
527
|
+
font: r ?? de.font,
|
|
528
|
+
headingFont: i ?? de.headingFont,
|
|
529
|
+
light: me(G.light, a, t),
|
|
530
|
+
dark: me(G.dark, n)
|
|
523
531
|
};
|
|
524
532
|
}
|
|
525
|
-
function
|
|
533
|
+
function q(e) {
|
|
526
534
|
return {
|
|
527
535
|
"--page-bg": e.background,
|
|
528
536
|
"--page-surface": e.surface ?? e.background,
|
|
529
|
-
"--page-border": e.border ??
|
|
537
|
+
"--page-border": e.border ?? G.light.border,
|
|
530
538
|
"--page-text": e.text,
|
|
531
539
|
"--page-accent": e.accent,
|
|
532
540
|
"--page-accent-text": e.accentText,
|
|
@@ -541,19 +549,19 @@ function me(e) {
|
|
|
541
549
|
};
|
|
542
550
|
}
|
|
543
551
|
function he(e) {
|
|
544
|
-
let t =
|
|
552
|
+
let t = K(e);
|
|
545
553
|
return {
|
|
546
554
|
backgroundColor: "var(--page-bg)",
|
|
547
555
|
color: "var(--page-text)",
|
|
548
|
-
fontFamily:
|
|
549
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
556
|
+
fontFamily: pe(t.font, W),
|
|
557
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : pe(t.headingFont, "inherit")
|
|
550
558
|
};
|
|
551
559
|
}
|
|
552
560
|
function ge(e, t = "light") {
|
|
553
|
-
let n =
|
|
561
|
+
let n = K(e);
|
|
554
562
|
return {
|
|
555
563
|
...he(e),
|
|
556
|
-
...
|
|
564
|
+
...q(n[t] ?? n.light)
|
|
557
565
|
};
|
|
558
566
|
}
|
|
559
567
|
function _e(e, t) {
|
|
@@ -564,7 +572,7 @@ function ve(e, t) {
|
|
|
564
572
|
}
|
|
565
573
|
//#endregion
|
|
566
574
|
//#region ../ui/src/components/builder/views.jsx
|
|
567
|
-
var
|
|
575
|
+
var J = n({
|
|
568
576
|
tenant: "",
|
|
569
577
|
apiUrl: "/api",
|
|
570
578
|
locale: "",
|
|
@@ -587,11 +595,11 @@ var q = n({
|
|
|
587
595
|
...xe()
|
|
588
596
|
};
|
|
589
597
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
590
|
-
}, Ce = n(null),
|
|
591
|
-
function
|
|
598
|
+
}, Ce = n(null), Y = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
599
|
+
function X(e, t) {
|
|
592
600
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
593
601
|
}
|
|
594
|
-
var
|
|
602
|
+
var Z = (e) => {
|
|
595
603
|
let t = [];
|
|
596
604
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
597
605
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -601,16 +609,16 @@ var J = (e) => {
|
|
|
601
609
|
}
|
|
602
610
|
return t;
|
|
603
611
|
};
|
|
604
|
-
function
|
|
612
|
+
function we(e) {
|
|
605
613
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
606
614
|
}
|
|
607
|
-
function
|
|
608
|
-
let n = t?.data ?? {}, r =
|
|
615
|
+
function Q(e, t) {
|
|
616
|
+
let n = t?.data ?? {}, r = Z(n);
|
|
609
617
|
if (!r.length) return e;
|
|
610
|
-
let i = RegExp(`:(${r.map(
|
|
618
|
+
let i = RegExp(`:(${r.map(Y).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => we(X(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
611
619
|
return a(e);
|
|
612
620
|
}
|
|
613
|
-
var
|
|
621
|
+
var Te = {
|
|
614
622
|
margin: 0,
|
|
615
623
|
fontWeight: 700,
|
|
616
624
|
lineHeight: 1.2,
|
|
@@ -699,14 +707,14 @@ function Fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
699
707
|
return /* @__PURE__ */ d(n, {
|
|
700
708
|
ref: a,
|
|
701
709
|
style: {
|
|
702
|
-
...
|
|
710
|
+
...Te,
|
|
703
711
|
...P(r)
|
|
704
712
|
},
|
|
705
713
|
children: Re(t, e, i)
|
|
706
714
|
});
|
|
707
715
|
}
|
|
708
716
|
var Ie = {
|
|
709
|
-
fontFamily:
|
|
717
|
+
fontFamily: fe.mono.value,
|
|
710
718
|
background: "rgba(148, 163, 184, 0.18)",
|
|
711
719
|
padding: "1px 5px",
|
|
712
720
|
borderRadius: 4,
|
|
@@ -971,7 +979,7 @@ function He(e = [], t, n) {
|
|
|
971
979
|
let e = t.type;
|
|
972
980
|
return /* @__PURE__ */ d(e, {
|
|
973
981
|
style: {
|
|
974
|
-
...
|
|
982
|
+
...Te,
|
|
975
983
|
fontSize: Be[t.type],
|
|
976
984
|
...i
|
|
977
985
|
},
|
|
@@ -1384,23 +1392,23 @@ function dt({ slides: e = [], linked: t, ...n }) {
|
|
|
1384
1392
|
}
|
|
1385
1393
|
}) : null;
|
|
1386
1394
|
}
|
|
1387
|
-
var
|
|
1388
|
-
let r =
|
|
1395
|
+
var ft = 256, pt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), mt = (e, t, n) => {
|
|
1396
|
+
let r = ft * 2 ** n;
|
|
1389
1397
|
return {
|
|
1390
1398
|
x: (Number(t) + 180) / 360 * r,
|
|
1391
|
-
y: (.5 -
|
|
1399
|
+
y: (.5 - pt(Number(e)) / (2 * Math.PI)) * r
|
|
1392
1400
|
};
|
|
1393
1401
|
}, $ = (e, t) => {
|
|
1394
1402
|
if (e === "" || e == null) return null;
|
|
1395
1403
|
let n = Number(e);
|
|
1396
1404
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1397
|
-
},
|
|
1398
|
-
function
|
|
1405
|
+
}, ht = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1406
|
+
function gt(e, t, n = "directions", r = "") {
|
|
1399
1407
|
let i = `${e},${t}`;
|
|
1400
1408
|
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)}`;
|
|
1401
1409
|
}
|
|
1402
|
-
var
|
|
1403
|
-
function
|
|
1410
|
+
var _t = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1411
|
+
function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1404
1412
|
let _ = c(null), [v, y] = l(1200);
|
|
1405
1413
|
a(() => {
|
|
1406
1414
|
let e = _.current;
|
|
@@ -1410,7 +1418,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1410
1418
|
let n = new ResizeObserver(t);
|
|
1411
1419
|
return n.observe(e), () => n.disconnect();
|
|
1412
1420
|
}, []);
|
|
1413
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1421
|
+
let b = (Array.isArray(e) ? e : []).filter(ht), x = ht({
|
|
1414
1422
|
lat: t,
|
|
1415
1423
|
lng: n
|
|
1416
1424
|
}) ? {
|
|
@@ -1422,7 +1430,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1422
1430
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1423
1431
|
if (b.length < 2) return 13;
|
|
1424
1432
|
for (let e = 19; e >= 1; e--) {
|
|
1425
|
-
let t = b.map((t) =>
|
|
1433
|
+
let t = b.map((t) => mt($(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));
|
|
1426
1434
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1427
1435
|
}
|
|
1428
1436
|
return 1;
|
|
@@ -1446,12 +1454,12 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1446
1454
|
},
|
|
1447
1455
|
children: "Set the coordinates in Settings"
|
|
1448
1456
|
});
|
|
1449
|
-
let T =
|
|
1457
|
+
let T = mt(x.lat, x.lng, C), E = {
|
|
1450
1458
|
x: T.x - v / 2,
|
|
1451
1459
|
y: T.y - S / 2
|
|
1452
1460
|
}, D = [], O = [];
|
|
1453
|
-
for (let e = Math.floor(E.x /
|
|
1454
|
-
for (let e = Math.floor(E.y /
|
|
1461
|
+
for (let e = Math.floor(E.x / ft); e <= Math.floor((E.x + v) / ft); e++) D.push(e);
|
|
1462
|
+
for (let e = Math.floor(E.y / ft); e <= Math.floor((E.y + S) / ft); e++) O.push(e);
|
|
1455
1463
|
let k = 2 ** C;
|
|
1456
1464
|
return /* @__PURE__ */ f("div", {
|
|
1457
1465
|
ref: (e) => {
|
|
@@ -1474,22 +1482,22 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1474
1482
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1475
1483
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1476
1484
|
alt: "",
|
|
1477
|
-
width:
|
|
1478
|
-
height:
|
|
1485
|
+
width: ft,
|
|
1486
|
+
height: ft,
|
|
1479
1487
|
loading: "lazy",
|
|
1480
1488
|
style: {
|
|
1481
1489
|
position: "absolute",
|
|
1482
|
-
left: Math.round(t *
|
|
1483
|
-
top: Math.round(e *
|
|
1484
|
-
width:
|
|
1485
|
-
height:
|
|
1490
|
+
left: Math.round(t * ft - E.x),
|
|
1491
|
+
top: Math.round(e * ft - E.y),
|
|
1492
|
+
width: ft,
|
|
1493
|
+
height: ft,
|
|
1486
1494
|
userSelect: "none",
|
|
1487
1495
|
pointerEvents: "none"
|
|
1488
1496
|
}
|
|
1489
1497
|
}, `${t}-${e}`);
|
|
1490
1498
|
})),
|
|
1491
1499
|
b.map((e, t) => {
|
|
1492
|
-
let n =
|
|
1500
|
+
let n = mt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : gt($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1493
1501
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1494
1502
|
href: c || void 0,
|
|
1495
1503
|
target: c ? "_blank" : void 0,
|
|
@@ -1528,8 +1536,8 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1528
1536
|
viewBox: "0 0 24 24",
|
|
1529
1537
|
fill: a,
|
|
1530
1538
|
style: { display: "block" },
|
|
1531
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1532
|
-
d:
|
|
1539
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), yt[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1540
|
+
d: yt[e.icon],
|
|
1533
1541
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1534
1542
|
fill: "none",
|
|
1535
1543
|
stroke: "#fff",
|
|
@@ -1565,7 +1573,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1565
1573
|
})
|
|
1566
1574
|
]
|
|
1567
1575
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1568
|
-
href:
|
|
1576
|
+
href: _t(x.lat, x.lng, C),
|
|
1569
1577
|
target: "_blank",
|
|
1570
1578
|
rel: "noopener noreferrer",
|
|
1571
1579
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1579,7 +1587,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1579
1587
|
}) : null]
|
|
1580
1588
|
});
|
|
1581
1589
|
}
|
|
1582
|
-
var
|
|
1590
|
+
var yt = {
|
|
1583
1591
|
check: "M4 12l5 5L20 6",
|
|
1584
1592
|
close: "M6 6l12 12M18 6L6 18",
|
|
1585
1593
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1676,8 +1684,8 @@ var vt = {
|
|
|
1676
1684
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1677
1685
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1678
1686
|
};
|
|
1679
|
-
function
|
|
1680
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1687
|
+
function bt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
|
|
1688
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [yt[e] ?? yt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1681
1689
|
viewBox: "0 0 24 24",
|
|
1682
1690
|
width: g,
|
|
1683
1691
|
height: g,
|
|
@@ -1713,10 +1721,10 @@ function yt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1713
1721
|
children: v
|
|
1714
1722
|
});
|
|
1715
1723
|
}
|
|
1716
|
-
function
|
|
1717
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1724
|
+
function xt(e, t = {}, n = 0) {
|
|
1725
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : we(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1718
1726
|
for (let e of r) {
|
|
1719
|
-
let n = e.data ?? e, r =
|
|
1727
|
+
let n = e.data ?? e, r = X(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(X(n, t.nameField)) : i(n.name), l = t.hrefField ? i(X(n, t.hrefField)) : "";
|
|
1720
1728
|
for (let e of s) if (o.push({
|
|
1721
1729
|
src: e,
|
|
1722
1730
|
name: c,
|
|
@@ -1726,8 +1734,8 @@ function bt(e, t = {}, n = 0) {
|
|
|
1726
1734
|
}
|
|
1727
1735
|
return o;
|
|
1728
1736
|
}
|
|
1729
|
-
function
|
|
1730
|
-
let { tenant: x, apiUrl: S } = i(
|
|
1737
|
+
function St({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1738
|
+
let { tenant: x, apiUrl: S } = i(J), C = i(ye)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1731
1739
|
a(() => {
|
|
1732
1740
|
if (!t || C) return;
|
|
1733
1741
|
let e = !0;
|
|
@@ -1744,7 +1752,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1744
1752
|
C
|
|
1745
1753
|
]);
|
|
1746
1754
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
|
|
1747
|
-
let e =
|
|
1755
|
+
let e = xt(k, {
|
|
1748
1756
|
imageField: r,
|
|
1749
1757
|
nameField: o,
|
|
1750
1758
|
hrefField: s
|
|
@@ -1758,7 +1766,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1758
1766
|
};
|
|
1759
1767
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1760
1768
|
}, [B, N.length]);
|
|
1761
|
-
let
|
|
1769
|
+
let ee = (e) => {
|
|
1762
1770
|
if (typeof e.name == "string" && e.name.trim()) return e.name;
|
|
1763
1771
|
if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
|
|
1764
1772
|
try {
|
|
@@ -1794,7 +1802,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1794
1802
|
display: "block",
|
|
1795
1803
|
borderRadius: "inherit"
|
|
1796
1804
|
}
|
|
1797
|
-
}), g &&
|
|
1805
|
+
}), g && ee(e) && /* @__PURE__ */ d("span", {
|
|
1798
1806
|
style: {
|
|
1799
1807
|
position: "absolute",
|
|
1800
1808
|
insetInline: 0,
|
|
@@ -1808,7 +1816,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1808
1816
|
overflow: "hidden",
|
|
1809
1817
|
textOverflow: "ellipsis"
|
|
1810
1818
|
},
|
|
1811
|
-
children:
|
|
1819
|
+
children: ee(e)
|
|
1812
1820
|
})]
|
|
1813
1821
|
}), i = e.href ? /* @__PURE__ */ d("a", {
|
|
1814
1822
|
href: e.href,
|
|
@@ -1879,14 +1887,14 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1879
1887
|
boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
|
|
1880
1888
|
}
|
|
1881
1889
|
}),
|
|
1882
|
-
|
|
1890
|
+
ee(N[R]) && /* @__PURE__ */ d("div", {
|
|
1883
1891
|
style: {
|
|
1884
1892
|
color: "#fff",
|
|
1885
1893
|
fontSize: 14,
|
|
1886
1894
|
marginTop: 12,
|
|
1887
1895
|
opacity: .85
|
|
1888
1896
|
},
|
|
1889
|
-
children:
|
|
1897
|
+
children: ee(N[R])
|
|
1890
1898
|
}),
|
|
1891
1899
|
/* @__PURE__ */ d("button", {
|
|
1892
1900
|
type: "button",
|
|
@@ -1949,20 +1957,20 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1949
1957
|
]
|
|
1950
1958
|
});
|
|
1951
1959
|
}
|
|
1952
|
-
var
|
|
1960
|
+
var Ct = {
|
|
1953
1961
|
color: "inherit",
|
|
1954
1962
|
textDecoration: "none",
|
|
1955
1963
|
fontSize: 14,
|
|
1956
1964
|
opacity: .85
|
|
1957
|
-
},
|
|
1965
|
+
}, wt = {
|
|
1958
1966
|
background: "var(--page-surface, #f2f2f2)",
|
|
1959
1967
|
color: "var(--page-text, #111827)",
|
|
1960
1968
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1961
1969
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1962
1970
|
zIndex: 60
|
|
1963
1971
|
};
|
|
1964
|
-
function
|
|
1965
|
-
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 ? "" :
|
|
1972
|
+
function Tt(e, t = {}, n = "dropdown") {
|
|
1973
|
+
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 ? "" : we(e), o = r.map((e) => {
|
|
1966
1974
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1967
1975
|
return {
|
|
1968
1976
|
key: e.id,
|
|
@@ -2003,8 +2011,8 @@ function wt(e, t = {}, n = "dropdown") {
|
|
|
2003
2011
|
type: e.children.length ? n : "link"
|
|
2004
2012
|
}));
|
|
2005
2013
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
2014
|
+
function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2015
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(J), N = i(ye)?.[g], [F, I] = l(null);
|
|
2008
2016
|
a(() => {
|
|
2009
2017
|
if (!g || N) return;
|
|
2010
2018
|
let e = !0;
|
|
@@ -2024,7 +2032,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2024
2032
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2025
2033
|
return e.observe(C), () => e.disconnect();
|
|
2026
2034
|
}, [C, h]);
|
|
2027
|
-
let L = g ?
|
|
2035
|
+
let L = g ? Tt(N ?? F ?? [], {
|
|
2028
2036
|
labelField: _,
|
|
2029
2037
|
hrefField: v,
|
|
2030
2038
|
imageField: y,
|
|
@@ -2053,7 +2061,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2053
2061
|
return /* @__PURE__ */ f("a", {
|
|
2054
2062
|
href: e.href || "#",
|
|
2055
2063
|
style: {
|
|
2056
|
-
...
|
|
2064
|
+
...Ct,
|
|
2057
2065
|
display: n ? "block" : "flex",
|
|
2058
2066
|
alignItems: n ? void 0 : "center",
|
|
2059
2067
|
gap: n ? void 0 : 10,
|
|
@@ -2150,7 +2158,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2150
2158
|
let t = e.children ?? [];
|
|
2151
2159
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2152
2160
|
href: e.href || "#",
|
|
2153
|
-
style:
|
|
2161
|
+
style: Ct,
|
|
2154
2162
|
children: e.label
|
|
2155
2163
|
}, e.key);
|
|
2156
2164
|
let n = e.type === "mega";
|
|
@@ -2164,7 +2172,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2164
2172
|
children: [/* @__PURE__ */ f("a", {
|
|
2165
2173
|
href: e.href || "#",
|
|
2166
2174
|
style: {
|
|
2167
|
-
...
|
|
2175
|
+
...Ct,
|
|
2168
2176
|
cursor: "pointer"
|
|
2169
2177
|
},
|
|
2170
2178
|
children: [
|
|
@@ -2180,7 +2188,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2180
2188
|
]
|
|
2181
2189
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2182
2190
|
style: {
|
|
2183
|
-
...
|
|
2191
|
+
...wt,
|
|
2184
2192
|
position: "absolute",
|
|
2185
2193
|
left: 0,
|
|
2186
2194
|
right: 0,
|
|
@@ -2196,7 +2204,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2196
2204
|
}, !0))
|
|
2197
2205
|
}) : /* @__PURE__ */ d("div", {
|
|
2198
2206
|
style: {
|
|
2199
|
-
...
|
|
2207
|
+
...wt,
|
|
2200
2208
|
position: "absolute",
|
|
2201
2209
|
top: "100%",
|
|
2202
2210
|
left: 0,
|
|
@@ -2225,7 +2233,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2225
2233
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2226
2234
|
href: e.href || "#",
|
|
2227
2235
|
style: {
|
|
2228
|
-
...
|
|
2236
|
+
...Ct,
|
|
2229
2237
|
padding: "10px 4px",
|
|
2230
2238
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2231
2239
|
opacity: 1
|
|
@@ -2236,7 +2244,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2236
2244
|
]
|
|
2237
2245
|
});
|
|
2238
2246
|
}
|
|
2239
|
-
function
|
|
2247
|
+
function Dt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2240
2248
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2241
2249
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2242
2250
|
ref: r,
|
|
@@ -2276,13 +2284,13 @@ function Et({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2276
2284
|
}, e.key))]
|
|
2277
2285
|
}) : null;
|
|
2278
2286
|
}
|
|
2279
|
-
function
|
|
2287
|
+
function Ot({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
|
|
2280
2288
|
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2281
2289
|
if (!e.length) return null;
|
|
2282
2290
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2283
2291
|
let n = Number(e);
|
|
2284
2292
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2285
|
-
}, b =
|
|
2293
|
+
}, b = yt[r], x = (e) => _((t) => {
|
|
2286
2294
|
let r = new Set(n ? t : []);
|
|
2287
2295
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2288
2296
|
});
|
|
@@ -2357,15 +2365,15 @@ function Dt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2357
2365
|
})
|
|
2358
2366
|
});
|
|
2359
2367
|
}
|
|
2360
|
-
var
|
|
2368
|
+
var kt = {
|
|
2361
2369
|
display: "flex",
|
|
2362
2370
|
flexDirection: "column",
|
|
2363
2371
|
gap: "12px"
|
|
2364
|
-
},
|
|
2372
|
+
}, At = {
|
|
2365
2373
|
fontSize: "14px",
|
|
2366
2374
|
fontWeight: 500,
|
|
2367
2375
|
color: "var(--page-text, #111827)"
|
|
2368
|
-
},
|
|
2376
|
+
}, jt = {
|
|
2369
2377
|
padding: "10px 12px",
|
|
2370
2378
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2371
2379
|
borderRadius: "6px",
|
|
@@ -2375,18 +2383,18 @@ var Ot = {
|
|
|
2375
2383
|
boxSizing: "border-box",
|
|
2376
2384
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2377
2385
|
color: "var(--page-text, #111827)"
|
|
2378
|
-
},
|
|
2386
|
+
}, Mt = {
|
|
2379
2387
|
display: "flex",
|
|
2380
2388
|
alignItems: "center",
|
|
2381
2389
|
gap: "8px",
|
|
2382
2390
|
fontSize: "14px",
|
|
2383
2391
|
color: "var(--page-text, #111827)"
|
|
2384
|
-
},
|
|
2392
|
+
}, Nt = (e) => e ? {
|
|
2385
2393
|
readOnly: !0,
|
|
2386
2394
|
tabIndex: -1,
|
|
2387
2395
|
onMouseDown: (e) => e.preventDefault()
|
|
2388
2396
|
} : {};
|
|
2389
|
-
function
|
|
2397
|
+
function Pt(e, t) {
|
|
2390
2398
|
if (!e) return !0;
|
|
2391
2399
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2392
2400
|
switch (e.op) {
|
|
@@ -2400,11 +2408,11 @@ function Nt(e, t) {
|
|
|
2400
2408
|
default: return !1;
|
|
2401
2409
|
}
|
|
2402
2410
|
}
|
|
2403
|
-
var
|
|
2411
|
+
var Ft = {
|
|
2404
2412
|
display: "flex",
|
|
2405
2413
|
flexDirection: "column",
|
|
2406
2414
|
gap: 6
|
|
2407
|
-
},
|
|
2415
|
+
}, It = {
|
|
2408
2416
|
font: "inherit",
|
|
2409
2417
|
fontSize: 15,
|
|
2410
2418
|
padding: "10px 12px",
|
|
@@ -2415,17 +2423,17 @@ var Pt = {
|
|
|
2415
2423
|
width: "100%",
|
|
2416
2424
|
boxSizing: "border-box"
|
|
2417
2425
|
};
|
|
2418
|
-
function
|
|
2426
|
+
function Lt(e, t) {
|
|
2419
2427
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2420
2428
|
if (!e?.parentField) return n;
|
|
2421
2429
|
let r = t?.[e.parentField];
|
|
2422
2430
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2423
2431
|
}
|
|
2424
|
-
var
|
|
2425
|
-
function
|
|
2432
|
+
var Rt = "g-recaptcha-response", zt = (e) => e?.type === "recaptcha" ? Rt : e?.name;
|
|
2433
|
+
function Bt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2426
2434
|
let a = /* @__PURE__ */ f("span", {
|
|
2427
2435
|
style: {
|
|
2428
|
-
...
|
|
2436
|
+
...At,
|
|
2429
2437
|
fontSize: 14
|
|
2430
2438
|
},
|
|
2431
2439
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2434,7 +2442,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2434
2442
|
required: e.required || void 0,
|
|
2435
2443
|
placeholder: e.placeholder || void 0,
|
|
2436
2444
|
disabled: r || void 0,
|
|
2437
|
-
style:
|
|
2445
|
+
style: It,
|
|
2438
2446
|
value: t ?? "",
|
|
2439
2447
|
onChange: (t) => n(e.name, t.target.value)
|
|
2440
2448
|
};
|
|
@@ -2463,11 +2471,11 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2463
2471
|
borderRadius: 8,
|
|
2464
2472
|
display: "block"
|
|
2465
2473
|
}
|
|
2466
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2474
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Gt, {
|
|
2467
2475
|
theme: e.captchaTheme,
|
|
2468
2476
|
size: e.captchaSize,
|
|
2469
2477
|
inert: r,
|
|
2470
|
-
onChange: (e) => n(
|
|
2478
|
+
onChange: (e) => n(Rt, e)
|
|
2471
2479
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(et, {
|
|
2472
2480
|
url: e.src,
|
|
2473
2481
|
style: { width: "100%" }
|
|
@@ -2480,14 +2488,14 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2480
2488
|
display: "block"
|
|
2481
2489
|
}
|
|
2482
2490
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2483
|
-
style:
|
|
2491
|
+
style: Ft,
|
|
2484
2492
|
children: [
|
|
2485
2493
|
a,
|
|
2486
2494
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2487
2495
|
...o,
|
|
2488
2496
|
rows: 4,
|
|
2489
2497
|
style: {
|
|
2490
|
-
...
|
|
2498
|
+
...It,
|
|
2491
2499
|
resize: "vertical"
|
|
2492
2500
|
}
|
|
2493
2501
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2496,7 +2504,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2496
2504
|
children: [/* @__PURE__ */ d("option", {
|
|
2497
2505
|
value: "",
|
|
2498
2506
|
children: e.placeholder || "—"
|
|
2499
|
-
}),
|
|
2507
|
+
}), Lt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2500
2508
|
value: typeof e == "string" ? e : e.value,
|
|
2501
2509
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2502
2510
|
}, t))]
|
|
@@ -2543,8 +2551,8 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2543
2551
|
]
|
|
2544
2552
|
});
|
|
2545
2553
|
}
|
|
2546
|
-
function
|
|
2547
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2554
|
+
function Vt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2555
|
+
let { tenant: y, apiUrl: b } = i(J), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2548
2556
|
a(() => {
|
|
2549
2557
|
if (!c || !s) return;
|
|
2550
2558
|
let e = !0;
|
|
@@ -2565,11 +2573,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2565
2573
|
section: e,
|
|
2566
2574
|
fields: []
|
|
2567
2575
|
}) : A[A.length - 1].fields.push(e);
|
|
2568
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
2576
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Pt(e.section.condition, T)).map((e) => ({
|
|
2569
2577
|
...e,
|
|
2570
|
-
fields: e.fields.filter((e) =>
|
|
2578
|
+
fields: e.fields.filter((e) => Pt(e.condition, T))
|
|
2571
2579
|
})), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2572
|
-
let t = T[
|
|
2580
|
+
let t = T[zt(e)];
|
|
2573
2581
|
return e.required && (t == null || t === "" || t === !1);
|
|
2574
2582
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2575
2583
|
let r = {
|
|
@@ -2625,11 +2633,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2625
2633
|
}
|
|
2626
2634
|
},
|
|
2627
2635
|
style: {
|
|
2628
|
-
...
|
|
2636
|
+
...kt,
|
|
2629
2637
|
display: k === "success" ? "none" : "flex"
|
|
2630
2638
|
},
|
|
2631
2639
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2632
|
-
N && /* @__PURE__ */ d(
|
|
2640
|
+
N && /* @__PURE__ */ d(gn, {
|
|
2633
2641
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2634
2642
|
active: F + 1,
|
|
2635
2643
|
style: { marginBottom: 8 }
|
|
@@ -2642,9 +2650,9 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2642
2650
|
},
|
|
2643
2651
|
children: M[F].section.help
|
|
2644
2652
|
}),
|
|
2645
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
2653
|
+
I.map((e) => /* @__PURE__ */ d(Bt, {
|
|
2646
2654
|
field: e,
|
|
2647
|
-
value: T[
|
|
2655
|
+
value: T[zt(e)],
|
|
2648
2656
|
values: T,
|
|
2649
2657
|
onChange: z,
|
|
2650
2658
|
inert: h
|
|
@@ -2715,10 +2723,10 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2715
2723
|
]
|
|
2716
2724
|
});
|
|
2717
2725
|
}
|
|
2718
|
-
var
|
|
2726
|
+
var Ht = null, Ut = null, Wt = (e) => {
|
|
2719
2727
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2720
|
-
if (
|
|
2721
|
-
if (
|
|
2728
|
+
if (Ht && Ut === t) return Ht;
|
|
2729
|
+
if (Ht && typeof window < "u") {
|
|
2722
2730
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2723
2731
|
delete window[e];
|
|
2724
2732
|
} catch {
|
|
@@ -2726,22 +2734,22 @@ var Vt = null, Ht = null, Ut = (e) => {
|
|
|
2726
2734
|
}
|
|
2727
2735
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2728
2736
|
}
|
|
2729
|
-
return
|
|
2737
|
+
return Ut = t, Ht = new Promise((e) => {
|
|
2730
2738
|
if (typeof window > "u") return;
|
|
2731
2739
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2732
2740
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2733
2741
|
let n = document.createElement("script");
|
|
2734
2742
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2735
|
-
}),
|
|
2743
|
+
}), Ht;
|
|
2736
2744
|
};
|
|
2737
|
-
function
|
|
2738
|
-
let p = i(
|
|
2745
|
+
function Gt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2746
|
+
let p = i(J), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2739
2747
|
if (_.current = u, a(() => {
|
|
2740
2748
|
if (l || !h || !g.current) return;
|
|
2741
2749
|
let e = !0, i = (t) => {
|
|
2742
2750
|
e && typeof _.current == "function" && _.current(t);
|
|
2743
2751
|
};
|
|
2744
|
-
return
|
|
2752
|
+
return Wt(r).then((r) => {
|
|
2745
2753
|
if (!(!e || !g.current || !r?.render)) {
|
|
2746
2754
|
g.current.innerHTML = "", i("");
|
|
2747
2755
|
try {
|
|
@@ -2823,17 +2831,17 @@ function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2823
2831
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2824
2832
|
}) : null;
|
|
2825
2833
|
}
|
|
2826
|
-
function
|
|
2834
|
+
function Kt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2827
2835
|
return /* @__PURE__ */ d("label", {
|
|
2828
2836
|
ref: r,
|
|
2829
2837
|
style: {
|
|
2830
|
-
...
|
|
2838
|
+
...At,
|
|
2831
2839
|
...P(n)
|
|
2832
2840
|
},
|
|
2833
2841
|
children: Re(t, e, i)
|
|
2834
2842
|
});
|
|
2835
2843
|
}
|
|
2836
|
-
function
|
|
2844
|
+
function qt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2837
2845
|
return /* @__PURE__ */ d("input", {
|
|
2838
2846
|
ref: a,
|
|
2839
2847
|
type: e,
|
|
@@ -2841,13 +2849,13 @@ function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2841
2849
|
placeholder: n,
|
|
2842
2850
|
required: !o && !!r,
|
|
2843
2851
|
style: {
|
|
2844
|
-
...
|
|
2852
|
+
...jt,
|
|
2845
2853
|
...P(i)
|
|
2846
2854
|
},
|
|
2847
|
-
...
|
|
2855
|
+
...Nt(o)
|
|
2848
2856
|
});
|
|
2849
2857
|
}
|
|
2850
|
-
function
|
|
2858
|
+
function Jt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2851
2859
|
return /* @__PURE__ */ d("textarea", {
|
|
2852
2860
|
ref: a,
|
|
2853
2861
|
name: e || void 0,
|
|
@@ -2855,18 +2863,18 @@ function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2855
2863
|
rows: n,
|
|
2856
2864
|
required: !o && !!r,
|
|
2857
2865
|
style: {
|
|
2858
|
-
...
|
|
2866
|
+
...jt,
|
|
2859
2867
|
resize: "vertical",
|
|
2860
2868
|
...P(i)
|
|
2861
2869
|
},
|
|
2862
|
-
...
|
|
2870
|
+
...Nt(o)
|
|
2863
2871
|
});
|
|
2864
2872
|
}
|
|
2865
|
-
function
|
|
2873
|
+
function Yt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2866
2874
|
return /* @__PURE__ */ f("label", {
|
|
2867
2875
|
ref: o,
|
|
2868
2876
|
style: {
|
|
2869
|
-
...
|
|
2877
|
+
...Mt,
|
|
2870
2878
|
...P(a)
|
|
2871
2879
|
},
|
|
2872
2880
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2883,7 +2891,7 @@ function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2883
2891
|
}), t]
|
|
2884
2892
|
});
|
|
2885
2893
|
}
|
|
2886
|
-
function
|
|
2894
|
+
function Xt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2887
2895
|
return /* @__PURE__ */ f("select", {
|
|
2888
2896
|
ref: a,
|
|
2889
2897
|
name: e || void 0,
|
|
@@ -2892,7 +2900,7 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2892
2900
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2893
2901
|
tabIndex: o ? -1 : void 0,
|
|
2894
2902
|
style: {
|
|
2895
|
-
...
|
|
2903
|
+
...jt,
|
|
2896
2904
|
appearance: "auto",
|
|
2897
2905
|
...P(i)
|
|
2898
2906
|
},
|
|
@@ -2906,12 +2914,12 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2906
2914
|
}, t))]
|
|
2907
2915
|
});
|
|
2908
2916
|
}
|
|
2909
|
-
function
|
|
2917
|
+
function Zt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2910
2918
|
let [s, c] = l(null);
|
|
2911
2919
|
return /* @__PURE__ */ f("label", {
|
|
2912
2920
|
ref: a,
|
|
2913
2921
|
style: {
|
|
2914
|
-
...
|
|
2922
|
+
...jt,
|
|
2915
2923
|
display: "flex",
|
|
2916
2924
|
alignItems: "center",
|
|
2917
2925
|
gap: "8px",
|
|
@@ -2938,7 +2946,7 @@ function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2938
2946
|
]
|
|
2939
2947
|
});
|
|
2940
2948
|
}
|
|
2941
|
-
function
|
|
2949
|
+
function Qt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2942
2950
|
return /* @__PURE__ */ d("button", {
|
|
2943
2951
|
ref: n,
|
|
2944
2952
|
type: r ? "button" : "submit",
|
|
@@ -2958,7 +2966,7 @@ function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2958
2966
|
children: e
|
|
2959
2967
|
});
|
|
2960
2968
|
}
|
|
2961
|
-
function
|
|
2969
|
+
function $t({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2962
2970
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2963
2971
|
return /* @__PURE__ */ d("div", {
|
|
2964
2972
|
ref: r,
|
|
@@ -2975,8 +2983,8 @@ function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2975
2983
|
}, t))
|
|
2976
2984
|
});
|
|
2977
2985
|
}
|
|
2978
|
-
function
|
|
2979
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
2986
|
+
function en({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2987
|
+
let { tenant: v, apiUrl: y, locale: b } = i(J), x = i(Ce), S = i(ye), [, C] = l(0);
|
|
2980
2988
|
a(() => {
|
|
2981
2989
|
if (typeof window > "u") return;
|
|
2982
2990
|
let e = () => C((e) => e + 1);
|
|
@@ -3029,7 +3037,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3029
3037
|
},
|
|
3030
3038
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
3031
3039
|
style: { minWidth: 0 },
|
|
3032
|
-
children: x.render(p, (t) =>
|
|
3040
|
+
children: x.render(p, (t) => Q(t, e))
|
|
3033
3041
|
}, e.id ?? e?.data?.slug))
|
|
3034
3042
|
}) : /* @__PURE__ */ d("div", {
|
|
3035
3043
|
ref: _,
|
|
@@ -3039,7 +3047,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3039
3047
|
...P(g)
|
|
3040
3048
|
},
|
|
3041
3049
|
children: M.map((e) => {
|
|
3042
|
-
let t = o ?
|
|
3050
|
+
let t = o ? X(e?.data, o) : null, r = s ? we(X(e?.data, s)) : null, i = c ? X(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : we(i), u = n === "list";
|
|
3043
3051
|
return /* @__PURE__ */ f("div", {
|
|
3044
3052
|
style: {
|
|
3045
3053
|
display: "flex",
|
|
@@ -3094,7 +3102,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3094
3102
|
})
|
|
3095
3103
|
});
|
|
3096
3104
|
}
|
|
3097
|
-
function
|
|
3105
|
+
function tn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3098
3106
|
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
|
|
3099
3107
|
height: 34,
|
|
3100
3108
|
padding: "0 12px",
|
|
@@ -3143,7 +3151,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3143
3151
|
name: `f_${e.name}`,
|
|
3144
3152
|
defaultValue: o[e.name] ?? "",
|
|
3145
3153
|
style: s,
|
|
3146
|
-
...
|
|
3154
|
+
...Nt(i),
|
|
3147
3155
|
children: [/* @__PURE__ */ d("option", {
|
|
3148
3156
|
value: "",
|
|
3149
3157
|
children: e.label || e.name
|
|
@@ -3158,7 +3166,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3158
3166
|
name: `f_${e.name}`,
|
|
3159
3167
|
defaultValue: o[e.name] ?? "",
|
|
3160
3168
|
style: s,
|
|
3161
|
-
...
|
|
3169
|
+
...Nt(i),
|
|
3162
3170
|
children: [
|
|
3163
3171
|
/* @__PURE__ */ d("option", {
|
|
3164
3172
|
value: "",
|
|
@@ -3179,7 +3187,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3179
3187
|
defaultValue: o[e.name] ?? "",
|
|
3180
3188
|
placeholder: e.label || e.name,
|
|
3181
3189
|
style: s,
|
|
3182
|
-
...
|
|
3190
|
+
...Nt(i)
|
|
3183
3191
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3184
3192
|
type: "submit",
|
|
3185
3193
|
style: {
|
|
@@ -3192,12 +3200,12 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3192
3200
|
fontWeight: 600,
|
|
3193
3201
|
cursor: i ? "default" : "pointer"
|
|
3194
3202
|
},
|
|
3195
|
-
...
|
|
3203
|
+
...Nt(i),
|
|
3196
3204
|
children: t
|
|
3197
3205
|
})]
|
|
3198
3206
|
});
|
|
3199
3207
|
}
|
|
3200
|
-
function
|
|
3208
|
+
function nn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3201
3209
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3202
3210
|
ref: r,
|
|
3203
3211
|
"aria-label": "Breadcrumb",
|
|
@@ -3247,8 +3255,8 @@ function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3247
3255
|
})
|
|
3248
3256
|
}) : null;
|
|
3249
3257
|
}
|
|
3250
|
-
function
|
|
3251
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3258
|
+
function rn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
3259
|
+
let { tenant: g, apiUrl: _ } = i(J), v = i(ye), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3252
3260
|
a(() => {
|
|
3253
3261
|
if (!o || Number.isFinite(x)) return;
|
|
3254
3262
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3332,15 +3340,15 @@ function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3332
3340
|
]
|
|
3333
3341
|
});
|
|
3334
3342
|
}
|
|
3335
|
-
var
|
|
3343
|
+
var an = "webim.page_mode", on = () => {
|
|
3336
3344
|
if (typeof window > "u") return "auto";
|
|
3337
3345
|
try {
|
|
3338
|
-
let e = window.localStorage.getItem(
|
|
3346
|
+
let e = window.localStorage.getItem(an);
|
|
3339
3347
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3340
3348
|
} catch {
|
|
3341
3349
|
return "auto";
|
|
3342
3350
|
}
|
|
3343
|
-
},
|
|
3351
|
+
}, sn = (e) => {
|
|
3344
3352
|
let t = {
|
|
3345
3353
|
width: 16,
|
|
3346
3354
|
height: 16,
|
|
@@ -3372,13 +3380,13 @@ var rn = "webim.page_mode", an = () => {
|
|
|
3372
3380
|
rx: "2"
|
|
3373
3381
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3374
3382
|
});
|
|
3375
|
-
},
|
|
3383
|
+
}, cn = {
|
|
3376
3384
|
light: "Light theme",
|
|
3377
3385
|
dark: "Dark theme",
|
|
3378
3386
|
auto: "Follow the device theme"
|
|
3379
3387
|
};
|
|
3380
|
-
function
|
|
3381
|
-
let [o, s] = l(i ? "auto" :
|
|
3388
|
+
function ln({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3389
|
+
let [o, s] = l(i ? "auto" : on), u = c(null), f = (e) => {
|
|
3382
3390
|
u.current = e, typeof r == "function" && r(e);
|
|
3383
3391
|
};
|
|
3384
3392
|
a(() => {
|
|
@@ -3386,7 +3394,7 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3386
3394
|
let e = u.current?.closest?.(".webim-page");
|
|
3387
3395
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3388
3396
|
try {
|
|
3389
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3397
|
+
o === "auto" ? window.localStorage.removeItem(an) : window.localStorage.setItem(an, o);
|
|
3390
3398
|
} catch {}
|
|
3391
3399
|
}, [o, i]);
|
|
3392
3400
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3421,8 +3429,8 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3421
3429
|
},
|
|
3422
3430
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3423
3431
|
type: "button",
|
|
3424
|
-
title:
|
|
3425
|
-
"aria-label":
|
|
3432
|
+
title: cn[e],
|
|
3433
|
+
"aria-label": cn[e],
|
|
3426
3434
|
"aria-pressed": e === m,
|
|
3427
3435
|
onClick: i ? void 0 : () => s(e),
|
|
3428
3436
|
style: {
|
|
@@ -3433,15 +3441,15 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3433
3441
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3434
3442
|
opacity: e === m ? 1 : .7
|
|
3435
3443
|
},
|
|
3436
|
-
children:
|
|
3444
|
+
children: sn(e)
|
|
3437
3445
|
}, e))
|
|
3438
3446
|
});
|
|
3439
3447
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3440
3448
|
return /* @__PURE__ */ d("button", {
|
|
3441
3449
|
ref: f,
|
|
3442
3450
|
type: "button",
|
|
3443
|
-
title:
|
|
3444
|
-
"aria-label": `Theme: ${
|
|
3451
|
+
title: cn[m],
|
|
3452
|
+
"aria-label": `Theme: ${cn[m]} — switch to ${cn[g]}`,
|
|
3445
3453
|
onClick: i ? void 0 : () => s(g),
|
|
3446
3454
|
style: {
|
|
3447
3455
|
...h,
|
|
@@ -3450,10 +3458,10 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3450
3458
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3451
3459
|
...P(n)
|
|
3452
3460
|
},
|
|
3453
|
-
children:
|
|
3461
|
+
children: sn(m)
|
|
3454
3462
|
});
|
|
3455
3463
|
}
|
|
3456
|
-
function
|
|
3464
|
+
function un(e) {
|
|
3457
3465
|
let t = e?.parentElement;
|
|
3458
3466
|
for (; t && t !== document.body;) {
|
|
3459
3467
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3462,7 +3470,7 @@ function ln(e) {
|
|
|
3462
3470
|
}
|
|
3463
3471
|
return window;
|
|
3464
3472
|
}
|
|
3465
|
-
var
|
|
3473
|
+
var dn = (e) => e === window ? window.scrollY : e.scrollTop, fn = {
|
|
3466
3474
|
"bottom-right": (e) => ({
|
|
3467
3475
|
right: e,
|
|
3468
3476
|
bottom: e
|
|
@@ -3477,7 +3485,7 @@ var un = (e) => e === window ? window.scrollY : e.scrollTop, dn = {
|
|
|
3477
3485
|
transform: "translateX(-50%)"
|
|
3478
3486
|
})
|
|
3479
3487
|
};
|
|
3480
|
-
function
|
|
3488
|
+
function pn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3481
3489
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3482
3490
|
b(e), typeof p == "function" && p(e);
|
|
3483
3491
|
};
|
|
@@ -3488,8 +3496,8 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3488
3496
|
}
|
|
3489
3497
|
if (!y) return;
|
|
3490
3498
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3491
|
-
let t =
|
|
3492
|
-
v(n ||
|
|
3499
|
+
let t = un(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3500
|
+
v(n || dn(t) > e);
|
|
3493
3501
|
};
|
|
3494
3502
|
return t(), document.addEventListener("scroll", t, {
|
|
3495
3503
|
capture: !0,
|
|
@@ -3503,7 +3511,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3503
3511
|
]);
|
|
3504
3512
|
let S = () => {
|
|
3505
3513
|
if (m) return;
|
|
3506
|
-
let e =
|
|
3514
|
+
let e = un(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3507
3515
|
e === window ? window.scrollTo({
|
|
3508
3516
|
top: 0,
|
|
3509
3517
|
behavior: n
|
|
@@ -3511,7 +3519,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3511
3519
|
top: 0,
|
|
3512
3520
|
behavior: n
|
|
3513
3521
|
});
|
|
3514
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3522
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = fn[n] ? n : "bottom-right", D = h ? {
|
|
3515
3523
|
position: "fixed",
|
|
3516
3524
|
zIndex: 5,
|
|
3517
3525
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3524,7 +3532,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3524
3532
|
} : {
|
|
3525
3533
|
position: "fixed",
|
|
3526
3534
|
zIndex: 2147482e3,
|
|
3527
|
-
...
|
|
3535
|
+
...fn[E](C)
|
|
3528
3536
|
};
|
|
3529
3537
|
return /* @__PURE__ */ f("button", {
|
|
3530
3538
|
ref: x,
|
|
@@ -3575,7 +3583,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3575
3583
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3576
3584
|
});
|
|
3577
3585
|
}
|
|
3578
|
-
var
|
|
3586
|
+
var mn = {
|
|
3579
3587
|
facebook: {
|
|
3580
3588
|
label: "Facebook",
|
|
3581
3589
|
color: "#1877f2",
|
|
@@ -3642,8 +3650,8 @@ var pn = {
|
|
|
3642
3650
|
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"
|
|
3643
3651
|
}
|
|
3644
3652
|
};
|
|
3645
|
-
function
|
|
3646
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3653
|
+
function hn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3654
|
+
let l = Array.isArray(e) ? e.filter((e) => e && mn[e.network]) : [];
|
|
3647
3655
|
if (!l.length) return null;
|
|
3648
3656
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 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;
|
|
3649
3657
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3656,7 +3664,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3656
3664
|
...P(o)
|
|
3657
3665
|
},
|
|
3658
3666
|
children: l.map((e, r) => {
|
|
3659
|
-
let i =
|
|
3667
|
+
let i = mn[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);
|
|
3660
3668
|
return /* @__PURE__ */ d("a", {
|
|
3661
3669
|
href: e.url || "#",
|
|
3662
3670
|
onClick: h,
|
|
@@ -3690,7 +3698,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3690
3698
|
})
|
|
3691
3699
|
});
|
|
3692
3700
|
}
|
|
3693
|
-
function
|
|
3701
|
+
function gn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3694
3702
|
if (!e.length) return null;
|
|
3695
3703
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3696
3704
|
width: 32,
|
|
@@ -3768,7 +3776,7 @@ function hn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3768
3776
|
})
|
|
3769
3777
|
});
|
|
3770
3778
|
}
|
|
3771
|
-
var
|
|
3779
|
+
var _n = {
|
|
3772
3780
|
small: {
|
|
3773
3781
|
w: 132,
|
|
3774
3782
|
h: 46,
|
|
@@ -3790,74 +3798,123 @@ var gn = {
|
|
|
3790
3798
|
title: 12.5,
|
|
3791
3799
|
avatar: 46
|
|
3792
3800
|
}
|
|
3793
|
-
},
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
let
|
|
3797
|
-
|
|
3798
|
-
|
|
3801
|
+
}, vn = (e) => _n[e] ?? _n.medium;
|
|
3802
|
+
_n.medium.w, _n.medium.h;
|
|
3803
|
+
var yn = (e) => String(e?.group ?? "").trim(), bn = (e) => {
|
|
3804
|
+
let t = [], n = /* @__PURE__ */ new Map();
|
|
3805
|
+
return e.forEach((e, r) => {
|
|
3806
|
+
let i = yn(e) || `#${r}`;
|
|
3807
|
+
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3808
|
+
}), t.flatMap((e) => n.get(e));
|
|
3809
|
+
};
|
|
3810
|
+
function xn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3811
|
+
let i = vn(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
|
|
3812
|
+
for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
|
|
3813
|
+
d = bn(d);
|
|
3814
|
+
for (let [e, t] of u) u.set(e, bn(t));
|
|
3815
|
+
let f = (e, t) => o + (yn(e) !== yn(t) && (yn(e) || yn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3799
3816
|
if (t.has(e.id)) return 0;
|
|
3800
3817
|
t.add(e.id);
|
|
3801
|
-
let n =
|
|
3802
|
-
return
|
|
3818
|
+
let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
|
|
3819
|
+
return p.set(e.id, i), i;
|
|
3803
3820
|
};
|
|
3804
|
-
|
|
3805
|
-
let
|
|
3806
|
-
if (
|
|
3807
|
-
|
|
3808
|
-
let
|
|
3809
|
-
|
|
3821
|
+
d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
|
|
3822
|
+
let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
|
|
3823
|
+
if (o.has(e.id)) return;
|
|
3824
|
+
o.add(e.id);
|
|
3825
|
+
let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
|
|
3826
|
+
h.push({
|
|
3810
3827
|
node: e,
|
|
3811
|
-
x:
|
|
3812
|
-
y:
|
|
3813
|
-
})
|
|
3814
|
-
let
|
|
3815
|
-
|
|
3816
|
-
let
|
|
3817
|
-
|
|
3828
|
+
x: m,
|
|
3829
|
+
y: b
|
|
3830
|
+
});
|
|
3831
|
+
let x = yn(e);
|
|
3832
|
+
if (x) {
|
|
3833
|
+
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3834
|
+
_.has(t) || _.set(t, {
|
|
3835
|
+
title: x,
|
|
3836
|
+
color: "",
|
|
3837
|
+
members: []
|
|
3838
|
+
});
|
|
3839
|
+
let n = _.get(t);
|
|
3840
|
+
!n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
|
|
3841
|
+
x: m,
|
|
3842
|
+
y: b
|
|
3843
|
+
});
|
|
3844
|
+
}
|
|
3845
|
+
v = Math.max(v, d + (n ? i.w : i.h));
|
|
3846
|
+
let S = t, C = u.get(e.id) ?? [];
|
|
3847
|
+
C.forEach((e, t) => {
|
|
3848
|
+
t && (S += f(C[t - 1], e));
|
|
3849
|
+
let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
|
|
3850
|
+
g.push(n ? {
|
|
3818
3851
|
from: {
|
|
3819
|
-
x:
|
|
3820
|
-
y:
|
|
3852
|
+
x: d + i.w,
|
|
3853
|
+
y: c + i.h / 2
|
|
3821
3854
|
},
|
|
3822
3855
|
to: {
|
|
3823
|
-
x:
|
|
3824
|
-
y:
|
|
3856
|
+
x: u,
|
|
3857
|
+
y: l
|
|
3825
3858
|
}
|
|
3826
3859
|
} : {
|
|
3827
3860
|
from: {
|
|
3828
|
-
x:
|
|
3829
|
-
y:
|
|
3861
|
+
x: c + i.w / 2,
|
|
3862
|
+
y: d + i.h
|
|
3830
3863
|
},
|
|
3831
3864
|
to: {
|
|
3832
|
-
x:
|
|
3833
|
-
y:
|
|
3865
|
+
x: l,
|
|
3866
|
+
y: u
|
|
3834
3867
|
}
|
|
3835
|
-
}),
|
|
3836
|
-
}
|
|
3837
|
-
},
|
|
3838
|
-
|
|
3839
|
-
|
|
3868
|
+
}), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
|
|
3869
|
+
});
|
|
3870
|
+
}, b = 0, x = /* @__PURE__ */ new Set();
|
|
3871
|
+
d.forEach((e, t) => {
|
|
3872
|
+
t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
|
|
3873
|
+
});
|
|
3874
|
+
let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
|
|
3875
|
+
let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
|
|
3876
|
+
return {
|
|
3877
|
+
x: t,
|
|
3878
|
+
y: a,
|
|
3879
|
+
width: n - t,
|
|
3880
|
+
height: o - a,
|
|
3881
|
+
title: e.title,
|
|
3882
|
+
color: e.color
|
|
3883
|
+
};
|
|
3884
|
+
}), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
|
|
3885
|
+
if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
|
|
3886
|
+
for (let e of h) e.x += D, e.y += O;
|
|
3887
|
+
for (let e of g) e.from = {
|
|
3888
|
+
x: e.from.x + D,
|
|
3889
|
+
y: e.from.y + O
|
|
3890
|
+
}, e.to = {
|
|
3891
|
+
x: e.to.x + D,
|
|
3892
|
+
y: e.to.y + O
|
|
3893
|
+
};
|
|
3894
|
+
for (let e of w) e.x += D, e.y += O;
|
|
3895
|
+
}
|
|
3840
3896
|
return {
|
|
3841
|
-
boxes:
|
|
3842
|
-
links:
|
|
3843
|
-
|
|
3844
|
-
|
|
3897
|
+
boxes: h,
|
|
3898
|
+
links: g,
|
|
3899
|
+
groups: w,
|
|
3900
|
+
width: T,
|
|
3901
|
+
height: E,
|
|
3845
3902
|
horizontal: n
|
|
3846
3903
|
};
|
|
3847
3904
|
}
|
|
3848
|
-
var
|
|
3905
|
+
var Sn = (e, t) => {
|
|
3849
3906
|
let n = String(e ?? "");
|
|
3850
3907
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3851
|
-
},
|
|
3908
|
+
}, Cn = (e) => {
|
|
3852
3909
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3853
3910
|
if (!t) return "#ffffff";
|
|
3854
3911
|
let n = t[1];
|
|
3855
3912
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3856
3913
|
let r = parseInt(n, 16);
|
|
3857
3914
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3858
|
-
},
|
|
3859
|
-
function
|
|
3860
|
-
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 ? "" :
|
|
3915
|
+
}, wn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3916
|
+
function Tn(e, t = {}) {
|
|
3917
|
+
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 ? "" : we(e);
|
|
3861
3918
|
return n.map((e) => {
|
|
3862
3919
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3863
3920
|
return {
|
|
@@ -3867,15 +3924,16 @@ function Sn(e, t = {}) {
|
|
|
3867
3924
|
photo: t.photoField && r(n[t.photoField]) || "",
|
|
3868
3925
|
parent: t.parentField ? o : null,
|
|
3869
3926
|
cv: t.cvField ? i(n[t.cvField]) : "",
|
|
3870
|
-
href: t.hrefField ? i(n[t.hrefField]) : ""
|
|
3927
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3928
|
+
group: t.groupField ? i(n[t.groupField]) : ""
|
|
3871
3929
|
};
|
|
3872
3930
|
});
|
|
3873
3931
|
}
|
|
3874
|
-
var
|
|
3932
|
+
var En = {
|
|
3875
3933
|
size: 36,
|
|
3876
3934
|
pad: 10
|
|
3877
3935
|
};
|
|
3878
|
-
function
|
|
3936
|
+
function Dn({ node: e, onClose: t }) {
|
|
3879
3937
|
return a(() => {
|
|
3880
3938
|
let e = (e) => e.key === "Escape" && t();
|
|
3881
3939
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3996,36 +4054,38 @@ function wn({ node: e, onClose: t }) {
|
|
|
3996
4054
|
})
|
|
3997
4055
|
});
|
|
3998
4056
|
}
|
|
3999
|
-
function
|
|
4000
|
-
let
|
|
4057
|
+
function On({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4058
|
+
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(J), O = i(ye)?.[t], [k, A] = l(null);
|
|
4001
4059
|
a(() => {
|
|
4002
|
-
if (!t ||
|
|
4060
|
+
if (!t || O) return;
|
|
4003
4061
|
let e = !0;
|
|
4004
|
-
return fetch(`${
|
|
4062
|
+
return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
|
|
4005
4063
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4006
|
-
e &&
|
|
4007
|
-
}).catch(() => e &&
|
|
4064
|
+
e && A(n);
|
|
4065
|
+
}).catch(() => e && A([])), () => {
|
|
4008
4066
|
e = !1;
|
|
4009
4067
|
};
|
|
4010
4068
|
}, [
|
|
4011
4069
|
t,
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4070
|
+
E,
|
|
4071
|
+
D,
|
|
4072
|
+
O
|
|
4015
4073
|
]);
|
|
4016
|
-
let
|
|
4074
|
+
let j = t ? Tn(O ?? k ?? [], {
|
|
4017
4075
|
nameField: n,
|
|
4018
4076
|
titleField: r,
|
|
4019
4077
|
photoField: s,
|
|
4020
4078
|
parentField: c,
|
|
4021
4079
|
cvField: p,
|
|
4022
|
-
hrefField: m
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4080
|
+
hrefField: m,
|
|
4081
|
+
groupField: h
|
|
4082
|
+
}) : e, M = vn(v), { boxes: N, links: F, groups: I, width: L, height: R } = xn(j, {
|
|
4083
|
+
size: v,
|
|
4084
|
+
horizontal: y,
|
|
4085
|
+
groupTitles: g
|
|
4026
4086
|
});
|
|
4027
|
-
if (!
|
|
4028
|
-
ref:
|
|
4087
|
+
if (!N.length) return !S && t ? /* @__PURE__ */ f("div", {
|
|
4088
|
+
ref: x,
|
|
4029
4089
|
style: {
|
|
4030
4090
|
padding: 18,
|
|
4031
4091
|
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
@@ -4033,7 +4093,7 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4033
4093
|
fontSize: 13,
|
|
4034
4094
|
opacity: .7,
|
|
4035
4095
|
textAlign: "center",
|
|
4036
|
-
...P(
|
|
4096
|
+
...P(b)
|
|
4037
4097
|
},
|
|
4038
4098
|
children: [
|
|
4039
4099
|
"Org Chart — no published entries in “",
|
|
@@ -4041,151 +4101,174 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4041
4101
|
"” yet"
|
|
4042
4102
|
]
|
|
4043
4103
|
}) : null;
|
|
4044
|
-
let
|
|
4104
|
+
let z = new Set(N.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
4045
4105
|
return /* @__PURE__ */ f("div", {
|
|
4046
|
-
ref:
|
|
4106
|
+
ref: x,
|
|
4047
4107
|
style: {
|
|
4048
4108
|
maxWidth: "100%",
|
|
4049
4109
|
overflowX: "auto",
|
|
4050
|
-
...P(
|
|
4110
|
+
...P(b)
|
|
4051
4111
|
},
|
|
4052
4112
|
children: [/* @__PURE__ */ f("svg", {
|
|
4053
|
-
viewBox: `0 0 ${
|
|
4113
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
4054
4114
|
role: "img",
|
|
4055
4115
|
"aria-label": "Organization chart",
|
|
4056
4116
|
style: {
|
|
4057
4117
|
display: "block",
|
|
4058
4118
|
width: "100%",
|
|
4059
|
-
maxWidth:
|
|
4119
|
+
maxWidth: L,
|
|
4060
4120
|
height: "auto",
|
|
4061
4121
|
margin: "0 auto"
|
|
4062
4122
|
},
|
|
4063
|
-
children: [
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
children: /* @__PURE__ */
|
|
4123
|
+
children: [
|
|
4124
|
+
I.map((e, t) => {
|
|
4125
|
+
let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
|
|
4126
|
+
return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("rect", {
|
|
4127
|
+
x: e.x,
|
|
4128
|
+
y: e.y,
|
|
4129
|
+
width: e.width,
|
|
4130
|
+
height: e.height,
|
|
4131
|
+
rx: "16",
|
|
4132
|
+
fill: n
|
|
4133
|
+
}), g !== "hidden" && e.title && /* @__PURE__ */ d("text", {
|
|
4134
|
+
x: e.x + e.width / 2,
|
|
4135
|
+
y: g === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
|
|
4136
|
+
textAnchor: "middle",
|
|
4137
|
+
fontSize: M.title + 1,
|
|
4138
|
+
fontWeight: "600",
|
|
4139
|
+
opacity: "0.55",
|
|
4140
|
+
fill: r ? Cn(e.color || _) : "var(--page-text, #111827)",
|
|
4141
|
+
children: Sn(e.title, Math.floor(e.width / 7))
|
|
4142
|
+
})] }, `group-${t}`);
|
|
4143
|
+
}),
|
|
4144
|
+
F.map((e, t) => /* @__PURE__ */ d("path", {
|
|
4145
|
+
d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
|
|
4146
|
+
fill: "none",
|
|
4147
|
+
stroke: "rgba(148, 163, 184, 0.7)",
|
|
4148
|
+
strokeWidth: "1.5"
|
|
4149
|
+
}, t)),
|
|
4150
|
+
N.map(({ node: e, x: t, y: n }) => {
|
|
4151
|
+
let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Cn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Cn(e.color2) : s, l = S && (wn(e) || e.href), p = () => wn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + En.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4152
|
+
return /* @__PURE__ */ f("g", {
|
|
4153
|
+
onClick: l ? p : void 0,
|
|
4154
|
+
style: l ? { cursor: "pointer" } : void 0,
|
|
4155
|
+
role: l ? "button" : void 0,
|
|
4156
|
+
"aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
4157
|
+
children: [
|
|
4158
|
+
i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
|
|
4159
|
+
id: `${C}-${e.id}-grad`,
|
|
4160
|
+
x1: "0",
|
|
4161
|
+
y1: "0",
|
|
4162
|
+
x2: "0",
|
|
4163
|
+
y2: "1",
|
|
4164
|
+
children: [/* @__PURE__ */ d("stop", {
|
|
4165
|
+
offset: "0%",
|
|
4166
|
+
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
4167
|
+
}), /* @__PURE__ */ d("stop", {
|
|
4168
|
+
offset: "100%",
|
|
4169
|
+
stopColor: e.color2
|
|
4170
|
+
})]
|
|
4171
|
+
}), /* @__PURE__ */ d("rect", {
|
|
4099
4172
|
x: t,
|
|
4100
4173
|
y: n,
|
|
4101
|
-
width:
|
|
4102
|
-
height:
|
|
4103
|
-
rx: "10"
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4174
|
+
width: M.w,
|
|
4175
|
+
height: M.h,
|
|
4176
|
+
rx: "10",
|
|
4177
|
+
fill: `url(#${C}-${e.id}-grad)`
|
|
4178
|
+
})] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4179
|
+
id: `${C}-${e.id}-box`,
|
|
4180
|
+
children: /* @__PURE__ */ d("rect", {
|
|
4181
|
+
x: t,
|
|
4182
|
+
y: n,
|
|
4183
|
+
width: M.w,
|
|
4184
|
+
height: M.h,
|
|
4185
|
+
rx: "10"
|
|
4186
|
+
})
|
|
4187
|
+
}), /* @__PURE__ */ f("g", {
|
|
4188
|
+
clipPath: `url(#${C}-${e.id}-box)`,
|
|
4189
|
+
children: [/* @__PURE__ */ d("rect", {
|
|
4190
|
+
x: t,
|
|
4191
|
+
y: n,
|
|
4192
|
+
width: M.w,
|
|
4193
|
+
height: _,
|
|
4194
|
+
fill: o
|
|
4195
|
+
}), /* @__PURE__ */ d("rect", {
|
|
4196
|
+
x: t,
|
|
4197
|
+
y: n + _,
|
|
4198
|
+
width: M.w,
|
|
4199
|
+
height: M.h - _,
|
|
4200
|
+
fill: e.color2
|
|
4201
|
+
})]
|
|
4202
|
+
})] }) : /* @__PURE__ */ d("rect", {
|
|
4108
4203
|
x: t,
|
|
4109
4204
|
y: n,
|
|
4110
|
-
width:
|
|
4111
|
-
height:
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
textAnchor: h,
|
|
4174
|
-
fontSize: k.title,
|
|
4175
|
-
opacity: "0.7",
|
|
4176
|
-
fill: s,
|
|
4177
|
-
children: yn(v[1], g + 4)
|
|
4178
|
-
})] })
|
|
4179
|
-
]
|
|
4180
|
-
}, e.id);
|
|
4181
|
-
})]
|
|
4182
|
-
}), x && /* @__PURE__ */ d(wn, {
|
|
4183
|
-
node: x,
|
|
4184
|
-
onClose: () => S(null)
|
|
4205
|
+
width: M.w,
|
|
4206
|
+
height: M.h,
|
|
4207
|
+
rx: "10",
|
|
4208
|
+
fill: o,
|
|
4209
|
+
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
4210
|
+
strokeWidth: a ? 0 : 1.5
|
|
4211
|
+
}),
|
|
4212
|
+
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4213
|
+
id: `${C}-${e.id}`,
|
|
4214
|
+
children: /* @__PURE__ */ d("circle", {
|
|
4215
|
+
cx: t + En.pad + M.avatar / 2,
|
|
4216
|
+
cy: n + M.h / 2,
|
|
4217
|
+
r: M.avatar / 2
|
|
4218
|
+
})
|
|
4219
|
+
}), /* @__PURE__ */ d("image", {
|
|
4220
|
+
href: e.photo,
|
|
4221
|
+
x: t + En.pad,
|
|
4222
|
+
y: n + (M.h - M.avatar) / 2,
|
|
4223
|
+
width: M.avatar,
|
|
4224
|
+
height: M.avatar,
|
|
4225
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
4226
|
+
clipPath: `url(#${C}-${e.id})`
|
|
4227
|
+
})] }),
|
|
4228
|
+
i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
|
|
4229
|
+
x: m,
|
|
4230
|
+
y: n + _ / 2 + M.title * .35,
|
|
4231
|
+
textAnchor: h,
|
|
4232
|
+
fontSize: M.title,
|
|
4233
|
+
fontWeight: "600",
|
|
4234
|
+
fill: s,
|
|
4235
|
+
children: Sn(e.title, g + 4)
|
|
4236
|
+
}), e.name && /* @__PURE__ */ d("text", {
|
|
4237
|
+
x: m,
|
|
4238
|
+
y: n + _ + _ / 2 + M.name * .35,
|
|
4239
|
+
textAnchor: h,
|
|
4240
|
+
fontSize: M.name,
|
|
4241
|
+
fontWeight: "600",
|
|
4242
|
+
fill: c,
|
|
4243
|
+
children: Sn(e.name, g)
|
|
4244
|
+
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
4245
|
+
x: m,
|
|
4246
|
+
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
4247
|
+
textAnchor: h,
|
|
4248
|
+
fontSize: M.name,
|
|
4249
|
+
fontWeight: "600",
|
|
4250
|
+
fill: s,
|
|
4251
|
+
children: Sn(v[0], g)
|
|
4252
|
+
}), v[1] && /* @__PURE__ */ d("text", {
|
|
4253
|
+
x: m,
|
|
4254
|
+
y: n + M.h * .73,
|
|
4255
|
+
textAnchor: h,
|
|
4256
|
+
fontSize: M.title,
|
|
4257
|
+
opacity: "0.7",
|
|
4258
|
+
fill: s,
|
|
4259
|
+
children: Sn(v[1], g + 4)
|
|
4260
|
+
})] })
|
|
4261
|
+
]
|
|
4262
|
+
}, e.id);
|
|
4263
|
+
})
|
|
4264
|
+
]
|
|
4265
|
+
}), w && /* @__PURE__ */ d(Dn, {
|
|
4266
|
+
node: w,
|
|
4267
|
+
onClose: () => T(null)
|
|
4185
4268
|
})]
|
|
4186
4269
|
});
|
|
4187
4270
|
}
|
|
4188
|
-
function
|
|
4271
|
+
function kn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4189
4272
|
let [i, o] = l(!1), s = c(null);
|
|
4190
4273
|
return a(() => {
|
|
4191
4274
|
if (!i || !s.current) return;
|
|
@@ -4215,7 +4298,7 @@ function En({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4215
4298
|
children: e ?? ""
|
|
4216
4299
|
});
|
|
4217
4300
|
}
|
|
4218
|
-
var
|
|
4301
|
+
var An = 360, jn = "\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", Mn = (e, t) => e && t ? `cell-${e}-${t}` : "", Nn = (e) => {
|
|
4219
4302
|
if (!e || typeof e != "object") return e ?? "";
|
|
4220
4303
|
let t = String(e.text ?? "");
|
|
4221
4304
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4226,8 +4309,8 @@ var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4226
4309
|
children: t
|
|
4227
4310
|
}) : t;
|
|
4228
4311
|
};
|
|
4229
|
-
function
|
|
4230
|
-
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null),
|
|
4312
|
+
function Pn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
|
|
4313
|
+
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), ee = (e, t) => () => R({
|
|
4231
4314
|
r: e,
|
|
4232
4315
|
c: t
|
|
4233
4316
|
});
|
|
@@ -4240,7 +4323,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4240
4323
|
}
|
|
4241
4324
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4242
4325
|
top: r.bottom - n.top + 4,
|
|
4243
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4326
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - An))
|
|
4244
4327
|
};
|
|
4245
4328
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4246
4329
|
}), a(() => {
|
|
@@ -4250,58 +4333,58 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4250
4333
|
};
|
|
4251
4334
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4252
4335
|
}, [N, L]);
|
|
4253
|
-
let { tenant:
|
|
4336
|
+
let { tenant: V, apiUrl: H } = i(J), te = i(ye), ne = te?.[h], re = C ? be(te) : 1, [ie, ae] = l(null);
|
|
4254
4337
|
if (a(() => {
|
|
4255
|
-
if (!h ||
|
|
4256
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4257
|
-
return fetch(r, { headers:
|
|
4338
|
+
if (!h || ne) return;
|
|
4339
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(re - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${H}/data/${encodeURIComponent(h.slice(4))}` : `${H}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4340
|
+
return fetch(r, { headers: V ? { "x-tenant": V } : {} }).then((e) => e.json()).then((t) => {
|
|
4258
4341
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4259
|
-
return e &&
|
|
4260
|
-
}).catch(() => e &&
|
|
4342
|
+
return e && ae(n);
|
|
4343
|
+
}).catch(() => e && ae([])), () => {
|
|
4261
4344
|
e = !1;
|
|
4262
4345
|
};
|
|
4263
4346
|
}, [
|
|
4264
4347
|
h,
|
|
4265
|
-
|
|
4348
|
+
V,
|
|
4266
4349
|
H,
|
|
4267
|
-
|
|
4350
|
+
ne,
|
|
4268
4351
|
C,
|
|
4269
|
-
|
|
4352
|
+
re,
|
|
4270
4353
|
g
|
|
4271
4354
|
]), !e.length) return null;
|
|
4272
|
-
let
|
|
4355
|
+
let U = Math.max(1, Number(g) || 10), oe = h ? C ? ne || h.startsWith("api:") ? (ne ?? ie ?? []).slice((re - 1) * U, re * U) : (ie ?? []).slice(0, U) : (ne ?? ie ?? []).slice(0, U) : null, se = oe ? oe.map((t) => e.map((e) => we(X(t?.data, e.field)))) : t, ce = !!h && !(h && !ne && ie === null) && se.length === 0, le = b ? {
|
|
4273
4356
|
y: 6,
|
|
4274
4357
|
x: 10
|
|
4275
4358
|
} : {
|
|
4276
4359
|
y: 10,
|
|
4277
4360
|
x: 14
|
|
4278
|
-
},
|
|
4361
|
+
}, W = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : le.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : le.x}px`, ue = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, G = y ? { border: ue } : { borderBottom: ue }, de = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), fe = [
|
|
4279
4362
|
"left",
|
|
4280
4363
|
"center",
|
|
4281
4364
|
"right"
|
|
4282
|
-
],
|
|
4283
|
-
...
|
|
4365
|
+
], pe = (t) => fe.includes(e[t]?.align) ? e[t].align : "", me = (e) => pe(e) || (fe.includes(O) ? O : "left"), K = Number.isFinite(Number(A)) && Number(A) > 0 ? Number(A) : 0, q = P(j), he = !K && q && q.maxHeight !== void 0 ? q.maxHeight : 0, ge = K || he, _e = he ? {
|
|
4366
|
+
...q,
|
|
4284
4367
|
maxHeight: void 0
|
|
4285
|
-
} :
|
|
4368
|
+
} : q, ve = !!N && N.rows !== !1, xe = (t) => (r) => {
|
|
4286
4369
|
if (!N?.resize || t >= e.length - 1) return;
|
|
4287
4370
|
r.preventDefault(), r.stopPropagation();
|
|
4288
4371
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4289
4372
|
if (!a) return;
|
|
4290
|
-
let o =
|
|
4373
|
+
let o = de ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4291
4374
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4292
4375
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4293
4376
|
}, u = () => {
|
|
4294
4377
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4295
4378
|
};
|
|
4296
4379
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4297
|
-
},
|
|
4298
|
-
p &&
|
|
4299
|
-
let i = p[
|
|
4380
|
+
}, Se = /* @__PURE__ */ new Set();
|
|
4381
|
+
p && se.forEach((t, n) => e.forEach((e, t) => {
|
|
4382
|
+
let i = p[Mn(r[n], o[t])];
|
|
4300
4383
|
if (!i) return;
|
|
4301
4384
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4302
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) &&
|
|
4385
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && Se.add(`${n + e},${t + r}`);
|
|
4303
4386
|
}));
|
|
4304
|
-
let
|
|
4387
|
+
let Ce = (e) => (t) => {
|
|
4305
4388
|
if (!N?.resizeRow) return;
|
|
4306
4389
|
t.preventDefault(), t.stopPropagation();
|
|
4307
4390
|
let n = t.currentTarget.closest("tr");
|
|
@@ -4310,7 +4393,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4310
4393
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4311
4394
|
};
|
|
4312
4395
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4313
|
-
},
|
|
4396
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4314
4397
|
className: "wb-tedit-btn",
|
|
4315
4398
|
role: "button",
|
|
4316
4399
|
"data-hint": t,
|
|
@@ -4319,7 +4402,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4319
4402
|
},
|
|
4320
4403
|
onClick: n,
|
|
4321
4404
|
children: e
|
|
4322
|
-
}, t),
|
|
4405
|
+
}, t), Z = L && L.r < se.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Te = Z ? p?.[Mn(r[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(Te?.c) || 1), De = Math.max(1, Number(Te?.r) || 1);
|
|
4323
4406
|
return /* @__PURE__ */ f("div", {
|
|
4324
4407
|
ref: (e) => {
|
|
4325
4408
|
I.current = e, typeof M == "function" && M(e);
|
|
@@ -4327,11 +4410,11 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4327
4410
|
style: {
|
|
4328
4411
|
width: "100%",
|
|
4329
4412
|
...N ? { position: "relative" } : null,
|
|
4330
|
-
...
|
|
4413
|
+
..._e
|
|
4331
4414
|
},
|
|
4332
4415
|
children: [
|
|
4333
|
-
N && /* @__PURE__ */ d("style", { children:
|
|
4334
|
-
N &&
|
|
4416
|
+
N && /* @__PURE__ */ d("style", { children: jn }),
|
|
4417
|
+
N && Z && z && /* @__PURE__ */ f("div", {
|
|
4335
4418
|
className: "wb-tedit-bar",
|
|
4336
4419
|
style: {
|
|
4337
4420
|
top: z.top,
|
|
@@ -4341,31 +4424,31 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4341
4424
|
children: [
|
|
4342
4425
|
/* @__PURE__ */ d("span", {
|
|
4343
4426
|
className: "wb-tedit-at",
|
|
4344
|
-
children: `R${
|
|
4427
|
+
children: `R${Z.r + 1}·C${Z.c + 1}`
|
|
4345
4428
|
}),
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4429
|
+
Y("+↑", Q("rowAbove", "Insert row above"), () => N.addRow(Z.r - 1)),
|
|
4430
|
+
Y("+↓", Q("rowBelow", "Insert row below"), () => N.addRow(Z.r)),
|
|
4431
|
+
Y("↑", Q("rowUp", "Move row up"), () => N.moveRow(Z.r, -1), Z.r === 0),
|
|
4432
|
+
Y("↓", Q("rowDown", "Move row down"), () => N.moveRow(Z.r, 1), Z.r >= se.length - 1),
|
|
4433
|
+
Y("✕ row", Q("rowDelete", "Delete row"), () => N.dropRow(Z.r), se.length <= 1),
|
|
4351
4434
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4352
|
-
|
|
4353
|
-
|
|
4354
|
-
|
|
4355
|
-
|
|
4356
|
-
|
|
4435
|
+
Y("+←", Q("colLeft", "Insert column left"), () => N.addColumn(Z.c - 1)),
|
|
4436
|
+
Y("+→", Q("colRight", "Insert column right"), () => N.addColumn(Z.c)),
|
|
4437
|
+
Y("←", Q("colMoveLeft", "Move column left"), () => N.moveColumn(Z.c, -1), Z.c === 0),
|
|
4438
|
+
Y("→", Q("colMoveRight", "Move column right"), () => N.moveColumn(Z.c, 1), Z.c >= e.length - 1),
|
|
4439
|
+
Y("✕ col", Q("colDelete", "Delete column"), () => N.dropColumn(Z.c), e.length <= 1),
|
|
4357
4440
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4441
|
+
Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => N.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
|
|
4442
|
+
Y("↕", Q("mergeDown", "Merge with the cell below"), () => N.merge(Z.r, Z.c, "down"), Z.r + De >= se.length),
|
|
4443
|
+
Y("⤫", Q("split", "Split this cell"), () => N.split(Z.r, Z.c), Ee === 1 && De === 1)
|
|
4361
4444
|
]
|
|
4362
4445
|
}),
|
|
4363
4446
|
/* @__PURE__ */ d("div", {
|
|
4364
4447
|
style: {
|
|
4365
4448
|
width: "100%",
|
|
4366
4449
|
overflowX: "auto",
|
|
4367
|
-
...
|
|
4368
|
-
maxHeight:
|
|
4450
|
+
...ge ? {
|
|
4451
|
+
maxHeight: ge,
|
|
4369
4452
|
overflowY: "auto"
|
|
4370
4453
|
} : null
|
|
4371
4454
|
},
|
|
@@ -4376,17 +4459,17 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4376
4459
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4377
4460
|
borderSpacing: 0,
|
|
4378
4461
|
fontSize: 14,
|
|
4379
|
-
...
|
|
4380
|
-
...y ? { border:
|
|
4462
|
+
...de ? { tableLayout: "fixed" } : null,
|
|
4463
|
+
...y ? { border: ue } : {}
|
|
4381
4464
|
},
|
|
4382
4465
|
children: [
|
|
4383
|
-
|
|
4466
|
+
de && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4384
4467
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4385
4468
|
className: N ? "wb-tedit-head" : void 0,
|
|
4386
4469
|
style: {
|
|
4387
|
-
textAlign:
|
|
4470
|
+
textAlign: me(n),
|
|
4388
4471
|
fontWeight: 600,
|
|
4389
|
-
padding:
|
|
4472
|
+
padding: W,
|
|
4390
4473
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4391
4474
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4392
4475
|
...T ? {
|
|
@@ -4394,53 +4477,53 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4394
4477
|
top: 0,
|
|
4395
4478
|
zIndex: 2
|
|
4396
4479
|
} : N ? { position: "relative" } : null,
|
|
4397
|
-
...
|
|
4480
|
+
...G
|
|
4398
4481
|
},
|
|
4399
|
-
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
4482
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(kn, {
|
|
4400
4483
|
value: t.label ?? t,
|
|
4401
4484
|
onCommit: (e) => N.header(n, e),
|
|
4402
|
-
hint:
|
|
4485
|
+
hint: Q("editCell", "Double-click to edit"),
|
|
4403
4486
|
style: { paddingRight: 6 }
|
|
4404
4487
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4405
4488
|
className: "wb-tedit-grip",
|
|
4406
|
-
title:
|
|
4407
|
-
onPointerDown:
|
|
4489
|
+
title: Q("colWidth", "Drag to resize the column"),
|
|
4490
|
+
onPointerDown: xe(n)
|
|
4408
4491
|
})] }) : t.label ?? t
|
|
4409
4492
|
}, n)) }) }),
|
|
4410
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
4493
|
+
/* @__PURE__ */ f("tbody", { children: [ce && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4411
4494
|
colSpan: e.length,
|
|
4412
4495
|
style: {
|
|
4413
|
-
padding:
|
|
4496
|
+
padding: W,
|
|
4414
4497
|
textAlign: "center",
|
|
4415
4498
|
opacity: .6,
|
|
4416
|
-
...
|
|
4499
|
+
...G
|
|
4417
4500
|
},
|
|
4418
4501
|
children: w || "No data yet"
|
|
4419
|
-
}) }),
|
|
4502
|
+
}) }), se.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4420
4503
|
className: N ? "wb-tedit-row" : void 0,
|
|
4421
4504
|
style: {
|
|
4422
4505
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4423
4506
|
...Number.isFinite(Number(s?.[n])) && s[n] > 0 ? { height: s[n] } : null
|
|
4424
4507
|
},
|
|
4425
4508
|
children: e.map((e, i) => {
|
|
4426
|
-
if (
|
|
4427
|
-
let a =
|
|
4509
|
+
if (Se.has(`${n},${i}`)) return null;
|
|
4510
|
+
let a = Mn(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
|
|
4428
4511
|
return /* @__PURE__ */ f("td", {
|
|
4429
4512
|
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4430
|
-
onMouseDownCapture:
|
|
4513
|
+
onMouseDownCapture: ve ? ee(n, i) : void 0,
|
|
4431
4514
|
"data-cell": N ? `${n}-${i}` : void 0,
|
|
4432
4515
|
colSpan: l > 1 ? l : void 0,
|
|
4433
4516
|
rowSpan: u > 1 ? u : void 0,
|
|
4434
4517
|
style: {
|
|
4435
|
-
padding:
|
|
4436
|
-
...
|
|
4518
|
+
padding: W,
|
|
4519
|
+
...pe(i) ? { textAlign: pe(i) } : null,
|
|
4437
4520
|
...N ? { position: "relative" } : null,
|
|
4438
|
-
...
|
|
4521
|
+
...G
|
|
4439
4522
|
},
|
|
4440
|
-
children: [s ??
|
|
4523
|
+
children: [s ?? Nn(t?.[i]), N && ve && /* @__PURE__ */ d("span", {
|
|
4441
4524
|
className: "wb-tedit-rowgrip",
|
|
4442
|
-
title:
|
|
4443
|
-
onPointerDown:
|
|
4525
|
+
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4526
|
+
onPointerDown: Ce(n),
|
|
4444
4527
|
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4445
4528
|
})]
|
|
4446
4529
|
}, i);
|
|
@@ -4452,7 +4535,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4452
4535
|
]
|
|
4453
4536
|
});
|
|
4454
4537
|
}
|
|
4455
|
-
var
|
|
4538
|
+
var Fn = {
|
|
4456
4539
|
small: {
|
|
4457
4540
|
cell: 62,
|
|
4458
4541
|
font: 10.5,
|
|
@@ -4477,9 +4560,9 @@ var Mn = {
|
|
|
4477
4560
|
pad: 8,
|
|
4478
4561
|
gap: 4
|
|
4479
4562
|
}
|
|
4480
|
-
},
|
|
4481
|
-
function
|
|
4482
|
-
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 ? "" :
|
|
4563
|
+
}, In = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ln = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Rn = 366;
|
|
4564
|
+
function zn(e, t = {}) {
|
|
4565
|
+
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 ? "" : we(e), a = (e) => {
|
|
4483
4566
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4484
4567
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4485
4568
|
};
|
|
@@ -4495,7 +4578,7 @@ function In(e, t = {}) {
|
|
|
4495
4578
|
} : null;
|
|
4496
4579
|
}).filter(Boolean);
|
|
4497
4580
|
}
|
|
4498
|
-
function
|
|
4581
|
+
function Bn(e) {
|
|
4499
4582
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4500
4583
|
let n = e?.start ? new Date(e.start) : null;
|
|
4501
4584
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4510,20 +4593,20 @@ function Ln(e) {
|
|
|
4510
4593
|
};
|
|
4511
4594
|
}).filter(Boolean);
|
|
4512
4595
|
}
|
|
4513
|
-
function
|
|
4596
|
+
function Vn(e) {
|
|
4514
4597
|
let t = /* @__PURE__ */ new Map();
|
|
4515
4598
|
for (let n of e) {
|
|
4516
|
-
let e =
|
|
4599
|
+
let e = Ln(n.start), r = n.end ? Ln(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Rn);
|
|
4517
4600
|
for (let r = 0; r <= i; r += 1) {
|
|
4518
|
-
let i =
|
|
4601
|
+
let i = In(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4519
4602
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4520
4603
|
}
|
|
4521
4604
|
}
|
|
4522
4605
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4523
4606
|
return t;
|
|
4524
4607
|
}
|
|
4525
|
-
function
|
|
4526
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
4608
|
+
function Hn({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4609
|
+
let { tenant: T, apiUrl: E, locale: D } = i(J), O = i(ye)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4527
4610
|
let e = /* @__PURE__ */ new Date();
|
|
4528
4611
|
return {
|
|
4529
4612
|
year: e.getFullYear(),
|
|
@@ -4545,13 +4628,13 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4545
4628
|
E,
|
|
4546
4629
|
O
|
|
4547
4630
|
]);
|
|
4548
|
-
let N =
|
|
4631
|
+
let N = Fn[m] ?? Fn.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 ? zn(O ?? k ?? [], {
|
|
4549
4632
|
titleField: n,
|
|
4550
4633
|
startField: r,
|
|
4551
4634
|
endField: o,
|
|
4552
4635
|
hrefField: s,
|
|
4553
4636
|
colorField: c
|
|
4554
|
-
}) :
|
|
4637
|
+
}) : Bn(e), B = Vn(z), ee = D || void 0, V = (e, t) => {
|
|
4555
4638
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4556
4639
|
width: 6,
|
|
4557
4640
|
height: 6,
|
|
@@ -4589,7 +4672,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4589
4672
|
title: e.title,
|
|
4590
4673
|
children: n
|
|
4591
4674
|
}, e.key);
|
|
4592
|
-
}, H = new Intl.DateTimeFormat(
|
|
4675
|
+
}, H = new Intl.DateTimeFormat(ee, {
|
|
4593
4676
|
month: "long",
|
|
4594
4677
|
year: "numeric"
|
|
4595
4678
|
}).format(new Date(j.year, j.month, 1)), te = (e) => M((t) => {
|
|
@@ -4598,7 +4681,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4598
4681
|
year: n.getFullYear(),
|
|
4599
4682
|
month: n.getMonth()
|
|
4600
4683
|
};
|
|
4601
|
-
}),
|
|
4684
|
+
}), ne = (e, t) => /* @__PURE__ */ d("button", {
|
|
4602
4685
|
type: "button",
|
|
4603
4686
|
"aria-label": e,
|
|
4604
4687
|
onClick: () => te(t),
|
|
@@ -4613,7 +4696,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4613
4696
|
padding: "4px 8px"
|
|
4614
4697
|
},
|
|
4615
4698
|
children: t < 0 ? "‹" : "›"
|
|
4616
|
-
}),
|
|
4699
|
+
}), re = /* @__PURE__ */ f("div", {
|
|
4617
4700
|
style: {
|
|
4618
4701
|
display: "flex",
|
|
4619
4702
|
alignItems: "center",
|
|
@@ -4630,12 +4713,12 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4630
4713
|
},
|
|
4631
4714
|
children: H
|
|
4632
4715
|
}),
|
|
4633
|
-
|
|
4634
|
-
|
|
4716
|
+
ne("Previous month", -1),
|
|
4717
|
+
ne("Next month", 1)
|
|
4635
4718
|
]
|
|
4636
4719
|
});
|
|
4637
4720
|
if (p === "list") {
|
|
4638
|
-
let e = z.filter((e) => e.start.getFullYear() === j.year && e.start.getMonth() === j.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(
|
|
4721
|
+
let e = z.filter((e) => e.start.getFullYear() === j.year && e.start.getMonth() === j.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(ee, {
|
|
4639
4722
|
day: "numeric",
|
|
4640
4723
|
month: "short",
|
|
4641
4724
|
hour: "2-digit",
|
|
@@ -4647,7 +4730,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4647
4730
|
width: "100%",
|
|
4648
4731
|
...P(S)
|
|
4649
4732
|
},
|
|
4650
|
-
children: [
|
|
4733
|
+
children: [re, e.length ? /* @__PURE__ */ d("div", {
|
|
4651
4734
|
style: {
|
|
4652
4735
|
display: "flex",
|
|
4653
4736
|
flexDirection: "column",
|
|
@@ -4668,7 +4751,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4668
4751
|
minWidth: 96
|
|
4669
4752
|
},
|
|
4670
4753
|
children: t.format(e.start)
|
|
4671
|
-
}),
|
|
4754
|
+
}), V(e, {
|
|
4672
4755
|
flexGrow: 1,
|
|
4673
4756
|
minWidth: 0
|
|
4674
4757
|
})]
|
|
@@ -4683,10 +4766,10 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4683
4766
|
})]
|
|
4684
4767
|
});
|
|
4685
4768
|
}
|
|
4686
|
-
let
|
|
4687
|
-
for (let e = 0; e <
|
|
4688
|
-
let t = e -
|
|
4689
|
-
|
|
4769
|
+
let ie = new Date(j.year, j.month, 1), ae = y === "sunday" ? 0 : 1, U = (ie.getDay() - ae + 7) % 7, oe = new Date(j.year, j.month + 1, 0).getDate(), se = Math.ceil((U + oe) / 7), ce = In(/* @__PURE__ */ new Date()), le = new Intl.DateTimeFormat(ee, { weekday: "short" }), W = [];
|
|
4770
|
+
for (let e = 0; e < se * 7; e += 1) {
|
|
4771
|
+
let t = e - U + 1, n = t >= 1 && t <= oe, r = In(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ce;
|
|
4772
|
+
W.push(/* @__PURE__ */ f("div", {
|
|
4690
4773
|
style: {
|
|
4691
4774
|
minHeight: N.cell,
|
|
4692
4775
|
borderTop: `1px solid ${I}`,
|
|
@@ -4711,7 +4794,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4711
4794
|
},
|
|
4712
4795
|
children: n ? t : new Date(j.year, j.month, t).getDate()
|
|
4713
4796
|
}),
|
|
4714
|
-
a.map((e) =>
|
|
4797
|
+
a.map((e) => V(e)),
|
|
4715
4798
|
i.length > a.length && /* @__PURE__ */ d("span", {
|
|
4716
4799
|
style: {
|
|
4717
4800
|
fontSize: N.font,
|
|
@@ -4729,7 +4812,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4729
4812
|
...P(S)
|
|
4730
4813
|
},
|
|
4731
4814
|
children: [
|
|
4732
|
-
|
|
4815
|
+
re,
|
|
4733
4816
|
/* @__PURE__ */ f("div", {
|
|
4734
4817
|
style: {
|
|
4735
4818
|
display: "grid",
|
|
@@ -4743,20 +4826,315 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4743
4826
|
textAlign: "center",
|
|
4744
4827
|
padding: `0 0 ${N.pad}px`
|
|
4745
4828
|
},
|
|
4746
|
-
children:
|
|
4747
|
-
}, `head-${t}`)),
|
|
4829
|
+
children: le.format(new Date(2024, 0, 7 + ae + t))
|
|
4830
|
+
}, `head-${t}`)), W]
|
|
4748
4831
|
}),
|
|
4749
4832
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4750
4833
|
]
|
|
4751
4834
|
});
|
|
4752
4835
|
}
|
|
4753
|
-
var
|
|
4836
|
+
var Un = {
|
|
4837
|
+
small: 36,
|
|
4838
|
+
medium: 56,
|
|
4839
|
+
large: 88
|
|
4840
|
+
};
|
|
4841
|
+
function Wn(e, t = {}) {
|
|
4842
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : we(e);
|
|
4843
|
+
return n.map((e) => {
|
|
4844
|
+
let n = e.data ?? e, i = X(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(X(n, t.nameField)) : r(n.name);
|
|
4845
|
+
return {
|
|
4846
|
+
src: typeof o == "string" ? o.trim() : "",
|
|
4847
|
+
alt: s,
|
|
4848
|
+
href: t.hrefField ? r(X(n, t.hrefField)) : ""
|
|
4849
|
+
};
|
|
4850
|
+
}).filter((e) => e.src);
|
|
4851
|
+
}
|
|
4852
|
+
function Gn({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
4853
|
+
let { tenant: D, apiUrl: O } = i(J), k = i(ye)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [ee, V] = l(!0), [H, te] = l(!1), [ne, re] = l(!1);
|
|
4854
|
+
a(() => {
|
|
4855
|
+
if (!t || k) return;
|
|
4856
|
+
let e = !0;
|
|
4857
|
+
return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
|
|
4858
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4859
|
+
e && j(n);
|
|
4860
|
+
}).catch(() => e && j([])), () => {
|
|
4861
|
+
e = !1;
|
|
4862
|
+
};
|
|
4863
|
+
}, [
|
|
4864
|
+
t,
|
|
4865
|
+
D,
|
|
4866
|
+
O,
|
|
4867
|
+
k
|
|
4868
|
+
]), a(() => {
|
|
4869
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
4870
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => re(e.matches);
|
|
4871
|
+
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
4872
|
+
}, []), a(() => {
|
|
4873
|
+
let e = N.current;
|
|
4874
|
+
if (!e) return;
|
|
4875
|
+
let t = () => I(e.clientWidth);
|
|
4876
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
4877
|
+
let n = new ResizeObserver(t);
|
|
4878
|
+
return n.observe(e), () => n.disconnect();
|
|
4879
|
+
}, []), a(() => {
|
|
4880
|
+
let e = M.current;
|
|
4881
|
+
if (!e) return;
|
|
4882
|
+
let t = !0, n = () => {
|
|
4883
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * U);
|
|
4884
|
+
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4885
|
+
};
|
|
4886
|
+
n();
|
|
4887
|
+
let r = [...e.querySelectorAll("img")].filter((e) => !e.complete);
|
|
4888
|
+
return r.forEach((e) => e.addEventListener("load", n)), () => {
|
|
4889
|
+
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4890
|
+
};
|
|
4891
|
+
});
|
|
4892
|
+
let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? Wn(k ?? A ?? [], {
|
|
4893
|
+
imageField: n,
|
|
4894
|
+
nameField: r,
|
|
4895
|
+
hrefField: o
|
|
4896
|
+
}) : ie, U = Un[p] ?? Un.medium, oe = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, se = s === "marquee" ? "step" : s, ce = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), le = Math.min(3e3, Math.max(100, Number(_) || 500)), W = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), G = (L || U * 3) + oe, de = F ? Math.max(1, Math.floor(F / G)) : W, fe = Math.min(W, de), pe = F ? Math.min(G, F / fe) : G;
|
|
4897
|
+
if (!ae.length) return /* @__PURE__ */ d("div", {
|
|
4898
|
+
ref: T,
|
|
4899
|
+
style: {
|
|
4900
|
+
width: "100%",
|
|
4901
|
+
...P(w)
|
|
4902
|
+
},
|
|
4903
|
+
children: E ? /* @__PURE__ */ d("div", {
|
|
4904
|
+
style: {
|
|
4905
|
+
display: "flex",
|
|
4906
|
+
alignItems: "center",
|
|
4907
|
+
justifyContent: "center",
|
|
4908
|
+
flexWrap: "wrap",
|
|
4909
|
+
gap: oe
|
|
4910
|
+
},
|
|
4911
|
+
children: [
|
|
4912
|
+
0,
|
|
4913
|
+
1,
|
|
4914
|
+
2,
|
|
4915
|
+
3,
|
|
4916
|
+
4
|
|
4917
|
+
].map((e) => /* @__PURE__ */ d("div", {
|
|
4918
|
+
style: {
|
|
4919
|
+
height: U,
|
|
4920
|
+
width: U * 3,
|
|
4921
|
+
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
4922
|
+
borderRadius: 6,
|
|
4923
|
+
display: "flex",
|
|
4924
|
+
alignItems: "center",
|
|
4925
|
+
justifyContent: "center",
|
|
4926
|
+
fontSize: Math.max(10, Math.round(U / 4)),
|
|
4927
|
+
opacity: .45,
|
|
4928
|
+
...ue
|
|
4929
|
+
},
|
|
4930
|
+
children: "LOGO"
|
|
4931
|
+
}, e))
|
|
4932
|
+
}) : C ? /* @__PURE__ */ d("div", {
|
|
4933
|
+
style: {
|
|
4934
|
+
fontSize: 13,
|
|
4935
|
+
opacity: .6,
|
|
4936
|
+
textAlign: "center",
|
|
4937
|
+
padding: 16
|
|
4938
|
+
},
|
|
4939
|
+
children: C
|
|
4940
|
+
}) : null
|
|
4941
|
+
});
|
|
4942
|
+
let me = ae.length, K = se === "step" && me > fe, q = se === "slider", he = K && !E && !H && !ne, ge = v === "right", _e = ge ? me : 0, ve = K ? [...ae, ...ae] : ae, be = K ? z * pe : 0, xe = (e, t, n) => {
|
|
4943
|
+
let r = /* @__PURE__ */ d("img", {
|
|
4944
|
+
src: e.src,
|
|
4945
|
+
alt: e.alt ?? "",
|
|
4946
|
+
style: {
|
|
4947
|
+
height: U,
|
|
4948
|
+
width: "auto",
|
|
4949
|
+
maxWidth: "100%",
|
|
4950
|
+
objectFit: "contain",
|
|
4951
|
+
display: "block"
|
|
4952
|
+
}
|
|
4953
|
+
}), i = K ? {
|
|
4954
|
+
width: pe,
|
|
4955
|
+
flex: "0 0 auto",
|
|
4956
|
+
padding: `0 ${oe / 2}px`,
|
|
4957
|
+
justifyContent: "center"
|
|
4958
|
+
} : {};
|
|
4959
|
+
return e.href && !E ? /* @__PURE__ */ d("a", {
|
|
4960
|
+
href: e.href,
|
|
4961
|
+
className: "wb-logo",
|
|
4962
|
+
title: e.alt || void 0,
|
|
4963
|
+
style: i,
|
|
4964
|
+
...S === !1 ? {} : {
|
|
4965
|
+
target: "_blank",
|
|
4966
|
+
rel: "noopener noreferrer"
|
|
4967
|
+
},
|
|
4968
|
+
...n ? {
|
|
4969
|
+
"aria-hidden": "true",
|
|
4970
|
+
tabIndex: -1
|
|
4971
|
+
} : {},
|
|
4972
|
+
children: r
|
|
4973
|
+
}, `${n ? "c" : "o"}-${t}`) : /* @__PURE__ */ d("div", {
|
|
4974
|
+
className: "wb-logo",
|
|
4975
|
+
style: i,
|
|
4976
|
+
...n ? { "aria-hidden": "true" } : {},
|
|
4977
|
+
children: r
|
|
4978
|
+
}, `${n ? "c" : "o"}-${t}`);
|
|
4979
|
+
}, Se = /* @__PURE__ */ d("div", {
|
|
4980
|
+
ref: M,
|
|
4981
|
+
className: "wb-logos-track",
|
|
4982
|
+
style: {
|
|
4983
|
+
display: "flex",
|
|
4984
|
+
alignItems: "center",
|
|
4985
|
+
...K ? {
|
|
4986
|
+
width: ve.length * pe,
|
|
4987
|
+
transform: `translateX(-${be}px)`,
|
|
4988
|
+
transition: ee ? `transform ${le}ms ease` : "none"
|
|
4989
|
+
} : q ? {
|
|
4990
|
+
gap: oe,
|
|
4991
|
+
overflowX: "auto",
|
|
4992
|
+
scrollBehavior: "smooth",
|
|
4993
|
+
scrollSnapType: "x proximity"
|
|
4994
|
+
} : {
|
|
4995
|
+
gap: oe,
|
|
4996
|
+
flexWrap: "wrap",
|
|
4997
|
+
justifyContent: "center"
|
|
4998
|
+
}
|
|
4999
|
+
},
|
|
5000
|
+
children: ve.map((e, t) => xe(e, t, K && t >= me))
|
|
5001
|
+
}), Ce = (e) => {
|
|
5002
|
+
if (q) {
|
|
5003
|
+
let t = M.current;
|
|
5004
|
+
t && t.scrollBy({
|
|
5005
|
+
left: e * Math.max(120, t.clientWidth * .8),
|
|
5006
|
+
behavior: "smooth"
|
|
5007
|
+
});
|
|
5008
|
+
return;
|
|
5009
|
+
}
|
|
5010
|
+
let t = z + e;
|
|
5011
|
+
if (t >= 0 && t <= me) {
|
|
5012
|
+
V(!0), B(t);
|
|
5013
|
+
return;
|
|
5014
|
+
}
|
|
5015
|
+
let n = t < 0 ? me : 0;
|
|
5016
|
+
V(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5017
|
+
V(!0), B(n + e);
|
|
5018
|
+
}));
|
|
5019
|
+
}, Y = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", X = Y !== "off" && (q ? F > 0 : K), Z = (e) => /* @__PURE__ */ d("button", {
|
|
5020
|
+
type: "button",
|
|
5021
|
+
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5022
|
+
onClick: () => Ce(e),
|
|
5023
|
+
className: `wb-logos-arrow${Y === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5024
|
+
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5025
|
+
children: e < 0 ? "‹" : "›"
|
|
5026
|
+
});
|
|
5027
|
+
return /* @__PURE__ */ f("div", {
|
|
5028
|
+
ref: (e) => {
|
|
5029
|
+
N.current = e, T && T(e);
|
|
5030
|
+
},
|
|
5031
|
+
className: "wb-logos",
|
|
5032
|
+
style: {
|
|
5033
|
+
width: "100%",
|
|
5034
|
+
position: "relative",
|
|
5035
|
+
overflow: "hidden",
|
|
5036
|
+
...P(w)
|
|
5037
|
+
},
|
|
5038
|
+
onMouseEnter: b === !1 ? void 0 : () => te(!0),
|
|
5039
|
+
onMouseLeave: b === !1 ? void 0 : () => te(!1),
|
|
5040
|
+
children: [
|
|
5041
|
+
/* @__PURE__ */ d("style", { children: `
|
|
5042
|
+
.wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
|
|
5043
|
+
.wb-logos .wb-logo img { filter: ${x === !1 ? "none" : "grayscale(1)"}; opacity: ${x === !1 ? 1 : .7}; transition: filter .2s ease, opacity .2s ease; }
|
|
5044
|
+
.wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
|
|
5045
|
+
.wb-logos .wb-logos-track::-webkit-scrollbar { display: none; }
|
|
5046
|
+
.wb-logos .wb-logos-track { scrollbar-width: none; }
|
|
5047
|
+
.wb-logos .wb-logo { scroll-snap-align: start; }
|
|
5048
|
+
/* Shy arrows fade in with the pointer — and with KEYBOARD focus, or they
|
|
5049
|
+
would be unreachable without a mouse. */
|
|
5050
|
+
.wb-logos .wb-logos-arrow-shy { opacity: 0; transition: opacity .18s ease; }
|
|
5051
|
+
.wb-logos:hover .wb-logos-arrow-shy,
|
|
5052
|
+
.wb-logos:focus-within .wb-logos-arrow-shy { opacity: 1; }
|
|
5053
|
+
.wb-logos-arrow {
|
|
5054
|
+
position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
|
|
5055
|
+
width: 30px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; font-size: 18px;
|
|
5056
|
+
display: flex; align-items: center; justify-content: center;
|
|
5057
|
+
color: inherit; background: var(--page-surface, #f2f2f2);
|
|
5058
|
+
border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
|
|
5059
|
+
}
|
|
5060
|
+
` }),
|
|
5061
|
+
K ? /* @__PURE__ */ f("div", {
|
|
5062
|
+
style: {
|
|
5063
|
+
position: "relative",
|
|
5064
|
+
width: fe * pe,
|
|
5065
|
+
maxWidth: "100%",
|
|
5066
|
+
margin: "0 auto"
|
|
5067
|
+
},
|
|
5068
|
+
children: [
|
|
5069
|
+
X ? Z(-1) : null,
|
|
5070
|
+
/* @__PURE__ */ d("div", {
|
|
5071
|
+
style: { overflow: "hidden" },
|
|
5072
|
+
children: Se
|
|
5073
|
+
}),
|
|
5074
|
+
X ? Z(1) : null
|
|
5075
|
+
]
|
|
5076
|
+
}) : /* @__PURE__ */ f(u, { children: [
|
|
5077
|
+
X ? Z(-1) : null,
|
|
5078
|
+
Se,
|
|
5079
|
+
X ? Z(1) : null
|
|
5080
|
+
] }),
|
|
5081
|
+
/* @__PURE__ */ d(Kn, {
|
|
5082
|
+
running: he,
|
|
5083
|
+
every: ce + le,
|
|
5084
|
+
slide: le,
|
|
5085
|
+
step: ge ? -1 : 1,
|
|
5086
|
+
index: z,
|
|
5087
|
+
total: me,
|
|
5088
|
+
home: _e,
|
|
5089
|
+
setIndex: B,
|
|
5090
|
+
setAnimate: V
|
|
5091
|
+
})
|
|
5092
|
+
]
|
|
5093
|
+
});
|
|
5094
|
+
}
|
|
5095
|
+
function Kn({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5096
|
+
a(() => {
|
|
5097
|
+
if (!e) return;
|
|
5098
|
+
let n = setInterval(() => {
|
|
5099
|
+
l(!0), c((e) => e + r);
|
|
5100
|
+
}, t);
|
|
5101
|
+
return () => clearInterval(n);
|
|
5102
|
+
}, [
|
|
5103
|
+
e,
|
|
5104
|
+
t,
|
|
5105
|
+
r,
|
|
5106
|
+
c,
|
|
5107
|
+
l
|
|
5108
|
+
]), a(() => {
|
|
5109
|
+
l(!1), c(s);
|
|
5110
|
+
}, [
|
|
5111
|
+
s,
|
|
5112
|
+
c,
|
|
5113
|
+
l
|
|
5114
|
+
]);
|
|
5115
|
+
let u = r > 0 ? i >= o : i <= 0;
|
|
5116
|
+
return a(() => {
|
|
5117
|
+
if (!u || i === s) return;
|
|
5118
|
+
let e = setTimeout(() => {
|
|
5119
|
+
l(!1), c(s);
|
|
5120
|
+
}, n);
|
|
5121
|
+
return () => clearTimeout(e);
|
|
5122
|
+
}, [
|
|
5123
|
+
u,
|
|
5124
|
+
i,
|
|
5125
|
+
n,
|
|
5126
|
+
s,
|
|
5127
|
+
c,
|
|
5128
|
+
l
|
|
5129
|
+
]), null;
|
|
5130
|
+
}
|
|
5131
|
+
var qn = {
|
|
4754
5132
|
small: 380,
|
|
4755
5133
|
medium: 560,
|
|
4756
5134
|
large: 820,
|
|
4757
5135
|
full: "100%"
|
|
4758
5136
|
};
|
|
4759
|
-
function
|
|
5137
|
+
function Jn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4760
5138
|
let [C, w] = l(!1), T = c(null);
|
|
4761
5139
|
a(() => {
|
|
4762
5140
|
if (S || !e) return;
|
|
@@ -4781,7 +5159,7 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4781
5159
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4782
5160
|
};
|
|
4783
5161
|
}, [S, C]);
|
|
4784
|
-
let E =
|
|
5162
|
+
let E = qn[o] ?? qn.medium, D = (e) => {
|
|
4785
5163
|
let t = {
|
|
4786
5164
|
padding: "9px 16px",
|
|
4787
5165
|
borderRadius: 6,
|
|
@@ -4950,10 +5328,11 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4950
5328
|
})]
|
|
4951
5329
|
});
|
|
4952
5330
|
}
|
|
4953
|
-
var
|
|
5331
|
+
var Yn = {
|
|
4954
5332
|
PageRoot: Me,
|
|
4955
|
-
CalendarBlock:
|
|
4956
|
-
|
|
5333
|
+
CalendarBlock: Hn,
|
|
5334
|
+
LogoCarousel: Gn,
|
|
5335
|
+
DialogBlock: Jn,
|
|
4957
5336
|
Section: Ne,
|
|
4958
5337
|
Container: Pe,
|
|
4959
5338
|
Heading: Fe,
|
|
@@ -4964,23 +5343,23 @@ var Hn = {
|
|
|
4964
5343
|
Divider: it,
|
|
4965
5344
|
SliderBlock: ut,
|
|
4966
5345
|
CanvasSlider: dt,
|
|
4967
|
-
TabsBlock:
|
|
4968
|
-
QuickStack:
|
|
4969
|
-
CollectionList:
|
|
4970
|
-
CollectionSearch:
|
|
4971
|
-
BreadcrumbsBlock:
|
|
4972
|
-
PaginationBlock:
|
|
4973
|
-
StepperBlock:
|
|
4974
|
-
SocialLinksBlock:
|
|
4975
|
-
ThemeModeBlock:
|
|
4976
|
-
ScrollTopBlock:
|
|
4977
|
-
OrgChartBlock:
|
|
4978
|
-
TableBlock:
|
|
4979
|
-
IconBlock:
|
|
4980
|
-
MapBlock:
|
|
4981
|
-
MasonryBlock:
|
|
4982
|
-
AccordionBlock:
|
|
4983
|
-
NavbarBlock:
|
|
5346
|
+
TabsBlock: Dt,
|
|
5347
|
+
QuickStack: $t,
|
|
5348
|
+
CollectionList: en,
|
|
5349
|
+
CollectionSearch: tn,
|
|
5350
|
+
BreadcrumbsBlock: nn,
|
|
5351
|
+
PaginationBlock: rn,
|
|
5352
|
+
StepperBlock: gn,
|
|
5353
|
+
SocialLinksBlock: hn,
|
|
5354
|
+
ThemeModeBlock: ln,
|
|
5355
|
+
ScrollTopBlock: pn,
|
|
5356
|
+
OrgChartBlock: On,
|
|
5357
|
+
TableBlock: Pn,
|
|
5358
|
+
IconBlock: bt,
|
|
5359
|
+
MapBlock: vt,
|
|
5360
|
+
MasonryBlock: St,
|
|
5361
|
+
AccordionBlock: Ot,
|
|
5362
|
+
NavbarBlock: Et,
|
|
4984
5363
|
ListBlock: Ke,
|
|
4985
5364
|
TextSpan: ze,
|
|
4986
5365
|
QuoteBlock: Ge,
|
|
@@ -4991,43 +5370,83 @@ var Hn = {
|
|
|
4991
5370
|
YouTubeBlock: et,
|
|
4992
5371
|
IframeBlock: tt,
|
|
4993
5372
|
EmbedBlock: nt,
|
|
4994
|
-
FormBlock:
|
|
4995
|
-
FormLabel:
|
|
4996
|
-
FormInput:
|
|
4997
|
-
FormTextarea:
|
|
4998
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
5373
|
+
FormBlock: Vt,
|
|
5374
|
+
FormLabel: Kt,
|
|
5375
|
+
FormInput: qt,
|
|
5376
|
+
FormTextarea: Jt,
|
|
5377
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Yt, {
|
|
4999
5378
|
kind: "checkbox",
|
|
5000
5379
|
...e
|
|
5001
5380
|
}),
|
|
5002
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
5381
|
+
FormRadio: (e) => /* @__PURE__ */ d(Yt, {
|
|
5003
5382
|
kind: "radio",
|
|
5004
5383
|
...e
|
|
5005
5384
|
}),
|
|
5006
|
-
FormSelect:
|
|
5007
|
-
FormFile:
|
|
5008
|
-
FormRecaptcha:
|
|
5009
|
-
FormSubmit:
|
|
5010
|
-
},
|
|
5385
|
+
FormSelect: Xt,
|
|
5386
|
+
FormFile: Zt,
|
|
5387
|
+
FormRecaptcha: Gt,
|
|
5388
|
+
FormSubmit: Qt
|
|
5389
|
+
}, Xn = {
|
|
5011
5390
|
id: "auth",
|
|
5012
5391
|
label: "Accounts",
|
|
5013
5392
|
category: "Apps",
|
|
5014
5393
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5015
5394
|
ssr: "shell",
|
|
5016
5395
|
settings: ["site.authRedirect"]
|
|
5017
|
-
},
|
|
5396
|
+
}, Zn = n({
|
|
5018
5397
|
user: null,
|
|
5019
5398
|
status: "idle",
|
|
5020
5399
|
ensure: () => {},
|
|
5021
5400
|
refresh: () => {},
|
|
5022
5401
|
signOut: () => {}
|
|
5023
|
-
})
|
|
5024
|
-
|
|
5402
|
+
});
|
|
5403
|
+
function Qn(e, t) {
|
|
5404
|
+
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5405
|
+
}
|
|
5406
|
+
function $n(e) {
|
|
5407
|
+
let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
|
|
5408
|
+
return {
|
|
5409
|
+
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5410
|
+
url: i,
|
|
5411
|
+
mePath: a,
|
|
5412
|
+
logoutPath: o,
|
|
5413
|
+
meUrl: Qn(i, a),
|
|
5414
|
+
logoutUrl: Qn(i, o),
|
|
5415
|
+
loginPage: r(n.loginPage),
|
|
5416
|
+
userPath: r(n.userPath),
|
|
5417
|
+
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5418
|
+
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5419
|
+
};
|
|
5420
|
+
}
|
|
5421
|
+
function er(e, t) {
|
|
5422
|
+
if (!t) return e ?? null;
|
|
5423
|
+
let n = e;
|
|
5424
|
+
for (let e of t.split(".")) {
|
|
5425
|
+
if (!n || typeof n != "object") return null;
|
|
5426
|
+
n = n[e];
|
|
5427
|
+
}
|
|
5428
|
+
return n ?? null;
|
|
5429
|
+
}
|
|
5430
|
+
function tr(e) {
|
|
5431
|
+
try {
|
|
5432
|
+
return window.localStorage.getItem(e) || "";
|
|
5433
|
+
} catch {
|
|
5434
|
+
return "";
|
|
5435
|
+
}
|
|
5436
|
+
}
|
|
5437
|
+
function nr(e) {
|
|
5438
|
+
try {
|
|
5439
|
+
window.localStorage.removeItem(e);
|
|
5440
|
+
} catch {}
|
|
5441
|
+
}
|
|
5442
|
+
var rr = () => {
|
|
5443
|
+
let e = i(Zn);
|
|
5025
5444
|
return a(() => {
|
|
5026
5445
|
e.ensure();
|
|
5027
5446
|
}, [e]), e;
|
|
5028
5447
|
};
|
|
5029
|
-
function
|
|
5030
|
-
let f = i(
|
|
5448
|
+
function ir({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
5449
|
+
let f = i(J), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => $n(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
|
|
5031
5450
|
...t,
|
|
5032
5451
|
credentials: "include",
|
|
5033
5452
|
headers: {
|
|
@@ -5035,61 +5454,93 @@ function Kn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5035
5454
|
...m ? { "x-tenant": m } : {},
|
|
5036
5455
|
...t?.headers
|
|
5037
5456
|
}
|
|
5038
|
-
}), [p, m]),
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5457
|
+
}), [p, m]), S = r((e) => (_(e), y(e ? "user" : "guest"), e), []), C = r(() => {
|
|
5458
|
+
if (n) return Promise.resolve(null);
|
|
5459
|
+
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5460
|
+
if (h.mode === "custom") {
|
|
5461
|
+
let e = h.auth === "bearer" ? tr(h.tokenKey) : "";
|
|
5462
|
+
return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
5463
|
+
let t = er(e, h.userPath);
|
|
5464
|
+
return S(t && typeof t == "object" ? t : null);
|
|
5465
|
+
}).catch(() => S(null));
|
|
5466
|
+
}
|
|
5467
|
+
return x("/site/me").then((e) => e.ok ? e.json() : null).then((e) => S(e?.payload ?? null)).catch(() => S(null));
|
|
5468
|
+
}, [
|
|
5469
|
+
x,
|
|
5470
|
+
h,
|
|
5471
|
+
n,
|
|
5472
|
+
S
|
|
5473
|
+
]), w = r(() => {
|
|
5474
|
+
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5475
|
+
if (h.mode === "custom") {
|
|
5476
|
+
let e = h.auth === "bearer" ? tr(h.tokenKey) : "";
|
|
5477
|
+
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5478
|
+
method: "post",
|
|
5479
|
+
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5480
|
+
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5481
|
+
h.auth === "bearer" && nr(h.tokenKey), S(null);
|
|
5482
|
+
});
|
|
5483
|
+
}
|
|
5484
|
+
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
5485
|
+
S(null);
|
|
5486
|
+
});
|
|
5487
|
+
}, [
|
|
5488
|
+
x,
|
|
5489
|
+
h,
|
|
5490
|
+
S
|
|
5491
|
+
]), T = r(() => {
|
|
5492
|
+
b.current || n || t || (b.current = !0, y("loading"), C());
|
|
5045
5493
|
}, [
|
|
5046
5494
|
n,
|
|
5047
5495
|
t,
|
|
5048
|
-
|
|
5049
|
-
]),
|
|
5050
|
-
user:
|
|
5051
|
-
status:
|
|
5052
|
-
ensure:
|
|
5053
|
-
refresh:
|
|
5054
|
-
signOut:
|
|
5496
|
+
C
|
|
5497
|
+
]), E = s(() => ({
|
|
5498
|
+
user: g,
|
|
5499
|
+
status: v,
|
|
5500
|
+
ensure: T,
|
|
5501
|
+
refresh: C,
|
|
5502
|
+
signOut: w
|
|
5055
5503
|
}), [
|
|
5056
|
-
|
|
5057
|
-
|
|
5504
|
+
g,
|
|
5505
|
+
v,
|
|
5506
|
+
T,
|
|
5058
5507
|
C,
|
|
5059
|
-
|
|
5060
|
-
S
|
|
5508
|
+
w
|
|
5061
5509
|
]);
|
|
5062
5510
|
return a(() => {
|
|
5063
5511
|
n || typeof window > "u" || (window.webim = {
|
|
5064
5512
|
...window.webim,
|
|
5065
|
-
user:
|
|
5066
|
-
status:
|
|
5067
|
-
|
|
5068
|
-
|
|
5513
|
+
user: g,
|
|
5514
|
+
status: v,
|
|
5515
|
+
loginUrl: h.loginPage || null,
|
|
5516
|
+
requireUser: () => b.current || t ? Promise.resolve(g) : C(),
|
|
5517
|
+
refresh: C,
|
|
5518
|
+
signOut: w
|
|
5069
5519
|
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
5070
|
-
user:
|
|
5071
|
-
status:
|
|
5520
|
+
user: g,
|
|
5521
|
+
status: v
|
|
5072
5522
|
} })));
|
|
5073
5523
|
}, [
|
|
5074
5524
|
n,
|
|
5075
|
-
|
|
5076
|
-
|
|
5525
|
+
g,
|
|
5526
|
+
v,
|
|
5077
5527
|
t,
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
|
|
5528
|
+
h.loginPage,
|
|
5529
|
+
C,
|
|
5530
|
+
w
|
|
5531
|
+
]), /* @__PURE__ */ d(Zn.Provider, {
|
|
5532
|
+
value: E,
|
|
5082
5533
|
children: e
|
|
5083
5534
|
});
|
|
5084
5535
|
}
|
|
5085
|
-
function
|
|
5086
|
-
let { status: n } =
|
|
5536
|
+
function ar({ when: e, children: t }) {
|
|
5537
|
+
let { status: n } = rr();
|
|
5087
5538
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5088
5539
|
}
|
|
5089
5540
|
//#endregion
|
|
5090
5541
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5091
|
-
function
|
|
5092
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
5542
|
+
function or({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
5543
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(J), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5093
5544
|
if (e.preventDefault(), u) return;
|
|
5094
5545
|
let n = new FormData(e.currentTarget);
|
|
5095
5546
|
C(!0), x("");
|
|
@@ -5137,20 +5588,20 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5137
5588
|
children: [
|
|
5138
5589
|
w ? /* @__PURE__ */ f("label", {
|
|
5139
5590
|
style: {
|
|
5140
|
-
...
|
|
5591
|
+
...At,
|
|
5141
5592
|
display: "grid",
|
|
5142
5593
|
gap: 6
|
|
5143
5594
|
},
|
|
5144
5595
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5145
5596
|
name: "name",
|
|
5146
5597
|
type: "text",
|
|
5147
|
-
style:
|
|
5148
|
-
...
|
|
5598
|
+
style: jt,
|
|
5599
|
+
...Nt(u)
|
|
5149
5600
|
})]
|
|
5150
5601
|
}) : null,
|
|
5151
5602
|
/* @__PURE__ */ f("label", {
|
|
5152
5603
|
style: {
|
|
5153
|
-
...
|
|
5604
|
+
...At,
|
|
5154
5605
|
display: "grid",
|
|
5155
5606
|
gap: 6
|
|
5156
5607
|
},
|
|
@@ -5158,13 +5609,13 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5158
5609
|
name: "email",
|
|
5159
5610
|
type: "email",
|
|
5160
5611
|
required: !u,
|
|
5161
|
-
style:
|
|
5162
|
-
...
|
|
5612
|
+
style: jt,
|
|
5613
|
+
...Nt(u)
|
|
5163
5614
|
})]
|
|
5164
5615
|
}),
|
|
5165
5616
|
/* @__PURE__ */ f("label", {
|
|
5166
5617
|
style: {
|
|
5167
|
-
...
|
|
5618
|
+
...At,
|
|
5168
5619
|
display: "grid",
|
|
5169
5620
|
gap: 6
|
|
5170
5621
|
},
|
|
@@ -5172,8 +5623,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5172
5623
|
name: "password",
|
|
5173
5624
|
type: "password",
|
|
5174
5625
|
required: !u,
|
|
5175
|
-
style:
|
|
5176
|
-
...
|
|
5626
|
+
style: jt,
|
|
5627
|
+
...Nt(u)
|
|
5177
5628
|
})]
|
|
5178
5629
|
}),
|
|
5179
5630
|
/* @__PURE__ */ d("button", {
|
|
@@ -5212,8 +5663,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5212
5663
|
]
|
|
5213
5664
|
});
|
|
5214
5665
|
}
|
|
5215
|
-
function
|
|
5216
|
-
let { user: c, status: l, signOut: u } =
|
|
5666
|
+
function sr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5667
|
+
let { user: c, status: l, signOut: u } = rr(), p = a ? s || "user" : l, m = a ? {
|
|
5217
5668
|
name: "Ada Lovelace",
|
|
5218
5669
|
email: "ada@example.com"
|
|
5219
5670
|
} : c;
|
|
@@ -5234,7 +5685,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5234
5685
|
children: [
|
|
5235
5686
|
/* @__PURE__ */ f("span", {
|
|
5236
5687
|
style: {
|
|
5237
|
-
...
|
|
5688
|
+
...At,
|
|
5238
5689
|
fontWeight: 600
|
|
5239
5690
|
},
|
|
5240
5691
|
children: [
|
|
@@ -5245,7 +5696,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5245
5696
|
}),
|
|
5246
5697
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5247
5698
|
style: {
|
|
5248
|
-
...
|
|
5699
|
+
...At,
|
|
5249
5700
|
opacity: .7
|
|
5250
5701
|
},
|
|
5251
5702
|
children: m.email
|
|
@@ -5261,7 +5712,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5261
5712
|
fontSize: 14,
|
|
5262
5713
|
cursor: a ? "default" : "pointer"
|
|
5263
5714
|
},
|
|
5264
|
-
...
|
|
5715
|
+
...Nt(a),
|
|
5265
5716
|
children: t
|
|
5266
5717
|
})
|
|
5267
5718
|
]
|
|
@@ -5278,40 +5729,40 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5278
5729
|
}
|
|
5279
5730
|
//#endregion
|
|
5280
5731
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5281
|
-
var
|
|
5732
|
+
var cr = {
|
|
5282
5733
|
id: "consent",
|
|
5283
5734
|
label: "Cookie consent",
|
|
5284
5735
|
category: "Apps",
|
|
5285
5736
|
keys: ["CookieConsent"],
|
|
5286
5737
|
ssr: "shell",
|
|
5287
5738
|
settings: []
|
|
5288
|
-
},
|
|
5289
|
-
function
|
|
5739
|
+
}, lr = "webim.cookie_consent";
|
|
5740
|
+
function ur() {
|
|
5290
5741
|
try {
|
|
5291
|
-
let e = window.localStorage.getItem(
|
|
5742
|
+
let e = window.localStorage.getItem(lr), t = e ? JSON.parse(e) : null;
|
|
5292
5743
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5293
5744
|
} catch {
|
|
5294
5745
|
return "";
|
|
5295
5746
|
}
|
|
5296
5747
|
}
|
|
5297
|
-
function
|
|
5748
|
+
function dr(e) {
|
|
5298
5749
|
try {
|
|
5299
5750
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5300
5751
|
} catch {}
|
|
5301
5752
|
}
|
|
5302
|
-
function
|
|
5753
|
+
function fr(e) {
|
|
5303
5754
|
try {
|
|
5304
|
-
window.localStorage.setItem(
|
|
5755
|
+
window.localStorage.setItem(lr, JSON.stringify({
|
|
5305
5756
|
choice: e,
|
|
5306
5757
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5307
5758
|
}));
|
|
5308
5759
|
} catch {}
|
|
5309
|
-
|
|
5760
|
+
dr(e);
|
|
5310
5761
|
try {
|
|
5311
5762
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5312
5763
|
} catch {}
|
|
5313
5764
|
}
|
|
5314
|
-
var
|
|
5765
|
+
var pr = {
|
|
5315
5766
|
bottom: {
|
|
5316
5767
|
left: 0,
|
|
5317
5768
|
right: 0,
|
|
@@ -5333,18 +5784,18 @@ var tr = {
|
|
|
5333
5784
|
maxWidth: 400
|
|
5334
5785
|
}
|
|
5335
5786
|
};
|
|
5336
|
-
function
|
|
5787
|
+
function mr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
5337
5788
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
5338
5789
|
y(e), typeof m == "function" && m(e);
|
|
5339
5790
|
};
|
|
5340
5791
|
if (a(() => {
|
|
5341
5792
|
if (h) return;
|
|
5342
|
-
let e =
|
|
5343
|
-
e ?
|
|
5793
|
+
let e = ur();
|
|
5794
|
+
e ? dr(e) : _(!0);
|
|
5344
5795
|
}, [h, v]), !g) return null;
|
|
5345
5796
|
let x = (e) => () => {
|
|
5346
|
-
h || (
|
|
5347
|
-
}, S =
|
|
5797
|
+
h || (fr(e), _(!1));
|
|
5798
|
+
}, S = pr[s] ?? pr.bottom, C = {
|
|
5348
5799
|
appearance: "none",
|
|
5349
5800
|
font: "inherit",
|
|
5350
5801
|
fontSize: 14,
|
|
@@ -5424,37 +5875,37 @@ function nr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5424
5875
|
}
|
|
5425
5876
|
//#endregion
|
|
5426
5877
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5427
|
-
var
|
|
5878
|
+
var hr = {
|
|
5428
5879
|
id: "language",
|
|
5429
5880
|
label: "Language",
|
|
5430
5881
|
category: "Apps",
|
|
5431
5882
|
keys: ["SiteLanguagePicker"],
|
|
5432
5883
|
ssr: "prefetch",
|
|
5433
5884
|
settings: ["locales"]
|
|
5434
|
-
},
|
|
5885
|
+
}, gr = {
|
|
5435
5886
|
id: "search",
|
|
5436
5887
|
label: "Search",
|
|
5437
5888
|
category: "Apps",
|
|
5438
5889
|
keys: ["SiteSearch"],
|
|
5439
5890
|
ssr: "prefetch",
|
|
5440
5891
|
settings: []
|
|
5441
|
-
},
|
|
5442
|
-
function
|
|
5892
|
+
}, _r = 50, vr = 2e3;
|
|
5893
|
+
function yr() {
|
|
5443
5894
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5444
5895
|
}
|
|
5445
|
-
function
|
|
5896
|
+
function br(e, t) {
|
|
5446
5897
|
let n = e?.data ?? {}, r = [];
|
|
5447
5898
|
for (let e of Object.values(n)) {
|
|
5448
|
-
let t = e == null ? "" :
|
|
5449
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5899
|
+
let t = e == null ? "" : we(e);
|
|
5900
|
+
if (t && r.push(t), r.join(" ").length > vr) break;
|
|
5450
5901
|
}
|
|
5451
|
-
return r.join(" ").slice(0,
|
|
5902
|
+
return r.join(" ").slice(0, vr).toLocaleLowerCase(t || void 0);
|
|
5452
5903
|
}
|
|
5453
|
-
function
|
|
5454
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
5904
|
+
function xr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
5905
|
+
let { tenant: b, apiUrl: x, locale: S } = i(J), [C, w] = l(() => yr()), [T, E] = l(() => yr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
5455
5906
|
a(() => {
|
|
5456
5907
|
let e = () => {
|
|
5457
|
-
let e =
|
|
5908
|
+
let e = yr();
|
|
5458
5909
|
w(e), E(e);
|
|
5459
5910
|
};
|
|
5460
5911
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5505,8 +5956,8 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5505
5956
|
});
|
|
5506
5957
|
}
|
|
5507
5958
|
else for (let t of e.rows) {
|
|
5508
|
-
if (!
|
|
5509
|
-
let n = t?.data ?? {}, r =
|
|
5959
|
+
if (!br(t, S).includes(N)) continue;
|
|
5960
|
+
let n = t?.data ?? {}, r = we(n.name) || "Untitled", i = we(n.slug);
|
|
5510
5961
|
F.push({
|
|
5511
5962
|
key: `entry:${t.id}`,
|
|
5512
5963
|
title: r,
|
|
@@ -5514,7 +5965,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5514
5965
|
kind: "entry"
|
|
5515
5966
|
});
|
|
5516
5967
|
}
|
|
5517
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5968
|
+
let I = F.slice(0, Math.min(Math.max(1, p), _r)), L = (e) => {
|
|
5518
5969
|
if (v) {
|
|
5519
5970
|
e.preventDefault(), w(T), A(!0);
|
|
5520
5971
|
return;
|
|
@@ -5535,7 +5986,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5535
5986
|
title: "Spring collection",
|
|
5536
5987
|
url: "/blog/spring",
|
|
5537
5988
|
kind: "entry"
|
|
5538
|
-
}] : null, z = R ?? I, B = !R && N && D && !I.length,
|
|
5989
|
+
}] : null, z = R ?? I, B = !R && N && D && !I.length, ee = !M || k && (z.length > 0 || B), V = z.length > 0 && /* @__PURE__ */ d("ul", {
|
|
5539
5990
|
style: {
|
|
5540
5991
|
listStyle: "none",
|
|
5541
5992
|
margin: 0,
|
|
@@ -5596,7 +6047,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5596
6047
|
onChange: (e) => E(e.target.value),
|
|
5597
6048
|
onFocus: () => N && A(!0),
|
|
5598
6049
|
style: {
|
|
5599
|
-
...
|
|
6050
|
+
...jt,
|
|
5600
6051
|
flexGrow: 1,
|
|
5601
6052
|
minWidth: 0
|
|
5602
6053
|
}
|
|
@@ -5623,7 +6074,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5623
6074
|
},
|
|
5624
6075
|
children: h
|
|
5625
6076
|
}),
|
|
5626
|
-
|
|
6077
|
+
ee && /* @__PURE__ */ f("div", {
|
|
5627
6078
|
style: M ? {
|
|
5628
6079
|
position: "absolute",
|
|
5629
6080
|
top: "100%",
|
|
@@ -5639,7 +6090,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5639
6090
|
background: "var(--page-surface, #f2f2f2)",
|
|
5640
6091
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5641
6092
|
} : { marginTop: 14 },
|
|
5642
|
-
children: [
|
|
6093
|
+
children: [V, B && /* @__PURE__ */ d("div", {
|
|
5643
6094
|
style: {
|
|
5644
6095
|
fontSize: 14,
|
|
5645
6096
|
opacity: .65,
|
|
@@ -5654,21 +6105,21 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5654
6105
|
}
|
|
5655
6106
|
//#endregion
|
|
5656
6107
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5657
|
-
function
|
|
6108
|
+
function Sr(e) {
|
|
5658
6109
|
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());
|
|
5659
6110
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5660
6111
|
}
|
|
5661
|
-
var
|
|
5662
|
-
function
|
|
6112
|
+
var Cr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6113
|
+
function wr(e, t) {
|
|
5663
6114
|
let n = String(e ?? "").toUpperCase();
|
|
5664
6115
|
if (t === "code") return n;
|
|
5665
6116
|
let r = "";
|
|
5666
6117
|
try {
|
|
5667
|
-
r =
|
|
6118
|
+
r = Cr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5668
6119
|
} catch {}
|
|
5669
6120
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5670
6121
|
}
|
|
5671
|
-
function
|
|
6122
|
+
function Tr(e, t) {
|
|
5672
6123
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5673
6124
|
if (typeof window > "u") return n || "?";
|
|
5674
6125
|
try {
|
|
@@ -5678,8 +6129,8 @@ function pr(e, t) {
|
|
|
5678
6129
|
return n || "/";
|
|
5679
6130
|
}
|
|
5680
6131
|
}
|
|
5681
|
-
function
|
|
5682
|
-
let c = i(
|
|
6132
|
+
function Er({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
6133
|
+
let c = i(J), l = Sr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
5683
6134
|
display: "inline-flex",
|
|
5684
6135
|
alignItems: "center",
|
|
5685
6136
|
gap: 8,
|
|
@@ -5714,7 +6165,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5714
6165
|
style: { opacity: .4 },
|
|
5715
6166
|
children: n ?? "·"
|
|
5716
6167
|
}), /* @__PURE__ */ d("a", {
|
|
5717
|
-
href:
|
|
6168
|
+
href: Tr(e, e === u),
|
|
5718
6169
|
hrefLang: e,
|
|
5719
6170
|
"aria-current": e === p ? "true" : void 0,
|
|
5720
6171
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5724,7 +6175,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5724
6175
|
textDecoration: "none",
|
|
5725
6176
|
cursor: s ? "default" : "pointer"
|
|
5726
6177
|
},
|
|
5727
|
-
children:
|
|
6178
|
+
children: wr(e, t)
|
|
5728
6179
|
})]
|
|
5729
6180
|
}, e))]
|
|
5730
6181
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -5735,7 +6186,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5735
6186
|
value: p,
|
|
5736
6187
|
onChange: s ? void 0 : (e) => {
|
|
5737
6188
|
let t = e.target.value;
|
|
5738
|
-
window.location.assign(
|
|
6189
|
+
window.location.assign(Tr(t, t === u));
|
|
5739
6190
|
},
|
|
5740
6191
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5741
6192
|
style: {
|
|
@@ -5749,57 +6200,57 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5749
6200
|
},
|
|
5750
6201
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
5751
6202
|
value: e,
|
|
5752
|
-
children:
|
|
6203
|
+
children: wr(e, t)
|
|
5753
6204
|
}, e))
|
|
5754
6205
|
})]
|
|
5755
6206
|
});
|
|
5756
6207
|
}
|
|
5757
6208
|
//#endregion
|
|
5758
6209
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5759
|
-
var
|
|
5760
|
-
Un,
|
|
5761
|
-
rr,
|
|
6210
|
+
var Dr = [
|
|
5762
6211
|
Xn,
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
6212
|
+
hr,
|
|
6213
|
+
cr,
|
|
6214
|
+
gr
|
|
6215
|
+
], Or = {
|
|
6216
|
+
SiteLoginForm: or,
|
|
6217
|
+
SiteAccountMenu: sr,
|
|
6218
|
+
SiteLanguagePicker: Er,
|
|
6219
|
+
CookieConsent: mr,
|
|
6220
|
+
SiteSearch: xr
|
|
5770
6221
|
};
|
|
5771
|
-
new Set(
|
|
6222
|
+
new Set(Dr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5772
6223
|
//#endregion
|
|
5773
6224
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5774
|
-
var
|
|
5775
|
-
function
|
|
5776
|
-
if (
|
|
6225
|
+
var kr = /* @__PURE__ */ new Map();
|
|
6226
|
+
function Ar(e) {
|
|
6227
|
+
if (kr.has(e)) return kr.get(e);
|
|
5777
6228
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5778
6229
|
/* @vite-ignore */
|
|
5779
6230
|
/* webpackIgnore: true */
|
|
5780
6231
|
t
|
|
5781
6232
|
).finally(() => URL.revokeObjectURL(t));
|
|
5782
|
-
return
|
|
6233
|
+
return kr.set(e, n), n;
|
|
5783
6234
|
}
|
|
5784
|
-
function
|
|
6235
|
+
function jr(e) {
|
|
5785
6236
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5786
6237
|
return n && typeof n == "object" ? n : {};
|
|
5787
6238
|
}
|
|
5788
6239
|
//#endregion
|
|
5789
6240
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5790
|
-
async function
|
|
5791
|
-
let n = await
|
|
6241
|
+
async function Mr(e, t) {
|
|
6242
|
+
let n = await Ar(e);
|
|
5792
6243
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5793
6244
|
}
|
|
5794
|
-
var
|
|
6245
|
+
var Nr = {
|
|
5795
6246
|
padding: "10px 12px",
|
|
5796
6247
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5797
6248
|
borderRadius: 8,
|
|
5798
6249
|
fontSize: 12,
|
|
5799
6250
|
opacity: .6
|
|
5800
6251
|
};
|
|
5801
|
-
function
|
|
5802
|
-
let s = i(
|
|
6252
|
+
function Pr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
6253
|
+
let s = i(J), l = jr(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
5803
6254
|
tenant: s?.tenant ?? "",
|
|
5804
6255
|
apiUrl: s?.apiUrl ?? "/api",
|
|
5805
6256
|
locale: s?.locale ?? "",
|
|
@@ -5811,7 +6262,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5811
6262
|
let e = u.current;
|
|
5812
6263
|
if (!l?.code || !e) return;
|
|
5813
6264
|
let n = !0;
|
|
5814
|
-
return
|
|
6265
|
+
return Mr(l.code, t).then((e) => {
|
|
5815
6266
|
if (!(!n || !e || !u.current)) {
|
|
5816
6267
|
p.current = e;
|
|
5817
6268
|
try {
|
|
@@ -5841,7 +6292,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5841
6292
|
}) : /* @__PURE__ */ f("div", {
|
|
5842
6293
|
ref: o,
|
|
5843
6294
|
style: {
|
|
5844
|
-
...
|
|
6295
|
+
...Nr,
|
|
5845
6296
|
...P(r)
|
|
5846
6297
|
},
|
|
5847
6298
|
children: [
|
|
@@ -5853,12 +6304,12 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5853
6304
|
}
|
|
5854
6305
|
//#endregion
|
|
5855
6306
|
//#region ../ui/src/components/builder/render.jsx
|
|
5856
|
-
var
|
|
5857
|
-
...
|
|
5858
|
-
...
|
|
5859
|
-
PluginBlock:
|
|
6307
|
+
var Fr = {
|
|
6308
|
+
...Yn,
|
|
6309
|
+
...Or,
|
|
6310
|
+
PluginBlock: Pr
|
|
5860
6311
|
};
|
|
5861
|
-
function
|
|
6312
|
+
function Ir(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5862
6313
|
let o = n[e];
|
|
5863
6314
|
if (!o || o.hidden) return null;
|
|
5864
6315
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5866,29 +6317,29 @@ function wr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5866
6317
|
let n = o.props?.componentId, s = r?.[n];
|
|
5867
6318
|
if (!s?.template || i.has(n)) return null;
|
|
5868
6319
|
let c = new Set(i).add(n);
|
|
5869
|
-
return /* @__PURE__ */ d(t, { children:
|
|
6320
|
+
return /* @__PURE__ */ d(t, { children: Ir(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
5870
6321
|
}
|
|
5871
|
-
let l =
|
|
6322
|
+
let l = Fr[s];
|
|
5872
6323
|
if (!l) return null;
|
|
5873
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
6324
|
+
let u = (o.nodes ?? []).map((e) => Ir(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Ir(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
5874
6325
|
...c,
|
|
5875
6326
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5876
6327
|
linked: p,
|
|
5877
6328
|
nodeRef: (t) => {
|
|
5878
|
-
t && (t.setAttribute("data-wb", e),
|
|
6329
|
+
t && (t.setAttribute("data-wb", e), ne(t, c), te(t, a?.events === !1 ? [] : c.events));
|
|
5879
6330
|
},
|
|
5880
6331
|
children: u.length ? u : void 0
|
|
5881
6332
|
}, e);
|
|
5882
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
6333
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(ar, {
|
|
5883
6334
|
when: c.when,
|
|
5884
6335
|
children: m
|
|
5885
6336
|
}, e) : m;
|
|
5886
6337
|
}
|
|
5887
6338
|
//#endregion
|
|
5888
6339
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5889
|
-
var
|
|
5890
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5891
|
-
function
|
|
6340
|
+
var Lr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Rr = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
6341
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
6342
|
+
function zr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
5892
6343
|
let y = o?.js?.trim();
|
|
5893
6344
|
if (a(() => {
|
|
5894
6345
|
if (!y) return;
|
|
@@ -5902,19 +6353,19 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5902
6353
|
minHeight: "100%",
|
|
5903
6354
|
display: "flex",
|
|
5904
6355
|
flexDirection: "column"
|
|
5905
|
-
}, w =
|
|
6356
|
+
}, w = Ir("ROOT", e, n), T = s(() => ({ render: (t, r) => Ir(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = le(e, n), O = ce(e, n), k = o?.css?.trim(), j = S(c), M = K(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !fe[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
5906
6357
|
rel: "stylesheet",
|
|
5907
6358
|
precedence: "default",
|
|
5908
6359
|
href: D(e)
|
|
5909
|
-
}, e)), F =
|
|
5910
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
6360
|
+
}, e)), F = Rr(M);
|
|
6361
|
+
return r === "auto" ? /* @__PURE__ */ d(J.Provider, {
|
|
5911
6362
|
value: {
|
|
5912
6363
|
tenant: l || "",
|
|
5913
6364
|
apiUrl: u || "/api",
|
|
5914
6365
|
locale: m || "",
|
|
5915
6366
|
settings: _ ?? null
|
|
5916
6367
|
},
|
|
5917
|
-
children: /* @__PURE__ */ d(
|
|
6368
|
+
children: /* @__PURE__ */ d(ir, {
|
|
5918
6369
|
initialUser: v,
|
|
5919
6370
|
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5920
6371
|
value: p ?? null,
|
|
@@ -5929,8 +6380,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5929
6380
|
...i
|
|
5930
6381
|
},
|
|
5931
6382
|
children: [
|
|
5932
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
5933
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
6383
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Lr(q(M.light))} }
|
|
6384
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Lr(q(M.dark))} } }` }),
|
|
5934
6385
|
/* @__PURE__ */ d("style", { children: F }),
|
|
5935
6386
|
P,
|
|
5936
6387
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -5943,14 +6394,14 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5943
6394
|
})
|
|
5944
6395
|
})
|
|
5945
6396
|
})
|
|
5946
|
-
}) : /* @__PURE__ */ d(
|
|
6397
|
+
}) : /* @__PURE__ */ d(J.Provider, {
|
|
5947
6398
|
value: {
|
|
5948
6399
|
tenant: l || "",
|
|
5949
6400
|
apiUrl: u || "/api",
|
|
5950
6401
|
locale: m || "",
|
|
5951
6402
|
settings: _ ?? null
|
|
5952
6403
|
},
|
|
5953
|
-
children: /* @__PURE__ */ d(
|
|
6404
|
+
children: /* @__PURE__ */ d(ir, {
|
|
5954
6405
|
initialUser: v,
|
|
5955
6406
|
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5956
6407
|
value: p ?? null,
|
|
@@ -5983,8 +6434,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5983
6434
|
}
|
|
5984
6435
|
//#endregion
|
|
5985
6436
|
//#region src/WebimContent.jsx
|
|
5986
|
-
function
|
|
5987
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
6437
|
+
function Br({ bundle: e, mode: t = "auto", style: n }) {
|
|
6438
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(zr, {
|
|
5988
6439
|
blocks: e.blocks,
|
|
5989
6440
|
theme: e.theme,
|
|
5990
6441
|
components: e.components,
|
|
@@ -6002,7 +6453,7 @@ function Or({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
6002
6453
|
}
|
|
6003
6454
|
//#endregion
|
|
6004
6455
|
//#region src/bundle.js
|
|
6005
|
-
function
|
|
6456
|
+
function Vr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
6006
6457
|
let a = {
|
|
6007
6458
|
...t?.global ?? {},
|
|
6008
6459
|
...t?.tenant ?? {}
|
|
@@ -6028,18 +6479,18 @@ function kr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
6028
6479
|
}
|
|
6029
6480
|
//#endregion
|
|
6030
6481
|
//#region src/fetchPage.js
|
|
6031
|
-
var
|
|
6482
|
+
var Hr = async (e) => {
|
|
6032
6483
|
let t = await e.json().catch(() => null);
|
|
6033
6484
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
6034
6485
|
return t?.payload ?? t;
|
|
6035
6486
|
};
|
|
6036
|
-
async function
|
|
6487
|
+
async function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
6037
6488
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
6038
6489
|
if (!n) throw Error("fetchPage: slug is required");
|
|
6039
6490
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
6040
6491
|
...t ? { "x-tenant": t } : {},
|
|
6041
6492
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
6042
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
6493
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Hr), c(`${l}/settings/public`, { headers: u }).then(Hr)]), p = Vr({
|
|
6043
6494
|
page: d,
|
|
6044
6495
|
settings: f,
|
|
6045
6496
|
tenant: t,
|
|
@@ -6050,10 +6501,11 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
6050
6501
|
"OrgChartBlock",
|
|
6051
6502
|
"NavbarBlock",
|
|
6052
6503
|
"CalendarBlock",
|
|
6053
|
-
"MasonryBlock"
|
|
6504
|
+
"MasonryBlock",
|
|
6505
|
+
"LogoCarousel"
|
|
6054
6506
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
6055
6507
|
if (m.length) {
|
|
6056
|
-
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(
|
|
6508
|
+
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(Hr).then((e) => {
|
|
6057
6509
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
6058
6510
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
6059
6511
|
}).catch(() => [[t, []]])));
|
|
@@ -6067,40 +6519,40 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
6067
6519
|
}
|
|
6068
6520
|
//#endregion
|
|
6069
6521
|
//#region src/ssr.jsx
|
|
6070
|
-
var
|
|
6522
|
+
var Wr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
6071
6523
|
"&": "&",
|
|
6072
6524
|
"<": "<",
|
|
6073
6525
|
">": ">",
|
|
6074
6526
|
"\"": """
|
|
6075
6527
|
})[e]);
|
|
6076
|
-
function
|
|
6077
|
-
return e(/* @__PURE__ */ d(
|
|
6528
|
+
function Gr(t, { mode: n = "auto", style: r } = {}) {
|
|
6529
|
+
return e(/* @__PURE__ */ d(Br, {
|
|
6078
6530
|
bundle: t,
|
|
6079
6531
|
mode: n,
|
|
6080
6532
|
style: r
|
|
6081
6533
|
}));
|
|
6082
6534
|
}
|
|
6083
|
-
function
|
|
6535
|
+
function Kr(e, { mode: t = "auto", lang: n } = {}) {
|
|
6084
6536
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
6085
6537
|
"<meta charset=\"utf-8\"/>",
|
|
6086
6538
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
6087
|
-
`<title>${
|
|
6088
|
-
r.description && `<meta name="description" content="${
|
|
6089
|
-
`<meta property="og:title" content="${
|
|
6090
|
-
r.image && `<meta property="og:image" content="${
|
|
6539
|
+
`<title>${Wr(o)}</title>`,
|
|
6540
|
+
r.description && `<meta name="description" content="${Wr(r.description)}"/>`,
|
|
6541
|
+
`<meta property="og:title" content="${Wr(o)}"/>`,
|
|
6542
|
+
r.image && `<meta property="og:image" content="${Wr(r.image)}"/>`,
|
|
6091
6543
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
6092
6544
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
6093
6545
|
].filter(Boolean).join("\n");
|
|
6094
6546
|
return `<!doctype html>
|
|
6095
|
-
<html lang="${
|
|
6547
|
+
<html lang="${Wr(i)}"${a ? ` dir="${a}"` : ""}>
|
|
6096
6548
|
<head>
|
|
6097
6549
|
${c}
|
|
6098
6550
|
</head>
|
|
6099
6551
|
<body>
|
|
6100
|
-
${
|
|
6552
|
+
${Gr(e, { mode: t })}
|
|
6101
6553
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
6102
6554
|
</body>
|
|
6103
6555
|
</html>`;
|
|
6104
6556
|
}
|
|
6105
6557
|
//#endregion
|
|
6106
|
-
export {
|
|
6558
|
+
export { Vr as assembleBundle, Ur as fetchPage, Gr as renderBundleHtml, Kr as renderPageDocument };
|