webim-adapter 1.1.0 → 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 +1176 -688
- package/build/webim-embed.js +25 -6
- package/build/webim-ssr.js +1206 -718
- 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}%)`),
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
let { textStrokeWidth:
|
|
269
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
270
|
-
let { clipText:
|
|
271
|
-
delete t.clipText,
|
|
272
|
-
let { transitions:
|
|
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
|
+
let te = F(L);
|
|
267
|
+
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
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];
|
|
@@ -335,12 +335,12 @@ function H(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
return [];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function te(e, t) {
|
|
339
339
|
for (let t of e.__webimEvents ?? []) 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 U(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 te(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,13 +609,13 @@ var Y = (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
621
|
var Te = {
|
|
@@ -706,7 +714,7 @@ function Fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
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,
|
|
@@ -717,11 +725,17 @@ function Le(e, t = [], n, r) {
|
|
|
717
725
|
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
718
726
|
style: Ie,
|
|
719
727
|
children: i
|
|
720
|
-
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n
|
|
728
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n ? i = /* @__PURE__ */ d("a", {
|
|
721
729
|
href: n,
|
|
722
730
|
target: r || void 0,
|
|
723
731
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
724
|
-
style: {
|
|
732
|
+
style: {
|
|
733
|
+
color: "inherit",
|
|
734
|
+
...t.includes("nounderline") && { textDecoration: "none" }
|
|
735
|
+
},
|
|
736
|
+
children: i
|
|
737
|
+
}) : t.includes("nounderline") && (i = /* @__PURE__ */ d("span", {
|
|
738
|
+
style: { textDecoration: "none" },
|
|
725
739
|
children: i
|
|
726
740
|
})), i;
|
|
727
741
|
}
|
|
@@ -739,11 +753,17 @@ function Re(e, n, r) {
|
|
|
739
753
|
...e.background && { backgroundColor: e.background }
|
|
740
754
|
},
|
|
741
755
|
children: i
|
|
742
|
-
})), e.href
|
|
756
|
+
})), e.href ? i = /* @__PURE__ */ d("a", {
|
|
743
757
|
href: e.href,
|
|
744
758
|
target: e.target || void 0,
|
|
745
759
|
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
746
|
-
style: {
|
|
760
|
+
style: {
|
|
761
|
+
color: e.color ?? "inherit",
|
|
762
|
+
...e.nounderline && { textDecoration: "none" }
|
|
763
|
+
},
|
|
764
|
+
children: i
|
|
765
|
+
}) : e.nounderline && (i = /* @__PURE__ */ d("span", {
|
|
766
|
+
style: { textDecoration: "none" },
|
|
747
767
|
children: i
|
|
748
768
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
749
769
|
}) : n;
|
|
@@ -1372,23 +1392,23 @@ function dt({ slides: e = [], linked: t, ...n }) {
|
|
|
1372
1392
|
}
|
|
1373
1393
|
}) : null;
|
|
1374
1394
|
}
|
|
1375
|
-
var
|
|
1376
|
-
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;
|
|
1377
1397
|
return {
|
|
1378
1398
|
x: (Number(t) + 180) / 360 * r,
|
|
1379
|
-
y: (.5 -
|
|
1399
|
+
y: (.5 - pt(Number(e)) / (2 * Math.PI)) * r
|
|
1380
1400
|
};
|
|
1381
1401
|
}, $ = (e, t) => {
|
|
1382
1402
|
if (e === "" || e == null) return null;
|
|
1383
1403
|
let n = Number(e);
|
|
1384
1404
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1385
|
-
},
|
|
1386
|
-
function
|
|
1405
|
+
}, ht = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1406
|
+
function gt(e, t, n = "directions", r = "") {
|
|
1387
1407
|
let i = `${e},${t}`;
|
|
1388
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)}`;
|
|
1389
1409
|
}
|
|
1390
|
-
var
|
|
1391
|
-
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 }) {
|
|
1392
1412
|
let _ = c(null), [v, y] = l(1200);
|
|
1393
1413
|
a(() => {
|
|
1394
1414
|
let e = _.current;
|
|
@@ -1398,7 +1418,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1398
1418
|
let n = new ResizeObserver(t);
|
|
1399
1419
|
return n.observe(e), () => n.disconnect();
|
|
1400
1420
|
}, []);
|
|
1401
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1421
|
+
let b = (Array.isArray(e) ? e : []).filter(ht), x = ht({
|
|
1402
1422
|
lat: t,
|
|
1403
1423
|
lng: n
|
|
1404
1424
|
}) ? {
|
|
@@ -1410,7 +1430,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1410
1430
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1411
1431
|
if (b.length < 2) return 13;
|
|
1412
1432
|
for (let e = 19; e >= 1; e--) {
|
|
1413
|
-
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));
|
|
1414
1434
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1415
1435
|
}
|
|
1416
1436
|
return 1;
|
|
@@ -1434,12 +1454,12 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1434
1454
|
},
|
|
1435
1455
|
children: "Set the coordinates in Settings"
|
|
1436
1456
|
});
|
|
1437
|
-
let T =
|
|
1457
|
+
let T = mt(x.lat, x.lng, C), E = {
|
|
1438
1458
|
x: T.x - v / 2,
|
|
1439
1459
|
y: T.y - S / 2
|
|
1440
1460
|
}, D = [], O = [];
|
|
1441
|
-
for (let e = Math.floor(E.x /
|
|
1442
|
-
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);
|
|
1443
1463
|
let k = 2 ** C;
|
|
1444
1464
|
return /* @__PURE__ */ f("div", {
|
|
1445
1465
|
ref: (e) => {
|
|
@@ -1462,22 +1482,22 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1462
1482
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1463
1483
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1464
1484
|
alt: "",
|
|
1465
|
-
width:
|
|
1466
|
-
height:
|
|
1485
|
+
width: ft,
|
|
1486
|
+
height: ft,
|
|
1467
1487
|
loading: "lazy",
|
|
1468
1488
|
style: {
|
|
1469
1489
|
position: "absolute",
|
|
1470
|
-
left: Math.round(t *
|
|
1471
|
-
top: Math.round(e *
|
|
1472
|
-
width:
|
|
1473
|
-
height:
|
|
1490
|
+
left: Math.round(t * ft - E.x),
|
|
1491
|
+
top: Math.round(e * ft - E.y),
|
|
1492
|
+
width: ft,
|
|
1493
|
+
height: ft,
|
|
1474
1494
|
userSelect: "none",
|
|
1475
1495
|
pointerEvents: "none"
|
|
1476
1496
|
}
|
|
1477
1497
|
}, `${t}-${e}`);
|
|
1478
1498
|
})),
|
|
1479
1499
|
b.map((e, t) => {
|
|
1480
|
-
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);
|
|
1481
1501
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1482
1502
|
href: c || void 0,
|
|
1483
1503
|
target: c ? "_blank" : void 0,
|
|
@@ -1516,8 +1536,8 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1516
1536
|
viewBox: "0 0 24 24",
|
|
1517
1537
|
fill: a,
|
|
1518
1538
|
style: { display: "block" },
|
|
1519
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1520
|
-
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],
|
|
1521
1541
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1522
1542
|
fill: "none",
|
|
1523
1543
|
stroke: "#fff",
|
|
@@ -1553,7 +1573,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1553
1573
|
})
|
|
1554
1574
|
]
|
|
1555
1575
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1556
|
-
href:
|
|
1576
|
+
href: _t(x.lat, x.lng, C),
|
|
1557
1577
|
target: "_blank",
|
|
1558
1578
|
rel: "noopener noreferrer",
|
|
1559
1579
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1567,7 +1587,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1567
1587
|
}) : null]
|
|
1568
1588
|
});
|
|
1569
1589
|
}
|
|
1570
|
-
var
|
|
1590
|
+
var yt = {
|
|
1571
1591
|
check: "M4 12l5 5L20 6",
|
|
1572
1592
|
close: "M6 6l12 12M18 6L6 18",
|
|
1573
1593
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1664,8 +1684,8 @@ var vt = {
|
|
|
1664
1684
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1665
1685
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1666
1686
|
};
|
|
1667
|
-
function
|
|
1668
|
-
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", {
|
|
1669
1689
|
viewBox: "0 0 24 24",
|
|
1670
1690
|
width: g,
|
|
1671
1691
|
height: g,
|
|
@@ -1701,10 +1721,10 @@ function yt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1701
1721
|
children: v
|
|
1702
1722
|
});
|
|
1703
1723
|
}
|
|
1704
|
-
function
|
|
1705
|
-
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 = [];
|
|
1706
1726
|
for (let e of r) {
|
|
1707
|
-
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)) : "";
|
|
1708
1728
|
for (let e of s) if (o.push({
|
|
1709
1729
|
src: e,
|
|
1710
1730
|
name: c,
|
|
@@ -1714,8 +1734,8 @@ function bt(e, t = {}, n = 0) {
|
|
|
1714
1734
|
}
|
|
1715
1735
|
return o;
|
|
1716
1736
|
}
|
|
1717
|
-
function
|
|
1718
|
-
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());
|
|
1719
1739
|
a(() => {
|
|
1720
1740
|
if (!t || C) return;
|
|
1721
1741
|
let e = !0;
|
|
@@ -1732,7 +1752,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1732
1752
|
C
|
|
1733
1753
|
]);
|
|
1734
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 ? (() => {
|
|
1735
|
-
let e =
|
|
1755
|
+
let e = xt(k, {
|
|
1736
1756
|
imageField: r,
|
|
1737
1757
|
nameField: o,
|
|
1738
1758
|
hrefField: s
|
|
@@ -1746,7 +1766,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1746
1766
|
};
|
|
1747
1767
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1748
1768
|
}, [B, N.length]);
|
|
1749
|
-
let
|
|
1769
|
+
let ee = (e) => {
|
|
1750
1770
|
if (typeof e.name == "string" && e.name.trim()) return e.name;
|
|
1751
1771
|
if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
|
|
1752
1772
|
try {
|
|
@@ -1782,7 +1802,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1782
1802
|
display: "block",
|
|
1783
1803
|
borderRadius: "inherit"
|
|
1784
1804
|
}
|
|
1785
|
-
}), g &&
|
|
1805
|
+
}), g && ee(e) && /* @__PURE__ */ d("span", {
|
|
1786
1806
|
style: {
|
|
1787
1807
|
position: "absolute",
|
|
1788
1808
|
insetInline: 0,
|
|
@@ -1796,7 +1816,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1796
1816
|
overflow: "hidden",
|
|
1797
1817
|
textOverflow: "ellipsis"
|
|
1798
1818
|
},
|
|
1799
|
-
children:
|
|
1819
|
+
children: ee(e)
|
|
1800
1820
|
})]
|
|
1801
1821
|
}), i = e.href ? /* @__PURE__ */ d("a", {
|
|
1802
1822
|
href: e.href,
|
|
@@ -1867,14 +1887,14 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1867
1887
|
boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
|
|
1868
1888
|
}
|
|
1869
1889
|
}),
|
|
1870
|
-
|
|
1890
|
+
ee(N[R]) && /* @__PURE__ */ d("div", {
|
|
1871
1891
|
style: {
|
|
1872
1892
|
color: "#fff",
|
|
1873
1893
|
fontSize: 14,
|
|
1874
1894
|
marginTop: 12,
|
|
1875
1895
|
opacity: .85
|
|
1876
1896
|
},
|
|
1877
|
-
children:
|
|
1897
|
+
children: ee(N[R])
|
|
1878
1898
|
}),
|
|
1879
1899
|
/* @__PURE__ */ d("button", {
|
|
1880
1900
|
type: "button",
|
|
@@ -1937,20 +1957,20 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1937
1957
|
]
|
|
1938
1958
|
});
|
|
1939
1959
|
}
|
|
1940
|
-
var
|
|
1960
|
+
var Ct = {
|
|
1941
1961
|
color: "inherit",
|
|
1942
1962
|
textDecoration: "none",
|
|
1943
1963
|
fontSize: 14,
|
|
1944
1964
|
opacity: .85
|
|
1945
|
-
},
|
|
1965
|
+
}, wt = {
|
|
1946
1966
|
background: "var(--page-surface, #f2f2f2)",
|
|
1947
1967
|
color: "var(--page-text, #111827)",
|
|
1948
1968
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1949
1969
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1950
1970
|
zIndex: 60
|
|
1951
1971
|
};
|
|
1952
|
-
function
|
|
1953
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" :
|
|
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) => {
|
|
1954
1974
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1955
1975
|
return {
|
|
1956
1976
|
key: e.id,
|
|
@@ -1991,8 +2011,8 @@ function wt(e, t = {}, n = "dropdown") {
|
|
|
1991
2011
|
type: e.children.length ? n : "link"
|
|
1992
2012
|
}));
|
|
1993
2013
|
}
|
|
1994
|
-
function
|
|
1995
|
-
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);
|
|
1996
2016
|
a(() => {
|
|
1997
2017
|
if (!g || N) return;
|
|
1998
2018
|
let e = !0;
|
|
@@ -2012,7 +2032,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2012
2032
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2013
2033
|
return e.observe(C), () => e.disconnect();
|
|
2014
2034
|
}, [C, h]);
|
|
2015
|
-
let L = g ?
|
|
2035
|
+
let L = g ? Tt(N ?? F ?? [], {
|
|
2016
2036
|
labelField: _,
|
|
2017
2037
|
hrefField: v,
|
|
2018
2038
|
imageField: y,
|
|
@@ -2041,7 +2061,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2041
2061
|
return /* @__PURE__ */ f("a", {
|
|
2042
2062
|
href: e.href || "#",
|
|
2043
2063
|
style: {
|
|
2044
|
-
...
|
|
2064
|
+
...Ct,
|
|
2045
2065
|
display: n ? "block" : "flex",
|
|
2046
2066
|
alignItems: n ? void 0 : "center",
|
|
2047
2067
|
gap: n ? void 0 : 10,
|
|
@@ -2138,7 +2158,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2138
2158
|
let t = e.children ?? [];
|
|
2139
2159
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2140
2160
|
href: e.href || "#",
|
|
2141
|
-
style:
|
|
2161
|
+
style: Ct,
|
|
2142
2162
|
children: e.label
|
|
2143
2163
|
}, e.key);
|
|
2144
2164
|
let n = e.type === "mega";
|
|
@@ -2152,7 +2172,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2152
2172
|
children: [/* @__PURE__ */ f("a", {
|
|
2153
2173
|
href: e.href || "#",
|
|
2154
2174
|
style: {
|
|
2155
|
-
...
|
|
2175
|
+
...Ct,
|
|
2156
2176
|
cursor: "pointer"
|
|
2157
2177
|
},
|
|
2158
2178
|
children: [
|
|
@@ -2168,7 +2188,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2168
2188
|
]
|
|
2169
2189
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2170
2190
|
style: {
|
|
2171
|
-
...
|
|
2191
|
+
...wt,
|
|
2172
2192
|
position: "absolute",
|
|
2173
2193
|
left: 0,
|
|
2174
2194
|
right: 0,
|
|
@@ -2184,7 +2204,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2184
2204
|
}, !0))
|
|
2185
2205
|
}) : /* @__PURE__ */ d("div", {
|
|
2186
2206
|
style: {
|
|
2187
|
-
...
|
|
2207
|
+
...wt,
|
|
2188
2208
|
position: "absolute",
|
|
2189
2209
|
top: "100%",
|
|
2190
2210
|
left: 0,
|
|
@@ -2213,7 +2233,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2213
2233
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2214
2234
|
href: e.href || "#",
|
|
2215
2235
|
style: {
|
|
2216
|
-
...
|
|
2236
|
+
...Ct,
|
|
2217
2237
|
padding: "10px 4px",
|
|
2218
2238
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2219
2239
|
opacity: 1
|
|
@@ -2224,7 +2244,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2224
2244
|
]
|
|
2225
2245
|
});
|
|
2226
2246
|
}
|
|
2227
|
-
function
|
|
2247
|
+
function Dt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2228
2248
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2229
2249
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2230
2250
|
ref: r,
|
|
@@ -2264,55 +2284,79 @@ function Et({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2264
2284
|
}, e.key))]
|
|
2265
2285
|
}) : null;
|
|
2266
2286
|
}
|
|
2267
|
-
function
|
|
2268
|
-
let [
|
|
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 }) {
|
|
2288
|
+
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2269
2289
|
if (!e.length) return null;
|
|
2270
|
-
let
|
|
2290
|
+
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2291
|
+
let n = Number(e);
|
|
2292
|
+
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2293
|
+
}, b = yt[r], x = (e) => _((t) => {
|
|
2271
2294
|
let r = new Set(n ? t : []);
|
|
2272
2295
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2273
2296
|
});
|
|
2274
2297
|
return /* @__PURE__ */ d("div", {
|
|
2275
|
-
ref:
|
|
2298
|
+
ref: h,
|
|
2276
2299
|
style: {
|
|
2277
2300
|
width: "100%",
|
|
2278
|
-
...P(
|
|
2301
|
+
...P(m)
|
|
2279
2302
|
},
|
|
2280
2303
|
children: e.map((n, r) => {
|
|
2281
|
-
let
|
|
2304
|
+
let l = g.has(n.key);
|
|
2282
2305
|
return /* @__PURE__ */ f("div", {
|
|
2283
|
-
style: { borderBottom: r < e.length - 1 ?
|
|
2306
|
+
style: { borderBottom: r < e.length - 1 ? `1px solid ${v(p, "rgba(148, 163, 184, 0.35)")}` : "none" },
|
|
2284
2307
|
children: [/* @__PURE__ */ f("button", {
|
|
2285
2308
|
type: "button",
|
|
2286
|
-
onClick: () =>
|
|
2309
|
+
onClick: () => x(n.key),
|
|
2287
2310
|
style: {
|
|
2288
2311
|
width: "100%",
|
|
2289
2312
|
display: "flex",
|
|
2290
2313
|
alignItems: "center",
|
|
2291
2314
|
justifyContent: "space-between",
|
|
2292
2315
|
gap: 12,
|
|
2293
|
-
background: "transparent",
|
|
2316
|
+
background: l ? v(c, v(o, "transparent")) : v(o, "transparent"),
|
|
2294
2317
|
border: 0,
|
|
2295
|
-
padding:
|
|
2318
|
+
padding: `${y(a, 14)}px ${y(i, 4)}px`,
|
|
2296
2319
|
fontSize: 15,
|
|
2297
2320
|
fontWeight: 600,
|
|
2298
2321
|
fontFamily: "inherit",
|
|
2299
|
-
color: "inherit",
|
|
2322
|
+
color: l ? v(u, v(s, "inherit")) : v(s, "inherit"),
|
|
2300
2323
|
textAlign: "left",
|
|
2301
|
-
cursor: "pointer"
|
|
2324
|
+
cursor: "pointer",
|
|
2325
|
+
transition: "background 180ms, color 180ms"
|
|
2302
2326
|
},
|
|
2303
|
-
children: [
|
|
2327
|
+
children: [/* @__PURE__ */ f("span", {
|
|
2328
|
+
style: {
|
|
2329
|
+
display: "flex",
|
|
2330
|
+
alignItems: "center",
|
|
2331
|
+
gap: 10,
|
|
2332
|
+
minWidth: 0
|
|
2333
|
+
},
|
|
2334
|
+
children: [b ? /* @__PURE__ */ d("svg", {
|
|
2335
|
+
viewBox: "0 0 24 24",
|
|
2336
|
+
width: 16,
|
|
2337
|
+
height: 16,
|
|
2338
|
+
fill: "none",
|
|
2339
|
+
stroke: "currentColor",
|
|
2340
|
+
strokeWidth: 2,
|
|
2341
|
+
strokeLinecap: "round",
|
|
2342
|
+
strokeLinejoin: "round",
|
|
2343
|
+
"aria-hidden": "true",
|
|
2344
|
+
style: { flexShrink: 0 },
|
|
2345
|
+
children: /* @__PURE__ */ d("path", { d: b })
|
|
2346
|
+
}) : null, n.title || `Item ${r + 1}`]
|
|
2347
|
+
}), /* @__PURE__ */ d("span", {
|
|
2304
2348
|
"aria-hidden": !0,
|
|
2305
2349
|
style: {
|
|
2306
2350
|
fontSize: 12,
|
|
2307
2351
|
opacity: .6,
|
|
2308
|
-
transform:
|
|
2352
|
+
transform: l ? "rotate(180deg)" : "none",
|
|
2309
2353
|
transition: "transform 180ms"
|
|
2310
2354
|
},
|
|
2311
2355
|
children: "▼"
|
|
2312
2356
|
})]
|
|
2313
2357
|
}), /* @__PURE__ */ d("div", {
|
|
2314
2358
|
style: {
|
|
2315
|
-
display:
|
|
2359
|
+
display: l ? "flex" : "none",
|
|
2316
2360
|
flexDirection: "column"
|
|
2317
2361
|
},
|
|
2318
2362
|
children: t?.[n.key] ?? null
|
|
@@ -2321,15 +2365,15 @@ function Dt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
2321
2365
|
})
|
|
2322
2366
|
});
|
|
2323
2367
|
}
|
|
2324
|
-
var
|
|
2368
|
+
var kt = {
|
|
2325
2369
|
display: "flex",
|
|
2326
2370
|
flexDirection: "column",
|
|
2327
2371
|
gap: "12px"
|
|
2328
|
-
},
|
|
2372
|
+
}, At = {
|
|
2329
2373
|
fontSize: "14px",
|
|
2330
2374
|
fontWeight: 500,
|
|
2331
2375
|
color: "var(--page-text, #111827)"
|
|
2332
|
-
},
|
|
2376
|
+
}, jt = {
|
|
2333
2377
|
padding: "10px 12px",
|
|
2334
2378
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2335
2379
|
borderRadius: "6px",
|
|
@@ -2339,18 +2383,18 @@ var Ot = {
|
|
|
2339
2383
|
boxSizing: "border-box",
|
|
2340
2384
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2341
2385
|
color: "var(--page-text, #111827)"
|
|
2342
|
-
},
|
|
2386
|
+
}, Mt = {
|
|
2343
2387
|
display: "flex",
|
|
2344
2388
|
alignItems: "center",
|
|
2345
2389
|
gap: "8px",
|
|
2346
2390
|
fontSize: "14px",
|
|
2347
2391
|
color: "var(--page-text, #111827)"
|
|
2348
|
-
},
|
|
2392
|
+
}, Nt = (e) => e ? {
|
|
2349
2393
|
readOnly: !0,
|
|
2350
2394
|
tabIndex: -1,
|
|
2351
2395
|
onMouseDown: (e) => e.preventDefault()
|
|
2352
2396
|
} : {};
|
|
2353
|
-
function
|
|
2397
|
+
function Pt(e, t) {
|
|
2354
2398
|
if (!e) return !0;
|
|
2355
2399
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2356
2400
|
switch (e.op) {
|
|
@@ -2364,11 +2408,11 @@ function Nt(e, t) {
|
|
|
2364
2408
|
default: return !1;
|
|
2365
2409
|
}
|
|
2366
2410
|
}
|
|
2367
|
-
var
|
|
2411
|
+
var Ft = {
|
|
2368
2412
|
display: "flex",
|
|
2369
2413
|
flexDirection: "column",
|
|
2370
2414
|
gap: 6
|
|
2371
|
-
},
|
|
2415
|
+
}, It = {
|
|
2372
2416
|
font: "inherit",
|
|
2373
2417
|
fontSize: 15,
|
|
2374
2418
|
padding: "10px 12px",
|
|
@@ -2379,17 +2423,17 @@ var Pt = {
|
|
|
2379
2423
|
width: "100%",
|
|
2380
2424
|
boxSizing: "border-box"
|
|
2381
2425
|
};
|
|
2382
|
-
function
|
|
2426
|
+
function Lt(e, t) {
|
|
2383
2427
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2384
2428
|
if (!e?.parentField) return n;
|
|
2385
2429
|
let r = t?.[e.parentField];
|
|
2386
2430
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2387
2431
|
}
|
|
2388
|
-
var
|
|
2389
|
-
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 }) {
|
|
2390
2434
|
let a = /* @__PURE__ */ f("span", {
|
|
2391
2435
|
style: {
|
|
2392
|
-
...
|
|
2436
|
+
...At,
|
|
2393
2437
|
fontSize: 14
|
|
2394
2438
|
},
|
|
2395
2439
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2398,7 +2442,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2398
2442
|
required: e.required || void 0,
|
|
2399
2443
|
placeholder: e.placeholder || void 0,
|
|
2400
2444
|
disabled: r || void 0,
|
|
2401
|
-
style:
|
|
2445
|
+
style: It,
|
|
2402
2446
|
value: t ?? "",
|
|
2403
2447
|
onChange: (t) => n(e.name, t.target.value)
|
|
2404
2448
|
};
|
|
@@ -2427,11 +2471,11 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2427
2471
|
borderRadius: 8,
|
|
2428
2472
|
display: "block"
|
|
2429
2473
|
}
|
|
2430
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2474
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Gt, {
|
|
2431
2475
|
theme: e.captchaTheme,
|
|
2432
2476
|
size: e.captchaSize,
|
|
2433
2477
|
inert: r,
|
|
2434
|
-
onChange: (e) => n(
|
|
2478
|
+
onChange: (e) => n(Rt, e)
|
|
2435
2479
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(et, {
|
|
2436
2480
|
url: e.src,
|
|
2437
2481
|
style: { width: "100%" }
|
|
@@ -2444,14 +2488,14 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2444
2488
|
display: "block"
|
|
2445
2489
|
}
|
|
2446
2490
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2447
|
-
style:
|
|
2491
|
+
style: Ft,
|
|
2448
2492
|
children: [
|
|
2449
2493
|
a,
|
|
2450
2494
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2451
2495
|
...o,
|
|
2452
2496
|
rows: 4,
|
|
2453
2497
|
style: {
|
|
2454
|
-
...
|
|
2498
|
+
...It,
|
|
2455
2499
|
resize: "vertical"
|
|
2456
2500
|
}
|
|
2457
2501
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2460,7 +2504,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2460
2504
|
children: [/* @__PURE__ */ d("option", {
|
|
2461
2505
|
value: "",
|
|
2462
2506
|
children: e.placeholder || "—"
|
|
2463
|
-
}),
|
|
2507
|
+
}), Lt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2464
2508
|
value: typeof e == "string" ? e : e.value,
|
|
2465
2509
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2466
2510
|
}, t))]
|
|
@@ -2507,8 +2551,8 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2507
2551
|
]
|
|
2508
2552
|
});
|
|
2509
2553
|
}
|
|
2510
|
-
function
|
|
2511
|
-
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;
|
|
2512
2556
|
a(() => {
|
|
2513
2557
|
if (!c || !s) return;
|
|
2514
2558
|
let e = !0;
|
|
@@ -2529,11 +2573,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2529
2573
|
section: e,
|
|
2530
2574
|
fields: []
|
|
2531
2575
|
}) : A[A.length - 1].fields.push(e);
|
|
2532
|
-
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) => ({
|
|
2533
2577
|
...e,
|
|
2534
|
-
fields: e.fields.filter((e) =>
|
|
2578
|
+
fields: e.fields.filter((e) => Pt(e.condition, T))
|
|
2535
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) => {
|
|
2536
|
-
let t = T[
|
|
2580
|
+
let t = T[zt(e)];
|
|
2537
2581
|
return e.required && (t == null || t === "" || t === !1);
|
|
2538
2582
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2539
2583
|
let r = {
|
|
@@ -2589,11 +2633,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2589
2633
|
}
|
|
2590
2634
|
},
|
|
2591
2635
|
style: {
|
|
2592
|
-
...
|
|
2636
|
+
...kt,
|
|
2593
2637
|
display: k === "success" ? "none" : "flex"
|
|
2594
2638
|
},
|
|
2595
2639
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2596
|
-
N && /* @__PURE__ */ d(
|
|
2640
|
+
N && /* @__PURE__ */ d(gn, {
|
|
2597
2641
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2598
2642
|
active: F + 1,
|
|
2599
2643
|
style: { marginBottom: 8 }
|
|
@@ -2606,9 +2650,9 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2606
2650
|
},
|
|
2607
2651
|
children: M[F].section.help
|
|
2608
2652
|
}),
|
|
2609
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
2653
|
+
I.map((e) => /* @__PURE__ */ d(Bt, {
|
|
2610
2654
|
field: e,
|
|
2611
|
-
value: T[
|
|
2655
|
+
value: T[zt(e)],
|
|
2612
2656
|
values: T,
|
|
2613
2657
|
onChange: z,
|
|
2614
2658
|
inert: h
|
|
@@ -2679,10 +2723,10 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2679
2723
|
]
|
|
2680
2724
|
});
|
|
2681
2725
|
}
|
|
2682
|
-
var
|
|
2726
|
+
var Ht = null, Ut = null, Wt = (e) => {
|
|
2683
2727
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2684
|
-
if (
|
|
2685
|
-
if (
|
|
2728
|
+
if (Ht && Ut === t) return Ht;
|
|
2729
|
+
if (Ht && typeof window < "u") {
|
|
2686
2730
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2687
2731
|
delete window[e];
|
|
2688
2732
|
} catch {
|
|
@@ -2690,22 +2734,22 @@ var Vt = null, Ht = null, Ut = (e) => {
|
|
|
2690
2734
|
}
|
|
2691
2735
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2692
2736
|
}
|
|
2693
|
-
return
|
|
2737
|
+
return Ut = t, Ht = new Promise((e) => {
|
|
2694
2738
|
if (typeof window > "u") return;
|
|
2695
2739
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2696
2740
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2697
2741
|
let n = document.createElement("script");
|
|
2698
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);
|
|
2699
|
-
}),
|
|
2743
|
+
}), Ht;
|
|
2700
2744
|
};
|
|
2701
|
-
function
|
|
2702
|
-
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);
|
|
2703
2747
|
if (_.current = u, a(() => {
|
|
2704
2748
|
if (l || !h || !g.current) return;
|
|
2705
2749
|
let e = !0, i = (t) => {
|
|
2706
2750
|
e && typeof _.current == "function" && _.current(t);
|
|
2707
2751
|
};
|
|
2708
|
-
return
|
|
2752
|
+
return Wt(r).then((r) => {
|
|
2709
2753
|
if (!(!e || !g.current || !r?.render)) {
|
|
2710
2754
|
g.current.innerHTML = "", i("");
|
|
2711
2755
|
try {
|
|
@@ -2787,17 +2831,17 @@ function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2787
2831
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2788
2832
|
}) : null;
|
|
2789
2833
|
}
|
|
2790
|
-
function
|
|
2834
|
+
function Kt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2791
2835
|
return /* @__PURE__ */ d("label", {
|
|
2792
2836
|
ref: r,
|
|
2793
2837
|
style: {
|
|
2794
|
-
...
|
|
2838
|
+
...At,
|
|
2795
2839
|
...P(n)
|
|
2796
2840
|
},
|
|
2797
2841
|
children: Re(t, e, i)
|
|
2798
2842
|
});
|
|
2799
2843
|
}
|
|
2800
|
-
function
|
|
2844
|
+
function qt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2801
2845
|
return /* @__PURE__ */ d("input", {
|
|
2802
2846
|
ref: a,
|
|
2803
2847
|
type: e,
|
|
@@ -2805,13 +2849,13 @@ function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2805
2849
|
placeholder: n,
|
|
2806
2850
|
required: !o && !!r,
|
|
2807
2851
|
style: {
|
|
2808
|
-
...
|
|
2852
|
+
...jt,
|
|
2809
2853
|
...P(i)
|
|
2810
2854
|
},
|
|
2811
|
-
...
|
|
2855
|
+
...Nt(o)
|
|
2812
2856
|
});
|
|
2813
2857
|
}
|
|
2814
|
-
function
|
|
2858
|
+
function Jt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2815
2859
|
return /* @__PURE__ */ d("textarea", {
|
|
2816
2860
|
ref: a,
|
|
2817
2861
|
name: e || void 0,
|
|
@@ -2819,18 +2863,18 @@ function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2819
2863
|
rows: n,
|
|
2820
2864
|
required: !o && !!r,
|
|
2821
2865
|
style: {
|
|
2822
|
-
...
|
|
2866
|
+
...jt,
|
|
2823
2867
|
resize: "vertical",
|
|
2824
2868
|
...P(i)
|
|
2825
2869
|
},
|
|
2826
|
-
...
|
|
2870
|
+
...Nt(o)
|
|
2827
2871
|
});
|
|
2828
2872
|
}
|
|
2829
|
-
function
|
|
2873
|
+
function Yt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2830
2874
|
return /* @__PURE__ */ f("label", {
|
|
2831
2875
|
ref: o,
|
|
2832
2876
|
style: {
|
|
2833
|
-
...
|
|
2877
|
+
...Mt,
|
|
2834
2878
|
...P(a)
|
|
2835
2879
|
},
|
|
2836
2880
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2847,7 +2891,7 @@ function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2847
2891
|
}), t]
|
|
2848
2892
|
});
|
|
2849
2893
|
}
|
|
2850
|
-
function
|
|
2894
|
+
function Xt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2851
2895
|
return /* @__PURE__ */ f("select", {
|
|
2852
2896
|
ref: a,
|
|
2853
2897
|
name: e || void 0,
|
|
@@ -2856,7 +2900,7 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2856
2900
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2857
2901
|
tabIndex: o ? -1 : void 0,
|
|
2858
2902
|
style: {
|
|
2859
|
-
...
|
|
2903
|
+
...jt,
|
|
2860
2904
|
appearance: "auto",
|
|
2861
2905
|
...P(i)
|
|
2862
2906
|
},
|
|
@@ -2870,12 +2914,12 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2870
2914
|
}, t))]
|
|
2871
2915
|
});
|
|
2872
2916
|
}
|
|
2873
|
-
function
|
|
2917
|
+
function Zt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2874
2918
|
let [s, c] = l(null);
|
|
2875
2919
|
return /* @__PURE__ */ f("label", {
|
|
2876
2920
|
ref: a,
|
|
2877
2921
|
style: {
|
|
2878
|
-
...
|
|
2922
|
+
...jt,
|
|
2879
2923
|
display: "flex",
|
|
2880
2924
|
alignItems: "center",
|
|
2881
2925
|
gap: "8px",
|
|
@@ -2902,7 +2946,7 @@ function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2902
2946
|
]
|
|
2903
2947
|
});
|
|
2904
2948
|
}
|
|
2905
|
-
function
|
|
2949
|
+
function Qt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2906
2950
|
return /* @__PURE__ */ d("button", {
|
|
2907
2951
|
ref: n,
|
|
2908
2952
|
type: r ? "button" : "submit",
|
|
@@ -2922,7 +2966,7 @@ function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2922
2966
|
children: e
|
|
2923
2967
|
});
|
|
2924
2968
|
}
|
|
2925
|
-
function
|
|
2969
|
+
function $t({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2926
2970
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2927
2971
|
return /* @__PURE__ */ d("div", {
|
|
2928
2972
|
ref: r,
|
|
@@ -2939,8 +2983,8 @@ function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2939
2983
|
}, t))
|
|
2940
2984
|
});
|
|
2941
2985
|
}
|
|
2942
|
-
function
|
|
2943
|
-
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);
|
|
2944
2988
|
a(() => {
|
|
2945
2989
|
if (typeof window > "u") return;
|
|
2946
2990
|
let e = () => C((e) => e + 1);
|
|
@@ -2993,7 +3037,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2993
3037
|
},
|
|
2994
3038
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
2995
3039
|
style: { minWidth: 0 },
|
|
2996
|
-
children: x.render(p, (t) =>
|
|
3040
|
+
children: x.render(p, (t) => Q(t, e))
|
|
2997
3041
|
}, e.id ?? e?.data?.slug))
|
|
2998
3042
|
}) : /* @__PURE__ */ d("div", {
|
|
2999
3043
|
ref: _,
|
|
@@ -3003,7 +3047,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3003
3047
|
...P(g)
|
|
3004
3048
|
},
|
|
3005
3049
|
children: M.map((e) => {
|
|
3006
|
-
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";
|
|
3007
3051
|
return /* @__PURE__ */ f("div", {
|
|
3008
3052
|
style: {
|
|
3009
3053
|
display: "flex",
|
|
@@ -3058,7 +3102,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3058
3102
|
})
|
|
3059
3103
|
});
|
|
3060
3104
|
}
|
|
3061
|
-
function
|
|
3105
|
+
function tn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3062
3106
|
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
|
|
3063
3107
|
height: 34,
|
|
3064
3108
|
padding: "0 12px",
|
|
@@ -3107,7 +3151,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3107
3151
|
name: `f_${e.name}`,
|
|
3108
3152
|
defaultValue: o[e.name] ?? "",
|
|
3109
3153
|
style: s,
|
|
3110
|
-
...
|
|
3154
|
+
...Nt(i),
|
|
3111
3155
|
children: [/* @__PURE__ */ d("option", {
|
|
3112
3156
|
value: "",
|
|
3113
3157
|
children: e.label || e.name
|
|
@@ -3122,7 +3166,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3122
3166
|
name: `f_${e.name}`,
|
|
3123
3167
|
defaultValue: o[e.name] ?? "",
|
|
3124
3168
|
style: s,
|
|
3125
|
-
...
|
|
3169
|
+
...Nt(i),
|
|
3126
3170
|
children: [
|
|
3127
3171
|
/* @__PURE__ */ d("option", {
|
|
3128
3172
|
value: "",
|
|
@@ -3143,7 +3187,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3143
3187
|
defaultValue: o[e.name] ?? "",
|
|
3144
3188
|
placeholder: e.label || e.name,
|
|
3145
3189
|
style: s,
|
|
3146
|
-
...
|
|
3190
|
+
...Nt(i)
|
|
3147
3191
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3148
3192
|
type: "submit",
|
|
3149
3193
|
style: {
|
|
@@ -3156,12 +3200,12 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3156
3200
|
fontWeight: 600,
|
|
3157
3201
|
cursor: i ? "default" : "pointer"
|
|
3158
3202
|
},
|
|
3159
|
-
...
|
|
3203
|
+
...Nt(i),
|
|
3160
3204
|
children: t
|
|
3161
3205
|
})]
|
|
3162
3206
|
});
|
|
3163
3207
|
}
|
|
3164
|
-
function
|
|
3208
|
+
function nn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3165
3209
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3166
3210
|
ref: r,
|
|
3167
3211
|
"aria-label": "Breadcrumb",
|
|
@@ -3211,8 +3255,8 @@ function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3211
3255
|
})
|
|
3212
3256
|
}) : null;
|
|
3213
3257
|
}
|
|
3214
|
-
function
|
|
3215
|
-
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;
|
|
3216
3260
|
a(() => {
|
|
3217
3261
|
if (!o || Number.isFinite(x)) return;
|
|
3218
3262
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3296,15 +3340,15 @@ function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3296
3340
|
]
|
|
3297
3341
|
});
|
|
3298
3342
|
}
|
|
3299
|
-
var
|
|
3343
|
+
var an = "webim.page_mode", on = () => {
|
|
3300
3344
|
if (typeof window > "u") return "auto";
|
|
3301
3345
|
try {
|
|
3302
|
-
let e = window.localStorage.getItem(
|
|
3346
|
+
let e = window.localStorage.getItem(an);
|
|
3303
3347
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3304
3348
|
} catch {
|
|
3305
3349
|
return "auto";
|
|
3306
3350
|
}
|
|
3307
|
-
},
|
|
3351
|
+
}, sn = (e) => {
|
|
3308
3352
|
let t = {
|
|
3309
3353
|
width: 16,
|
|
3310
3354
|
height: 16,
|
|
@@ -3336,13 +3380,13 @@ var rn = "webim.page_mode", an = () => {
|
|
|
3336
3380
|
rx: "2"
|
|
3337
3381
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3338
3382
|
});
|
|
3339
|
-
},
|
|
3383
|
+
}, cn = {
|
|
3340
3384
|
light: "Light theme",
|
|
3341
3385
|
dark: "Dark theme",
|
|
3342
3386
|
auto: "Follow the device theme"
|
|
3343
3387
|
};
|
|
3344
|
-
function
|
|
3345
|
-
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) => {
|
|
3346
3390
|
u.current = e, typeof r == "function" && r(e);
|
|
3347
3391
|
};
|
|
3348
3392
|
a(() => {
|
|
@@ -3350,7 +3394,7 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3350
3394
|
let e = u.current?.closest?.(".webim-page");
|
|
3351
3395
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3352
3396
|
try {
|
|
3353
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3397
|
+
o === "auto" ? window.localStorage.removeItem(an) : window.localStorage.setItem(an, o);
|
|
3354
3398
|
} catch {}
|
|
3355
3399
|
}, [o, i]);
|
|
3356
3400
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3385,8 +3429,8 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3385
3429
|
},
|
|
3386
3430
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3387
3431
|
type: "button",
|
|
3388
|
-
title:
|
|
3389
|
-
"aria-label":
|
|
3432
|
+
title: cn[e],
|
|
3433
|
+
"aria-label": cn[e],
|
|
3390
3434
|
"aria-pressed": e === m,
|
|
3391
3435
|
onClick: i ? void 0 : () => s(e),
|
|
3392
3436
|
style: {
|
|
@@ -3397,15 +3441,15 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3397
3441
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3398
3442
|
opacity: e === m ? 1 : .7
|
|
3399
3443
|
},
|
|
3400
|
-
children:
|
|
3444
|
+
children: sn(e)
|
|
3401
3445
|
}, e))
|
|
3402
3446
|
});
|
|
3403
3447
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3404
3448
|
return /* @__PURE__ */ d("button", {
|
|
3405
3449
|
ref: f,
|
|
3406
3450
|
type: "button",
|
|
3407
|
-
title:
|
|
3408
|
-
"aria-label": `Theme: ${
|
|
3451
|
+
title: cn[m],
|
|
3452
|
+
"aria-label": `Theme: ${cn[m]} — switch to ${cn[g]}`,
|
|
3409
3453
|
onClick: i ? void 0 : () => s(g),
|
|
3410
3454
|
style: {
|
|
3411
3455
|
...h,
|
|
@@ -3414,10 +3458,10 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3414
3458
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3415
3459
|
...P(n)
|
|
3416
3460
|
},
|
|
3417
|
-
children:
|
|
3461
|
+
children: sn(m)
|
|
3418
3462
|
});
|
|
3419
3463
|
}
|
|
3420
|
-
function
|
|
3464
|
+
function un(e) {
|
|
3421
3465
|
let t = e?.parentElement;
|
|
3422
3466
|
for (; t && t !== document.body;) {
|
|
3423
3467
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3426,7 +3470,7 @@ function ln(e) {
|
|
|
3426
3470
|
}
|
|
3427
3471
|
return window;
|
|
3428
3472
|
}
|
|
3429
|
-
var
|
|
3473
|
+
var dn = (e) => e === window ? window.scrollY : e.scrollTop, fn = {
|
|
3430
3474
|
"bottom-right": (e) => ({
|
|
3431
3475
|
right: e,
|
|
3432
3476
|
bottom: e
|
|
@@ -3441,7 +3485,7 @@ var un = (e) => e === window ? window.scrollY : e.scrollTop, dn = {
|
|
|
3441
3485
|
transform: "translateX(-50%)"
|
|
3442
3486
|
})
|
|
3443
3487
|
};
|
|
3444
|
-
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 }) {
|
|
3445
3489
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3446
3490
|
b(e), typeof p == "function" && p(e);
|
|
3447
3491
|
};
|
|
@@ -3452,8 +3496,8 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3452
3496
|
}
|
|
3453
3497
|
if (!y) return;
|
|
3454
3498
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3455
|
-
let t =
|
|
3456
|
-
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);
|
|
3457
3501
|
};
|
|
3458
3502
|
return t(), document.addEventListener("scroll", t, {
|
|
3459
3503
|
capture: !0,
|
|
@@ -3467,7 +3511,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3467
3511
|
]);
|
|
3468
3512
|
let S = () => {
|
|
3469
3513
|
if (m) return;
|
|
3470
|
-
let e =
|
|
3514
|
+
let e = un(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3471
3515
|
e === window ? window.scrollTo({
|
|
3472
3516
|
top: 0,
|
|
3473
3517
|
behavior: n
|
|
@@ -3475,7 +3519,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3475
3519
|
top: 0,
|
|
3476
3520
|
behavior: n
|
|
3477
3521
|
});
|
|
3478
|
-
}, 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 ? {
|
|
3479
3523
|
position: "fixed",
|
|
3480
3524
|
zIndex: 5,
|
|
3481
3525
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3488,7 +3532,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3488
3532
|
} : {
|
|
3489
3533
|
position: "fixed",
|
|
3490
3534
|
zIndex: 2147482e3,
|
|
3491
|
-
...
|
|
3535
|
+
...fn[E](C)
|
|
3492
3536
|
};
|
|
3493
3537
|
return /* @__PURE__ */ f("button", {
|
|
3494
3538
|
ref: x,
|
|
@@ -3539,7 +3583,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3539
3583
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3540
3584
|
});
|
|
3541
3585
|
}
|
|
3542
|
-
var
|
|
3586
|
+
var mn = {
|
|
3543
3587
|
facebook: {
|
|
3544
3588
|
label: "Facebook",
|
|
3545
3589
|
color: "#1877f2",
|
|
@@ -3606,8 +3650,8 @@ var pn = {
|
|
|
3606
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"
|
|
3607
3651
|
}
|
|
3608
3652
|
};
|
|
3609
|
-
function
|
|
3610
|
-
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]) : [];
|
|
3611
3655
|
if (!l.length) return null;
|
|
3612
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;
|
|
3613
3657
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3620,7 +3664,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3620
3664
|
...P(o)
|
|
3621
3665
|
},
|
|
3622
3666
|
children: l.map((e, r) => {
|
|
3623
|
-
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);
|
|
3624
3668
|
return /* @__PURE__ */ d("a", {
|
|
3625
3669
|
href: e.url || "#",
|
|
3626
3670
|
onClick: h,
|
|
@@ -3654,7 +3698,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3654
3698
|
})
|
|
3655
3699
|
});
|
|
3656
3700
|
}
|
|
3657
|
-
function
|
|
3701
|
+
function gn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3658
3702
|
if (!e.length) return null;
|
|
3659
3703
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3660
3704
|
width: 32,
|
|
@@ -3732,7 +3776,7 @@ function hn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3732
3776
|
})
|
|
3733
3777
|
});
|
|
3734
3778
|
}
|
|
3735
|
-
var
|
|
3779
|
+
var _n = {
|
|
3736
3780
|
small: {
|
|
3737
3781
|
w: 132,
|
|
3738
3782
|
h: 46,
|
|
@@ -3754,74 +3798,123 @@ var gn = {
|
|
|
3754
3798
|
title: 12.5,
|
|
3755
3799
|
avatar: 46
|
|
3756
3800
|
}
|
|
3757
|
-
},
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
let
|
|
3761
|
-
|
|
3762
|
-
|
|
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) => {
|
|
3763
3816
|
if (t.has(e.id)) return 0;
|
|
3764
3817
|
t.add(e.id);
|
|
3765
|
-
let n =
|
|
3766
|
-
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;
|
|
3767
3820
|
};
|
|
3768
|
-
|
|
3769
|
-
let
|
|
3770
|
-
if (
|
|
3771
|
-
|
|
3772
|
-
let
|
|
3773
|
-
|
|
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({
|
|
3774
3827
|
node: e,
|
|
3775
|
-
x:
|
|
3776
|
-
y:
|
|
3777
|
-
})
|
|
3778
|
-
let
|
|
3779
|
-
|
|
3780
|
-
let
|
|
3781
|
-
|
|
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 ? {
|
|
3782
3851
|
from: {
|
|
3783
|
-
x:
|
|
3784
|
-
y:
|
|
3852
|
+
x: d + i.w,
|
|
3853
|
+
y: c + i.h / 2
|
|
3785
3854
|
},
|
|
3786
3855
|
to: {
|
|
3787
|
-
x:
|
|
3788
|
-
y:
|
|
3856
|
+
x: u,
|
|
3857
|
+
y: l
|
|
3789
3858
|
}
|
|
3790
3859
|
} : {
|
|
3791
3860
|
from: {
|
|
3792
|
-
x:
|
|
3793
|
-
y:
|
|
3861
|
+
x: c + i.w / 2,
|
|
3862
|
+
y: d + i.h
|
|
3794
3863
|
},
|
|
3795
3864
|
to: {
|
|
3796
|
-
x:
|
|
3797
|
-
y:
|
|
3865
|
+
x: l,
|
|
3866
|
+
y: u
|
|
3798
3867
|
}
|
|
3799
|
-
}),
|
|
3800
|
-
}
|
|
3801
|
-
},
|
|
3802
|
-
|
|
3803
|
-
|
|
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
|
+
}
|
|
3804
3896
|
return {
|
|
3805
|
-
boxes:
|
|
3806
|
-
links:
|
|
3807
|
-
|
|
3808
|
-
|
|
3897
|
+
boxes: h,
|
|
3898
|
+
links: g,
|
|
3899
|
+
groups: w,
|
|
3900
|
+
width: T,
|
|
3901
|
+
height: E,
|
|
3809
3902
|
horizontal: n
|
|
3810
3903
|
};
|
|
3811
3904
|
}
|
|
3812
|
-
var
|
|
3905
|
+
var Sn = (e, t) => {
|
|
3813
3906
|
let n = String(e ?? "");
|
|
3814
3907
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3815
|
-
},
|
|
3908
|
+
}, Cn = (e) => {
|
|
3816
3909
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3817
3910
|
if (!t) return "#ffffff";
|
|
3818
3911
|
let n = t[1];
|
|
3819
3912
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3820
3913
|
let r = parseInt(n, 16);
|
|
3821
3914
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3822
|
-
},
|
|
3823
|
-
function
|
|
3824
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" :
|
|
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);
|
|
3825
3918
|
return n.map((e) => {
|
|
3826
3919
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3827
3920
|
return {
|
|
@@ -3831,15 +3924,16 @@ function Sn(e, t = {}) {
|
|
|
3831
3924
|
photo: t.photoField && r(n[t.photoField]) || "",
|
|
3832
3925
|
parent: t.parentField ? o : null,
|
|
3833
3926
|
cv: t.cvField ? i(n[t.cvField]) : "",
|
|
3834
|
-
href: t.hrefField ? i(n[t.hrefField]) : ""
|
|
3927
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3928
|
+
group: t.groupField ? i(n[t.groupField]) : ""
|
|
3835
3929
|
};
|
|
3836
3930
|
});
|
|
3837
3931
|
}
|
|
3838
|
-
var
|
|
3932
|
+
var En = {
|
|
3839
3933
|
size: 36,
|
|
3840
3934
|
pad: 10
|
|
3841
3935
|
};
|
|
3842
|
-
function
|
|
3936
|
+
function Dn({ node: e, onClose: t }) {
|
|
3843
3937
|
return a(() => {
|
|
3844
3938
|
let e = (e) => e.key === "Escape" && t();
|
|
3845
3939
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3960,36 +4054,38 @@ function wn({ node: e, onClose: t }) {
|
|
|
3960
4054
|
})
|
|
3961
4055
|
});
|
|
3962
4056
|
}
|
|
3963
|
-
function
|
|
3964
|
-
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);
|
|
3965
4059
|
a(() => {
|
|
3966
|
-
if (!t ||
|
|
4060
|
+
if (!t || O) return;
|
|
3967
4061
|
let e = !0;
|
|
3968
|
-
return fetch(`${
|
|
4062
|
+
return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
|
|
3969
4063
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3970
|
-
e &&
|
|
3971
|
-
}).catch(() => e &&
|
|
4064
|
+
e && A(n);
|
|
4065
|
+
}).catch(() => e && A([])), () => {
|
|
3972
4066
|
e = !1;
|
|
3973
4067
|
};
|
|
3974
4068
|
}, [
|
|
3975
4069
|
t,
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
4070
|
+
E,
|
|
4071
|
+
D,
|
|
4072
|
+
O
|
|
3979
4073
|
]);
|
|
3980
|
-
let
|
|
4074
|
+
let j = t ? Tn(O ?? k ?? [], {
|
|
3981
4075
|
nameField: n,
|
|
3982
4076
|
titleField: r,
|
|
3983
4077
|
photoField: s,
|
|
3984
4078
|
parentField: c,
|
|
3985
4079
|
cvField: p,
|
|
3986
|
-
hrefField: m
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
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
|
|
3990
4086
|
});
|
|
3991
|
-
if (!
|
|
3992
|
-
ref:
|
|
4087
|
+
if (!N.length) return !S && t ? /* @__PURE__ */ f("div", {
|
|
4088
|
+
ref: x,
|
|
3993
4089
|
style: {
|
|
3994
4090
|
padding: 18,
|
|
3995
4091
|
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
@@ -3997,7 +4093,7 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
3997
4093
|
fontSize: 13,
|
|
3998
4094
|
opacity: .7,
|
|
3999
4095
|
textAlign: "center",
|
|
4000
|
-
...P(
|
|
4096
|
+
...P(b)
|
|
4001
4097
|
},
|
|
4002
4098
|
children: [
|
|
4003
4099
|
"Org Chart — no published entries in “",
|
|
@@ -4005,151 +4101,174 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4005
4101
|
"” yet"
|
|
4006
4102
|
]
|
|
4007
4103
|
}) : null;
|
|
4008
|
-
let
|
|
4104
|
+
let z = new Set(N.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
4009
4105
|
return /* @__PURE__ */ f("div", {
|
|
4010
|
-
ref:
|
|
4106
|
+
ref: x,
|
|
4011
4107
|
style: {
|
|
4012
4108
|
maxWidth: "100%",
|
|
4013
4109
|
overflowX: "auto",
|
|
4014
|
-
...P(
|
|
4110
|
+
...P(b)
|
|
4015
4111
|
},
|
|
4016
4112
|
children: [/* @__PURE__ */ f("svg", {
|
|
4017
|
-
viewBox: `0 0 ${
|
|
4113
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
4018
4114
|
role: "img",
|
|
4019
4115
|
"aria-label": "Organization chart",
|
|
4020
4116
|
style: {
|
|
4021
4117
|
display: "block",
|
|
4022
4118
|
width: "100%",
|
|
4023
|
-
maxWidth:
|
|
4119
|
+
maxWidth: L,
|
|
4024
4120
|
height: "auto",
|
|
4025
4121
|
margin: "0 auto"
|
|
4026
4122
|
},
|
|
4027
|
-
children: [
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
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", {
|
|
4063
4172
|
x: t,
|
|
4064
4173
|
y: n,
|
|
4065
|
-
width:
|
|
4066
|
-
height:
|
|
4067
|
-
rx: "10"
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
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", {
|
|
4072
4203
|
x: t,
|
|
4073
4204
|
y: n,
|
|
4074
|
-
width:
|
|
4075
|
-
height:
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
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
|
-
textAnchor: h,
|
|
4138
|
-
fontSize: k.title,
|
|
4139
|
-
opacity: "0.7",
|
|
4140
|
-
fill: s,
|
|
4141
|
-
children: yn(v[1], g + 4)
|
|
4142
|
-
})] })
|
|
4143
|
-
]
|
|
4144
|
-
}, e.id);
|
|
4145
|
-
})]
|
|
4146
|
-
}), x && /* @__PURE__ */ d(wn, {
|
|
4147
|
-
node: x,
|
|
4148
|
-
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)
|
|
4149
4268
|
})]
|
|
4150
4269
|
});
|
|
4151
4270
|
}
|
|
4152
|
-
function
|
|
4271
|
+
function kn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4153
4272
|
let [i, o] = l(!1), s = c(null);
|
|
4154
4273
|
return a(() => {
|
|
4155
4274
|
if (!i || !s.current) return;
|
|
@@ -4179,7 +4298,7 @@ function En({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4179
4298
|
children: e ?? ""
|
|
4180
4299
|
});
|
|
4181
4300
|
}
|
|
4182
|
-
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) => {
|
|
4183
4302
|
if (!e || typeof e != "object") return e ?? "";
|
|
4184
4303
|
let t = String(e.text ?? "");
|
|
4185
4304
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4190,91 +4309,91 @@ var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4190
4309
|
children: t
|
|
4191
4310
|
}) : t;
|
|
4192
4311
|
};
|
|
4193
|
-
function
|
|
4194
|
-
let
|
|
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({
|
|
4195
4314
|
r: e,
|
|
4196
4315
|
c: t
|
|
4197
4316
|
});
|
|
4198
4317
|
a(() => {
|
|
4199
|
-
if (!
|
|
4200
|
-
let e =
|
|
4318
|
+
if (!N) return;
|
|
4319
|
+
let e = I.current, t = L && e?.querySelector(`[data-cell="${L.r}-${L.c}"]`);
|
|
4201
4320
|
if (!t) {
|
|
4202
|
-
|
|
4321
|
+
z && B(null);
|
|
4203
4322
|
return;
|
|
4204
4323
|
}
|
|
4205
4324
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4206
4325
|
top: r.bottom - n.top + 4,
|
|
4207
|
-
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))
|
|
4208
4327
|
};
|
|
4209
|
-
(
|
|
4328
|
+
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4210
4329
|
}), a(() => {
|
|
4211
|
-
if (!
|
|
4330
|
+
if (!N || !L) return;
|
|
4212
4331
|
let e = (e) => {
|
|
4213
|
-
|
|
4332
|
+
I.current?.contains(e.target) || R(null);
|
|
4214
4333
|
};
|
|
4215
4334
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4216
|
-
}, [
|
|
4217
|
-
let { tenant: V, apiUrl:
|
|
4335
|
+
}, [N, L]);
|
|
4336
|
+
let { tenant: V, apiUrl: H } = i(J), te = i(ye), ne = te?.[h], re = C ? be(te) : 1, [ie, ae] = l(null);
|
|
4218
4337
|
if (a(() => {
|
|
4219
|
-
if (!h ||
|
|
4220
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
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}`;
|
|
4221
4340
|
return fetch(r, { headers: V ? { "x-tenant": V } : {} }).then((e) => e.json()).then((t) => {
|
|
4222
4341
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4223
|
-
return e &&
|
|
4224
|
-
}).catch(() => e &&
|
|
4342
|
+
return e && ae(n);
|
|
4343
|
+
}).catch(() => e && ae([])), () => {
|
|
4225
4344
|
e = !1;
|
|
4226
4345
|
};
|
|
4227
4346
|
}, [
|
|
4228
4347
|
h,
|
|
4229
4348
|
V,
|
|
4230
|
-
|
|
4231
|
-
|
|
4349
|
+
H,
|
|
4350
|
+
ne,
|
|
4232
4351
|
C,
|
|
4233
|
-
|
|
4352
|
+
re,
|
|
4234
4353
|
g
|
|
4235
4354
|
]), !e.length) return null;
|
|
4236
|
-
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 ? {
|
|
4237
4356
|
y: 6,
|
|
4238
4357
|
x: 10
|
|
4239
4358
|
} : {
|
|
4240
4359
|
y: 10,
|
|
4241
4360
|
x: 14
|
|
4242
|
-
},
|
|
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 = [
|
|
4243
4362
|
"left",
|
|
4244
4363
|
"center",
|
|
4245
4364
|
"right"
|
|
4246
|
-
],
|
|
4247
|
-
...
|
|
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,
|
|
4248
4367
|
maxHeight: void 0
|
|
4249
|
-
} :
|
|
4250
|
-
if (!
|
|
4368
|
+
} : q, ve = !!N && N.rows !== !1, xe = (t) => (r) => {
|
|
4369
|
+
if (!N?.resize || t >= e.length - 1) return;
|
|
4251
4370
|
r.preventDefault(), r.stopPropagation();
|
|
4252
|
-
let i =
|
|
4371
|
+
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4253
4372
|
if (!a) return;
|
|
4254
|
-
let o =
|
|
4373
|
+
let o = de ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4255
4374
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4256
|
-
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10,
|
|
4375
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4257
4376
|
}, u = () => {
|
|
4258
4377
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4259
4378
|
};
|
|
4260
4379
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4261
4380
|
}, Se = /* @__PURE__ */ new Set();
|
|
4262
|
-
p &&
|
|
4263
|
-
let i = p[
|
|
4381
|
+
p && se.forEach((t, n) => e.forEach((e, t) => {
|
|
4382
|
+
let i = p[Mn(r[n], o[t])];
|
|
4264
4383
|
if (!i) return;
|
|
4265
4384
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4266
4385
|
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && Se.add(`${n + e},${t + r}`);
|
|
4267
4386
|
}));
|
|
4268
4387
|
let Ce = (e) => (t) => {
|
|
4269
|
-
if (!
|
|
4388
|
+
if (!N?.resizeRow) return;
|
|
4270
4389
|
t.preventDefault(), t.stopPropagation();
|
|
4271
4390
|
let n = t.currentTarget.closest("tr");
|
|
4272
4391
|
if (!n) return;
|
|
4273
|
-
let r = t.clientY, i = n.offsetHeight, a = (t) =>
|
|
4392
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => N.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4274
4393
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4275
4394
|
};
|
|
4276
4395
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4277
|
-
},
|
|
4396
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4278
4397
|
className: "wb-tedit-btn",
|
|
4279
4398
|
role: "button",
|
|
4280
4399
|
"data-hint": t,
|
|
@@ -4283,45 +4402,45 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4283
4402
|
},
|
|
4284
4403
|
onClick: n,
|
|
4285
4404
|
children: e
|
|
4286
|
-
}, 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);
|
|
4287
4406
|
return /* @__PURE__ */ f("div", {
|
|
4288
4407
|
ref: (e) => {
|
|
4289
|
-
|
|
4408
|
+
I.current = e, typeof M == "function" && M(e);
|
|
4290
4409
|
},
|
|
4291
4410
|
style: {
|
|
4292
4411
|
width: "100%",
|
|
4293
|
-
...
|
|
4412
|
+
...N ? { position: "relative" } : null,
|
|
4294
4413
|
..._e
|
|
4295
4414
|
},
|
|
4296
4415
|
children: [
|
|
4297
|
-
|
|
4298
|
-
|
|
4416
|
+
N && /* @__PURE__ */ d("style", { children: jn }),
|
|
4417
|
+
N && Z && z && /* @__PURE__ */ f("div", {
|
|
4299
4418
|
className: "wb-tedit-bar",
|
|
4300
4419
|
style: {
|
|
4301
|
-
top:
|
|
4302
|
-
left:
|
|
4420
|
+
top: z.top,
|
|
4421
|
+
left: z.left
|
|
4303
4422
|
},
|
|
4304
4423
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4305
4424
|
children: [
|
|
4306
4425
|
/* @__PURE__ */ d("span", {
|
|
4307
4426
|
className: "wb-tedit-at",
|
|
4308
|
-
children: `R${
|
|
4427
|
+
children: `R${Z.r + 1}·C${Z.c + 1}`
|
|
4309
4428
|
}),
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
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),
|
|
4315
4434
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
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),
|
|
4321
4440
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
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)
|
|
4325
4444
|
]
|
|
4326
4445
|
}),
|
|
4327
4446
|
/* @__PURE__ */ d("div", {
|
|
@@ -4334,78 +4453,78 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4334
4453
|
} : null
|
|
4335
4454
|
},
|
|
4336
4455
|
children: /* @__PURE__ */ f("table", {
|
|
4337
|
-
ref:
|
|
4456
|
+
ref: F,
|
|
4338
4457
|
style: {
|
|
4339
4458
|
width: "100%",
|
|
4340
4459
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4341
4460
|
borderSpacing: 0,
|
|
4342
4461
|
fontSize: 14,
|
|
4343
|
-
...
|
|
4344
|
-
...y ? { border:
|
|
4462
|
+
...de ? { tableLayout: "fixed" } : null,
|
|
4463
|
+
...y ? { border: ue } : {}
|
|
4345
4464
|
},
|
|
4346
4465
|
children: [
|
|
4347
|
-
|
|
4466
|
+
de && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4348
4467
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4349
|
-
className:
|
|
4468
|
+
className: N ? "wb-tedit-head" : void 0,
|
|
4350
4469
|
style: {
|
|
4351
|
-
textAlign:
|
|
4470
|
+
textAlign: me(n),
|
|
4352
4471
|
fontWeight: 600,
|
|
4353
|
-
padding:
|
|
4472
|
+
padding: W,
|
|
4354
4473
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4355
4474
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4356
4475
|
...T ? {
|
|
4357
4476
|
position: "sticky",
|
|
4358
4477
|
top: 0,
|
|
4359
4478
|
zIndex: 2
|
|
4360
|
-
} :
|
|
4361
|
-
...
|
|
4479
|
+
} : N ? { position: "relative" } : null,
|
|
4480
|
+
...G
|
|
4362
4481
|
},
|
|
4363
|
-
children:
|
|
4482
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(kn, {
|
|
4364
4483
|
value: t.label ?? t,
|
|
4365
|
-
onCommit: (e) =>
|
|
4366
|
-
hint:
|
|
4484
|
+
onCommit: (e) => N.header(n, e),
|
|
4485
|
+
hint: Q("editCell", "Double-click to edit"),
|
|
4367
4486
|
style: { paddingRight: 6 }
|
|
4368
4487
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4369
4488
|
className: "wb-tedit-grip",
|
|
4370
|
-
title:
|
|
4489
|
+
title: Q("colWidth", "Drag to resize the column"),
|
|
4371
4490
|
onPointerDown: xe(n)
|
|
4372
4491
|
})] }) : t.label ?? t
|
|
4373
4492
|
}, n)) }) }),
|
|
4374
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
4493
|
+
/* @__PURE__ */ f("tbody", { children: [ce && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4375
4494
|
colSpan: e.length,
|
|
4376
4495
|
style: {
|
|
4377
|
-
padding:
|
|
4496
|
+
padding: W,
|
|
4378
4497
|
textAlign: "center",
|
|
4379
4498
|
opacity: .6,
|
|
4380
|
-
...
|
|
4499
|
+
...G
|
|
4381
4500
|
},
|
|
4382
4501
|
children: w || "No data yet"
|
|
4383
|
-
}) }),
|
|
4384
|
-
className:
|
|
4502
|
+
}) }), se.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4503
|
+
className: N ? "wb-tedit-row" : void 0,
|
|
4385
4504
|
style: {
|
|
4386
4505
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4387
4506
|
...Number.isFinite(Number(s?.[n])) && s[n] > 0 ? { height: s[n] } : null
|
|
4388
4507
|
},
|
|
4389
4508
|
children: e.map((e, i) => {
|
|
4390
4509
|
if (Se.has(`${n},${i}`)) return null;
|
|
4391
|
-
let a =
|
|
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);
|
|
4392
4511
|
return /* @__PURE__ */ f("td", {
|
|
4393
|
-
className:
|
|
4394
|
-
onMouseDownCapture: ve ?
|
|
4395
|
-
"data-cell":
|
|
4512
|
+
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4513
|
+
onMouseDownCapture: ve ? ee(n, i) : void 0,
|
|
4514
|
+
"data-cell": N ? `${n}-${i}` : void 0,
|
|
4396
4515
|
colSpan: l > 1 ? l : void 0,
|
|
4397
4516
|
rowSpan: u > 1 ? u : void 0,
|
|
4398
4517
|
style: {
|
|
4399
|
-
padding:
|
|
4400
|
-
...
|
|
4401
|
-
...
|
|
4402
|
-
...
|
|
4518
|
+
padding: W,
|
|
4519
|
+
...pe(i) ? { textAlign: pe(i) } : null,
|
|
4520
|
+
...N ? { position: "relative" } : null,
|
|
4521
|
+
...G
|
|
4403
4522
|
},
|
|
4404
|
-
children: [s ??
|
|
4523
|
+
children: [s ?? Nn(t?.[i]), N && ve && /* @__PURE__ */ d("span", {
|
|
4405
4524
|
className: "wb-tedit-rowgrip",
|
|
4406
|
-
title:
|
|
4525
|
+
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4407
4526
|
onPointerDown: Ce(n),
|
|
4408
|
-
onDoubleClick: () =>
|
|
4527
|
+
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4409
4528
|
})]
|
|
4410
4529
|
}, i);
|
|
4411
4530
|
})
|
|
@@ -4416,7 +4535,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4416
4535
|
]
|
|
4417
4536
|
});
|
|
4418
4537
|
}
|
|
4419
|
-
var
|
|
4538
|
+
var Fn = {
|
|
4420
4539
|
small: {
|
|
4421
4540
|
cell: 62,
|
|
4422
4541
|
font: 10.5,
|
|
@@ -4441,9 +4560,9 @@ var Mn = {
|
|
|
4441
4560
|
pad: 8,
|
|
4442
4561
|
gap: 4
|
|
4443
4562
|
}
|
|
4444
|
-
},
|
|
4445
|
-
function
|
|
4446
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" :
|
|
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) => {
|
|
4447
4566
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4448
4567
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4449
4568
|
};
|
|
@@ -4459,7 +4578,7 @@ function In(e, t = {}) {
|
|
|
4459
4578
|
} : null;
|
|
4460
4579
|
}).filter(Boolean);
|
|
4461
4580
|
}
|
|
4462
|
-
function
|
|
4581
|
+
function Bn(e) {
|
|
4463
4582
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4464
4583
|
let n = e?.start ? new Date(e.start) : null;
|
|
4465
4584
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4474,20 +4593,20 @@ function Ln(e) {
|
|
|
4474
4593
|
};
|
|
4475
4594
|
}).filter(Boolean);
|
|
4476
4595
|
}
|
|
4477
|
-
function
|
|
4596
|
+
function Vn(e) {
|
|
4478
4597
|
let t = /* @__PURE__ */ new Map();
|
|
4479
4598
|
for (let n of e) {
|
|
4480
|
-
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);
|
|
4481
4600
|
for (let r = 0; r <= i; r += 1) {
|
|
4482
|
-
let i =
|
|
4601
|
+
let i = In(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4483
4602
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4484
4603
|
}
|
|
4485
4604
|
}
|
|
4486
4605
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4487
4606
|
return t;
|
|
4488
4607
|
}
|
|
4489
|
-
function
|
|
4490
|
-
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(() => {
|
|
4491
4610
|
let e = /* @__PURE__ */ new Date();
|
|
4492
4611
|
return {
|
|
4493
4612
|
year: e.getFullYear(),
|
|
@@ -4509,13 +4628,13 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4509
4628
|
E,
|
|
4510
4629
|
O
|
|
4511
4630
|
]);
|
|
4512
|
-
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 ?? [], {
|
|
4513
4632
|
titleField: n,
|
|
4514
4633
|
startField: r,
|
|
4515
4634
|
endField: o,
|
|
4516
4635
|
hrefField: s,
|
|
4517
4636
|
colorField: c
|
|
4518
|
-
}) :
|
|
4637
|
+
}) : Bn(e), B = Vn(z), ee = D || void 0, V = (e, t) => {
|
|
4519
4638
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4520
4639
|
width: 6,
|
|
4521
4640
|
height: 6,
|
|
@@ -4553,19 +4672,19 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4553
4672
|
title: e.title,
|
|
4554
4673
|
children: n
|
|
4555
4674
|
}, e.key);
|
|
4556
|
-
}, H = new Intl.DateTimeFormat(
|
|
4675
|
+
}, H = new Intl.DateTimeFormat(ee, {
|
|
4557
4676
|
month: "long",
|
|
4558
4677
|
year: "numeric"
|
|
4559
|
-
}).format(new Date(j.year, j.month, 1)),
|
|
4678
|
+
}).format(new Date(j.year, j.month, 1)), te = (e) => M((t) => {
|
|
4560
4679
|
let n = new Date(t.year, t.month + e, 1);
|
|
4561
4680
|
return {
|
|
4562
4681
|
year: n.getFullYear(),
|
|
4563
4682
|
month: n.getMonth()
|
|
4564
4683
|
};
|
|
4565
|
-
}),
|
|
4684
|
+
}), ne = (e, t) => /* @__PURE__ */ d("button", {
|
|
4566
4685
|
type: "button",
|
|
4567
4686
|
"aria-label": e,
|
|
4568
|
-
onClick: () =>
|
|
4687
|
+
onClick: () => te(t),
|
|
4569
4688
|
style: {
|
|
4570
4689
|
background: "transparent",
|
|
4571
4690
|
border: `1px solid ${I}`,
|
|
@@ -4577,7 +4696,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4577
4696
|
padding: "4px 8px"
|
|
4578
4697
|
},
|
|
4579
4698
|
children: t < 0 ? "‹" : "›"
|
|
4580
|
-
}),
|
|
4699
|
+
}), re = /* @__PURE__ */ f("div", {
|
|
4581
4700
|
style: {
|
|
4582
4701
|
display: "flex",
|
|
4583
4702
|
alignItems: "center",
|
|
@@ -4594,12 +4713,12 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4594
4713
|
},
|
|
4595
4714
|
children: H
|
|
4596
4715
|
}),
|
|
4597
|
-
|
|
4598
|
-
|
|
4716
|
+
ne("Previous month", -1),
|
|
4717
|
+
ne("Next month", 1)
|
|
4599
4718
|
]
|
|
4600
4719
|
});
|
|
4601
4720
|
if (p === "list") {
|
|
4602
|
-
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, {
|
|
4603
4722
|
day: "numeric",
|
|
4604
4723
|
month: "short",
|
|
4605
4724
|
hour: "2-digit",
|
|
@@ -4611,7 +4730,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4611
4730
|
width: "100%",
|
|
4612
4731
|
...P(S)
|
|
4613
4732
|
},
|
|
4614
|
-
children: [
|
|
4733
|
+
children: [re, e.length ? /* @__PURE__ */ d("div", {
|
|
4615
4734
|
style: {
|
|
4616
4735
|
display: "flex",
|
|
4617
4736
|
flexDirection: "column",
|
|
@@ -4632,7 +4751,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4632
4751
|
minWidth: 96
|
|
4633
4752
|
},
|
|
4634
4753
|
children: t.format(e.start)
|
|
4635
|
-
}),
|
|
4754
|
+
}), V(e, {
|
|
4636
4755
|
flexGrow: 1,
|
|
4637
4756
|
minWidth: 0
|
|
4638
4757
|
})]
|
|
@@ -4647,10 +4766,10 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4647
4766
|
})]
|
|
4648
4767
|
});
|
|
4649
4768
|
}
|
|
4650
|
-
let
|
|
4651
|
-
for (let e = 0; e <
|
|
4652
|
-
let t = e -
|
|
4653
|
-
|
|
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", {
|
|
4654
4773
|
style: {
|
|
4655
4774
|
minHeight: N.cell,
|
|
4656
4775
|
borderTop: `1px solid ${I}`,
|
|
@@ -4675,7 +4794,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4675
4794
|
},
|
|
4676
4795
|
children: n ? t : new Date(j.year, j.month, t).getDate()
|
|
4677
4796
|
}),
|
|
4678
|
-
a.map((e) =>
|
|
4797
|
+
a.map((e) => V(e)),
|
|
4679
4798
|
i.length > a.length && /* @__PURE__ */ d("span", {
|
|
4680
4799
|
style: {
|
|
4681
4800
|
fontSize: N.font,
|
|
@@ -4693,7 +4812,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4693
4812
|
...P(S)
|
|
4694
4813
|
},
|
|
4695
4814
|
children: [
|
|
4696
|
-
|
|
4815
|
+
re,
|
|
4697
4816
|
/* @__PURE__ */ f("div", {
|
|
4698
4817
|
style: {
|
|
4699
4818
|
display: "grid",
|
|
@@ -4707,20 +4826,315 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4707
4826
|
textAlign: "center",
|
|
4708
4827
|
padding: `0 0 ${N.pad}px`
|
|
4709
4828
|
},
|
|
4710
|
-
children:
|
|
4711
|
-
}, `head-${t}`)),
|
|
4829
|
+
children: le.format(new Date(2024, 0, 7 + ae + t))
|
|
4830
|
+
}, `head-${t}`)), W]
|
|
4712
4831
|
}),
|
|
4713
4832
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4714
4833
|
]
|
|
4715
4834
|
});
|
|
4716
4835
|
}
|
|
4717
|
-
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 = {
|
|
4718
5132
|
small: 380,
|
|
4719
5133
|
medium: 560,
|
|
4720
5134
|
large: 820,
|
|
4721
5135
|
full: "100%"
|
|
4722
5136
|
};
|
|
4723
|
-
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 }) {
|
|
4724
5138
|
let [C, w] = l(!1), T = c(null);
|
|
4725
5139
|
a(() => {
|
|
4726
5140
|
if (S || !e) return;
|
|
@@ -4745,7 +5159,7 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4745
5159
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4746
5160
|
};
|
|
4747
5161
|
}, [S, C]);
|
|
4748
|
-
let E =
|
|
5162
|
+
let E = qn[o] ?? qn.medium, D = (e) => {
|
|
4749
5163
|
let t = {
|
|
4750
5164
|
padding: "9px 16px",
|
|
4751
5165
|
borderRadius: 6,
|
|
@@ -4914,10 +5328,11 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4914
5328
|
})]
|
|
4915
5329
|
});
|
|
4916
5330
|
}
|
|
4917
|
-
var
|
|
5331
|
+
var Yn = {
|
|
4918
5332
|
PageRoot: Me,
|
|
4919
|
-
CalendarBlock:
|
|
4920
|
-
|
|
5333
|
+
CalendarBlock: Hn,
|
|
5334
|
+
LogoCarousel: Gn,
|
|
5335
|
+
DialogBlock: Jn,
|
|
4921
5336
|
Section: Ne,
|
|
4922
5337
|
Container: Pe,
|
|
4923
5338
|
Heading: Fe,
|
|
@@ -4928,23 +5343,23 @@ var Hn = {
|
|
|
4928
5343
|
Divider: it,
|
|
4929
5344
|
SliderBlock: ut,
|
|
4930
5345
|
CanvasSlider: dt,
|
|
4931
|
-
TabsBlock:
|
|
4932
|
-
QuickStack:
|
|
4933
|
-
CollectionList:
|
|
4934
|
-
CollectionSearch:
|
|
4935
|
-
BreadcrumbsBlock:
|
|
4936
|
-
PaginationBlock:
|
|
4937
|
-
StepperBlock:
|
|
4938
|
-
SocialLinksBlock:
|
|
4939
|
-
ThemeModeBlock:
|
|
4940
|
-
ScrollTopBlock:
|
|
4941
|
-
OrgChartBlock:
|
|
4942
|
-
TableBlock:
|
|
4943
|
-
IconBlock:
|
|
4944
|
-
MapBlock:
|
|
4945
|
-
MasonryBlock:
|
|
4946
|
-
AccordionBlock:
|
|
4947
|
-
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,
|
|
4948
5363
|
ListBlock: Ke,
|
|
4949
5364
|
TextSpan: ze,
|
|
4950
5365
|
QuoteBlock: Ge,
|
|
@@ -4955,43 +5370,83 @@ var Hn = {
|
|
|
4955
5370
|
YouTubeBlock: et,
|
|
4956
5371
|
IframeBlock: tt,
|
|
4957
5372
|
EmbedBlock: nt,
|
|
4958
|
-
FormBlock:
|
|
4959
|
-
FormLabel:
|
|
4960
|
-
FormInput:
|
|
4961
|
-
FormTextarea:
|
|
4962
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
5373
|
+
FormBlock: Vt,
|
|
5374
|
+
FormLabel: Kt,
|
|
5375
|
+
FormInput: qt,
|
|
5376
|
+
FormTextarea: Jt,
|
|
5377
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(Yt, {
|
|
4963
5378
|
kind: "checkbox",
|
|
4964
5379
|
...e
|
|
4965
5380
|
}),
|
|
4966
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
5381
|
+
FormRadio: (e) => /* @__PURE__ */ d(Yt, {
|
|
4967
5382
|
kind: "radio",
|
|
4968
5383
|
...e
|
|
4969
5384
|
}),
|
|
4970
|
-
FormSelect:
|
|
4971
|
-
FormFile:
|
|
4972
|
-
FormRecaptcha:
|
|
4973
|
-
FormSubmit:
|
|
4974
|
-
},
|
|
5385
|
+
FormSelect: Xt,
|
|
5386
|
+
FormFile: Zt,
|
|
5387
|
+
FormRecaptcha: Gt,
|
|
5388
|
+
FormSubmit: Qt
|
|
5389
|
+
}, Xn = {
|
|
4975
5390
|
id: "auth",
|
|
4976
5391
|
label: "Accounts",
|
|
4977
5392
|
category: "Apps",
|
|
4978
5393
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4979
5394
|
ssr: "shell",
|
|
4980
5395
|
settings: ["site.authRedirect"]
|
|
4981
|
-
},
|
|
5396
|
+
}, Zn = n({
|
|
4982
5397
|
user: null,
|
|
4983
5398
|
status: "idle",
|
|
4984
5399
|
ensure: () => {},
|
|
4985
5400
|
refresh: () => {},
|
|
4986
5401
|
signOut: () => {}
|
|
4987
|
-
})
|
|
4988
|
-
|
|
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);
|
|
4989
5444
|
return a(() => {
|
|
4990
5445
|
e.ensure();
|
|
4991
5446
|
}, [e]), e;
|
|
4992
5447
|
};
|
|
4993
|
-
function
|
|
4994
|
-
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}`, {
|
|
4995
5450
|
...t,
|
|
4996
5451
|
credentials: "include",
|
|
4997
5452
|
headers: {
|
|
@@ -4999,61 +5454,93 @@ function Kn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
4999
5454
|
...m ? { "x-tenant": m } : {},
|
|
5000
5455
|
...t?.headers
|
|
5001
5456
|
}
|
|
5002
|
-
}), [p, m]),
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
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());
|
|
5009
5493
|
}, [
|
|
5010
5494
|
n,
|
|
5011
5495
|
t,
|
|
5012
|
-
|
|
5013
|
-
]),
|
|
5014
|
-
user:
|
|
5015
|
-
status:
|
|
5016
|
-
ensure:
|
|
5017
|
-
refresh:
|
|
5018
|
-
signOut:
|
|
5496
|
+
C
|
|
5497
|
+
]), E = s(() => ({
|
|
5498
|
+
user: g,
|
|
5499
|
+
status: v,
|
|
5500
|
+
ensure: T,
|
|
5501
|
+
refresh: C,
|
|
5502
|
+
signOut: w
|
|
5019
5503
|
}), [
|
|
5020
|
-
|
|
5021
|
-
|
|
5504
|
+
g,
|
|
5505
|
+
v,
|
|
5506
|
+
T,
|
|
5022
5507
|
C,
|
|
5023
|
-
|
|
5024
|
-
S
|
|
5508
|
+
w
|
|
5025
5509
|
]);
|
|
5026
5510
|
return a(() => {
|
|
5027
5511
|
n || typeof window > "u" || (window.webim = {
|
|
5028
5512
|
...window.webim,
|
|
5029
|
-
user:
|
|
5030
|
-
status:
|
|
5031
|
-
|
|
5032
|
-
|
|
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
|
|
5033
5519
|
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
5034
|
-
user:
|
|
5035
|
-
status:
|
|
5520
|
+
user: g,
|
|
5521
|
+
status: v
|
|
5036
5522
|
} })));
|
|
5037
5523
|
}, [
|
|
5038
5524
|
n,
|
|
5039
|
-
|
|
5040
|
-
|
|
5525
|
+
g,
|
|
5526
|
+
v,
|
|
5041
5527
|
t,
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5528
|
+
h.loginPage,
|
|
5529
|
+
C,
|
|
5530
|
+
w
|
|
5531
|
+
]), /* @__PURE__ */ d(Zn.Provider, {
|
|
5532
|
+
value: E,
|
|
5046
5533
|
children: e
|
|
5047
5534
|
});
|
|
5048
5535
|
}
|
|
5049
|
-
function
|
|
5050
|
-
let { status: n } =
|
|
5536
|
+
function ar({ when: e, children: t }) {
|
|
5537
|
+
let { status: n } = rr();
|
|
5051
5538
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5052
5539
|
}
|
|
5053
5540
|
//#endregion
|
|
5054
5541
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5055
|
-
function
|
|
5056
|
-
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) => {
|
|
5057
5544
|
if (e.preventDefault(), u) return;
|
|
5058
5545
|
let n = new FormData(e.currentTarget);
|
|
5059
5546
|
C(!0), x("");
|
|
@@ -5101,20 +5588,20 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5101
5588
|
children: [
|
|
5102
5589
|
w ? /* @__PURE__ */ f("label", {
|
|
5103
5590
|
style: {
|
|
5104
|
-
...
|
|
5591
|
+
...At,
|
|
5105
5592
|
display: "grid",
|
|
5106
5593
|
gap: 6
|
|
5107
5594
|
},
|
|
5108
5595
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5109
5596
|
name: "name",
|
|
5110
5597
|
type: "text",
|
|
5111
|
-
style:
|
|
5112
|
-
...
|
|
5598
|
+
style: jt,
|
|
5599
|
+
...Nt(u)
|
|
5113
5600
|
})]
|
|
5114
5601
|
}) : null,
|
|
5115
5602
|
/* @__PURE__ */ f("label", {
|
|
5116
5603
|
style: {
|
|
5117
|
-
...
|
|
5604
|
+
...At,
|
|
5118
5605
|
display: "grid",
|
|
5119
5606
|
gap: 6
|
|
5120
5607
|
},
|
|
@@ -5122,13 +5609,13 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5122
5609
|
name: "email",
|
|
5123
5610
|
type: "email",
|
|
5124
5611
|
required: !u,
|
|
5125
|
-
style:
|
|
5126
|
-
...
|
|
5612
|
+
style: jt,
|
|
5613
|
+
...Nt(u)
|
|
5127
5614
|
})]
|
|
5128
5615
|
}),
|
|
5129
5616
|
/* @__PURE__ */ f("label", {
|
|
5130
5617
|
style: {
|
|
5131
|
-
...
|
|
5618
|
+
...At,
|
|
5132
5619
|
display: "grid",
|
|
5133
5620
|
gap: 6
|
|
5134
5621
|
},
|
|
@@ -5136,8 +5623,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5136
5623
|
name: "password",
|
|
5137
5624
|
type: "password",
|
|
5138
5625
|
required: !u,
|
|
5139
|
-
style:
|
|
5140
|
-
...
|
|
5626
|
+
style: jt,
|
|
5627
|
+
...Nt(u)
|
|
5141
5628
|
})]
|
|
5142
5629
|
}),
|
|
5143
5630
|
/* @__PURE__ */ d("button", {
|
|
@@ -5176,8 +5663,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5176
5663
|
]
|
|
5177
5664
|
});
|
|
5178
5665
|
}
|
|
5179
|
-
function
|
|
5180
|
-
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 ? {
|
|
5181
5668
|
name: "Ada Lovelace",
|
|
5182
5669
|
email: "ada@example.com"
|
|
5183
5670
|
} : c;
|
|
@@ -5198,7 +5685,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5198
5685
|
children: [
|
|
5199
5686
|
/* @__PURE__ */ f("span", {
|
|
5200
5687
|
style: {
|
|
5201
|
-
...
|
|
5688
|
+
...At,
|
|
5202
5689
|
fontWeight: 600
|
|
5203
5690
|
},
|
|
5204
5691
|
children: [
|
|
@@ -5209,7 +5696,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5209
5696
|
}),
|
|
5210
5697
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5211
5698
|
style: {
|
|
5212
|
-
...
|
|
5699
|
+
...At,
|
|
5213
5700
|
opacity: .7
|
|
5214
5701
|
},
|
|
5215
5702
|
children: m.email
|
|
@@ -5225,7 +5712,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5225
5712
|
fontSize: 14,
|
|
5226
5713
|
cursor: a ? "default" : "pointer"
|
|
5227
5714
|
},
|
|
5228
|
-
...
|
|
5715
|
+
...Nt(a),
|
|
5229
5716
|
children: t
|
|
5230
5717
|
})
|
|
5231
5718
|
]
|
|
@@ -5242,40 +5729,40 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5242
5729
|
}
|
|
5243
5730
|
//#endregion
|
|
5244
5731
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5245
|
-
var
|
|
5732
|
+
var cr = {
|
|
5246
5733
|
id: "consent",
|
|
5247
5734
|
label: "Cookie consent",
|
|
5248
5735
|
category: "Apps",
|
|
5249
5736
|
keys: ["CookieConsent"],
|
|
5250
5737
|
ssr: "shell",
|
|
5251
5738
|
settings: []
|
|
5252
|
-
},
|
|
5253
|
-
function
|
|
5739
|
+
}, lr = "webim.cookie_consent";
|
|
5740
|
+
function ur() {
|
|
5254
5741
|
try {
|
|
5255
|
-
let e = window.localStorage.getItem(
|
|
5742
|
+
let e = window.localStorage.getItem(lr), t = e ? JSON.parse(e) : null;
|
|
5256
5743
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5257
5744
|
} catch {
|
|
5258
5745
|
return "";
|
|
5259
5746
|
}
|
|
5260
5747
|
}
|
|
5261
|
-
function
|
|
5748
|
+
function dr(e) {
|
|
5262
5749
|
try {
|
|
5263
5750
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5264
5751
|
} catch {}
|
|
5265
5752
|
}
|
|
5266
|
-
function
|
|
5753
|
+
function fr(e) {
|
|
5267
5754
|
try {
|
|
5268
|
-
window.localStorage.setItem(
|
|
5755
|
+
window.localStorage.setItem(lr, JSON.stringify({
|
|
5269
5756
|
choice: e,
|
|
5270
5757
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5271
5758
|
}));
|
|
5272
5759
|
} catch {}
|
|
5273
|
-
|
|
5760
|
+
dr(e);
|
|
5274
5761
|
try {
|
|
5275
5762
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5276
5763
|
} catch {}
|
|
5277
5764
|
}
|
|
5278
|
-
var
|
|
5765
|
+
var pr = {
|
|
5279
5766
|
bottom: {
|
|
5280
5767
|
left: 0,
|
|
5281
5768
|
right: 0,
|
|
@@ -5297,18 +5784,18 @@ var tr = {
|
|
|
5297
5784
|
maxWidth: 400
|
|
5298
5785
|
}
|
|
5299
5786
|
};
|
|
5300
|
-
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 }) {
|
|
5301
5788
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
5302
5789
|
y(e), typeof m == "function" && m(e);
|
|
5303
5790
|
};
|
|
5304
5791
|
if (a(() => {
|
|
5305
5792
|
if (h) return;
|
|
5306
|
-
let e =
|
|
5307
|
-
e ?
|
|
5793
|
+
let e = ur();
|
|
5794
|
+
e ? dr(e) : _(!0);
|
|
5308
5795
|
}, [h, v]), !g) return null;
|
|
5309
5796
|
let x = (e) => () => {
|
|
5310
|
-
h || (
|
|
5311
|
-
}, S =
|
|
5797
|
+
h || (fr(e), _(!1));
|
|
5798
|
+
}, S = pr[s] ?? pr.bottom, C = {
|
|
5312
5799
|
appearance: "none",
|
|
5313
5800
|
font: "inherit",
|
|
5314
5801
|
fontSize: 14,
|
|
@@ -5388,37 +5875,37 @@ function nr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5388
5875
|
}
|
|
5389
5876
|
//#endregion
|
|
5390
5877
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5391
|
-
var
|
|
5878
|
+
var hr = {
|
|
5392
5879
|
id: "language",
|
|
5393
5880
|
label: "Language",
|
|
5394
5881
|
category: "Apps",
|
|
5395
5882
|
keys: ["SiteLanguagePicker"],
|
|
5396
5883
|
ssr: "prefetch",
|
|
5397
5884
|
settings: ["locales"]
|
|
5398
|
-
},
|
|
5885
|
+
}, gr = {
|
|
5399
5886
|
id: "search",
|
|
5400
5887
|
label: "Search",
|
|
5401
5888
|
category: "Apps",
|
|
5402
5889
|
keys: ["SiteSearch"],
|
|
5403
5890
|
ssr: "prefetch",
|
|
5404
5891
|
settings: []
|
|
5405
|
-
},
|
|
5406
|
-
function
|
|
5892
|
+
}, _r = 50, vr = 2e3;
|
|
5893
|
+
function yr() {
|
|
5407
5894
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5408
5895
|
}
|
|
5409
|
-
function
|
|
5896
|
+
function br(e, t) {
|
|
5410
5897
|
let n = e?.data ?? {}, r = [];
|
|
5411
5898
|
for (let e of Object.values(n)) {
|
|
5412
|
-
let t = e == null ? "" :
|
|
5413
|
-
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;
|
|
5414
5901
|
}
|
|
5415
|
-
return r.join(" ").slice(0,
|
|
5902
|
+
return r.join(" ").slice(0, vr).toLocaleLowerCase(t || void 0);
|
|
5416
5903
|
}
|
|
5417
|
-
function
|
|
5418
|
-
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";
|
|
5419
5906
|
a(() => {
|
|
5420
5907
|
let e = () => {
|
|
5421
|
-
let e =
|
|
5908
|
+
let e = yr();
|
|
5422
5909
|
w(e), E(e);
|
|
5423
5910
|
};
|
|
5424
5911
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5469,8 +5956,8 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5469
5956
|
});
|
|
5470
5957
|
}
|
|
5471
5958
|
else for (let t of e.rows) {
|
|
5472
|
-
if (!
|
|
5473
|
-
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);
|
|
5474
5961
|
F.push({
|
|
5475
5962
|
key: `entry:${t.id}`,
|
|
5476
5963
|
title: r,
|
|
@@ -5478,7 +5965,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5478
5965
|
kind: "entry"
|
|
5479
5966
|
});
|
|
5480
5967
|
}
|
|
5481
|
-
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) => {
|
|
5482
5969
|
if (v) {
|
|
5483
5970
|
e.preventDefault(), w(T), A(!0);
|
|
5484
5971
|
return;
|
|
@@ -5499,7 +5986,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5499
5986
|
title: "Spring collection",
|
|
5500
5987
|
url: "/blog/spring",
|
|
5501
5988
|
kind: "entry"
|
|
5502
|
-
}] : 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", {
|
|
5503
5990
|
style: {
|
|
5504
5991
|
listStyle: "none",
|
|
5505
5992
|
margin: 0,
|
|
@@ -5560,7 +6047,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5560
6047
|
onChange: (e) => E(e.target.value),
|
|
5561
6048
|
onFocus: () => N && A(!0),
|
|
5562
6049
|
style: {
|
|
5563
|
-
...
|
|
6050
|
+
...jt,
|
|
5564
6051
|
flexGrow: 1,
|
|
5565
6052
|
minWidth: 0
|
|
5566
6053
|
}
|
|
@@ -5587,7 +6074,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5587
6074
|
},
|
|
5588
6075
|
children: h
|
|
5589
6076
|
}),
|
|
5590
|
-
|
|
6077
|
+
ee && /* @__PURE__ */ f("div", {
|
|
5591
6078
|
style: M ? {
|
|
5592
6079
|
position: "absolute",
|
|
5593
6080
|
top: "100%",
|
|
@@ -5603,7 +6090,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5603
6090
|
background: "var(--page-surface, #f2f2f2)",
|
|
5604
6091
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5605
6092
|
} : { marginTop: 14 },
|
|
5606
|
-
children: [
|
|
6093
|
+
children: [V, B && /* @__PURE__ */ d("div", {
|
|
5607
6094
|
style: {
|
|
5608
6095
|
fontSize: 14,
|
|
5609
6096
|
opacity: .65,
|
|
@@ -5618,21 +6105,21 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5618
6105
|
}
|
|
5619
6106
|
//#endregion
|
|
5620
6107
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5621
|
-
function
|
|
6108
|
+
function Sr(e) {
|
|
5622
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());
|
|
5623
6110
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5624
6111
|
}
|
|
5625
|
-
var
|
|
5626
|
-
function
|
|
6112
|
+
var Cr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6113
|
+
function wr(e, t) {
|
|
5627
6114
|
let n = String(e ?? "").toUpperCase();
|
|
5628
6115
|
if (t === "code") return n;
|
|
5629
6116
|
let r = "";
|
|
5630
6117
|
try {
|
|
5631
|
-
r =
|
|
6118
|
+
r = Cr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5632
6119
|
} catch {}
|
|
5633
6120
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5634
6121
|
}
|
|
5635
|
-
function
|
|
6122
|
+
function Tr(e, t) {
|
|
5636
6123
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5637
6124
|
if (typeof window > "u") return n || "?";
|
|
5638
6125
|
try {
|
|
@@ -5642,8 +6129,8 @@ function pr(e, t) {
|
|
|
5642
6129
|
return n || "/";
|
|
5643
6130
|
}
|
|
5644
6131
|
}
|
|
5645
|
-
function
|
|
5646
|
-
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 = {
|
|
5647
6134
|
display: "inline-flex",
|
|
5648
6135
|
alignItems: "center",
|
|
5649
6136
|
gap: 8,
|
|
@@ -5678,7 +6165,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5678
6165
|
style: { opacity: .4 },
|
|
5679
6166
|
children: n ?? "·"
|
|
5680
6167
|
}), /* @__PURE__ */ d("a", {
|
|
5681
|
-
href:
|
|
6168
|
+
href: Tr(e, e === u),
|
|
5682
6169
|
hrefLang: e,
|
|
5683
6170
|
"aria-current": e === p ? "true" : void 0,
|
|
5684
6171
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5688,7 +6175,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5688
6175
|
textDecoration: "none",
|
|
5689
6176
|
cursor: s ? "default" : "pointer"
|
|
5690
6177
|
},
|
|
5691
|
-
children:
|
|
6178
|
+
children: wr(e, t)
|
|
5692
6179
|
})]
|
|
5693
6180
|
}, e))]
|
|
5694
6181
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -5699,7 +6186,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5699
6186
|
value: p,
|
|
5700
6187
|
onChange: s ? void 0 : (e) => {
|
|
5701
6188
|
let t = e.target.value;
|
|
5702
|
-
window.location.assign(
|
|
6189
|
+
window.location.assign(Tr(t, t === u));
|
|
5703
6190
|
},
|
|
5704
6191
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5705
6192
|
style: {
|
|
@@ -5713,57 +6200,57 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5713
6200
|
},
|
|
5714
6201
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
5715
6202
|
value: e,
|
|
5716
|
-
children:
|
|
6203
|
+
children: wr(e, t)
|
|
5717
6204
|
}, e))
|
|
5718
6205
|
})]
|
|
5719
6206
|
});
|
|
5720
6207
|
}
|
|
5721
6208
|
//#endregion
|
|
5722
6209
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5723
|
-
var
|
|
5724
|
-
Un,
|
|
5725
|
-
rr,
|
|
6210
|
+
var Dr = [
|
|
5726
6211
|
Xn,
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
6212
|
+
hr,
|
|
6213
|
+
cr,
|
|
6214
|
+
gr
|
|
6215
|
+
], Or = {
|
|
6216
|
+
SiteLoginForm: or,
|
|
6217
|
+
SiteAccountMenu: sr,
|
|
6218
|
+
SiteLanguagePicker: Er,
|
|
6219
|
+
CookieConsent: mr,
|
|
6220
|
+
SiteSearch: xr
|
|
5734
6221
|
};
|
|
5735
|
-
new Set(
|
|
6222
|
+
new Set(Dr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5736
6223
|
//#endregion
|
|
5737
6224
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5738
|
-
var
|
|
5739
|
-
function
|
|
5740
|
-
if (
|
|
6225
|
+
var kr = /* @__PURE__ */ new Map();
|
|
6226
|
+
function Ar(e) {
|
|
6227
|
+
if (kr.has(e)) return kr.get(e);
|
|
5741
6228
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5742
6229
|
/* @vite-ignore */
|
|
5743
6230
|
/* webpackIgnore: true */
|
|
5744
6231
|
t
|
|
5745
6232
|
).finally(() => URL.revokeObjectURL(t));
|
|
5746
|
-
return
|
|
6233
|
+
return kr.set(e, n), n;
|
|
5747
6234
|
}
|
|
5748
|
-
function
|
|
6235
|
+
function jr(e) {
|
|
5749
6236
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5750
6237
|
return n && typeof n == "object" ? n : {};
|
|
5751
6238
|
}
|
|
5752
6239
|
//#endregion
|
|
5753
6240
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5754
|
-
async function
|
|
5755
|
-
let n = await
|
|
6241
|
+
async function Mr(e, t) {
|
|
6242
|
+
let n = await Ar(e);
|
|
5756
6243
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5757
6244
|
}
|
|
5758
|
-
var
|
|
6245
|
+
var Nr = {
|
|
5759
6246
|
padding: "10px 12px",
|
|
5760
6247
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5761
6248
|
borderRadius: 8,
|
|
5762
6249
|
fontSize: 12,
|
|
5763
6250
|
opacity: .6
|
|
5764
6251
|
};
|
|
5765
|
-
function
|
|
5766
|
-
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 = {
|
|
5767
6254
|
tenant: s?.tenant ?? "",
|
|
5768
6255
|
apiUrl: s?.apiUrl ?? "/api",
|
|
5769
6256
|
locale: s?.locale ?? "",
|
|
@@ -5775,7 +6262,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5775
6262
|
let e = u.current;
|
|
5776
6263
|
if (!l?.code || !e) return;
|
|
5777
6264
|
let n = !0;
|
|
5778
|
-
return
|
|
6265
|
+
return Mr(l.code, t).then((e) => {
|
|
5779
6266
|
if (!(!n || !e || !u.current)) {
|
|
5780
6267
|
p.current = e;
|
|
5781
6268
|
try {
|
|
@@ -5805,7 +6292,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5805
6292
|
}) : /* @__PURE__ */ f("div", {
|
|
5806
6293
|
ref: o,
|
|
5807
6294
|
style: {
|
|
5808
|
-
...
|
|
6295
|
+
...Nr,
|
|
5809
6296
|
...P(r)
|
|
5810
6297
|
},
|
|
5811
6298
|
children: [
|
|
@@ -5817,12 +6304,12 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5817
6304
|
}
|
|
5818
6305
|
//#endregion
|
|
5819
6306
|
//#region ../ui/src/components/builder/render.jsx
|
|
5820
|
-
var
|
|
5821
|
-
...
|
|
5822
|
-
...
|
|
5823
|
-
PluginBlock:
|
|
6307
|
+
var Fr = {
|
|
6308
|
+
...Yn,
|
|
6309
|
+
...Or,
|
|
6310
|
+
PluginBlock: Pr
|
|
5824
6311
|
};
|
|
5825
|
-
function
|
|
6312
|
+
function Ir(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5826
6313
|
let o = n[e];
|
|
5827
6314
|
if (!o || o.hidden) return null;
|
|
5828
6315
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5830,29 +6317,29 @@ function wr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5830
6317
|
let n = o.props?.componentId, s = r?.[n];
|
|
5831
6318
|
if (!s?.template || i.has(n)) return null;
|
|
5832
6319
|
let c = new Set(i).add(n);
|
|
5833
|
-
return /* @__PURE__ */ d(t, { children:
|
|
6320
|
+
return /* @__PURE__ */ d(t, { children: Ir(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
5834
6321
|
}
|
|
5835
|
-
let l =
|
|
6322
|
+
let l = Fr[s];
|
|
5836
6323
|
if (!l) return null;
|
|
5837
|
-
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, {
|
|
5838
6325
|
...c,
|
|
5839
6326
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5840
6327
|
linked: p,
|
|
5841
6328
|
nodeRef: (t) => {
|
|
5842
|
-
t && (t.setAttribute("data-wb", e),
|
|
6329
|
+
t && (t.setAttribute("data-wb", e), ne(t, c), te(t, a?.events === !1 ? [] : c.events));
|
|
5843
6330
|
},
|
|
5844
6331
|
children: u.length ? u : void 0
|
|
5845
6332
|
}, e);
|
|
5846
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
6333
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(ar, {
|
|
5847
6334
|
when: c.when,
|
|
5848
6335
|
children: m
|
|
5849
6336
|
}, e) : m;
|
|
5850
6337
|
}
|
|
5851
6338
|
//#endregion
|
|
5852
6339
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5853
|
-
var
|
|
5854
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5855
|
-
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 }) {
|
|
5856
6343
|
let y = o?.js?.trim();
|
|
5857
6344
|
if (a(() => {
|
|
5858
6345
|
if (!y) return;
|
|
@@ -5866,19 +6353,19 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5866
6353
|
minHeight: "100%",
|
|
5867
6354
|
display: "flex",
|
|
5868
6355
|
flexDirection: "column"
|
|
5869
|
-
}, 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", {
|
|
5870
6357
|
rel: "stylesheet",
|
|
5871
6358
|
precedence: "default",
|
|
5872
6359
|
href: D(e)
|
|
5873
|
-
}, e)), F =
|
|
5874
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
6360
|
+
}, e)), F = Rr(M);
|
|
6361
|
+
return r === "auto" ? /* @__PURE__ */ d(J.Provider, {
|
|
5875
6362
|
value: {
|
|
5876
6363
|
tenant: l || "",
|
|
5877
6364
|
apiUrl: u || "/api",
|
|
5878
6365
|
locale: m || "",
|
|
5879
6366
|
settings: _ ?? null
|
|
5880
6367
|
},
|
|
5881
|
-
children: /* @__PURE__ */ d(
|
|
6368
|
+
children: /* @__PURE__ */ d(ir, {
|
|
5882
6369
|
initialUser: v,
|
|
5883
6370
|
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5884
6371
|
value: p ?? null,
|
|
@@ -5893,8 +6380,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5893
6380
|
...i
|
|
5894
6381
|
},
|
|
5895
6382
|
children: [
|
|
5896
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
5897
|
-
@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))} } }` }),
|
|
5898
6385
|
/* @__PURE__ */ d("style", { children: F }),
|
|
5899
6386
|
P,
|
|
5900
6387
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -5907,14 +6394,14 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5907
6394
|
})
|
|
5908
6395
|
})
|
|
5909
6396
|
})
|
|
5910
|
-
}) : /* @__PURE__ */ d(
|
|
6397
|
+
}) : /* @__PURE__ */ d(J.Provider, {
|
|
5911
6398
|
value: {
|
|
5912
6399
|
tenant: l || "",
|
|
5913
6400
|
apiUrl: u || "/api",
|
|
5914
6401
|
locale: m || "",
|
|
5915
6402
|
settings: _ ?? null
|
|
5916
6403
|
},
|
|
5917
|
-
children: /* @__PURE__ */ d(
|
|
6404
|
+
children: /* @__PURE__ */ d(ir, {
|
|
5918
6405
|
initialUser: v,
|
|
5919
6406
|
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5920
6407
|
value: p ?? null,
|
|
@@ -5947,8 +6434,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5947
6434
|
}
|
|
5948
6435
|
//#endregion
|
|
5949
6436
|
//#region src/WebimContent.jsx
|
|
5950
|
-
function
|
|
5951
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
6437
|
+
function Br({ bundle: e, mode: t = "auto", style: n }) {
|
|
6438
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(zr, {
|
|
5952
6439
|
blocks: e.blocks,
|
|
5953
6440
|
theme: e.theme,
|
|
5954
6441
|
components: e.components,
|
|
@@ -5966,7 +6453,7 @@ function Or({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5966
6453
|
}
|
|
5967
6454
|
//#endregion
|
|
5968
6455
|
//#region src/bundle.js
|
|
5969
|
-
function
|
|
6456
|
+
function Vr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
5970
6457
|
let a = {
|
|
5971
6458
|
...t?.global ?? {},
|
|
5972
6459
|
...t?.tenant ?? {}
|
|
@@ -5992,18 +6479,18 @@ function kr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
5992
6479
|
}
|
|
5993
6480
|
//#endregion
|
|
5994
6481
|
//#region src/fetchPage.js
|
|
5995
|
-
var
|
|
6482
|
+
var Hr = async (e) => {
|
|
5996
6483
|
let t = await e.json().catch(() => null);
|
|
5997
6484
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
5998
6485
|
return t?.payload ?? t;
|
|
5999
6486
|
};
|
|
6000
|
-
async function
|
|
6487
|
+
async function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
6001
6488
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
6002
6489
|
if (!n) throw Error("fetchPage: slug is required");
|
|
6003
6490
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
6004
6491
|
...t ? { "x-tenant": t } : {},
|
|
6005
6492
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
6006
|
-
}, [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({
|
|
6007
6494
|
page: d,
|
|
6008
6495
|
settings: f,
|
|
6009
6496
|
tenant: t,
|
|
@@ -6014,10 +6501,11 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
6014
6501
|
"OrgChartBlock",
|
|
6015
6502
|
"NavbarBlock",
|
|
6016
6503
|
"CalendarBlock",
|
|
6017
|
-
"MasonryBlock"
|
|
6504
|
+
"MasonryBlock",
|
|
6505
|
+
"LogoCarousel"
|
|
6018
6506
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
6019
6507
|
if (m.length) {
|
|
6020
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
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) => {
|
|
6021
6509
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
6022
6510
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
6023
6511
|
}).catch(() => [[t, []]])));
|
|
@@ -6031,40 +6519,40 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
6031
6519
|
}
|
|
6032
6520
|
//#endregion
|
|
6033
6521
|
//#region src/ssr.jsx
|
|
6034
|
-
var
|
|
6522
|
+
var Wr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
6035
6523
|
"&": "&",
|
|
6036
6524
|
"<": "<",
|
|
6037
6525
|
">": ">",
|
|
6038
6526
|
"\"": """
|
|
6039
6527
|
})[e]);
|
|
6040
|
-
function
|
|
6041
|
-
return e(/* @__PURE__ */ d(
|
|
6528
|
+
function Gr(t, { mode: n = "auto", style: r } = {}) {
|
|
6529
|
+
return e(/* @__PURE__ */ d(Br, {
|
|
6042
6530
|
bundle: t,
|
|
6043
6531
|
mode: n,
|
|
6044
6532
|
style: r
|
|
6045
6533
|
}));
|
|
6046
6534
|
}
|
|
6047
|
-
function
|
|
6535
|
+
function Kr(e, { mode: t = "auto", lang: n } = {}) {
|
|
6048
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 = [
|
|
6049
6537
|
"<meta charset=\"utf-8\"/>",
|
|
6050
6538
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
6051
|
-
`<title>${
|
|
6052
|
-
r.description && `<meta name="description" content="${
|
|
6053
|
-
`<meta property="og:title" content="${
|
|
6054
|
-
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)}"/>`,
|
|
6055
6543
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
6056
6544
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
6057
6545
|
].filter(Boolean).join("\n");
|
|
6058
6546
|
return `<!doctype html>
|
|
6059
|
-
<html lang="${
|
|
6547
|
+
<html lang="${Wr(i)}"${a ? ` dir="${a}"` : ""}>
|
|
6060
6548
|
<head>
|
|
6061
6549
|
${c}
|
|
6062
6550
|
</head>
|
|
6063
6551
|
<body>
|
|
6064
|
-
${
|
|
6552
|
+
${Gr(e, { mode: t })}
|
|
6065
6553
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
6066
6554
|
</body>
|
|
6067
6555
|
</html>`;
|
|
6068
6556
|
}
|
|
6069
6557
|
//#endregion
|
|
6070
|
-
export {
|
|
6558
|
+
export { Vr as assembleBundle, Ur as fetchPage, Gr as renderBundleHtml, Kr as renderPageDocument };
|