webim-adapter 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1194,26 +1194,33 @@ function ct({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1194
1194
  }
1195
1195
  }) : null;
1196
1196
  }
1197
- function lt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1198
- let [i, o] = l(null);
1197
+ var lt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
1198
+ function ut(e) {
1199
+ return `@scope ([data-wb-embed]) {\n${e.replace(lt, "$1:scope")}\n}`;
1200
+ }
1201
+ function dt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
1202
+ let [o, s] = l(null);
1199
1203
  return a(() => {
1200
- i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
1204
+ o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
1205
+ e.textContent = ut(e.textContent || "");
1206
+ })) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
1201
1207
  let t = document.createElement("script");
1202
1208
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
1203
1209
  t.text = e.textContent, e.replaceWith(t);
1204
1210
  }));
1205
1211
  }, [
1206
- i,
1212
+ o,
1207
1213
  e,
1208
- t
1214
+ t,
1215
+ n
1209
1216
  ]), /* @__PURE__ */ d("div", {
1210
1217
  ref: (e) => {
1211
- o(e), r && r(e);
1218
+ s(e), i && i(e);
1212
1219
  },
1213
- style: P(n)
1220
+ style: P(r)
1214
1221
  });
1215
1222
  }
1216
- function ut({ height: e, style: t, nodeRef: n }) {
1223
+ function ft({ height: e, style: t, nodeRef: n }) {
1217
1224
  return /* @__PURE__ */ d("div", {
1218
1225
  ref: n,
1219
1226
  style: {
@@ -1224,7 +1231,7 @@ function ut({ height: e, style: t, nodeRef: n }) {
1224
1231
  }
1225
1232
  });
1226
1233
  }
1227
- function dt({ style: e, nodeRef: t }) {
1234
+ function pt({ style: e, nodeRef: t }) {
1228
1235
  return /* @__PURE__ */ d("div", {
1229
1236
  ref: t,
1230
1237
  style: {
@@ -1235,7 +1242,7 @@ function dt({ style: e, nodeRef: t }) {
1235
1242
  }
1236
1243
  });
1237
1244
  }
1238
- function ft({ style: e, nodeRef: t }) {
1245
+ function mt({ style: e, nodeRef: t }) {
1239
1246
  return /* @__PURE__ */ d("div", {
1240
1247
  ref: t,
1241
1248
  style: {
@@ -1244,7 +1251,7 @@ function ft({ style: e, nodeRef: t }) {
1244
1251
  }
1245
1252
  });
1246
1253
  }
1247
- var pt = {
1254
+ var ht = {
1248
1255
  position: "absolute",
1249
1256
  top: "50%",
1250
1257
  transform: "translateY(-50%)",
@@ -1261,7 +1268,7 @@ var pt = {
1261
1268
  alignItems: "center",
1262
1269
  justifyContent: "center",
1263
1270
  padding: 0
1264
- }, mt = {
1271
+ }, gt = {
1265
1272
  bottom: {
1266
1273
  inset: "auto 0 0 0",
1267
1274
  padding: "40px 24px 20px",
@@ -1280,8 +1287,8 @@ var pt = {
1280
1287
  padding: 24,
1281
1288
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1282
1289
  }
1283
- }, ht = 48;
1284
- function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1290
+ }, _t = 48;
1291
+ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1285
1292
  let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
1286
1293
  if (a(() => {
1287
1294
  if (!n || h || _ || e < 2) return;
@@ -1297,7 +1304,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1297
1304
  let b = (t) => m((t + e) % e), x = () => {
1298
1305
  if (!_) return;
1299
1306
  let { dx: e } = _;
1300
- v(null), e < -48 ? b(y + 1) : e > ht && b(y - 1);
1307
+ v(null), e < -48 ? b(y + 1) : e > _t && b(y - 1);
1301
1308
  };
1302
1309
  return /* @__PURE__ */ f("div", {
1303
1310
  ref: c,
@@ -1346,7 +1353,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1346
1353
  type: "button",
1347
1354
  "aria-label": "Previous slide",
1348
1355
  style: {
1349
- ...pt,
1356
+ ...ht,
1350
1357
  left: 12
1351
1358
  },
1352
1359
  onClick: () => b(y - 1),
@@ -1356,7 +1363,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1356
1363
  type: "button",
1357
1364
  "aria-label": "Next slide",
1358
1365
  style: {
1359
- ...pt,
1366
+ ...ht,
1360
1367
  right: 12
1361
1368
  },
1362
1369
  onClick: () => b(y + 1),
@@ -1390,7 +1397,7 @@ function gt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1390
1397
  ] })]
1391
1398
  });
1392
1399
  }
1393
- var _t = (e, t) => ({
1400
+ var yt = (e, t) => ({
1394
1401
  position: "absolute",
1395
1402
  inset: 0,
1396
1403
  backgroundImage: e ? `url(${e})` : "none",
@@ -1398,18 +1405,18 @@ var _t = (e, t) => ({
1398
1405
  backgroundSize: "cover",
1399
1406
  backgroundPosition: "center"
1400
1407
  });
1401
- function vt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1402
- return e.length ? /* @__PURE__ */ d(gt, {
1408
+ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1409
+ return e.length ? /* @__PURE__ */ d(vt, {
1403
1410
  ...r,
1404
1411
  count: e.length,
1405
1412
  renderSlide: (r) => {
1406
1413
  let i = e[r];
1407
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: _t(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1414
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: yt(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1408
1415
  style: {
1409
1416
  position: "absolute",
1410
1417
  color: "#fff",
1411
1418
  textAlign: n,
1412
- ...mt[t] ?? mt.bottom
1419
+ ...gt[t] ?? gt.bottom
1413
1420
  },
1414
1421
  children: [i.title && /* @__PURE__ */ d("div", {
1415
1422
  style: {
@@ -1429,13 +1436,13 @@ function vt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1429
1436
  }
1430
1437
  }) : null;
1431
1438
  }
1432
- function yt({ slides: e = [], linked: t, ...n }) {
1433
- return e.length ? /* @__PURE__ */ d(gt, {
1439
+ function xt({ slides: e = [], linked: t, ...n }) {
1440
+ return e.length ? /* @__PURE__ */ d(vt, {
1434
1441
  ...n,
1435
1442
  count: e.length,
1436
1443
  renderSlide: (n) => {
1437
1444
  let r = e[n];
1438
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: _t(r.image, r.color) }), /* @__PURE__ */ d("div", {
1445
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: yt(r.image, r.color) }), /* @__PURE__ */ d("div", {
1439
1446
  style: {
1440
1447
  position: "absolute",
1441
1448
  inset: 0,
@@ -1447,23 +1454,23 @@ function yt({ slides: e = [], linked: t, ...n }) {
1447
1454
  }
1448
1455
  }) : null;
1449
1456
  }
1450
- var bt = 256, xt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), St = (e, t, n) => {
1451
- let r = bt * 2 ** n;
1457
+ var St = 256, Ct = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), wt = (e, t, n) => {
1458
+ let r = St * 2 ** n;
1452
1459
  return {
1453
1460
  x: (Number(t) + 180) / 360 * r,
1454
- y: (.5 - xt(Number(e)) / (2 * Math.PI)) * r
1461
+ y: (.5 - Ct(Number(e)) / (2 * Math.PI)) * r
1455
1462
  };
1456
1463
  }, $ = (e, t) => {
1457
1464
  if (e === "" || e == null) return null;
1458
1465
  let n = Number(e);
1459
1466
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1460
- }, Ct = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1461
- function wt(e, t, n = "directions", r = "") {
1467
+ }, Tt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1468
+ function Et(e, t, n = "directions", r = "") {
1462
1469
  let i = `${e},${t}`;
1463
1470
  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)}`;
1464
1471
  }
1465
- var Tt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1466
- function Et({ 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 }) {
1472
+ var Dt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1473
+ function Ot({ 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 }) {
1467
1474
  let _ = c(null), [v, y] = l(1200);
1468
1475
  a(() => {
1469
1476
  let e = _.current;
@@ -1473,7 +1480,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1473
1480
  let n = new ResizeObserver(t);
1474
1481
  return n.observe(e), () => n.disconnect();
1475
1482
  }, []);
1476
- let b = (Array.isArray(e) ? e : []).filter(Ct), x = Ct({
1483
+ let b = (Array.isArray(e) ? e : []).filter(Tt), x = Tt({
1477
1484
  lat: t,
1478
1485
  lng: n
1479
1486
  }) ? {
@@ -1485,7 +1492,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1485
1492
  } : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1486
1493
  if (b.length < 2) return 13;
1487
1494
  for (let e = 19; e >= 1; e--) {
1488
- let t = b.map((t) => St($(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));
1495
+ let t = b.map((t) => wt($(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));
1489
1496
  if (n <= v * .8 && r <= S * .7) return e;
1490
1497
  }
1491
1498
  return 1;
@@ -1509,12 +1516,12 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1509
1516
  },
1510
1517
  children: "Set the coordinates in Settings"
1511
1518
  });
1512
- let T = St(x.lat, x.lng, C), E = {
1519
+ let T = wt(x.lat, x.lng, C), E = {
1513
1520
  x: T.x - v / 2,
1514
1521
  y: T.y - S / 2
1515
1522
  }, D = [], O = [];
1516
- for (let e = Math.floor(E.x / bt); e <= Math.floor((E.x + v) / bt); e++) D.push(e);
1517
- for (let e = Math.floor(E.y / bt); e <= Math.floor((E.y + S) / bt); e++) O.push(e);
1523
+ for (let e = Math.floor(E.x / St); e <= Math.floor((E.x + v) / St); e++) D.push(e);
1524
+ for (let e = Math.floor(E.y / St); e <= Math.floor((E.y + S) / St); e++) O.push(e);
1518
1525
  let k = 2 ** C;
1519
1526
  return /* @__PURE__ */ f("div", {
1520
1527
  ref: (e) => {
@@ -1537,22 +1544,22 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1537
1544
  return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
1538
1545
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1539
1546
  alt: "",
1540
- width: bt,
1541
- height: bt,
1547
+ width: St,
1548
+ height: St,
1542
1549
  loading: "lazy",
1543
1550
  style: {
1544
1551
  position: "absolute",
1545
- left: Math.round(t * bt - E.x),
1546
- top: Math.round(e * bt - E.y),
1547
- width: bt,
1548
- height: bt,
1552
+ left: Math.round(t * St - E.x),
1553
+ top: Math.round(e * St - E.y),
1554
+ width: St,
1555
+ height: St,
1549
1556
  userSelect: "none",
1550
1557
  pointerEvents: "none"
1551
1558
  }
1552
1559
  }, `${t}-${e}`);
1553
1560
  })),
1554
1561
  b.map((e, t) => {
1555
- let n = St($(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 : wt($(e.lat, 90), $(e.lng, 180), s, e.title);
1562
+ let n = wt($(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 : Et($(e.lat, 90), $(e.lng, 180), s, e.title);
1556
1563
  return /* @__PURE__ */ f(c ? "a" : "span", {
1557
1564
  href: c || void 0,
1558
1565
  target: c ? "_blank" : void 0,
@@ -1591,8 +1598,8 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1591
1598
  viewBox: "0 0 24 24",
1592
1599
  fill: a,
1593
1600
  style: { display: "block" },
1594
- children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), Dt[e.icon] ? /* @__PURE__ */ d("path", {
1595
- d: Dt[e.icon],
1601
+ children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), kt[e.icon] ? /* @__PURE__ */ d("path", {
1602
+ d: kt[e.icon],
1596
1603
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1597
1604
  fill: "none",
1598
1605
  stroke: "#fff",
@@ -1628,7 +1635,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1628
1635
  })
1629
1636
  ]
1630
1637
  }), u ? /* @__PURE__ */ d("a", {
1631
- href: Tt(x.lat, x.lng, C),
1638
+ href: Dt(x.lat, x.lng, C),
1632
1639
  target: "_blank",
1633
1640
  rel: "noopener noreferrer",
1634
1641
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1642,7 +1649,7 @@ function Et({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1642
1649
  }) : null]
1643
1650
  });
1644
1651
  }
1645
- var Dt = {
1652
+ var kt = {
1646
1653
  check: "M4 12l5 5L20 6",
1647
1654
  close: "M6 6l12 12M18 6L6 18",
1648
1655
  plus: "M12 5v14M5 12h14",
@@ -1739,8 +1746,8 @@ var Dt = {
1739
1746
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
1740
1747
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
1741
1748
  };
1742
- function Ot({ 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 }) {
1743
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [Dt[e] ?? Dt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
1749
+ function At({ 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 }) {
1750
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [kt[e] ?? kt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
1744
1751
  viewBox: "0 0 24 24",
1745
1752
  width: g,
1746
1753
  height: g,
@@ -1776,7 +1783,7 @@ function Ot({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
1776
1783
  children: v
1777
1784
  });
1778
1785
  }
1779
- function kt(e, t = {}, n = 0) {
1786
+ function jt(e, t = {}, n = 0) {
1780
1787
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Ee(e), a = Math.max(0, Number(n) || 0), o = [];
1781
1788
  for (let e of r) {
1782
1789
  let n = e.data ?? e, r = we(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(we(n, t.nameField)) : i(n.name), l = t.hrefField ? i(we(n, t.hrefField)) : "";
@@ -1789,7 +1796,7 @@ function kt(e, t = {}, n = 0) {
1789
1796
  }
1790
1797
  return o;
1791
1798
  }
1792
- function At({ 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 }) {
1799
+ function Mt({ 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 }) {
1793
1800
  let { tenant: x, apiUrl: S } = i(Y), C = i(xe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
1794
1801
  a(() => {
1795
1802
  if (!t || C) return;
@@ -1807,7 +1814,7 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1807
1814
  C
1808
1815
  ]);
1809
1816
  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 ? (() => {
1810
- let e = kt(k, {
1817
+ let e = jt(k, {
1811
1818
  imageField: r,
1812
1819
  nameField: o,
1813
1820
  hrefField: s
@@ -2012,19 +2019,19 @@ function At({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
2012
2019
  ]
2013
2020
  });
2014
2021
  }
2015
- var jt = {
2022
+ var Nt = {
2016
2023
  color: "inherit",
2017
2024
  textDecoration: "none",
2018
2025
  fontSize: 14,
2019
2026
  opacity: .85
2020
- }, Mt = {
2027
+ }, Pt = {
2021
2028
  background: "var(--page-surface, #f2f2f2)",
2022
2029
  color: "var(--page-text, #111827)",
2023
2030
  border: "1px solid rgba(148, 163, 184, 0.25)",
2024
2031
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2025
2032
  zIndex: 60
2026
2033
  };
2027
- function Nt(e, t = {}, n = "dropdown") {
2034
+ function Ft(e, t = {}, n = "dropdown") {
2028
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 ? "" : Ee(e), o = r.map((e) => {
2029
2036
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2030
2037
  return {
@@ -2066,7 +2073,7 @@ function Nt(e, t = {}, n = "dropdown") {
2066
2073
  type: e.children.length ? n : "link"
2067
2074
  }));
2068
2075
  }
2069
- function Pt({ 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" }) {
2076
+ function It({ 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" }) {
2070
2077
  let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Y), N = i(xe)?.[g], [F, I] = l(null);
2071
2078
  a(() => {
2072
2079
  if (!g || N) return;
@@ -2087,7 +2094,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2087
2094
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2088
2095
  return e.observe(C), () => e.disconnect();
2089
2096
  }, [C, h]);
2090
- let L = g ? Nt(N ?? F ?? [], {
2097
+ let L = g ? Ft(N ?? F ?? [], {
2091
2098
  labelField: _,
2092
2099
  hrefField: v,
2093
2100
  imageField: y,
@@ -2116,7 +2123,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2116
2123
  return /* @__PURE__ */ f("a", {
2117
2124
  href: e.href || "#",
2118
2125
  style: {
2119
- ...jt,
2126
+ ...Nt,
2120
2127
  display: n ? "block" : "flex",
2121
2128
  alignItems: n ? void 0 : "center",
2122
2129
  gap: n ? void 0 : 10,
@@ -2213,7 +2220,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2213
2220
  let t = e.children ?? [];
2214
2221
  if (!t.length) return /* @__PURE__ */ d("a", {
2215
2222
  href: e.href || "#",
2216
- style: jt,
2223
+ style: Nt,
2217
2224
  children: e.label
2218
2225
  }, e.key);
2219
2226
  let n = e.type === "mega";
@@ -2227,7 +2234,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2227
2234
  children: [/* @__PURE__ */ f("a", {
2228
2235
  href: e.href || "#",
2229
2236
  style: {
2230
- ...jt,
2237
+ ...Nt,
2231
2238
  cursor: "pointer"
2232
2239
  },
2233
2240
  children: [
@@ -2243,7 +2250,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2243
2250
  ]
2244
2251
  }), k === e.key && (n ? /* @__PURE__ */ d("div", {
2245
2252
  style: {
2246
- ...Mt,
2253
+ ...Pt,
2247
2254
  position: "absolute",
2248
2255
  left: 0,
2249
2256
  right: 0,
@@ -2259,7 +2266,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2259
2266
  }, !0))
2260
2267
  }) : /* @__PURE__ */ d("div", {
2261
2268
  style: {
2262
- ...Mt,
2269
+ ...Pt,
2263
2270
  position: "absolute",
2264
2271
  top: "100%",
2265
2272
  left: 0,
@@ -2288,7 +2295,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2288
2295
  children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
2289
2296
  href: e.href || "#",
2290
2297
  style: {
2291
- ...jt,
2298
+ ...Nt,
2292
2299
  padding: "10px 4px",
2293
2300
  fontWeight: (e.children ?? []).length ? 600 : 400,
2294
2301
  opacity: 1
@@ -2299,7 +2306,7 @@ function Pt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2299
2306
  ]
2300
2307
  });
2301
2308
  }
2302
- function Ft({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2309
+ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2303
2310
  let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2304
2311
  return e.length ? /* @__PURE__ */ f("div", {
2305
2312
  ref: r,
@@ -2339,13 +2346,13 @@ function Ft({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2339
2346
  }, e.key))]
2340
2347
  }) : null;
2341
2348
  }
2342
- function It({ 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 }) {
2349
+ function Rt({ 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 }) {
2343
2350
  let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
2344
2351
  if (!e.length) return null;
2345
2352
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2346
2353
  let n = Number(e);
2347
2354
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2348
- }, b = Dt[r], x = (e) => _((t) => {
2355
+ }, b = kt[r], x = (e) => _((t) => {
2349
2356
  let r = new Set(n ? t : []);
2350
2357
  return t.has(e) ? r.delete(e) : r.add(e), r;
2351
2358
  });
@@ -2420,15 +2427,15 @@ function It({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2420
2427
  })
2421
2428
  });
2422
2429
  }
2423
- var Lt = {
2430
+ var zt = {
2424
2431
  display: "flex",
2425
2432
  flexDirection: "column",
2426
2433
  gap: "12px"
2427
- }, Rt = {
2434
+ }, Bt = {
2428
2435
  fontSize: "14px",
2429
2436
  fontWeight: 500,
2430
2437
  color: "var(--page-text, #111827)"
2431
- }, zt = {
2438
+ }, Vt = {
2432
2439
  padding: "10px 12px",
2433
2440
  border: "1px solid var(--page-border, #d1d5db)",
2434
2441
  borderRadius: "6px",
@@ -2438,18 +2445,18 @@ var Lt = {
2438
2445
  boxSizing: "border-box",
2439
2446
  backgroundColor: "var(--page-surface, #f2f2f2)",
2440
2447
  color: "var(--page-text, #111827)"
2441
- }, Bt = {
2448
+ }, Ht = {
2442
2449
  display: "flex",
2443
2450
  alignItems: "center",
2444
2451
  gap: "8px",
2445
2452
  fontSize: "14px",
2446
2453
  color: "var(--page-text, #111827)"
2447
- }, Vt = (e) => e ? {
2454
+ }, Ut = (e) => e ? {
2448
2455
  readOnly: !0,
2449
2456
  tabIndex: -1,
2450
2457
  onMouseDown: (e) => e.preventDefault()
2451
2458
  } : {};
2452
- function Ht(e, t) {
2459
+ function Wt(e, t) {
2453
2460
  if (!e) return !0;
2454
2461
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2455
2462
  switch (e.op) {
@@ -2463,11 +2470,11 @@ function Ht(e, t) {
2463
2470
  default: return !1;
2464
2471
  }
2465
2472
  }
2466
- var Ut = {
2473
+ var Gt = {
2467
2474
  display: "flex",
2468
2475
  flexDirection: "column",
2469
2476
  gap: 6
2470
- }, Wt = {
2477
+ }, Kt = {
2471
2478
  font: "inherit",
2472
2479
  fontSize: 15,
2473
2480
  padding: "10px 12px",
@@ -2478,17 +2485,17 @@ var Ut = {
2478
2485
  width: "100%",
2479
2486
  boxSizing: "border-box"
2480
2487
  };
2481
- function Gt(e, t) {
2488
+ function qt(e, t) {
2482
2489
  let n = Array.isArray(e?.options) ? e.options : [];
2483
2490
  if (!e?.parentField) return n;
2484
2491
  let r = t?.[e.parentField];
2485
2492
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2486
2493
  }
2487
- var Kt = "g-recaptcha-response", qt = (e) => e?.type === "recaptcha" ? Kt : e?.name;
2488
- function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2494
+ var Jt = "g-recaptcha-response", Yt = (e) => e?.type === "recaptcha" ? Jt : e?.name;
2495
+ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2489
2496
  let a = /* @__PURE__ */ f("span", {
2490
2497
  style: {
2491
- ...Rt,
2498
+ ...Bt,
2492
2499
  fontSize: 14
2493
2500
  },
2494
2501
  children: [e.label, e.required ? " *" : ""]
@@ -2497,7 +2504,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2497
2504
  required: e.required || void 0,
2498
2505
  placeholder: e.placeholder || void 0,
2499
2506
  disabled: r || void 0,
2500
- style: Wt,
2507
+ style: Kt,
2501
2508
  value: t ?? "",
2502
2509
  onChange: (t) => n(e.name, t.target.value)
2503
2510
  };
@@ -2526,11 +2533,11 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2526
2533
  borderRadius: 8,
2527
2534
  display: "block"
2528
2535
  }
2529
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d($t, {
2536
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(tn, {
2530
2537
  theme: e.captchaTheme,
2531
2538
  size: e.captchaSize,
2532
2539
  inert: r,
2533
- onChange: (e) => n(Kt, e)
2540
+ onChange: (e) => n(Jt, e)
2534
2541
  }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(st, {
2535
2542
  url: e.src,
2536
2543
  style: { width: "100%" }
@@ -2543,14 +2550,14 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2543
2550
  display: "block"
2544
2551
  }
2545
2552
  }) : null : /* @__PURE__ */ f("label", {
2546
- style: Ut,
2553
+ style: Gt,
2547
2554
  children: [
2548
2555
  a,
2549
2556
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
2550
2557
  ...o,
2551
2558
  rows: 4,
2552
2559
  style: {
2553
- ...Wt,
2560
+ ...Kt,
2554
2561
  resize: "vertical"
2555
2562
  }
2556
2563
  }) : e.type === "select" ? /* @__PURE__ */ f("select", {
@@ -2559,7 +2566,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2559
2566
  children: [/* @__PURE__ */ d("option", {
2560
2567
  value: "",
2561
2568
  children: e.placeholder || "—"
2562
- }), Gt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2569
+ }), qt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2563
2570
  value: typeof e == "string" ? e : e.value,
2564
2571
  children: typeof e == "string" ? e : e.label ?? e.value
2565
2572
  }, t))]
@@ -2606,7 +2613,7 @@ function Jt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2606
2613
  ]
2607
2614
  });
2608
2615
  }
2609
- function Yt({ 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 }) {
2616
+ function Zt({ 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 }) {
2610
2617
  let { tenant: y, apiUrl: b } = i(Y), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
2611
2618
  a(() => {
2612
2619
  if (!c || !s) return;
@@ -2628,11 +2635,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2628
2635
  section: e,
2629
2636
  fields: []
2630
2637
  }) : A[A.length - 1].fields.push(e);
2631
- let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Ht(e.section.condition, T)).map((e) => ({
2638
+ let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Wt(e.section.condition, T)).map((e) => ({
2632
2639
  ...e,
2633
- fields: e.fields.filter((e) => Ht(e.condition, T))
2640
+ fields: e.fields.filter((e) => Wt(e.condition, T))
2634
2641
  })), 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) => {
2635
- let t = T[qt(e)];
2642
+ let t = T[Yt(e)];
2636
2643
  return e.required && (t == null || t === "" || t === !1);
2637
2644
  }), R = F >= M.length - 1, z = (e, t) => E((n) => {
2638
2645
  let r = {
@@ -2688,11 +2695,11 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2688
2695
  }
2689
2696
  },
2690
2697
  style: {
2691
- ...Lt,
2698
+ ...zt,
2692
2699
  display: k === "success" ? "none" : "flex"
2693
2700
  },
2694
2701
  children: c && s ? /* @__PURE__ */ f(u, { children: [
2695
- N && /* @__PURE__ */ d(wn, {
2702
+ N && /* @__PURE__ */ d(jn, {
2696
2703
  steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
2697
2704
  active: F + 1,
2698
2705
  style: { marginBottom: 8 }
@@ -2705,9 +2712,9 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2705
2712
  },
2706
2713
  children: M[F].section.help
2707
2714
  }),
2708
- I.map((e) => /* @__PURE__ */ d(Jt, {
2715
+ I.map((e) => /* @__PURE__ */ d(Xt, {
2709
2716
  field: e,
2710
- value: T[qt(e)],
2717
+ value: T[Yt(e)],
2711
2718
  values: T,
2712
2719
  onChange: z,
2713
2720
  inert: h
@@ -2778,10 +2785,10 @@ function Yt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2778
2785
  ]
2779
2786
  });
2780
2787
  }
2781
- var Xt = null, Zt = null, Qt = (e) => {
2788
+ var Qt = null, $t = null, en = (e) => {
2782
2789
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2783
- if (Xt && Zt === t) return Xt;
2784
- if (Xt && typeof window < "u") {
2790
+ if (Qt && $t === t) return Qt;
2791
+ if (Qt && typeof window < "u") {
2785
2792
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2786
2793
  delete window[e];
2787
2794
  } catch {
@@ -2789,22 +2796,22 @@ var Xt = null, Zt = null, Qt = (e) => {
2789
2796
  }
2790
2797
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2791
2798
  }
2792
- return Zt = t, Xt = new Promise((e) => {
2799
+ return $t = t, Qt = new Promise((e) => {
2793
2800
  if (typeof window > "u") return;
2794
2801
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2795
2802
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2796
2803
  let n = document.createElement("script");
2797
2804
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2798
- }), Xt;
2805
+ }), Qt;
2799
2806
  };
2800
- function $t({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2807
+ function tn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2801
2808
  let p = i(Y), 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);
2802
2809
  if (_.current = u, a(() => {
2803
2810
  if (l || !h || !g.current) return;
2804
2811
  let e = !0, i = (t) => {
2805
2812
  e && typeof _.current == "function" && _.current(t);
2806
2813
  };
2807
- return Qt(r).then((r) => {
2814
+ return en(r).then((r) => {
2808
2815
  if (!(!e || !g.current || !r?.render)) {
2809
2816
  g.current.innerHTML = "", i("");
2810
2817
  try {
@@ -2886,17 +2893,17 @@ function $t({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
2886
2893
  children: /* @__PURE__ */ d("div", { ref: g })
2887
2894
  }) : null;
2888
2895
  }
2889
- function en({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2896
+ function nn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2890
2897
  return /* @__PURE__ */ d("label", {
2891
2898
  ref: r,
2892
2899
  style: {
2893
- ...Rt,
2900
+ ...Bt,
2894
2901
  ...P(n)
2895
2902
  },
2896
2903
  children: Ue(t, e, i)
2897
2904
  });
2898
2905
  }
2899
- function tn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2906
+ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2900
2907
  return /* @__PURE__ */ d("input", {
2901
2908
  ref: a,
2902
2909
  type: e,
@@ -2904,13 +2911,13 @@ function tn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2904
2911
  placeholder: n,
2905
2912
  required: !o && !!r,
2906
2913
  style: {
2907
- ...zt,
2914
+ ...Vt,
2908
2915
  ...P(i)
2909
2916
  },
2910
- ...Vt(o)
2917
+ ...Ut(o)
2911
2918
  });
2912
2919
  }
2913
- function nn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2920
+ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2914
2921
  return /* @__PURE__ */ d("textarea", {
2915
2922
  ref: a,
2916
2923
  name: e || void 0,
@@ -2918,18 +2925,18 @@ function nn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2918
2925
  rows: n,
2919
2926
  required: !o && !!r,
2920
2927
  style: {
2921
- ...zt,
2928
+ ...Vt,
2922
2929
  resize: "vertical",
2923
2930
  ...P(i)
2924
2931
  },
2925
- ...Vt(o)
2932
+ ...Ut(o)
2926
2933
  });
2927
2934
  }
2928
- function rn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2935
+ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2929
2936
  return /* @__PURE__ */ f("label", {
2930
2937
  ref: o,
2931
2938
  style: {
2932
- ...Bt,
2939
+ ...Ht,
2933
2940
  ...P(a)
2934
2941
  },
2935
2942
  children: [/* @__PURE__ */ d("input", {
@@ -2946,7 +2953,7 @@ function rn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2946
2953
  }), t]
2947
2954
  });
2948
2955
  }
2949
- function an({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2956
+ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2950
2957
  return /* @__PURE__ */ f("select", {
2951
2958
  ref: a,
2952
2959
  name: e || void 0,
@@ -2955,7 +2962,7 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2955
2962
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2956
2963
  tabIndex: o ? -1 : void 0,
2957
2964
  style: {
2958
- ...zt,
2965
+ ...Vt,
2959
2966
  appearance: "auto",
2960
2967
  ...P(i)
2961
2968
  },
@@ -2969,12 +2976,12 @@ function an({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2969
2976
  }, t))]
2970
2977
  });
2971
2978
  }
2972
- function on({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2979
+ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2973
2980
  let [s, c] = l(null);
2974
2981
  return /* @__PURE__ */ f("label", {
2975
2982
  ref: a,
2976
2983
  style: {
2977
- ...zt,
2984
+ ...Vt,
2978
2985
  display: "flex",
2979
2986
  alignItems: "center",
2980
2987
  gap: "8px",
@@ -3001,7 +3008,7 @@ function on({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3001
3008
  ]
3002
3009
  });
3003
3010
  }
3004
- function sn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3011
+ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3005
3012
  return /* @__PURE__ */ d("button", {
3006
3013
  ref: n,
3007
3014
  type: r ? "button" : "submit",
@@ -3021,7 +3028,7 @@ function sn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3021
3028
  children: e
3022
3029
  });
3023
3030
  }
3024
- function cn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3031
+ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3025
3032
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3026
3033
  return /* @__PURE__ */ d("div", {
3027
3034
  ref: r,
@@ -3038,7 +3045,7 @@ function cn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3038
3045
  }, t))
3039
3046
  });
3040
3047
  }
3041
- function ln({ 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: _ }) {
3048
+ function dn({ 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: _ }) {
3042
3049
  let { tenant: v, apiUrl: y, locale: b } = i(Y), x = i(Q), S = i(xe), [, C] = l(0);
3043
3050
  a(() => {
3044
3051
  if (typeof window > "u") return;
@@ -3157,7 +3164,7 @@ function ln({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3157
3164
  })
3158
3165
  });
3159
3166
  }
3160
- function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3167
+ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3161
3168
  let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : X(), s = {
3162
3169
  height: 34,
3163
3170
  padding: "0 12px",
@@ -3206,7 +3213,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3206
3213
  name: `f_${e.name}`,
3207
3214
  defaultValue: o[e.name] ?? "",
3208
3215
  style: s,
3209
- ...Vt(i),
3216
+ ...Ut(i),
3210
3217
  children: [/* @__PURE__ */ d("option", {
3211
3218
  value: "",
3212
3219
  children: e.label || e.name
@@ -3221,7 +3228,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3221
3228
  name: `f_${e.name}`,
3222
3229
  defaultValue: o[e.name] ?? "",
3223
3230
  style: s,
3224
- ...Vt(i),
3231
+ ...Ut(i),
3225
3232
  children: [
3226
3233
  /* @__PURE__ */ d("option", {
3227
3234
  value: "",
@@ -3242,7 +3249,7 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3242
3249
  defaultValue: o[e.name] ?? "",
3243
3250
  placeholder: e.label || e.name,
3244
3251
  style: s,
3245
- ...Vt(i)
3252
+ ...Ut(i)
3246
3253
  }, e.name)), /* @__PURE__ */ d("button", {
3247
3254
  type: "submit",
3248
3255
  style: {
@@ -3255,12 +3262,12 @@ function un({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3255
3262
  fontWeight: 600,
3256
3263
  cursor: i ? "default" : "pointer"
3257
3264
  },
3258
- ...Vt(i),
3265
+ ...Ut(i),
3259
3266
  children: t
3260
3267
  })]
3261
3268
  });
3262
3269
  }
3263
- function dn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3270
+ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3264
3271
  return e.length ? /* @__PURE__ */ d("nav", {
3265
3272
  ref: r,
3266
3273
  "aria-label": "Breadcrumb",
@@ -3310,7 +3317,7 @@ function dn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3310
3317
  })
3311
3318
  }) : null;
3312
3319
  }
3313
- function fn({ 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 }) {
3320
+ function mn({ 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 }) {
3314
3321
  let { tenant: g, apiUrl: _ } = i(Y), v = i(xe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3315
3322
  a(() => {
3316
3323
  if (!o || Number.isFinite(x)) return;
@@ -3395,15 +3402,15 @@ function fn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
3395
3402
  ]
3396
3403
  });
3397
3404
  }
3398
- var pn = "webim.page_mode", mn = () => {
3405
+ var hn = "webim.page_mode", gn = () => {
3399
3406
  if (typeof window > "u") return "auto";
3400
3407
  try {
3401
- let e = window.localStorage.getItem(pn);
3408
+ let e = window.localStorage.getItem(hn);
3402
3409
  return e === "light" || e === "dark" ? e : "auto";
3403
3410
  } catch {
3404
3411
  return "auto";
3405
3412
  }
3406
- }, hn = (e) => {
3413
+ }, _n = (e) => {
3407
3414
  let t = {
3408
3415
  width: 16,
3409
3416
  height: 16,
@@ -3435,13 +3442,13 @@ var pn = "webim.page_mode", mn = () => {
3435
3442
  rx: "2"
3436
3443
  }), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
3437
3444
  });
3438
- }, gn = {
3445
+ }, vn = {
3439
3446
  light: "Light theme",
3440
3447
  dark: "Dark theme",
3441
3448
  auto: "Follow the device theme"
3442
3449
  };
3443
- function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3444
- let [o, s] = l(i ? "auto" : mn), u = c(null), f = (e) => {
3450
+ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3451
+ let [o, s] = l(i ? "auto" : gn), u = c(null), f = (e) => {
3445
3452
  u.current = e, typeof r == "function" && r(e);
3446
3453
  };
3447
3454
  a(() => {
@@ -3449,7 +3456,7 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3449
3456
  let e = u.current?.closest?.(".webim-page");
3450
3457
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3451
3458
  try {
3452
- o === "auto" ? window.localStorage.removeItem(pn) : window.localStorage.setItem(pn, o);
3459
+ o === "auto" ? window.localStorage.removeItem(hn) : window.localStorage.setItem(hn, o);
3453
3460
  } catch {}
3454
3461
  }, [o, i]);
3455
3462
  let p = t === !1 ? ["light", "dark"] : [
@@ -3484,8 +3491,8 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3484
3491
  },
3485
3492
  children: p.map((e) => /* @__PURE__ */ d("button", {
3486
3493
  type: "button",
3487
- title: gn[e],
3488
- "aria-label": gn[e],
3494
+ title: vn[e],
3495
+ "aria-label": vn[e],
3489
3496
  "aria-pressed": e === m,
3490
3497
  onClick: i ? void 0 : () => s(e),
3491
3498
  style: {
@@ -3496,15 +3503,15 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3496
3503
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3497
3504
  opacity: e === m ? 1 : .7
3498
3505
  },
3499
- children: hn(e)
3506
+ children: _n(e)
3500
3507
  }, e))
3501
3508
  });
3502
3509
  let g = p[(p.indexOf(m) + 1) % p.length];
3503
3510
  return /* @__PURE__ */ d("button", {
3504
3511
  ref: f,
3505
3512
  type: "button",
3506
- title: gn[m],
3507
- "aria-label": `Theme: ${gn[m]} — switch to ${gn[g]}`,
3513
+ title: vn[m],
3514
+ "aria-label": `Theme: ${vn[m]} — switch to ${vn[g]}`,
3508
3515
  onClick: i ? void 0 : () => s(g),
3509
3516
  style: {
3510
3517
  ...h,
@@ -3513,10 +3520,10 @@ function _n({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3513
3520
  border: "1px solid rgba(148, 163, 184, 0.4)",
3514
3521
  ...P(n)
3515
3522
  },
3516
- children: hn(m)
3523
+ children: _n(m)
3517
3524
  });
3518
3525
  }
3519
- function vn(e) {
3526
+ function bn(e) {
3520
3527
  let t = e?.parentElement;
3521
3528
  for (; t && t !== document.body;) {
3522
3529
  let e = getComputedStyle(t).overflowY;
@@ -3525,7 +3532,7 @@ function vn(e) {
3525
3532
  }
3526
3533
  return window;
3527
3534
  }
3528
- var yn = (e) => e === window ? window.scrollY : e.scrollTop, bn = {
3535
+ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
3529
3536
  "bottom-right": (e) => ({
3530
3537
  right: e,
3531
3538
  bottom: e
@@ -3539,8 +3546,122 @@ var yn = (e) => e === window ? window.scrollY : e.scrollTop, bn = {
3539
3546
  bottom: e,
3540
3547
  transform: "translateX(-50%)"
3541
3548
  })
3549
+ }, Cn = {
3550
+ linear: (e) => e,
3551
+ out: (e) => 1 - (1 - e) ** 3,
3552
+ inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
3553
+ }, wn = (e) => {
3554
+ let t = e.getBoundingClientRect(), n = e.parentElement;
3555
+ for (; n && n !== document.body;) {
3556
+ let e = getComputedStyle(n);
3557
+ if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) break;
3558
+ n = n.parentElement;
3559
+ }
3560
+ 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
+ }, Tn = (e, t) => {
3562
+ let n = typeof e == "number" ? e : parseFloat(e);
3563
+ return Number.isFinite(n) ? n : t;
3542
3564
  };
3543
- function xn({ 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 }) {
3565
+ function En(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
3566
+ let i = Math.min(Math.max(Math.round(Tn(n, 0)), 0), 6);
3567
+ try {
3568
+ return new Intl.NumberFormat(t || void 0, {
3569
+ minimumFractionDigits: i,
3570
+ maximumFractionDigits: i,
3571
+ useGrouping: r !== "none"
3572
+ }).format(e);
3573
+ } catch {
3574
+ return e.toFixed(i);
3575
+ }
3576
+ }
3577
+ function Dn({ 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 }) {
3578
+ let { locale: C } = i(Y), w = Math.max(Tn(g, 0), 0), T = Tn(e, 0), E = Tn(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
3579
+ return a(() => {
3580
+ let e = k.current;
3581
+ if (S || !A || !e) {
3582
+ O(E);
3583
+ return;
3584
+ }
3585
+ O(T);
3586
+ let t = Math.max(Tn(n, 2e3), 0), i = Math.max(Tn(r, 0), 0), a = Cn[m] || Cn.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
3587
+ if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
3588
+ O(E);
3589
+ return;
3590
+ }
3591
+ c = setTimeout(() => {
3592
+ let e = performance.now(), n = (r) => {
3593
+ let i = Math.min((r - e) / t, 1);
3594
+ O(T + (E - T) * a(i)), i < 1 && (s = requestAnimationFrame(n));
3595
+ };
3596
+ s = requestAnimationFrame(n);
3597
+ }, i);
3598
+ };
3599
+ if (h === "load" || typeof IntersectionObserver > "u") return u(), () => {
3600
+ cancelAnimationFrame(s), clearTimeout(c);
3601
+ };
3602
+ let d = new IntersectionObserver((e) => {
3603
+ let t = e.some((e) => e.isIntersecting);
3604
+ t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
3605
+ }, {
3606
+ rootMargin: `0px 0px -${Math.min(w, Math.floor(wn(e)))}px 0px`,
3607
+ threshold: w > 0 ? 0 : .3
3608
+ });
3609
+ return d.observe(e), () => {
3610
+ d.disconnect(), cancelAnimationFrame(s), clearTimeout(c);
3611
+ };
3612
+ }, [
3613
+ A,
3614
+ S,
3615
+ T,
3616
+ E,
3617
+ n,
3618
+ r,
3619
+ m,
3620
+ h,
3621
+ w,
3622
+ _
3623
+ ]), /* @__PURE__ */ f("div", {
3624
+ ref: (e) => {
3625
+ k.current = e, e && j(!0), typeof x == "function" && x(e);
3626
+ },
3627
+ "data-wb-counter": "",
3628
+ style: {
3629
+ display: "flex",
3630
+ flexDirection: "column",
3631
+ alignItems: y === "left" ? "flex-start" : y === "right" ? "flex-end" : "center",
3632
+ gap: 4,
3633
+ fontSize: 48,
3634
+ fontWeight: 700,
3635
+ lineHeight: 1.1,
3636
+ textAlign: y === "left" ? "left" : y === "right" ? "right" : "center",
3637
+ ...P(b)
3638
+ },
3639
+ children: [/* @__PURE__ */ f("span", {
3640
+ style: {
3641
+ fontVariantNumeric: "tabular-nums",
3642
+ whiteSpace: "nowrap"
3643
+ },
3644
+ children: [
3645
+ s || "",
3646
+ En(D, {
3647
+ locale: C,
3648
+ decimals: o,
3649
+ separator: p
3650
+ }),
3651
+ u || ""
3652
+ ]
3653
+ }), v ? /* @__PURE__ */ d("span", {
3654
+ style: {
3655
+ fontSize: "0.3em",
3656
+ fontWeight: 400,
3657
+ lineHeight: 1.4,
3658
+ opacity: .72
3659
+ },
3660
+ children: v
3661
+ }) : null]
3662
+ });
3663
+ }
3664
+ function On({ 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 }) {
3544
3665
  let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
3545
3666
  b(e), typeof p == "function" && p(e);
3546
3667
  };
@@ -3551,8 +3672,8 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3551
3672
  }
3552
3673
  if (!y) return;
3553
3674
  let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
3554
- let t = vn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3555
- v(n || yn(t) > e);
3675
+ let t = bn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3676
+ v(n || xn(t) > e);
3556
3677
  };
3557
3678
  return t(), document.addEventListener("scroll", t, {
3558
3679
  capture: !0,
@@ -3566,7 +3687,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3566
3687
  ]);
3567
3688
  let S = () => {
3568
3689
  if (m) return;
3569
- let e = vn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3690
+ let e = bn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3570
3691
  e === window ? window.scrollTo({
3571
3692
  top: 0,
3572
3693
  behavior: n
@@ -3574,7 +3695,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3574
3695
  top: 0,
3575
3696
  behavior: n
3576
3697
  });
3577
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = bn[n] ? n : "bottom-right", D = h ? {
3698
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = Sn[n] ? n : "bottom-right", D = h ? {
3578
3699
  position: "fixed",
3579
3700
  zIndex: 5,
3580
3701
  bottom: (h.bottom ?? 0) + C,
@@ -3587,7 +3708,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3587
3708
  } : {
3588
3709
  position: "fixed",
3589
3710
  zIndex: 2147482e3,
3590
- ...bn[E](C)
3711
+ ...Sn[E](C)
3591
3712
  };
3592
3713
  return /* @__PURE__ */ f("button", {
3593
3714
  ref: x,
@@ -3638,7 +3759,7 @@ function xn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3638
3759
  }), w ? /* @__PURE__ */ d("span", { children: T }) : null]
3639
3760
  });
3640
3761
  }
3641
- var Sn = {
3762
+ var kn = {
3642
3763
  facebook: {
3643
3764
  label: "Facebook",
3644
3765
  color: "#1877f2",
@@ -3705,8 +3826,8 @@ var Sn = {
3705
3826
  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"
3706
3827
  }
3707
3828
  };
3708
- function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3709
- let l = Array.isArray(e) ? e.filter((e) => e && Sn[e.network]) : [];
3829
+ function An({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3830
+ let l = Array.isArray(e) ? e.filter((e) => e && kn[e.network]) : [];
3710
3831
  if (!l.length) return null;
3711
3832
  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;
3712
3833
  return /* @__PURE__ */ d("div", {
@@ -3719,7 +3840,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3719
3840
  ...P(o)
3720
3841
  },
3721
3842
  children: l.map((e, r) => {
3722
- let i = Sn[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);
3843
+ let i = kn[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);
3723
3844
  return /* @__PURE__ */ d("a", {
3724
3845
  href: e.url || "#",
3725
3846
  onClick: h,
@@ -3753,7 +3874,7 @@ function Cn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3753
3874
  })
3754
3875
  });
3755
3876
  }
3756
- function wn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3877
+ function jn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3757
3878
  if (!e.length) return null;
3758
3879
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
3759
3880
  width: 32,
@@ -3831,7 +3952,7 @@ function wn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3831
3952
  })
3832
3953
  });
3833
3954
  }
3834
- var Tn = {
3955
+ var Mn = {
3835
3956
  small: {
3836
3957
  w: 132,
3837
3958
  h: 46,
@@ -3853,21 +3974,21 @@ var Tn = {
3853
3974
  title: 12.5,
3854
3975
  avatar: 46
3855
3976
  }
3856
- }, En = (e) => Tn[e] ?? Tn.medium;
3857
- Tn.medium.w, Tn.medium.h;
3858
- var Dn = (e) => String(e?.group ?? "").trim(), On = (e) => {
3977
+ }, Nn = (e) => Mn[e] ?? Mn.medium;
3978
+ Mn.medium.w, Mn.medium.h;
3979
+ var Pn = (e) => String(e?.group ?? "").trim(), Fn = (e) => {
3859
3980
  let t = [], n = /* @__PURE__ */ new Map();
3860
3981
  return e.forEach((e, r) => {
3861
- let i = Dn(e) || `#${r}`;
3982
+ let i = Pn(e) || `#${r}`;
3862
3983
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
3863
3984
  }), t.flatMap((e) => n.get(e));
3864
3985
  };
3865
- function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3866
- let i = En(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 = [];
3986
+ function In(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3987
+ let i = Nn(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 = [];
3867
3988
  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);
3868
- d = On(d);
3869
- for (let [e, t] of u) u.set(e, On(t));
3870
- let f = (e, t) => o + (Dn(e) !== Dn(t) && (Dn(e) || Dn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3989
+ d = Fn(d);
3990
+ for (let [e, t] of u) u.set(e, Fn(t));
3991
+ let f = (e, t) => o + (Pn(e) !== Pn(t) && (Pn(e) || Pn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3871
3992
  if (t.has(e.id)) return 0;
3872
3993
  t.add(e.id);
3873
3994
  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);
@@ -3883,7 +4004,7 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
3883
4004
  x: m,
3884
4005
  y: b
3885
4006
  });
3886
- let x = Dn(e);
4007
+ let x = Pn(e);
3887
4008
  if (x) {
3888
4009
  let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
3889
4010
  _.has(t) || _.set(t, {
@@ -3957,18 +4078,18 @@ function kn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
3957
4078
  horizontal: n
3958
4079
  };
3959
4080
  }
3960
- var An = (e, t) => {
4081
+ var Ln = (e, t) => {
3961
4082
  let n = String(e ?? "");
3962
4083
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3963
- }, jn = (e) => {
4084
+ }, Rn = (e) => {
3964
4085
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3965
4086
  if (!t) return "#ffffff";
3966
4087
  let n = t[1];
3967
4088
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3968
4089
  let r = parseInt(n, 16);
3969
4090
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3970
- }, Mn = (e) => !!(e?.cv?.trim?.() || e?.photo);
3971
- function Nn(e, t = {}) {
4091
+ }, zn = (e) => !!(e?.cv?.trim?.() || e?.photo);
4092
+ function Bn(e, t = {}) {
3972
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 ? "" : Ee(e);
3973
4094
  return n.map((e) => {
3974
4095
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -3984,11 +4105,11 @@ function Nn(e, t = {}) {
3984
4105
  };
3985
4106
  });
3986
4107
  }
3987
- var Pn = {
4108
+ var Vn = {
3988
4109
  size: 36,
3989
4110
  pad: 10
3990
4111
  };
3991
- function Fn({ node: e, onClose: t }) {
4112
+ function Hn({ node: e, onClose: t }) {
3992
4113
  return a(() => {
3993
4114
  let e = (e) => e.key === "Escape" && t();
3994
4115
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -4109,7 +4230,7 @@ function Fn({ node: e, onClose: t }) {
4109
4230
  })
4110
4231
  });
4111
4232
  }
4112
- function In({ 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 }) {
4233
+ function Un({ 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 }) {
4113
4234
  let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Y), O = i(xe)?.[t], [k, A] = l(null);
4114
4235
  a(() => {
4115
4236
  if (!t || O) return;
@@ -4126,7 +4247,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4126
4247
  D,
4127
4248
  O
4128
4249
  ]);
4129
- let j = t ? Nn(O ?? k ?? [], {
4250
+ let j = t ? Bn(O ?? k ?? [], {
4130
4251
  nameField: n,
4131
4252
  titleField: r,
4132
4253
  photoField: s,
@@ -4134,7 +4255,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4134
4255
  cvField: p,
4135
4256
  hrefField: m,
4136
4257
  groupField: h
4137
- }) : e, M = En(v), { boxes: N, links: F, groups: I, width: L, height: R } = kn(j, {
4258
+ }) : e, M = Nn(v), { boxes: N, links: F, groups: I, width: L, height: R } = In(j, {
4138
4259
  size: v,
4139
4260
  horizontal: y,
4140
4261
  groupTitles: g
@@ -4192,8 +4313,8 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4192
4313
  fontSize: M.title + 1,
4193
4314
  fontWeight: "600",
4194
4315
  opacity: "0.55",
4195
- fill: r ? jn(e.color || _) : "var(--page-text, #111827)",
4196
- children: An(e.title, Math.floor(e.width / 7))
4316
+ fill: r ? Rn(e.color || _) : "var(--page-text, #111827)",
4317
+ children: Ln(e.title, Math.floor(e.width / 7))
4197
4318
  })] }, `group-${t}`);
4198
4319
  }),
4199
4320
  F.map((e, t) => /* @__PURE__ */ d("path", {
@@ -4203,7 +4324,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4203
4324
  strokeWidth: "1.5"
4204
4325
  }, t)),
4205
4326
  N.map(({ node: e, x: t, y: n }) => {
4206
- 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 ? jn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? jn(e.color2) : s, l = S && (Mn(e) || e.href), p = () => Mn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Pn.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);
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 ? Rn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Rn(e.color2) : s, l = S && (zn(e) || e.href), p = () => zn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Vn.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);
4207
4328
  return /* @__PURE__ */ f("g", {
4208
4329
  onClick: l ? p : void 0,
4209
4330
  style: l ? { cursor: "pointer" } : void 0,
@@ -4267,13 +4388,13 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4267
4388
  e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4268
4389
  id: `${C}-${e.id}`,
4269
4390
  children: /* @__PURE__ */ d("circle", {
4270
- cx: t + Pn.pad + M.avatar / 2,
4391
+ cx: t + Vn.pad + M.avatar / 2,
4271
4392
  cy: n + M.h / 2,
4272
4393
  r: M.avatar / 2
4273
4394
  })
4274
4395
  }), /* @__PURE__ */ d("image", {
4275
4396
  href: e.photo,
4276
- x: t + Pn.pad,
4397
+ x: t + Vn.pad,
4277
4398
  y: n + (M.h - M.avatar) / 2,
4278
4399
  width: M.avatar,
4279
4400
  height: M.avatar,
@@ -4287,7 +4408,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4287
4408
  fontSize: M.title,
4288
4409
  fontWeight: "600",
4289
4410
  fill: s,
4290
- children: An(e.title, g + 4)
4411
+ children: Ln(e.title, g + 4)
4291
4412
  }), e.name && /* @__PURE__ */ d("text", {
4292
4413
  x: m,
4293
4414
  y: n + _ + _ / 2 + M.name * .35,
@@ -4295,7 +4416,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4295
4416
  fontSize: M.name,
4296
4417
  fontWeight: "600",
4297
4418
  fill: c,
4298
- children: An(e.name, g)
4419
+ children: Ln(e.name, g)
4299
4420
  })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
4300
4421
  x: m,
4301
4422
  y: n + (v[1] ? M.h * .43 : M.h * .57),
@@ -4303,7 +4424,7 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4303
4424
  fontSize: M.name,
4304
4425
  fontWeight: "600",
4305
4426
  fill: s,
4306
- children: An(v[0], g)
4427
+ children: Ln(v[0], g)
4307
4428
  }), v[1] && /* @__PURE__ */ d("text", {
4308
4429
  x: m,
4309
4430
  y: n + M.h * .73,
@@ -4311,19 +4432,19 @@ function In({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4311
4432
  fontSize: M.title,
4312
4433
  opacity: "0.7",
4313
4434
  fill: s,
4314
- children: An(v[1], g + 4)
4435
+ children: Ln(v[1], g + 4)
4315
4436
  })] })
4316
4437
  ]
4317
4438
  }, e.id);
4318
4439
  })
4319
4440
  ]
4320
- }), w && /* @__PURE__ */ d(Fn, {
4441
+ }), w && /* @__PURE__ */ d(Hn, {
4321
4442
  node: w,
4322
4443
  onClose: () => T(null)
4323
4444
  })]
4324
4445
  });
4325
4446
  }
4326
- function Ln({ value: e, onCommit: t, style: n, hint: r }) {
4447
+ function Wn({ value: e, onCommit: t, style: n, hint: r }) {
4327
4448
  let [i, o] = l(!1), s = c(null);
4328
4449
  return a(() => {
4329
4450
  if (!i || !s.current) return;
@@ -4353,7 +4474,7 @@ function Ln({ value: e, onCommit: t, style: n, hint: r }) {
4353
4474
  children: e ?? ""
4354
4475
  });
4355
4476
  }
4356
- var Rn = 360, zn = "\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", Bn = (e, t) => e && t ? `cell-${e}-${t}` : "", Vn = (e) => {
4477
+ var Gn = 360, Kn = "\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", qn = (e, t) => e && t ? `cell-${e}-${t}` : "", Jn = (e) => {
4357
4478
  if (!e || typeof e != "object") return e ?? "";
4358
4479
  let t = String(e.text ?? "");
4359
4480
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
@@ -4364,7 +4485,7 @@ var Rn = 360, zn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4364
4485
  children: t
4365
4486
  }) : t;
4366
4487
  };
4367
- function Hn({ 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 }) {
4488
+ function Yn({ 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 }) {
4368
4489
  let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
4369
4490
  r: e,
4370
4491
  c: t
@@ -4378,7 +4499,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4378
4499
  }
4379
4500
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4380
4501
  top: r.bottom - n.top + 4,
4381
- left: Math.max(0, Math.min(r.left - n.left, n.width - Rn))
4502
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Gn))
4382
4503
  };
4383
4504
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4384
4505
  }), a(() => {
@@ -4434,7 +4555,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4434
4555
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4435
4556
  }, ye = /* @__PURE__ */ new Set();
4436
4557
  p && ae.forEach((t, n) => e.forEach((e, t) => {
4437
- let i = p[Bn(r[n], o[t])];
4558
+ let i = p[qn(r[n], o[t])];
4438
4559
  if (!i) return;
4439
4560
  let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
4440
4561
  for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
@@ -4457,7 +4578,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4457
4578
  },
4458
4579
  onClick: n,
4459
4580
  children: e
4460
- }, t), Z = L && L.r < ae.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Ce = Z ? p?.[Bn(r[Z.r], o[Z.c])] : null, Te = Math.max(1, Number(Ce?.c) || 1), De = Math.max(1, Number(Ce?.r) || 1);
4581
+ }, t), Z = L && L.r < ae.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Ce = Z ? p?.[qn(r[Z.r], o[Z.c])] : null, Te = Math.max(1, Number(Ce?.c) || 1), De = Math.max(1, Number(Ce?.r) || 1);
4461
4582
  return /* @__PURE__ */ f("div", {
4462
4583
  ref: (e) => {
4463
4584
  I.current = e, typeof M == "function" && M(e);
@@ -4468,7 +4589,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4468
4589
  ...ge
4469
4590
  },
4470
4591
  children: [
4471
- N && /* @__PURE__ */ d("style", { children: zn }),
4592
+ N && /* @__PURE__ */ d("style", { children: Kn }),
4472
4593
  N && Z && z && /* @__PURE__ */ f("div", {
4473
4594
  className: "wb-tedit-bar",
4474
4595
  style: {
@@ -4534,7 +4655,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4534
4655
  } : N ? { position: "relative" } : null,
4535
4656
  ...q
4536
4657
  },
4537
- children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Ln, {
4658
+ children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Wn, {
4538
4659
  value: t.label ?? t,
4539
4660
  onCommit: (e) => N.header(n, e),
4540
4661
  hint: Q("editCell", "Double-click to edit"),
@@ -4562,7 +4683,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4562
4683
  },
4563
4684
  children: e.map((e, i) => {
4564
4685
  if (ye.has(`${n},${i}`)) return null;
4565
- let a = Bn(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);
4686
+ let a = qn(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);
4566
4687
  return /* @__PURE__ */ f("td", {
4567
4688
  className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
4568
4689
  onMouseDownCapture: _e ? V(n, i) : void 0,
@@ -4575,7 +4696,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4575
4696
  ...N ? { position: "relative" } : null,
4576
4697
  ...q
4577
4698
  },
4578
- children: [s ?? Vn(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
4699
+ children: [s ?? Jn(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
4579
4700
  className: "wb-tedit-rowgrip",
4580
4701
  title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
4581
4702
  onPointerDown: be(n),
@@ -4590,7 +4711,7 @@ function Hn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4590
4711
  ]
4591
4712
  });
4592
4713
  }
4593
- var Un = {
4714
+ var Xn = {
4594
4715
  small: {
4595
4716
  cell: 62,
4596
4717
  font: 10.5,
@@ -4615,8 +4736,8 @@ var Un = {
4615
4736
  pad: 8,
4616
4737
  gap: 4
4617
4738
  }
4618
- }, Wn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Gn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Kn = 366;
4619
- function qn(e, t = {}) {
4739
+ }, Zn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Qn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), $n = 366;
4740
+ function er(e, t = {}) {
4620
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 ? "" : Ee(e), a = (e) => {
4621
4742
  let t = i(r(e)), n = t ? new Date(t) : null;
4622
4743
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -4633,7 +4754,7 @@ function qn(e, t = {}) {
4633
4754
  } : null;
4634
4755
  }).filter(Boolean);
4635
4756
  }
4636
- function Jn(e) {
4757
+ function tr(e) {
4637
4758
  return (Array.isArray(e) ? e : []).map((e, t) => {
4638
4759
  let n = e?.start ? new Date(e.start) : null;
4639
4760
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -4648,19 +4769,19 @@ function Jn(e) {
4648
4769
  };
4649
4770
  }).filter(Boolean);
4650
4771
  }
4651
- function Yn(e) {
4772
+ function nr(e) {
4652
4773
  let t = /* @__PURE__ */ new Map();
4653
4774
  for (let n of e) {
4654
- let e = Gn(n.start), r = n.end ? Gn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Kn);
4775
+ let e = Qn(n.start), r = n.end ? Qn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), $n);
4655
4776
  for (let r = 0; r <= i; r += 1) {
4656
- let i = Wn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4777
+ let i = Zn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4657
4778
  t.has(i) || t.set(i, []), t.get(i).push(n);
4658
4779
  }
4659
4780
  }
4660
4781
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
4661
4782
  return t;
4662
4783
  }
4663
- function Xn({ 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 }) {
4784
+ function rr({ 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 }) {
4664
4785
  let { tenant: T, apiUrl: E, locale: D } = i(Y), O = i(xe)?.[t], [k, A] = l(null), [j, M] = l(() => {
4665
4786
  let e = /* @__PURE__ */ new Date();
4666
4787
  return {
@@ -4683,13 +4804,13 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
4683
4804
  E,
4684
4805
  O
4685
4806
  ]);
4686
- let N = Un[m] ?? Un.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 ? qn(O ?? k ?? [], {
4807
+ let N = Xn[m] ?? Xn.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 ? er(O ?? k ?? [], {
4687
4808
  titleField: n,
4688
4809
  startField: r,
4689
4810
  endField: o,
4690
4811
  hrefField: s,
4691
4812
  colorField: c
4692
- }) : Jn(e), B = Yn(z), V = D || void 0, H = (e, t) => {
4813
+ }) : tr(e), B = nr(z), V = D || void 0, H = (e, t) => {
4693
4814
  let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
4694
4815
  width: 6,
4695
4816
  height: 6,
@@ -4821,9 +4942,9 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
4821
4942
  })]
4822
4943
  });
4823
4944
  }
4824
- let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, ie = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((G + ie) / 7), oe = Wn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), K = [];
4945
+ let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, ie = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((G + ie) / 7), oe = Zn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), K = [];
4825
4946
  for (let e = 0; e < ae * 7; e += 1) {
4826
- let t = e - G + 1, n = t >= 1 && t <= ie, r = Wn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
4947
+ let t = e - G + 1, n = t >= 1 && t <= ie, r = Zn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
4827
4948
  K.push(/* @__PURE__ */ f("div", {
4828
4949
  style: {
4829
4950
  minHeight: N.cell,
@@ -4888,12 +5009,12 @@ function Xn({ events: e = [], source: t = "", titleField: n = "", startField: r
4888
5009
  ]
4889
5010
  });
4890
5011
  }
4891
- var Zn = {
5012
+ var ir = {
4892
5013
  small: 36,
4893
5014
  medium: 56,
4894
5015
  large: 88
4895
5016
  };
4896
- function Qn(e, t = {}) {
5017
+ function ar(e, t = {}) {
4897
5018
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Ee(e);
4898
5019
  return n.map((e) => {
4899
5020
  let n = e.data ?? e, i = we(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(we(n, t.nameField)) : r(n.name);
@@ -4904,7 +5025,7 @@ function Qn(e, t = {}) {
4904
5025
  };
4905
5026
  }).filter((e) => e.src);
4906
5027
  }
4907
- function $n({ 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 }) {
5028
+ function or({ 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 }) {
4908
5029
  let { tenant: D, apiUrl: O } = i(Y), k = i(xe)?.[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);
4909
5030
  a(() => {
4910
5031
  if (!t || k) return;
@@ -4944,11 +5065,11 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
4944
5065
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
4945
5066
  };
4946
5067
  });
4947
- let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? Qn(k ?? A ?? [], {
5068
+ let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? ar(k ?? A ?? [], {
4948
5069
  imageField: n,
4949
5070
  nameField: r,
4950
5071
  hrefField: o
4951
- }) : ne, G = Zn[p] ?? Zn.medium, ie = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = s === "marquee" ? "step" : s, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), se = Math.min(3e3, Math.max(100, Number(_) || 500)), K = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), q = (L || G * 3) + ie, J = F ? Math.max(1, Math.floor(F / q)) : K, le = Math.min(K, J), ue = F ? Math.min(q, F / le) : q;
5072
+ }) : ne, G = ir[p] ?? ir.medium, ie = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = s === "marquee" ? "step" : s, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), se = Math.min(3e3, Math.max(100, Number(_) || 500)), K = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), q = (L || G * 3) + ie, J = F ? Math.max(1, Math.floor(F / q)) : K, le = Math.min(K, J), ue = F ? Math.min(q, F / le) : q;
4952
5073
  if (!re.length) return /* @__PURE__ */ d("div", {
4953
5074
  ref: T,
4954
5075
  style: {
@@ -5133,7 +5254,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5133
5254
  be,
5134
5255
  Z ? Q(1) : null
5135
5256
  ] }),
5136
- /* @__PURE__ */ d(er, {
5257
+ /* @__PURE__ */ d(sr, {
5137
5258
  running: me,
5138
5259
  every: oe + se,
5139
5260
  slide: se,
@@ -5147,7 +5268,7 @@ function $n({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5147
5268
  ]
5148
5269
  });
5149
5270
  }
5150
- function er({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
5271
+ function sr({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
5151
5272
  a(() => {
5152
5273
  if (!e) return;
5153
5274
  let n = setInterval(() => {
@@ -5183,13 +5304,13 @@ function er({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
5183
5304
  l
5184
5305
  ]), null;
5185
5306
  }
5186
- var tr = {
5307
+ var cr = {
5187
5308
  small: 380,
5188
5309
  medium: 560,
5189
5310
  large: 820,
5190
5311
  full: "100%"
5191
5312
  };
5192
- function nr({ 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 }) {
5313
+ function lr({ 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 }) {
5193
5314
  let [C, w] = l(!1), T = c(null);
5194
5315
  a(() => {
5195
5316
  if (S || !e) return;
@@ -5214,7 +5335,7 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5214
5335
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
5215
5336
  };
5216
5337
  }, [S, C]);
5217
- let E = tr[o] ?? tr.medium, D = (e) => {
5338
+ let E = cr[o] ?? cr.medium, D = (e) => {
5218
5339
  let t = {
5219
5340
  padding: "9px 16px",
5220
5341
  borderRadius: 6,
@@ -5383,7 +5504,7 @@ function nr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5383
5504
  })]
5384
5505
  });
5385
5506
  }
5386
- function rr({ 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 }) {
5507
+ function ur({ 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 }) {
5387
5508
  let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
5388
5509
  b.current && clearTimeout(b.current), b.current = null;
5389
5510
  }, C = () => {
@@ -5484,40 +5605,41 @@ function rr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
5484
5605
  }), E]
5485
5606
  });
5486
5607
  }
5487
- var ir = {
5608
+ var dr = {
5488
5609
  PageRoot: Le,
5489
- CalendarBlock: Xn,
5490
- LogoCarousel: $n,
5491
- DialogBlock: nr,
5492
- DropdownBlock: rr,
5610
+ CalendarBlock: rr,
5611
+ LogoCarousel: or,
5612
+ DialogBlock: lr,
5613
+ DropdownBlock: ur,
5493
5614
  Section: Re,
5494
5615
  Container: ze,
5495
5616
  Heading: Be,
5496
5617
  TextBlock: et,
5497
5618
  ButtonBlock: rt,
5498
5619
  ImageBlock: it,
5499
- Spacer: ut,
5500
- Divider: dt,
5501
- BoxBlock: ft,
5502
- SliderBlock: vt,
5503
- CanvasSlider: yt,
5504
- TabsBlock: Ft,
5505
- QuickStack: cn,
5506
- CollectionList: ln,
5507
- CollectionSearch: un,
5508
- BreadcrumbsBlock: dn,
5509
- PaginationBlock: fn,
5510
- StepperBlock: wn,
5511
- SocialLinksBlock: Cn,
5512
- ThemeModeBlock: _n,
5513
- ScrollTopBlock: xn,
5514
- OrgChartBlock: In,
5515
- TableBlock: Hn,
5516
- IconBlock: Ot,
5517
- MapBlock: Et,
5518
- MasonryBlock: At,
5519
- AccordionBlock: It,
5520
- NavbarBlock: Pt,
5620
+ Spacer: ft,
5621
+ Divider: pt,
5622
+ BoxBlock: mt,
5623
+ SliderBlock: bt,
5624
+ CanvasSlider: xt,
5625
+ TabsBlock: Lt,
5626
+ QuickStack: un,
5627
+ CollectionList: dn,
5628
+ CollectionSearch: fn,
5629
+ BreadcrumbsBlock: pn,
5630
+ PaginationBlock: mn,
5631
+ StepperBlock: jn,
5632
+ SocialLinksBlock: An,
5633
+ ThemeModeBlock: yn,
5634
+ ScrollTopBlock: On,
5635
+ CounterBlock: Dn,
5636
+ OrgChartBlock: Un,
5637
+ TableBlock: Yn,
5638
+ IconBlock: At,
5639
+ MapBlock: Ot,
5640
+ MasonryBlock: Mt,
5641
+ AccordionBlock: Rt,
5642
+ NavbarBlock: It,
5521
5643
  ListBlock: $e,
5522
5644
  TextSpan: We,
5523
5645
  QuoteBlock: Qe,
@@ -5527,56 +5649,56 @@ var ir = {
5527
5649
  VideoBlock: at,
5528
5650
  YouTubeBlock: st,
5529
5651
  IframeBlock: ct,
5530
- EmbedBlock: lt,
5531
- FormBlock: Yt,
5532
- FormLabel: en,
5533
- FormInput: tn,
5534
- FormTextarea: nn,
5535
- FormCheckbox: (e) => /* @__PURE__ */ d(rn, {
5652
+ EmbedBlock: dt,
5653
+ FormBlock: Zt,
5654
+ FormLabel: nn,
5655
+ FormInput: rn,
5656
+ FormTextarea: an,
5657
+ FormCheckbox: (e) => /* @__PURE__ */ d(on, {
5536
5658
  kind: "checkbox",
5537
5659
  ...e
5538
5660
  }),
5539
- FormRadio: (e) => /* @__PURE__ */ d(rn, {
5661
+ FormRadio: (e) => /* @__PURE__ */ d(on, {
5540
5662
  kind: "radio",
5541
5663
  ...e
5542
5664
  }),
5543
- FormSelect: an,
5544
- FormFile: on,
5545
- FormRecaptcha: $t,
5546
- FormSubmit: sn
5547
- }, ar = {
5665
+ FormSelect: sn,
5666
+ FormFile: cn,
5667
+ FormRecaptcha: tn,
5668
+ FormSubmit: ln
5669
+ }, fr = {
5548
5670
  id: "auth",
5549
5671
  label: "Accounts",
5550
5672
  category: "Apps",
5551
5673
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5552
5674
  ssr: "shell",
5553
5675
  settings: ["site.authRedirect"]
5554
- }, or = n({
5676
+ }, pr = n({
5555
5677
  user: null,
5556
5678
  status: "idle",
5557
5679
  ensure: () => {},
5558
5680
  refresh: () => {},
5559
5681
  signOut: () => {}
5560
5682
  });
5561
- function sr(e, t) {
5683
+ function mr(e, t) {
5562
5684
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5563
5685
  }
5564
- function cr(e) {
5686
+ function hr(e) {
5565
5687
  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);
5566
5688
  return {
5567
5689
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5568
5690
  url: i,
5569
5691
  mePath: a,
5570
5692
  logoutPath: o,
5571
- meUrl: sr(i, a),
5572
- logoutUrl: sr(i, o),
5693
+ meUrl: mr(i, a),
5694
+ logoutUrl: mr(i, o),
5573
5695
  loginPage: r(n.loginPage),
5574
5696
  userPath: r(n.userPath),
5575
5697
  auth: n.auth === "bearer" ? "bearer" : "cookies",
5576
5698
  tokenKey: r(n.tokenKey) || "webim_session_token"
5577
5699
  };
5578
5700
  }
5579
- function lr(e, t) {
5701
+ function gr(e, t) {
5580
5702
  if (!t) return e ?? null;
5581
5703
  let n = e;
5582
5704
  for (let e of t.split(".")) {
@@ -5585,26 +5707,26 @@ function lr(e, t) {
5585
5707
  }
5586
5708
  return n ?? null;
5587
5709
  }
5588
- function ur(e) {
5710
+ function _r(e) {
5589
5711
  try {
5590
5712
  return window.localStorage.getItem(e) || "";
5591
5713
  } catch {
5592
5714
  return "";
5593
5715
  }
5594
5716
  }
5595
- function dr(e) {
5717
+ function vr(e) {
5596
5718
  try {
5597
5719
  window.localStorage.removeItem(e);
5598
5720
  } catch {}
5599
5721
  }
5600
- var fr = () => {
5601
- let e = i(or);
5722
+ var yr = () => {
5723
+ let e = i(pr);
5602
5724
  return a(() => {
5603
5725
  e.ensure();
5604
5726
  }, [e]), e;
5605
5727
  };
5606
- function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
5607
- let f = i(Y), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => cr(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}`, {
5728
+ function br({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
5729
+ let f = i(Y), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => hr(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}`, {
5608
5730
  ...t,
5609
5731
  credentials: "include",
5610
5732
  headers: {
@@ -5616,9 +5738,9 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
5616
5738
  if (n) return Promise.resolve(null);
5617
5739
  if (h.mode === "off") return Promise.resolve(S(null));
5618
5740
  if (h.mode === "custom") {
5619
- let e = h.auth === "bearer" ? ur(h.tokenKey) : "";
5741
+ let e = h.auth === "bearer" ? _r(h.tokenKey) : "";
5620
5742
  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) => {
5621
- let t = lr(e, h.userPath);
5743
+ let t = gr(e, h.userPath);
5622
5744
  return S(t && typeof t == "object" ? t : null);
5623
5745
  }).catch(() => S(null));
5624
5746
  }
@@ -5631,12 +5753,12 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
5631
5753
  ]), w = r(() => {
5632
5754
  if (h.mode === "off") return S(null), Promise.resolve();
5633
5755
  if (h.mode === "custom") {
5634
- let e = h.auth === "bearer" ? ur(h.tokenKey) : "";
5756
+ let e = h.auth === "bearer" ? _r(h.tokenKey) : "";
5635
5757
  return (h.logoutUrl ? fetch(h.logoutUrl, {
5636
5758
  method: "post",
5637
5759
  ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5638
5760
  }).catch(() => {}) : Promise.resolve()).then(() => {
5639
- h.auth === "bearer" && dr(h.tokenKey), S(null);
5761
+ h.auth === "bearer" && vr(h.tokenKey), S(null);
5640
5762
  });
5641
5763
  }
5642
5764
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -5686,18 +5808,18 @@ function pr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
5686
5808
  h.loginPage,
5687
5809
  C,
5688
5810
  w
5689
- ]), /* @__PURE__ */ d(or.Provider, {
5811
+ ]), /* @__PURE__ */ d(pr.Provider, {
5690
5812
  value: E,
5691
5813
  children: e
5692
5814
  });
5693
5815
  }
5694
- function mr({ when: e, children: t }) {
5695
- let { status: n } = fr();
5816
+ function xr({ when: e, children: t }) {
5817
+ let { status: n } = yr();
5696
5818
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5697
5819
  }
5698
5820
  //#endregion
5699
5821
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5700
- function hr({ 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 }) {
5822
+ function Sr({ 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 }) {
5701
5823
  let { tenant: h, apiUrl: g, settings: _ } = i(Y), [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) => {
5702
5824
  if (e.preventDefault(), u) return;
5703
5825
  let n = new FormData(e.currentTarget);
@@ -5746,20 +5868,20 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5746
5868
  children: [
5747
5869
  w ? /* @__PURE__ */ f("label", {
5748
5870
  style: {
5749
- ...Rt,
5871
+ ...Bt,
5750
5872
  display: "grid",
5751
5873
  gap: 6
5752
5874
  },
5753
5875
  children: [a, /* @__PURE__ */ d("input", {
5754
5876
  name: "name",
5755
5877
  type: "text",
5756
- style: zt,
5757
- ...Vt(u)
5878
+ style: Vt,
5879
+ ...Ut(u)
5758
5880
  })]
5759
5881
  }) : null,
5760
5882
  /* @__PURE__ */ f("label", {
5761
5883
  style: {
5762
- ...Rt,
5884
+ ...Bt,
5763
5885
  display: "grid",
5764
5886
  gap: 6
5765
5887
  },
@@ -5767,13 +5889,13 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5767
5889
  name: "email",
5768
5890
  type: "email",
5769
5891
  required: !u,
5770
- style: zt,
5771
- ...Vt(u)
5892
+ style: Vt,
5893
+ ...Ut(u)
5772
5894
  })]
5773
5895
  }),
5774
5896
  /* @__PURE__ */ f("label", {
5775
5897
  style: {
5776
- ...Rt,
5898
+ ...Bt,
5777
5899
  display: "grid",
5778
5900
  gap: 6
5779
5901
  },
@@ -5781,8 +5903,8 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5781
5903
  name: "password",
5782
5904
  type: "password",
5783
5905
  required: !u,
5784
- style: zt,
5785
- ...Vt(u)
5906
+ style: Vt,
5907
+ ...Ut(u)
5786
5908
  })]
5787
5909
  }),
5788
5910
  /* @__PURE__ */ d("button", {
@@ -5821,8 +5943,8 @@ function hr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5821
5943
  ]
5822
5944
  });
5823
5945
  }
5824
- function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5825
- let { user: c, status: l, signOut: u } = fr(), p = a ? s || "user" : l, m = a ? {
5946
+ function Cr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5947
+ let { user: c, status: l, signOut: u } = yr(), p = a ? s || "user" : l, m = a ? {
5826
5948
  name: "Ada Lovelace",
5827
5949
  email: "ada@example.com"
5828
5950
  } : c;
@@ -5843,7 +5965,7 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5843
5965
  children: [
5844
5966
  /* @__PURE__ */ f("span", {
5845
5967
  style: {
5846
- ...Rt,
5968
+ ...Bt,
5847
5969
  fontWeight: 600
5848
5970
  },
5849
5971
  children: [
@@ -5854,7 +5976,7 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5854
5976
  }),
5855
5977
  n && m?.email ? /* @__PURE__ */ d("span", {
5856
5978
  style: {
5857
- ...Rt,
5979
+ ...Bt,
5858
5980
  opacity: .7
5859
5981
  },
5860
5982
  children: m.email
@@ -5870,7 +5992,7 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5870
5992
  fontSize: 14,
5871
5993
  cursor: a ? "default" : "pointer"
5872
5994
  },
5873
- ...Vt(a),
5995
+ ...Ut(a),
5874
5996
  children: t
5875
5997
  })
5876
5998
  ]
@@ -5887,40 +6009,40 @@ function gr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5887
6009
  }
5888
6010
  //#endregion
5889
6011
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5890
- var _r = {
6012
+ var wr = {
5891
6013
  id: "consent",
5892
6014
  label: "Cookie consent",
5893
6015
  category: "Apps",
5894
6016
  keys: ["CookieConsent"],
5895
6017
  ssr: "shell",
5896
6018
  settings: []
5897
- }, vr = "webim.cookie_consent";
5898
- function yr() {
6019
+ }, Tr = "webim.cookie_consent";
6020
+ function Er() {
5899
6021
  try {
5900
- let e = window.localStorage.getItem(vr), t = e ? JSON.parse(e) : null;
6022
+ let e = window.localStorage.getItem(Tr), t = e ? JSON.parse(e) : null;
5901
6023
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5902
6024
  } catch {
5903
6025
  return "";
5904
6026
  }
5905
6027
  }
5906
- function br(e) {
6028
+ function Dr(e) {
5907
6029
  try {
5908
6030
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5909
6031
  } catch {}
5910
6032
  }
5911
- function xr(e) {
6033
+ function Or(e) {
5912
6034
  try {
5913
- window.localStorage.setItem(vr, JSON.stringify({
6035
+ window.localStorage.setItem(Tr, JSON.stringify({
5914
6036
  choice: e,
5915
6037
  at: (/* @__PURE__ */ new Date()).toISOString()
5916
6038
  }));
5917
6039
  } catch {}
5918
- br(e);
6040
+ Dr(e);
5919
6041
  try {
5920
6042
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5921
6043
  } catch {}
5922
6044
  }
5923
- var Sr = {
6045
+ var kr = {
5924
6046
  bottom: {
5925
6047
  left: 0,
5926
6048
  right: 0,
@@ -5942,18 +6064,18 @@ var Sr = {
5942
6064
  maxWidth: 400
5943
6065
  }
5944
6066
  };
5945
- function Cr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
6067
+ function Ar({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
5946
6068
  let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
5947
6069
  y(e), typeof m == "function" && m(e);
5948
6070
  };
5949
6071
  if (a(() => {
5950
6072
  if (h) return;
5951
- let e = yr();
5952
- e ? br(e) : _(!0);
6073
+ let e = Er();
6074
+ e ? Dr(e) : _(!0);
5953
6075
  }, [h, v]), !g) return null;
5954
6076
  let x = (e) => () => {
5955
- h || (xr(e), _(!1));
5956
- }, S = Sr[s] ?? Sr.bottom, C = {
6077
+ h || (Or(e), _(!1));
6078
+ }, S = kr[s] ?? kr.bottom, C = {
5957
6079
  appearance: "none",
5958
6080
  font: "inherit",
5959
6081
  fontSize: 14,
@@ -6033,37 +6155,37 @@ function Cr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
6033
6155
  }
6034
6156
  //#endregion
6035
6157
  //#region ../ui/src/components/builder/apps/language/manifest.js
6036
- var wr = {
6158
+ var jr = {
6037
6159
  id: "language",
6038
6160
  label: "Language",
6039
6161
  category: "Apps",
6040
6162
  keys: ["SiteLanguagePicker"],
6041
6163
  ssr: "prefetch",
6042
6164
  settings: ["locales"]
6043
- }, Tr = {
6165
+ }, Mr = {
6044
6166
  id: "search",
6045
6167
  label: "Search",
6046
6168
  category: "Apps",
6047
6169
  keys: ["SiteSearch"],
6048
6170
  ssr: "prefetch",
6049
6171
  settings: []
6050
- }, Er = 50, Dr = 2e3;
6051
- function Or() {
6172
+ }, Nr = 50, Pr = 2e3;
6173
+ function Fr() {
6052
6174
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
6053
6175
  }
6054
- function kr(e, t) {
6176
+ function Ir(e, t) {
6055
6177
  let n = e?.data ?? {}, r = [];
6056
6178
  for (let e of Object.values(n)) {
6057
6179
  let t = e == null ? "" : Ee(e);
6058
- if (t && r.push(t), r.join(" ").length > Dr) break;
6180
+ if (t && r.push(t), r.join(" ").length > Pr) break;
6059
6181
  }
6060
- return r.join(" ").slice(0, Dr).toLocaleLowerCase(t || void 0);
6182
+ return r.join(" ").slice(0, Pr).toLocaleLowerCase(t || void 0);
6061
6183
  }
6062
- function Ar({ 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 }) {
6063
- let { tenant: b, apiUrl: x, locale: S } = i(Y), [C, w] = l(() => Or()), [T, E] = l(() => Or()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
6184
+ function Lr({ 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 }) {
6185
+ let { tenant: b, apiUrl: x, locale: S } = i(Y), [C, w] = l(() => Fr()), [T, E] = l(() => Fr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
6064
6186
  a(() => {
6065
6187
  let e = () => {
6066
- let e = Or();
6188
+ let e = Fr();
6067
6189
  w(e), E(e);
6068
6190
  };
6069
6191
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -6114,7 +6236,7 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6114
6236
  });
6115
6237
  }
6116
6238
  else for (let t of e.rows) {
6117
- if (!kr(t, S).includes(N)) continue;
6239
+ if (!Ir(t, S).includes(N)) continue;
6118
6240
  let n = t?.data ?? {}, r = Ee(n.name) || "Untitled", i = Ee(n.slug);
6119
6241
  F.push({
6120
6242
  key: `entry:${t.id}`,
@@ -6123,7 +6245,7 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6123
6245
  kind: "entry"
6124
6246
  });
6125
6247
  }
6126
- let I = F.slice(0, Math.min(Math.max(1, p), Er)), L = (e) => {
6248
+ let I = F.slice(0, Math.min(Math.max(1, p), Nr)), L = (e) => {
6127
6249
  if (v) {
6128
6250
  e.preventDefault(), w(T), A(!0);
6129
6251
  return;
@@ -6205,7 +6327,7 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6205
6327
  onChange: (e) => E(e.target.value),
6206
6328
  onFocus: () => N && A(!0),
6207
6329
  style: {
6208
- ...zt,
6330
+ ...Vt,
6209
6331
  flexGrow: 1,
6210
6332
  minWidth: 0
6211
6333
  }
@@ -6263,21 +6385,21 @@ function Ar({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6263
6385
  }
6264
6386
  //#endregion
6265
6387
  //#region ../ui/src/components/builder/apps/language/views.jsx
6266
- function jr(e) {
6388
+ function Rr(e) {
6267
6389
  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());
6268
6390
  return [...new Set(n.map((e) => e.trim()))];
6269
6391
  }
6270
- var Mr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6271
- function Nr(e, t) {
6392
+ var zr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6393
+ function Br(e, t) {
6272
6394
  let n = String(e ?? "").toUpperCase();
6273
6395
  if (t === "code") return n;
6274
6396
  let r = "";
6275
6397
  try {
6276
- r = Mr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6398
+ r = zr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6277
6399
  } catch {}
6278
6400
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
6279
6401
  }
6280
- function Pr(e, t) {
6402
+ function Vr(e, t) {
6281
6403
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
6282
6404
  if (typeof window > "u") return n || "?";
6283
6405
  try {
@@ -6287,8 +6409,8 @@ function Pr(e, t) {
6287
6409
  return n || "/";
6288
6410
  }
6289
6411
  }
6290
- function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
6291
- let c = i(Y), l = jr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
6412
+ function Hr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
6413
+ let c = i(Y), l = Rr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
6292
6414
  display: "inline-flex",
6293
6415
  alignItems: "center",
6294
6416
  gap: 8,
@@ -6323,7 +6445,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6323
6445
  style: { opacity: .4 },
6324
6446
  children: n ?? "·"
6325
6447
  }), /* @__PURE__ */ d("a", {
6326
- href: Pr(e, e === u),
6448
+ href: Vr(e, e === u),
6327
6449
  hrefLang: e,
6328
6450
  "aria-current": e === p ? "true" : void 0,
6329
6451
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -6333,7 +6455,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6333
6455
  textDecoration: "none",
6334
6456
  cursor: s ? "default" : "pointer"
6335
6457
  },
6336
- children: Nr(e, t)
6458
+ children: Br(e, t)
6337
6459
  })]
6338
6460
  }, e))]
6339
6461
  }) : /* @__PURE__ */ f("div", {
@@ -6344,7 +6466,7 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6344
6466
  value: p,
6345
6467
  onChange: s ? void 0 : (e) => {
6346
6468
  let t = e.target.value;
6347
- window.location.assign(Pr(t, t === u));
6469
+ window.location.assign(Vr(t, t === u));
6348
6470
  },
6349
6471
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
6350
6472
  style: {
@@ -6358,47 +6480,47 @@ function Fr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6358
6480
  },
6359
6481
  children: l.map((e) => /* @__PURE__ */ d("option", {
6360
6482
  value: e,
6361
- children: Nr(e, t)
6483
+ children: Br(e, t)
6362
6484
  }, e))
6363
6485
  })]
6364
6486
  });
6365
6487
  }
6366
6488
  //#endregion
6367
6489
  //#region ../ui/src/components/builder/apps/index.js
6368
- var Ir = [
6369
- ar,
6490
+ var Ur = [
6491
+ fr,
6492
+ jr,
6370
6493
  wr,
6371
- _r,
6372
- Tr
6373
- ], Lr = {
6374
- SiteLoginForm: hr,
6375
- SiteAccountMenu: gr,
6376
- SiteLanguagePicker: Fr,
6377
- CookieConsent: Cr,
6378
- SiteSearch: Ar
6494
+ Mr
6495
+ ], Wr = {
6496
+ SiteLoginForm: Sr,
6497
+ SiteAccountMenu: Cr,
6498
+ SiteLanguagePicker: Hr,
6499
+ CookieConsent: Ar,
6500
+ SiteSearch: Lr
6379
6501
  };
6380
- new Set(Ir.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6502
+ new Set(Ur.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6381
6503
  //#endregion
6382
6504
  //#region ../ui/src/components/builder/three/runtime.js
6383
- var Rr = "0.185.1", zr = "4.2.0", Br = "https://cdn.jsdelivr.net/npm", Vr = `${Br}/three@${Rr}/+esm`, Hr = `${Br}/@google/model-viewer@${zr}/dist/model-viewer.min.js`, Ur = (e) => import(
6505
+ var Gr = "0.185.1", Kr = "4.2.0", qr = "https://cdn.jsdelivr.net/npm", Jr = `${qr}/three@${Gr}/+esm`, Yr = `${qr}/@google/model-viewer@${Kr}/dist/model-viewer.min.js`, Xr = (e) => import(
6384
6506
  /* @vite-ignore */
6385
6507
  /* webpackIgnore: true */
6386
6508
  e
6387
- ), Wr = /* @__PURE__ */ new Map();
6388
- function Gr(e) {
6389
- if (Wr.has(e)) return Wr.get(e);
6509
+ ), Zr = /* @__PURE__ */ new Map();
6510
+ function Qr(e) {
6511
+ if (Zr.has(e)) return Zr.get(e);
6390
6512
  if (typeof window > "u") return new Promise(() => {});
6391
- let t = Ur(e).catch((t) => {
6392
- throw Wr.delete(e), t;
6513
+ let t = Xr(e).catch((t) => {
6514
+ throw Zr.delete(e), t;
6393
6515
  });
6394
- return Wr.set(e, t), t;
6516
+ return Zr.set(e, t), t;
6395
6517
  }
6396
- var Kr = () => Gr(Vr), qr = (e) => Gr(`${Br}/three@${Rr}/examples/jsm/${e}/+esm`);
6397
- function Jr() {
6398
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Gr(Hr);
6518
+ var $r = () => Qr(Jr), ei = (e) => Qr(`${qr}/three@${Gr}/examples/jsm/${e}/+esm`);
6519
+ function ti() {
6520
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Qr(Yr);
6399
6521
  }
6400
- var Yr = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Xr = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6401
- function Zr(e, t) {
6522
+ var ni = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ri = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6523
+ function ii(e, t) {
6402
6524
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
6403
6525
  n = requestAnimationFrame(o), i ||= e;
6404
6526
  let a = r ? (e - r) / 1e3 : 0;
@@ -6417,7 +6539,7 @@ function Zr(e, t) {
6417
6539
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
6418
6540
  };
6419
6541
  }
6420
- function Qr(e, t, n = {}) {
6542
+ function ai(e, t, n = {}) {
6421
6543
  let r = {
6422
6544
  radius: n.distance ?? 4,
6423
6545
  polar: n.polar ?? Math.PI / 2.4,
@@ -6466,13 +6588,13 @@ function Qr(e, t, n = {}) {
6466
6588
  }
6467
6589
  //#endregion
6468
6590
  //#region ../ui/src/components/builder/three/views.jsx
6469
- var $r = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ei = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ti = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ni = (e) => typeof e == "string" && !!e.trim();
6470
- function ri({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6591
+ var oi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, si = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, ci = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, li = (e) => typeof e == "string" && !!e.trim();
6592
+ function ui({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6471
6593
  return /* @__PURE__ */ f("div", {
6472
6594
  ref: r,
6473
6595
  style: {
6474
6596
  ...P(i),
6475
- minHeight: $r(n, 320),
6597
+ minHeight: oi(n, 320),
6476
6598
  display: "flex",
6477
6599
  flexDirection: "column",
6478
6600
  alignItems: "center",
@@ -6500,24 +6622,24 @@ function ri({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6500
6622
  }) : null]
6501
6623
  });
6502
6624
  }
6503
- function ii({ 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 }) {
6625
+ function di({ 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 }) {
6504
6626
  let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
6505
6627
  a(() => {
6506
6628
  if (y || !e) return;
6507
6629
  let t = !0;
6508
- return Jr().then(() => t && b(!0), () => t && S(!0)), () => {
6630
+ return ti().then(() => t && b(!0), () => t && S(!0)), () => {
6509
6631
  t = !1;
6510
6632
  };
6511
6633
  }, [y, e]);
6512
6634
  let C = {
6513
6635
  display: "block",
6514
6636
  width: "100%",
6515
- minHeight: $r(r, 360),
6516
- height: $r(r, 360),
6637
+ minHeight: oi(r, 360),
6638
+ height: oi(r, 360),
6517
6639
  backgroundColor: i || "transparent",
6518
6640
  ...P(g)
6519
6641
  };
6520
- if (!e) return v ? /* @__PURE__ */ d(ri, {
6642
+ if (!e) return v ? /* @__PURE__ */ d(ui, {
6521
6643
  nodeRef: _,
6522
6644
  style: g,
6523
6645
  height: r,
@@ -6552,13 +6674,13 @@ function ii({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
6552
6674
  poster: t || void 0,
6553
6675
  style: C,
6554
6676
  "camera-controls": w(!v && c !== !1),
6555
- "auto-rotate": w(T && !Yr()),
6556
- "auto-rotate-delay": T ? String($r(s, 0)) : void 0,
6677
+ "auto-rotate": w(T && !ni()),
6678
+ "auto-rotate-delay": T ? String(oi(s, 0)) : void 0,
6557
6679
  "rotation-per-second": "18deg",
6558
6680
  ar: w(!v && u === !0),
6559
6681
  "ar-modes": "webxr scene-viewer quick-look",
6560
- "shadow-intensity": String(ei(p, 100)),
6561
- exposure: String(ei(f, 100)),
6682
+ "shadow-intensity": String(si(p, 100)),
6683
+ exposure: String(si(f, 100)),
6562
6684
  "field-of-view": m ? `${Number(m)}deg` : void 0,
6563
6685
  "environment-image": h && h !== "neutral" ? h : "neutral",
6564
6686
  "interaction-prompt": v ? "none" : void 0,
@@ -6576,7 +6698,7 @@ function ii({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
6576
6698
  }) : null
6577
6699
  });
6578
6700
  }
6579
- var ai = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), oi = [
6701
+ var fi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), pi = [
6580
6702
  "precision highp float;",
6581
6703
  "uniform vec2 u_res;",
6582
6704
  "uniform float u_time;",
@@ -6599,7 +6721,7 @@ var ai = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6599
6721
  " return v;",
6600
6722
  "}",
6601
6723
  ""
6602
- ].join("\n"), si = {
6724
+ ].join("\n"), mi = {
6603
6725
  gradient: [
6604
6726
  "void main(){",
6605
6727
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -6651,7 +6773,7 @@ var ai = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
6651
6773
  "}"
6652
6774
  ].join("\n")
6653
6775
  };
6654
- function ci(e, t) {
6776
+ function hi(e, t) {
6655
6777
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
6656
6778
  if (!n) return t;
6657
6779
  let r = parseInt(n[1], 16);
@@ -6661,7 +6783,7 @@ function ci(e, t) {
6661
6783
  (r & 255) / 255
6662
6784
  ];
6663
6785
  }
6664
- function li(e, t, n) {
6786
+ function gi(e, t, n) {
6665
6787
  let r = e.createShader(t);
6666
6788
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
6667
6789
  let t = e.getShaderInfoLog(r);
@@ -6669,13 +6791,13 @@ function li(e, t, n) {
6669
6791
  }
6670
6792
  return r;
6671
6793
  }
6672
- function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
6794
+ function _i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
6673
6795
  let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
6674
6796
  a(() => () => {
6675
6797
  let e = y.current;
6676
6798
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
6677
6799
  }, []);
6678
- let S = typeof t == "string" && t.trim() ? t : si[e] ?? si.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = ei(o, 100), D = Math.max(.05, ei(s, 100));
6800
+ let S = typeof t == "string" && t.trim() ? t : mi[e] ?? mi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = si(o, 100), D = Math.max(.05, si(s, 100));
6679
6801
  return a(() => {
6680
6802
  let e = _.current, t = v.current;
6681
6803
  if (!e || !t) return;
@@ -6690,7 +6812,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
6690
6812
  }
6691
6813
  let r = null;
6692
6814
  try {
6693
- let e = li(n, n.VERTEX_SHADER, ai), t = li(n, n.FRAGMENT_SHADER, oi + S);
6815
+ let e = gi(n, n.VERTEX_SHADER, fi), t = gi(n, n.FRAGMENT_SHADER, pi + S);
6694
6816
  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");
6695
6817
  x("");
6696
6818
  } catch (e) {
@@ -6726,28 +6848,28 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
6726
6848
  };
6727
6849
  p !== !1 && t.addEventListener("pointermove", l);
6728
6850
  let u = () => {
6729
- let r = Xr(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
6851
+ let r = ri(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
6730
6852
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
6731
6853
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6732
6854
  d?.observe(t), u();
6733
- let f = Yr(), m = {
6734
- a: ci(C, [
6855
+ let f = ni(), m = {
6856
+ a: hi(C, [
6735
6857
  .35,
6736
6858
  .4,
6737
6859
  .95
6738
6860
  ]),
6739
- b: ci(w, [
6861
+ b: hi(w, [
6740
6862
  .05,
6741
6863
  .06,
6742
6864
  .16
6743
6865
  ]),
6744
- c: ci(T, [
6866
+ c: hi(T, [
6745
6867
  .95,
6746
6868
  .35,
6747
6869
  .6
6748
6870
  ])
6749
6871
  }, h = {};
6750
- return h.stop = Zr(t, (t, r) => {
6872
+ return h.stop = ii(t, (t, r) => {
6751
6873
  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?.();
6752
6874
  }), () => {
6753
6875
  h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
@@ -6766,7 +6888,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
6766
6888
  },
6767
6889
  style: {
6768
6890
  position: "relative",
6769
- minHeight: $r(u, 320),
6891
+ minHeight: oi(u, 320),
6770
6892
  overflow: "hidden",
6771
6893
  ...P(m)
6772
6894
  },
@@ -6798,7 +6920,7 @@ function ui({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
6798
6920
  }) : null]
6799
6921
  });
6800
6922
  }
6801
- function di(e, t) {
6923
+ function vi(e, t) {
6802
6924
  let n = new e.Scene(), r = new e.BoxGeometry();
6803
6925
  r.deleteAttribute("uv");
6804
6926
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -6814,23 +6936,23 @@ function di(e, t) {
6814
6936
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
6815
6937
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
6816
6938
  }
6817
- var fi = /* @__PURE__ */ new Map();
6818
- function pi(e) {
6819
- if (fi.has(e)) return fi.get(e);
6820
- let t = qr("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
6939
+ var yi = /* @__PURE__ */ new Map();
6940
+ function bi(e) {
6941
+ if (yi.has(e)) return yi.get(e);
6942
+ let t = ei("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
6821
6943
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
6822
6944
  })).catch((t) => {
6823
- throw fi.delete(e), t;
6945
+ throw yi.delete(e), t;
6824
6946
  });
6825
- return fi.set(e, t), t;
6947
+ return yi.set(e, t), t;
6826
6948
  }
6827
- function mi(e, t) {
6949
+ function xi(e, t) {
6828
6950
  let n = new e.Box3().setFromObject(t);
6829
6951
  if (n.isEmpty()) return t;
6830
6952
  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();
6831
6953
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
6832
6954
  }
6833
- var hi = {
6955
+ var Si = {
6834
6956
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
6835
6957
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
6836
6958
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -6839,50 +6961,50 @@ var hi = {
6839
6961
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
6840
6962
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
6841
6963
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
6842
- }, gi = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
6843
- function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
6844
- 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 && !Yr(), S = s !== !1 && !h;
6964
+ }, Ci = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
6965
+ function wi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
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 && !ni(), S = s !== !1 && !h;
6845
6967
  return a(() => {
6846
6968
  let e = g.current;
6847
6969
  if (!e) return;
6848
6970
  let i = !0, a = null;
6849
- return Kr().then((s) => {
6971
+ return $r().then((s) => {
6850
6972
  if (!i || !e) return;
6851
6973
  let c = new s.WebGLRenderer({
6852
6974
  antialias: !0,
6853
6975
  alpha: !t
6854
6976
  });
6855
- c.setPixelRatio(Xr()), 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);
6977
+ c.setPixelRatio(ri()), 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);
6856
6978
  let l = new s.Scene();
6857
- t && (l.background = new s.Color(t)), l.environment = di(s, c);
6858
- let d = new s.PerspectiveCamera(gi(r, 45), 1, .1, 400), f = Qr(d, c.domElement, {
6859
- distance: gi(n, 5),
6979
+ t && (l.background = new s.Color(t)), l.environment = vi(s, c);
6980
+ let d = new s.PerspectiveCamera(Ci(r, 45), 1, .1, 400), f = ai(d, c.domElement, {
6981
+ distance: Ci(n, 5),
6860
6982
  enableZoom: S
6861
6983
  }), p = new s.DirectionalLight(16777215, 2.2);
6862
6984
  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));
6863
6985
  let m = [], h = new s.Group(), g = (e, t) => {
6864
- let n = gi(t.scale, 1);
6865
- e.position.set(gi(t.x, 0), gi(t.y, 0), gi(t.z, 0)), e.rotation.set(ti(t.rx), ti(t.ry), ti(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ti(t.spin);
6986
+ let n = Ci(t.scale, 1);
6987
+ e.position.set(Ci(t.x, 0), Ci(t.y, 0), Ci(t.z, 0)), e.rotation.set(ci(t.rx), ci(t.ry), ci(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = ci(t.spin);
6866
6988
  };
6867
6989
  for (let e of y) {
6868
6990
  if (e.shape === "model") {
6869
- if (!ni(e.src)) continue;
6991
+ if (!li(e.src)) continue;
6870
6992
  let t = new s.Group();
6871
- g(t, e), h.add(t), pi(e.src).then((e) => {
6993
+ g(t, e), h.add(t), bi(e.src).then((e) => {
6872
6994
  if (!i) return;
6873
- let n = mi(s, e.clone(!0));
6995
+ let n = xi(s, e.clone(!0));
6874
6996
  n.traverse((e) => {
6875
6997
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
6876
6998
  }), t.add(n);
6877
6999
  }, () => {});
6878
7000
  continue;
6879
7001
  }
6880
- let t = (hi[e.shape] ?? hi.box)(s), n = new s.MeshStandardMaterial({
7002
+ let t = (Si[e.shape] ?? Si.box)(s), n = new s.MeshStandardMaterial({
6881
7003
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
6882
- metalness: Math.min(1, Math.max(0, ei(e.metalness, 10))),
6883
- roughness: Math.min(1, Math.max(0, ei(e.roughness, 35))),
6884
- transparent: ei(e.opacity, 100) < 1,
6885
- opacity: Math.min(1, Math.max(0, ei(e.opacity, 100))),
7004
+ metalness: Math.min(1, Math.max(0, si(e.metalness, 10))),
7005
+ roughness: Math.min(1, Math.max(0, si(e.roughness, 35))),
7006
+ transparent: si(e.opacity, 100) < 1,
7007
+ opacity: Math.min(1, Math.max(0, si(e.opacity, 100))),
6886
7008
  flatShading: e.flat === !0,
6887
7009
  wireframe: e.wireframe === !0,
6888
7010
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -6893,14 +7015,14 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6893
7015
  let _ = null;
6894
7016
  if (u !== !1) {
6895
7017
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
6896
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = gi(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
7018
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = Ci(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
6897
7019
  }
6898
7020
  let v = () => {
6899
7021
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
6900
7022
  c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
6901
7023
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
6902
7024
  b?.observe(e), v();
6903
- let C = ti(Number.isFinite(Number(o)) ? o : 20), w = Zr(e, (e) => {
7025
+ let C = ci(Number.isFinite(Number(o)) ? o : 20), w = ii(e, (e) => {
6904
7026
  f.autoSpin(x ? C : 0, e), f.update();
6905
7027
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
6906
7028
  c.render(l, d);
@@ -6924,7 +7046,7 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6924
7046
  o,
6925
7047
  S,
6926
7048
  u
6927
- ]), _ && h ? /* @__PURE__ */ d(ri, {
7049
+ ]), _ && h ? /* @__PURE__ */ d(ui, {
6928
7050
  nodeRef: m,
6929
7051
  style: p,
6930
7052
  height: f,
@@ -6935,27 +7057,27 @@ function _i({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
6935
7057
  g.current = e, typeof m == "function" && m(e);
6936
7058
  },
6937
7059
  style: {
6938
- minHeight: $r(f, 380),
6939
- height: $r(f, 380),
7060
+ minHeight: oi(f, 380),
7061
+ height: oi(f, 380),
6940
7062
  overflow: "hidden",
6941
7063
  touchAction: S ? "pan-y" : void 0,
6942
7064
  ...P(p)
6943
7065
  }
6944
7066
  });
6945
7067
  }
6946
- function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
7068
+ function Ti({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
6947
7069
  let s = c(null), [u, f] = l("");
6948
7070
  return a(() => {
6949
7071
  let t = s.current;
6950
7072
  if (o || !t || typeof e != "string" || !e.trim()) return;
6951
7073
  let r = !0, i = null;
6952
- return Kr().then((a) => {
7074
+ return $r().then((a) => {
6953
7075
  if (!r || !t) return;
6954
7076
  let o = new a.WebGLRenderer({
6955
7077
  antialias: !0,
6956
7078
  alpha: !n
6957
7079
  });
6958
- o.setPixelRatio(Xr()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
7080
+ o.setPixelRatio(ri()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
6959
7081
  let s = new a.Scene();
6960
7082
  n && (s.background = new a.Color(n));
6961
7083
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -6978,7 +7100,7 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
6978
7100
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
6979
7101
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
6980
7102
  d?.observe(t), u();
6981
- let p = !1, m = Zr(t, (e, t) => {
7103
+ let p = !1, m = ii(t, (e, t) => {
6982
7104
  if (!p && typeof l?.frame == "function") try {
6983
7105
  l.frame(e, t);
6984
7106
  } catch (e) {
@@ -7000,7 +7122,7 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7000
7122
  e,
7001
7123
  o,
7002
7124
  n
7003
- ]), o ? /* @__PURE__ */ d(ri, {
7125
+ ]), o ? /* @__PURE__ */ d(ui, {
7004
7126
  nodeRef: i,
7005
7127
  style: r,
7006
7128
  height: t,
@@ -7011,8 +7133,8 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7011
7133
  s.current = e, typeof i == "function" && i(e);
7012
7134
  },
7013
7135
  style: {
7014
- minHeight: $r(t, 380),
7015
- height: $r(t, 380),
7136
+ minHeight: oi(t, 380),
7137
+ height: oi(t, 380),
7016
7138
  overflow: "hidden",
7017
7139
  position: "relative",
7018
7140
  touchAction: "pan-y",
@@ -7035,40 +7157,40 @@ function vi({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7035
7157
  }) : null
7036
7158
  });
7037
7159
  }
7038
- var yi = {
7039
- ModelViewerBlock: ii,
7040
- ShaderBlock: ui,
7041
- SceneBlock: _i,
7042
- ThreeCanvasBlock: vi
7043
- }, bi = /* @__PURE__ */ new Map();
7044
- function xi(e) {
7045
- if (bi.has(e)) return bi.get(e);
7160
+ var Ei = {
7161
+ ModelViewerBlock: di,
7162
+ ShaderBlock: _i,
7163
+ SceneBlock: wi,
7164
+ ThreeCanvasBlock: Ti
7165
+ }, Di = /* @__PURE__ */ new Map();
7166
+ function Oi(e) {
7167
+ if (Di.has(e)) return Di.get(e);
7046
7168
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
7047
7169
  /* @vite-ignore */
7048
7170
  /* webpackIgnore: true */
7049
7171
  t
7050
7172
  ).finally(() => URL.revokeObjectURL(t));
7051
- return bi.set(e, n), n;
7173
+ return Di.set(e, n), n;
7052
7174
  }
7053
- function Si(e) {
7175
+ function ki(e) {
7054
7176
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
7055
7177
  return n && typeof n == "object" ? n : {};
7056
7178
  }
7057
7179
  //#endregion
7058
7180
  //#region ../ui/src/components/builder/plugins/view.jsx
7059
- async function Ci(e, t) {
7060
- let n = await xi(e);
7181
+ async function Ai(e, t) {
7182
+ let n = await Oi(e);
7061
7183
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
7062
7184
  }
7063
- var wi = {
7185
+ var ji = {
7064
7186
  padding: "10px 12px",
7065
7187
  border: "1px dashed rgba(148, 163, 184, 0.5)",
7066
7188
  borderRadius: 8,
7067
7189
  fontSize: 12,
7068
7190
  opacity: .6
7069
7191
  };
7070
- function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7071
- let s = i(Y), l = Si(s?.settings)[e], u = c(null), p = c(null), m = {
7192
+ function Mi({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7193
+ let s = i(Y), l = ki(s?.settings)[e], u = c(null), p = c(null), m = {
7072
7194
  tenant: s?.tenant ?? "",
7073
7195
  apiUrl: s?.apiUrl ?? "/api",
7074
7196
  locale: s?.locale ?? "",
@@ -7080,7 +7202,7 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7080
7202
  let e = u.current;
7081
7203
  if (!l?.code || !e) return;
7082
7204
  let n = !0;
7083
- return Ci(l.code, t).then((e) => {
7205
+ return Ai(l.code, t).then((e) => {
7084
7206
  if (!(!n || !e || !u.current)) {
7085
7207
  p.current = e;
7086
7208
  try {
@@ -7110,7 +7232,7 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7110
7232
  }) : /* @__PURE__ */ f("div", {
7111
7233
  ref: o,
7112
7234
  style: {
7113
- ...wi,
7235
+ ...ji,
7114
7236
  ...P(r)
7115
7237
  },
7116
7238
  children: [
@@ -7122,13 +7244,13 @@ function Ti({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7122
7244
  }
7123
7245
  //#endregion
7124
7246
  //#region ../ui/src/components/builder/render.jsx
7125
- var Ei = {
7126
- ...ir,
7127
- ...Lr,
7128
- ...yi,
7129
- PluginBlock: Ti
7247
+ var Ni = {
7248
+ ...dr,
7249
+ ...Wr,
7250
+ ...Ei,
7251
+ PluginBlock: Mi
7130
7252
  };
7131
- function Di(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7253
+ function Pi(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7132
7254
  let o = n[e];
7133
7255
  if (!o || o.hidden) return null;
7134
7256
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -7136,11 +7258,11 @@ function Di(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7136
7258
  let n = o.props?.componentId, s = r?.[n];
7137
7259
  if (!s?.template || i.has(n)) return null;
7138
7260
  let c = new Set(i).add(n);
7139
- return /* @__PURE__ */ d(t, { children: Di(s.template.rootId, s.template.nodes, r, c, a) }, e);
7261
+ return /* @__PURE__ */ d(t, { children: Pi(s.template.rootId, s.template.nodes, r, c, a) }, e);
7140
7262
  }
7141
- let l = Ei[s];
7263
+ let l = Ni[s];
7142
7264
  if (!l) return null;
7143
- let u = (o.nodes ?? []).map((e) => Di(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Di(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
7265
+ let u = (o.nodes ?? []).map((e) => Pi(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Pi(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
7144
7266
  ...c,
7145
7267
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
7146
7268
  linked: p,
@@ -7149,16 +7271,16 @@ function Di(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7149
7271
  },
7150
7272
  children: u.length ? u : void 0
7151
7273
  }, e);
7152
- return c.when && c.when !== "always" ? /* @__PURE__ */ d(mr, {
7274
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(xr, {
7153
7275
  when: c.when,
7154
7276
  children: m
7155
7277
  }, e) : m;
7156
7278
  }
7157
7279
  //#endregion
7158
7280
  //#region ../ui/src/components/builder/PageRenderer.jsx
7159
- var Oi = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ki = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(me(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7281
+ var Fi = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ii = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(me(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7160
7282
  .webim-page[data-webim-mode="dark"] { ${Object.entries(me(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
7161
- function Ai({ 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 }) {
7283
+ function Li({ 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 }) {
7162
7284
  let y = o?.js?.trim();
7163
7285
  if (a(() => {
7164
7286
  if (!y) return;
@@ -7172,11 +7294,11 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7172
7294
  minHeight: "100%",
7173
7295
  display: "flex",
7174
7296
  flexDirection: "column"
7175
- }, w = Di("ROOT", e, n), T = s(() => ({ render: (t, r) => Di(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = se(e, n), O = oe(e, n), k = o?.css?.trim(), j = S(c), M = pe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !ue[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
7297
+ }, w = Pi("ROOT", e, n), T = s(() => ({ render: (t, r) => Pi(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = se(e, n), O = oe(e, n), k = o?.css?.trim(), j = S(c), M = pe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !ue[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
7176
7298
  rel: "stylesheet",
7177
7299
  precedence: "default",
7178
7300
  href: D(e)
7179
- }, e)), F = ki(M);
7301
+ }, e)), F = Ii(M);
7180
7302
  return r === "auto" ? /* @__PURE__ */ d(Y.Provider, {
7181
7303
  value: {
7182
7304
  tenant: l || "",
@@ -7184,7 +7306,7 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7184
7306
  locale: m || "",
7185
7307
  settings: _ ?? null
7186
7308
  },
7187
- children: /* @__PURE__ */ d(pr, {
7309
+ children: /* @__PURE__ */ d(br, {
7188
7310
  initialUser: v,
7189
7311
  children: /* @__PURE__ */ d(xe.Provider, {
7190
7312
  value: p ?? null,
@@ -7199,8 +7321,8 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7199
7321
  ...i
7200
7322
  },
7201
7323
  children: [
7202
- /* @__PURE__ */ d("style", { children: `.webim-page { ${Oi(me(M.light))} }
7203
- @media (prefers-color-scheme: dark) { .webim-page { ${Oi(me(M.dark))} } }` }),
7324
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${Fi(me(M.light))} }
7325
+ @media (prefers-color-scheme: dark) { .webim-page { ${Fi(me(M.dark))} } }` }),
7204
7326
  /* @__PURE__ */ d("style", { children: F }),
7205
7327
  P,
7206
7328
  /* @__PURE__ */ d("style", { children: x }),
@@ -7220,7 +7342,7 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7220
7342
  locale: m || "",
7221
7343
  settings: _ ?? null
7222
7344
  },
7223
- children: /* @__PURE__ */ d(pr, {
7345
+ children: /* @__PURE__ */ d(br, {
7224
7346
  initialUser: v,
7225
7347
  children: /* @__PURE__ */ d(xe.Provider, {
7226
7348
  value: p ?? null,
@@ -7253,8 +7375,8 @@ function Ai({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7253
7375
  }
7254
7376
  //#endregion
7255
7377
  //#region src/WebimContent.jsx
7256
- function ji({ bundle: e, mode: t = "auto", style: n }) {
7257
- return e?.blocks?.ROOT ? /* @__PURE__ */ d(Ai, {
7378
+ function Ri({ bundle: e, mode: t = "auto", style: n }) {
7379
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(Li, {
7258
7380
  blocks: e.blocks,
7259
7381
  theme: e.theme,
7260
7382
  components: e.components,
@@ -7272,7 +7394,7 @@ function ji({ bundle: e, mode: t = "auto", style: n }) {
7272
7394
  }
7273
7395
  //#endregion
7274
7396
  //#region src/bundle.js
7275
- function Mi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7397
+ function zi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7276
7398
  let a = {
7277
7399
  ...t?.global ?? {},
7278
7400
  ...t?.tenant ?? {}
@@ -7298,18 +7420,18 @@ function Mi({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7298
7420
  }
7299
7421
  //#endregion
7300
7422
  //#region src/fetchPage.js
7301
- var Ni = async (e) => {
7423
+ var Bi = async (e) => {
7302
7424
  let t = await e.json().catch(() => null);
7303
7425
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
7304
7426
  return t?.payload ?? t;
7305
7427
  };
7306
- async function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
7428
+ async function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
7307
7429
  if (!e) throw Error("fetchPage: apiUrl is required");
7308
7430
  if (!n) throw Error("fetchPage: slug is required");
7309
7431
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
7310
7432
  ...t ? { "x-tenant": t } : {},
7311
7433
  ...a ? { authorization: `Bearer ${a}` } : {}
7312
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Ni), c(`${l}/settings/public`, { headers: u }).then(Ni)]), p = Mi({
7434
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Bi), c(`${l}/settings/public`, { headers: u }).then(Bi)]), p = zi({
7313
7435
  page: d,
7314
7436
  settings: f,
7315
7437
  tenant: t,
@@ -7324,7 +7446,7 @@ async function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
7324
7446
  "LogoCarousel"
7325
7447
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
7326
7448
  if (m.length) {
7327
- 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(Ni).then((e) => {
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(Bi).then((e) => {
7328
7450
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
7329
7451
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
7330
7452
  }).catch(() => [[t, []]])));
@@ -7338,40 +7460,40 @@ async function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
7338
7460
  }
7339
7461
  //#endregion
7340
7462
  //#region src/ssr.jsx
7341
- var Fi = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
7463
+ var Hi = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
7342
7464
  "&": "&amp;",
7343
7465
  "<": "&lt;",
7344
7466
  ">": "&gt;",
7345
7467
  "\"": "&quot;"
7346
7468
  })[e]);
7347
- function Ii(t, { mode: n = "auto", style: r } = {}) {
7348
- return e(/* @__PURE__ */ d(ji, {
7469
+ function Ui(t, { mode: n = "auto", style: r } = {}) {
7470
+ return e(/* @__PURE__ */ d(Ri, {
7349
7471
  bundle: t,
7350
7472
  mode: n,
7351
7473
  style: r
7352
7474
  }));
7353
7475
  }
7354
- function Li(e, { mode: t = "auto", lang: n } = {}) {
7476
+ function Wi(e, { mode: t = "auto", lang: n } = {}) {
7355
7477
  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 = [
7356
7478
  "<meta charset=\"utf-8\"/>",
7357
7479
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
7358
- `<title>${Fi(o)}</title>`,
7359
- r.description && `<meta name="description" content="${Fi(r.description)}"/>`,
7360
- `<meta property="og:title" content="${Fi(o)}"/>`,
7361
- r.image && `<meta property="og:image" content="${Fi(r.image)}"/>`,
7480
+ `<title>${Hi(o)}</title>`,
7481
+ r.description && `<meta name="description" content="${Hi(r.description)}"/>`,
7482
+ `<meta property="og:title" content="${Hi(o)}"/>`,
7483
+ r.image && `<meta property="og:image" content="${Hi(r.image)}"/>`,
7362
7484
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
7363
7485
  "<style>html,body{margin:0;height:100%}</style>"
7364
7486
  ].filter(Boolean).join("\n");
7365
7487
  return `<!doctype html>
7366
- <html lang="${Fi(i)}"${a ? ` dir="${a}"` : ""}>
7488
+ <html lang="${Hi(i)}"${a ? ` dir="${a}"` : ""}>
7367
7489
  <head>
7368
7490
  ${c}
7369
7491
  </head>
7370
7492
  <body>
7371
- ${Ii(e, { mode: t })}
7493
+ ${Ui(e, { mode: t })}
7372
7494
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
7373
7495
  </body>
7374
7496
  </html>`;
7375
7497
  }
7376
7498
  //#endregion
7377
- export { Mi as assembleBundle, Pi as fetchPage, Ii as renderBundleHtml, Li as renderPageDocument };
7499
+ export { zi as assembleBundle, Vi as fetchPage, Ui as renderBundleHtml, Wi as renderPageDocument };