webim-adapter 2.0.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/build/webim-adapter.js +1160 -752
- package/build/webim-embed.js +16 -10
- package/build/webim-ssr.js +1235 -827
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -269,26 +269,26 @@ function P(e) {
|
|
|
269
269
|
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${M(W ?? 1)} ${te || "currentColor"}`);
|
|
270
270
|
let { clipText: ne } = t;
|
|
271
271
|
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
-
let { transitions:
|
|
272
|
+
let { transitions: G, transitionDuration: K, transitionEasing: re, transitionProperty: q } = t, ie = (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 ae = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (K !== void 0 && ae.push(`${q || "all"} ${ie(K)} ${re || "ease"}`), ae.length && (t.transition = ae.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: J, overlayOpacity: oe } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
282
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 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: se } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (ce.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of ce) 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;
|
|
@@ -385,10 +385,10 @@ function ne(e, t, n, r = !1) {
|
|
|
385
385
|
let i = Object.entries(P(t)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function G(e, t, n) {
|
|
389
389
|
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var K = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var G = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], re = (e) => Object.entries(P(e)).map(([e, t]) => `${te(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function q(e, t) {
|
|
406
|
+
return K.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? re(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 ie(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = q(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 ae(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = G(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,15 +430,282 @@ 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
|
|
434
|
-
fontFamily:
|
|
433
|
+
var J = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", oe = {
|
|
434
|
+
fontFamily: J,
|
|
435
435
|
fontStyle: "normal",
|
|
436
436
|
fontWeight: 400,
|
|
437
437
|
letterSpacing: "normal",
|
|
438
438
|
textTransform: "none",
|
|
439
439
|
lineHeight: 1.4,
|
|
440
440
|
textShadow: "none"
|
|
441
|
-
},
|
|
441
|
+
}, se = /^(https?:|mailto:|tel:)/i, ce = /^[a-z][a-z0-9+.-]*:/i;
|
|
442
|
+
function le(e) {
|
|
443
|
+
let t = String(e ?? "").trim();
|
|
444
|
+
return t ? se.test(t) || t.startsWith("//") ? t : ce.test(t) ? "" : t : "";
|
|
445
|
+
}
|
|
446
|
+
var ue = /^\\([\\`*_{}[\]()#+\-.!~>|])/, de = /^(`+)([\s\S]*?[^`])\1(?!`)/, fe = /^!\[([^\]]*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, pe = /^\[((?:[^[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, me = /^<((?:https?:\/\/|mailto:)[^>\s]+)>/, he = /^https?:\/\/[^\s<>"'`]+[^\s<>"'`.,;:!?)\]}]/, ge = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/, _e = /^~~(?=\S)([\s\S]*?\S)~~/, ve = /^(\*|_)(?=\S)([\s\S]*?\S)\1/, ye = /[\\`*_~![<\n]|https?:\/\//, be = (e, t) => e.map((e) => e.br || e.image ? {
|
|
447
|
+
...e,
|
|
448
|
+
...t.href ? {
|
|
449
|
+
href: t.href,
|
|
450
|
+
target: t.target
|
|
451
|
+
} : null
|
|
452
|
+
} : {
|
|
453
|
+
...e,
|
|
454
|
+
...t
|
|
455
|
+
});
|
|
456
|
+
function Y(e, t = {}) {
|
|
457
|
+
let n = String(e ?? ""), r = t.newTab ? "_blank" : void 0, i = [], a = "", o = 0, s = () => {
|
|
458
|
+
a && i.push({ text: a }), a = "";
|
|
459
|
+
}, c = (e) => {
|
|
460
|
+
s(), i.push(...e);
|
|
461
|
+
};
|
|
462
|
+
for (; o < n.length;) {
|
|
463
|
+
let e = n.slice(o), i = o > 0 ? n[o - 1] : "", s = ue.exec(e);
|
|
464
|
+
if (s) {
|
|
465
|
+
a += s[1], o += s[0].length;
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
if (e[0] === "\n") {
|
|
469
|
+
/ {2,}$/.test(a) ? (a = a.replace(/ +$/, ""), c([{ br: !0 }])) : a.endsWith("\\") ? (a = a.slice(0, -1), c([{ br: !0 }])) : a += " ", o += 1;
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if (s = de.exec(e), s) {
|
|
473
|
+
c([{
|
|
474
|
+
text: (/^ .* $/.test(s[2]) ? s[2].slice(1, -1) : s[2]).replace(/\n/g, " "),
|
|
475
|
+
code: !0
|
|
476
|
+
}]), o += s[0].length;
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
if (s = fe.exec(e), s) {
|
|
480
|
+
let e = le(s[2]);
|
|
481
|
+
e ? c([{ image: {
|
|
482
|
+
src: e,
|
|
483
|
+
alt: s[1] || "",
|
|
484
|
+
title: s[3] || ""
|
|
485
|
+
} }]) : a += s[1], o += s[0].length;
|
|
486
|
+
continue;
|
|
487
|
+
}
|
|
488
|
+
if (s = pe.exec(e), s) {
|
|
489
|
+
let e = le(s[2]), n = Y(s[1], t);
|
|
490
|
+
c(e ? be(n, {
|
|
491
|
+
href: e,
|
|
492
|
+
target: r
|
|
493
|
+
}) : n), o += s[0].length;
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
if (s = me.exec(e) ?? (/[\s(<]/.test(i) || o === 0 ? he.exec(e) : null), s) {
|
|
497
|
+
let e = s[1] ?? s[0], t = le(e);
|
|
498
|
+
t ? c([{
|
|
499
|
+
text: e.replace(/^mailto:/i, ""),
|
|
500
|
+
href: t,
|
|
501
|
+
target: r
|
|
502
|
+
}]) : a += e, o += s[0].length;
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (s = ge.exec(e), s && (s[1] === "**" || !/\w/.test(i))) {
|
|
506
|
+
c(be(Y(s[2], t), { bold: !0 })), o += s[0].length;
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
if (s = _e.exec(e), s) {
|
|
510
|
+
c(be(Y(s[1], t), { strike: !0 })), o += s[0].length;
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
if (s = ve.exec(e), s && (s[1] === "*" || !/\w/.test(i) && !/\w/.test(n[o + s[0].length] ?? ""))) {
|
|
514
|
+
c(be(Y(s[2], t), { italic: !0 })), o += s[0].length;
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
a += n[o], o += 1;
|
|
518
|
+
let l = n.slice(o).search(ye);
|
|
519
|
+
l > 0 ? (a += n.slice(o, o + l), o += l) : l === -1 && (a += n.slice(o), o = n.length);
|
|
520
|
+
}
|
|
521
|
+
return s(), i;
|
|
522
|
+
}
|
|
523
|
+
var X = /^[ \t]*$/, Z = /^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)[ \t]*$/, xe = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/, Se = /^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/, Ce = /^ {0,3}>[ \t]?(.*)$/, we = /^( *)([-*+])[ \t]+(.*)$/, Te = /^( *)(\d{1,9})[.)][ \t]+(.*)$/, Ee = /^ {0,3}(=+|-+)[ \t]*$/, De = /^\[([ xX])\][ \t]+(.*)$/, Oe = /^ {0,3}\|?(?:[ \t]*:?-+:?[ \t]*\|)+[ \t]*:?-*:?[ \t]*\|?[ \t]*$/, ke = (e) => (/^[ \t]*/.exec(e)[0].match(/\t/g) || []).length * 3 + /^[ \t]*/.exec(e)[0].length;
|
|
524
|
+
function Ae(e) {
|
|
525
|
+
let t = we.exec(e);
|
|
526
|
+
if (t) return {
|
|
527
|
+
indent: t[1].length,
|
|
528
|
+
ordered: !1,
|
|
529
|
+
text: t[3]
|
|
530
|
+
};
|
|
531
|
+
let n = Te.exec(e);
|
|
532
|
+
return n ? {
|
|
533
|
+
indent: n[1].length,
|
|
534
|
+
ordered: !0,
|
|
535
|
+
start: Number(n[2]),
|
|
536
|
+
text: n[3]
|
|
537
|
+
} : null;
|
|
538
|
+
}
|
|
539
|
+
function je(e) {
|
|
540
|
+
let t = [], n = "";
|
|
541
|
+
for (let r = 0; r < e.length; r++) e[r] === "\\" && e[r + 1] === "|" ? (n += "|", r += 1) : e[r] === "|" ? (t.push(n), n = "") : n += e[r];
|
|
542
|
+
return t.push(n), t.length && X.test(t[0]) && t.shift(), t.length && X.test(t[t.length - 1]) && t.pop(), t.map((e) => e.trim());
|
|
543
|
+
}
|
|
544
|
+
var Me = (e) => {
|
|
545
|
+
let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
|
|
546
|
+
return n && r ? "center" : r ? "right" : n ? "left" : null;
|
|
547
|
+
};
|
|
548
|
+
function Ne(e) {
|
|
549
|
+
let t = e.filter((e) => !(e.text && !e.text.trim()));
|
|
550
|
+
if (t.length === 1 && t[0].image && !t[0].href) {
|
|
551
|
+
let { src: e, alt: n, title: r } = t[0].image;
|
|
552
|
+
return [{
|
|
553
|
+
type: "image",
|
|
554
|
+
src: e,
|
|
555
|
+
alt: n,
|
|
556
|
+
caption: r || "",
|
|
557
|
+
align: "left",
|
|
558
|
+
wrap: !1
|
|
559
|
+
}];
|
|
560
|
+
}
|
|
561
|
+
return e.length ? [{
|
|
562
|
+
type: "p",
|
|
563
|
+
parts: e
|
|
564
|
+
}] : [];
|
|
565
|
+
}
|
|
566
|
+
function Pe(e) {
|
|
567
|
+
let t = String(e ?? "").replace(/\r\n?/g, "\n").replace(/^/, "").split("\n"), n = null;
|
|
568
|
+
return t.map((e) => {
|
|
569
|
+
let t = Z.exec(e);
|
|
570
|
+
return n ? (t && t[1].startsWith(n[0]) && t[1].length >= n.length && (n = null), e) : t ? (n = t[1], e) : e.replace(/^[ \t]+/, (e) => e.replace(/\t/g, " "));
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
function Fe(e, t) {
|
|
574
|
+
let n = [], r = 0;
|
|
575
|
+
for (; r < e.length;) {
|
|
576
|
+
let i = e[r];
|
|
577
|
+
if (X.test(i)) {
|
|
578
|
+
r += 1;
|
|
579
|
+
continue;
|
|
580
|
+
}
|
|
581
|
+
let a = Z.exec(i);
|
|
582
|
+
if (a) {
|
|
583
|
+
let t = [], i = r + 1;
|
|
584
|
+
for (; i < e.length;) {
|
|
585
|
+
let n = Z.exec(e[i]);
|
|
586
|
+
if (n && n[1][0] === a[1][0] && n[1].length >= a[1].length && !n[2]) break;
|
|
587
|
+
t.push(e[i]), i += 1;
|
|
588
|
+
}
|
|
589
|
+
n.push({
|
|
590
|
+
type: "code",
|
|
591
|
+
lang: a[2] || "",
|
|
592
|
+
text: t.join("\n")
|
|
593
|
+
}), r = i + 1;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
let o = xe.exec(i);
|
|
597
|
+
if (o) {
|
|
598
|
+
let e = (o[2] ?? "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
599
|
+
n.push({
|
|
600
|
+
type: `h${o[1].length}`,
|
|
601
|
+
parts: Y(e, t)
|
|
602
|
+
}), r += 1;
|
|
603
|
+
continue;
|
|
604
|
+
}
|
|
605
|
+
if (Se.test(i)) {
|
|
606
|
+
n.push({ type: "divider" }), r += 1;
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
if (Ce.test(i)) {
|
|
610
|
+
let i = [];
|
|
611
|
+
for (; r < e.length;) {
|
|
612
|
+
let t = Ce.exec(e[r]);
|
|
613
|
+
if (t) i.push(t[1]);
|
|
614
|
+
else if (!X.test(e[r]) && i.length && !X.test(i[i.length - 1])) i.push(e[r]);
|
|
615
|
+
else break;
|
|
616
|
+
r += 1;
|
|
617
|
+
}
|
|
618
|
+
let a = Fe(i, t);
|
|
619
|
+
n.push(a.length === 1 && a[0].type === "p" ? {
|
|
620
|
+
type: "quote",
|
|
621
|
+
parts: a[0].parts
|
|
622
|
+
} : {
|
|
623
|
+
type: "quote",
|
|
624
|
+
blocks: a
|
|
625
|
+
});
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
if (Ae(i)) {
|
|
629
|
+
r = Ie(e, r, n, t);
|
|
630
|
+
continue;
|
|
631
|
+
}
|
|
632
|
+
if (i.includes("|") && r + 1 < e.length && Oe.test(e[r + 1])) {
|
|
633
|
+
let a = je(i), o = je(e[r + 1]).map(Me), s = [a.map((e) => Y(e, t))], c = r + 2;
|
|
634
|
+
for (; c < e.length && !X.test(e[c]) && e[c].includes("|");) {
|
|
635
|
+
let n = je(e[c]);
|
|
636
|
+
s.push(a.map((e, r) => Y(n[r] ?? "", t))), c += 1;
|
|
637
|
+
}
|
|
638
|
+
let l = {};
|
|
639
|
+
o.forEach((e, t) => {
|
|
640
|
+
e && s.forEach((n, r) => l[`${r}:${t}`] = { align: e });
|
|
641
|
+
}), n.push({
|
|
642
|
+
type: "table",
|
|
643
|
+
header: !0,
|
|
644
|
+
rows: s,
|
|
645
|
+
cellStyles: l
|
|
646
|
+
}), r = c;
|
|
647
|
+
continue;
|
|
648
|
+
}
|
|
649
|
+
let s = [i];
|
|
650
|
+
for (r += 1; r < e.length && !X.test(e[r]);) {
|
|
651
|
+
let i = e[r], a = Ee.exec(i);
|
|
652
|
+
if (a) {
|
|
653
|
+
n.push({
|
|
654
|
+
type: a[1][0] === "=" ? "h1" : "h2",
|
|
655
|
+
parts: Y(s.join("\n"), t)
|
|
656
|
+
}), r += 1, s.length = 0;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
if (Z.test(i) || xe.test(i) || Se.test(i) || Ce.test(i) || Ae(i)) break;
|
|
660
|
+
s.push(i), r += 1;
|
|
661
|
+
}
|
|
662
|
+
s.length && n.push(...Ne(Y(s.join("\n"), t)));
|
|
663
|
+
}
|
|
664
|
+
return n;
|
|
665
|
+
}
|
|
666
|
+
function Ie(e, t, n, r) {
|
|
667
|
+
let i = Ae(e[t]), a = i.indent, o = [], s = null, c = t;
|
|
668
|
+
for (; c < e.length;) {
|
|
669
|
+
let t = e[c], n = Ae(t);
|
|
670
|
+
if (n && n.indent <= a + 1) {
|
|
671
|
+
if (n.ordered !== i.ordered) break;
|
|
672
|
+
s = { lines: [n.text] }, o.push(s), c += 1;
|
|
673
|
+
continue;
|
|
674
|
+
}
|
|
675
|
+
if (X.test(t)) {
|
|
676
|
+
let t = c;
|
|
677
|
+
for (; t < e.length && X.test(e[t]);) t += 1;
|
|
678
|
+
if (!(t < e.length && (ke(e[t]) >= a + 2 || Ae(e[t]) && Ae(e[t]).ordered === i.ordered))) break;
|
|
679
|
+
s?.lines.push(""), c = t;
|
|
680
|
+
continue;
|
|
681
|
+
}
|
|
682
|
+
if (!s) break;
|
|
683
|
+
if (ke(t) >= a + 2) s.lines.push(t.slice(Math.min(t.length - t.trimStart().length, a + 2)));
|
|
684
|
+
else if (!n) s.lines.push(t.trim());
|
|
685
|
+
else break;
|
|
686
|
+
c += 1;
|
|
687
|
+
}
|
|
688
|
+
return n.push({
|
|
689
|
+
type: i.ordered ? "ol" : "ul",
|
|
690
|
+
...i.ordered && i.start !== 1 ? { start: i.start } : null,
|
|
691
|
+
items: o.map((e) => {
|
|
692
|
+
let t = De.exec(e.lines[0] ?? "");
|
|
693
|
+
t && (e.lines[0] = t[2]);
|
|
694
|
+
let n = Fe(e.lines, r), i = n[0]?.type === "p" ? n.shift() : null;
|
|
695
|
+
return {
|
|
696
|
+
parts: i ? i.parts : [],
|
|
697
|
+
...n.length ? { blocks: n } : null,
|
|
698
|
+
...t ? { task: t[1].toLowerCase() === "x" } : null
|
|
699
|
+
};
|
|
700
|
+
})
|
|
701
|
+
}), c;
|
|
702
|
+
}
|
|
703
|
+
function Le(e, t = {}) {
|
|
704
|
+
return String(e ?? "").trim() ? Fe(Pe(e), t) : [];
|
|
705
|
+
}
|
|
706
|
+
//#endregion
|
|
707
|
+
//#region ../ui/src/components/builder/theme.js
|
|
708
|
+
var Re = {
|
|
442
709
|
light: {
|
|
443
710
|
background: "#f2f2f2",
|
|
444
711
|
surface: "#f2f2f2",
|
|
@@ -479,32 +746,32 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
479
746
|
contrastText: "#052e2b"
|
|
480
747
|
}
|
|
481
748
|
}
|
|
482
|
-
},
|
|
749
|
+
}, ze = {
|
|
483
750
|
h1: 40,
|
|
484
751
|
h2: 32,
|
|
485
752
|
h3: 26,
|
|
486
753
|
h4: 22,
|
|
487
754
|
h5: 19,
|
|
488
755
|
h6: 16
|
|
489
|
-
},
|
|
756
|
+
}, Be = {
|
|
490
757
|
font: "system",
|
|
491
758
|
headingFont: "inherit",
|
|
492
|
-
headings:
|
|
759
|
+
headings: ze,
|
|
493
760
|
bodySize: 16,
|
|
494
|
-
light:
|
|
495
|
-
dark:
|
|
496
|
-
},
|
|
761
|
+
light: Re.light,
|
|
762
|
+
dark: Re.dark
|
|
763
|
+
}, Ve = {
|
|
497
764
|
system: {
|
|
498
765
|
label: "System",
|
|
499
|
-
value:
|
|
766
|
+
value: J
|
|
500
767
|
},
|
|
501
768
|
inter: {
|
|
502
769
|
label: "Inter",
|
|
503
|
-
value: `"Inter", ${
|
|
770
|
+
value: `"Inter", ${J}`
|
|
504
771
|
},
|
|
505
772
|
outfit: {
|
|
506
773
|
label: "Outfit",
|
|
507
|
-
value: `"Outfit", ${
|
|
774
|
+
value: `"Outfit", ${J}`
|
|
508
775
|
},
|
|
509
776
|
serif: {
|
|
510
777
|
label: "Serif",
|
|
@@ -514,7 +781,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
514
781
|
label: "Mono",
|
|
515
782
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
516
783
|
}
|
|
517
|
-
},
|
|
784
|
+
}, He = (e, t) => Ve[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), Ue = (e, ...t) => {
|
|
518
785
|
let n = Object.assign({}, e, ...t);
|
|
519
786
|
return n.primary = {
|
|
520
787
|
...e.primary,
|
|
@@ -530,25 +797,25 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
530
797
|
}), {})
|
|
531
798
|
}, n;
|
|
532
799
|
};
|
|
533
|
-
function
|
|
800
|
+
function We(e) {
|
|
534
801
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
535
802
|
return {
|
|
536
|
-
font: r ??
|
|
537
|
-
headingFont: i ??
|
|
803
|
+
font: r ?? Be.font,
|
|
804
|
+
headingFont: i ?? Be.headingFont,
|
|
538
805
|
headings: {
|
|
539
|
-
...
|
|
806
|
+
...ze,
|
|
540
807
|
...a ?? {}
|
|
541
808
|
},
|
|
542
809
|
bodySize: o ?? 16,
|
|
543
|
-
light:
|
|
544
|
-
dark:
|
|
810
|
+
light: Ue(Re.light, s, t),
|
|
811
|
+
dark: Ue(Re.dark, n)
|
|
545
812
|
};
|
|
546
813
|
}
|
|
547
|
-
function
|
|
814
|
+
function Ge(e) {
|
|
548
815
|
return {
|
|
549
816
|
"--page-bg": e.background,
|
|
550
817
|
"--page-surface": e.surface ?? e.background,
|
|
551
|
-
"--page-border": e.border ??
|
|
818
|
+
"--page-border": e.border ?? Re.light.border,
|
|
552
819
|
"--page-text": e.text,
|
|
553
820
|
"--page-accent": e.accent,
|
|
554
821
|
"--page-accent-text": e.accentText,
|
|
@@ -562,71 +829,71 @@ function me(e) {
|
|
|
562
829
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
563
830
|
};
|
|
564
831
|
}
|
|
565
|
-
function
|
|
566
|
-
let t =
|
|
832
|
+
function Ke(e) {
|
|
833
|
+
let t = We(e);
|
|
567
834
|
return {
|
|
568
835
|
backgroundColor: "var(--page-bg)",
|
|
569
836
|
color: "var(--page-text)",
|
|
570
|
-
fontFamily:
|
|
571
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
572
|
-
...
|
|
573
|
-
"--page-body-size":
|
|
837
|
+
fontFamily: He(t.font, J),
|
|
838
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : He(t.headingFont, "inherit"),
|
|
839
|
+
...Je(t.headings),
|
|
840
|
+
"--page-body-size": qe(t.bodySize, 16)
|
|
574
841
|
};
|
|
575
842
|
}
|
|
576
|
-
function
|
|
843
|
+
function qe(e, t) {
|
|
577
844
|
return e === "" || e == null ? `${t}px` : isNaN(Number(e)) ? String(e) : `${Number(e)}px`;
|
|
578
845
|
}
|
|
579
|
-
function
|
|
846
|
+
function Je(e) {
|
|
580
847
|
let t = {};
|
|
581
|
-
for (let n of Object.keys(
|
|
582
|
-
let r = e?.[n] ??
|
|
583
|
-
t[`--page-${n}`] =
|
|
848
|
+
for (let n of Object.keys(ze)) {
|
|
849
|
+
let r = e?.[n] ?? ze[n];
|
|
850
|
+
t[`--page-${n}`] = qe(r, ze[n]);
|
|
584
851
|
}
|
|
585
852
|
return t;
|
|
586
853
|
}
|
|
587
|
-
function
|
|
588
|
-
let n =
|
|
854
|
+
function Ye(e, t = "light") {
|
|
855
|
+
let n = We(e);
|
|
589
856
|
return {
|
|
590
|
-
...
|
|
591
|
-
...
|
|
857
|
+
...Ke(e),
|
|
858
|
+
...Ge(n[t] ?? n.light)
|
|
592
859
|
};
|
|
593
860
|
}
|
|
594
|
-
function
|
|
861
|
+
function Xe(e, t) {
|
|
595
862
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
596
863
|
}
|
|
597
|
-
function
|
|
864
|
+
function Ze(e, t) {
|
|
598
865
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
599
866
|
}
|
|
600
867
|
//#endregion
|
|
601
868
|
//#region ../ui/src/components/builder/views.jsx
|
|
602
|
-
var
|
|
869
|
+
var Q = n({
|
|
603
870
|
tenant: "",
|
|
604
871
|
apiUrl: "/api",
|
|
605
872
|
locale: "",
|
|
606
873
|
settings: null
|
|
607
|
-
}),
|
|
874
|
+
}), Qe = n(null), $e = (e) => {
|
|
608
875
|
let t = Number(e?.__page);
|
|
609
876
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
610
877
|
if (typeof window > "u") return 1;
|
|
611
878
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
612
879
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
613
|
-
},
|
|
880
|
+
}, et = () => {
|
|
614
881
|
if (typeof window > "u") return {};
|
|
615
882
|
let e = {};
|
|
616
883
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
617
884
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
618
885
|
}), e;
|
|
619
|
-
},
|
|
886
|
+
}, tt = (e) => {
|
|
620
887
|
let t = {
|
|
621
888
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
622
|
-
...
|
|
889
|
+
...et()
|
|
623
890
|
};
|
|
624
891
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
625
|
-
},
|
|
626
|
-
function
|
|
892
|
+
}, nt = n(null), rt = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
893
|
+
function it(e, t) {
|
|
627
894
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
628
895
|
}
|
|
629
|
-
var
|
|
896
|
+
var at = (e) => {
|
|
630
897
|
let t = [];
|
|
631
898
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
632
899
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -636,39 +903,39 @@ var Te = (e) => {
|
|
|
636
903
|
}
|
|
637
904
|
return t;
|
|
638
905
|
};
|
|
639
|
-
function
|
|
906
|
+
function ot(e) {
|
|
640
907
|
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(" ") : "";
|
|
641
908
|
}
|
|
642
|
-
function
|
|
643
|
-
let n = t?.data ?? {}, r =
|
|
909
|
+
function st(e, t) {
|
|
910
|
+
let n = t?.data ?? {}, r = at(n);
|
|
644
911
|
if (!r.length) return e;
|
|
645
|
-
let i = RegExp(`:(${r.map(
|
|
912
|
+
let i = RegExp(`:(${r.map(rt).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => ot(it(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
646
913
|
return a(e);
|
|
647
914
|
}
|
|
648
|
-
var
|
|
915
|
+
var ct = {
|
|
649
916
|
margin: 0,
|
|
650
917
|
fontWeight: 700,
|
|
651
918
|
lineHeight: 1.2,
|
|
652
919
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
653
|
-
},
|
|
920
|
+
}, lt = ze, ut = (e) => `var(--page-${e}, ${ze[e] ?? ze.h2}px)`, dt = {
|
|
654
921
|
margin: 0,
|
|
655
922
|
fontSize: "var(--page-body-size, 16px)"
|
|
656
|
-
},
|
|
923
|
+
}, ft = {
|
|
657
924
|
display: "inline-block",
|
|
658
925
|
textDecoration: "none",
|
|
659
926
|
cursor: "pointer",
|
|
660
927
|
backgroundColor: "var(--page-accent, #111827)",
|
|
661
928
|
color: "var(--page-accent-text, #ffffff)"
|
|
662
|
-
},
|
|
929
|
+
}, pt = {
|
|
663
930
|
flexGrow: 1,
|
|
664
931
|
display: "flex",
|
|
665
932
|
flexDirection: "column",
|
|
666
933
|
position: "relative"
|
|
667
|
-
},
|
|
934
|
+
}, mt = {
|
|
668
935
|
display: "flex",
|
|
669
936
|
flexDirection: "column"
|
|
670
937
|
};
|
|
671
|
-
function
|
|
938
|
+
function ht({ style: e }) {
|
|
672
939
|
let t = e?.backgroundVideo;
|
|
673
940
|
if (!t) return null;
|
|
674
941
|
let n = {
|
|
@@ -694,7 +961,7 @@ function Fe({ style: e }) {
|
|
|
694
961
|
background: r
|
|
695
962
|
} })] });
|
|
696
963
|
}
|
|
697
|
-
var
|
|
964
|
+
var gt = (e, t) => e?.backgroundVideo ? {
|
|
698
965
|
position: "relative",
|
|
699
966
|
...t,
|
|
700
967
|
...P(e)
|
|
@@ -702,24 +969,24 @@ var Ie = (e, t) => e?.backgroundVideo ? {
|
|
|
702
969
|
...t,
|
|
703
970
|
...P(e)
|
|
704
971
|
};
|
|
705
|
-
function
|
|
972
|
+
function _t({ style: e, nodeRef: t, children: n }) {
|
|
706
973
|
return /* @__PURE__ */ f("div", {
|
|
707
974
|
ref: t,
|
|
708
975
|
style: {
|
|
709
|
-
...
|
|
976
|
+
...pt,
|
|
710
977
|
...P(e)
|
|
711
978
|
},
|
|
712
|
-
children: [/* @__PURE__ */ d(
|
|
979
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
713
980
|
});
|
|
714
981
|
}
|
|
715
|
-
function
|
|
982
|
+
function vt({ style: e, nodeRef: t, children: n }) {
|
|
716
983
|
return /* @__PURE__ */ f("section", {
|
|
717
984
|
ref: t,
|
|
718
|
-
style:
|
|
719
|
-
children: [/* @__PURE__ */ d(
|
|
985
|
+
style: gt(e, mt),
|
|
986
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), n]
|
|
720
987
|
});
|
|
721
988
|
}
|
|
722
|
-
function
|
|
989
|
+
function yt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
723
990
|
let i = t ? {
|
|
724
991
|
position: "relative",
|
|
725
992
|
minHeight: 240
|
|
@@ -728,33 +995,56 @@ function ze({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
728
995
|
ref: n,
|
|
729
996
|
style: i ? {
|
|
730
997
|
...i,
|
|
731
|
-
...
|
|
732
|
-
} :
|
|
733
|
-
children: [/* @__PURE__ */ d(
|
|
998
|
+
...gt(e)
|
|
999
|
+
} : gt(e),
|
|
1000
|
+
children: [/* @__PURE__ */ d(ht, { style: e }), r]
|
|
734
1001
|
});
|
|
735
1002
|
}
|
|
736
|
-
function
|
|
1003
|
+
function bt({ href: e, target: t, style: n, nodeRef: r, children: i }) {
|
|
1004
|
+
return /* @__PURE__ */ f("a", {
|
|
1005
|
+
ref: r,
|
|
1006
|
+
href: e || "#",
|
|
1007
|
+
target: t || void 0,
|
|
1008
|
+
rel: t === "_blank" ? "noopener noreferrer" : void 0,
|
|
1009
|
+
style: {
|
|
1010
|
+
...Vt,
|
|
1011
|
+
...gt(n)
|
|
1012
|
+
},
|
|
1013
|
+
children: [/* @__PURE__ */ d(ht, { style: n }), i]
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
function xt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
737
1017
|
return /* @__PURE__ */ d(n, {
|
|
738
1018
|
ref: a,
|
|
739
1019
|
style: {
|
|
740
|
-
...
|
|
741
|
-
fontSize:
|
|
1020
|
+
...ct,
|
|
1021
|
+
fontSize: ut(n),
|
|
742
1022
|
...P(r)
|
|
743
1023
|
},
|
|
744
|
-
children:
|
|
1024
|
+
children: Tt(t, e, i)
|
|
745
1025
|
});
|
|
746
1026
|
}
|
|
747
|
-
var
|
|
748
|
-
fontFamily:
|
|
1027
|
+
var St = {
|
|
1028
|
+
fontFamily: Ve.mono.value,
|
|
749
1029
|
background: "rgba(148, 163, 184, 0.18)",
|
|
750
1030
|
padding: "1px 5px",
|
|
751
1031
|
borderRadius: 4,
|
|
752
1032
|
fontSize: "0.9em"
|
|
1033
|
+
}, Ct = {
|
|
1034
|
+
fontFamily: Ve.mono.value,
|
|
1035
|
+
background: "rgba(148, 163, 184, 0.16)",
|
|
1036
|
+
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1037
|
+
borderRadius: 6,
|
|
1038
|
+
padding: "12px 14px",
|
|
1039
|
+
fontSize: "0.875em",
|
|
1040
|
+
lineHeight: 1.55,
|
|
1041
|
+
overflowX: "auto",
|
|
1042
|
+
whiteSpace: "pre"
|
|
753
1043
|
};
|
|
754
|
-
function
|
|
1044
|
+
function wt(e, t = [], n, r) {
|
|
755
1045
|
let i = e;
|
|
756
1046
|
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", {
|
|
757
|
-
style:
|
|
1047
|
+
style: St,
|
|
758
1048
|
children: i
|
|
759
1049
|
})), 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", {
|
|
760
1050
|
href: n,
|
|
@@ -770,13 +1060,22 @@ function He(e, t = [], n, r) {
|
|
|
770
1060
|
children: i
|
|
771
1061
|
})), i;
|
|
772
1062
|
}
|
|
773
|
-
function
|
|
1063
|
+
function Tt(e, n, r) {
|
|
774
1064
|
return e?.length ? e.map((e, n) => {
|
|
775
1065
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
776
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
1066
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: Tt(e.parts, "", r) }, n);
|
|
1067
|
+
if (e.br) return /* @__PURE__ */ d("br", {}, n);
|
|
777
1068
|
let i = e.text;
|
|
778
|
-
return e.
|
|
779
|
-
|
|
1069
|
+
return e.image && (i = /* @__PURE__ */ d("img", {
|
|
1070
|
+
src: e.image.src,
|
|
1071
|
+
alt: e.image.alt || "",
|
|
1072
|
+
title: e.image.title || void 0,
|
|
1073
|
+
style: {
|
|
1074
|
+
maxWidth: "100%",
|
|
1075
|
+
verticalAlign: "middle"
|
|
1076
|
+
}
|
|
1077
|
+
})), e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
1078
|
+
style: St,
|
|
780
1079
|
children: i
|
|
781
1080
|
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
782
1081
|
style: {
|
|
@@ -799,35 +1098,35 @@ function Ue(e, n, r) {
|
|
|
799
1098
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
800
1099
|
}) : n;
|
|
801
1100
|
}
|
|
802
|
-
function
|
|
1101
|
+
function Et({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
803
1102
|
return /* @__PURE__ */ d("span", {
|
|
804
1103
|
style: P(a),
|
|
805
|
-
children: e?.length ?
|
|
1104
|
+
children: e?.length ? Tt(e, t) : wt(t, n, r, i)
|
|
806
1105
|
});
|
|
807
1106
|
}
|
|
808
|
-
var
|
|
1107
|
+
var Dt = [
|
|
809
1108
|
"left",
|
|
810
1109
|
"center",
|
|
811
1110
|
"right",
|
|
812
1111
|
"justify"
|
|
813
1112
|
];
|
|
814
|
-
function
|
|
1113
|
+
function Ot(e, t, n) {
|
|
815
1114
|
let r = e && e.cellStyles;
|
|
816
1115
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
817
1116
|
let i = r[`${t}:${n}`];
|
|
818
1117
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
819
1118
|
}
|
|
820
|
-
function
|
|
1119
|
+
function kt(e, t) {
|
|
821
1120
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
822
1121
|
return {
|
|
823
|
-
textAlign:
|
|
1122
|
+
textAlign: Dt.includes(n.align) ? n.align : "left",
|
|
824
1123
|
fontWeight: r ? 700 : 400,
|
|
825
1124
|
fontStyle: n.italic ? "italic" : void 0,
|
|
826
1125
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
827
1126
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
828
1127
|
};
|
|
829
1128
|
}
|
|
830
|
-
function
|
|
1129
|
+
function At({ align: e = "center", width: t, wrap: n } = {}) {
|
|
831
1130
|
let r = t ? `${t}%` : void 0;
|
|
832
1131
|
if (e === "full") return { width: "100%" };
|
|
833
1132
|
let i = e === "left" || e === "right";
|
|
@@ -861,18 +1160,48 @@ function Je({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
861
1160
|
marginRight: "auto"
|
|
862
1161
|
};
|
|
863
1162
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
1163
|
+
var jt = {
|
|
1164
|
+
red: "#e03131",
|
|
1165
|
+
orange: "#e8590c",
|
|
1166
|
+
yellow: "#c98a00",
|
|
1167
|
+
blue: "#1c7ed6",
|
|
1168
|
+
purple: "#7048e8",
|
|
1169
|
+
pink: "#d6336c",
|
|
1170
|
+
green: "#2f9e44",
|
|
1171
|
+
grey: "#868e96"
|
|
1172
|
+
}, Mt = {
|
|
1173
|
+
red: "rgba(224, 49, 49, 0.12)",
|
|
1174
|
+
orange: "rgba(232, 89, 12, 0.12)",
|
|
1175
|
+
yellow: "rgba(201, 138, 0, 0.15)",
|
|
1176
|
+
blue: "rgba(28, 126, 214, 0.12)",
|
|
1177
|
+
purple: "rgba(112, 72, 232, 0.12)",
|
|
1178
|
+
pink: "rgba(214, 51, 108, 0.12)",
|
|
1179
|
+
green: "rgba(47, 158, 68, 0.12)",
|
|
1180
|
+
grey: "rgba(134, 142, 150, 0.16)"
|
|
1181
|
+
};
|
|
1182
|
+
function Nt(e) {
|
|
1183
|
+
let t = jt[e?.color] ?? (e?.color || ""), n = Mt[e?.background] ?? (e?.background || "");
|
|
1184
|
+
return {
|
|
1185
|
+
...t && { color: t },
|
|
1186
|
+
...n && {
|
|
1187
|
+
backgroundColor: n,
|
|
1188
|
+
padding: "8px 12px",
|
|
1189
|
+
borderRadius: "8px"
|
|
1190
|
+
}
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
function Pt(e = [], t, n) {
|
|
1194
|
+
let r = n ?? ((e, n) => Tt(e, n, t));
|
|
1195
|
+
return e.map((n, i) => {
|
|
1196
|
+
let a = {
|
|
868
1197
|
marginTop: 0,
|
|
869
|
-
marginBottom:
|
|
1198
|
+
marginBottom: i === e.length - 1 ? 0 : 14
|
|
870
1199
|
};
|
|
871
|
-
if (
|
|
872
|
-
if (!
|
|
1200
|
+
if (n.type === "image") {
|
|
1201
|
+
if (!n.src) return null;
|
|
873
1202
|
let e = /* @__PURE__ */ d("img", {
|
|
874
|
-
src:
|
|
875
|
-
alt:
|
|
1203
|
+
src: n.src,
|
|
1204
|
+
alt: n.alt || "",
|
|
876
1205
|
style: {
|
|
877
1206
|
width: "100%",
|
|
878
1207
|
display: "block",
|
|
@@ -883,51 +1212,51 @@ function Ye(e = [], t, n) {
|
|
|
883
1212
|
style: {
|
|
884
1213
|
marginLeft: 0,
|
|
885
1214
|
marginRight: 0,
|
|
886
|
-
...
|
|
887
|
-
...
|
|
1215
|
+
...a,
|
|
1216
|
+
...At(n)
|
|
888
1217
|
},
|
|
889
|
-
children: [
|
|
890
|
-
href:
|
|
891
|
-
target:
|
|
892
|
-
rel:
|
|
1218
|
+
children: [n.href ? /* @__PURE__ */ d("a", {
|
|
1219
|
+
href: n.href,
|
|
1220
|
+
target: n.target || void 0,
|
|
1221
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
893
1222
|
style: { display: "block" },
|
|
894
1223
|
children: e
|
|
895
|
-
}) : e,
|
|
1224
|
+
}) : e, n.caption && /* @__PURE__ */ d("figcaption", {
|
|
896
1225
|
style: {
|
|
897
1226
|
fontSize: 13,
|
|
898
1227
|
opacity: .65,
|
|
899
1228
|
marginTop: 6,
|
|
900
1229
|
textAlign: "center"
|
|
901
1230
|
},
|
|
902
|
-
children:
|
|
1231
|
+
children: n.caption
|
|
903
1232
|
})]
|
|
904
|
-
},
|
|
1233
|
+
}, i);
|
|
905
1234
|
}
|
|
906
|
-
if (
|
|
1235
|
+
if (n.type === "video") return qt(n.url) ? /* @__PURE__ */ d("div", {
|
|
907
1236
|
style: {
|
|
908
|
-
...
|
|
909
|
-
...
|
|
910
|
-
align:
|
|
911
|
-
wrap:
|
|
912
|
-
width:
|
|
1237
|
+
...a,
|
|
1238
|
+
...At({
|
|
1239
|
+
align: n.align,
|
|
1240
|
+
wrap: n.wrap,
|
|
1241
|
+
width: n.width ?? 100
|
|
913
1242
|
})
|
|
914
1243
|
},
|
|
915
|
-
children: /* @__PURE__ */ d(
|
|
916
|
-
url:
|
|
917
|
-
autoplay:
|
|
918
|
-
muted:
|
|
919
|
-
loop:
|
|
920
|
-
controls:
|
|
921
|
-
start:
|
|
1244
|
+
children: /* @__PURE__ */ d(Jt, {
|
|
1245
|
+
url: n.url,
|
|
1246
|
+
autoplay: n.autoplay,
|
|
1247
|
+
muted: n.muted,
|
|
1248
|
+
loop: n.loop,
|
|
1249
|
+
controls: n.controls ?? !0,
|
|
1250
|
+
start: n.start
|
|
922
1251
|
})
|
|
923
|
-
},
|
|
924
|
-
if (
|
|
925
|
-
if (!(typeof
|
|
926
|
-
let e = Number.isFinite(Number(
|
|
1252
|
+
}, i) : null;
|
|
1253
|
+
if (n.type === "button") {
|
|
1254
|
+
if (!(typeof n.label == "string" && n.label.trim())) return null;
|
|
1255
|
+
let e = Number.isFinite(Number(n.radius)) ? Number(n.radius) : 8, t = ["center", "right"].includes(n.align) ? n.align : "left";
|
|
927
1256
|
return /* @__PURE__ */ d("div", {
|
|
928
1257
|
style: {
|
|
929
|
-
...
|
|
930
|
-
textAlign:
|
|
1258
|
+
...a,
|
|
1259
|
+
textAlign: t
|
|
931
1260
|
},
|
|
932
1261
|
children: /* @__PURE__ */ d("table", {
|
|
933
1262
|
role: "presentation",
|
|
@@ -939,132 +1268,204 @@ function Ye(e = [], t, n) {
|
|
|
939
1268
|
},
|
|
940
1269
|
children: /* @__PURE__ */ d("tbody", { children: /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
941
1270
|
style: {
|
|
942
|
-
backgroundColor:
|
|
1271
|
+
backgroundColor: n.bg || "var(--page-accent, #4f46e5)",
|
|
943
1272
|
borderRadius: e
|
|
944
1273
|
},
|
|
945
1274
|
children: /* @__PURE__ */ d("a", {
|
|
946
|
-
href:
|
|
947
|
-
target:
|
|
948
|
-
rel:
|
|
1275
|
+
href: n.href || "#",
|
|
1276
|
+
target: n.target || void 0,
|
|
1277
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
949
1278
|
style: {
|
|
950
1279
|
display: "inline-block",
|
|
951
1280
|
padding: "13px 24px",
|
|
952
|
-
color:
|
|
1281
|
+
color: n.color || "#ffffff",
|
|
953
1282
|
fontSize: 15,
|
|
954
1283
|
fontWeight: 600,
|
|
955
1284
|
lineHeight: 1.2,
|
|
956
1285
|
textDecoration: "none",
|
|
957
1286
|
borderRadius: e
|
|
958
1287
|
},
|
|
959
|
-
children:
|
|
1288
|
+
children: n.label
|
|
960
1289
|
})
|
|
961
1290
|
}) }) })
|
|
962
1291
|
})
|
|
963
|
-
},
|
|
1292
|
+
}, i);
|
|
964
1293
|
}
|
|
965
|
-
if (
|
|
966
|
-
...
|
|
1294
|
+
if (n.type === "divider") return /* @__PURE__ */ d("hr", { style: {
|
|
1295
|
+
...a,
|
|
967
1296
|
border: 0,
|
|
968
1297
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
969
|
-
} },
|
|
970
|
-
if (
|
|
971
|
-
let e = Array.isArray(
|
|
1298
|
+
} }, i);
|
|
1299
|
+
if (n.type === "table") {
|
|
1300
|
+
let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
|
|
972
1301
|
if (!e.length) return null;
|
|
973
|
-
let
|
|
974
|
-
border:
|
|
975
|
-
padding:
|
|
1302
|
+
let t = n.header !== !1, o = n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)", s = Number.isFinite(n.padX) ? Math.max(0, n.padX) : 10, c = Number.isFinite(n.padY) ? Math.max(0, n.padY) : 6, l = Math.max(0, Number(n.spacing) || 0), u = {
|
|
1303
|
+
border: o,
|
|
1304
|
+
padding: `${c}px ${s}px`,
|
|
976
1305
|
verticalAlign: "top"
|
|
977
|
-
},
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
})
|
|
1306
|
+
}, p = Array.isArray(n.heights) ? n.heights : null, m = (e) => {
|
|
1307
|
+
let t = Number(p?.[e]);
|
|
1308
|
+
return Number.isFinite(t) && t > 0 ? { height: `${t}px` } : void 0;
|
|
1309
|
+
}, h = t ? e.slice(1) : e, g = Array.isArray(n.widths) ? n.widths : null, _ = (e, t, r) => ({
|
|
1310
|
+
...u,
|
|
1311
|
+
...kt(Ot(n, e, t), r)
|
|
1312
|
+
}), v = n.spans && typeof n.spans == "object" ? n.spans : null, y = /* @__PURE__ */ new Set();
|
|
1313
|
+
v && e.forEach((e, t) => e.forEach((e, n) => {
|
|
1314
|
+
let r = v[`${t}:${n}`];
|
|
1315
|
+
if (!r) return;
|
|
1316
|
+
let i = Math.max(1, Number(r.c) || 1), a = Math.max(1, Number(r.r) || 1);
|
|
1317
|
+
for (let e = 0; e < a; e += 1) for (let r = 0; r < i; r += 1) (e || r) && y.add(`${t + e}:${n + r}`);
|
|
1318
|
+
}));
|
|
1319
|
+
let b = (e, t) => {
|
|
1320
|
+
let n = v?.[`${e}:${t}`], r = Math.max(1, Number(n?.c) || 1), i = Math.max(1, Number(n?.r) || 1);
|
|
1321
|
+
return {
|
|
1322
|
+
colSpan: r > 1 ? r : void 0,
|
|
1323
|
+
rowSpan: i > 1 ? i : void 0
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
981
1326
|
return /* @__PURE__ */ f("table", {
|
|
982
1327
|
style: {
|
|
983
|
-
...
|
|
984
|
-
borderCollapse: "collapse",
|
|
1328
|
+
...a,
|
|
1329
|
+
borderCollapse: l ? "separate" : "collapse",
|
|
1330
|
+
borderSpacing: l ? `${l}px` : void 0,
|
|
985
1331
|
width: "100%",
|
|
986
1332
|
fontSize: "inherit",
|
|
987
|
-
tableLayout:
|
|
1333
|
+
tableLayout: g ? "fixed" : void 0
|
|
988
1334
|
},
|
|
989
1335
|
children: [
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
style:
|
|
993
|
-
children: e
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
}
|
|
1336
|
+
g && /* @__PURE__ */ d("colgroup", { children: g.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
1337
|
+
t && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", {
|
|
1338
|
+
style: m(0),
|
|
1339
|
+
children: e[0].map((e, t) => y.has(`0:${t}`) ? null : /* @__PURE__ */ d("th", {
|
|
1340
|
+
style: _(0, t, !0),
|
|
1341
|
+
...b(0, t),
|
|
1342
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1343
|
+
}, t))
|
|
1344
|
+
}) }),
|
|
1345
|
+
/* @__PURE__ */ d("tbody", { children: h.map((e, n) => /* @__PURE__ */ d("tr", {
|
|
1346
|
+
style: m(t ? n + 1 : n),
|
|
1347
|
+
children: e.map((e, i) => {
|
|
1348
|
+
let a = t ? n + 1 : n;
|
|
1349
|
+
return y.has(`${a}:${i}`) ? null : /* @__PURE__ */ d("td", {
|
|
1350
|
+
style: _(a, i, !1),
|
|
1351
|
+
...b(a, i),
|
|
1352
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1353
|
+
}, i);
|
|
1354
|
+
})
|
|
1355
|
+
}, n)) })
|
|
999
1356
|
]
|
|
1000
|
-
},
|
|
1357
|
+
}, i);
|
|
1001
1358
|
}
|
|
1002
|
-
if (
|
|
1003
|
-
let e =
|
|
1359
|
+
if (n.type === "ul" || n.type === "ol") {
|
|
1360
|
+
let e = n.type;
|
|
1004
1361
|
return /* @__PURE__ */ d(e, {
|
|
1005
1362
|
style: {
|
|
1006
|
-
...
|
|
1007
|
-
|
|
1363
|
+
...a,
|
|
1364
|
+
...Nt(n),
|
|
1365
|
+
paddingLeft: n.background ? 34 : 24
|
|
1008
1366
|
},
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1367
|
+
start: n.type === "ol" ? n.start : void 0,
|
|
1368
|
+
children: (n.items ?? []).map((e, n) => {
|
|
1369
|
+
let i = typeof e.task == "boolean";
|
|
1370
|
+
return /* @__PURE__ */ f("li", {
|
|
1371
|
+
style: {
|
|
1372
|
+
marginBottom: 4,
|
|
1373
|
+
...i && {
|
|
1374
|
+
listStyleType: "none",
|
|
1375
|
+
marginLeft: -18
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1378
|
+
children: [
|
|
1379
|
+
i && /* @__PURE__ */ d("span", {
|
|
1380
|
+
style: { marginRight: 6 },
|
|
1381
|
+
children: e.task ? "☑" : "☐"
|
|
1382
|
+
}),
|
|
1383
|
+
r(e.parts, e.text),
|
|
1384
|
+
e.blocks?.length ? Pt(e.blocks, t, r) : null
|
|
1385
|
+
]
|
|
1386
|
+
}, n);
|
|
1387
|
+
})
|
|
1388
|
+
}, i);
|
|
1014
1389
|
}
|
|
1015
|
-
if (
|
|
1390
|
+
if (n.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
1016
1391
|
style: {
|
|
1017
|
-
...
|
|
1018
|
-
...
|
|
1392
|
+
...Lt,
|
|
1393
|
+
...a,
|
|
1394
|
+
...Nt(n),
|
|
1395
|
+
...n.background && { paddingLeft: 20 }
|
|
1019
1396
|
},
|
|
1020
|
-
children: r(
|
|
1021
|
-
},
|
|
1022
|
-
if (
|
|
1023
|
-
|
|
1397
|
+
children: n.blocks?.length ? Pt(n.blocks, t, r) : r(n.parts, n.text)
|
|
1398
|
+
}, i);
|
|
1399
|
+
if (n.type === "code") return /* @__PURE__ */ d("pre", {
|
|
1400
|
+
"data-lang": n.lang || void 0,
|
|
1401
|
+
style: {
|
|
1402
|
+
...a,
|
|
1403
|
+
...Ct
|
|
1404
|
+
},
|
|
1405
|
+
children: /* @__PURE__ */ d("code", {
|
|
1406
|
+
style: { fontFamily: "inherit" },
|
|
1407
|
+
children: n.text
|
|
1408
|
+
})
|
|
1409
|
+
}, i);
|
|
1410
|
+
if (lt[n.type]) {
|
|
1411
|
+
let e = n.type;
|
|
1024
1412
|
return /* @__PURE__ */ d(e, {
|
|
1025
1413
|
style: {
|
|
1026
|
-
...
|
|
1027
|
-
fontSize:
|
|
1028
|
-
...
|
|
1414
|
+
...ct,
|
|
1415
|
+
fontSize: ut(n.type),
|
|
1416
|
+
...a,
|
|
1417
|
+
...Nt(n)
|
|
1029
1418
|
},
|
|
1030
|
-
children: r(
|
|
1031
|
-
},
|
|
1419
|
+
children: r(n.parts, n.text)
|
|
1420
|
+
}, i);
|
|
1032
1421
|
}
|
|
1033
1422
|
return /* @__PURE__ */ d("p", {
|
|
1034
1423
|
style: {
|
|
1035
|
-
...
|
|
1036
|
-
...
|
|
1424
|
+
...dt,
|
|
1425
|
+
...a,
|
|
1426
|
+
...Nt(n)
|
|
1037
1427
|
},
|
|
1038
|
-
children: r(
|
|
1039
|
-
},
|
|
1428
|
+
children: r(n.parts, n.text)
|
|
1429
|
+
}, i);
|
|
1040
1430
|
});
|
|
1041
1431
|
}
|
|
1042
|
-
function
|
|
1432
|
+
function Ft({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1043
1433
|
return /* @__PURE__ */ d("div", {
|
|
1044
1434
|
ref: r,
|
|
1045
1435
|
style: {
|
|
1046
1436
|
display: "flow-root",
|
|
1047
1437
|
...P(t)
|
|
1048
1438
|
},
|
|
1049
|
-
children:
|
|
1439
|
+
children: Pt(e, n)
|
|
1440
|
+
});
|
|
1441
|
+
}
|
|
1442
|
+
function It({ markdown: e, newTab: t, style: n, nodeRef: r }) {
|
|
1443
|
+
let i = s(() => Le(e, { newTab: t }), [e, t]);
|
|
1444
|
+
return /* @__PURE__ */ d("div", {
|
|
1445
|
+
ref: r,
|
|
1446
|
+
style: {
|
|
1447
|
+
display: "flow-root",
|
|
1448
|
+
...P(n)
|
|
1449
|
+
},
|
|
1450
|
+
children: Pt(i)
|
|
1050
1451
|
});
|
|
1051
1452
|
}
|
|
1052
|
-
var
|
|
1453
|
+
var Lt = {
|
|
1053
1454
|
margin: 0,
|
|
1054
1455
|
padding: "8px 0 8px 20px",
|
|
1055
1456
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1056
1457
|
};
|
|
1057
|
-
function
|
|
1458
|
+
function Rt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1058
1459
|
return /* @__PURE__ */ d("blockquote", {
|
|
1059
1460
|
ref: i,
|
|
1060
1461
|
style: {
|
|
1061
|
-
...
|
|
1462
|
+
...Lt,
|
|
1062
1463
|
...P(n)
|
|
1063
1464
|
},
|
|
1064
|
-
children:
|
|
1465
|
+
children: Tt(t, e, r)
|
|
1065
1466
|
});
|
|
1066
1467
|
}
|
|
1067
|
-
function
|
|
1468
|
+
function zt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1068
1469
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
1069
1470
|
ref: r,
|
|
1070
1471
|
style: {
|
|
@@ -1074,53 +1475,58 @@ function $e({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1074
1475
|
},
|
|
1075
1476
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
1076
1477
|
style: { marginBottom: 4 },
|
|
1077
|
-
children:
|
|
1478
|
+
children: Tt(e.parts, e.text)
|
|
1078
1479
|
}, t))
|
|
1079
1480
|
});
|
|
1080
1481
|
}
|
|
1081
|
-
function
|
|
1482
|
+
function Bt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1082
1483
|
return /* @__PURE__ */ d("p", {
|
|
1083
1484
|
ref: i,
|
|
1084
1485
|
style: {
|
|
1085
|
-
...
|
|
1486
|
+
...dt,
|
|
1086
1487
|
...P(n)
|
|
1087
1488
|
},
|
|
1088
|
-
children:
|
|
1489
|
+
children: Tt(t, e, r)
|
|
1089
1490
|
});
|
|
1090
1491
|
}
|
|
1091
|
-
var
|
|
1492
|
+
var Vt = {
|
|
1493
|
+
display: "block",
|
|
1494
|
+
color: "inherit",
|
|
1495
|
+
textDecoration: "none",
|
|
1496
|
+
cursor: "pointer"
|
|
1497
|
+
}, Ht = {
|
|
1092
1498
|
color: "var(--page-accent, inherit)",
|
|
1093
1499
|
textDecoration: "underline",
|
|
1094
1500
|
textUnderlineOffset: 3,
|
|
1095
1501
|
cursor: "pointer"
|
|
1096
1502
|
};
|
|
1097
|
-
function
|
|
1503
|
+
function Ut({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1098
1504
|
return /* @__PURE__ */ d("a", {
|
|
1099
1505
|
ref: o,
|
|
1100
1506
|
href: n || "#",
|
|
1101
1507
|
target: r || void 0,
|
|
1102
1508
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1103
1509
|
style: {
|
|
1104
|
-
...
|
|
1510
|
+
...Ht,
|
|
1105
1511
|
...P(i)
|
|
1106
1512
|
},
|
|
1107
|
-
children:
|
|
1513
|
+
children: Tt(t, e, a)
|
|
1108
1514
|
});
|
|
1109
1515
|
}
|
|
1110
|
-
function
|
|
1516
|
+
function Wt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1111
1517
|
return /* @__PURE__ */ d("a", {
|
|
1112
1518
|
ref: o,
|
|
1113
1519
|
href: n || "#",
|
|
1114
1520
|
target: r || void 0,
|
|
1115
1521
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1116
1522
|
style: {
|
|
1117
|
-
...
|
|
1523
|
+
...ft,
|
|
1118
1524
|
...P(i)
|
|
1119
1525
|
},
|
|
1120
|
-
children:
|
|
1526
|
+
children: Tt(t, e, a)
|
|
1121
1527
|
});
|
|
1122
1528
|
}
|
|
1123
|
-
function
|
|
1529
|
+
function Gt({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1124
1530
|
return e ? /* @__PURE__ */ d("img", {
|
|
1125
1531
|
ref: r,
|
|
1126
1532
|
src: e,
|
|
@@ -1132,7 +1538,7 @@ function it({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1132
1538
|
}
|
|
1133
1539
|
}) : null;
|
|
1134
1540
|
}
|
|
1135
|
-
function
|
|
1541
|
+
function Kt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1136
1542
|
return e ? /* @__PURE__ */ d("video", {
|
|
1137
1543
|
ref: s,
|
|
1138
1544
|
src: e,
|
|
@@ -1150,9 +1556,9 @@ function at({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1150
1556
|
}
|
|
1151
1557
|
}) : null;
|
|
1152
1558
|
}
|
|
1153
|
-
var
|
|
1154
|
-
function
|
|
1155
|
-
let c =
|
|
1559
|
+
var qt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1560
|
+
function Jt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1561
|
+
let c = qt(e);
|
|
1156
1562
|
if (!c) return null;
|
|
1157
1563
|
let l = new URLSearchParams({ rel: "0" });
|
|
1158
1564
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
|
|
@@ -1178,7 +1584,7 @@ function st({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1178
1584
|
})
|
|
1179
1585
|
});
|
|
1180
1586
|
}
|
|
1181
|
-
function
|
|
1587
|
+
function Yt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1182
1588
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
1183
1589
|
ref: i,
|
|
1184
1590
|
src: e,
|
|
@@ -1194,15 +1600,15 @@ function ct({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1194
1600
|
}
|
|
1195
1601
|
}) : null;
|
|
1196
1602
|
}
|
|
1197
|
-
var
|
|
1198
|
-
function
|
|
1199
|
-
return `@scope ([data-wb-embed]) {\n${e.replace(
|
|
1603
|
+
var Xt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1604
|
+
function Zt(e) {
|
|
1605
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(Xt, "$1:scope")}\n}`;
|
|
1200
1606
|
}
|
|
1201
|
-
function
|
|
1607
|
+
function Qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
|
|
1202
1608
|
let [o, s] = l(null);
|
|
1203
1609
|
return a(() => {
|
|
1204
1610
|
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1205
|
-
e.textContent =
|
|
1611
|
+
e.textContent = Zt(e.textContent || "");
|
|
1206
1612
|
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1207
1613
|
let t = document.createElement("script");
|
|
1208
1614
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
@@ -1220,7 +1626,7 @@ function dt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRe
|
|
|
1220
1626
|
style: P(r)
|
|
1221
1627
|
});
|
|
1222
1628
|
}
|
|
1223
|
-
function
|
|
1629
|
+
function $t({ height: e, style: t, nodeRef: n }) {
|
|
1224
1630
|
return /* @__PURE__ */ d("div", {
|
|
1225
1631
|
ref: n,
|
|
1226
1632
|
style: {
|
|
@@ -1231,7 +1637,7 @@ function ft({ height: e, style: t, nodeRef: n }) {
|
|
|
1231
1637
|
}
|
|
1232
1638
|
});
|
|
1233
1639
|
}
|
|
1234
|
-
function
|
|
1640
|
+
function en({ style: e, nodeRef: t }) {
|
|
1235
1641
|
return /* @__PURE__ */ d("div", {
|
|
1236
1642
|
ref: t,
|
|
1237
1643
|
style: {
|
|
@@ -1242,7 +1648,7 @@ function pt({ style: e, nodeRef: t }) {
|
|
|
1242
1648
|
}
|
|
1243
1649
|
});
|
|
1244
1650
|
}
|
|
1245
|
-
function
|
|
1651
|
+
function tn({ style: e, nodeRef: t }) {
|
|
1246
1652
|
return /* @__PURE__ */ d("div", {
|
|
1247
1653
|
ref: t,
|
|
1248
1654
|
style: {
|
|
@@ -1251,7 +1657,7 @@ function mt({ style: e, nodeRef: t }) {
|
|
|
1251
1657
|
}
|
|
1252
1658
|
});
|
|
1253
1659
|
}
|
|
1254
|
-
var
|
|
1660
|
+
var nn = {
|
|
1255
1661
|
position: "absolute",
|
|
1256
1662
|
top: "50%",
|
|
1257
1663
|
transform: "translateY(-50%)",
|
|
@@ -1268,7 +1674,7 @@ var ht = {
|
|
|
1268
1674
|
alignItems: "center",
|
|
1269
1675
|
justifyContent: "center",
|
|
1270
1676
|
padding: 0
|
|
1271
|
-
},
|
|
1677
|
+
}, rn = {
|
|
1272
1678
|
bottom: {
|
|
1273
1679
|
inset: "auto 0 0 0",
|
|
1274
1680
|
padding: "40px 24px 20px",
|
|
@@ -1287,8 +1693,8 @@ var ht = {
|
|
|
1287
1693
|
padding: 24,
|
|
1288
1694
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1289
1695
|
}
|
|
1290
|
-
},
|
|
1291
|
-
function
|
|
1696
|
+
}, an = 48;
|
|
1697
|
+
function on({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1292
1698
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1293
1699
|
if (a(() => {
|
|
1294
1700
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1304,7 +1710,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1304
1710
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1305
1711
|
if (!_) return;
|
|
1306
1712
|
let { dx: e } = _;
|
|
1307
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1713
|
+
v(null), e < -48 ? b(y + 1) : e > an && b(y - 1);
|
|
1308
1714
|
};
|
|
1309
1715
|
return /* @__PURE__ */ f("div", {
|
|
1310
1716
|
ref: c,
|
|
@@ -1353,7 +1759,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1353
1759
|
type: "button",
|
|
1354
1760
|
"aria-label": "Previous slide",
|
|
1355
1761
|
style: {
|
|
1356
|
-
...
|
|
1762
|
+
...nn,
|
|
1357
1763
|
left: 12
|
|
1358
1764
|
},
|
|
1359
1765
|
onClick: () => b(y - 1),
|
|
@@ -1363,7 +1769,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1363
1769
|
type: "button",
|
|
1364
1770
|
"aria-label": "Next slide",
|
|
1365
1771
|
style: {
|
|
1366
|
-
...
|
|
1772
|
+
...nn,
|
|
1367
1773
|
right: 12
|
|
1368
1774
|
},
|
|
1369
1775
|
onClick: () => b(y + 1),
|
|
@@ -1397,7 +1803,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1397
1803
|
] })]
|
|
1398
1804
|
});
|
|
1399
1805
|
}
|
|
1400
|
-
var
|
|
1806
|
+
var sn = (e, t) => ({
|
|
1401
1807
|
position: "absolute",
|
|
1402
1808
|
inset: 0,
|
|
1403
1809
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1405,18 +1811,18 @@ var yt = (e, t) => ({
|
|
|
1405
1811
|
backgroundSize: "cover",
|
|
1406
1812
|
backgroundPosition: "center"
|
|
1407
1813
|
});
|
|
1408
|
-
function
|
|
1409
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1814
|
+
function cn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1815
|
+
return e.length ? /* @__PURE__ */ d(on, {
|
|
1410
1816
|
...r,
|
|
1411
1817
|
count: e.length,
|
|
1412
1818
|
renderSlide: (r) => {
|
|
1413
1819
|
let i = e[r];
|
|
1414
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1820
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: sn(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1415
1821
|
style: {
|
|
1416
1822
|
position: "absolute",
|
|
1417
1823
|
color: "#fff",
|
|
1418
1824
|
textAlign: n,
|
|
1419
|
-
...
|
|
1825
|
+
...rn[t] ?? rn.bottom
|
|
1420
1826
|
},
|
|
1421
1827
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1422
1828
|
style: {
|
|
@@ -1436,13 +1842,13 @@ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1436
1842
|
}
|
|
1437
1843
|
}) : null;
|
|
1438
1844
|
}
|
|
1439
|
-
function
|
|
1440
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1845
|
+
function ln({ slides: e = [], linked: t, ...n }) {
|
|
1846
|
+
return e.length ? /* @__PURE__ */ d(on, {
|
|
1441
1847
|
...n,
|
|
1442
1848
|
count: e.length,
|
|
1443
1849
|
renderSlide: (n) => {
|
|
1444
1850
|
let r = e[n];
|
|
1445
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1851
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: sn(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1446
1852
|
style: {
|
|
1447
1853
|
position: "absolute",
|
|
1448
1854
|
inset: 0,
|
|
@@ -1454,23 +1860,23 @@ function xt({ slides: e = [], linked: t, ...n }) {
|
|
|
1454
1860
|
}
|
|
1455
1861
|
}) : null;
|
|
1456
1862
|
}
|
|
1457
|
-
var
|
|
1458
|
-
let r =
|
|
1863
|
+
var un = 256, dn = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), fn = (e, t, n) => {
|
|
1864
|
+
let r = un * 2 ** n;
|
|
1459
1865
|
return {
|
|
1460
1866
|
x: (Number(t) + 180) / 360 * r,
|
|
1461
|
-
y: (.5 -
|
|
1867
|
+
y: (.5 - dn(Number(e)) / (2 * Math.PI)) * r
|
|
1462
1868
|
};
|
|
1463
1869
|
}, $ = (e, t) => {
|
|
1464
1870
|
if (e === "" || e == null) return null;
|
|
1465
1871
|
let n = Number(e);
|
|
1466
1872
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1467
|
-
},
|
|
1468
|
-
function
|
|
1873
|
+
}, pn = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1874
|
+
function mn(e, t, n = "directions", r = "") {
|
|
1469
1875
|
let i = `${e},${t}`;
|
|
1470
1876
|
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)}`;
|
|
1471
1877
|
}
|
|
1472
|
-
var
|
|
1473
|
-
function
|
|
1878
|
+
var hn = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1879
|
+
function gn({ 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 }) {
|
|
1474
1880
|
let _ = c(null), [v, y] = l(1200);
|
|
1475
1881
|
a(() => {
|
|
1476
1882
|
let e = _.current;
|
|
@@ -1480,7 +1886,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1480
1886
|
let n = new ResizeObserver(t);
|
|
1481
1887
|
return n.observe(e), () => n.disconnect();
|
|
1482
1888
|
}, []);
|
|
1483
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1889
|
+
let b = (Array.isArray(e) ? e : []).filter(pn), x = pn({
|
|
1484
1890
|
lat: t,
|
|
1485
1891
|
lng: n
|
|
1486
1892
|
}) ? {
|
|
@@ -1492,7 +1898,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1492
1898
|
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1493
1899
|
if (b.length < 2) return 13;
|
|
1494
1900
|
for (let e = 19; e >= 1; e--) {
|
|
1495
|
-
let t = b.map((t) =>
|
|
1901
|
+
let t = b.map((t) => fn($(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));
|
|
1496
1902
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1497
1903
|
}
|
|
1498
1904
|
return 1;
|
|
@@ -1516,12 +1922,12 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1516
1922
|
},
|
|
1517
1923
|
children: "Set the coordinates in Settings"
|
|
1518
1924
|
});
|
|
1519
|
-
let T =
|
|
1925
|
+
let T = fn(x.lat, x.lng, C), E = {
|
|
1520
1926
|
x: T.x - v / 2,
|
|
1521
1927
|
y: T.y - S / 2
|
|
1522
1928
|
}, D = [], O = [];
|
|
1523
|
-
for (let e = Math.floor(E.x /
|
|
1524
|
-
for (let e = Math.floor(E.y /
|
|
1929
|
+
for (let e = Math.floor(E.x / un); e <= Math.floor((E.x + v) / un); e++) D.push(e);
|
|
1930
|
+
for (let e = Math.floor(E.y / un); e <= Math.floor((E.y + S) / un); e++) O.push(e);
|
|
1525
1931
|
let k = 2 ** C;
|
|
1526
1932
|
return /* @__PURE__ */ f("div", {
|
|
1527
1933
|
ref: (e) => {
|
|
@@ -1544,22 +1950,22 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1544
1950
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1545
1951
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1546
1952
|
alt: "",
|
|
1547
|
-
width:
|
|
1548
|
-
height:
|
|
1953
|
+
width: un,
|
|
1954
|
+
height: un,
|
|
1549
1955
|
loading: "lazy",
|
|
1550
1956
|
style: {
|
|
1551
1957
|
position: "absolute",
|
|
1552
|
-
left: Math.round(t *
|
|
1553
|
-
top: Math.round(e *
|
|
1554
|
-
width:
|
|
1555
|
-
height:
|
|
1958
|
+
left: Math.round(t * un - E.x),
|
|
1959
|
+
top: Math.round(e * un - E.y),
|
|
1960
|
+
width: un,
|
|
1961
|
+
height: un,
|
|
1556
1962
|
userSelect: "none",
|
|
1557
1963
|
pointerEvents: "none"
|
|
1558
1964
|
}
|
|
1559
1965
|
}, `${t}-${e}`);
|
|
1560
1966
|
})),
|
|
1561
1967
|
b.map((e, t) => {
|
|
1562
|
-
let n =
|
|
1968
|
+
let n = fn($(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 : mn($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1563
1969
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1564
1970
|
href: c || void 0,
|
|
1565
1971
|
target: c ? "_blank" : void 0,
|
|
@@ -1598,8 +2004,8 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1598
2004
|
viewBox: "0 0 24 24",
|
|
1599
2005
|
fill: a,
|
|
1600
2006
|
style: { display: "block" },
|
|
1601
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1602
|
-
d:
|
|
2007
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), _n[e.icon] ? /* @__PURE__ */ d("path", {
|
|
2008
|
+
d: _n[e.icon],
|
|
1603
2009
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1604
2010
|
fill: "none",
|
|
1605
2011
|
stroke: "#fff",
|
|
@@ -1635,7 +2041,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1635
2041
|
})
|
|
1636
2042
|
]
|
|
1637
2043
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1638
|
-
href:
|
|
2044
|
+
href: hn(x.lat, x.lng, C),
|
|
1639
2045
|
target: "_blank",
|
|
1640
2046
|
rel: "noopener noreferrer",
|
|
1641
2047
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1649,7 +2055,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1649
2055
|
}) : null]
|
|
1650
2056
|
});
|
|
1651
2057
|
}
|
|
1652
|
-
var
|
|
2058
|
+
var _n = {
|
|
1653
2059
|
check: "M4 12l5 5L20 6",
|
|
1654
2060
|
close: "M6 6l12 12M18 6L6 18",
|
|
1655
2061
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1746,8 +2152,8 @@ var kt = {
|
|
|
1746
2152
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1747
2153
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1748
2154
|
};
|
|
1749
|
-
function
|
|
1750
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2155
|
+
function vn({ 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 }) {
|
|
2156
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [_n[e] ?? _n.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1751
2157
|
viewBox: "0 0 24 24",
|
|
1752
2158
|
width: g,
|
|
1753
2159
|
height: g,
|
|
@@ -1783,10 +2189,10 @@ function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1783
2189
|
children: v
|
|
1784
2190
|
});
|
|
1785
2191
|
}
|
|
1786
|
-
function
|
|
1787
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
2192
|
+
function yn(e, t = {}, n = 0) {
|
|
2193
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ot(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1788
2194
|
for (let e of r) {
|
|
1789
|
-
let n = e.data ?? e, r =
|
|
2195
|
+
let n = e.data ?? e, r = it(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(it(n, t.nameField)) : i(n.name), l = t.hrefField ? i(it(n, t.hrefField)) : "";
|
|
1790
2196
|
for (let e of s) if (o.push({
|
|
1791
2197
|
src: e,
|
|
1792
2198
|
name: c,
|
|
@@ -1796,8 +2202,8 @@ function jt(e, t = {}, n = 0) {
|
|
|
1796
2202
|
}
|
|
1797
2203
|
return o;
|
|
1798
2204
|
}
|
|
1799
|
-
function
|
|
1800
|
-
let { tenant: x, apiUrl: S } = i(
|
|
2205
|
+
function bn({ 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 }) {
|
|
2206
|
+
let { tenant: x, apiUrl: S } = i(Q), C = i(Qe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1801
2207
|
a(() => {
|
|
1802
2208
|
if (!t || C) return;
|
|
1803
2209
|
let e = !0;
|
|
@@ -1814,7 +2220,7 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1814
2220
|
C
|
|
1815
2221
|
]);
|
|
1816
2222
|
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 ? (() => {
|
|
1817
|
-
let e =
|
|
2223
|
+
let e = yn(k, {
|
|
1818
2224
|
imageField: r,
|
|
1819
2225
|
nameField: o,
|
|
1820
2226
|
hrefField: s
|
|
@@ -2019,20 +2425,20 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
2019
2425
|
]
|
|
2020
2426
|
});
|
|
2021
2427
|
}
|
|
2022
|
-
var
|
|
2428
|
+
var xn = {
|
|
2023
2429
|
color: "inherit",
|
|
2024
2430
|
textDecoration: "none",
|
|
2025
2431
|
fontSize: 14,
|
|
2026
2432
|
opacity: .85
|
|
2027
|
-
},
|
|
2433
|
+
}, Sn = {
|
|
2028
2434
|
background: "var(--page-surface, #f2f2f2)",
|
|
2029
2435
|
color: "var(--page-text, #111827)",
|
|
2030
2436
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2031
2437
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2032
2438
|
zIndex: 60
|
|
2033
2439
|
};
|
|
2034
|
-
function
|
|
2035
|
-
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 ? "" :
|
|
2440
|
+
function Cn(e, t = {}, n = "dropdown") {
|
|
2441
|
+
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 ? "" : ot(e), o = r.map((e) => {
|
|
2036
2442
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2037
2443
|
return {
|
|
2038
2444
|
key: e.id,
|
|
@@ -2073,8 +2479,8 @@ function Ft(e, t = {}, n = "dropdown") {
|
|
|
2073
2479
|
type: e.children.length ? n : "link"
|
|
2074
2480
|
}));
|
|
2075
2481
|
}
|
|
2076
|
-
function
|
|
2077
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
2482
|
+
function wn({ 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" }) {
|
|
2483
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Q), N = i(Qe)?.[g], [F, I] = l(null);
|
|
2078
2484
|
a(() => {
|
|
2079
2485
|
if (!g || N) return;
|
|
2080
2486
|
let e = !0;
|
|
@@ -2094,7 +2500,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2094
2500
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2095
2501
|
return e.observe(C), () => e.disconnect();
|
|
2096
2502
|
}, [C, h]);
|
|
2097
|
-
let L = g ?
|
|
2503
|
+
let L = g ? Cn(N ?? F ?? [], {
|
|
2098
2504
|
labelField: _,
|
|
2099
2505
|
hrefField: v,
|
|
2100
2506
|
imageField: y,
|
|
@@ -2123,7 +2529,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2123
2529
|
return /* @__PURE__ */ f("a", {
|
|
2124
2530
|
href: e.href || "#",
|
|
2125
2531
|
style: {
|
|
2126
|
-
...
|
|
2532
|
+
...xn,
|
|
2127
2533
|
display: n ? "block" : "flex",
|
|
2128
2534
|
alignItems: n ? void 0 : "center",
|
|
2129
2535
|
gap: n ? void 0 : 10,
|
|
@@ -2220,7 +2626,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2220
2626
|
let t = e.children ?? [];
|
|
2221
2627
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2222
2628
|
href: e.href || "#",
|
|
2223
|
-
style:
|
|
2629
|
+
style: xn,
|
|
2224
2630
|
children: e.label
|
|
2225
2631
|
}, e.key);
|
|
2226
2632
|
let n = e.type === "mega";
|
|
@@ -2234,7 +2640,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2234
2640
|
children: [/* @__PURE__ */ f("a", {
|
|
2235
2641
|
href: e.href || "#",
|
|
2236
2642
|
style: {
|
|
2237
|
-
...
|
|
2643
|
+
...xn,
|
|
2238
2644
|
cursor: "pointer"
|
|
2239
2645
|
},
|
|
2240
2646
|
children: [
|
|
@@ -2250,7 +2656,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2250
2656
|
]
|
|
2251
2657
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2252
2658
|
style: {
|
|
2253
|
-
...
|
|
2659
|
+
...Sn,
|
|
2254
2660
|
position: "absolute",
|
|
2255
2661
|
left: 0,
|
|
2256
2662
|
right: 0,
|
|
@@ -2266,7 +2672,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2266
2672
|
}, !0))
|
|
2267
2673
|
}) : /* @__PURE__ */ d("div", {
|
|
2268
2674
|
style: {
|
|
2269
|
-
...
|
|
2675
|
+
...Sn,
|
|
2270
2676
|
position: "absolute",
|
|
2271
2677
|
top: "100%",
|
|
2272
2678
|
left: 0,
|
|
@@ -2295,7 +2701,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2295
2701
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2296
2702
|
href: e.href || "#",
|
|
2297
2703
|
style: {
|
|
2298
|
-
...
|
|
2704
|
+
...xn,
|
|
2299
2705
|
padding: "10px 4px",
|
|
2300
2706
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2301
2707
|
opacity: 1
|
|
@@ -2306,7 +2712,7 @@ function It({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2306
2712
|
]
|
|
2307
2713
|
});
|
|
2308
2714
|
}
|
|
2309
|
-
function
|
|
2715
|
+
function Tn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2310
2716
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2311
2717
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2312
2718
|
ref: r,
|
|
@@ -2346,13 +2752,13 @@ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2346
2752
|
}, e.key))]
|
|
2347
2753
|
}) : null;
|
|
2348
2754
|
}
|
|
2349
|
-
function
|
|
2755
|
+
function En({ 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 }) {
|
|
2350
2756
|
let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2351
2757
|
if (!e.length) return null;
|
|
2352
2758
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2353
2759
|
let n = Number(e);
|
|
2354
2760
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2355
|
-
}, b =
|
|
2761
|
+
}, b = _n[r], x = (e) => _((t) => {
|
|
2356
2762
|
let r = new Set(n ? t : []);
|
|
2357
2763
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2358
2764
|
});
|
|
@@ -2427,15 +2833,15 @@ function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2427
2833
|
})
|
|
2428
2834
|
});
|
|
2429
2835
|
}
|
|
2430
|
-
var
|
|
2836
|
+
var Dn = {
|
|
2431
2837
|
display: "flex",
|
|
2432
2838
|
flexDirection: "column",
|
|
2433
2839
|
gap: "12px"
|
|
2434
|
-
},
|
|
2840
|
+
}, On = {
|
|
2435
2841
|
fontSize: "14px",
|
|
2436
2842
|
fontWeight: 500,
|
|
2437
2843
|
color: "var(--page-text, #111827)"
|
|
2438
|
-
},
|
|
2844
|
+
}, kn = {
|
|
2439
2845
|
padding: "10px 12px",
|
|
2440
2846
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2441
2847
|
borderRadius: "6px",
|
|
@@ -2445,18 +2851,18 @@ var zt = {
|
|
|
2445
2851
|
boxSizing: "border-box",
|
|
2446
2852
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2447
2853
|
color: "var(--page-text, #111827)"
|
|
2448
|
-
},
|
|
2854
|
+
}, An = {
|
|
2449
2855
|
display: "flex",
|
|
2450
2856
|
alignItems: "center",
|
|
2451
2857
|
gap: "8px",
|
|
2452
2858
|
fontSize: "14px",
|
|
2453
2859
|
color: "var(--page-text, #111827)"
|
|
2454
|
-
},
|
|
2860
|
+
}, jn = (e) => e ? {
|
|
2455
2861
|
readOnly: !0,
|
|
2456
2862
|
tabIndex: -1,
|
|
2457
2863
|
onMouseDown: (e) => e.preventDefault()
|
|
2458
2864
|
} : {};
|
|
2459
|
-
function
|
|
2865
|
+
function Mn(e, t) {
|
|
2460
2866
|
if (!e) return !0;
|
|
2461
2867
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2462
2868
|
switch (e.op) {
|
|
@@ -2470,11 +2876,11 @@ function Wt(e, t) {
|
|
|
2470
2876
|
default: return !1;
|
|
2471
2877
|
}
|
|
2472
2878
|
}
|
|
2473
|
-
var
|
|
2879
|
+
var Nn = {
|
|
2474
2880
|
display: "flex",
|
|
2475
2881
|
flexDirection: "column",
|
|
2476
2882
|
gap: 6
|
|
2477
|
-
},
|
|
2883
|
+
}, Pn = {
|
|
2478
2884
|
font: "inherit",
|
|
2479
2885
|
fontSize: 15,
|
|
2480
2886
|
padding: "10px 12px",
|
|
@@ -2485,17 +2891,17 @@ var Gt = {
|
|
|
2485
2891
|
width: "100%",
|
|
2486
2892
|
boxSizing: "border-box"
|
|
2487
2893
|
};
|
|
2488
|
-
function
|
|
2894
|
+
function Fn(e, t) {
|
|
2489
2895
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2490
2896
|
if (!e?.parentField) return n;
|
|
2491
2897
|
let r = t?.[e.parentField];
|
|
2492
2898
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2493
2899
|
}
|
|
2494
|
-
var
|
|
2495
|
-
function
|
|
2900
|
+
var In = "g-recaptcha-response", Ln = (e) => e?.type === "recaptcha" ? In : e?.name;
|
|
2901
|
+
function Rn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2496
2902
|
let a = /* @__PURE__ */ f("span", {
|
|
2497
2903
|
style: {
|
|
2498
|
-
...
|
|
2904
|
+
...On,
|
|
2499
2905
|
fontSize: 14
|
|
2500
2906
|
},
|
|
2501
2907
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2504,7 +2910,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2504
2910
|
required: e.required || void 0,
|
|
2505
2911
|
placeholder: e.placeholder || void 0,
|
|
2506
2912
|
disabled: r || void 0,
|
|
2507
|
-
style:
|
|
2913
|
+
style: Pn,
|
|
2508
2914
|
value: t ?? "",
|
|
2509
2915
|
onChange: (t) => n(e.name, t.target.value)
|
|
2510
2916
|
};
|
|
@@ -2533,12 +2939,12 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2533
2939
|
borderRadius: 8,
|
|
2534
2940
|
display: "block"
|
|
2535
2941
|
}
|
|
2536
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(
|
|
2942
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Un, {
|
|
2537
2943
|
theme: e.captchaTheme,
|
|
2538
2944
|
size: e.captchaSize,
|
|
2539
2945
|
inert: r,
|
|
2540
|
-
onChange: (e) => n(
|
|
2541
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2946
|
+
onChange: (e) => n(In, e)
|
|
2947
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Jt, {
|
|
2542
2948
|
url: e.src,
|
|
2543
2949
|
style: { width: "100%" }
|
|
2544
2950
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -2550,14 +2956,14 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2550
2956
|
display: "block"
|
|
2551
2957
|
}
|
|
2552
2958
|
}) : null : /* @__PURE__ */ f("label", {
|
|
2553
|
-
style:
|
|
2959
|
+
style: Nn,
|
|
2554
2960
|
children: [
|
|
2555
2961
|
a,
|
|
2556
2962
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
2557
2963
|
...o,
|
|
2558
2964
|
rows: 4,
|
|
2559
2965
|
style: {
|
|
2560
|
-
...
|
|
2966
|
+
...Pn,
|
|
2561
2967
|
resize: "vertical"
|
|
2562
2968
|
}
|
|
2563
2969
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -2566,7 +2972,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2566
2972
|
children: [/* @__PURE__ */ d("option", {
|
|
2567
2973
|
value: "",
|
|
2568
2974
|
children: e.placeholder || "—"
|
|
2569
|
-
}),
|
|
2975
|
+
}), Fn(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
2570
2976
|
value: typeof e == "string" ? e : e.value,
|
|
2571
2977
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2572
2978
|
}, t))]
|
|
@@ -2613,8 +3019,8 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2613
3019
|
]
|
|
2614
3020
|
});
|
|
2615
3021
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let { tenant: y, apiUrl: b } = i(
|
|
3022
|
+
function zn({ 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 }) {
|
|
3023
|
+
let { tenant: y, apiUrl: b } = i(Q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2618
3024
|
a(() => {
|
|
2619
3025
|
if (!c || !s) return;
|
|
2620
3026
|
let e = !0;
|
|
@@ -2635,11 +3041,11 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2635
3041
|
section: e,
|
|
2636
3042
|
fields: []
|
|
2637
3043
|
}) : A[A.length - 1].fields.push(e);
|
|
2638
|
-
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section ||
|
|
3044
|
+
let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Mn(e.section.condition, T)).map((e) => ({
|
|
2639
3045
|
...e,
|
|
2640
|
-
fields: e.fields.filter((e) =>
|
|
3046
|
+
fields: e.fields.filter((e) => Mn(e.condition, T))
|
|
2641
3047
|
})), 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) => {
|
|
2642
|
-
let t = T[
|
|
3048
|
+
let t = T[Ln(e)];
|
|
2643
3049
|
return e.required && (t == null || t === "" || t === !1);
|
|
2644
3050
|
}), R = F >= M.length - 1, z = (e, t) => E((n) => {
|
|
2645
3051
|
let r = {
|
|
@@ -2695,11 +3101,11 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2695
3101
|
}
|
|
2696
3102
|
},
|
|
2697
3103
|
style: {
|
|
2698
|
-
...
|
|
3104
|
+
...Dn,
|
|
2699
3105
|
display: k === "success" ? "none" : "flex"
|
|
2700
3106
|
},
|
|
2701
3107
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
2702
|
-
N && /* @__PURE__ */ d(
|
|
3108
|
+
N && /* @__PURE__ */ d(vr, {
|
|
2703
3109
|
steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2704
3110
|
active: F + 1,
|
|
2705
3111
|
style: { marginBottom: 8 }
|
|
@@ -2712,9 +3118,9 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2712
3118
|
},
|
|
2713
3119
|
children: M[F].section.help
|
|
2714
3120
|
}),
|
|
2715
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
3121
|
+
I.map((e) => /* @__PURE__ */ d(Rn, {
|
|
2716
3122
|
field: e,
|
|
2717
|
-
value: T[
|
|
3123
|
+
value: T[Ln(e)],
|
|
2718
3124
|
values: T,
|
|
2719
3125
|
onChange: z,
|
|
2720
3126
|
inert: h
|
|
@@ -2731,7 +3137,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2731
3137
|
disabled: h || void 0,
|
|
2732
3138
|
onClick: () => O(F - 1),
|
|
2733
3139
|
style: {
|
|
2734
|
-
...
|
|
3140
|
+
...ft,
|
|
2735
3141
|
background: "transparent",
|
|
2736
3142
|
color: "inherit",
|
|
2737
3143
|
border: 0,
|
|
@@ -2744,7 +3150,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2744
3150
|
disabled: h || L.length > 0,
|
|
2745
3151
|
onClick: () => O(F + 1),
|
|
2746
3152
|
style: {
|
|
2747
|
-
...
|
|
3153
|
+
...ft,
|
|
2748
3154
|
border: 0,
|
|
2749
3155
|
padding: "10px 22px",
|
|
2750
3156
|
borderRadius: 8,
|
|
@@ -2758,7 +3164,7 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2758
3164
|
type: "submit",
|
|
2759
3165
|
disabled: h || void 0,
|
|
2760
3166
|
style: {
|
|
2761
|
-
...
|
|
3167
|
+
...ft,
|
|
2762
3168
|
border: 0,
|
|
2763
3169
|
padding: "10px 22px",
|
|
2764
3170
|
borderRadius: 8,
|
|
@@ -2785,10 +3191,10 @@ function Zt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2785
3191
|
]
|
|
2786
3192
|
});
|
|
2787
3193
|
}
|
|
2788
|
-
var
|
|
3194
|
+
var Bn = null, Vn = null, Hn = (e) => {
|
|
2789
3195
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2790
|
-
if (
|
|
2791
|
-
if (
|
|
3196
|
+
if (Bn && Vn === t) return Bn;
|
|
3197
|
+
if (Bn && typeof window < "u") {
|
|
2792
3198
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2793
3199
|
delete window[e];
|
|
2794
3200
|
} catch {
|
|
@@ -2796,22 +3202,22 @@ var Qt = null, $t = null, en = (e) => {
|
|
|
2796
3202
|
}
|
|
2797
3203
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2798
3204
|
}
|
|
2799
|
-
return
|
|
3205
|
+
return Vn = t, Bn = new Promise((e) => {
|
|
2800
3206
|
if (typeof window > "u") return;
|
|
2801
3207
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2802
3208
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2803
3209
|
let n = document.createElement("script");
|
|
2804
3210
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2805
|
-
}),
|
|
3211
|
+
}), Bn;
|
|
2806
3212
|
};
|
|
2807
|
-
function
|
|
2808
|
-
let p = i(
|
|
3213
|
+
function Un({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
3214
|
+
let p = i(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2809
3215
|
if (_.current = u, a(() => {
|
|
2810
3216
|
if (l || !h || !g.current) return;
|
|
2811
3217
|
let e = !0, i = (t) => {
|
|
2812
3218
|
e && typeof _.current == "function" && _.current(t);
|
|
2813
3219
|
};
|
|
2814
|
-
return
|
|
3220
|
+
return Hn(r).then((r) => {
|
|
2815
3221
|
if (!(!e || !g.current || !r?.render)) {
|
|
2816
3222
|
g.current.innerHTML = "", i("");
|
|
2817
3223
|
try {
|
|
@@ -2893,17 +3299,17 @@ function tn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
|
|
|
2893
3299
|
children: /* @__PURE__ */ d("div", { ref: g })
|
|
2894
3300
|
}) : null;
|
|
2895
3301
|
}
|
|
2896
|
-
function
|
|
3302
|
+
function Wn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2897
3303
|
return /* @__PURE__ */ d("label", {
|
|
2898
3304
|
ref: r,
|
|
2899
3305
|
style: {
|
|
2900
|
-
...
|
|
3306
|
+
...On,
|
|
2901
3307
|
...P(n)
|
|
2902
3308
|
},
|
|
2903
|
-
children:
|
|
3309
|
+
children: Tt(t, e, i)
|
|
2904
3310
|
});
|
|
2905
3311
|
}
|
|
2906
|
-
function
|
|
3312
|
+
function Gn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2907
3313
|
return /* @__PURE__ */ d("input", {
|
|
2908
3314
|
ref: a,
|
|
2909
3315
|
type: e,
|
|
@@ -2911,13 +3317,13 @@ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2911
3317
|
placeholder: n,
|
|
2912
3318
|
required: !o && !!r,
|
|
2913
3319
|
style: {
|
|
2914
|
-
...
|
|
3320
|
+
...kn,
|
|
2915
3321
|
...P(i)
|
|
2916
3322
|
},
|
|
2917
|
-
...
|
|
3323
|
+
...jn(o)
|
|
2918
3324
|
});
|
|
2919
3325
|
}
|
|
2920
|
-
function
|
|
3326
|
+
function Kn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2921
3327
|
return /* @__PURE__ */ d("textarea", {
|
|
2922
3328
|
ref: a,
|
|
2923
3329
|
name: e || void 0,
|
|
@@ -2925,18 +3331,18 @@ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2925
3331
|
rows: n,
|
|
2926
3332
|
required: !o && !!r,
|
|
2927
3333
|
style: {
|
|
2928
|
-
...
|
|
3334
|
+
...kn,
|
|
2929
3335
|
resize: "vertical",
|
|
2930
3336
|
...P(i)
|
|
2931
3337
|
},
|
|
2932
|
-
...
|
|
3338
|
+
...jn(o)
|
|
2933
3339
|
});
|
|
2934
3340
|
}
|
|
2935
|
-
function
|
|
3341
|
+
function qn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2936
3342
|
return /* @__PURE__ */ f("label", {
|
|
2937
3343
|
ref: o,
|
|
2938
3344
|
style: {
|
|
2939
|
-
...
|
|
3345
|
+
...An,
|
|
2940
3346
|
...P(a)
|
|
2941
3347
|
},
|
|
2942
3348
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2953,7 +3359,7 @@ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2953
3359
|
}), t]
|
|
2954
3360
|
});
|
|
2955
3361
|
}
|
|
2956
|
-
function
|
|
3362
|
+
function Jn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2957
3363
|
return /* @__PURE__ */ f("select", {
|
|
2958
3364
|
ref: a,
|
|
2959
3365
|
name: e || void 0,
|
|
@@ -2962,7 +3368,7 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2962
3368
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2963
3369
|
tabIndex: o ? -1 : void 0,
|
|
2964
3370
|
style: {
|
|
2965
|
-
...
|
|
3371
|
+
...kn,
|
|
2966
3372
|
appearance: "auto",
|
|
2967
3373
|
...P(i)
|
|
2968
3374
|
},
|
|
@@ -2976,12 +3382,12 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2976
3382
|
}, t))]
|
|
2977
3383
|
});
|
|
2978
3384
|
}
|
|
2979
|
-
function
|
|
3385
|
+
function Yn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2980
3386
|
let [s, c] = l(null);
|
|
2981
3387
|
return /* @__PURE__ */ f("label", {
|
|
2982
3388
|
ref: a,
|
|
2983
3389
|
style: {
|
|
2984
|
-
...
|
|
3390
|
+
...kn,
|
|
2985
3391
|
display: "flex",
|
|
2986
3392
|
alignItems: "center",
|
|
2987
3393
|
gap: "8px",
|
|
@@ -3008,12 +3414,12 @@ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3008
3414
|
]
|
|
3009
3415
|
});
|
|
3010
3416
|
}
|
|
3011
|
-
function
|
|
3417
|
+
function Xn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3012
3418
|
return /* @__PURE__ */ d("button", {
|
|
3013
3419
|
ref: n,
|
|
3014
3420
|
type: r ? "button" : "submit",
|
|
3015
3421
|
style: {
|
|
3016
|
-
...
|
|
3422
|
+
...ft,
|
|
3017
3423
|
border: 0,
|
|
3018
3424
|
cursor: "pointer",
|
|
3019
3425
|
alignSelf: "flex-start",
|
|
@@ -3028,7 +3434,7 @@ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3028
3434
|
children: e
|
|
3029
3435
|
});
|
|
3030
3436
|
}
|
|
3031
|
-
function
|
|
3437
|
+
function Zn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3032
3438
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3033
3439
|
return /* @__PURE__ */ d("div", {
|
|
3034
3440
|
ref: r,
|
|
@@ -3045,8 +3451,8 @@ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3045
3451
|
}, t))
|
|
3046
3452
|
});
|
|
3047
3453
|
}
|
|
3048
|
-
function
|
|
3049
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
3454
|
+
function Qn({ 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: _ }) {
|
|
3455
|
+
let { tenant: v, apiUrl: y, locale: b } = i(Q), x = i(nt), S = i(Qe), [, C] = l(0);
|
|
3050
3456
|
a(() => {
|
|
3051
3457
|
if (typeof window > "u") return;
|
|
3052
3458
|
let e = () => C((e) => e + 1);
|
|
@@ -3054,7 +3460,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3054
3460
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3055
3461
|
};
|
|
3056
3462
|
}, []);
|
|
3057
|
-
let w =
|
|
3463
|
+
let w = tt(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? $e(S) : 1, [k, A] = l(null);
|
|
3058
3464
|
if (a(() => {
|
|
3059
3465
|
if (!e || D) return;
|
|
3060
3466
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3099,7 +3505,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3099
3505
|
},
|
|
3100
3506
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
3101
3507
|
style: { minWidth: 0 },
|
|
3102
|
-
children: x.render(p, (t) =>
|
|
3508
|
+
children: x.render(p, (t) => st(t, e))
|
|
3103
3509
|
}, e.id ?? e?.data?.slug))
|
|
3104
3510
|
}) : /* @__PURE__ */ d("div", {
|
|
3105
3511
|
ref: _,
|
|
@@ -3109,7 +3515,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3109
3515
|
...P(g)
|
|
3110
3516
|
},
|
|
3111
3517
|
children: M.map((e) => {
|
|
3112
|
-
let t = o ?
|
|
3518
|
+
let t = o ? it(e?.data, o) : null, r = s ? ot(it(e?.data, s)) : null, i = c ? it(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : ot(i), u = n === "list";
|
|
3113
3519
|
return /* @__PURE__ */ f("div", {
|
|
3114
3520
|
style: {
|
|
3115
3521
|
display: "flex",
|
|
@@ -3156,7 +3562,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3156
3562
|
lineHeight: 1.55,
|
|
3157
3563
|
opacity: .85
|
|
3158
3564
|
},
|
|
3159
|
-
children:
|
|
3565
|
+
children: Pt(a)
|
|
3160
3566
|
})
|
|
3161
3567
|
]
|
|
3162
3568
|
})]
|
|
@@ -3164,8 +3570,8 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3164
3570
|
})
|
|
3165
3571
|
});
|
|
3166
3572
|
}
|
|
3167
|
-
function
|
|
3168
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3573
|
+
function $n({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3574
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : et(), s = {
|
|
3169
3575
|
height: 34,
|
|
3170
3576
|
padding: "0 12px",
|
|
3171
3577
|
borderRadius: 8,
|
|
@@ -3213,7 +3619,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3213
3619
|
name: `f_${e.name}`,
|
|
3214
3620
|
defaultValue: o[e.name] ?? "",
|
|
3215
3621
|
style: s,
|
|
3216
|
-
...
|
|
3622
|
+
...jn(i),
|
|
3217
3623
|
children: [/* @__PURE__ */ d("option", {
|
|
3218
3624
|
value: "",
|
|
3219
3625
|
children: e.label || e.name
|
|
@@ -3228,7 +3634,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3228
3634
|
name: `f_${e.name}`,
|
|
3229
3635
|
defaultValue: o[e.name] ?? "",
|
|
3230
3636
|
style: s,
|
|
3231
|
-
...
|
|
3637
|
+
...jn(i),
|
|
3232
3638
|
children: [
|
|
3233
3639
|
/* @__PURE__ */ d("option", {
|
|
3234
3640
|
value: "",
|
|
@@ -3249,7 +3655,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3249
3655
|
defaultValue: o[e.name] ?? "",
|
|
3250
3656
|
placeholder: e.label || e.name,
|
|
3251
3657
|
style: s,
|
|
3252
|
-
...
|
|
3658
|
+
...jn(i)
|
|
3253
3659
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3254
3660
|
type: "submit",
|
|
3255
3661
|
style: {
|
|
@@ -3262,12 +3668,12 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3262
3668
|
fontWeight: 600,
|
|
3263
3669
|
cursor: i ? "default" : "pointer"
|
|
3264
3670
|
},
|
|
3265
|
-
...
|
|
3671
|
+
...jn(i),
|
|
3266
3672
|
children: t
|
|
3267
3673
|
})]
|
|
3268
3674
|
});
|
|
3269
3675
|
}
|
|
3270
|
-
function
|
|
3676
|
+
function er({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3271
3677
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
3272
3678
|
ref: r,
|
|
3273
3679
|
"aria-label": "Breadcrumb",
|
|
@@ -3317,8 +3723,8 @@ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3317
3723
|
})
|
|
3318
3724
|
}) : null;
|
|
3319
3725
|
}
|
|
3320
|
-
function
|
|
3321
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3726
|
+
function tr({ 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 }) {
|
|
3727
|
+
let { tenant: g, apiUrl: _ } = i(Q), v = i(Qe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3322
3728
|
a(() => {
|
|
3323
3729
|
if (!o || Number.isFinite(x)) return;
|
|
3324
3730
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3337,7 +3743,7 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3337
3743
|
]);
|
|
3338
3744
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3339
3745
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
3340
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3746
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? $e(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3341
3747
|
if (o) {
|
|
3342
3748
|
if (typeof window < "u") {
|
|
3343
3749
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3402,15 +3808,15 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3402
3808
|
]
|
|
3403
3809
|
});
|
|
3404
3810
|
}
|
|
3405
|
-
var
|
|
3811
|
+
var nr = "webim.page_mode", rr = () => {
|
|
3406
3812
|
if (typeof window > "u") return "auto";
|
|
3407
3813
|
try {
|
|
3408
|
-
let e = window.localStorage.getItem(
|
|
3814
|
+
let e = window.localStorage.getItem(nr);
|
|
3409
3815
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3410
3816
|
} catch {
|
|
3411
3817
|
return "auto";
|
|
3412
3818
|
}
|
|
3413
|
-
},
|
|
3819
|
+
}, ir = (e) => {
|
|
3414
3820
|
let t = {
|
|
3415
3821
|
width: 16,
|
|
3416
3822
|
height: 16,
|
|
@@ -3442,13 +3848,13 @@ var hn = "webim.page_mode", gn = () => {
|
|
|
3442
3848
|
rx: "2"
|
|
3443
3849
|
}), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
|
|
3444
3850
|
});
|
|
3445
|
-
},
|
|
3851
|
+
}, ar = {
|
|
3446
3852
|
light: "Light theme",
|
|
3447
3853
|
dark: "Dark theme",
|
|
3448
3854
|
auto: "Follow the device theme"
|
|
3449
3855
|
};
|
|
3450
|
-
function
|
|
3451
|
-
let [o, s] = l(i ? "auto" :
|
|
3856
|
+
function or({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
3857
|
+
let [o, s] = l(i ? "auto" : rr), u = c(null), f = (e) => {
|
|
3452
3858
|
u.current = e, typeof r == "function" && r(e);
|
|
3453
3859
|
};
|
|
3454
3860
|
a(() => {
|
|
@@ -3456,7 +3862,7 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3456
3862
|
let e = u.current?.closest?.(".webim-page");
|
|
3457
3863
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3458
3864
|
try {
|
|
3459
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3865
|
+
o === "auto" ? window.localStorage.removeItem(nr) : window.localStorage.setItem(nr, o);
|
|
3460
3866
|
} catch {}
|
|
3461
3867
|
}, [o, i]);
|
|
3462
3868
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3491,8 +3897,8 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3491
3897
|
},
|
|
3492
3898
|
children: p.map((e) => /* @__PURE__ */ d("button", {
|
|
3493
3899
|
type: "button",
|
|
3494
|
-
title:
|
|
3495
|
-
"aria-label":
|
|
3900
|
+
title: ar[e],
|
|
3901
|
+
"aria-label": ar[e],
|
|
3496
3902
|
"aria-pressed": e === m,
|
|
3497
3903
|
onClick: i ? void 0 : () => s(e),
|
|
3498
3904
|
style: {
|
|
@@ -3503,15 +3909,15 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3503
3909
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3504
3910
|
opacity: e === m ? 1 : .7
|
|
3505
3911
|
},
|
|
3506
|
-
children:
|
|
3912
|
+
children: ir(e)
|
|
3507
3913
|
}, e))
|
|
3508
3914
|
});
|
|
3509
3915
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3510
3916
|
return /* @__PURE__ */ d("button", {
|
|
3511
3917
|
ref: f,
|
|
3512
3918
|
type: "button",
|
|
3513
|
-
title:
|
|
3514
|
-
"aria-label": `Theme: ${
|
|
3919
|
+
title: ar[m],
|
|
3920
|
+
"aria-label": `Theme: ${ar[m]} — switch to ${ar[g]}`,
|
|
3515
3921
|
onClick: i ? void 0 : () => s(g),
|
|
3516
3922
|
style: {
|
|
3517
3923
|
...h,
|
|
@@ -3520,10 +3926,10 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
|
|
|
3520
3926
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3521
3927
|
...P(n)
|
|
3522
3928
|
},
|
|
3523
|
-
children:
|
|
3929
|
+
children: ir(m)
|
|
3524
3930
|
});
|
|
3525
3931
|
}
|
|
3526
|
-
function
|
|
3932
|
+
function sr(e) {
|
|
3527
3933
|
let t = e?.parentElement;
|
|
3528
3934
|
for (; t && t !== document.body;) {
|
|
3529
3935
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3532,7 +3938,7 @@ function bn(e) {
|
|
|
3532
3938
|
}
|
|
3533
3939
|
return window;
|
|
3534
3940
|
}
|
|
3535
|
-
var
|
|
3941
|
+
var cr = (e) => e === window ? window.scrollY : e.scrollTop, lr = {
|
|
3536
3942
|
"bottom-right": (e) => ({
|
|
3537
3943
|
right: e,
|
|
3538
3944
|
bottom: e
|
|
@@ -3546,11 +3952,11 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
|
3546
3952
|
bottom: e,
|
|
3547
3953
|
transform: "translateX(-50%)"
|
|
3548
3954
|
})
|
|
3549
|
-
},
|
|
3955
|
+
}, ur = {
|
|
3550
3956
|
linear: (e) => e,
|
|
3551
3957
|
out: (e) => 1 - (1 - e) ** 3,
|
|
3552
3958
|
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3553
|
-
},
|
|
3959
|
+
}, dr = (e) => {
|
|
3554
3960
|
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3555
3961
|
for (; n && n !== document.body;) {
|
|
3556
3962
|
let e = getComputedStyle(n);
|
|
@@ -3558,12 +3964,12 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
|
3558
3964
|
n = n.parentElement;
|
|
3559
3965
|
}
|
|
3560
3966
|
return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
|
|
3561
|
-
},
|
|
3967
|
+
}, fr = (e, t) => {
|
|
3562
3968
|
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3563
3969
|
return Number.isFinite(n) ? n : t;
|
|
3564
3970
|
};
|
|
3565
|
-
function
|
|
3566
|
-
let i = Math.min(Math.max(Math.round(
|
|
3971
|
+
function pr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3972
|
+
let i = Math.min(Math.max(Math.round(fr(n, 0)), 0), 6);
|
|
3567
3973
|
try {
|
|
3568
3974
|
return new Intl.NumberFormat(t || void 0, {
|
|
3569
3975
|
minimumFractionDigits: i,
|
|
@@ -3574,8 +3980,8 @@ function En(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
|
3574
3980
|
return e.toFixed(i);
|
|
3575
3981
|
}
|
|
3576
3982
|
}
|
|
3577
|
-
function
|
|
3578
|
-
let { locale: C } = i(
|
|
3983
|
+
function mr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suffix: u, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3984
|
+
let { locale: C } = i(Q), w = Math.max(fr(g, 0), 0), T = fr(e, 0), E = fr(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
|
|
3579
3985
|
return a(() => {
|
|
3580
3986
|
let e = k.current;
|
|
3581
3987
|
if (S || !A || !e) {
|
|
@@ -3583,7 +3989,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3583
3989
|
return;
|
|
3584
3990
|
}
|
|
3585
3991
|
O(T);
|
|
3586
|
-
let t = Math.max(
|
|
3992
|
+
let t = Math.max(fr(n, 2e3), 0), i = Math.max(fr(r, 0), 0), a = ur[m] || ur.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3587
3993
|
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3588
3994
|
O(E);
|
|
3589
3995
|
return;
|
|
@@ -3603,7 +4009,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3603
4009
|
let t = e.some((e) => e.isIntersecting);
|
|
3604
4010
|
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3605
4011
|
}, {
|
|
3606
|
-
rootMargin: `0px 0px -${Math.min(w, Math.floor(
|
|
4012
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(dr(e)))}px 0px`,
|
|
3607
4013
|
threshold: w > 0 ? 0 : .3
|
|
3608
4014
|
});
|
|
3609
4015
|
return d.observe(e), () => {
|
|
@@ -3643,7 +4049,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3643
4049
|
},
|
|
3644
4050
|
children: [
|
|
3645
4051
|
s || "",
|
|
3646
|
-
|
|
4052
|
+
pr(D, {
|
|
3647
4053
|
locale: C,
|
|
3648
4054
|
decimals: o,
|
|
3649
4055
|
separator: p
|
|
@@ -3661,7 +4067,7 @@ function Dn({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
|
|
|
3661
4067
|
}) : null]
|
|
3662
4068
|
});
|
|
3663
4069
|
}
|
|
3664
|
-
function
|
|
4070
|
+
function hr({ 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 }) {
|
|
3665
4071
|
let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
|
|
3666
4072
|
b(e), typeof p == "function" && p(e);
|
|
3667
4073
|
};
|
|
@@ -3672,8 +4078,8 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3672
4078
|
}
|
|
3673
4079
|
if (!y) return;
|
|
3674
4080
|
let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
|
|
3675
|
-
let t =
|
|
3676
|
-
v(n ||
|
|
4081
|
+
let t = sr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4082
|
+
v(n || cr(t) > e);
|
|
3677
4083
|
};
|
|
3678
4084
|
return t(), document.addEventListener("scroll", t, {
|
|
3679
4085
|
capture: !0,
|
|
@@ -3687,7 +4093,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3687
4093
|
]);
|
|
3688
4094
|
let S = () => {
|
|
3689
4095
|
if (m) return;
|
|
3690
|
-
let e =
|
|
4096
|
+
let e = sr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3691
4097
|
e === window ? window.scrollTo({
|
|
3692
4098
|
top: 0,
|
|
3693
4099
|
behavior: n
|
|
@@ -3695,7 +4101,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3695
4101
|
top: 0,
|
|
3696
4102
|
behavior: n
|
|
3697
4103
|
});
|
|
3698
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4104
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = lr[n] ? n : "bottom-right", D = h ? {
|
|
3699
4105
|
position: "fixed",
|
|
3700
4106
|
zIndex: 5,
|
|
3701
4107
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3708,7 +4114,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3708
4114
|
} : {
|
|
3709
4115
|
position: "fixed",
|
|
3710
4116
|
zIndex: 2147482e3,
|
|
3711
|
-
...
|
|
4117
|
+
...lr[E](C)
|
|
3712
4118
|
};
|
|
3713
4119
|
return /* @__PURE__ */ f("button", {
|
|
3714
4120
|
ref: x,
|
|
@@ -3759,7 +4165,7 @@ function On({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
3759
4165
|
}), w ? /* @__PURE__ */ d("span", { children: T }) : null]
|
|
3760
4166
|
});
|
|
3761
4167
|
}
|
|
3762
|
-
var
|
|
4168
|
+
var gr = {
|
|
3763
4169
|
facebook: {
|
|
3764
4170
|
label: "Facebook",
|
|
3765
4171
|
color: "#1877f2",
|
|
@@ -3826,8 +4232,8 @@ var kn = {
|
|
|
3826
4232
|
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"
|
|
3827
4233
|
}
|
|
3828
4234
|
};
|
|
3829
|
-
function
|
|
3830
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4235
|
+
function _r({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4236
|
+
let l = Array.isArray(e) ? e.filter((e) => e && gr[e.network]) : [];
|
|
3831
4237
|
if (!l.length) return null;
|
|
3832
4238
|
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;
|
|
3833
4239
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3840,7 +4246,7 @@ function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3840
4246
|
...P(o)
|
|
3841
4247
|
},
|
|
3842
4248
|
children: l.map((e, r) => {
|
|
3843
|
-
let i =
|
|
4249
|
+
let i = gr[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);
|
|
3844
4250
|
return /* @__PURE__ */ d("a", {
|
|
3845
4251
|
href: e.url || "#",
|
|
3846
4252
|
onClick: h,
|
|
@@ -3874,7 +4280,7 @@ function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3874
4280
|
})
|
|
3875
4281
|
});
|
|
3876
4282
|
}
|
|
3877
|
-
function
|
|
4283
|
+
function vr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3878
4284
|
if (!e.length) return null;
|
|
3879
4285
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
3880
4286
|
width: 32,
|
|
@@ -3952,7 +4358,7 @@ function jn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3952
4358
|
})
|
|
3953
4359
|
});
|
|
3954
4360
|
}
|
|
3955
|
-
var
|
|
4361
|
+
var yr = {
|
|
3956
4362
|
small: {
|
|
3957
4363
|
w: 132,
|
|
3958
4364
|
h: 46,
|
|
@@ -3974,21 +4380,21 @@ var Mn = {
|
|
|
3974
4380
|
title: 12.5,
|
|
3975
4381
|
avatar: 46
|
|
3976
4382
|
}
|
|
3977
|
-
},
|
|
3978
|
-
|
|
3979
|
-
var
|
|
4383
|
+
}, br = (e) => yr[e] ?? yr.medium;
|
|
4384
|
+
yr.medium.w, yr.medium.h;
|
|
4385
|
+
var xr = (e) => String(e?.group ?? "").trim(), Sr = (e) => {
|
|
3980
4386
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3981
4387
|
return e.forEach((e, r) => {
|
|
3982
|
-
let i =
|
|
4388
|
+
let i = xr(e) || `#${r}`;
|
|
3983
4389
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3984
4390
|
}), t.flatMap((e) => n.get(e));
|
|
3985
4391
|
};
|
|
3986
|
-
function
|
|
3987
|
-
let i =
|
|
4392
|
+
function Cr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4393
|
+
let i = br(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 = [];
|
|
3988
4394
|
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);
|
|
3989
|
-
d =
|
|
3990
|
-
for (let [e, t] of u) u.set(e,
|
|
3991
|
-
let f = (e, t) => o + (
|
|
4395
|
+
d = Sr(d);
|
|
4396
|
+
for (let [e, t] of u) u.set(e, Sr(t));
|
|
4397
|
+
let f = (e, t) => o + (xr(e) !== xr(t) && (xr(e) || xr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3992
4398
|
if (t.has(e.id)) return 0;
|
|
3993
4399
|
t.add(e.id);
|
|
3994
4400
|
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);
|
|
@@ -4004,7 +4410,7 @@ function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4004
4410
|
x: m,
|
|
4005
4411
|
y: b
|
|
4006
4412
|
});
|
|
4007
|
-
let x =
|
|
4413
|
+
let x = xr(e);
|
|
4008
4414
|
if (x) {
|
|
4009
4415
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
4010
4416
|
_.has(t) || _.set(t, {
|
|
@@ -4078,19 +4484,19 @@ function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4078
4484
|
horizontal: n
|
|
4079
4485
|
};
|
|
4080
4486
|
}
|
|
4081
|
-
var
|
|
4487
|
+
var wr = (e, t) => {
|
|
4082
4488
|
let n = String(e ?? "");
|
|
4083
4489
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
4084
|
-
},
|
|
4490
|
+
}, Tr = (e) => {
|
|
4085
4491
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
4086
4492
|
if (!t) return "#ffffff";
|
|
4087
4493
|
let n = t[1];
|
|
4088
4494
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
4089
4495
|
let r = parseInt(n, 16);
|
|
4090
4496
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4091
|
-
},
|
|
4092
|
-
function
|
|
4093
|
-
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 ? "" :
|
|
4497
|
+
}, Er = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4498
|
+
function Dr(e, t = {}) {
|
|
4499
|
+
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 ? "" : ot(e);
|
|
4094
4500
|
return n.map((e) => {
|
|
4095
4501
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4096
4502
|
return {
|
|
@@ -4105,11 +4511,11 @@ function Bn(e, t = {}) {
|
|
|
4105
4511
|
};
|
|
4106
4512
|
});
|
|
4107
4513
|
}
|
|
4108
|
-
var
|
|
4514
|
+
var Or = {
|
|
4109
4515
|
size: 36,
|
|
4110
4516
|
pad: 10
|
|
4111
4517
|
};
|
|
4112
|
-
function
|
|
4518
|
+
function kr({ node: e, onClose: t }) {
|
|
4113
4519
|
return a(() => {
|
|
4114
4520
|
let e = (e) => e.key === "Escape" && t();
|
|
4115
4521
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4230,8 +4636,8 @@ function Hn({ node: e, onClose: t }) {
|
|
|
4230
4636
|
})
|
|
4231
4637
|
});
|
|
4232
4638
|
}
|
|
4233
|
-
function
|
|
4234
|
-
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(
|
|
4639
|
+
function Ar({ 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 }) {
|
|
4640
|
+
let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null);
|
|
4235
4641
|
a(() => {
|
|
4236
4642
|
if (!t || O) return;
|
|
4237
4643
|
let e = !0;
|
|
@@ -4247,7 +4653,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4247
4653
|
D,
|
|
4248
4654
|
O
|
|
4249
4655
|
]);
|
|
4250
|
-
let j = t ?
|
|
4656
|
+
let j = t ? Dr(O ?? k ?? [], {
|
|
4251
4657
|
nameField: n,
|
|
4252
4658
|
titleField: r,
|
|
4253
4659
|
photoField: s,
|
|
@@ -4255,7 +4661,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4255
4661
|
cvField: p,
|
|
4256
4662
|
hrefField: m,
|
|
4257
4663
|
groupField: h
|
|
4258
|
-
}) : e, M =
|
|
4664
|
+
}) : e, M = br(v), { boxes: N, links: F, groups: I, width: L, height: R } = Cr(j, {
|
|
4259
4665
|
size: v,
|
|
4260
4666
|
horizontal: y,
|
|
4261
4667
|
groupTitles: g
|
|
@@ -4313,8 +4719,8 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4313
4719
|
fontSize: M.title + 1,
|
|
4314
4720
|
fontWeight: "600",
|
|
4315
4721
|
opacity: "0.55",
|
|
4316
|
-
fill: r ?
|
|
4317
|
-
children:
|
|
4722
|
+
fill: r ? Tr(e.color || _) : "var(--page-text, #111827)",
|
|
4723
|
+
children: wr(e.title, Math.floor(e.width / 7))
|
|
4318
4724
|
})] }, `group-${t}`);
|
|
4319
4725
|
}),
|
|
4320
4726
|
F.map((e, t) => /* @__PURE__ */ d("path", {
|
|
@@ -4324,7 +4730,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4324
4730
|
strokeWidth: "1.5"
|
|
4325
4731
|
}, t)),
|
|
4326
4732
|
N.map(({ node: e, x: t, y: n }) => {
|
|
4327
|
-
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 ?
|
|
4733
|
+
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 ? Tr(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tr(e.color2) : s, l = S && (Er(e) || e.href), p = () => Er(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Or.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);
|
|
4328
4734
|
return /* @__PURE__ */ f("g", {
|
|
4329
4735
|
onClick: l ? p : void 0,
|
|
4330
4736
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -4388,13 +4794,13 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4388
4794
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
4389
4795
|
id: `${C}-${e.id}`,
|
|
4390
4796
|
children: /* @__PURE__ */ d("circle", {
|
|
4391
|
-
cx: t +
|
|
4797
|
+
cx: t + Or.pad + M.avatar / 2,
|
|
4392
4798
|
cy: n + M.h / 2,
|
|
4393
4799
|
r: M.avatar / 2
|
|
4394
4800
|
})
|
|
4395
4801
|
}), /* @__PURE__ */ d("image", {
|
|
4396
4802
|
href: e.photo,
|
|
4397
|
-
x: t +
|
|
4803
|
+
x: t + Or.pad,
|
|
4398
4804
|
y: n + (M.h - M.avatar) / 2,
|
|
4399
4805
|
width: M.avatar,
|
|
4400
4806
|
height: M.avatar,
|
|
@@ -4408,7 +4814,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4408
4814
|
fontSize: M.title,
|
|
4409
4815
|
fontWeight: "600",
|
|
4410
4816
|
fill: s,
|
|
4411
|
-
children:
|
|
4817
|
+
children: wr(e.title, g + 4)
|
|
4412
4818
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
4413
4819
|
x: m,
|
|
4414
4820
|
y: n + _ + _ / 2 + M.name * .35,
|
|
@@ -4416,7 +4822,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4416
4822
|
fontSize: M.name,
|
|
4417
4823
|
fontWeight: "600",
|
|
4418
4824
|
fill: c,
|
|
4419
|
-
children:
|
|
4825
|
+
children: wr(e.name, g)
|
|
4420
4826
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
4421
4827
|
x: m,
|
|
4422
4828
|
y: n + (v[1] ? M.h * .43 : M.h * .57),
|
|
@@ -4424,7 +4830,7 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4424
4830
|
fontSize: M.name,
|
|
4425
4831
|
fontWeight: "600",
|
|
4426
4832
|
fill: s,
|
|
4427
|
-
children:
|
|
4833
|
+
children: wr(v[0], g)
|
|
4428
4834
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
4429
4835
|
x: m,
|
|
4430
4836
|
y: n + M.h * .73,
|
|
@@ -4432,19 +4838,19 @@ function Un({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
4432
4838
|
fontSize: M.title,
|
|
4433
4839
|
opacity: "0.7",
|
|
4434
4840
|
fill: s,
|
|
4435
|
-
children:
|
|
4841
|
+
children: wr(v[1], g + 4)
|
|
4436
4842
|
})] })
|
|
4437
4843
|
]
|
|
4438
4844
|
}, e.id);
|
|
4439
4845
|
})
|
|
4440
4846
|
]
|
|
4441
|
-
}), w && /* @__PURE__ */ d(
|
|
4847
|
+
}), w && /* @__PURE__ */ d(kr, {
|
|
4442
4848
|
node: w,
|
|
4443
4849
|
onClose: () => T(null)
|
|
4444
4850
|
})]
|
|
4445
4851
|
});
|
|
4446
4852
|
}
|
|
4447
|
-
function
|
|
4853
|
+
function jr({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4448
4854
|
let [i, o] = l(!1), s = c(null);
|
|
4449
4855
|
return a(() => {
|
|
4450
4856
|
if (!i || !s.current) return;
|
|
@@ -4474,7 +4880,7 @@ function Wn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4474
4880
|
children: e ?? ""
|
|
4475
4881
|
});
|
|
4476
4882
|
}
|
|
4477
|
-
var
|
|
4883
|
+
var Mr = 360, Nr = "\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", Pr = (e, t) => e && t ? `cell-${e}-${t}` : "", Fr = (e) => {
|
|
4478
4884
|
if (!e || typeof e != "object") return e ?? "";
|
|
4479
4885
|
let t = String(e.text ?? "");
|
|
4480
4886
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
@@ -4485,7 +4891,7 @@ var Gn = 360, Kn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4485
4891
|
children: t
|
|
4486
4892
|
}) : t;
|
|
4487
4893
|
};
|
|
4488
|
-
function
|
|
4894
|
+
function Ir({ 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 }) {
|
|
4489
4895
|
let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
|
|
4490
4896
|
r: e,
|
|
4491
4897
|
c: t
|
|
@@ -4499,7 +4905,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4499
4905
|
}
|
|
4500
4906
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4501
4907
|
top: r.bottom - n.top + 4,
|
|
4502
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4908
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Mr))
|
|
4503
4909
|
};
|
|
4504
4910
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4505
4911
|
}), a(() => {
|
|
@@ -4509,14 +4915,14 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4509
4915
|
};
|
|
4510
4916
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4511
4917
|
}, [N, L]);
|
|
4512
|
-
let { tenant: H, apiUrl: U } = i(
|
|
4918
|
+
let { tenant: H, apiUrl: U } = i(Q), ee = i(Qe), W = ee?.[h], te = C ? $e(ee) : 1, [ne, G] = l(null);
|
|
4513
4919
|
if (a(() => {
|
|
4514
4920
|
if (!h || W) return;
|
|
4515
4921
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4516
4922
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4517
4923
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4518
|
-
return e &&
|
|
4519
|
-
}).catch(() => e &&
|
|
4924
|
+
return e && G(n);
|
|
4925
|
+
}).catch(() => e && G([])), () => {
|
|
4520
4926
|
e = !1;
|
|
4521
4927
|
};
|
|
4522
4928
|
}, [
|
|
@@ -4528,13 +4934,13 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4528
4934
|
te,
|
|
4529
4935
|
g
|
|
4530
4936
|
]), !e.length) return null;
|
|
4531
|
-
let
|
|
4937
|
+
let K = Math.max(1, Number(g) || 10), re = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * K, te * K) : (ne ?? []).slice(0, K) : (W ?? ne ?? []).slice(0, K) : null, q = re ? re.map((t) => e.map((e) => ot(it(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, ae = b ? {
|
|
4532
4938
|
y: 6,
|
|
4533
4939
|
x: 10
|
|
4534
4940
|
} : {
|
|
4535
4941
|
y: 10,
|
|
4536
4942
|
x: 14
|
|
4537
|
-
},
|
|
4943
|
+
}, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : ae.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : ae.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
|
|
4538
4944
|
"left",
|
|
4539
4945
|
"center",
|
|
4540
4946
|
"right"
|
|
@@ -4546,7 +4952,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4546
4952
|
r.preventDefault(), r.stopPropagation();
|
|
4547
4953
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4548
4954
|
if (!a) return;
|
|
4549
|
-
let o =
|
|
4955
|
+
let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4550
4956
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4551
4957
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4552
4958
|
}, u = () => {
|
|
@@ -4554,8 +4960,8 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4554
4960
|
};
|
|
4555
4961
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4556
4962
|
}, ye = /* @__PURE__ */ new Set();
|
|
4557
|
-
p &&
|
|
4558
|
-
let i = p[
|
|
4963
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
4964
|
+
let i = p[Pr(r[n], o[t])];
|
|
4559
4965
|
if (!i) return;
|
|
4560
4966
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4561
4967
|
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4569,7 +4975,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4569
4975
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4570
4976
|
};
|
|
4571
4977
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4572
|
-
},
|
|
4978
|
+
}, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4573
4979
|
className: "wb-tedit-btn",
|
|
4574
4980
|
role: "button",
|
|
4575
4981
|
"data-hint": t,
|
|
@@ -4578,7 +4984,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4578
4984
|
},
|
|
4579
4985
|
onClick: n,
|
|
4580
4986
|
children: e
|
|
4581
|
-
}, t),
|
|
4987
|
+
}, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, xe = X ? p?.[Pr(r[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
4582
4988
|
return /* @__PURE__ */ f("div", {
|
|
4583
4989
|
ref: (e) => {
|
|
4584
4990
|
I.current = e, typeof M == "function" && M(e);
|
|
@@ -4589,8 +4995,8 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4589
4995
|
...ge
|
|
4590
4996
|
},
|
|
4591
4997
|
children: [
|
|
4592
|
-
N && /* @__PURE__ */ d("style", { children:
|
|
4593
|
-
N &&
|
|
4998
|
+
N && /* @__PURE__ */ d("style", { children: Nr }),
|
|
4999
|
+
N && X && z && /* @__PURE__ */ f("div", {
|
|
4594
5000
|
className: "wb-tedit-bar",
|
|
4595
5001
|
style: {
|
|
4596
5002
|
top: z.top,
|
|
@@ -4600,23 +5006,23 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4600
5006
|
children: [
|
|
4601
5007
|
/* @__PURE__ */ d("span", {
|
|
4602
5008
|
className: "wb-tedit-at",
|
|
4603
|
-
children: `R${
|
|
5009
|
+
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4604
5010
|
}),
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
5011
|
+
Y("+↑", Z("rowAbove", "Insert row above"), () => N.addRow(X.r - 1)),
|
|
5012
|
+
Y("+↓", Z("rowBelow", "Insert row below"), () => N.addRow(X.r)),
|
|
5013
|
+
Y("↑", Z("rowUp", "Move row up"), () => N.moveRow(X.r, -1), X.r === 0),
|
|
5014
|
+
Y("↓", Z("rowDown", "Move row down"), () => N.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
5015
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => N.dropRow(X.r), q.length <= 1),
|
|
4610
5016
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
5017
|
+
Y("+←", Z("colLeft", "Insert column left"), () => N.addColumn(X.c - 1)),
|
|
5018
|
+
Y("+→", Z("colRight", "Insert column right"), () => N.addColumn(X.c)),
|
|
5019
|
+
Y("←", Z("colMoveLeft", "Move column left"), () => N.moveColumn(X.c, -1), X.c === 0),
|
|
5020
|
+
Y("→", Z("colMoveRight", "Move column right"), () => N.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
5021
|
+
Y("✕ col", Z("colDelete", "Delete column"), () => N.dropColumn(X.c), e.length <= 1),
|
|
4616
5022
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
5023
|
+
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => N.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
5024
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => N.merge(X.r, X.c, "down"), X.r + Ce >= q.length),
|
|
5025
|
+
Y("⤫", Z("split", "Split this cell"), () => N.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
4620
5026
|
]
|
|
4621
5027
|
}),
|
|
4622
5028
|
/* @__PURE__ */ d("div", {
|
|
@@ -4635,17 +5041,17 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4635
5041
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4636
5042
|
borderSpacing: 0,
|
|
4637
5043
|
fontSize: 14,
|
|
4638
|
-
...
|
|
4639
|
-
...y ? { border:
|
|
5044
|
+
...ce ? { tableLayout: "fixed" } : null,
|
|
5045
|
+
...y ? { border: oe } : {}
|
|
4640
5046
|
},
|
|
4641
5047
|
children: [
|
|
4642
|
-
|
|
5048
|
+
ce && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4643
5049
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4644
5050
|
className: N ? "wb-tedit-head" : void 0,
|
|
4645
5051
|
style: {
|
|
4646
5052
|
textAlign: de(n),
|
|
4647
5053
|
fontWeight: 600,
|
|
4648
|
-
padding:
|
|
5054
|
+
padding: J,
|
|
4649
5055
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4650
5056
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4651
5057
|
...T ? {
|
|
@@ -4653,29 +5059,29 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4653
5059
|
top: 0,
|
|
4654
5060
|
zIndex: 2
|
|
4655
5061
|
} : N ? { position: "relative" } : null,
|
|
4656
|
-
...
|
|
5062
|
+
...se
|
|
4657
5063
|
},
|
|
4658
|
-
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(
|
|
5064
|
+
children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(jr, {
|
|
4659
5065
|
value: t.label ?? t,
|
|
4660
5066
|
onCommit: (e) => N.header(n, e),
|
|
4661
|
-
hint:
|
|
5067
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4662
5068
|
style: { paddingRight: 6 }
|
|
4663
5069
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4664
5070
|
className: "wb-tedit-grip",
|
|
4665
|
-
title:
|
|
5071
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4666
5072
|
onPointerDown: ve(n)
|
|
4667
5073
|
})] }) : t.label ?? t
|
|
4668
5074
|
}, n)) }) }),
|
|
4669
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
5075
|
+
/* @__PURE__ */ f("tbody", { children: [ie && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4670
5076
|
colSpan: e.length,
|
|
4671
5077
|
style: {
|
|
4672
|
-
padding:
|
|
5078
|
+
padding: J,
|
|
4673
5079
|
textAlign: "center",
|
|
4674
5080
|
opacity: .6,
|
|
4675
|
-
...
|
|
5081
|
+
...se
|
|
4676
5082
|
},
|
|
4677
5083
|
children: w || "No data yet"
|
|
4678
|
-
}) }),
|
|
5084
|
+
}) }), q.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4679
5085
|
className: N ? "wb-tedit-row" : void 0,
|
|
4680
5086
|
style: {
|
|
4681
5087
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -4683,7 +5089,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4683
5089
|
},
|
|
4684
5090
|
children: e.map((e, i) => {
|
|
4685
5091
|
if (ye.has(`${n},${i}`)) return null;
|
|
4686
|
-
let a =
|
|
5092
|
+
let a = Pr(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);
|
|
4687
5093
|
return /* @__PURE__ */ f("td", {
|
|
4688
5094
|
className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4689
5095
|
onMouseDownCapture: _e ? V(n, i) : void 0,
|
|
@@ -4691,14 +5097,14 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4691
5097
|
colSpan: l > 1 ? l : void 0,
|
|
4692
5098
|
rowSpan: u > 1 ? u : void 0,
|
|
4693
5099
|
style: {
|
|
4694
|
-
padding:
|
|
5100
|
+
padding: J,
|
|
4695
5101
|
...ue(i) ? { textAlign: ue(i) } : null,
|
|
4696
5102
|
...N ? { position: "relative" } : null,
|
|
4697
|
-
...
|
|
5103
|
+
...se
|
|
4698
5104
|
},
|
|
4699
|
-
children: [s ??
|
|
5105
|
+
children: [s ?? Fr(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
|
|
4700
5106
|
className: "wb-tedit-rowgrip",
|
|
4701
|
-
title:
|
|
5107
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4702
5108
|
onPointerDown: be(n),
|
|
4703
5109
|
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4704
5110
|
})]
|
|
@@ -4711,7 +5117,7 @@ function Yn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4711
5117
|
]
|
|
4712
5118
|
});
|
|
4713
5119
|
}
|
|
4714
|
-
var
|
|
5120
|
+
var Lr = {
|
|
4715
5121
|
small: {
|
|
4716
5122
|
cell: 62,
|
|
4717
5123
|
font: 10.5,
|
|
@@ -4736,9 +5142,9 @@ var Xn = {
|
|
|
4736
5142
|
pad: 8,
|
|
4737
5143
|
gap: 4
|
|
4738
5144
|
}
|
|
4739
|
-
},
|
|
4740
|
-
function
|
|
4741
|
-
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 ? "" :
|
|
5145
|
+
}, Rr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, zr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Br = 366;
|
|
5146
|
+
function Vr(e, t = {}) {
|
|
5147
|
+
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 ? "" : ot(e), a = (e) => {
|
|
4742
5148
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4743
5149
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4744
5150
|
};
|
|
@@ -4754,7 +5160,7 @@ function er(e, t = {}) {
|
|
|
4754
5160
|
} : null;
|
|
4755
5161
|
}).filter(Boolean);
|
|
4756
5162
|
}
|
|
4757
|
-
function
|
|
5163
|
+
function Hr(e) {
|
|
4758
5164
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4759
5165
|
let n = e?.start ? new Date(e.start) : null;
|
|
4760
5166
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4769,20 +5175,20 @@ function tr(e) {
|
|
|
4769
5175
|
};
|
|
4770
5176
|
}).filter(Boolean);
|
|
4771
5177
|
}
|
|
4772
|
-
function
|
|
5178
|
+
function Ur(e) {
|
|
4773
5179
|
let t = /* @__PURE__ */ new Map();
|
|
4774
5180
|
for (let n of e) {
|
|
4775
|
-
let e =
|
|
5181
|
+
let e = zr(n.start), r = n.end ? zr(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Br);
|
|
4776
5182
|
for (let r = 0; r <= i; r += 1) {
|
|
4777
|
-
let i =
|
|
5183
|
+
let i = Rr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4778
5184
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4779
5185
|
}
|
|
4780
5186
|
}
|
|
4781
5187
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4782
5188
|
return t;
|
|
4783
5189
|
}
|
|
4784
|
-
function
|
|
4785
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
5190
|
+
function Wr({ 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 }) {
|
|
5191
|
+
let { tenant: T, apiUrl: E, locale: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4786
5192
|
let e = /* @__PURE__ */ new Date();
|
|
4787
5193
|
return {
|
|
4788
5194
|
year: e.getFullYear(),
|
|
@@ -4804,13 +5210,13 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4804
5210
|
E,
|
|
4805
5211
|
O
|
|
4806
5212
|
]);
|
|
4807
|
-
let N =
|
|
5213
|
+
let N = Lr[m] ?? Lr.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 ? Vr(O ?? k ?? [], {
|
|
4808
5214
|
titleField: n,
|
|
4809
5215
|
startField: r,
|
|
4810
5216
|
endField: o,
|
|
4811
5217
|
hrefField: s,
|
|
4812
5218
|
colorField: c
|
|
4813
|
-
}) :
|
|
5219
|
+
}) : Hr(e), B = Ur(z), V = D || void 0, H = (e, t) => {
|
|
4814
5220
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4815
5221
|
width: 6,
|
|
4816
5222
|
height: 6,
|
|
@@ -4942,10 +5348,10 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4942
5348
|
})]
|
|
4943
5349
|
});
|
|
4944
5350
|
}
|
|
4945
|
-
let ne = new Date(j.year, j.month, 1),
|
|
4946
|
-
for (let e = 0; e <
|
|
4947
|
-
let t = e -
|
|
4948
|
-
|
|
5351
|
+
let ne = new Date(j.year, j.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), q = Math.ceil((K + re) / 7), ie = Rr(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
5352
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
5353
|
+
let t = e - K + 1, n = t >= 1 && t <= re, r = Rr(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
5354
|
+
J.push(/* @__PURE__ */ f("div", {
|
|
4949
5355
|
style: {
|
|
4950
5356
|
minHeight: N.cell,
|
|
4951
5357
|
borderTop: `1px solid ${I}`,
|
|
@@ -5002,31 +5408,31 @@ function rr({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
5002
5408
|
textAlign: "center",
|
|
5003
5409
|
padding: `0 0 ${N.pad}px`
|
|
5004
5410
|
},
|
|
5005
|
-
children:
|
|
5006
|
-
}, `head-${t}`)),
|
|
5411
|
+
children: ae.format(new Date(2024, 0, 7 + G + t))
|
|
5412
|
+
}, `head-${t}`)), J]
|
|
5007
5413
|
}),
|
|
5008
5414
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
5009
5415
|
]
|
|
5010
5416
|
});
|
|
5011
5417
|
}
|
|
5012
|
-
var
|
|
5418
|
+
var Gr = {
|
|
5013
5419
|
small: 36,
|
|
5014
5420
|
medium: 56,
|
|
5015
5421
|
large: 88
|
|
5016
5422
|
};
|
|
5017
|
-
function
|
|
5018
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
5423
|
+
function Kr(e, t = {}) {
|
|
5424
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ot(e);
|
|
5019
5425
|
return n.map((e) => {
|
|
5020
|
-
let n = e.data ?? e, i =
|
|
5426
|
+
let n = e.data ?? e, i = it(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(it(n, t.nameField)) : r(n.name);
|
|
5021
5427
|
return {
|
|
5022
5428
|
src: typeof o == "string" ? o.trim() : "",
|
|
5023
5429
|
alt: s,
|
|
5024
|
-
href: t.hrefField ? r(
|
|
5430
|
+
href: t.hrefField ? r(it(n, t.hrefField)) : ""
|
|
5025
5431
|
};
|
|
5026
5432
|
}).filter((e) => e.src);
|
|
5027
5433
|
}
|
|
5028
|
-
function
|
|
5029
|
-
let { tenant: D, apiUrl: O } = i(
|
|
5434
|
+
function qr({ 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 }) {
|
|
5435
|
+
let { tenant: D, apiUrl: O } = i(Q), k = i(Qe)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [W, te] = l(!1);
|
|
5030
5436
|
a(() => {
|
|
5031
5437
|
if (!t || k) return;
|
|
5032
5438
|
let e = !0;
|
|
@@ -5056,7 +5462,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5056
5462
|
let e = M.current;
|
|
5057
5463
|
if (!e) return;
|
|
5058
5464
|
let t = !0, n = () => {
|
|
5059
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5465
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * K);
|
|
5060
5466
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
5061
5467
|
};
|
|
5062
5468
|
n();
|
|
@@ -5065,12 +5471,12 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5065
5471
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5066
5472
|
};
|
|
5067
5473
|
});
|
|
5068
|
-
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [],
|
|
5474
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Kr(k ?? A ?? [], {
|
|
5069
5475
|
imageField: n,
|
|
5070
5476
|
nameField: r,
|
|
5071
5477
|
hrefField: o
|
|
5072
|
-
}) : ne,
|
|
5073
|
-
if (!
|
|
5478
|
+
}) : ne, K = Gr[p] ?? Gr.medium, re = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, q = s === "marquee" ? "step" : s, ie = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), J = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + re, ce = F ? Math.max(1, Math.floor(F / se)) : J, le = Math.min(J, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5479
|
+
if (!G.length) return /* @__PURE__ */ d("div", {
|
|
5074
5480
|
ref: T,
|
|
5075
5481
|
style: {
|
|
5076
5482
|
width: "100%",
|
|
@@ -5082,7 +5488,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5082
5488
|
alignItems: "center",
|
|
5083
5489
|
justifyContent: "center",
|
|
5084
5490
|
flexWrap: "wrap",
|
|
5085
|
-
gap:
|
|
5491
|
+
gap: re
|
|
5086
5492
|
},
|
|
5087
5493
|
children: [
|
|
5088
5494
|
0,
|
|
@@ -5092,16 +5498,16 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5092
5498
|
4
|
|
5093
5499
|
].map((e) => /* @__PURE__ */ d("div", {
|
|
5094
5500
|
style: {
|
|
5095
|
-
height:
|
|
5096
|
-
width:
|
|
5501
|
+
height: K,
|
|
5502
|
+
width: K * 3,
|
|
5097
5503
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5098
5504
|
borderRadius: 6,
|
|
5099
5505
|
display: "flex",
|
|
5100
5506
|
alignItems: "center",
|
|
5101
5507
|
justifyContent: "center",
|
|
5102
|
-
fontSize: Math.max(10, Math.round(
|
|
5508
|
+
fontSize: Math.max(10, Math.round(K / 4)),
|
|
5103
5509
|
opacity: .45,
|
|
5104
|
-
...
|
|
5510
|
+
...oe
|
|
5105
5511
|
},
|
|
5106
5512
|
children: "LOGO"
|
|
5107
5513
|
}, e))
|
|
@@ -5115,12 +5521,12 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5115
5521
|
children: C
|
|
5116
5522
|
}) : null
|
|
5117
5523
|
});
|
|
5118
|
-
let de =
|
|
5524
|
+
let de = G.length, fe = q === "step" && de > le, pe = q === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...G, ...G] : G, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5119
5525
|
let r = /* @__PURE__ */ d("img", {
|
|
5120
5526
|
src: e.src,
|
|
5121
5527
|
alt: e.alt ?? "",
|
|
5122
5528
|
style: {
|
|
5123
|
-
height:
|
|
5529
|
+
height: K,
|
|
5124
5530
|
width: "auto",
|
|
5125
5531
|
maxWidth: "100%",
|
|
5126
5532
|
objectFit: "contain",
|
|
@@ -5129,7 +5535,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5129
5535
|
}), i = fe ? {
|
|
5130
5536
|
width: ue,
|
|
5131
5537
|
flex: "0 0 auto",
|
|
5132
|
-
padding: `0 ${
|
|
5538
|
+
padding: `0 ${re / 2}px`,
|
|
5133
5539
|
justifyContent: "center"
|
|
5134
5540
|
} : {};
|
|
5135
5541
|
return e.href && !E ? /* @__PURE__ */ d("a", {
|
|
@@ -5161,20 +5567,20 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5161
5567
|
...fe ? {
|
|
5162
5568
|
width: _e.length * ue,
|
|
5163
5569
|
transform: `translateX(-${ve}px)`,
|
|
5164
|
-
transition: V ? `transform ${
|
|
5570
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5165
5571
|
} : pe ? {
|
|
5166
|
-
gap:
|
|
5572
|
+
gap: re,
|
|
5167
5573
|
overflowX: "auto",
|
|
5168
5574
|
scrollBehavior: "smooth",
|
|
5169
5575
|
scrollSnapType: "x proximity"
|
|
5170
5576
|
} : {
|
|
5171
|
-
gap:
|
|
5577
|
+
gap: re,
|
|
5172
5578
|
flexWrap: "wrap",
|
|
5173
5579
|
justifyContent: "center"
|
|
5174
5580
|
}
|
|
5175
5581
|
},
|
|
5176
5582
|
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5177
|
-
}),
|
|
5583
|
+
}), Y = (e) => {
|
|
5178
5584
|
if (pe) {
|
|
5179
5585
|
let t = M.current;
|
|
5180
5586
|
t && t.scrollBy({
|
|
@@ -5192,10 +5598,10 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5192
5598
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5193
5599
|
H(!0), B(n + e);
|
|
5194
5600
|
}));
|
|
5195
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe),
|
|
5601
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), xe = (e) => /* @__PURE__ */ d("button", {
|
|
5196
5602
|
type: "button",
|
|
5197
5603
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5198
|
-
onClick: () =>
|
|
5604
|
+
onClick: () => Y(e),
|
|
5199
5605
|
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5200
5606
|
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5201
5607
|
children: e < 0 ? "‹" : "›"
|
|
@@ -5242,22 +5648,22 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5242
5648
|
margin: "0 auto"
|
|
5243
5649
|
},
|
|
5244
5650
|
children: [
|
|
5245
|
-
Z ?
|
|
5651
|
+
Z ? xe(-1) : null,
|
|
5246
5652
|
/* @__PURE__ */ d("div", {
|
|
5247
5653
|
style: { overflow: "hidden" },
|
|
5248
5654
|
children: be
|
|
5249
5655
|
}),
|
|
5250
|
-
Z ?
|
|
5656
|
+
Z ? xe(1) : null
|
|
5251
5657
|
]
|
|
5252
5658
|
}) : /* @__PURE__ */ f(u, { children: [
|
|
5253
|
-
Z ?
|
|
5659
|
+
Z ? xe(-1) : null,
|
|
5254
5660
|
be,
|
|
5255
|
-
Z ?
|
|
5661
|
+
Z ? xe(1) : null
|
|
5256
5662
|
] }),
|
|
5257
|
-
/* @__PURE__ */ d(
|
|
5663
|
+
/* @__PURE__ */ d(Jr, {
|
|
5258
5664
|
running: me,
|
|
5259
|
-
every:
|
|
5260
|
-
slide:
|
|
5665
|
+
every: ie + ae,
|
|
5666
|
+
slide: ae,
|
|
5261
5667
|
step: he ? -1 : 1,
|
|
5262
5668
|
index: z,
|
|
5263
5669
|
total: de,
|
|
@@ -5268,7 +5674,7 @@ function or({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
5268
5674
|
]
|
|
5269
5675
|
});
|
|
5270
5676
|
}
|
|
5271
|
-
function
|
|
5677
|
+
function Jr({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5272
5678
|
a(() => {
|
|
5273
5679
|
if (!e) return;
|
|
5274
5680
|
let n = setInterval(() => {
|
|
@@ -5304,13 +5710,13 @@ function sr({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
|
|
|
5304
5710
|
l
|
|
5305
5711
|
]), null;
|
|
5306
5712
|
}
|
|
5307
|
-
var
|
|
5713
|
+
var Yr = {
|
|
5308
5714
|
small: 380,
|
|
5309
5715
|
medium: 560,
|
|
5310
5716
|
large: 820,
|
|
5311
5717
|
full: "100%"
|
|
5312
5718
|
};
|
|
5313
|
-
function
|
|
5719
|
+
function Xr({ 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 }) {
|
|
5314
5720
|
let [C, w] = l(!1), T = c(null);
|
|
5315
5721
|
a(() => {
|
|
5316
5722
|
if (S || !e) return;
|
|
@@ -5335,7 +5741,7 @@ function lr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5335
5741
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5336
5742
|
};
|
|
5337
5743
|
}, [S, C]);
|
|
5338
|
-
let E =
|
|
5744
|
+
let E = Yr[o] ?? Yr.medium, D = (e) => {
|
|
5339
5745
|
let t = {
|
|
5340
5746
|
padding: "9px 16px",
|
|
5341
5747
|
borderRadius: 6,
|
|
@@ -5504,7 +5910,7 @@ function lr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5504
5910
|
})]
|
|
5505
5911
|
});
|
|
5506
5912
|
}
|
|
5507
|
-
function
|
|
5913
|
+
function Zr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: o = "", offset: s = 8, editorOpen: u = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5508
5914
|
let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
|
|
5509
5915
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5510
5916
|
}, C = () => {
|
|
@@ -5605,100 +6011,102 @@ function ur({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
5605
6011
|
}), E]
|
|
5606
6012
|
});
|
|
5607
6013
|
}
|
|
5608
|
-
var
|
|
5609
|
-
PageRoot:
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5636
|
-
|
|
5637
|
-
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
6014
|
+
var Qr = {
|
|
6015
|
+
PageRoot: _t,
|
|
6016
|
+
MarkdownBlock: It,
|
|
6017
|
+
CalendarBlock: Wr,
|
|
6018
|
+
LogoCarousel: qr,
|
|
6019
|
+
DialogBlock: Xr,
|
|
6020
|
+
DropdownBlock: Zr,
|
|
6021
|
+
Section: vt,
|
|
6022
|
+
Container: yt,
|
|
6023
|
+
LinkBlock: bt,
|
|
6024
|
+
Heading: xt,
|
|
6025
|
+
TextBlock: Bt,
|
|
6026
|
+
ButtonBlock: Wt,
|
|
6027
|
+
ImageBlock: Gt,
|
|
6028
|
+
Spacer: $t,
|
|
6029
|
+
Divider: en,
|
|
6030
|
+
BoxBlock: tn,
|
|
6031
|
+
SliderBlock: cn,
|
|
6032
|
+
CanvasSlider: ln,
|
|
6033
|
+
TabsBlock: Tn,
|
|
6034
|
+
QuickStack: Zn,
|
|
6035
|
+
CollectionList: Qn,
|
|
6036
|
+
CollectionSearch: $n,
|
|
6037
|
+
BreadcrumbsBlock: er,
|
|
6038
|
+
PaginationBlock: tr,
|
|
6039
|
+
StepperBlock: vr,
|
|
6040
|
+
SocialLinksBlock: _r,
|
|
6041
|
+
ThemeModeBlock: or,
|
|
6042
|
+
ScrollTopBlock: hr,
|
|
6043
|
+
CounterBlock: mr,
|
|
6044
|
+
OrgChartBlock: Ar,
|
|
6045
|
+
TableBlock: Ir,
|
|
6046
|
+
IconBlock: vn,
|
|
6047
|
+
MapBlock: gn,
|
|
6048
|
+
MasonryBlock: bn,
|
|
6049
|
+
AccordionBlock: En,
|
|
6050
|
+
NavbarBlock: wn,
|
|
6051
|
+
ListBlock: zt,
|
|
6052
|
+
TextSpan: Et,
|
|
6053
|
+
QuoteBlock: Rt,
|
|
6054
|
+
TextLink: Ut,
|
|
6055
|
+
RichTextBlock: Ft,
|
|
6056
|
+
RichContentBlock: Ft,
|
|
6057
|
+
VideoBlock: Kt,
|
|
6058
|
+
YouTubeBlock: Jt,
|
|
6059
|
+
IframeBlock: Yt,
|
|
6060
|
+
EmbedBlock: Qt,
|
|
6061
|
+
FormBlock: zn,
|
|
6062
|
+
FormLabel: Wn,
|
|
6063
|
+
FormInput: Gn,
|
|
6064
|
+
FormTextarea: Kn,
|
|
6065
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(qn, {
|
|
5658
6066
|
kind: "checkbox",
|
|
5659
6067
|
...e
|
|
5660
6068
|
}),
|
|
5661
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
6069
|
+
FormRadio: (e) => /* @__PURE__ */ d(qn, {
|
|
5662
6070
|
kind: "radio",
|
|
5663
6071
|
...e
|
|
5664
6072
|
}),
|
|
5665
|
-
FormSelect:
|
|
5666
|
-
FormFile:
|
|
5667
|
-
FormRecaptcha:
|
|
5668
|
-
FormSubmit:
|
|
5669
|
-
},
|
|
6073
|
+
FormSelect: Jn,
|
|
6074
|
+
FormFile: Yn,
|
|
6075
|
+
FormRecaptcha: Un,
|
|
6076
|
+
FormSubmit: Xn
|
|
6077
|
+
}, $r = {
|
|
5670
6078
|
id: "auth",
|
|
5671
6079
|
label: "Accounts",
|
|
5672
6080
|
category: "Apps",
|
|
5673
6081
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5674
6082
|
ssr: "shell",
|
|
5675
6083
|
settings: ["site.authRedirect"]
|
|
5676
|
-
},
|
|
6084
|
+
}, ei = n({
|
|
5677
6085
|
user: null,
|
|
5678
6086
|
status: "idle",
|
|
5679
6087
|
ensure: () => {},
|
|
5680
6088
|
refresh: () => {},
|
|
5681
6089
|
signOut: () => {}
|
|
5682
6090
|
});
|
|
5683
|
-
function
|
|
6091
|
+
function ti(e, t) {
|
|
5684
6092
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5685
6093
|
}
|
|
5686
|
-
function
|
|
6094
|
+
function ni(e) {
|
|
5687
6095
|
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);
|
|
5688
6096
|
return {
|
|
5689
6097
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5690
6098
|
url: i,
|
|
5691
6099
|
mePath: a,
|
|
5692
6100
|
logoutPath: o,
|
|
5693
|
-
meUrl:
|
|
5694
|
-
logoutUrl:
|
|
6101
|
+
meUrl: ti(i, a),
|
|
6102
|
+
logoutUrl: ti(i, o),
|
|
5695
6103
|
loginPage: r(n.loginPage),
|
|
5696
6104
|
userPath: r(n.userPath),
|
|
5697
6105
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5698
6106
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5699
6107
|
};
|
|
5700
6108
|
}
|
|
5701
|
-
function
|
|
6109
|
+
function ri(e, t) {
|
|
5702
6110
|
if (!t) return e ?? null;
|
|
5703
6111
|
let n = e;
|
|
5704
6112
|
for (let e of t.split(".")) {
|
|
@@ -5707,26 +6115,26 @@ function gr(e, t) {
|
|
|
5707
6115
|
}
|
|
5708
6116
|
return n ?? null;
|
|
5709
6117
|
}
|
|
5710
|
-
function
|
|
6118
|
+
function ii(e) {
|
|
5711
6119
|
try {
|
|
5712
6120
|
return window.localStorage.getItem(e) || "";
|
|
5713
6121
|
} catch {
|
|
5714
6122
|
return "";
|
|
5715
6123
|
}
|
|
5716
6124
|
}
|
|
5717
|
-
function
|
|
6125
|
+
function ai(e) {
|
|
5718
6126
|
try {
|
|
5719
6127
|
window.localStorage.removeItem(e);
|
|
5720
6128
|
} catch {}
|
|
5721
6129
|
}
|
|
5722
|
-
var
|
|
5723
|
-
let e = i(
|
|
6130
|
+
var oi = () => {
|
|
6131
|
+
let e = i(ei);
|
|
5724
6132
|
return a(() => {
|
|
5725
6133
|
e.ensure();
|
|
5726
6134
|
}, [e]), e;
|
|
5727
6135
|
};
|
|
5728
|
-
function
|
|
5729
|
-
let f = i(
|
|
6136
|
+
function si({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
6137
|
+
let f = i(Q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => ni(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}`, {
|
|
5730
6138
|
...t,
|
|
5731
6139
|
credentials: "include",
|
|
5732
6140
|
headers: {
|
|
@@ -5738,9 +6146,9 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5738
6146
|
if (n) return Promise.resolve(null);
|
|
5739
6147
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5740
6148
|
if (h.mode === "custom") {
|
|
5741
|
-
let e = h.auth === "bearer" ?
|
|
6149
|
+
let e = h.auth === "bearer" ? ii(h.tokenKey) : "";
|
|
5742
6150
|
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) => {
|
|
5743
|
-
let t =
|
|
6151
|
+
let t = ri(e, h.userPath);
|
|
5744
6152
|
return S(t && typeof t == "object" ? t : null);
|
|
5745
6153
|
}).catch(() => S(null));
|
|
5746
6154
|
}
|
|
@@ -5753,12 +6161,12 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5753
6161
|
]), w = r(() => {
|
|
5754
6162
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5755
6163
|
if (h.mode === "custom") {
|
|
5756
|
-
let e = h.auth === "bearer" ?
|
|
6164
|
+
let e = h.auth === "bearer" ? ii(h.tokenKey) : "";
|
|
5757
6165
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5758
6166
|
method: "post",
|
|
5759
6167
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5760
6168
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5761
|
-
h.auth === "bearer" &&
|
|
6169
|
+
h.auth === "bearer" && ai(h.tokenKey), S(null);
|
|
5762
6170
|
});
|
|
5763
6171
|
}
|
|
5764
6172
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5808,19 +6216,19 @@ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
5808
6216
|
h.loginPage,
|
|
5809
6217
|
C,
|
|
5810
6218
|
w
|
|
5811
|
-
]), /* @__PURE__ */ d(
|
|
6219
|
+
]), /* @__PURE__ */ d(ei.Provider, {
|
|
5812
6220
|
value: E,
|
|
5813
6221
|
children: e
|
|
5814
6222
|
});
|
|
5815
6223
|
}
|
|
5816
|
-
function
|
|
5817
|
-
let { status: n } =
|
|
6224
|
+
function ci({ when: e, children: t }) {
|
|
6225
|
+
let { status: n } = oi();
|
|
5818
6226
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5819
6227
|
}
|
|
5820
6228
|
//#endregion
|
|
5821
6229
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5822
|
-
function
|
|
5823
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
6230
|
+
function li({ 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 }) {
|
|
6231
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(Q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5824
6232
|
if (e.preventDefault(), u) return;
|
|
5825
6233
|
let n = new FormData(e.currentTarget);
|
|
5826
6234
|
C(!0), x("");
|
|
@@ -5868,20 +6276,20 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5868
6276
|
children: [
|
|
5869
6277
|
w ? /* @__PURE__ */ f("label", {
|
|
5870
6278
|
style: {
|
|
5871
|
-
...
|
|
6279
|
+
...On,
|
|
5872
6280
|
display: "grid",
|
|
5873
6281
|
gap: 6
|
|
5874
6282
|
},
|
|
5875
6283
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5876
6284
|
name: "name",
|
|
5877
6285
|
type: "text",
|
|
5878
|
-
style:
|
|
5879
|
-
...
|
|
6286
|
+
style: kn,
|
|
6287
|
+
...jn(u)
|
|
5880
6288
|
})]
|
|
5881
6289
|
}) : null,
|
|
5882
6290
|
/* @__PURE__ */ f("label", {
|
|
5883
6291
|
style: {
|
|
5884
|
-
...
|
|
6292
|
+
...On,
|
|
5885
6293
|
display: "grid",
|
|
5886
6294
|
gap: 6
|
|
5887
6295
|
},
|
|
@@ -5889,13 +6297,13 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5889
6297
|
name: "email",
|
|
5890
6298
|
type: "email",
|
|
5891
6299
|
required: !u,
|
|
5892
|
-
style:
|
|
5893
|
-
...
|
|
6300
|
+
style: kn,
|
|
6301
|
+
...jn(u)
|
|
5894
6302
|
})]
|
|
5895
6303
|
}),
|
|
5896
6304
|
/* @__PURE__ */ f("label", {
|
|
5897
6305
|
style: {
|
|
5898
|
-
...
|
|
6306
|
+
...On,
|
|
5899
6307
|
display: "grid",
|
|
5900
6308
|
gap: 6
|
|
5901
6309
|
},
|
|
@@ -5903,15 +6311,15 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5903
6311
|
name: "password",
|
|
5904
6312
|
type: "password",
|
|
5905
6313
|
required: !u,
|
|
5906
|
-
style:
|
|
5907
|
-
...
|
|
6314
|
+
style: kn,
|
|
6315
|
+
...jn(u)
|
|
5908
6316
|
})]
|
|
5909
6317
|
}),
|
|
5910
6318
|
/* @__PURE__ */ d("button", {
|
|
5911
6319
|
type: u ? "button" : "submit",
|
|
5912
6320
|
disabled: S || void 0,
|
|
5913
6321
|
style: {
|
|
5914
|
-
...
|
|
6322
|
+
...ft,
|
|
5915
6323
|
border: 0,
|
|
5916
6324
|
padding: "10px 22px",
|
|
5917
6325
|
borderRadius: 8,
|
|
@@ -5943,8 +6351,8 @@ function Sr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5943
6351
|
]
|
|
5944
6352
|
});
|
|
5945
6353
|
}
|
|
5946
|
-
function
|
|
5947
|
-
let { user: c, status: l, signOut: u } =
|
|
6354
|
+
function ui({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6355
|
+
let { user: c, status: l, signOut: u } = oi(), p = a ? s || "user" : l, m = a ? {
|
|
5948
6356
|
name: "Ada Lovelace",
|
|
5949
6357
|
email: "ada@example.com"
|
|
5950
6358
|
} : c;
|
|
@@ -5965,7 +6373,7 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5965
6373
|
children: [
|
|
5966
6374
|
/* @__PURE__ */ f("span", {
|
|
5967
6375
|
style: {
|
|
5968
|
-
...
|
|
6376
|
+
...On,
|
|
5969
6377
|
fontWeight: 600
|
|
5970
6378
|
},
|
|
5971
6379
|
children: [
|
|
@@ -5976,7 +6384,7 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5976
6384
|
}),
|
|
5977
6385
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5978
6386
|
style: {
|
|
5979
|
-
...
|
|
6387
|
+
...On,
|
|
5980
6388
|
opacity: .7
|
|
5981
6389
|
},
|
|
5982
6390
|
children: m.email
|
|
@@ -5985,14 +6393,14 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5985
6393
|
type: "button",
|
|
5986
6394
|
onClick: a ? void 0 : u,
|
|
5987
6395
|
style: {
|
|
5988
|
-
...
|
|
6396
|
+
...ft,
|
|
5989
6397
|
border: 0,
|
|
5990
6398
|
padding: "8px 16px",
|
|
5991
6399
|
borderRadius: 8,
|
|
5992
6400
|
fontSize: 14,
|
|
5993
6401
|
cursor: a ? "default" : "pointer"
|
|
5994
6402
|
},
|
|
5995
|
-
...
|
|
6403
|
+
...jn(a),
|
|
5996
6404
|
children: t
|
|
5997
6405
|
})
|
|
5998
6406
|
]
|
|
@@ -6009,40 +6417,40 @@ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6009
6417
|
}
|
|
6010
6418
|
//#endregion
|
|
6011
6419
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
6012
|
-
var
|
|
6420
|
+
var di = {
|
|
6013
6421
|
id: "consent",
|
|
6014
6422
|
label: "Cookie consent",
|
|
6015
6423
|
category: "Apps",
|
|
6016
6424
|
keys: ["CookieConsent"],
|
|
6017
6425
|
ssr: "shell",
|
|
6018
6426
|
settings: []
|
|
6019
|
-
},
|
|
6020
|
-
function
|
|
6427
|
+
}, fi = "webim.cookie_consent";
|
|
6428
|
+
function pi() {
|
|
6021
6429
|
try {
|
|
6022
|
-
let e = window.localStorage.getItem(
|
|
6430
|
+
let e = window.localStorage.getItem(fi), t = e ? JSON.parse(e) : null;
|
|
6023
6431
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
6024
6432
|
} catch {
|
|
6025
6433
|
return "";
|
|
6026
6434
|
}
|
|
6027
6435
|
}
|
|
6028
|
-
function
|
|
6436
|
+
function mi(e) {
|
|
6029
6437
|
try {
|
|
6030
6438
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
6031
6439
|
} catch {}
|
|
6032
6440
|
}
|
|
6033
|
-
function
|
|
6441
|
+
function hi(e) {
|
|
6034
6442
|
try {
|
|
6035
|
-
window.localStorage.setItem(
|
|
6443
|
+
window.localStorage.setItem(fi, JSON.stringify({
|
|
6036
6444
|
choice: e,
|
|
6037
6445
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6038
6446
|
}));
|
|
6039
6447
|
} catch {}
|
|
6040
|
-
|
|
6448
|
+
mi(e);
|
|
6041
6449
|
try {
|
|
6042
6450
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
6043
6451
|
} catch {}
|
|
6044
6452
|
}
|
|
6045
|
-
var
|
|
6453
|
+
var gi = {
|
|
6046
6454
|
bottom: {
|
|
6047
6455
|
left: 0,
|
|
6048
6456
|
right: 0,
|
|
@@ -6064,18 +6472,18 @@ var kr = {
|
|
|
6064
6472
|
maxWidth: 400
|
|
6065
6473
|
}
|
|
6066
6474
|
};
|
|
6067
|
-
function
|
|
6475
|
+
function _i({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
6068
6476
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
6069
6477
|
y(e), typeof m == "function" && m(e);
|
|
6070
6478
|
};
|
|
6071
6479
|
if (a(() => {
|
|
6072
6480
|
if (h) return;
|
|
6073
|
-
let e =
|
|
6074
|
-
e ?
|
|
6481
|
+
let e = pi();
|
|
6482
|
+
e ? mi(e) : _(!0);
|
|
6075
6483
|
}, [h, v]), !g) return null;
|
|
6076
6484
|
let x = (e) => () => {
|
|
6077
|
-
h || (
|
|
6078
|
-
}, S =
|
|
6485
|
+
h || (hi(e), _(!1));
|
|
6486
|
+
}, S = gi[s] ?? gi.bottom, C = {
|
|
6079
6487
|
appearance: "none",
|
|
6080
6488
|
font: "inherit",
|
|
6081
6489
|
fontSize: 14,
|
|
@@ -6155,37 +6563,37 @@ function Ar({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6155
6563
|
}
|
|
6156
6564
|
//#endregion
|
|
6157
6565
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6158
|
-
var
|
|
6566
|
+
var vi = {
|
|
6159
6567
|
id: "language",
|
|
6160
6568
|
label: "Language",
|
|
6161
6569
|
category: "Apps",
|
|
6162
6570
|
keys: ["SiteLanguagePicker"],
|
|
6163
6571
|
ssr: "prefetch",
|
|
6164
6572
|
settings: ["locales"]
|
|
6165
|
-
},
|
|
6573
|
+
}, yi = {
|
|
6166
6574
|
id: "search",
|
|
6167
6575
|
label: "Search",
|
|
6168
6576
|
category: "Apps",
|
|
6169
6577
|
keys: ["SiteSearch"],
|
|
6170
6578
|
ssr: "prefetch",
|
|
6171
6579
|
settings: []
|
|
6172
|
-
},
|
|
6173
|
-
function
|
|
6580
|
+
}, bi = 50, xi = 2e3;
|
|
6581
|
+
function Si() {
|
|
6174
6582
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6175
6583
|
}
|
|
6176
|
-
function
|
|
6584
|
+
function Ci(e, t) {
|
|
6177
6585
|
let n = e?.data ?? {}, r = [];
|
|
6178
6586
|
for (let e of Object.values(n)) {
|
|
6179
|
-
let t = e == null ? "" :
|
|
6180
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6587
|
+
let t = e == null ? "" : ot(e);
|
|
6588
|
+
if (t && r.push(t), r.join(" ").length > xi) break;
|
|
6181
6589
|
}
|
|
6182
|
-
return r.join(" ").slice(0,
|
|
6590
|
+
return r.join(" ").slice(0, xi).toLocaleLowerCase(t || void 0);
|
|
6183
6591
|
}
|
|
6184
|
-
function
|
|
6185
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
6592
|
+
function wi({ 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 }) {
|
|
6593
|
+
let { tenant: b, apiUrl: x, locale: S } = i(Q), [C, w] = l(() => Si()), [T, E] = l(() => Si()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
6186
6594
|
a(() => {
|
|
6187
6595
|
let e = () => {
|
|
6188
|
-
let e =
|
|
6596
|
+
let e = Si();
|
|
6189
6597
|
w(e), E(e);
|
|
6190
6598
|
};
|
|
6191
6599
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6236,8 +6644,8 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6236
6644
|
});
|
|
6237
6645
|
}
|
|
6238
6646
|
else for (let t of e.rows) {
|
|
6239
|
-
if (!
|
|
6240
|
-
let n = t?.data ?? {}, r =
|
|
6647
|
+
if (!Ci(t, S).includes(N)) continue;
|
|
6648
|
+
let n = t?.data ?? {}, r = ot(n.name) || "Untitled", i = ot(n.slug);
|
|
6241
6649
|
F.push({
|
|
6242
6650
|
key: `entry:${t.id}`,
|
|
6243
6651
|
title: r,
|
|
@@ -6245,7 +6653,7 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6245
6653
|
kind: "entry"
|
|
6246
6654
|
});
|
|
6247
6655
|
}
|
|
6248
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6656
|
+
let I = F.slice(0, Math.min(Math.max(1, p), bi)), L = (e) => {
|
|
6249
6657
|
if (v) {
|
|
6250
6658
|
e.preventDefault(), w(T), A(!0);
|
|
6251
6659
|
return;
|
|
@@ -6327,7 +6735,7 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6327
6735
|
onChange: (e) => E(e.target.value),
|
|
6328
6736
|
onFocus: () => N && A(!0),
|
|
6329
6737
|
style: {
|
|
6330
|
-
...
|
|
6738
|
+
...kn,
|
|
6331
6739
|
flexGrow: 1,
|
|
6332
6740
|
minWidth: 0
|
|
6333
6741
|
}
|
|
@@ -6385,21 +6793,21 @@ function Lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6385
6793
|
}
|
|
6386
6794
|
//#endregion
|
|
6387
6795
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6388
|
-
function
|
|
6796
|
+
function Ti(e) {
|
|
6389
6797
|
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());
|
|
6390
6798
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6391
6799
|
}
|
|
6392
|
-
var
|
|
6393
|
-
function
|
|
6800
|
+
var Ei = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6801
|
+
function Di(e, t) {
|
|
6394
6802
|
let n = String(e ?? "").toUpperCase();
|
|
6395
6803
|
if (t === "code") return n;
|
|
6396
6804
|
let r = "";
|
|
6397
6805
|
try {
|
|
6398
|
-
r =
|
|
6806
|
+
r = Ei(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6399
6807
|
} catch {}
|
|
6400
6808
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6401
6809
|
}
|
|
6402
|
-
function
|
|
6810
|
+
function Oi(e, t) {
|
|
6403
6811
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6404
6812
|
if (typeof window > "u") return n || "?";
|
|
6405
6813
|
try {
|
|
@@ -6409,8 +6817,8 @@ function Vr(e, t) {
|
|
|
6409
6817
|
return n || "/";
|
|
6410
6818
|
}
|
|
6411
6819
|
}
|
|
6412
|
-
function
|
|
6413
|
-
let c = i(
|
|
6820
|
+
function ki({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
6821
|
+
let c = i(Q), l = Ti(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
6414
6822
|
display: "inline-flex",
|
|
6415
6823
|
alignItems: "center",
|
|
6416
6824
|
gap: 8,
|
|
@@ -6445,7 +6853,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6445
6853
|
style: { opacity: .4 },
|
|
6446
6854
|
children: n ?? "·"
|
|
6447
6855
|
}), /* @__PURE__ */ d("a", {
|
|
6448
|
-
href:
|
|
6856
|
+
href: Oi(e, e === u),
|
|
6449
6857
|
hrefLang: e,
|
|
6450
6858
|
"aria-current": e === p ? "true" : void 0,
|
|
6451
6859
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6455,7 +6863,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6455
6863
|
textDecoration: "none",
|
|
6456
6864
|
cursor: s ? "default" : "pointer"
|
|
6457
6865
|
},
|
|
6458
|
-
children:
|
|
6866
|
+
children: Di(e, t)
|
|
6459
6867
|
})]
|
|
6460
6868
|
}, e))]
|
|
6461
6869
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -6466,7 +6874,7 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6466
6874
|
value: p,
|
|
6467
6875
|
onChange: s ? void 0 : (e) => {
|
|
6468
6876
|
let t = e.target.value;
|
|
6469
|
-
window.location.assign(
|
|
6877
|
+
window.location.assign(Oi(t, t === u));
|
|
6470
6878
|
},
|
|
6471
6879
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6472
6880
|
style: {
|
|
@@ -6480,47 +6888,47 @@ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
6480
6888
|
},
|
|
6481
6889
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
6482
6890
|
value: e,
|
|
6483
|
-
children:
|
|
6891
|
+
children: Di(e, t)
|
|
6484
6892
|
}, e))
|
|
6485
6893
|
})]
|
|
6486
6894
|
});
|
|
6487
6895
|
}
|
|
6488
6896
|
//#endregion
|
|
6489
6897
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6490
|
-
var
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
],
|
|
6496
|
-
SiteLoginForm:
|
|
6497
|
-
SiteAccountMenu:
|
|
6498
|
-
SiteLanguagePicker:
|
|
6499
|
-
CookieConsent:
|
|
6500
|
-
SiteSearch:
|
|
6898
|
+
var Ai = [
|
|
6899
|
+
$r,
|
|
6900
|
+
vi,
|
|
6901
|
+
di,
|
|
6902
|
+
yi
|
|
6903
|
+
], ji = {
|
|
6904
|
+
SiteLoginForm: li,
|
|
6905
|
+
SiteAccountMenu: ui,
|
|
6906
|
+
SiteLanguagePicker: ki,
|
|
6907
|
+
CookieConsent: _i,
|
|
6908
|
+
SiteSearch: wi
|
|
6501
6909
|
};
|
|
6502
|
-
new Set(
|
|
6910
|
+
new Set(Ai.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6503
6911
|
//#endregion
|
|
6504
6912
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6505
|
-
var
|
|
6913
|
+
var Mi = "0.185.1", Ni = "4.2.0", Pi = "https://cdn.jsdelivr.net/npm", Fi = `${Pi}/three@${Mi}/+esm`, Ii = `${Pi}/@google/model-viewer@${Ni}/dist/model-viewer.min.js`, Li = (e) => import(
|
|
6506
6914
|
/* @vite-ignore */
|
|
6507
6915
|
/* webpackIgnore: true */
|
|
6508
6916
|
e
|
|
6509
|
-
),
|
|
6510
|
-
function
|
|
6511
|
-
if (
|
|
6917
|
+
), Ri = /* @__PURE__ */ new Map();
|
|
6918
|
+
function zi(e) {
|
|
6919
|
+
if (Ri.has(e)) return Ri.get(e);
|
|
6512
6920
|
if (typeof window > "u") return new Promise(() => {});
|
|
6513
|
-
let t =
|
|
6514
|
-
throw
|
|
6921
|
+
let t = Li(e).catch((t) => {
|
|
6922
|
+
throw Ri.delete(e), t;
|
|
6515
6923
|
});
|
|
6516
|
-
return
|
|
6924
|
+
return Ri.set(e, t), t;
|
|
6517
6925
|
}
|
|
6518
|
-
var
|
|
6519
|
-
function
|
|
6520
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6926
|
+
var Bi = () => zi(Fi), Vi = (e) => zi(`${Pi}/three@${Mi}/examples/jsm/${e}/+esm`);
|
|
6927
|
+
function Hi() {
|
|
6928
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : zi(Ii);
|
|
6521
6929
|
}
|
|
6522
|
-
var
|
|
6523
|
-
function
|
|
6930
|
+
var Ui = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Wi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6931
|
+
function Gi(e, t) {
|
|
6524
6932
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6525
6933
|
n = requestAnimationFrame(o), i ||= e;
|
|
6526
6934
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6539,7 +6947,7 @@ function ii(e, t) {
|
|
|
6539
6947
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6540
6948
|
};
|
|
6541
6949
|
}
|
|
6542
|
-
function
|
|
6950
|
+
function Ki(e, t, n = {}) {
|
|
6543
6951
|
let r = {
|
|
6544
6952
|
radius: n.distance ?? 4,
|
|
6545
6953
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6588,13 +6996,13 @@ function ai(e, t, n = {}) {
|
|
|
6588
6996
|
}
|
|
6589
6997
|
//#endregion
|
|
6590
6998
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6591
|
-
var
|
|
6592
|
-
function
|
|
6999
|
+
var qi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ji = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Yi = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Xi = (e) => typeof e == "string" && !!e.trim();
|
|
7000
|
+
function Zi({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6593
7001
|
return /* @__PURE__ */ f("div", {
|
|
6594
7002
|
ref: r,
|
|
6595
7003
|
style: {
|
|
6596
7004
|
...P(i),
|
|
6597
|
-
minHeight:
|
|
7005
|
+
minHeight: qi(n, 320),
|
|
6598
7006
|
display: "flex",
|
|
6599
7007
|
flexDirection: "column",
|
|
6600
7008
|
alignItems: "center",
|
|
@@ -6603,7 +7011,7 @@ function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6603
7011
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
6604
7012
|
borderRadius: 10,
|
|
6605
7013
|
background: "rgba(148,163,184,.08)",
|
|
6606
|
-
...
|
|
7014
|
+
...oe,
|
|
6607
7015
|
color: "rgba(100,116,139,.95)",
|
|
6608
7016
|
fontSize: 13,
|
|
6609
7017
|
textAlign: "center",
|
|
@@ -6622,24 +7030,24 @@ function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6622
7030
|
}) : null]
|
|
6623
7031
|
});
|
|
6624
7032
|
}
|
|
6625
|
-
function
|
|
7033
|
+
function Qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6626
7034
|
let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
|
|
6627
7035
|
a(() => {
|
|
6628
7036
|
if (y || !e) return;
|
|
6629
7037
|
let t = !0;
|
|
6630
|
-
return
|
|
7038
|
+
return Hi().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6631
7039
|
t = !1;
|
|
6632
7040
|
};
|
|
6633
7041
|
}, [y, e]);
|
|
6634
7042
|
let C = {
|
|
6635
7043
|
display: "block",
|
|
6636
7044
|
width: "100%",
|
|
6637
|
-
minHeight:
|
|
6638
|
-
height:
|
|
7045
|
+
minHeight: qi(r, 360),
|
|
7046
|
+
height: qi(r, 360),
|
|
6639
7047
|
backgroundColor: i || "transparent",
|
|
6640
7048
|
...P(g)
|
|
6641
7049
|
};
|
|
6642
|
-
if (!e) return v ? /* @__PURE__ */ d(
|
|
7050
|
+
if (!e) return v ? /* @__PURE__ */ d(Zi, {
|
|
6643
7051
|
nodeRef: _,
|
|
6644
7052
|
style: g,
|
|
6645
7053
|
height: r,
|
|
@@ -6674,13 +7082,13 @@ function di({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6674
7082
|
poster: t || void 0,
|
|
6675
7083
|
style: C,
|
|
6676
7084
|
"camera-controls": w(!v && c !== !1),
|
|
6677
|
-
"auto-rotate": w(T && !
|
|
6678
|
-
"auto-rotate-delay": T ? String(
|
|
7085
|
+
"auto-rotate": w(T && !Ui()),
|
|
7086
|
+
"auto-rotate-delay": T ? String(qi(s, 0)) : void 0,
|
|
6679
7087
|
"rotation-per-second": "18deg",
|
|
6680
7088
|
ar: w(!v && u === !0),
|
|
6681
7089
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6682
|
-
"shadow-intensity": String(
|
|
6683
|
-
exposure: String(
|
|
7090
|
+
"shadow-intensity": String(Ji(p, 100)),
|
|
7091
|
+
exposure: String(Ji(f, 100)),
|
|
6684
7092
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6685
7093
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6686
7094
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6698,7 +7106,7 @@ function di({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
|
|
|
6698
7106
|
}) : null
|
|
6699
7107
|
});
|
|
6700
7108
|
}
|
|
6701
|
-
var
|
|
7109
|
+
var $i = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ea = [
|
|
6702
7110
|
"precision highp float;",
|
|
6703
7111
|
"uniform vec2 u_res;",
|
|
6704
7112
|
"uniform float u_time;",
|
|
@@ -6721,7 +7129,7 @@ var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6721
7129
|
" return v;",
|
|
6722
7130
|
"}",
|
|
6723
7131
|
""
|
|
6724
|
-
].join("\n"),
|
|
7132
|
+
].join("\n"), ta = {
|
|
6725
7133
|
gradient: [
|
|
6726
7134
|
"void main(){",
|
|
6727
7135
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6773,7 +7181,7 @@ var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6773
7181
|
"}"
|
|
6774
7182
|
].join("\n")
|
|
6775
7183
|
};
|
|
6776
|
-
function
|
|
7184
|
+
function na(e, t) {
|
|
6777
7185
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6778
7186
|
if (!n) return t;
|
|
6779
7187
|
let r = parseInt(n[1], 16);
|
|
@@ -6783,7 +7191,7 @@ function hi(e, t) {
|
|
|
6783
7191
|
(r & 255) / 255
|
|
6784
7192
|
];
|
|
6785
7193
|
}
|
|
6786
|
-
function
|
|
7194
|
+
function ra(e, t, n) {
|
|
6787
7195
|
let r = e.createShader(t);
|
|
6788
7196
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6789
7197
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6791,13 +7199,13 @@ function gi(e, t, n) {
|
|
|
6791
7199
|
}
|
|
6792
7200
|
return r;
|
|
6793
7201
|
}
|
|
6794
|
-
function
|
|
7202
|
+
function ia({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6795
7203
|
let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
|
|
6796
7204
|
a(() => () => {
|
|
6797
7205
|
let e = y.current;
|
|
6798
7206
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6799
7207
|
}, []);
|
|
6800
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7208
|
+
let S = typeof t == "string" && t.trim() ? t : ta[e] ?? ta.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ji(o, 100), D = Math.max(.05, Ji(s, 100));
|
|
6801
7209
|
return a(() => {
|
|
6802
7210
|
let e = _.current, t = v.current;
|
|
6803
7211
|
if (!e || !t) return;
|
|
@@ -6812,7 +7220,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6812
7220
|
}
|
|
6813
7221
|
let r = null;
|
|
6814
7222
|
try {
|
|
6815
|
-
let e =
|
|
7223
|
+
let e = ra(n, n.VERTEX_SHADER, $i), t = ra(n, n.FRAGMENT_SHADER, ea + S);
|
|
6816
7224
|
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
6817
7225
|
x("");
|
|
6818
7226
|
} catch (e) {
|
|
@@ -6848,28 +7256,28 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6848
7256
|
};
|
|
6849
7257
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6850
7258
|
let u = () => {
|
|
6851
|
-
let r =
|
|
7259
|
+
let r = Wi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6852
7260
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6853
7261
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6854
7262
|
d?.observe(t), u();
|
|
6855
|
-
let f =
|
|
6856
|
-
a:
|
|
7263
|
+
let f = Ui(), m = {
|
|
7264
|
+
a: na(C, [
|
|
6857
7265
|
.35,
|
|
6858
7266
|
.4,
|
|
6859
7267
|
.95
|
|
6860
7268
|
]),
|
|
6861
|
-
b:
|
|
7269
|
+
b: na(w, [
|
|
6862
7270
|
.05,
|
|
6863
7271
|
.06,
|
|
6864
7272
|
.16
|
|
6865
7273
|
]),
|
|
6866
|
-
c:
|
|
7274
|
+
c: na(T, [
|
|
6867
7275
|
.95,
|
|
6868
7276
|
.35,
|
|
6869
7277
|
.6
|
|
6870
7278
|
])
|
|
6871
7279
|
}, h = {};
|
|
6872
|
-
return h.stop =
|
|
7280
|
+
return h.stop = Gi(t, (t, r) => {
|
|
6873
7281
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6874
7282
|
}), () => {
|
|
6875
7283
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6888,7 +7296,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6888
7296
|
},
|
|
6889
7297
|
style: {
|
|
6890
7298
|
position: "relative",
|
|
6891
|
-
minHeight:
|
|
7299
|
+
minHeight: qi(u, 320),
|
|
6892
7300
|
overflow: "hidden",
|
|
6893
7301
|
...P(m)
|
|
6894
7302
|
},
|
|
@@ -6910,7 +7318,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6910
7318
|
justifyContent: "center",
|
|
6911
7319
|
padding: 12,
|
|
6912
7320
|
background: "rgba(15,23,42,.75)",
|
|
6913
|
-
...
|
|
7321
|
+
...oe,
|
|
6914
7322
|
color: "#fecaca",
|
|
6915
7323
|
fontSize: 11,
|
|
6916
7324
|
whiteSpace: "pre-wrap",
|
|
@@ -6920,7 +7328,7 @@ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
|
|
|
6920
7328
|
}) : null]
|
|
6921
7329
|
});
|
|
6922
7330
|
}
|
|
6923
|
-
function
|
|
7331
|
+
function aa(e, t) {
|
|
6924
7332
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6925
7333
|
r.deleteAttribute("uv");
|
|
6926
7334
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6936,23 +7344,23 @@ function vi(e, t) {
|
|
|
6936
7344
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6937
7345
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6938
7346
|
}
|
|
6939
|
-
var
|
|
6940
|
-
function
|
|
6941
|
-
if (
|
|
6942
|
-
let t =
|
|
7347
|
+
var oa = /* @__PURE__ */ new Map();
|
|
7348
|
+
function sa(e) {
|
|
7349
|
+
if (oa.has(e)) return oa.get(e);
|
|
7350
|
+
let t = Vi("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6943
7351
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6944
7352
|
})).catch((t) => {
|
|
6945
|
-
throw
|
|
7353
|
+
throw oa.delete(e), t;
|
|
6946
7354
|
});
|
|
6947
|
-
return
|
|
7355
|
+
return oa.set(e, t), t;
|
|
6948
7356
|
}
|
|
6949
|
-
function
|
|
7357
|
+
function ca(e, t) {
|
|
6950
7358
|
let n = new e.Box3().setFromObject(t);
|
|
6951
7359
|
if (n.isEmpty()) return t;
|
|
6952
7360
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
6953
7361
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6954
7362
|
}
|
|
6955
|
-
var
|
|
7363
|
+
var la = {
|
|
6956
7364
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6957
7365
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6958
7366
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6961,50 +7369,50 @@ var Si = {
|
|
|
6961
7369
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6962
7370
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6963
7371
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6964
|
-
},
|
|
6965
|
-
function
|
|
6966
|
-
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
7372
|
+
}, ua = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7373
|
+
function da({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7374
|
+
let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ui(), S = s !== !1 && !h;
|
|
6967
7375
|
return a(() => {
|
|
6968
7376
|
let e = g.current;
|
|
6969
7377
|
if (!e) return;
|
|
6970
7378
|
let i = !0, a = null;
|
|
6971
|
-
return
|
|
7379
|
+
return Bi().then((s) => {
|
|
6972
7380
|
if (!i || !e) return;
|
|
6973
7381
|
let c = new s.WebGLRenderer({
|
|
6974
7382
|
antialias: !0,
|
|
6975
7383
|
alpha: !t
|
|
6976
7384
|
});
|
|
6977
|
-
c.setPixelRatio(
|
|
7385
|
+
c.setPixelRatio(Wi()), c.shadowMap.enabled = u !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
6978
7386
|
let l = new s.Scene();
|
|
6979
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6980
|
-
let d = new s.PerspectiveCamera(
|
|
6981
|
-
distance:
|
|
7387
|
+
t && (l.background = new s.Color(t)), l.environment = aa(s, c);
|
|
7388
|
+
let d = new s.PerspectiveCamera(ua(r, 45), 1, .1, 400), f = Ki(d, c.domElement, {
|
|
7389
|
+
distance: ua(n, 5),
|
|
6982
7390
|
enableZoom: S
|
|
6983
7391
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6984
7392
|
p.position.set(4, 7, 5), p.castShadow = u !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
6985
7393
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6986
|
-
let n =
|
|
6987
|
-
e.position.set(
|
|
7394
|
+
let n = ua(t.scale, 1);
|
|
7395
|
+
e.position.set(ua(t.x, 0), ua(t.y, 0), ua(t.z, 0)), e.rotation.set(Yi(t.rx), Yi(t.ry), Yi(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Yi(t.spin);
|
|
6988
7396
|
};
|
|
6989
7397
|
for (let e of y) {
|
|
6990
7398
|
if (e.shape === "model") {
|
|
6991
|
-
if (!
|
|
7399
|
+
if (!Xi(e.src)) continue;
|
|
6992
7400
|
let t = new s.Group();
|
|
6993
|
-
g(t, e), h.add(t),
|
|
7401
|
+
g(t, e), h.add(t), sa(e.src).then((e) => {
|
|
6994
7402
|
if (!i) return;
|
|
6995
|
-
let n =
|
|
7403
|
+
let n = ca(s, e.clone(!0));
|
|
6996
7404
|
n.traverse((e) => {
|
|
6997
7405
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6998
7406
|
}), t.add(n);
|
|
6999
7407
|
}, () => {});
|
|
7000
7408
|
continue;
|
|
7001
7409
|
}
|
|
7002
|
-
let t = (
|
|
7410
|
+
let t = (la[e.shape] ?? la.box)(s), n = new s.MeshStandardMaterial({
|
|
7003
7411
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
7004
|
-
metalness: Math.min(1, Math.max(0,
|
|
7005
|
-
roughness: Math.min(1, Math.max(0,
|
|
7006
|
-
transparent:
|
|
7007
|
-
opacity: Math.min(1, Math.max(0,
|
|
7412
|
+
metalness: Math.min(1, Math.max(0, Ji(e.metalness, 10))),
|
|
7413
|
+
roughness: Math.min(1, Math.max(0, Ji(e.roughness, 35))),
|
|
7414
|
+
transparent: Ji(e.opacity, 100) < 1,
|
|
7415
|
+
opacity: Math.min(1, Math.max(0, Ji(e.opacity, 100))),
|
|
7008
7416
|
flatShading: e.flat === !0,
|
|
7009
7417
|
wireframe: e.wireframe === !0,
|
|
7010
7418
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -7015,14 +7423,14 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7015
7423
|
let _ = null;
|
|
7016
7424
|
if (u !== !1) {
|
|
7017
7425
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
7018
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7426
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = ua(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
7019
7427
|
}
|
|
7020
7428
|
let v = () => {
|
|
7021
7429
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
7022
7430
|
c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
7023
7431
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
7024
7432
|
b?.observe(e), v();
|
|
7025
|
-
let C =
|
|
7433
|
+
let C = Yi(Number.isFinite(Number(o)) ? o : 20), w = Gi(e, (e) => {
|
|
7026
7434
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
7027
7435
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
7028
7436
|
c.render(l, d);
|
|
@@ -7046,7 +7454,7 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7046
7454
|
o,
|
|
7047
7455
|
S,
|
|
7048
7456
|
u
|
|
7049
|
-
]), _ && h ? /* @__PURE__ */ d(
|
|
7457
|
+
]), _ && h ? /* @__PURE__ */ d(Zi, {
|
|
7050
7458
|
nodeRef: m,
|
|
7051
7459
|
style: p,
|
|
7052
7460
|
height: f,
|
|
@@ -7057,27 +7465,27 @@ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7057
7465
|
g.current = e, typeof m == "function" && m(e);
|
|
7058
7466
|
},
|
|
7059
7467
|
style: {
|
|
7060
|
-
minHeight:
|
|
7061
|
-
height:
|
|
7468
|
+
minHeight: qi(f, 380),
|
|
7469
|
+
height: qi(f, 380),
|
|
7062
7470
|
overflow: "hidden",
|
|
7063
7471
|
touchAction: S ? "pan-y" : void 0,
|
|
7064
7472
|
...P(p)
|
|
7065
7473
|
}
|
|
7066
7474
|
});
|
|
7067
7475
|
}
|
|
7068
|
-
function
|
|
7476
|
+
function fa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
|
|
7069
7477
|
let s = c(null), [u, f] = l("");
|
|
7070
7478
|
return a(() => {
|
|
7071
7479
|
let t = s.current;
|
|
7072
7480
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
7073
7481
|
let r = !0, i = null;
|
|
7074
|
-
return
|
|
7482
|
+
return Bi().then((a) => {
|
|
7075
7483
|
if (!r || !t) return;
|
|
7076
7484
|
let o = new a.WebGLRenderer({
|
|
7077
7485
|
antialias: !0,
|
|
7078
7486
|
alpha: !n
|
|
7079
7487
|
});
|
|
7080
|
-
o.setPixelRatio(
|
|
7488
|
+
o.setPixelRatio(Wi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
7081
7489
|
let s = new a.Scene();
|
|
7082
7490
|
n && (s.background = new a.Color(n));
|
|
7083
7491
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -7100,7 +7508,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7100
7508
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
7101
7509
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7102
7510
|
d?.observe(t), u();
|
|
7103
|
-
let p = !1, m =
|
|
7511
|
+
let p = !1, m = Gi(t, (e, t) => {
|
|
7104
7512
|
if (!p && typeof l?.frame == "function") try {
|
|
7105
7513
|
l.frame(e, t);
|
|
7106
7514
|
} catch (e) {
|
|
@@ -7122,7 +7530,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7122
7530
|
e,
|
|
7123
7531
|
o,
|
|
7124
7532
|
n
|
|
7125
|
-
]), o ? /* @__PURE__ */ d(
|
|
7533
|
+
]), o ? /* @__PURE__ */ d(Zi, {
|
|
7126
7534
|
nodeRef: i,
|
|
7127
7535
|
style: r,
|
|
7128
7536
|
height: t,
|
|
@@ -7133,8 +7541,8 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7133
7541
|
s.current = e, typeof i == "function" && i(e);
|
|
7134
7542
|
},
|
|
7135
7543
|
style: {
|
|
7136
|
-
minHeight:
|
|
7137
|
-
height:
|
|
7544
|
+
minHeight: qi(t, 380),
|
|
7545
|
+
height: qi(t, 380),
|
|
7138
7546
|
overflow: "hidden",
|
|
7139
7547
|
position: "relative",
|
|
7140
7548
|
touchAction: "pan-y",
|
|
@@ -7149,7 +7557,7 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7149
7557
|
padding: "6px 8px",
|
|
7150
7558
|
borderRadius: 6,
|
|
7151
7559
|
background: "rgba(127,29,29,.85)",
|
|
7152
|
-
...
|
|
7560
|
+
...oe,
|
|
7153
7561
|
color: "#fee2e2",
|
|
7154
7562
|
fontSize: 11
|
|
7155
7563
|
},
|
|
@@ -7157,40 +7565,40 @@ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
|
|
|
7157
7565
|
}) : null
|
|
7158
7566
|
});
|
|
7159
7567
|
}
|
|
7160
|
-
var
|
|
7161
|
-
ModelViewerBlock:
|
|
7162
|
-
ShaderBlock:
|
|
7163
|
-
SceneBlock:
|
|
7164
|
-
ThreeCanvasBlock:
|
|
7165
|
-
},
|
|
7166
|
-
function
|
|
7167
|
-
if (
|
|
7568
|
+
var pa = {
|
|
7569
|
+
ModelViewerBlock: Qi,
|
|
7570
|
+
ShaderBlock: ia,
|
|
7571
|
+
SceneBlock: da,
|
|
7572
|
+
ThreeCanvasBlock: fa
|
|
7573
|
+
}, ma = /* @__PURE__ */ new Map();
|
|
7574
|
+
function ha(e) {
|
|
7575
|
+
if (ma.has(e)) return ma.get(e);
|
|
7168
7576
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7169
7577
|
/* @vite-ignore */
|
|
7170
7578
|
/* webpackIgnore: true */
|
|
7171
7579
|
t
|
|
7172
7580
|
).finally(() => URL.revokeObjectURL(t));
|
|
7173
|
-
return
|
|
7581
|
+
return ma.set(e, n), n;
|
|
7174
7582
|
}
|
|
7175
|
-
function
|
|
7583
|
+
function ga(e) {
|
|
7176
7584
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7177
7585
|
return n && typeof n == "object" ? n : {};
|
|
7178
7586
|
}
|
|
7179
7587
|
//#endregion
|
|
7180
7588
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7181
|
-
async function
|
|
7182
|
-
let n = await
|
|
7589
|
+
async function _a(e, t) {
|
|
7590
|
+
let n = await ha(e);
|
|
7183
7591
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7184
7592
|
}
|
|
7185
|
-
var
|
|
7593
|
+
var va = {
|
|
7186
7594
|
padding: "10px 12px",
|
|
7187
7595
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7188
7596
|
borderRadius: 8,
|
|
7189
7597
|
fontSize: 12,
|
|
7190
7598
|
opacity: .6
|
|
7191
7599
|
};
|
|
7192
|
-
function
|
|
7193
|
-
let s = i(
|
|
7600
|
+
function ya({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
7601
|
+
let s = i(Q), l = ga(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
7194
7602
|
tenant: s?.tenant ?? "",
|
|
7195
7603
|
apiUrl: s?.apiUrl ?? "/api",
|
|
7196
7604
|
locale: s?.locale ?? "",
|
|
@@ -7202,7 +7610,7 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7202
7610
|
let e = u.current;
|
|
7203
7611
|
if (!l?.code || !e) return;
|
|
7204
7612
|
let n = !0;
|
|
7205
|
-
return
|
|
7613
|
+
return _a(l.code, t).then((e) => {
|
|
7206
7614
|
if (!(!n || !e || !u.current)) {
|
|
7207
7615
|
p.current = e;
|
|
7208
7616
|
try {
|
|
@@ -7232,7 +7640,7 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7232
7640
|
}) : /* @__PURE__ */ f("div", {
|
|
7233
7641
|
ref: o,
|
|
7234
7642
|
style: {
|
|
7235
|
-
...
|
|
7643
|
+
...va,
|
|
7236
7644
|
...P(r)
|
|
7237
7645
|
},
|
|
7238
7646
|
children: [
|
|
@@ -7244,13 +7652,13 @@ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
7244
7652
|
}
|
|
7245
7653
|
//#endregion
|
|
7246
7654
|
//#region ../ui/src/components/builder/render.jsx
|
|
7247
|
-
var
|
|
7248
|
-
...
|
|
7249
|
-
...
|
|
7250
|
-
...
|
|
7251
|
-
PluginBlock:
|
|
7655
|
+
var ba = {
|
|
7656
|
+
...Qr,
|
|
7657
|
+
...ji,
|
|
7658
|
+
...pa,
|
|
7659
|
+
PluginBlock: ya
|
|
7252
7660
|
};
|
|
7253
|
-
function
|
|
7661
|
+
function xa(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7254
7662
|
let o = n[e];
|
|
7255
7663
|
if (!o || o.hidden) return null;
|
|
7256
7664
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7258,11 +7666,11 @@ function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7258
7666
|
let n = o.props?.componentId, s = r?.[n];
|
|
7259
7667
|
if (!s?.template || i.has(n)) return null;
|
|
7260
7668
|
let c = new Set(i).add(n);
|
|
7261
|
-
return /* @__PURE__ */ d(t, { children:
|
|
7669
|
+
return /* @__PURE__ */ d(t, { children: xa(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
7262
7670
|
}
|
|
7263
|
-
let l =
|
|
7671
|
+
let l = ba[s];
|
|
7264
7672
|
if (!l) return null;
|
|
7265
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
7673
|
+
let u = (o.nodes ?? []).map((e) => xa(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, xa(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
7266
7674
|
...c,
|
|
7267
7675
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7268
7676
|
linked: p,
|
|
@@ -7271,16 +7679,16 @@ function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7271
7679
|
},
|
|
7272
7680
|
children: u.length ? u : void 0
|
|
7273
7681
|
}, e);
|
|
7274
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
7682
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(ci, {
|
|
7275
7683
|
when: c.when,
|
|
7276
7684
|
children: m
|
|
7277
7685
|
}, e) : m;
|
|
7278
7686
|
}
|
|
7279
7687
|
//#endregion
|
|
7280
7688
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7281
|
-
var
|
|
7282
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7283
|
-
function
|
|
7689
|
+
var Sa = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ca = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ge(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7690
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(Ge(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7691
|
+
function wa({ 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 }) {
|
|
7284
7692
|
let y = o?.js?.trim();
|
|
7285
7693
|
if (a(() => {
|
|
7286
7694
|
if (!y) return;
|
|
@@ -7294,35 +7702,35 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7294
7702
|
minHeight: "100%",
|
|
7295
7703
|
display: "flex",
|
|
7296
7704
|
flexDirection: "column"
|
|
7297
|
-
}, w =
|
|
7705
|
+
}, w = xa("ROOT", e, n), T = s(() => ({ render: (t, r) => xa(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ae(e, n), O = ie(e, n), k = o?.css?.trim(), j = S(c), M = We(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ve[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
7298
7706
|
rel: "stylesheet",
|
|
7299
7707
|
precedence: "default",
|
|
7300
7708
|
href: D(e)
|
|
7301
|
-
}, e)), F =
|
|
7302
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
7709
|
+
}, e)), F = Ca(M);
|
|
7710
|
+
return r === "auto" ? /* @__PURE__ */ d(Q.Provider, {
|
|
7303
7711
|
value: {
|
|
7304
7712
|
tenant: l || "",
|
|
7305
7713
|
apiUrl: u || "/api",
|
|
7306
7714
|
locale: m || "",
|
|
7307
7715
|
settings: _ ?? null
|
|
7308
7716
|
},
|
|
7309
|
-
children: /* @__PURE__ */ d(
|
|
7717
|
+
children: /* @__PURE__ */ d(si, {
|
|
7310
7718
|
initialUser: v,
|
|
7311
|
-
children: /* @__PURE__ */ d(
|
|
7719
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7312
7720
|
value: p ?? null,
|
|
7313
|
-
children: /* @__PURE__ */ d(
|
|
7721
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7314
7722
|
value: T,
|
|
7315
7723
|
children: /* @__PURE__ */ f("div", {
|
|
7316
7724
|
...b,
|
|
7317
7725
|
className: "webim-page",
|
|
7318
7726
|
style: {
|
|
7319
7727
|
...C,
|
|
7320
|
-
...
|
|
7728
|
+
...Ke(t),
|
|
7321
7729
|
...i
|
|
7322
7730
|
},
|
|
7323
7731
|
children: [
|
|
7324
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
7325
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7732
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Sa(Ge(M.light))} }
|
|
7733
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Sa(Ge(M.dark))} } }` }),
|
|
7326
7734
|
/* @__PURE__ */ d("style", { children: F }),
|
|
7327
7735
|
P,
|
|
7328
7736
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -7335,25 +7743,25 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7335
7743
|
})
|
|
7336
7744
|
})
|
|
7337
7745
|
})
|
|
7338
|
-
}) : /* @__PURE__ */ d(
|
|
7746
|
+
}) : /* @__PURE__ */ d(Q.Provider, {
|
|
7339
7747
|
value: {
|
|
7340
7748
|
tenant: l || "",
|
|
7341
7749
|
apiUrl: u || "/api",
|
|
7342
7750
|
locale: m || "",
|
|
7343
7751
|
settings: _ ?? null
|
|
7344
7752
|
},
|
|
7345
|
-
children: /* @__PURE__ */ d(
|
|
7753
|
+
children: /* @__PURE__ */ d(si, {
|
|
7346
7754
|
initialUser: v,
|
|
7347
|
-
children: /* @__PURE__ */ d(
|
|
7755
|
+
children: /* @__PURE__ */ d(Qe.Provider, {
|
|
7348
7756
|
value: p ?? null,
|
|
7349
|
-
children: /* @__PURE__ */ d(
|
|
7757
|
+
children: /* @__PURE__ */ d(nt.Provider, {
|
|
7350
7758
|
value: T,
|
|
7351
7759
|
children: /* @__PURE__ */ f("div", {
|
|
7352
7760
|
...b,
|
|
7353
7761
|
className: "webim-page",
|
|
7354
7762
|
style: {
|
|
7355
7763
|
...C,
|
|
7356
|
-
...
|
|
7764
|
+
...Ye(t, r),
|
|
7357
7765
|
...i
|
|
7358
7766
|
},
|
|
7359
7767
|
children: [
|
|
@@ -7375,8 +7783,8 @@ function Li({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
7375
7783
|
}
|
|
7376
7784
|
//#endregion
|
|
7377
7785
|
//#region src/WebimContent.jsx
|
|
7378
|
-
function
|
|
7379
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
7786
|
+
function Ta({ bundle: e, mode: t = "auto", style: n }) {
|
|
7787
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(wa, {
|
|
7380
7788
|
blocks: e.blocks,
|
|
7381
7789
|
theme: e.theme,
|
|
7382
7790
|
components: e.components,
|
|
@@ -7388,13 +7796,13 @@ function Ri({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7388
7796
|
locale: e.locale,
|
|
7389
7797
|
direction: e.direction,
|
|
7390
7798
|
settings: e.settings,
|
|
7391
|
-
mode:
|
|
7799
|
+
mode: Ze(t, e.scheme),
|
|
7392
7800
|
style: n
|
|
7393
7801
|
}) : null;
|
|
7394
7802
|
}
|
|
7395
7803
|
//#endregion
|
|
7396
7804
|
//#region src/bundle.js
|
|
7397
|
-
function
|
|
7805
|
+
function Ea({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
7398
7806
|
let a = {
|
|
7399
7807
|
...t?.global ?? {},
|
|
7400
7808
|
...t?.tenant ?? {}
|
|
@@ -7404,7 +7812,7 @@ function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7404
7812
|
title: e.title,
|
|
7405
7813
|
slug: e.slug,
|
|
7406
7814
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
7407
|
-
theme:
|
|
7815
|
+
theme: Xe(o, a.builder_themes?.themes),
|
|
7408
7816
|
components: a.builder_components?.components ?? {},
|
|
7409
7817
|
custom: o.custom,
|
|
7410
7818
|
animations: o.animations,
|
|
@@ -7420,18 +7828,18 @@ function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
7420
7828
|
}
|
|
7421
7829
|
//#endregion
|
|
7422
7830
|
//#region src/fetchPage.js
|
|
7423
|
-
var
|
|
7831
|
+
var Da = async (e) => {
|
|
7424
7832
|
let t = await e.json().catch(() => null);
|
|
7425
7833
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
7426
7834
|
return t?.payload ?? t;
|
|
7427
7835
|
};
|
|
7428
|
-
async function
|
|
7836
|
+
async function Oa({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
7429
7837
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
7430
7838
|
if (!n) throw Error("fetchPage: slug is required");
|
|
7431
7839
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
7432
7840
|
...t ? { "x-tenant": t } : {},
|
|
7433
7841
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
7434
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
7842
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Da), c(`${l}/settings/public`, { headers: u }).then(Da)]), p = Ea({
|
|
7435
7843
|
page: d,
|
|
7436
7844
|
settings: f,
|
|
7437
7845
|
tenant: t,
|
|
@@ -7446,7 +7854,7 @@ async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7446
7854
|
"LogoCarousel"
|
|
7447
7855
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
7448
7856
|
if (m.length) {
|
|
7449
|
-
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(
|
|
7857
|
+
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(Da).then((e) => {
|
|
7450
7858
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
7451
7859
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
7452
7860
|
}).catch(() => [[t, []]])));
|
|
@@ -7460,40 +7868,40 @@ async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
7460
7868
|
}
|
|
7461
7869
|
//#endregion
|
|
7462
7870
|
//#region src/ssr.jsx
|
|
7463
|
-
var
|
|
7871
|
+
var ka = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
7464
7872
|
"&": "&",
|
|
7465
7873
|
"<": "<",
|
|
7466
7874
|
">": ">",
|
|
7467
7875
|
"\"": """
|
|
7468
7876
|
})[e]);
|
|
7469
|
-
function
|
|
7470
|
-
return e(/* @__PURE__ */ d(
|
|
7877
|
+
function Aa(t, { mode: n = "auto", style: r } = {}) {
|
|
7878
|
+
return e(/* @__PURE__ */ d(Ta, {
|
|
7471
7879
|
bundle: t,
|
|
7472
7880
|
mode: n,
|
|
7473
7881
|
style: r
|
|
7474
7882
|
}));
|
|
7475
7883
|
}
|
|
7476
|
-
function
|
|
7884
|
+
function ja(e, { mode: t = "auto", lang: n } = {}) {
|
|
7477
7885
|
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 = [
|
|
7478
7886
|
"<meta charset=\"utf-8\"/>",
|
|
7479
7887
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
7480
|
-
`<title>${
|
|
7481
|
-
r.description && `<meta name="description" content="${
|
|
7482
|
-
`<meta property="og:title" content="${
|
|
7483
|
-
r.image && `<meta property="og:image" content="${
|
|
7888
|
+
`<title>${ka(o)}</title>`,
|
|
7889
|
+
r.description && `<meta name="description" content="${ka(r.description)}"/>`,
|
|
7890
|
+
`<meta property="og:title" content="${ka(o)}"/>`,
|
|
7891
|
+
r.image && `<meta property="og:image" content="${ka(r.image)}"/>`,
|
|
7484
7892
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
7485
7893
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
7486
7894
|
].filter(Boolean).join("\n");
|
|
7487
7895
|
return `<!doctype html>
|
|
7488
|
-
<html lang="${
|
|
7896
|
+
<html lang="${ka(i)}"${a ? ` dir="${a}"` : ""}>
|
|
7489
7897
|
<head>
|
|
7490
7898
|
${c}
|
|
7491
7899
|
</head>
|
|
7492
7900
|
<body>
|
|
7493
|
-
${
|
|
7901
|
+
${Aa(e, { mode: t })}
|
|
7494
7902
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
7495
7903
|
</body>
|
|
7496
7904
|
</html>`;
|
|
7497
7905
|
}
|
|
7498
7906
|
//#endregion
|
|
7499
|
-
export {
|
|
7907
|
+
export { Ea as assembleBundle, Oa as fetchPage, Aa as renderBundleHtml, ja as renderPageDocument };
|