webim-adapter 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1000,7 +1000,20 @@ function yt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
1000
1000
  children: [/* @__PURE__ */ d(ht, { style: e }), r]
1001
1001
  });
1002
1002
  }
1003
- function bt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
1003
+ function bt({ href: e, target: t, style: n, nodeRef: r, children: i }) {
1004
+ return /* @__PURE__ */ f("a", {
1005
+ ref: r,
1006
+ href: e || "#",
1007
+ target: t || void 0,
1008
+ rel: t === "_blank" ? "noopener noreferrer" : void 0,
1009
+ style: {
1010
+ ...Vt,
1011
+ ...gt(n)
1012
+ },
1013
+ children: [/* @__PURE__ */ d(ht, { style: n }), i]
1014
+ });
1015
+ }
1016
+ function xt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
1004
1017
  return /* @__PURE__ */ d(n, {
1005
1018
  ref: a,
1006
1019
  style: {
@@ -1008,16 +1021,16 @@ function bt({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
1008
1021
  fontSize: ut(n),
1009
1022
  ...P(r)
1010
1023
  },
1011
- children: wt(t, e, i)
1024
+ children: Tt(t, e, i)
1012
1025
  });
1013
1026
  }
1014
- var xt = {
1027
+ var St = {
1015
1028
  fontFamily: Ve.mono.value,
1016
1029
  background: "rgba(148, 163, 184, 0.18)",
1017
1030
  padding: "1px 5px",
1018
1031
  borderRadius: 4,
1019
1032
  fontSize: "0.9em"
1020
- }, St = {
1033
+ }, Ct = {
1021
1034
  fontFamily: Ve.mono.value,
1022
1035
  background: "rgba(148, 163, 184, 0.16)",
1023
1036
  border: "1px solid rgba(148, 163, 184, 0.3)",
@@ -1028,10 +1041,10 @@ var xt = {
1028
1041
  overflowX: "auto",
1029
1042
  whiteSpace: "pre"
1030
1043
  };
1031
- function Ct(e, t = [], n, r) {
1044
+ function wt(e, t = [], n, r) {
1032
1045
  let i = e;
1033
1046
  return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
1034
- style: xt,
1047
+ style: St,
1035
1048
  children: i
1036
1049
  })), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n ? i = /* @__PURE__ */ d("a", {
1037
1050
  href: n,
@@ -1047,10 +1060,10 @@ function Ct(e, t = [], n, r) {
1047
1060
  children: i
1048
1061
  })), i;
1049
1062
  }
1050
- function wt(e, n, r) {
1063
+ function Tt(e, n, r) {
1051
1064
  return e?.length ? e.map((e, n) => {
1052
1065
  if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
1053
- if (e.parts) return /* @__PURE__ */ d(t, { children: wt(e.parts, "", r) }, n);
1066
+ if (e.parts) return /* @__PURE__ */ d(t, { children: Tt(e.parts, "", r) }, n);
1054
1067
  if (e.br) return /* @__PURE__ */ d("br", {}, n);
1055
1068
  let i = e.text;
1056
1069
  return e.image && (i = /* @__PURE__ */ d("img", {
@@ -1062,7 +1075,7 @@ function wt(e, n, r) {
1062
1075
  verticalAlign: "middle"
1063
1076
  }
1064
1077
  })), e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
1065
- style: xt,
1078
+ style: St,
1066
1079
  children: i
1067
1080
  })), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
1068
1081
  style: {
@@ -1085,35 +1098,35 @@ function wt(e, n, r) {
1085
1098
  })), /* @__PURE__ */ d(t, { children: i }, n);
1086
1099
  }) : n;
1087
1100
  }
1088
- function Tt({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
1101
+ function Et({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
1089
1102
  return /* @__PURE__ */ d("span", {
1090
1103
  style: P(a),
1091
- children: e?.length ? wt(e, t) : Ct(t, n, r, i)
1104
+ children: e?.length ? Tt(e, t) : wt(t, n, r, i)
1092
1105
  });
1093
1106
  }
1094
- var Et = [
1107
+ var Dt = [
1095
1108
  "left",
1096
1109
  "center",
1097
1110
  "right",
1098
1111
  "justify"
1099
1112
  ];
1100
- function Dt(e, t, n) {
1113
+ function Ot(e, t, n) {
1101
1114
  let r = e && e.cellStyles;
1102
1115
  if (!r || typeof r != "object" || Array.isArray(r)) return {};
1103
1116
  let i = r[`${t}:${n}`];
1104
1117
  return i && typeof i == "object" && !Array.isArray(i) ? i : {};
1105
1118
  }
1106
- function Ot(e, t) {
1119
+ function kt(e, t) {
1107
1120
  let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
1108
1121
  return {
1109
- textAlign: Et.includes(n.align) ? n.align : "left",
1122
+ textAlign: Dt.includes(n.align) ? n.align : "left",
1110
1123
  fontWeight: r ? 700 : 400,
1111
1124
  fontStyle: n.italic ? "italic" : void 0,
1112
1125
  color: typeof n.color == "string" && n.color ? n.color : void 0,
1113
1126
  backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
1114
1127
  };
1115
1128
  }
1116
- function kt({ align: e = "center", width: t, wrap: n } = {}) {
1129
+ function At({ align: e = "center", width: t, wrap: n } = {}) {
1117
1130
  let r = t ? `${t}%` : void 0;
1118
1131
  if (e === "full") return { width: "100%" };
1119
1132
  let i = e === "left" || e === "right";
@@ -1147,8 +1160,38 @@ function kt({ align: e = "center", width: t, wrap: n } = {}) {
1147
1160
  marginRight: "auto"
1148
1161
  };
1149
1162
  }
1150
- function At(e = [], t, n) {
1151
- let r = n ?? ((e, n) => wt(e, n, t));
1163
+ var jt = {
1164
+ red: "#e03131",
1165
+ orange: "#e8590c",
1166
+ yellow: "#c98a00",
1167
+ blue: "#1c7ed6",
1168
+ purple: "#7048e8",
1169
+ pink: "#d6336c",
1170
+ green: "#2f9e44",
1171
+ grey: "#868e96"
1172
+ }, Mt = {
1173
+ red: "rgba(224, 49, 49, 0.12)",
1174
+ orange: "rgba(232, 89, 12, 0.12)",
1175
+ yellow: "rgba(201, 138, 0, 0.15)",
1176
+ blue: "rgba(28, 126, 214, 0.12)",
1177
+ purple: "rgba(112, 72, 232, 0.12)",
1178
+ pink: "rgba(214, 51, 108, 0.12)",
1179
+ green: "rgba(47, 158, 68, 0.12)",
1180
+ grey: "rgba(134, 142, 150, 0.16)"
1181
+ };
1182
+ function Nt(e) {
1183
+ let t = jt[e?.color] ?? (e?.color || ""), n = Mt[e?.background] ?? (e?.background || "");
1184
+ return {
1185
+ ...t && { color: t },
1186
+ ...n && {
1187
+ backgroundColor: n,
1188
+ padding: "8px 12px",
1189
+ borderRadius: "8px"
1190
+ }
1191
+ };
1192
+ }
1193
+ function Pt(e = [], t, n) {
1194
+ let r = n ?? ((e, n) => Tt(e, n, t));
1152
1195
  return e.map((n, i) => {
1153
1196
  let a = {
1154
1197
  marginTop: 0,
@@ -1170,7 +1213,7 @@ function At(e = [], t, n) {
1170
1213
  marginLeft: 0,
1171
1214
  marginRight: 0,
1172
1215
  ...a,
1173
- ...kt(n)
1216
+ ...At(n)
1174
1217
  },
1175
1218
  children: [n.href ? /* @__PURE__ */ d("a", {
1176
1219
  href: n.href,
@@ -1189,16 +1232,16 @@ function At(e = [], t, n) {
1189
1232
  })]
1190
1233
  }, i);
1191
1234
  }
1192
- if (n.type === "video") return Ht(n.url) ? /* @__PURE__ */ d("div", {
1235
+ if (n.type === "video") return qt(n.url) ? /* @__PURE__ */ d("div", {
1193
1236
  style: {
1194
1237
  ...a,
1195
- ...kt({
1238
+ ...At({
1196
1239
  align: n.align,
1197
1240
  wrap: n.wrap,
1198
1241
  width: n.width ?? 100
1199
1242
  })
1200
1243
  },
1201
- children: /* @__PURE__ */ d(Ut, {
1244
+ children: /* @__PURE__ */ d(Jt, {
1202
1245
  url: n.url,
1203
1246
  autoplay: n.autoplay,
1204
1247
  muted: n.muted,
@@ -1256,32 +1299,60 @@ function At(e = [], t, n) {
1256
1299
  if (n.type === "table") {
1257
1300
  let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
1258
1301
  if (!e.length) return null;
1259
- let t = n.header !== !1, o = {
1260
- border: n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
1261
- padding: "6px 10px",
1302
+ let t = n.header !== !1, o = n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)", s = Number.isFinite(n.padX) ? Math.max(0, n.padX) : 10, c = Number.isFinite(n.padY) ? Math.max(0, n.padY) : 6, l = Math.max(0, Number(n.spacing) || 0), u = {
1303
+ border: o,
1304
+ padding: `${c}px ${s}px`,
1262
1305
  verticalAlign: "top"
1263
- }, s = t ? e.slice(1) : e, c = Array.isArray(n.widths) ? n.widths : null, l = (e, t, r) => ({
1264
- ...o,
1265
- ...Ot(Dt(n, e, t), r)
1266
- });
1306
+ }, p = Array.isArray(n.heights) ? n.heights : null, m = (e) => {
1307
+ let t = Number(p?.[e]);
1308
+ return Number.isFinite(t) && t > 0 ? { height: `${t}px` } : void 0;
1309
+ }, h = t ? e.slice(1) : e, g = Array.isArray(n.widths) ? n.widths : null, _ = (e, t, r) => ({
1310
+ ...u,
1311
+ ...kt(Ot(n, e, t), r)
1312
+ }), v = n.spans && typeof n.spans == "object" ? n.spans : null, y = /* @__PURE__ */ new Set();
1313
+ v && e.forEach((e, t) => e.forEach((e, n) => {
1314
+ let r = v[`${t}:${n}`];
1315
+ if (!r) return;
1316
+ let i = Math.max(1, Number(r.c) || 1), a = Math.max(1, Number(r.r) || 1);
1317
+ for (let e = 0; e < a; e += 1) for (let r = 0; r < i; r += 1) (e || r) && y.add(`${t + e}:${n + r}`);
1318
+ }));
1319
+ let b = (e, t) => {
1320
+ let n = v?.[`${e}:${t}`], r = Math.max(1, Number(n?.c) || 1), i = Math.max(1, Number(n?.r) || 1);
1321
+ return {
1322
+ colSpan: r > 1 ? r : void 0,
1323
+ rowSpan: i > 1 ? i : void 0
1324
+ };
1325
+ };
1267
1326
  return /* @__PURE__ */ f("table", {
1268
1327
  style: {
1269
1328
  ...a,
1270
- borderCollapse: "collapse",
1329
+ borderCollapse: l ? "separate" : "collapse",
1330
+ borderSpacing: l ? `${l}px` : void 0,
1271
1331
  width: "100%",
1272
1332
  fontSize: "inherit",
1273
- tableLayout: c ? "fixed" : void 0
1333
+ tableLayout: g ? "fixed" : void 0
1274
1334
  },
1275
1335
  children: [
1276
- c && /* @__PURE__ */ d("colgroup", { children: c.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
1277
- t && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e[0].map((e, t) => /* @__PURE__ */ d("th", {
1278
- style: l(0, t, !0),
1279
- children: Array.isArray(e) ? r(e) : e
1280
- }, t)) }) }),
1281
- /* @__PURE__ */ d("tbody", { children: s.map((e, n) => /* @__PURE__ */ d("tr", { children: e.map((e, i) => /* @__PURE__ */ d("td", {
1282
- style: l(t ? n + 1 : n, i, !1),
1283
- children: Array.isArray(e) ? r(e) : e
1284
- }, i)) }, n)) })
1336
+ g && /* @__PURE__ */ d("colgroup", { children: g.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
1337
+ t && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", {
1338
+ style: m(0),
1339
+ children: e[0].map((e, t) => y.has(`0:${t}`) ? null : /* @__PURE__ */ d("th", {
1340
+ style: _(0, t, !0),
1341
+ ...b(0, t),
1342
+ children: Array.isArray(e) ? r(e) : e
1343
+ }, t))
1344
+ }) }),
1345
+ /* @__PURE__ */ d("tbody", { children: h.map((e, n) => /* @__PURE__ */ d("tr", {
1346
+ style: m(t ? n + 1 : n),
1347
+ children: e.map((e, i) => {
1348
+ let a = t ? n + 1 : n;
1349
+ return y.has(`${a}:${i}`) ? null : /* @__PURE__ */ d("td", {
1350
+ style: _(a, i, !1),
1351
+ ...b(a, i),
1352
+ children: Array.isArray(e) ? r(e) : e
1353
+ }, i);
1354
+ })
1355
+ }, n)) })
1285
1356
  ]
1286
1357
  }, i);
1287
1358
  }
@@ -1290,7 +1361,8 @@ function At(e = [], t, n) {
1290
1361
  return /* @__PURE__ */ d(e, {
1291
1362
  style: {
1292
1363
  ...a,
1293
- paddingLeft: 24
1364
+ ...Nt(n),
1365
+ paddingLeft: n.background ? 34 : 24
1294
1366
  },
1295
1367
  start: n.type === "ol" ? n.start : void 0,
1296
1368
  children: (n.items ?? []).map((e, n) => {
@@ -1309,7 +1381,7 @@ function At(e = [], t, n) {
1309
1381
  children: e.task ? "☑" : "☐"
1310
1382
  }),
1311
1383
  r(e.parts, e.text),
1312
- e.blocks?.length ? At(e.blocks, t, r) : null
1384
+ e.blocks?.length ? Pt(e.blocks, t, r) : null
1313
1385
  ]
1314
1386
  }, n);
1315
1387
  })
@@ -1317,16 +1389,18 @@ function At(e = [], t, n) {
1317
1389
  }
1318
1390
  if (n.type === "quote") return /* @__PURE__ */ d("blockquote", {
1319
1391
  style: {
1320
- ...Nt,
1321
- ...a
1392
+ ...Lt,
1393
+ ...a,
1394
+ ...Nt(n),
1395
+ ...n.background && { paddingLeft: 20 }
1322
1396
  },
1323
- children: n.blocks?.length ? At(n.blocks, t, r) : r(n.parts, n.text)
1397
+ children: n.blocks?.length ? Pt(n.blocks, t, r) : r(n.parts, n.text)
1324
1398
  }, i);
1325
1399
  if (n.type === "code") return /* @__PURE__ */ d("pre", {
1326
1400
  "data-lang": n.lang || void 0,
1327
1401
  style: {
1328
1402
  ...a,
1329
- ...St
1403
+ ...Ct
1330
1404
  },
1331
1405
  children: /* @__PURE__ */ d("code", {
1332
1406
  style: { fontFamily: "inherit" },
@@ -1339,7 +1413,8 @@ function At(e = [], t, n) {
1339
1413
  style: {
1340
1414
  ...ct,
1341
1415
  fontSize: ut(n.type),
1342
- ...a
1416
+ ...a,
1417
+ ...Nt(n)
1343
1418
  },
1344
1419
  children: r(n.parts, n.text)
1345
1420
  }, i);
@@ -1347,23 +1422,24 @@ function At(e = [], t, n) {
1347
1422
  return /* @__PURE__ */ d("p", {
1348
1423
  style: {
1349
1424
  ...dt,
1350
- ...a
1425
+ ...a,
1426
+ ...Nt(n)
1351
1427
  },
1352
1428
  children: r(n.parts, n.text)
1353
1429
  }, i);
1354
1430
  });
1355
1431
  }
1356
- function jt({ content: e, style: t, linked: n, nodeRef: r }) {
1432
+ function Ft({ content: e, style: t, linked: n, nodeRef: r }) {
1357
1433
  return /* @__PURE__ */ d("div", {
1358
1434
  ref: r,
1359
1435
  style: {
1360
1436
  display: "flow-root",
1361
1437
  ...P(t)
1362
1438
  },
1363
- children: At(e, n)
1439
+ children: Pt(e, n)
1364
1440
  });
1365
1441
  }
1366
- function Mt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
1442
+ function It({ markdown: e, newTab: t, style: n, nodeRef: r }) {
1367
1443
  let i = s(() => Le(e, { newTab: t }), [e, t]);
1368
1444
  return /* @__PURE__ */ d("div", {
1369
1445
  ref: r,
@@ -1371,25 +1447,25 @@ function Mt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
1371
1447
  display: "flow-root",
1372
1448
  ...P(n)
1373
1449
  },
1374
- children: At(i)
1450
+ children: Pt(i)
1375
1451
  });
1376
1452
  }
1377
- var Nt = {
1453
+ var Lt = {
1378
1454
  margin: 0,
1379
1455
  padding: "8px 0 8px 20px",
1380
1456
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
1381
1457
  };
1382
- function Pt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1458
+ function Rt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1383
1459
  return /* @__PURE__ */ d("blockquote", {
1384
1460
  ref: i,
1385
1461
  style: {
1386
- ...Nt,
1462
+ ...Lt,
1387
1463
  ...P(n)
1388
1464
  },
1389
- children: wt(t, e, r)
1465
+ children: Tt(t, e, r)
1390
1466
  });
1391
1467
  }
1392
- function Ft({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1468
+ function zt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1393
1469
  return /* @__PURE__ */ d(e ? "ol" : "ul", {
1394
1470
  ref: r,
1395
1471
  style: {
@@ -1399,40 +1475,45 @@ function Ft({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1399
1475
  },
1400
1476
  children: t.map((e, t) => /* @__PURE__ */ d("li", {
1401
1477
  style: { marginBottom: 4 },
1402
- children: wt(e.parts, e.text)
1478
+ children: Tt(e.parts, e.text)
1403
1479
  }, t))
1404
1480
  });
1405
1481
  }
1406
- function It({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1482
+ function Bt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1407
1483
  return /* @__PURE__ */ d("p", {
1408
1484
  ref: i,
1409
1485
  style: {
1410
1486
  ...dt,
1411
1487
  ...P(n)
1412
1488
  },
1413
- children: wt(t, e, r)
1489
+ children: Tt(t, e, r)
1414
1490
  });
1415
1491
  }
1416
- var Lt = {
1492
+ var Vt = {
1493
+ display: "block",
1494
+ color: "inherit",
1495
+ textDecoration: "none",
1496
+ cursor: "pointer"
1497
+ }, Ht = {
1417
1498
  color: "var(--page-accent, inherit)",
1418
1499
  textDecoration: "underline",
1419
1500
  textUnderlineOffset: 3,
1420
1501
  cursor: "pointer"
1421
1502
  };
1422
- function Rt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1503
+ function Ut({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1423
1504
  return /* @__PURE__ */ d("a", {
1424
1505
  ref: o,
1425
1506
  href: n || "#",
1426
1507
  target: r || void 0,
1427
1508
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
1428
1509
  style: {
1429
- ...Lt,
1510
+ ...Ht,
1430
1511
  ...P(i)
1431
1512
  },
1432
- children: wt(t, e, a)
1513
+ children: Tt(t, e, a)
1433
1514
  });
1434
1515
  }
1435
- function zt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1516
+ function Wt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1436
1517
  return /* @__PURE__ */ d("a", {
1437
1518
  ref: o,
1438
1519
  href: n || "#",
@@ -1442,10 +1523,10 @@ function zt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
1442
1523
  ...ft,
1443
1524
  ...P(i)
1444
1525
  },
1445
- children: wt(t, e, a)
1526
+ children: Tt(t, e, a)
1446
1527
  });
1447
1528
  }
1448
- function Bt({ src: e, alt: t, style: n, nodeRef: r }) {
1529
+ function Gt({ src: e, alt: t, style: n, nodeRef: r }) {
1449
1530
  return e ? /* @__PURE__ */ d("img", {
1450
1531
  ref: r,
1451
1532
  src: e,
@@ -1457,7 +1538,7 @@ function Bt({ src: e, alt: t, style: n, nodeRef: r }) {
1457
1538
  }
1458
1539
  }) : null;
1459
1540
  }
1460
- function Vt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1541
+ function Kt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1461
1542
  return e ? /* @__PURE__ */ d("video", {
1462
1543
  ref: s,
1463
1544
  src: e,
@@ -1475,9 +1556,9 @@ function Vt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
1475
1556
  }
1476
1557
  }) : null;
1477
1558
  }
1478
- var Ht = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1479
- function Ut({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1480
- let c = Ht(e);
1559
+ var qt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1560
+ function Jt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1561
+ let c = qt(e);
1481
1562
  if (!c) return null;
1482
1563
  let l = new URLSearchParams({ rel: "0" });
1483
1564
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
@@ -1503,7 +1584,7 @@ function Ut({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
1503
1584
  })
1504
1585
  });
1505
1586
  }
1506
- function Wt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1587
+ function Yt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1507
1588
  return e ? /* @__PURE__ */ d("iframe", {
1508
1589
  ref: i,
1509
1590
  src: e,
@@ -1519,15 +1600,15 @@ function Wt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1519
1600
  }
1520
1601
  }) : null;
1521
1602
  }
1522
- var Gt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
1523
- function Kt(e) {
1524
- return `@scope ([data-wb-embed]) {\n${e.replace(Gt, "$1:scope")}\n}`;
1603
+ var Xt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
1604
+ function Zt(e) {
1605
+ return `@scope ([data-wb-embed]) {\n${e.replace(Xt, "$1:scope")}\n}`;
1525
1606
  }
1526
- function qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
1607
+ function Qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: i }) {
1527
1608
  let [o, s] = l(null);
1528
1609
  return a(() => {
1529
1610
  o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
1530
- e.textContent = Kt(e.textContent || "");
1611
+ e.textContent = Zt(e.textContent || "");
1531
1612
  })) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
1532
1613
  let t = document.createElement("script");
1533
1614
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
@@ -1545,7 +1626,7 @@ function qt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRe
1545
1626
  style: P(r)
1546
1627
  });
1547
1628
  }
1548
- function Jt({ height: e, style: t, nodeRef: n }) {
1629
+ function $t({ height: e, style: t, nodeRef: n }) {
1549
1630
  return /* @__PURE__ */ d("div", {
1550
1631
  ref: n,
1551
1632
  style: {
@@ -1556,7 +1637,7 @@ function Jt({ height: e, style: t, nodeRef: n }) {
1556
1637
  }
1557
1638
  });
1558
1639
  }
1559
- function Yt({ style: e, nodeRef: t }) {
1640
+ function en({ style: e, nodeRef: t }) {
1560
1641
  return /* @__PURE__ */ d("div", {
1561
1642
  ref: t,
1562
1643
  style: {
@@ -1567,7 +1648,7 @@ function Yt({ style: e, nodeRef: t }) {
1567
1648
  }
1568
1649
  });
1569
1650
  }
1570
- function Xt({ style: e, nodeRef: t }) {
1651
+ function tn({ style: e, nodeRef: t }) {
1571
1652
  return /* @__PURE__ */ d("div", {
1572
1653
  ref: t,
1573
1654
  style: {
@@ -1576,7 +1657,7 @@ function Xt({ style: e, nodeRef: t }) {
1576
1657
  }
1577
1658
  });
1578
1659
  }
1579
- var Zt = {
1660
+ var nn = {
1580
1661
  position: "absolute",
1581
1662
  top: "50%",
1582
1663
  transform: "translateY(-50%)",
@@ -1593,7 +1674,7 @@ var Zt = {
1593
1674
  alignItems: "center",
1594
1675
  justifyContent: "center",
1595
1676
  padding: 0
1596
- }, Qt = {
1677
+ }, rn = {
1597
1678
  bottom: {
1598
1679
  inset: "auto 0 0 0",
1599
1680
  padding: "40px 24px 20px",
@@ -1612,8 +1693,8 @@ var Zt = {
1612
1693
  padding: 24,
1613
1694
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1614
1695
  }
1615
- }, $t = 48;
1616
- function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1696
+ }, an = 48;
1697
+ function on({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1617
1698
  let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
1618
1699
  if (a(() => {
1619
1700
  if (!n || h || _ || e < 2) return;
@@ -1629,7 +1710,7 @@ function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1629
1710
  let b = (t) => m((t + e) % e), x = () => {
1630
1711
  if (!_) return;
1631
1712
  let { dx: e } = _;
1632
- v(null), e < -48 ? b(y + 1) : e > $t && b(y - 1);
1713
+ v(null), e < -48 ? b(y + 1) : e > an && b(y - 1);
1633
1714
  };
1634
1715
  return /* @__PURE__ */ f("div", {
1635
1716
  ref: c,
@@ -1678,7 +1759,7 @@ function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1678
1759
  type: "button",
1679
1760
  "aria-label": "Previous slide",
1680
1761
  style: {
1681
- ...Zt,
1762
+ ...nn,
1682
1763
  left: 12
1683
1764
  },
1684
1765
  onClick: () => b(y - 1),
@@ -1688,7 +1769,7 @@ function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1688
1769
  type: "button",
1689
1770
  "aria-label": "Next slide",
1690
1771
  style: {
1691
- ...Zt,
1772
+ ...nn,
1692
1773
  right: 12
1693
1774
  },
1694
1775
  onClick: () => b(y + 1),
@@ -1722,7 +1803,7 @@ function en({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1722
1803
  ] })]
1723
1804
  });
1724
1805
  }
1725
- var tn = (e, t) => ({
1806
+ var sn = (e, t) => ({
1726
1807
  position: "absolute",
1727
1808
  inset: 0,
1728
1809
  backgroundImage: e ? `url(${e})` : "none",
@@ -1730,18 +1811,18 @@ var tn = (e, t) => ({
1730
1811
  backgroundSize: "cover",
1731
1812
  backgroundPosition: "center"
1732
1813
  });
1733
- function nn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1734
- return e.length ? /* @__PURE__ */ d(en, {
1814
+ function cn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1815
+ return e.length ? /* @__PURE__ */ d(on, {
1735
1816
  ...r,
1736
1817
  count: e.length,
1737
1818
  renderSlide: (r) => {
1738
1819
  let i = e[r];
1739
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1820
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: sn(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1740
1821
  style: {
1741
1822
  position: "absolute",
1742
1823
  color: "#fff",
1743
1824
  textAlign: n,
1744
- ...Qt[t] ?? Qt.bottom
1825
+ ...rn[t] ?? rn.bottom
1745
1826
  },
1746
1827
  children: [i.title && /* @__PURE__ */ d("div", {
1747
1828
  style: {
@@ -1761,13 +1842,13 @@ function nn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1761
1842
  }
1762
1843
  }) : null;
1763
1844
  }
1764
- function rn({ slides: e = [], linked: t, ...n }) {
1765
- return e.length ? /* @__PURE__ */ d(en, {
1845
+ function ln({ slides: e = [], linked: t, ...n }) {
1846
+ return e.length ? /* @__PURE__ */ d(on, {
1766
1847
  ...n,
1767
1848
  count: e.length,
1768
1849
  renderSlide: (n) => {
1769
1850
  let r = e[n];
1770
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: tn(r.image, r.color) }), /* @__PURE__ */ d("div", {
1851
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: sn(r.image, r.color) }), /* @__PURE__ */ d("div", {
1771
1852
  style: {
1772
1853
  position: "absolute",
1773
1854
  inset: 0,
@@ -1779,23 +1860,23 @@ function rn({ slides: e = [], linked: t, ...n }) {
1779
1860
  }
1780
1861
  }) : null;
1781
1862
  }
1782
- var an = 256, on = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), sn = (e, t, n) => {
1783
- let r = an * 2 ** n;
1863
+ var un = 256, dn = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), fn = (e, t, n) => {
1864
+ let r = un * 2 ** n;
1784
1865
  return {
1785
1866
  x: (Number(t) + 180) / 360 * r,
1786
- y: (.5 - on(Number(e)) / (2 * Math.PI)) * r
1867
+ y: (.5 - dn(Number(e)) / (2 * Math.PI)) * r
1787
1868
  };
1788
1869
  }, $ = (e, t) => {
1789
1870
  if (e === "" || e == null) return null;
1790
1871
  let n = Number(e);
1791
1872
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1792
- }, cn = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1793
- function ln(e, t, n = "directions", r = "") {
1873
+ }, pn = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1874
+ function mn(e, t, n = "directions", r = "") {
1794
1875
  let i = `${e},${t}`;
1795
1876
  return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
1796
1877
  }
1797
- var un = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1798
- function dn({ 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 }) {
1878
+ var hn = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1879
+ function gn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1799
1880
  let _ = c(null), [v, y] = l(1200);
1800
1881
  a(() => {
1801
1882
  let e = _.current;
@@ -1805,7 +1886,7 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1805
1886
  let n = new ResizeObserver(t);
1806
1887
  return n.observe(e), () => n.disconnect();
1807
1888
  }, []);
1808
- let b = (Array.isArray(e) ? e : []).filter(cn), x = cn({
1889
+ let b = (Array.isArray(e) ? e : []).filter(pn), x = pn({
1809
1890
  lat: t,
1810
1891
  lng: n
1811
1892
  }) ? {
@@ -1817,7 +1898,7 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1817
1898
  } : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1818
1899
  if (b.length < 2) return 13;
1819
1900
  for (let e = 19; e >= 1; e--) {
1820
- let t = b.map((t) => sn($(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));
1901
+ let t = b.map((t) => fn($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1821
1902
  if (n <= v * .8 && r <= S * .7) return e;
1822
1903
  }
1823
1904
  return 1;
@@ -1841,12 +1922,12 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1841
1922
  },
1842
1923
  children: "Set the coordinates in Settings"
1843
1924
  });
1844
- let T = sn(x.lat, x.lng, C), E = {
1925
+ let T = fn(x.lat, x.lng, C), E = {
1845
1926
  x: T.x - v / 2,
1846
1927
  y: T.y - S / 2
1847
1928
  }, D = [], O = [];
1848
- for (let e = Math.floor(E.x / an); e <= Math.floor((E.x + v) / an); e++) D.push(e);
1849
- for (let e = Math.floor(E.y / an); e <= Math.floor((E.y + S) / an); e++) O.push(e);
1929
+ for (let e = Math.floor(E.x / un); e <= Math.floor((E.x + v) / un); e++) D.push(e);
1930
+ for (let e = Math.floor(E.y / un); e <= Math.floor((E.y + S) / un); e++) O.push(e);
1850
1931
  let k = 2 ** C;
1851
1932
  return /* @__PURE__ */ f("div", {
1852
1933
  ref: (e) => {
@@ -1869,22 +1950,22 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1869
1950
  return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
1870
1951
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1871
1952
  alt: "",
1872
- width: an,
1873
- height: an,
1953
+ width: un,
1954
+ height: un,
1874
1955
  loading: "lazy",
1875
1956
  style: {
1876
1957
  position: "absolute",
1877
- left: Math.round(t * an - E.x),
1878
- top: Math.round(e * an - E.y),
1879
- width: an,
1880
- height: an,
1958
+ left: Math.round(t * un - E.x),
1959
+ top: Math.round(e * un - E.y),
1960
+ width: un,
1961
+ height: un,
1881
1962
  userSelect: "none",
1882
1963
  pointerEvents: "none"
1883
1964
  }
1884
1965
  }, `${t}-${e}`);
1885
1966
  })),
1886
1967
  b.map((e, t) => {
1887
- let n = sn($(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 : ln($(e.lat, 90), $(e.lng, 180), s, e.title);
1968
+ let n = fn($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : mn($(e.lat, 90), $(e.lng, 180), s, e.title);
1888
1969
  return /* @__PURE__ */ f(c ? "a" : "span", {
1889
1970
  href: c || void 0,
1890
1971
  target: c ? "_blank" : void 0,
@@ -1923,8 +2004,8 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1923
2004
  viewBox: "0 0 24 24",
1924
2005
  fill: a,
1925
2006
  style: { display: "block" },
1926
- children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), fn[e.icon] ? /* @__PURE__ */ d("path", {
1927
- d: fn[e.icon],
2007
+ children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), _n[e.icon] ? /* @__PURE__ */ d("path", {
2008
+ d: _n[e.icon],
1928
2009
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1929
2010
  fill: "none",
1930
2011
  stroke: "#fff",
@@ -1960,7 +2041,7 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1960
2041
  })
1961
2042
  ]
1962
2043
  }), u ? /* @__PURE__ */ d("a", {
1963
- href: un(x.lat, x.lng, C),
2044
+ href: hn(x.lat, x.lng, C),
1964
2045
  target: "_blank",
1965
2046
  rel: "noopener noreferrer",
1966
2047
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1974,7 +2055,7 @@ function dn({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1974
2055
  }) : null]
1975
2056
  });
1976
2057
  }
1977
- var fn = {
2058
+ var _n = {
1978
2059
  check: "M4 12l5 5L20 6",
1979
2060
  close: "M6 6l12 12M18 6L6 18",
1980
2061
  plus: "M12 5v14M5 12h14",
@@ -2071,8 +2152,8 @@ var fn = {
2071
2152
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
2072
2153
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
2073
2154
  };
2074
- function pn({ 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 }) {
2075
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [fn[e] ?? fn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
2155
+ function vn({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
2156
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [_n[e] ?? _n.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
2076
2157
  viewBox: "0 0 24 24",
2077
2158
  width: g,
2078
2159
  height: g,
@@ -2108,7 +2189,7 @@ function pn({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
2108
2189
  children: v
2109
2190
  });
2110
2191
  }
2111
- function mn(e, t = {}, n = 0) {
2192
+ function yn(e, t = {}, n = 0) {
2112
2193
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ot(e), a = Math.max(0, Number(n) || 0), o = [];
2113
2194
  for (let e of r) {
2114
2195
  let n = e.data ?? e, r = it(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(it(n, t.nameField)) : i(n.name), l = t.hrefField ? i(it(n, t.hrefField)) : "";
@@ -2121,7 +2202,7 @@ function mn(e, t = {}, n = 0) {
2121
2202
  }
2122
2203
  return o;
2123
2204
  }
2124
- function hn({ 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 }) {
2205
+ function bn({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
2125
2206
  let { tenant: x, apiUrl: S } = i(Q), C = i(Qe)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
2126
2207
  a(() => {
2127
2208
  if (!t || C) return;
@@ -2139,7 +2220,7 @@ function hn({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
2139
2220
  C
2140
2221
  ]);
2141
2222
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
2142
- let e = mn(k, {
2223
+ let e = yn(k, {
2143
2224
  imageField: r,
2144
2225
  nameField: o,
2145
2226
  hrefField: s
@@ -2344,19 +2425,19 @@ function hn({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
2344
2425
  ]
2345
2426
  });
2346
2427
  }
2347
- var gn = {
2428
+ var xn = {
2348
2429
  color: "inherit",
2349
2430
  textDecoration: "none",
2350
2431
  fontSize: 14,
2351
2432
  opacity: .85
2352
- }, _n = {
2433
+ }, Sn = {
2353
2434
  background: "var(--page-surface, #f2f2f2)",
2354
2435
  color: "var(--page-text, #111827)",
2355
2436
  border: "1px solid rgba(148, 163, 184, 0.25)",
2356
2437
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2357
2438
  zIndex: 60
2358
2439
  };
2359
- function vn(e, t = {}, n = "dropdown") {
2440
+ function Cn(e, t = {}, n = "dropdown") {
2360
2441
  let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : ot(e), o = r.map((e) => {
2361
2442
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2362
2443
  return {
@@ -2398,7 +2479,7 @@ function vn(e, t = {}, n = "dropdown") {
2398
2479
  type: e.children.length ? n : "link"
2399
2480
  }));
2400
2481
  }
2401
- function yn({ 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" }) {
2482
+ function wn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2402
2483
  let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(Q), N = i(Qe)?.[g], [F, I] = l(null);
2403
2484
  a(() => {
2404
2485
  if (!g || N) return;
@@ -2419,7 +2500,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2419
2500
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2420
2501
  return e.observe(C), () => e.disconnect();
2421
2502
  }, [C, h]);
2422
- let L = g ? vn(N ?? F ?? [], {
2503
+ let L = g ? Cn(N ?? F ?? [], {
2423
2504
  labelField: _,
2424
2505
  hrefField: v,
2425
2506
  imageField: y,
@@ -2448,7 +2529,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2448
2529
  return /* @__PURE__ */ f("a", {
2449
2530
  href: e.href || "#",
2450
2531
  style: {
2451
- ...gn,
2532
+ ...xn,
2452
2533
  display: n ? "block" : "flex",
2453
2534
  alignItems: n ? void 0 : "center",
2454
2535
  gap: n ? void 0 : 10,
@@ -2545,7 +2626,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2545
2626
  let t = e.children ?? [];
2546
2627
  if (!t.length) return /* @__PURE__ */ d("a", {
2547
2628
  href: e.href || "#",
2548
- style: gn,
2629
+ style: xn,
2549
2630
  children: e.label
2550
2631
  }, e.key);
2551
2632
  let n = e.type === "mega";
@@ -2559,7 +2640,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2559
2640
  children: [/* @__PURE__ */ f("a", {
2560
2641
  href: e.href || "#",
2561
2642
  style: {
2562
- ...gn,
2643
+ ...xn,
2563
2644
  cursor: "pointer"
2564
2645
  },
2565
2646
  children: [
@@ -2575,7 +2656,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2575
2656
  ]
2576
2657
  }), k === e.key && (n ? /* @__PURE__ */ d("div", {
2577
2658
  style: {
2578
- ..._n,
2659
+ ...Sn,
2579
2660
  position: "absolute",
2580
2661
  left: 0,
2581
2662
  right: 0,
@@ -2591,7 +2672,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2591
2672
  }, !0))
2592
2673
  }) : /* @__PURE__ */ d("div", {
2593
2674
  style: {
2594
- ..._n,
2675
+ ...Sn,
2595
2676
  position: "absolute",
2596
2677
  top: "100%",
2597
2678
  left: 0,
@@ -2620,7 +2701,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2620
2701
  children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
2621
2702
  href: e.href || "#",
2622
2703
  style: {
2623
- ...gn,
2704
+ ...xn,
2624
2705
  padding: "10px 4px",
2625
2706
  fontWeight: (e.children ?? []).length ? 600 : 400,
2626
2707
  opacity: 1
@@ -2631,7 +2712,7 @@ function yn({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2631
2712
  ]
2632
2713
  });
2633
2714
  }
2634
- function bn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2715
+ function Tn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2635
2716
  let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2636
2717
  return e.length ? /* @__PURE__ */ f("div", {
2637
2718
  ref: r,
@@ -2671,13 +2752,13 @@ function bn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2671
2752
  }, e.key))]
2672
2753
  }) : null;
2673
2754
  }
2674
- function xn({ 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 }) {
2755
+ function En({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
2675
2756
  let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
2676
2757
  if (!e.length) return null;
2677
2758
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2678
2759
  let n = Number(e);
2679
2760
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2680
- }, b = fn[r], x = (e) => _((t) => {
2761
+ }, b = _n[r], x = (e) => _((t) => {
2681
2762
  let r = new Set(n ? t : []);
2682
2763
  return t.has(e) ? r.delete(e) : r.add(e), r;
2683
2764
  });
@@ -2752,15 +2833,15 @@ function xn({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2752
2833
  })
2753
2834
  });
2754
2835
  }
2755
- var Sn = {
2836
+ var Dn = {
2756
2837
  display: "flex",
2757
2838
  flexDirection: "column",
2758
2839
  gap: "12px"
2759
- }, Cn = {
2840
+ }, On = {
2760
2841
  fontSize: "14px",
2761
2842
  fontWeight: 500,
2762
2843
  color: "var(--page-text, #111827)"
2763
- }, wn = {
2844
+ }, kn = {
2764
2845
  padding: "10px 12px",
2765
2846
  border: "1px solid var(--page-border, #d1d5db)",
2766
2847
  borderRadius: "6px",
@@ -2770,18 +2851,18 @@ var Sn = {
2770
2851
  boxSizing: "border-box",
2771
2852
  backgroundColor: "var(--page-surface, #f2f2f2)",
2772
2853
  color: "var(--page-text, #111827)"
2773
- }, Tn = {
2854
+ }, An = {
2774
2855
  display: "flex",
2775
2856
  alignItems: "center",
2776
2857
  gap: "8px",
2777
2858
  fontSize: "14px",
2778
2859
  color: "var(--page-text, #111827)"
2779
- }, En = (e) => e ? {
2860
+ }, jn = (e) => e ? {
2780
2861
  readOnly: !0,
2781
2862
  tabIndex: -1,
2782
2863
  onMouseDown: (e) => e.preventDefault()
2783
2864
  } : {};
2784
- function Dn(e, t) {
2865
+ function Mn(e, t) {
2785
2866
  if (!e) return !0;
2786
2867
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2787
2868
  switch (e.op) {
@@ -2795,11 +2876,11 @@ function Dn(e, t) {
2795
2876
  default: return !1;
2796
2877
  }
2797
2878
  }
2798
- var On = {
2879
+ var Nn = {
2799
2880
  display: "flex",
2800
2881
  flexDirection: "column",
2801
2882
  gap: 6
2802
- }, kn = {
2883
+ }, Pn = {
2803
2884
  font: "inherit",
2804
2885
  fontSize: 15,
2805
2886
  padding: "10px 12px",
@@ -2810,17 +2891,17 @@ var On = {
2810
2891
  width: "100%",
2811
2892
  boxSizing: "border-box"
2812
2893
  };
2813
- function An(e, t) {
2894
+ function Fn(e, t) {
2814
2895
  let n = Array.isArray(e?.options) ? e.options : [];
2815
2896
  if (!e?.parentField) return n;
2816
2897
  let r = t?.[e.parentField];
2817
2898
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2818
2899
  }
2819
- var jn = "g-recaptcha-response", Mn = (e) => e?.type === "recaptcha" ? jn : e?.name;
2820
- function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2900
+ var In = "g-recaptcha-response", Ln = (e) => e?.type === "recaptcha" ? In : e?.name;
2901
+ function Rn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2821
2902
  let a = /* @__PURE__ */ f("span", {
2822
2903
  style: {
2823
- ...Cn,
2904
+ ...On,
2824
2905
  fontSize: 14
2825
2906
  },
2826
2907
  children: [e.label, e.required ? " *" : ""]
@@ -2829,7 +2910,7 @@ function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2829
2910
  required: e.required || void 0,
2830
2911
  placeholder: e.placeholder || void 0,
2831
2912
  disabled: r || void 0,
2832
- style: kn,
2913
+ style: Pn,
2833
2914
  value: t ?? "",
2834
2915
  onChange: (t) => n(e.name, t.target.value)
2835
2916
  };
@@ -2858,12 +2939,12 @@ function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2858
2939
  borderRadius: 8,
2859
2940
  display: "block"
2860
2941
  }
2861
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Rn, {
2942
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Un, {
2862
2943
  theme: e.captchaTheme,
2863
2944
  size: e.captchaSize,
2864
2945
  inert: r,
2865
- onChange: (e) => n(jn, e)
2866
- }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Ut, {
2946
+ onChange: (e) => n(In, e)
2947
+ }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Jt, {
2867
2948
  url: e.src,
2868
2949
  style: { width: "100%" }
2869
2950
  }) : /* @__PURE__ */ d("video", {
@@ -2875,14 +2956,14 @@ function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2875
2956
  display: "block"
2876
2957
  }
2877
2958
  }) : null : /* @__PURE__ */ f("label", {
2878
- style: On,
2959
+ style: Nn,
2879
2960
  children: [
2880
2961
  a,
2881
2962
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
2882
2963
  ...o,
2883
2964
  rows: 4,
2884
2965
  style: {
2885
- ...kn,
2966
+ ...Pn,
2886
2967
  resize: "vertical"
2887
2968
  }
2888
2969
  }) : e.type === "select" ? /* @__PURE__ */ f("select", {
@@ -2891,7 +2972,7 @@ function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2891
2972
  children: [/* @__PURE__ */ d("option", {
2892
2973
  value: "",
2893
2974
  children: e.placeholder || "—"
2894
- }), An(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2975
+ }), Fn(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2895
2976
  value: typeof e == "string" ? e : e.value,
2896
2977
  children: typeof e == "string" ? e : e.label ?? e.value
2897
2978
  }, t))]
@@ -2938,7 +3019,7 @@ function Nn({ field: e, value: t, onChange: n, inert: r, values: i }) {
2938
3019
  ]
2939
3020
  });
2940
3021
  }
2941
- function Pn({ 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 }) {
3022
+ function zn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2942
3023
  let { tenant: y, apiUrl: b } = i(Q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
2943
3024
  a(() => {
2944
3025
  if (!c || !s) return;
@@ -2960,11 +3041,11 @@ function Pn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2960
3041
  section: e,
2961
3042
  fields: []
2962
3043
  }) : A[A.length - 1].fields.push(e);
2963
- let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Dn(e.section.condition, T)).map((e) => ({
3044
+ let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Mn(e.section.condition, T)).map((e) => ({
2964
3045
  ...e,
2965
- fields: e.fields.filter((e) => Dn(e.condition, T))
3046
+ fields: e.fields.filter((e) => Mn(e.condition, T))
2966
3047
  })), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
2967
- let t = T[Mn(e)];
3048
+ let t = T[Ln(e)];
2968
3049
  return e.required && (t == null || t === "" || t === !1);
2969
3050
  }), R = F >= M.length - 1, z = (e, t) => E((n) => {
2970
3051
  let r = {
@@ -3020,11 +3101,11 @@ function Pn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
3020
3101
  }
3021
3102
  },
3022
3103
  style: {
3023
- ...Sn,
3104
+ ...Dn,
3024
3105
  display: k === "success" ? "none" : "flex"
3025
3106
  },
3026
3107
  children: c && s ? /* @__PURE__ */ f(u, { children: [
3027
- N && /* @__PURE__ */ d(pr, {
3108
+ N && /* @__PURE__ */ d(vr, {
3028
3109
  steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
3029
3110
  active: F + 1,
3030
3111
  style: { marginBottom: 8 }
@@ -3037,9 +3118,9 @@ function Pn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
3037
3118
  },
3038
3119
  children: M[F].section.help
3039
3120
  }),
3040
- I.map((e) => /* @__PURE__ */ d(Nn, {
3121
+ I.map((e) => /* @__PURE__ */ d(Rn, {
3041
3122
  field: e,
3042
- value: T[Mn(e)],
3123
+ value: T[Ln(e)],
3043
3124
  values: T,
3044
3125
  onChange: z,
3045
3126
  inert: h
@@ -3110,10 +3191,10 @@ function Pn({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
3110
3191
  ]
3111
3192
  });
3112
3193
  }
3113
- var Fn = null, In = null, Ln = (e) => {
3194
+ var Bn = null, Vn = null, Hn = (e) => {
3114
3195
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
3115
- if (Fn && In === t) return Fn;
3116
- if (Fn && typeof window < "u") {
3196
+ if (Bn && Vn === t) return Bn;
3197
+ if (Bn && typeof window < "u") {
3117
3198
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
3118
3199
  delete window[e];
3119
3200
  } catch {
@@ -3121,22 +3202,22 @@ var Fn = null, In = null, Ln = (e) => {
3121
3202
  }
3122
3203
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
3123
3204
  }
3124
- return In = t, Fn = new Promise((e) => {
3205
+ return Vn = t, Bn = new Promise((e) => {
3125
3206
  if (typeof window > "u") return;
3126
3207
  if (window.grecaptcha?.render) return e(window.grecaptcha);
3127
3208
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
3128
3209
  let n = document.createElement("script");
3129
3210
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
3130
- }), Fn;
3211
+ }), Bn;
3131
3212
  };
3132
- function Rn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
3213
+ function Un({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
3133
3214
  let p = i(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
3134
3215
  if (_.current = u, a(() => {
3135
3216
  if (l || !h || !g.current) return;
3136
3217
  let e = !0, i = (t) => {
3137
3218
  e && typeof _.current == "function" && _.current(t);
3138
3219
  };
3139
- return Ln(r).then((r) => {
3220
+ return Hn(r).then((r) => {
3140
3221
  if (!(!e || !g.current || !r?.render)) {
3141
3222
  g.current.innerHTML = "", i("");
3142
3223
  try {
@@ -3218,17 +3299,17 @@ function Rn({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
3218
3299
  children: /* @__PURE__ */ d("div", { ref: g })
3219
3300
  }) : null;
3220
3301
  }
3221
- function zn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
3302
+ function Wn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
3222
3303
  return /* @__PURE__ */ d("label", {
3223
3304
  ref: r,
3224
3305
  style: {
3225
- ...Cn,
3306
+ ...On,
3226
3307
  ...P(n)
3227
3308
  },
3228
- children: wt(t, e, i)
3309
+ children: Tt(t, e, i)
3229
3310
  });
3230
3311
  }
3231
- function Bn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
3312
+ function Gn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
3232
3313
  return /* @__PURE__ */ d("input", {
3233
3314
  ref: a,
3234
3315
  type: e,
@@ -3236,13 +3317,13 @@ function Bn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
3236
3317
  placeholder: n,
3237
3318
  required: !o && !!r,
3238
3319
  style: {
3239
- ...wn,
3320
+ ...kn,
3240
3321
  ...P(i)
3241
3322
  },
3242
- ...En(o)
3323
+ ...jn(o)
3243
3324
  });
3244
3325
  }
3245
- function Vn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
3326
+ function Kn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
3246
3327
  return /* @__PURE__ */ d("textarea", {
3247
3328
  ref: a,
3248
3329
  name: e || void 0,
@@ -3250,18 +3331,18 @@ function Vn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
3250
3331
  rows: n,
3251
3332
  required: !o && !!r,
3252
3333
  style: {
3253
- ...wn,
3334
+ ...kn,
3254
3335
  resize: "vertical",
3255
3336
  ...P(i)
3256
3337
  },
3257
- ...En(o)
3338
+ ...jn(o)
3258
3339
  });
3259
3340
  }
3260
- function Hn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
3341
+ function qn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
3261
3342
  return /* @__PURE__ */ f("label", {
3262
3343
  ref: o,
3263
3344
  style: {
3264
- ...Tn,
3345
+ ...An,
3265
3346
  ...P(a)
3266
3347
  },
3267
3348
  children: [/* @__PURE__ */ d("input", {
@@ -3278,7 +3359,7 @@ function Hn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
3278
3359
  }), t]
3279
3360
  });
3280
3361
  }
3281
- function Un({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3362
+ function Jn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
3282
3363
  return /* @__PURE__ */ f("select", {
3283
3364
  ref: a,
3284
3365
  name: e || void 0,
@@ -3287,7 +3368,7 @@ function Un({ name: e, placeholder: t, options: n = [], required: r, style: i, n
3287
3368
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
3288
3369
  tabIndex: o ? -1 : void 0,
3289
3370
  style: {
3290
- ...wn,
3371
+ ...kn,
3291
3372
  appearance: "auto",
3292
3373
  ...P(i)
3293
3374
  },
@@ -3301,12 +3382,12 @@ function Un({ name: e, placeholder: t, options: n = [], required: r, style: i, n
3301
3382
  }, t))]
3302
3383
  });
3303
3384
  }
3304
- function Wn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3385
+ function Yn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
3305
3386
  let [s, c] = l(null);
3306
3387
  return /* @__PURE__ */ f("label", {
3307
3388
  ref: a,
3308
3389
  style: {
3309
- ...wn,
3390
+ ...kn,
3310
3391
  display: "flex",
3311
3392
  alignItems: "center",
3312
3393
  gap: "8px",
@@ -3333,7 +3414,7 @@ function Wn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3333
3414
  ]
3334
3415
  });
3335
3416
  }
3336
- function Gn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3417
+ function Xn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3337
3418
  return /* @__PURE__ */ d("button", {
3338
3419
  ref: n,
3339
3420
  type: r ? "button" : "submit",
@@ -3353,7 +3434,7 @@ function Gn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3353
3434
  children: e
3354
3435
  });
3355
3436
  }
3356
- function Kn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3437
+ function Zn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3357
3438
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3358
3439
  return /* @__PURE__ */ d("div", {
3359
3440
  ref: r,
@@ -3370,7 +3451,7 @@ function Kn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3370
3451
  }, t))
3371
3452
  });
3372
3453
  }
3373
- function qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3454
+ function Qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3374
3455
  let { tenant: v, apiUrl: y, locale: b } = i(Q), x = i(nt), S = i(Qe), [, C] = l(0);
3375
3456
  a(() => {
3376
3457
  if (typeof window > "u") return;
@@ -3481,7 +3562,7 @@ function qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3481
3562
  lineHeight: 1.55,
3482
3563
  opacity: .85
3483
3564
  },
3484
- children: At(a)
3565
+ children: Pt(a)
3485
3566
  })
3486
3567
  ]
3487
3568
  })]
@@ -3489,7 +3570,7 @@ function qn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3489
3570
  })
3490
3571
  });
3491
3572
  }
3492
- function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3573
+ function $n({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3493
3574
  let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : et(), s = {
3494
3575
  height: 34,
3495
3576
  padding: "0 12px",
@@ -3538,7 +3619,7 @@ function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3538
3619
  name: `f_${e.name}`,
3539
3620
  defaultValue: o[e.name] ?? "",
3540
3621
  style: s,
3541
- ...En(i),
3622
+ ...jn(i),
3542
3623
  children: [/* @__PURE__ */ d("option", {
3543
3624
  value: "",
3544
3625
  children: e.label || e.name
@@ -3553,7 +3634,7 @@ function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3553
3634
  name: `f_${e.name}`,
3554
3635
  defaultValue: o[e.name] ?? "",
3555
3636
  style: s,
3556
- ...En(i),
3637
+ ...jn(i),
3557
3638
  children: [
3558
3639
  /* @__PURE__ */ d("option", {
3559
3640
  value: "",
@@ -3574,7 +3655,7 @@ function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3574
3655
  defaultValue: o[e.name] ?? "",
3575
3656
  placeholder: e.label || e.name,
3576
3657
  style: s,
3577
- ...En(i)
3658
+ ...jn(i)
3578
3659
  }, e.name)), /* @__PURE__ */ d("button", {
3579
3660
  type: "submit",
3580
3661
  style: {
@@ -3587,12 +3668,12 @@ function Jn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3587
3668
  fontWeight: 600,
3588
3669
  cursor: i ? "default" : "pointer"
3589
3670
  },
3590
- ...En(i),
3671
+ ...jn(i),
3591
3672
  children: t
3592
3673
  })]
3593
3674
  });
3594
3675
  }
3595
- function Yn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3676
+ function er({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3596
3677
  return e.length ? /* @__PURE__ */ d("nav", {
3597
3678
  ref: r,
3598
3679
  "aria-label": "Breadcrumb",
@@ -3642,7 +3723,7 @@ function Yn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3642
3723
  })
3643
3724
  }) : null;
3644
3725
  }
3645
- function Xn({ 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 }) {
3726
+ function tr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
3646
3727
  let { tenant: g, apiUrl: _ } = i(Q), v = i(Qe), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3647
3728
  a(() => {
3648
3729
  if (!o || Number.isFinite(x)) return;
@@ -3727,15 +3808,15 @@ function Xn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
3727
3808
  ]
3728
3809
  });
3729
3810
  }
3730
- var Zn = "webim.page_mode", Qn = () => {
3811
+ var nr = "webim.page_mode", rr = () => {
3731
3812
  if (typeof window > "u") return "auto";
3732
3813
  try {
3733
- let e = window.localStorage.getItem(Zn);
3814
+ let e = window.localStorage.getItem(nr);
3734
3815
  return e === "light" || e === "dark" ? e : "auto";
3735
3816
  } catch {
3736
3817
  return "auto";
3737
3818
  }
3738
- }, $n = (e) => {
3819
+ }, ir = (e) => {
3739
3820
  let t = {
3740
3821
  width: 16,
3741
3822
  height: 16,
@@ -3767,13 +3848,13 @@ var Zn = "webim.page_mode", Qn = () => {
3767
3848
  rx: "2"
3768
3849
  }), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
3769
3850
  });
3770
- }, er = {
3851
+ }, ar = {
3771
3852
  light: "Light theme",
3772
3853
  dark: "Dark theme",
3773
3854
  auto: "Follow the device theme"
3774
3855
  };
3775
- function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3776
- let [o, s] = l(i ? "auto" : Qn), u = c(null), f = (e) => {
3856
+ function or({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3857
+ let [o, s] = l(i ? "auto" : rr), u = c(null), f = (e) => {
3777
3858
  u.current = e, typeof r == "function" && r(e);
3778
3859
  };
3779
3860
  a(() => {
@@ -3781,7 +3862,7 @@ function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3781
3862
  let e = u.current?.closest?.(".webim-page");
3782
3863
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3783
3864
  try {
3784
- o === "auto" ? window.localStorage.removeItem(Zn) : window.localStorage.setItem(Zn, o);
3865
+ o === "auto" ? window.localStorage.removeItem(nr) : window.localStorage.setItem(nr, o);
3785
3866
  } catch {}
3786
3867
  }, [o, i]);
3787
3868
  let p = t === !1 ? ["light", "dark"] : [
@@ -3816,8 +3897,8 @@ function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3816
3897
  },
3817
3898
  children: p.map((e) => /* @__PURE__ */ d("button", {
3818
3899
  type: "button",
3819
- title: er[e],
3820
- "aria-label": er[e],
3900
+ title: ar[e],
3901
+ "aria-label": ar[e],
3821
3902
  "aria-pressed": e === m,
3822
3903
  onClick: i ? void 0 : () => s(e),
3823
3904
  style: {
@@ -3828,15 +3909,15 @@ function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3828
3909
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3829
3910
  opacity: e === m ? 1 : .7
3830
3911
  },
3831
- children: $n(e)
3912
+ children: ir(e)
3832
3913
  }, e))
3833
3914
  });
3834
3915
  let g = p[(p.indexOf(m) + 1) % p.length];
3835
3916
  return /* @__PURE__ */ d("button", {
3836
3917
  ref: f,
3837
3918
  type: "button",
3838
- title: er[m],
3839
- "aria-label": `Theme: ${er[m]} — switch to ${er[g]}`,
3919
+ title: ar[m],
3920
+ "aria-label": `Theme: ${ar[m]} — switch to ${ar[g]}`,
3840
3921
  onClick: i ? void 0 : () => s(g),
3841
3922
  style: {
3842
3923
  ...h,
@@ -3845,10 +3926,10 @@ function tr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3845
3926
  border: "1px solid rgba(148, 163, 184, 0.4)",
3846
3927
  ...P(n)
3847
3928
  },
3848
- children: $n(m)
3929
+ children: ir(m)
3849
3930
  });
3850
3931
  }
3851
- function nr(e) {
3932
+ function sr(e) {
3852
3933
  let t = e?.parentElement;
3853
3934
  for (; t && t !== document.body;) {
3854
3935
  let e = getComputedStyle(t).overflowY;
@@ -3857,7 +3938,7 @@ function nr(e) {
3857
3938
  }
3858
3939
  return window;
3859
3940
  }
3860
- var rr = (e) => e === window ? window.scrollY : e.scrollTop, ir = {
3941
+ var cr = (e) => e === window ? window.scrollY : e.scrollTop, lr = {
3861
3942
  "bottom-right": (e) => ({
3862
3943
  right: e,
3863
3944
  bottom: e
@@ -3871,11 +3952,11 @@ var rr = (e) => e === window ? window.scrollY : e.scrollTop, ir = {
3871
3952
  bottom: e,
3872
3953
  transform: "translateX(-50%)"
3873
3954
  })
3874
- }, ar = {
3955
+ }, ur = {
3875
3956
  linear: (e) => e,
3876
3957
  out: (e) => 1 - (1 - e) ** 3,
3877
3958
  inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
3878
- }, or = (e) => {
3959
+ }, dr = (e) => {
3879
3960
  let t = e.getBoundingClientRect(), n = e.parentElement;
3880
3961
  for (; n && n !== document.body;) {
3881
3962
  let e = getComputedStyle(n);
@@ -3883,12 +3964,12 @@ var rr = (e) => e === window ? window.scrollY : e.scrollTop, ir = {
3883
3964
  n = n.parentElement;
3884
3965
  }
3885
3966
  return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
3886
- }, sr = (e, t) => {
3967
+ }, fr = (e, t) => {
3887
3968
  let n = typeof e == "number" ? e : parseFloat(e);
3888
3969
  return Number.isFinite(n) ? n : t;
3889
3970
  };
3890
- function cr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
3891
- let i = Math.min(Math.max(Math.round(sr(n, 0)), 0), 6);
3971
+ function pr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
3972
+ let i = Math.min(Math.max(Math.round(fr(n, 0)), 0), 6);
3892
3973
  try {
3893
3974
  return new Intl.NumberFormat(t || void 0, {
3894
3975
  minimumFractionDigits: i,
@@ -3899,8 +3980,8 @@ function cr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
3899
3980
  return e.toFixed(i);
3900
3981
  }
3901
3982
  }
3902
- function lr({ 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 }) {
3903
- let { locale: C } = i(Q), w = Math.max(sr(g, 0), 0), T = sr(e, 0), E = sr(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
3983
+ function mr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suffix: u, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
3984
+ let { locale: C } = i(Q), w = Math.max(fr(g, 0), 0), T = fr(e, 0), E = fr(t, 100), [D, O] = l(E), k = c(null), [A, j] = l(!1);
3904
3985
  return a(() => {
3905
3986
  let e = k.current;
3906
3987
  if (S || !A || !e) {
@@ -3908,7 +3989,7 @@ function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
3908
3989
  return;
3909
3990
  }
3910
3991
  O(T);
3911
- let t = Math.max(sr(n, 2e3), 0), i = Math.max(sr(r, 0), 0), a = ar[m] || ar.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
3992
+ let t = Math.max(fr(n, 2e3), 0), i = Math.max(fr(r, 0), 0), a = ur[m] || ur.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
3912
3993
  if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
3913
3994
  O(E);
3914
3995
  return;
@@ -3928,7 +4009,7 @@ function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
3928
4009
  let t = e.some((e) => e.isIntersecting);
3929
4010
  t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
3930
4011
  }, {
3931
- rootMargin: `0px 0px -${Math.min(w, Math.floor(or(e)))}px 0px`,
4012
+ rootMargin: `0px 0px -${Math.min(w, Math.floor(dr(e)))}px 0px`,
3932
4013
  threshold: w > 0 ? 0 : .3
3933
4014
  });
3934
4015
  return d.observe(e), () => {
@@ -3968,7 +4049,7 @@ function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
3968
4049
  },
3969
4050
  children: [
3970
4051
  s || "",
3971
- cr(D, {
4052
+ pr(D, {
3972
4053
  locale: C,
3973
4054
  decimals: o,
3974
4055
  separator: p
@@ -3986,7 +4067,7 @@ function lr({ from: e, to: t, duration: n, delay: r, decimals: o, prefix: s, suf
3986
4067
  }) : null]
3987
4068
  });
3988
4069
  }
3989
- function ur({ 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 }) {
4070
+ function hr({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
3990
4071
  let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
3991
4072
  b(e), typeof p == "function" && p(e);
3992
4073
  };
@@ -3997,8 +4078,8 @@ function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3997
4078
  }
3998
4079
  if (!y) return;
3999
4080
  let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
4000
- let t = nr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
4001
- v(n || rr(t) > e);
4081
+ let t = sr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
4082
+ v(n || cr(t) > e);
4002
4083
  };
4003
4084
  return t(), document.addEventListener("scroll", t, {
4004
4085
  capture: !0,
@@ -4012,7 +4093,7 @@ function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4012
4093
  ]);
4013
4094
  let S = () => {
4014
4095
  if (m) return;
4015
- let e = nr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
4096
+ let e = sr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
4016
4097
  e === window ? window.scrollTo({
4017
4098
  top: 0,
4018
4099
  behavior: n
@@ -4020,7 +4101,7 @@ function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4020
4101
  top: 0,
4021
4102
  behavior: n
4022
4103
  });
4023
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = ir[n] ? n : "bottom-right", D = h ? {
4104
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = lr[n] ? n : "bottom-right", D = h ? {
4024
4105
  position: "fixed",
4025
4106
  zIndex: 5,
4026
4107
  bottom: (h.bottom ?? 0) + C,
@@ -4033,7 +4114,7 @@ function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4033
4114
  } : {
4034
4115
  position: "fixed",
4035
4116
  zIndex: 2147482e3,
4036
- ...ir[E](C)
4117
+ ...lr[E](C)
4037
4118
  };
4038
4119
  return /* @__PURE__ */ f("button", {
4039
4120
  ref: x,
@@ -4084,7 +4165,7 @@ function ur({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
4084
4165
  }), w ? /* @__PURE__ */ d("span", { children: T }) : null]
4085
4166
  });
4086
4167
  }
4087
- var dr = {
4168
+ var gr = {
4088
4169
  facebook: {
4089
4170
  label: "Facebook",
4090
4171
  color: "#1877f2",
@@ -4151,8 +4232,8 @@ var dr = {
4151
4232
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
4152
4233
  }
4153
4234
  };
4154
- function fr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
4155
- let l = Array.isArray(e) ? e.filter((e) => e && dr[e.network]) : [];
4235
+ function _r({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
4236
+ let l = Array.isArray(e) ? e.filter((e) => e && gr[e.network]) : [];
4156
4237
  if (!l.length) return null;
4157
4238
  let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
4158
4239
  return /* @__PURE__ */ d("div", {
@@ -4165,7 +4246,7 @@ function fr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
4165
4246
  ...P(o)
4166
4247
  },
4167
4248
  children: l.map((e, r) => {
4168
- let i = dr[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);
4249
+ let i = gr[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
4169
4250
  return /* @__PURE__ */ d("a", {
4170
4251
  href: e.url || "#",
4171
4252
  onClick: h,
@@ -4199,7 +4280,7 @@ function fr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
4199
4280
  })
4200
4281
  });
4201
4282
  }
4202
- function pr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
4283
+ function vr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
4203
4284
  if (!e.length) return null;
4204
4285
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
4205
4286
  width: 32,
@@ -4277,7 +4358,7 @@ function pr({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
4277
4358
  })
4278
4359
  });
4279
4360
  }
4280
- var mr = {
4361
+ var yr = {
4281
4362
  small: {
4282
4363
  w: 132,
4283
4364
  h: 46,
@@ -4299,21 +4380,21 @@ var mr = {
4299
4380
  title: 12.5,
4300
4381
  avatar: 46
4301
4382
  }
4302
- }, hr = (e) => mr[e] ?? mr.medium;
4303
- mr.medium.w, mr.medium.h;
4304
- var gr = (e) => String(e?.group ?? "").trim(), _r = (e) => {
4383
+ }, br = (e) => yr[e] ?? yr.medium;
4384
+ yr.medium.w, yr.medium.h;
4385
+ var xr = (e) => String(e?.group ?? "").trim(), Sr = (e) => {
4305
4386
  let t = [], n = /* @__PURE__ */ new Map();
4306
4387
  return e.forEach((e, r) => {
4307
- let i = gr(e) || `#${r}`;
4388
+ let i = xr(e) || `#${r}`;
4308
4389
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
4309
4390
  }), t.flatMap((e) => n.get(e));
4310
4391
  };
4311
- function vr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
4312
- let i = hr(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 = [];
4392
+ function Cr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
4393
+ let i = br(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
4313
4394
  for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
4314
- d = _r(d);
4315
- for (let [e, t] of u) u.set(e, _r(t));
4316
- let f = (e, t) => o + (gr(e) !== gr(t) && (gr(e) || gr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
4395
+ d = Sr(d);
4396
+ for (let [e, t] of u) u.set(e, Sr(t));
4397
+ let f = (e, t) => o + (xr(e) !== xr(t) && (xr(e) || xr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
4317
4398
  if (t.has(e.id)) return 0;
4318
4399
  t.add(e.id);
4319
4400
  let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
@@ -4329,7 +4410,7 @@ function vr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
4329
4410
  x: m,
4330
4411
  y: b
4331
4412
  });
4332
- let x = gr(e);
4413
+ let x = xr(e);
4333
4414
  if (x) {
4334
4415
  let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
4335
4416
  _.has(t) || _.set(t, {
@@ -4403,18 +4484,18 @@ function vr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
4403
4484
  horizontal: n
4404
4485
  };
4405
4486
  }
4406
- var yr = (e, t) => {
4487
+ var wr = (e, t) => {
4407
4488
  let n = String(e ?? "");
4408
4489
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
4409
- }, br = (e) => {
4490
+ }, Tr = (e) => {
4410
4491
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
4411
4492
  if (!t) return "#ffffff";
4412
4493
  let n = t[1];
4413
4494
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
4414
4495
  let r = parseInt(n, 16);
4415
4496
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
4416
- }, xr = (e) => !!(e?.cv?.trim?.() || e?.photo);
4417
- function Sr(e, t = {}) {
4497
+ }, Er = (e) => !!(e?.cv?.trim?.() || e?.photo);
4498
+ function Dr(e, t = {}) {
4418
4499
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ot(e);
4419
4500
  return n.map((e) => {
4420
4501
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -4430,11 +4511,11 @@ function Sr(e, t = {}) {
4430
4511
  };
4431
4512
  });
4432
4513
  }
4433
- var Cr = {
4514
+ var Or = {
4434
4515
  size: 36,
4435
4516
  pad: 10
4436
4517
  };
4437
- function wr({ node: e, onClose: t }) {
4518
+ function kr({ node: e, onClose: t }) {
4438
4519
  return a(() => {
4439
4520
  let e = (e) => e.key === "Escape" && t();
4440
4521
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -4555,7 +4636,7 @@ function wr({ node: e, onClose: t }) {
4555
4636
  })
4556
4637
  });
4557
4638
  }
4558
- function Tr({ 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 }) {
4639
+ function Ar({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4559
4640
  let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null);
4560
4641
  a(() => {
4561
4642
  if (!t || O) return;
@@ -4572,7 +4653,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4572
4653
  D,
4573
4654
  O
4574
4655
  ]);
4575
- let j = t ? Sr(O ?? k ?? [], {
4656
+ let j = t ? Dr(O ?? k ?? [], {
4576
4657
  nameField: n,
4577
4658
  titleField: r,
4578
4659
  photoField: s,
@@ -4580,7 +4661,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4580
4661
  cvField: p,
4581
4662
  hrefField: m,
4582
4663
  groupField: h
4583
- }) : e, M = hr(v), { boxes: N, links: F, groups: I, width: L, height: R } = vr(j, {
4664
+ }) : e, M = br(v), { boxes: N, links: F, groups: I, width: L, height: R } = Cr(j, {
4584
4665
  size: v,
4585
4666
  horizontal: y,
4586
4667
  groupTitles: g
@@ -4638,8 +4719,8 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4638
4719
  fontSize: M.title + 1,
4639
4720
  fontWeight: "600",
4640
4721
  opacity: "0.55",
4641
- fill: r ? br(e.color || _) : "var(--page-text, #111827)",
4642
- children: yr(e.title, Math.floor(e.width / 7))
4722
+ fill: r ? Tr(e.color || _) : "var(--page-text, #111827)",
4723
+ children: wr(e.title, Math.floor(e.width / 7))
4643
4724
  })] }, `group-${t}`);
4644
4725
  }),
4645
4726
  F.map((e, t) => /* @__PURE__ */ d("path", {
@@ -4649,7 +4730,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4649
4730
  strokeWidth: "1.5"
4650
4731
  }, t)),
4651
4732
  N.map(({ node: e, x: t, y: n }) => {
4652
- 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 ? br(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? br(e.color2) : s, l = S && (xr(e) || e.href), p = () => xr(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Cr.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);
4733
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Tr(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tr(e.color2) : s, l = S && (Er(e) || e.href), p = () => Er(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Or.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4653
4734
  return /* @__PURE__ */ f("g", {
4654
4735
  onClick: l ? p : void 0,
4655
4736
  style: l ? { cursor: "pointer" } : void 0,
@@ -4713,13 +4794,13 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4713
4794
  e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4714
4795
  id: `${C}-${e.id}`,
4715
4796
  children: /* @__PURE__ */ d("circle", {
4716
- cx: t + Cr.pad + M.avatar / 2,
4797
+ cx: t + Or.pad + M.avatar / 2,
4717
4798
  cy: n + M.h / 2,
4718
4799
  r: M.avatar / 2
4719
4800
  })
4720
4801
  }), /* @__PURE__ */ d("image", {
4721
4802
  href: e.photo,
4722
- x: t + Cr.pad,
4803
+ x: t + Or.pad,
4723
4804
  y: n + (M.h - M.avatar) / 2,
4724
4805
  width: M.avatar,
4725
4806
  height: M.avatar,
@@ -4733,7 +4814,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4733
4814
  fontSize: M.title,
4734
4815
  fontWeight: "600",
4735
4816
  fill: s,
4736
- children: yr(e.title, g + 4)
4817
+ children: wr(e.title, g + 4)
4737
4818
  }), e.name && /* @__PURE__ */ d("text", {
4738
4819
  x: m,
4739
4820
  y: n + _ + _ / 2 + M.name * .35,
@@ -4741,7 +4822,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4741
4822
  fontSize: M.name,
4742
4823
  fontWeight: "600",
4743
4824
  fill: c,
4744
- children: yr(e.name, g)
4825
+ children: wr(e.name, g)
4745
4826
  })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
4746
4827
  x: m,
4747
4828
  y: n + (v[1] ? M.h * .43 : M.h * .57),
@@ -4749,7 +4830,7 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4749
4830
  fontSize: M.name,
4750
4831
  fontWeight: "600",
4751
4832
  fill: s,
4752
- children: yr(v[0], g)
4833
+ children: wr(v[0], g)
4753
4834
  }), v[1] && /* @__PURE__ */ d("text", {
4754
4835
  x: m,
4755
4836
  y: n + M.h * .73,
@@ -4757,19 +4838,19 @@ function Tr({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4757
4838
  fontSize: M.title,
4758
4839
  opacity: "0.7",
4759
4840
  fill: s,
4760
- children: yr(v[1], g + 4)
4841
+ children: wr(v[1], g + 4)
4761
4842
  })] })
4762
4843
  ]
4763
4844
  }, e.id);
4764
4845
  })
4765
4846
  ]
4766
- }), w && /* @__PURE__ */ d(wr, {
4847
+ }), w && /* @__PURE__ */ d(kr, {
4767
4848
  node: w,
4768
4849
  onClose: () => T(null)
4769
4850
  })]
4770
4851
  });
4771
4852
  }
4772
- function Er({ value: e, onCommit: t, style: n, hint: r }) {
4853
+ function jr({ value: e, onCommit: t, style: n, hint: r }) {
4773
4854
  let [i, o] = l(!1), s = c(null);
4774
4855
  return a(() => {
4775
4856
  if (!i || !s.current) return;
@@ -4799,7 +4880,7 @@ function Er({ value: e, onCommit: t, style: n, hint: r }) {
4799
4880
  children: e ?? ""
4800
4881
  });
4801
4882
  }
4802
- var Dr = 360, Or = "\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", kr = (e, t) => e && t ? `cell-${e}-${t}` : "", Ar = (e) => {
4883
+ var Mr = 360, Nr = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Pr = (e, t) => e && t ? `cell-${e}-${t}` : "", Fr = (e) => {
4803
4884
  if (!e || typeof e != "object") return e ?? "";
4804
4885
  let t = String(e.text ?? "");
4805
4886
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
@@ -4810,7 +4891,7 @@ var Dr = 360, Or = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4810
4891
  children: t
4811
4892
  }) : t;
4812
4893
  };
4813
- function jr({ 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 }) {
4894
+ function Ir({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
4814
4895
  let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
4815
4896
  r: e,
4816
4897
  c: t
@@ -4824,7 +4905,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4824
4905
  }
4825
4906
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4826
4907
  top: r.bottom - n.top + 4,
4827
- left: Math.max(0, Math.min(r.left - n.left, n.width - Dr))
4908
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Mr))
4828
4909
  };
4829
4910
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4830
4911
  }), a(() => {
@@ -4880,7 +4961,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4880
4961
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4881
4962
  }, ye = /* @__PURE__ */ new Set();
4882
4963
  p && q.forEach((t, n) => e.forEach((e, t) => {
4883
- let i = p[kr(r[n], o[t])];
4964
+ let i = p[Pr(r[n], o[t])];
4884
4965
  if (!i) return;
4885
4966
  let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
4886
4967
  for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && ye.add(`${n + e},${t + r}`);
@@ -4903,7 +4984,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4903
4984
  },
4904
4985
  onClick: n,
4905
4986
  children: e
4906
- }, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, xe = X ? p?.[kr(r[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
4987
+ }, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, xe = X ? p?.[Pr(r[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
4907
4988
  return /* @__PURE__ */ f("div", {
4908
4989
  ref: (e) => {
4909
4990
  I.current = e, typeof M == "function" && M(e);
@@ -4914,7 +4995,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4914
4995
  ...ge
4915
4996
  },
4916
4997
  children: [
4917
- N && /* @__PURE__ */ d("style", { children: Or }),
4998
+ N && /* @__PURE__ */ d("style", { children: Nr }),
4918
4999
  N && X && z && /* @__PURE__ */ f("div", {
4919
5000
  className: "wb-tedit-bar",
4920
5001
  style: {
@@ -4980,7 +5061,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4980
5061
  } : N ? { position: "relative" } : null,
4981
5062
  ...se
4982
5063
  },
4983
- children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Er, {
5064
+ children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(jr, {
4984
5065
  value: t.label ?? t,
4985
5066
  onCommit: (e) => N.header(n, e),
4986
5067
  hint: Z("editCell", "Double-click to edit"),
@@ -5008,7 +5089,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5008
5089
  },
5009
5090
  children: e.map((e, i) => {
5010
5091
  if (ye.has(`${n},${i}`)) return null;
5011
- let a = kr(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);
5092
+ let a = Pr(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
5012
5093
  return /* @__PURE__ */ f("td", {
5013
5094
  className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
5014
5095
  onMouseDownCapture: _e ? V(n, i) : void 0,
@@ -5021,7 +5102,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5021
5102
  ...N ? { position: "relative" } : null,
5022
5103
  ...se
5023
5104
  },
5024
- children: [s ?? Ar(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
5105
+ children: [s ?? Fr(t?.[i]), N && _e && /* @__PURE__ */ d("span", {
5025
5106
  className: "wb-tedit-rowgrip",
5026
5107
  title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
5027
5108
  onPointerDown: be(n),
@@ -5036,7 +5117,7 @@ function jr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5036
5117
  ]
5037
5118
  });
5038
5119
  }
5039
- var Mr = {
5120
+ var Lr = {
5040
5121
  small: {
5041
5122
  cell: 62,
5042
5123
  font: 10.5,
@@ -5061,8 +5142,8 @@ var Mr = {
5061
5142
  pad: 8,
5062
5143
  gap: 4
5063
5144
  }
5064
- }, Nr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Pr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Fr = 366;
5065
- function Ir(e, t = {}) {
5145
+ }, Rr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, zr = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Br = 366;
5146
+ function Vr(e, t = {}) {
5066
5147
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ot(e), a = (e) => {
5067
5148
  let t = i(r(e)), n = t ? new Date(t) : null;
5068
5149
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -5079,7 +5160,7 @@ function Ir(e, t = {}) {
5079
5160
  } : null;
5080
5161
  }).filter(Boolean);
5081
5162
  }
5082
- function Lr(e) {
5163
+ function Hr(e) {
5083
5164
  return (Array.isArray(e) ? e : []).map((e, t) => {
5084
5165
  let n = e?.start ? new Date(e.start) : null;
5085
5166
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -5094,19 +5175,19 @@ function Lr(e) {
5094
5175
  };
5095
5176
  }).filter(Boolean);
5096
5177
  }
5097
- function Rr(e) {
5178
+ function Ur(e) {
5098
5179
  let t = /* @__PURE__ */ new Map();
5099
5180
  for (let n of e) {
5100
- let e = Pr(n.start), r = n.end ? Pr(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Fr);
5181
+ let e = zr(n.start), r = n.end ? zr(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Br);
5101
5182
  for (let r = 0; r <= i; r += 1) {
5102
- let i = Nr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
5183
+ let i = Rr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
5103
5184
  t.has(i) || t.set(i, []), t.get(i).push(n);
5104
5185
  }
5105
5186
  }
5106
5187
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
5107
5188
  return t;
5108
5189
  }
5109
- function zr({ 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 }) {
5190
+ function Wr({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
5110
5191
  let { tenant: T, apiUrl: E, locale: D } = i(Q), O = i(Qe)?.[t], [k, A] = l(null), [j, M] = l(() => {
5111
5192
  let e = /* @__PURE__ */ new Date();
5112
5193
  return {
@@ -5129,13 +5210,13 @@ function zr({ events: e = [], source: t = "", titleField: n = "", startField: r
5129
5210
  E,
5130
5211
  O
5131
5212
  ]);
5132
- let N = Mr[m] ?? Mr.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 ? Ir(O ?? k ?? [], {
5213
+ let N = Lr[m] ?? Lr.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Vr(O ?? k ?? [], {
5133
5214
  titleField: n,
5134
5215
  startField: r,
5135
5216
  endField: o,
5136
5217
  hrefField: s,
5137
5218
  colorField: c
5138
- }) : Lr(e), B = Rr(z), V = D || void 0, H = (e, t) => {
5219
+ }) : Hr(e), B = Ur(z), V = D || void 0, H = (e, t) => {
5139
5220
  let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
5140
5221
  width: 6,
5141
5222
  height: 6,
@@ -5267,9 +5348,9 @@ function zr({ events: e = [], source: t = "", titleField: n = "", startField: r
5267
5348
  })]
5268
5349
  });
5269
5350
  }
5270
- let ne = new Date(j.year, j.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), q = Math.ceil((K + re) / 7), ie = Nr(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
5351
+ let ne = new Date(j.year, j.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, re = new Date(j.year, j.month + 1, 0).getDate(), q = Math.ceil((K + re) / 7), ie = Rr(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
5271
5352
  for (let e = 0; e < q * 7; e += 1) {
5272
- let t = e - K + 1, n = t >= 1 && t <= re, r = Nr(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
5353
+ let t = e - K + 1, n = t >= 1 && t <= re, r = Rr(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
5273
5354
  J.push(/* @__PURE__ */ f("div", {
5274
5355
  style: {
5275
5356
  minHeight: N.cell,
@@ -5334,12 +5415,12 @@ function zr({ events: e = [], source: t = "", titleField: n = "", startField: r
5334
5415
  ]
5335
5416
  });
5336
5417
  }
5337
- var Br = {
5418
+ var Gr = {
5338
5419
  small: 36,
5339
5420
  medium: 56,
5340
5421
  large: 88
5341
5422
  };
5342
- function Vr(e, t = {}) {
5423
+ function Kr(e, t = {}) {
5343
5424
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ot(e);
5344
5425
  return n.map((e) => {
5345
5426
  let n = e.data ?? e, i = it(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(it(n, t.nameField)) : r(n.name);
@@ -5350,7 +5431,7 @@ function Vr(e, t = {}) {
5350
5431
  };
5351
5432
  }).filter((e) => e.src);
5352
5433
  }
5353
- function Hr({ 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 }) {
5434
+ function qr({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
5354
5435
  let { tenant: D, apiUrl: O } = i(Q), k = i(Qe)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [V, H] = l(!0), [U, ee] = l(!1), [W, te] = l(!1);
5355
5436
  a(() => {
5356
5437
  if (!t || k) return;
@@ -5390,11 +5471,11 @@ function Hr({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5390
5471
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
5391
5472
  };
5392
5473
  });
5393
- let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Vr(k ?? A ?? [], {
5474
+ let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Kr(k ?? A ?? [], {
5394
5475
  imageField: n,
5395
5476
  nameField: r,
5396
5477
  hrefField: o
5397
- }) : ne, K = Br[p] ?? Br.medium, re = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, q = s === "marquee" ? "step" : s, ie = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), J = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + re, ce = F ? Math.max(1, Math.floor(F / se)) : J, le = Math.min(J, ce), ue = F ? Math.min(se, F / le) : se;
5478
+ }) : ne, K = Gr[p] ?? Gr.medium, re = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, q = s === "marquee" ? "step" : s, ie = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), J = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + re, ce = F ? Math.max(1, Math.floor(F / se)) : J, le = Math.min(J, ce), ue = F ? Math.min(se, F / le) : se;
5398
5479
  if (!G.length) return /* @__PURE__ */ d("div", {
5399
5480
  ref: T,
5400
5481
  style: {
@@ -5579,7 +5660,7 @@ function Hr({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5579
5660
  be,
5580
5661
  Z ? xe(1) : null
5581
5662
  ] }),
5582
- /* @__PURE__ */ d(Ur, {
5663
+ /* @__PURE__ */ d(Jr, {
5583
5664
  running: me,
5584
5665
  every: ie + ae,
5585
5666
  slide: ae,
@@ -5593,7 +5674,7 @@ function Hr({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5593
5674
  ]
5594
5675
  });
5595
5676
  }
5596
- function Ur({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
5677
+ function Jr({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
5597
5678
  a(() => {
5598
5679
  if (!e) return;
5599
5680
  let n = setInterval(() => {
@@ -5629,13 +5710,13 @@ function Ur({ running: e, every: t, slide: n, step: r, index: i, total: o, home:
5629
5710
  l
5630
5711
  ]), null;
5631
5712
  }
5632
- var Wr = {
5713
+ var Yr = {
5633
5714
  small: 380,
5634
5715
  medium: 560,
5635
5716
  large: 820,
5636
5717
  full: "100%"
5637
5718
  };
5638
- function Gr({ 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 }) {
5719
+ function Xr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
5639
5720
  let [C, w] = l(!1), T = c(null);
5640
5721
  a(() => {
5641
5722
  if (S || !e) return;
@@ -5660,7 +5741,7 @@ function Gr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5660
5741
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
5661
5742
  };
5662
5743
  }, [S, C]);
5663
- let E = Wr[o] ?? Wr.medium, D = (e) => {
5744
+ let E = Yr[o] ?? Yr.medium, D = (e) => {
5664
5745
  let t = {
5665
5746
  padding: "9px 16px",
5666
5747
  borderRadius: 6,
@@ -5829,7 +5910,7 @@ function Gr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5829
5910
  })]
5830
5911
  });
5831
5912
  }
5832
- function Kr({ 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 }) {
5913
+ function Zr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: o = "", offset: s = 8, editorOpen: u = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
5833
5914
  let [_, v] = l(!1), y = c(null), b = c(null), x = r !== "click", S = () => {
5834
5915
  b.current && clearTimeout(b.current), b.current = null;
5835
5916
  }, C = () => {
@@ -5930,101 +6011,102 @@ function Kr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
5930
6011
  }), E]
5931
6012
  });
5932
6013
  }
5933
- var qr = {
6014
+ var Qr = {
5934
6015
  PageRoot: _t,
5935
- MarkdownBlock: Mt,
5936
- CalendarBlock: zr,
5937
- LogoCarousel: Hr,
5938
- DialogBlock: Gr,
5939
- DropdownBlock: Kr,
6016
+ MarkdownBlock: It,
6017
+ CalendarBlock: Wr,
6018
+ LogoCarousel: qr,
6019
+ DialogBlock: Xr,
6020
+ DropdownBlock: Zr,
5940
6021
  Section: vt,
5941
6022
  Container: yt,
5942
- Heading: bt,
5943
- TextBlock: It,
5944
- ButtonBlock: zt,
5945
- ImageBlock: Bt,
5946
- Spacer: Jt,
5947
- Divider: Yt,
5948
- BoxBlock: Xt,
5949
- SliderBlock: nn,
5950
- CanvasSlider: rn,
5951
- TabsBlock: bn,
5952
- QuickStack: Kn,
5953
- CollectionList: qn,
5954
- CollectionSearch: Jn,
5955
- BreadcrumbsBlock: Yn,
5956
- PaginationBlock: Xn,
5957
- StepperBlock: pr,
5958
- SocialLinksBlock: fr,
5959
- ThemeModeBlock: tr,
5960
- ScrollTopBlock: ur,
5961
- CounterBlock: lr,
5962
- OrgChartBlock: Tr,
5963
- TableBlock: jr,
5964
- IconBlock: pn,
5965
- MapBlock: dn,
5966
- MasonryBlock: hn,
5967
- AccordionBlock: xn,
5968
- NavbarBlock: yn,
5969
- ListBlock: Ft,
5970
- TextSpan: Tt,
5971
- QuoteBlock: Pt,
5972
- TextLink: Rt,
5973
- RichTextBlock: jt,
5974
- RichContentBlock: jt,
5975
- VideoBlock: Vt,
5976
- YouTubeBlock: Ut,
5977
- IframeBlock: Wt,
5978
- EmbedBlock: qt,
5979
- FormBlock: Pn,
5980
- FormLabel: zn,
5981
- FormInput: Bn,
5982
- FormTextarea: Vn,
5983
- FormCheckbox: (e) => /* @__PURE__ */ d(Hn, {
6023
+ LinkBlock: bt,
6024
+ Heading: xt,
6025
+ TextBlock: Bt,
6026
+ ButtonBlock: Wt,
6027
+ ImageBlock: Gt,
6028
+ Spacer: $t,
6029
+ Divider: en,
6030
+ BoxBlock: tn,
6031
+ SliderBlock: cn,
6032
+ CanvasSlider: ln,
6033
+ TabsBlock: Tn,
6034
+ QuickStack: Zn,
6035
+ CollectionList: Qn,
6036
+ CollectionSearch: $n,
6037
+ BreadcrumbsBlock: er,
6038
+ PaginationBlock: tr,
6039
+ StepperBlock: vr,
6040
+ SocialLinksBlock: _r,
6041
+ ThemeModeBlock: or,
6042
+ ScrollTopBlock: hr,
6043
+ CounterBlock: mr,
6044
+ OrgChartBlock: Ar,
6045
+ TableBlock: Ir,
6046
+ IconBlock: vn,
6047
+ MapBlock: gn,
6048
+ MasonryBlock: bn,
6049
+ AccordionBlock: En,
6050
+ NavbarBlock: wn,
6051
+ ListBlock: zt,
6052
+ TextSpan: Et,
6053
+ QuoteBlock: Rt,
6054
+ TextLink: Ut,
6055
+ RichTextBlock: Ft,
6056
+ RichContentBlock: Ft,
6057
+ VideoBlock: Kt,
6058
+ YouTubeBlock: Jt,
6059
+ IframeBlock: Yt,
6060
+ EmbedBlock: Qt,
6061
+ FormBlock: zn,
6062
+ FormLabel: Wn,
6063
+ FormInput: Gn,
6064
+ FormTextarea: Kn,
6065
+ FormCheckbox: (e) => /* @__PURE__ */ d(qn, {
5984
6066
  kind: "checkbox",
5985
6067
  ...e
5986
6068
  }),
5987
- FormRadio: (e) => /* @__PURE__ */ d(Hn, {
6069
+ FormRadio: (e) => /* @__PURE__ */ d(qn, {
5988
6070
  kind: "radio",
5989
6071
  ...e
5990
6072
  }),
5991
- FormSelect: Un,
5992
- FormFile: Wn,
5993
- FormRecaptcha: Rn,
5994
- FormSubmit: Gn
5995
- }, Jr = {
6073
+ FormSelect: Jn,
6074
+ FormFile: Yn,
6075
+ FormRecaptcha: Un,
6076
+ FormSubmit: Xn
6077
+ }, $r = {
5996
6078
  id: "auth",
5997
6079
  label: "Accounts",
5998
6080
  category: "Apps",
5999
6081
  keys: ["SiteLoginForm", "SiteAccountMenu"],
6000
6082
  ssr: "shell",
6001
6083
  settings: ["site.authRedirect"]
6002
- }, Yr = n({
6084
+ }, ei = n({
6003
6085
  user: null,
6004
6086
  status: "idle",
6005
6087
  ensure: () => {},
6006
6088
  refresh: () => {},
6007
6089
  signOut: () => {}
6008
6090
  });
6009
- function Xr(e, t) {
6091
+ function ti(e, t) {
6010
6092
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
6011
6093
  }
6012
- function Zr(e) {
6094
+ function ni(e) {
6013
6095
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
6014
6096
  return {
6015
6097
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
6016
6098
  url: i,
6017
6099
  mePath: a,
6018
6100
  logoutPath: o,
6019
- meUrl: Xr(i, a),
6020
- logoutUrl: Xr(i, o),
6101
+ meUrl: ti(i, a),
6102
+ logoutUrl: ti(i, o),
6021
6103
  loginPage: r(n.loginPage),
6022
6104
  userPath: r(n.userPath),
6023
6105
  auth: n.auth === "bearer" ? "bearer" : "cookies",
6024
6106
  tokenKey: r(n.tokenKey) || "webim_session_token"
6025
6107
  };
6026
6108
  }
6027
- function Qr(e, t) {
6109
+ function ri(e, t) {
6028
6110
  if (!t) return e ?? null;
6029
6111
  let n = e;
6030
6112
  for (let e of t.split(".")) {
@@ -6033,26 +6115,26 @@ function Qr(e, t) {
6033
6115
  }
6034
6116
  return n ?? null;
6035
6117
  }
6036
- function $r(e) {
6118
+ function ii(e) {
6037
6119
  try {
6038
6120
  return window.localStorage.getItem(e) || "";
6039
6121
  } catch {
6040
6122
  return "";
6041
6123
  }
6042
6124
  }
6043
- function ei(e) {
6125
+ function ai(e) {
6044
6126
  try {
6045
6127
  window.localStorage.removeItem(e);
6046
6128
  } catch {}
6047
6129
  }
6048
- var ti = () => {
6049
- let e = i(Yr);
6130
+ var oi = () => {
6131
+ let e = i(ei);
6050
6132
  return a(() => {
6051
6133
  e.ensure();
6052
6134
  }, [e]), e;
6053
6135
  };
6054
- function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
6055
- let f = i(Q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => Zr(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}`, {
6136
+ function si({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
6137
+ let f = i(Q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => ni(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
6056
6138
  ...t,
6057
6139
  credentials: "include",
6058
6140
  headers: {
@@ -6064,9 +6146,9 @@ function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
6064
6146
  if (n) return Promise.resolve(null);
6065
6147
  if (h.mode === "off") return Promise.resolve(S(null));
6066
6148
  if (h.mode === "custom") {
6067
- let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
6149
+ let e = h.auth === "bearer" ? ii(h.tokenKey) : "";
6068
6150
  return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
6069
- let t = Qr(e, h.userPath);
6151
+ let t = ri(e, h.userPath);
6070
6152
  return S(t && typeof t == "object" ? t : null);
6071
6153
  }).catch(() => S(null));
6072
6154
  }
@@ -6079,12 +6161,12 @@ function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
6079
6161
  ]), w = r(() => {
6080
6162
  if (h.mode === "off") return S(null), Promise.resolve();
6081
6163
  if (h.mode === "custom") {
6082
- let e = h.auth === "bearer" ? $r(h.tokenKey) : "";
6164
+ let e = h.auth === "bearer" ? ii(h.tokenKey) : "";
6083
6165
  return (h.logoutUrl ? fetch(h.logoutUrl, {
6084
6166
  method: "post",
6085
6167
  ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
6086
6168
  }).catch(() => {}) : Promise.resolve()).then(() => {
6087
- h.auth === "bearer" && ei(h.tokenKey), S(null);
6169
+ h.auth === "bearer" && ai(h.tokenKey), S(null);
6088
6170
  });
6089
6171
  }
6090
6172
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -6134,18 +6216,18 @@ function ni({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
6134
6216
  h.loginPage,
6135
6217
  C,
6136
6218
  w
6137
- ]), /* @__PURE__ */ d(Yr.Provider, {
6219
+ ]), /* @__PURE__ */ d(ei.Provider, {
6138
6220
  value: E,
6139
6221
  children: e
6140
6222
  });
6141
6223
  }
6142
- function ri({ when: e, children: t }) {
6143
- let { status: n } = ti();
6224
+ function ci({ when: e, children: t }) {
6225
+ let { status: n } = oi();
6144
6226
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
6145
6227
  }
6146
6228
  //#endregion
6147
6229
  //#region ../ui/src/components/builder/apps/auth/views.jsx
6148
- function ii({ 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 }) {
6230
+ function li({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
6149
6231
  let { tenant: h, apiUrl: g, settings: _ } = i(Q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
6150
6232
  if (e.preventDefault(), u) return;
6151
6233
  let n = new FormData(e.currentTarget);
@@ -6194,20 +6276,20 @@ function ii({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
6194
6276
  children: [
6195
6277
  w ? /* @__PURE__ */ f("label", {
6196
6278
  style: {
6197
- ...Cn,
6279
+ ...On,
6198
6280
  display: "grid",
6199
6281
  gap: 6
6200
6282
  },
6201
6283
  children: [a, /* @__PURE__ */ d("input", {
6202
6284
  name: "name",
6203
6285
  type: "text",
6204
- style: wn,
6205
- ...En(u)
6286
+ style: kn,
6287
+ ...jn(u)
6206
6288
  })]
6207
6289
  }) : null,
6208
6290
  /* @__PURE__ */ f("label", {
6209
6291
  style: {
6210
- ...Cn,
6292
+ ...On,
6211
6293
  display: "grid",
6212
6294
  gap: 6
6213
6295
  },
@@ -6215,13 +6297,13 @@ function ii({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
6215
6297
  name: "email",
6216
6298
  type: "email",
6217
6299
  required: !u,
6218
- style: wn,
6219
- ...En(u)
6300
+ style: kn,
6301
+ ...jn(u)
6220
6302
  })]
6221
6303
  }),
6222
6304
  /* @__PURE__ */ f("label", {
6223
6305
  style: {
6224
- ...Cn,
6306
+ ...On,
6225
6307
  display: "grid",
6226
6308
  gap: 6
6227
6309
  },
@@ -6229,8 +6311,8 @@ function ii({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
6229
6311
  name: "password",
6230
6312
  type: "password",
6231
6313
  required: !u,
6232
- style: wn,
6233
- ...En(u)
6314
+ style: kn,
6315
+ ...jn(u)
6234
6316
  })]
6235
6317
  }),
6236
6318
  /* @__PURE__ */ d("button", {
@@ -6269,8 +6351,8 @@ function ii({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
6269
6351
  ]
6270
6352
  });
6271
6353
  }
6272
- function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
6273
- let { user: c, status: l, signOut: u } = ti(), p = a ? s || "user" : l, m = a ? {
6354
+ function ui({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
6355
+ let { user: c, status: l, signOut: u } = oi(), p = a ? s || "user" : l, m = a ? {
6274
6356
  name: "Ada Lovelace",
6275
6357
  email: "ada@example.com"
6276
6358
  } : c;
@@ -6291,7 +6373,7 @@ function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
6291
6373
  children: [
6292
6374
  /* @__PURE__ */ f("span", {
6293
6375
  style: {
6294
- ...Cn,
6376
+ ...On,
6295
6377
  fontWeight: 600
6296
6378
  },
6297
6379
  children: [
@@ -6302,7 +6384,7 @@ function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
6302
6384
  }),
6303
6385
  n && m?.email ? /* @__PURE__ */ d("span", {
6304
6386
  style: {
6305
- ...Cn,
6387
+ ...On,
6306
6388
  opacity: .7
6307
6389
  },
6308
6390
  children: m.email
@@ -6318,7 +6400,7 @@ function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
6318
6400
  fontSize: 14,
6319
6401
  cursor: a ? "default" : "pointer"
6320
6402
  },
6321
- ...En(a),
6403
+ ...jn(a),
6322
6404
  children: t
6323
6405
  })
6324
6406
  ]
@@ -6335,40 +6417,40 @@ function ai({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
6335
6417
  }
6336
6418
  //#endregion
6337
6419
  //#region ../ui/src/components/builder/apps/consent/manifest.js
6338
- var oi = {
6420
+ var di = {
6339
6421
  id: "consent",
6340
6422
  label: "Cookie consent",
6341
6423
  category: "Apps",
6342
6424
  keys: ["CookieConsent"],
6343
6425
  ssr: "shell",
6344
6426
  settings: []
6345
- }, si = "webim.cookie_consent";
6346
- function ci() {
6427
+ }, fi = "webim.cookie_consent";
6428
+ function pi() {
6347
6429
  try {
6348
- let e = window.localStorage.getItem(si), t = e ? JSON.parse(e) : null;
6430
+ let e = window.localStorage.getItem(fi), t = e ? JSON.parse(e) : null;
6349
6431
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
6350
6432
  } catch {
6351
6433
  return "";
6352
6434
  }
6353
6435
  }
6354
- function li(e) {
6436
+ function mi(e) {
6355
6437
  try {
6356
6438
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
6357
6439
  } catch {}
6358
6440
  }
6359
- function ui(e) {
6441
+ function hi(e) {
6360
6442
  try {
6361
- window.localStorage.setItem(si, JSON.stringify({
6443
+ window.localStorage.setItem(fi, JSON.stringify({
6362
6444
  choice: e,
6363
6445
  at: (/* @__PURE__ */ new Date()).toISOString()
6364
6446
  }));
6365
6447
  } catch {}
6366
- li(e);
6448
+ mi(e);
6367
6449
  try {
6368
6450
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
6369
6451
  } catch {}
6370
6452
  }
6371
- var di = {
6453
+ var gi = {
6372
6454
  bottom: {
6373
6455
  left: 0,
6374
6456
  right: 0,
@@ -6390,18 +6472,18 @@ var di = {
6390
6472
  maxWidth: 400
6391
6473
  }
6392
6474
  };
6393
- function fi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
6475
+ function _i({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
6394
6476
  let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
6395
6477
  y(e), typeof m == "function" && m(e);
6396
6478
  };
6397
6479
  if (a(() => {
6398
6480
  if (h) return;
6399
- let e = ci();
6400
- e ? li(e) : _(!0);
6481
+ let e = pi();
6482
+ e ? mi(e) : _(!0);
6401
6483
  }, [h, v]), !g) return null;
6402
6484
  let x = (e) => () => {
6403
- h || (ui(e), _(!1));
6404
- }, S = di[s] ?? di.bottom, C = {
6485
+ h || (hi(e), _(!1));
6486
+ }, S = gi[s] ?? gi.bottom, C = {
6405
6487
  appearance: "none",
6406
6488
  font: "inherit",
6407
6489
  fontSize: 14,
@@ -6481,37 +6563,37 @@ function fi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
6481
6563
  }
6482
6564
  //#endregion
6483
6565
  //#region ../ui/src/components/builder/apps/language/manifest.js
6484
- var pi = {
6566
+ var vi = {
6485
6567
  id: "language",
6486
6568
  label: "Language",
6487
6569
  category: "Apps",
6488
6570
  keys: ["SiteLanguagePicker"],
6489
6571
  ssr: "prefetch",
6490
6572
  settings: ["locales"]
6491
- }, mi = {
6573
+ }, yi = {
6492
6574
  id: "search",
6493
6575
  label: "Search",
6494
6576
  category: "Apps",
6495
6577
  keys: ["SiteSearch"],
6496
6578
  ssr: "prefetch",
6497
6579
  settings: []
6498
- }, hi = 50, gi = 2e3;
6499
- function _i() {
6580
+ }, bi = 50, xi = 2e3;
6581
+ function Si() {
6500
6582
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
6501
6583
  }
6502
- function vi(e, t) {
6584
+ function Ci(e, t) {
6503
6585
  let n = e?.data ?? {}, r = [];
6504
6586
  for (let e of Object.values(n)) {
6505
6587
  let t = e == null ? "" : ot(e);
6506
- if (t && r.push(t), r.join(" ").length > gi) break;
6588
+ if (t && r.push(t), r.join(" ").length > xi) break;
6507
6589
  }
6508
- return r.join(" ").slice(0, gi).toLocaleLowerCase(t || void 0);
6590
+ return r.join(" ").slice(0, xi).toLocaleLowerCase(t || void 0);
6509
6591
  }
6510
- function yi({ 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 }) {
6511
- let { tenant: b, apiUrl: x, locale: S } = i(Q), [C, w] = l(() => _i()), [T, E] = l(() => _i()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
6592
+ function wi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
6593
+ let { tenant: b, apiUrl: x, locale: S } = i(Q), [C, w] = l(() => Si()), [T, E] = l(() => Si()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
6512
6594
  a(() => {
6513
6595
  let e = () => {
6514
- let e = _i();
6596
+ let e = Si();
6515
6597
  w(e), E(e);
6516
6598
  };
6517
6599
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -6562,7 +6644,7 @@ function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6562
6644
  });
6563
6645
  }
6564
6646
  else for (let t of e.rows) {
6565
- if (!vi(t, S).includes(N)) continue;
6647
+ if (!Ci(t, S).includes(N)) continue;
6566
6648
  let n = t?.data ?? {}, r = ot(n.name) || "Untitled", i = ot(n.slug);
6567
6649
  F.push({
6568
6650
  key: `entry:${t.id}`,
@@ -6571,7 +6653,7 @@ function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6571
6653
  kind: "entry"
6572
6654
  });
6573
6655
  }
6574
- let I = F.slice(0, Math.min(Math.max(1, p), hi)), L = (e) => {
6656
+ let I = F.slice(0, Math.min(Math.max(1, p), bi)), L = (e) => {
6575
6657
  if (v) {
6576
6658
  e.preventDefault(), w(T), A(!0);
6577
6659
  return;
@@ -6653,7 +6735,7 @@ function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6653
6735
  onChange: (e) => E(e.target.value),
6654
6736
  onFocus: () => N && A(!0),
6655
6737
  style: {
6656
- ...wn,
6738
+ ...kn,
6657
6739
  flexGrow: 1,
6658
6740
  minWidth: 0
6659
6741
  }
@@ -6711,21 +6793,21 @@ function yi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
6711
6793
  }
6712
6794
  //#endregion
6713
6795
  //#region ../ui/src/components/builder/apps/language/views.jsx
6714
- function bi(e) {
6796
+ function Ti(e) {
6715
6797
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
6716
6798
  return [...new Set(n.map((e) => e.trim()))];
6717
6799
  }
6718
- var xi = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6719
- function Si(e, t) {
6800
+ var Ei = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6801
+ function Di(e, t) {
6720
6802
  let n = String(e ?? "").toUpperCase();
6721
6803
  if (t === "code") return n;
6722
6804
  let r = "";
6723
6805
  try {
6724
- r = xi(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6806
+ r = Ei(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6725
6807
  } catch {}
6726
6808
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
6727
6809
  }
6728
- function Ci(e, t) {
6810
+ function Oi(e, t) {
6729
6811
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
6730
6812
  if (typeof window > "u") return n || "?";
6731
6813
  try {
@@ -6735,8 +6817,8 @@ function Ci(e, t) {
6735
6817
  return n || "/";
6736
6818
  }
6737
6819
  }
6738
- function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
6739
- let c = i(Q), l = bi(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
6820
+ function ki({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
6821
+ let c = i(Q), l = Ti(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
6740
6822
  display: "inline-flex",
6741
6823
  alignItems: "center",
6742
6824
  gap: 8,
@@ -6771,7 +6853,7 @@ function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6771
6853
  style: { opacity: .4 },
6772
6854
  children: n ?? "·"
6773
6855
  }), /* @__PURE__ */ d("a", {
6774
- href: Ci(e, e === u),
6856
+ href: Oi(e, e === u),
6775
6857
  hrefLang: e,
6776
6858
  "aria-current": e === p ? "true" : void 0,
6777
6859
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -6781,7 +6863,7 @@ function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6781
6863
  textDecoration: "none",
6782
6864
  cursor: s ? "default" : "pointer"
6783
6865
  },
6784
- children: Si(e, t)
6866
+ children: Di(e, t)
6785
6867
  })]
6786
6868
  }, e))]
6787
6869
  }) : /* @__PURE__ */ f("div", {
@@ -6792,7 +6874,7 @@ function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6792
6874
  value: p,
6793
6875
  onChange: s ? void 0 : (e) => {
6794
6876
  let t = e.target.value;
6795
- window.location.assign(Ci(t, t === u));
6877
+ window.location.assign(Oi(t, t === u));
6796
6878
  },
6797
6879
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
6798
6880
  style: {
@@ -6806,47 +6888,47 @@ function wi({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
6806
6888
  },
6807
6889
  children: l.map((e) => /* @__PURE__ */ d("option", {
6808
6890
  value: e,
6809
- children: Si(e, t)
6891
+ children: Di(e, t)
6810
6892
  }, e))
6811
6893
  })]
6812
6894
  });
6813
6895
  }
6814
6896
  //#endregion
6815
6897
  //#region ../ui/src/components/builder/apps/index.js
6816
- var Ti = [
6817
- Jr,
6818
- pi,
6819
- oi,
6820
- mi
6821
- ], Ei = {
6822
- SiteLoginForm: ii,
6823
- SiteAccountMenu: ai,
6824
- SiteLanguagePicker: wi,
6825
- CookieConsent: fi,
6826
- SiteSearch: yi
6898
+ var Ai = [
6899
+ $r,
6900
+ vi,
6901
+ di,
6902
+ yi
6903
+ ], ji = {
6904
+ SiteLoginForm: li,
6905
+ SiteAccountMenu: ui,
6906
+ SiteLanguagePicker: ki,
6907
+ CookieConsent: _i,
6908
+ SiteSearch: wi
6827
6909
  };
6828
- new Set(Ti.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6910
+ new Set(Ai.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6829
6911
  //#endregion
6830
6912
  //#region ../ui/src/components/builder/three/runtime.js
6831
- var Di = "0.185.1", Oi = "4.2.0", ki = "https://cdn.jsdelivr.net/npm", Ai = `${ki}/three@${Di}/+esm`, ji = `${ki}/@google/model-viewer@${Oi}/dist/model-viewer.min.js`, Mi = (e) => import(
6913
+ var Mi = "0.185.1", Ni = "4.2.0", Pi = "https://cdn.jsdelivr.net/npm", Fi = `${Pi}/three@${Mi}/+esm`, Ii = `${Pi}/@google/model-viewer@${Ni}/dist/model-viewer.min.js`, Li = (e) => import(
6832
6914
  /* @vite-ignore */
6833
6915
  /* webpackIgnore: true */
6834
6916
  e
6835
- ), Ni = /* @__PURE__ */ new Map();
6836
- function Pi(e) {
6837
- if (Ni.has(e)) return Ni.get(e);
6917
+ ), Ri = /* @__PURE__ */ new Map();
6918
+ function zi(e) {
6919
+ if (Ri.has(e)) return Ri.get(e);
6838
6920
  if (typeof window > "u") return new Promise(() => {});
6839
- let t = Mi(e).catch((t) => {
6840
- throw Ni.delete(e), t;
6921
+ let t = Li(e).catch((t) => {
6922
+ throw Ri.delete(e), t;
6841
6923
  });
6842
- return Ni.set(e, t), t;
6924
+ return Ri.set(e, t), t;
6843
6925
  }
6844
- var Fi = () => Pi(Ai), Ii = (e) => Pi(`${ki}/three@${Di}/examples/jsm/${e}/+esm`);
6845
- function Li() {
6846
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Pi(ji);
6926
+ var Bi = () => zi(Fi), Vi = (e) => zi(`${Pi}/three@${Mi}/examples/jsm/${e}/+esm`);
6927
+ function Hi() {
6928
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : zi(Ii);
6847
6929
  }
6848
- var Ri = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, zi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6849
- function Bi(e, t) {
6930
+ var Ui = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Wi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
6931
+ function Gi(e, t) {
6850
6932
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
6851
6933
  n = requestAnimationFrame(o), i ||= e;
6852
6934
  let a = r ? (e - r) / 1e3 : 0;
@@ -6865,7 +6947,7 @@ function Bi(e, t) {
6865
6947
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
6866
6948
  };
6867
6949
  }
6868
- function Vi(e, t, n = {}) {
6950
+ function Ki(e, t, n = {}) {
6869
6951
  let r = {
6870
6952
  radius: n.distance ?? 4,
6871
6953
  polar: n.polar ?? Math.PI / 2.4,
@@ -6914,13 +6996,13 @@ function Vi(e, t, n = {}) {
6914
6996
  }
6915
6997
  //#endregion
6916
6998
  //#region ../ui/src/components/builder/three/views.jsx
6917
- var Hi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ui = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Wi = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Gi = (e) => typeof e == "string" && !!e.trim();
6918
- function Ki({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6999
+ var qi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ji = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Yi = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Xi = (e) => typeof e == "string" && !!e.trim();
7000
+ function Zi({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6919
7001
  return /* @__PURE__ */ f("div", {
6920
7002
  ref: r,
6921
7003
  style: {
6922
7004
  ...P(i),
6923
- minHeight: Hi(n, 320),
7005
+ minHeight: qi(n, 320),
6924
7006
  display: "flex",
6925
7007
  flexDirection: "column",
6926
7008
  alignItems: "center",
@@ -6948,24 +7030,24 @@ function Ki({ label: e, note: t, height: n, nodeRef: r, style: i }) {
6948
7030
  }) : null]
6949
7031
  });
6950
7032
  }
6951
- function qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
7033
+ function Qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotateDelay: s, cameraControls: c, ar: u, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
6952
7034
  let [y, b] = l(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = l(!1);
6953
7035
  a(() => {
6954
7036
  if (y || !e) return;
6955
7037
  let t = !0;
6956
- return Li().then(() => t && b(!0), () => t && S(!0)), () => {
7038
+ return Hi().then(() => t && b(!0), () => t && S(!0)), () => {
6957
7039
  t = !1;
6958
7040
  };
6959
7041
  }, [y, e]);
6960
7042
  let C = {
6961
7043
  display: "block",
6962
7044
  width: "100%",
6963
- minHeight: Hi(r, 360),
6964
- height: Hi(r, 360),
7045
+ minHeight: qi(r, 360),
7046
+ height: qi(r, 360),
6965
7047
  backgroundColor: i || "transparent",
6966
7048
  ...P(g)
6967
7049
  };
6968
- if (!e) return v ? /* @__PURE__ */ d(Ki, {
7050
+ if (!e) return v ? /* @__PURE__ */ d(Zi, {
6969
7051
  nodeRef: _,
6970
7052
  style: g,
6971
7053
  height: r,
@@ -7000,13 +7082,13 @@ function qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
7000
7082
  poster: t || void 0,
7001
7083
  style: C,
7002
7084
  "camera-controls": w(!v && c !== !1),
7003
- "auto-rotate": w(T && !Ri()),
7004
- "auto-rotate-delay": T ? String(Hi(s, 0)) : void 0,
7085
+ "auto-rotate": w(T && !Ui()),
7086
+ "auto-rotate-delay": T ? String(qi(s, 0)) : void 0,
7005
7087
  "rotation-per-second": "18deg",
7006
7088
  ar: w(!v && u === !0),
7007
7089
  "ar-modes": "webxr scene-viewer quick-look",
7008
- "shadow-intensity": String(Ui(p, 100)),
7009
- exposure: String(Ui(f, 100)),
7090
+ "shadow-intensity": String(Ji(p, 100)),
7091
+ exposure: String(Ji(f, 100)),
7010
7092
  "field-of-view": m ? `${Number(m)}deg` : void 0,
7011
7093
  "environment-image": h && h !== "neutral" ? h : "neutral",
7012
7094
  "interaction-prompt": v ? "none" : void 0,
@@ -7024,7 +7106,7 @@ function qi({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: o, rotate
7024
7106
  }) : null
7025
7107
  });
7026
7108
  }
7027
- var Ji = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Yi = [
7109
+ var $i = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ea = [
7028
7110
  "precision highp float;",
7029
7111
  "uniform vec2 u_res;",
7030
7112
  "uniform float u_time;",
@@ -7047,7 +7129,7 @@ var Ji = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
7047
7129
  " return v;",
7048
7130
  "}",
7049
7131
  ""
7050
- ].join("\n"), Xi = {
7132
+ ].join("\n"), ta = {
7051
7133
  gradient: [
7052
7134
  "void main(){",
7053
7135
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -7099,7 +7181,7 @@ var Ji = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
7099
7181
  "}"
7100
7182
  ].join("\n")
7101
7183
  };
7102
- function Zi(e, t) {
7184
+ function na(e, t) {
7103
7185
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
7104
7186
  if (!n) return t;
7105
7187
  let r = parseInt(n[1], 16);
@@ -7109,7 +7191,7 @@ function Zi(e, t) {
7109
7191
  (r & 255) / 255
7110
7192
  ];
7111
7193
  }
7112
- function Qi(e, t, n) {
7194
+ function ra(e, t, n) {
7113
7195
  let r = e.createShader(t);
7114
7196
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
7115
7197
  let t = e.getShaderInfoLog(r);
@@ -7117,13 +7199,13 @@ function Qi(e, t, n) {
7117
7199
  }
7118
7200
  return r;
7119
7201
  }
7120
- 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 }) {
7202
+ function ia({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, scale: s, height: u, interactive: p, style: m, nodeRef: h, inert: g }) {
7121
7203
  let _ = c(null), v = c(null), y = c(null), [b, x] = l("");
7122
7204
  a(() => () => {
7123
7205
  let e = y.current;
7124
7206
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
7125
7207
  }, []);
7126
- let S = typeof t == "string" && t.trim() ? t : Xi[e] ?? Xi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ui(o, 100), D = Math.max(.05, Ui(s, 100));
7208
+ let S = typeof t == "string" && t.trim() ? t : ta[e] ?? ta.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ji(o, 100), D = Math.max(.05, Ji(s, 100));
7127
7209
  return a(() => {
7128
7210
  let e = _.current, t = v.current;
7129
7211
  if (!e || !t) return;
@@ -7138,7 +7220,7 @@ function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
7138
7220
  }
7139
7221
  let r = null;
7140
7222
  try {
7141
- let e = Qi(n, n.VERTEX_SHADER, Ji), t = Qi(n, n.FRAGMENT_SHADER, Yi + S);
7223
+ let e = ra(n, n.VERTEX_SHADER, $i), t = ra(n, n.FRAGMENT_SHADER, ea + S);
7142
7224
  if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
7143
7225
  x("");
7144
7226
  } catch (e) {
@@ -7174,28 +7256,28 @@ function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
7174
7256
  };
7175
7257
  p !== !1 && t.addEventListener("pointermove", l);
7176
7258
  let u = () => {
7177
- let r = zi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
7259
+ let r = Wi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
7178
7260
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
7179
7261
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
7180
7262
  d?.observe(t), u();
7181
- let f = Ri(), m = {
7182
- a: Zi(C, [
7263
+ let f = Ui(), m = {
7264
+ a: na(C, [
7183
7265
  .35,
7184
7266
  .4,
7185
7267
  .95
7186
7268
  ]),
7187
- b: Zi(w, [
7269
+ b: na(w, [
7188
7270
  .05,
7189
7271
  .06,
7190
7272
  .16
7191
7273
  ]),
7192
- c: Zi(T, [
7274
+ c: na(T, [
7193
7275
  .95,
7194
7276
  .35,
7195
7277
  .6
7196
7278
  ])
7197
7279
  }, h = {};
7198
- return h.stop = Bi(t, (t, r) => {
7280
+ return h.stop = Gi(t, (t, r) => {
7199
7281
  u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
7200
7282
  }), () => {
7201
7283
  h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
@@ -7214,7 +7296,7 @@ function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
7214
7296
  },
7215
7297
  style: {
7216
7298
  position: "relative",
7217
- minHeight: Hi(u, 320),
7299
+ minHeight: qi(u, 320),
7218
7300
  overflow: "hidden",
7219
7301
  ...P(m)
7220
7302
  },
@@ -7246,7 +7328,7 @@ function $i({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: o, sca
7246
7328
  }) : null]
7247
7329
  });
7248
7330
  }
7249
- function ea(e, t) {
7331
+ function aa(e, t) {
7250
7332
  let n = new e.Scene(), r = new e.BoxGeometry();
7251
7333
  r.deleteAttribute("uv");
7252
7334
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -7262,23 +7344,23 @@ function ea(e, t) {
7262
7344
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
7263
7345
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
7264
7346
  }
7265
- var ta = /* @__PURE__ */ new Map();
7266
- function na(e) {
7267
- if (ta.has(e)) return ta.get(e);
7268
- let t = Ii("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
7347
+ var oa = /* @__PURE__ */ new Map();
7348
+ function sa(e) {
7349
+ if (oa.has(e)) return oa.get(e);
7350
+ let t = Vi("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
7269
7351
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
7270
7352
  })).catch((t) => {
7271
- throw ta.delete(e), t;
7353
+ throw oa.delete(e), t;
7272
7354
  });
7273
- return ta.set(e, t), t;
7355
+ return oa.set(e, t), t;
7274
7356
  }
7275
- function ra(e, t) {
7357
+ function ca(e, t) {
7276
7358
  let n = new e.Box3().setFromObject(t);
7277
7359
  if (n.isEmpty()) return t;
7278
7360
  let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
7279
7361
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
7280
7362
  }
7281
- var ia = {
7363
+ var la = {
7282
7364
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
7283
7365
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
7284
7366
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -7287,50 +7369,50 @@ var ia = {
7287
7369
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
7288
7370
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
7289
7371
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
7290
- }, aa = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
7291
- function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
7292
- 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 && !Ri(), S = s !== !1 && !h;
7372
+ }, ua = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
7373
+ function da({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: o, controls: s, ground: u, height: f, style: p, nodeRef: m, inert: h }) {
7374
+ let g = c(null), [_, v] = l(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ui(), S = s !== !1 && !h;
7293
7375
  return a(() => {
7294
7376
  let e = g.current;
7295
7377
  if (!e) return;
7296
7378
  let i = !0, a = null;
7297
- return Fi().then((s) => {
7379
+ return Bi().then((s) => {
7298
7380
  if (!i || !e) return;
7299
7381
  let c = new s.WebGLRenderer({
7300
7382
  antialias: !0,
7301
7383
  alpha: !t
7302
7384
  });
7303
- c.setPixelRatio(zi()), 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);
7385
+ c.setPixelRatio(Wi()), c.shadowMap.enabled = u !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
7304
7386
  let l = new s.Scene();
7305
- t && (l.background = new s.Color(t)), l.environment = ea(s, c);
7306
- let d = new s.PerspectiveCamera(aa(r, 45), 1, .1, 400), f = Vi(d, c.domElement, {
7307
- distance: aa(n, 5),
7387
+ t && (l.background = new s.Color(t)), l.environment = aa(s, c);
7388
+ let d = new s.PerspectiveCamera(ua(r, 45), 1, .1, 400), f = Ki(d, c.domElement, {
7389
+ distance: ua(n, 5),
7308
7390
  enableZoom: S
7309
7391
  }), p = new s.DirectionalLight(16777215, 2.2);
7310
7392
  p.position.set(4, 7, 5), p.castShadow = u !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
7311
7393
  let m = [], h = new s.Group(), g = (e, t) => {
7312
- let n = aa(t.scale, 1);
7313
- e.position.set(aa(t.x, 0), aa(t.y, 0), aa(t.z, 0)), e.rotation.set(Wi(t.rx), Wi(t.ry), Wi(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Wi(t.spin);
7394
+ let n = ua(t.scale, 1);
7395
+ e.position.set(ua(t.x, 0), ua(t.y, 0), ua(t.z, 0)), e.rotation.set(Yi(t.rx), Yi(t.ry), Yi(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Yi(t.spin);
7314
7396
  };
7315
7397
  for (let e of y) {
7316
7398
  if (e.shape === "model") {
7317
- if (!Gi(e.src)) continue;
7399
+ if (!Xi(e.src)) continue;
7318
7400
  let t = new s.Group();
7319
- g(t, e), h.add(t), na(e.src).then((e) => {
7401
+ g(t, e), h.add(t), sa(e.src).then((e) => {
7320
7402
  if (!i) return;
7321
- let n = ra(s, e.clone(!0));
7403
+ let n = ca(s, e.clone(!0));
7322
7404
  n.traverse((e) => {
7323
7405
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
7324
7406
  }), t.add(n);
7325
7407
  }, () => {});
7326
7408
  continue;
7327
7409
  }
7328
- let t = (ia[e.shape] ?? ia.box)(s), n = new s.MeshStandardMaterial({
7410
+ let t = (la[e.shape] ?? la.box)(s), n = new s.MeshStandardMaterial({
7329
7411
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
7330
- metalness: Math.min(1, Math.max(0, Ui(e.metalness, 10))),
7331
- roughness: Math.min(1, Math.max(0, Ui(e.roughness, 35))),
7332
- transparent: Ui(e.opacity, 100) < 1,
7333
- opacity: Math.min(1, Math.max(0, Ui(e.opacity, 100))),
7412
+ metalness: Math.min(1, Math.max(0, Ji(e.metalness, 10))),
7413
+ roughness: Math.min(1, Math.max(0, Ji(e.roughness, 35))),
7414
+ transparent: Ji(e.opacity, 100) < 1,
7415
+ opacity: Math.min(1, Math.max(0, Ji(e.opacity, 100))),
7334
7416
  flatShading: e.flat === !0,
7335
7417
  wireframe: e.wireframe === !0,
7336
7418
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -7341,14 +7423,14 @@ function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
7341
7423
  let _ = null;
7342
7424
  if (u !== !1) {
7343
7425
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
7344
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = aa(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
7426
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = ua(u === !0 ? 0 : u, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
7345
7427
  }
7346
7428
  let v = () => {
7347
7429
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
7348
7430
  c.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
7349
7431
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
7350
7432
  b?.observe(e), v();
7351
- let C = Wi(Number.isFinite(Number(o)) ? o : 20), w = Bi(e, (e) => {
7433
+ let C = Yi(Number.isFinite(Number(o)) ? o : 20), w = Gi(e, (e) => {
7352
7434
  f.autoSpin(x ? C : 0, e), f.update();
7353
7435
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
7354
7436
  c.render(l, d);
@@ -7372,7 +7454,7 @@ function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
7372
7454
  o,
7373
7455
  S,
7374
7456
  u
7375
- ]), _ && h ? /* @__PURE__ */ d(Ki, {
7457
+ ]), _ && h ? /* @__PURE__ */ d(Zi, {
7376
7458
  nodeRef: m,
7377
7459
  style: p,
7378
7460
  height: f,
@@ -7383,27 +7465,27 @@ function oa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
7383
7465
  g.current = e, typeof m == "function" && m(e);
7384
7466
  },
7385
7467
  style: {
7386
- minHeight: Hi(f, 380),
7387
- height: Hi(f, 380),
7468
+ minHeight: qi(f, 380),
7469
+ height: qi(f, 380),
7388
7470
  overflow: "hidden",
7389
7471
  touchAction: S ? "pan-y" : void 0,
7390
7472
  ...P(p)
7391
7473
  }
7392
7474
  });
7393
7475
  }
7394
- function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
7476
+ function fa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o }) {
7395
7477
  let s = c(null), [u, f] = l("");
7396
7478
  return a(() => {
7397
7479
  let t = s.current;
7398
7480
  if (o || !t || typeof e != "string" || !e.trim()) return;
7399
7481
  let r = !0, i = null;
7400
- return Fi().then((a) => {
7482
+ return Bi().then((a) => {
7401
7483
  if (!r || !t) return;
7402
7484
  let o = new a.WebGLRenderer({
7403
7485
  antialias: !0,
7404
7486
  alpha: !n
7405
7487
  });
7406
- o.setPixelRatio(zi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
7488
+ o.setPixelRatio(Wi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
7407
7489
  let s = new a.Scene();
7408
7490
  n && (s.background = new a.Color(n));
7409
7491
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -7426,7 +7508,7 @@ function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7426
7508
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
7427
7509
  }, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
7428
7510
  d?.observe(t), u();
7429
- let p = !1, m = Bi(t, (e, t) => {
7511
+ let p = !1, m = Gi(t, (e, t) => {
7430
7512
  if (!p && typeof l?.frame == "function") try {
7431
7513
  l.frame(e, t);
7432
7514
  } catch (e) {
@@ -7448,7 +7530,7 @@ function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7448
7530
  e,
7449
7531
  o,
7450
7532
  n
7451
- ]), o ? /* @__PURE__ */ d(Ki, {
7533
+ ]), o ? /* @__PURE__ */ d(Zi, {
7452
7534
  nodeRef: i,
7453
7535
  style: r,
7454
7536
  height: t,
@@ -7459,8 +7541,8 @@ function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7459
7541
  s.current = e, typeof i == "function" && i(e);
7460
7542
  },
7461
7543
  style: {
7462
- minHeight: Hi(t, 380),
7463
- height: Hi(t, 380),
7544
+ minHeight: qi(t, 380),
7545
+ height: qi(t, 380),
7464
7546
  overflow: "hidden",
7465
7547
  position: "relative",
7466
7548
  touchAction: "pan-y",
@@ -7483,40 +7565,40 @@ function sa({ code: e, height: t, background: n, style: r, nodeRef: i, inert: o
7483
7565
  }) : null
7484
7566
  });
7485
7567
  }
7486
- var ca = {
7487
- ModelViewerBlock: qi,
7488
- ShaderBlock: $i,
7489
- SceneBlock: oa,
7490
- ThreeCanvasBlock: sa
7491
- }, la = /* @__PURE__ */ new Map();
7492
- function ua(e) {
7493
- if (la.has(e)) return la.get(e);
7568
+ var pa = {
7569
+ ModelViewerBlock: Qi,
7570
+ ShaderBlock: ia,
7571
+ SceneBlock: da,
7572
+ ThreeCanvasBlock: fa
7573
+ }, ma = /* @__PURE__ */ new Map();
7574
+ function ha(e) {
7575
+ if (ma.has(e)) return ma.get(e);
7494
7576
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
7495
7577
  /* @vite-ignore */
7496
7578
  /* webpackIgnore: true */
7497
7579
  t
7498
7580
  ).finally(() => URL.revokeObjectURL(t));
7499
- return la.set(e, n), n;
7581
+ return ma.set(e, n), n;
7500
7582
  }
7501
- function da(e) {
7583
+ function ga(e) {
7502
7584
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
7503
7585
  return n && typeof n == "object" ? n : {};
7504
7586
  }
7505
7587
  //#endregion
7506
7588
  //#region ../ui/src/components/builder/plugins/view.jsx
7507
- async function fa(e, t) {
7508
- let n = await ua(e);
7589
+ async function _a(e, t) {
7590
+ let n = await ha(e);
7509
7591
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
7510
7592
  }
7511
- var pa = {
7593
+ var va = {
7512
7594
  padding: "10px 12px",
7513
7595
  border: "1px dashed rgba(148, 163, 184, 0.5)",
7514
7596
  borderRadius: 8,
7515
7597
  fontSize: 12,
7516
7598
  opacity: .6
7517
7599
  };
7518
- function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7519
- let s = i(Q), l = da(s?.settings)[e], u = c(null), p = c(null), m = {
7600
+ function ya({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7601
+ let s = i(Q), l = ga(s?.settings)[e], u = c(null), p = c(null), m = {
7520
7602
  tenant: s?.tenant ?? "",
7521
7603
  apiUrl: s?.apiUrl ?? "/api",
7522
7604
  locale: s?.locale ?? "",
@@ -7528,7 +7610,7 @@ function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7528
7610
  let e = u.current;
7529
7611
  if (!l?.code || !e) return;
7530
7612
  let n = !0;
7531
- return fa(l.code, t).then((e) => {
7613
+ return _a(l.code, t).then((e) => {
7532
7614
  if (!(!n || !e || !u.current)) {
7533
7615
  p.current = e;
7534
7616
  try {
@@ -7558,7 +7640,7 @@ function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7558
7640
  }) : /* @__PURE__ */ f("div", {
7559
7641
  ref: o,
7560
7642
  style: {
7561
- ...pa,
7643
+ ...va,
7562
7644
  ...P(r)
7563
7645
  },
7564
7646
  children: [
@@ -7570,13 +7652,13 @@ function ma({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
7570
7652
  }
7571
7653
  //#endregion
7572
7654
  //#region ../ui/src/components/builder/render.jsx
7573
- var ha = {
7574
- ...qr,
7575
- ...Ei,
7576
- ...ca,
7577
- PluginBlock: ma
7655
+ var ba = {
7656
+ ...Qr,
7657
+ ...ji,
7658
+ ...pa,
7659
+ PluginBlock: ya
7578
7660
  };
7579
- function ga(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7661
+ function xa(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7580
7662
  let o = n[e];
7581
7663
  if (!o || o.hidden) return null;
7582
7664
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -7584,11 +7666,11 @@ function ga(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7584
7666
  let n = o.props?.componentId, s = r?.[n];
7585
7667
  if (!s?.template || i.has(n)) return null;
7586
7668
  let c = new Set(i).add(n);
7587
- return /* @__PURE__ */ d(t, { children: ga(s.template.rootId, s.template.nodes, r, c, a) }, e);
7669
+ return /* @__PURE__ */ d(t, { children: xa(s.template.rootId, s.template.nodes, r, c, a) }, e);
7588
7670
  }
7589
- let l = ha[s];
7671
+ let l = ba[s];
7590
7672
  if (!l) return null;
7591
- let u = (o.nodes ?? []).map((e) => ga(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, ga(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
7673
+ let u = (o.nodes ?? []).map((e) => xa(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, xa(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
7592
7674
  ...c,
7593
7675
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
7594
7676
  linked: p,
@@ -7597,16 +7679,16 @@ function ga(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
7597
7679
  },
7598
7680
  children: u.length ? u : void 0
7599
7681
  }, e);
7600
- return c.when && c.when !== "always" ? /* @__PURE__ */ d(ri, {
7682
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(ci, {
7601
7683
  when: c.when,
7602
7684
  children: m
7603
7685
  }, e) : m;
7604
7686
  }
7605
7687
  //#endregion
7606
7688
  //#region ../ui/src/components/builder/PageRenderer.jsx
7607
- var _a = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), va = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ge(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7689
+ var Sa = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ca = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ge(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
7608
7690
  .webim-page[data-webim-mode="dark"] { ${Object.entries(Ge(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
7609
- function ya({ 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 }) {
7691
+ function wa({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
7610
7692
  let y = o?.js?.trim();
7611
7693
  if (a(() => {
7612
7694
  if (!y) return;
@@ -7620,11 +7702,11 @@ function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7620
7702
  minHeight: "100%",
7621
7703
  display: "flex",
7622
7704
  flexDirection: "column"
7623
- }, w = ga("ROOT", e, n), T = s(() => ({ render: (t, r) => ga(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ae(e, n), O = ie(e, n), k = o?.css?.trim(), j = S(c), M = We(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ve[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
7705
+ }, w = xa("ROOT", e, n), T = s(() => ({ render: (t, r) => xa(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = ae(e, n), O = ie(e, n), k = o?.css?.trim(), j = S(c), M = We(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ve[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
7624
7706
  rel: "stylesheet",
7625
7707
  precedence: "default",
7626
7708
  href: D(e)
7627
- }, e)), F = va(M);
7709
+ }, e)), F = Ca(M);
7628
7710
  return r === "auto" ? /* @__PURE__ */ d(Q.Provider, {
7629
7711
  value: {
7630
7712
  tenant: l || "",
@@ -7632,7 +7714,7 @@ function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7632
7714
  locale: m || "",
7633
7715
  settings: _ ?? null
7634
7716
  },
7635
- children: /* @__PURE__ */ d(ni, {
7717
+ children: /* @__PURE__ */ d(si, {
7636
7718
  initialUser: v,
7637
7719
  children: /* @__PURE__ */ d(Qe.Provider, {
7638
7720
  value: p ?? null,
@@ -7647,8 +7729,8 @@ function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7647
7729
  ...i
7648
7730
  },
7649
7731
  children: [
7650
- /* @__PURE__ */ d("style", { children: `.webim-page { ${_a(Ge(M.light))} }
7651
- @media (prefers-color-scheme: dark) { .webim-page { ${_a(Ge(M.dark))} } }` }),
7732
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${Sa(Ge(M.light))} }
7733
+ @media (prefers-color-scheme: dark) { .webim-page { ${Sa(Ge(M.dark))} } }` }),
7652
7734
  /* @__PURE__ */ d("style", { children: F }),
7653
7735
  P,
7654
7736
  /* @__PURE__ */ d("style", { children: x }),
@@ -7668,7 +7750,7 @@ function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7668
7750
  locale: m || "",
7669
7751
  settings: _ ?? null
7670
7752
  },
7671
- children: /* @__PURE__ */ d(ni, {
7753
+ children: /* @__PURE__ */ d(si, {
7672
7754
  initialUser: v,
7673
7755
  children: /* @__PURE__ */ d(Qe.Provider, {
7674
7756
  value: p ?? null,
@@ -7701,8 +7783,8 @@ function ya({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
7701
7783
  }
7702
7784
  //#endregion
7703
7785
  //#region src/WebimContent.jsx
7704
- function ba({ bundle: e, mode: t = "auto", style: n }) {
7705
- return e?.blocks?.ROOT ? /* @__PURE__ */ d(ya, {
7786
+ function Ta({ bundle: e, mode: t = "auto", style: n }) {
7787
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(wa, {
7706
7788
  blocks: e.blocks,
7707
7789
  theme: e.theme,
7708
7790
  components: e.components,
@@ -7720,7 +7802,7 @@ function ba({ bundle: e, mode: t = "auto", style: n }) {
7720
7802
  }
7721
7803
  //#endregion
7722
7804
  //#region src/bundle.js
7723
- function xa({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7805
+ function Ea({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7724
7806
  let a = {
7725
7807
  ...t?.global ?? {},
7726
7808
  ...t?.tenant ?? {}
@@ -7746,18 +7828,18 @@ function xa({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
7746
7828
  }
7747
7829
  //#endregion
7748
7830
  //#region src/fetchPage.js
7749
- var Sa = async (e) => {
7831
+ var Da = async (e) => {
7750
7832
  let t = await e.json().catch(() => null);
7751
7833
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
7752
7834
  return t?.payload ?? t;
7753
7835
  };
7754
- async function Ca({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
7836
+ async function Oa({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
7755
7837
  if (!e) throw Error("fetchPage: apiUrl is required");
7756
7838
  if (!n) throw Error("fetchPage: slug is required");
7757
7839
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
7758
7840
  ...t ? { "x-tenant": t } : {},
7759
7841
  ...a ? { authorization: `Bearer ${a}` } : {}
7760
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Sa), c(`${l}/settings/public`, { headers: u }).then(Sa)]), p = xa({
7842
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Da), c(`${l}/settings/public`, { headers: u }).then(Da)]), p = Ea({
7761
7843
  page: d,
7762
7844
  settings: f,
7763
7845
  tenant: t,
@@ -7772,7 +7854,7 @@ async function Ca({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
7772
7854
  "LogoCarousel"
7773
7855
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
7774
7856
  if (m.length) {
7775
- 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(Sa).then((e) => {
7857
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Da).then((e) => {
7776
7858
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
7777
7859
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
7778
7860
  }).catch(() => [[t, []]])));
@@ -7786,40 +7868,40 @@ async function Ca({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
7786
7868
  }
7787
7869
  //#endregion
7788
7870
  //#region src/ssr.jsx
7789
- var wa = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
7871
+ var ka = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
7790
7872
  "&": "&amp;",
7791
7873
  "<": "&lt;",
7792
7874
  ">": "&gt;",
7793
7875
  "\"": "&quot;"
7794
7876
  })[e]);
7795
- function Ta(t, { mode: n = "auto", style: r } = {}) {
7796
- return e(/* @__PURE__ */ d(ba, {
7877
+ function Aa(t, { mode: n = "auto", style: r } = {}) {
7878
+ return e(/* @__PURE__ */ d(Ta, {
7797
7879
  bundle: t,
7798
7880
  mode: n,
7799
7881
  style: r
7800
7882
  }));
7801
7883
  }
7802
- function Ea(e, { mode: t = "auto", lang: n } = {}) {
7884
+ function ja(e, { mode: t = "auto", lang: n } = {}) {
7803
7885
  let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
7804
7886
  "<meta charset=\"utf-8\"/>",
7805
7887
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
7806
- `<title>${wa(o)}</title>`,
7807
- r.description && `<meta name="description" content="${wa(r.description)}"/>`,
7808
- `<meta property="og:title" content="${wa(o)}"/>`,
7809
- r.image && `<meta property="og:image" content="${wa(r.image)}"/>`,
7888
+ `<title>${ka(o)}</title>`,
7889
+ r.description && `<meta name="description" content="${ka(r.description)}"/>`,
7890
+ `<meta property="og:title" content="${ka(o)}"/>`,
7891
+ r.image && `<meta property="og:image" content="${ka(r.image)}"/>`,
7810
7892
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
7811
7893
  "<style>html,body{margin:0;height:100%}</style>"
7812
7894
  ].filter(Boolean).join("\n");
7813
7895
  return `<!doctype html>
7814
- <html lang="${wa(i)}"${a ? ` dir="${a}"` : ""}>
7896
+ <html lang="${ka(i)}"${a ? ` dir="${a}"` : ""}>
7815
7897
  <head>
7816
7898
  ${c}
7817
7899
  </head>
7818
7900
  <body>
7819
- ${Ta(e, { mode: t })}
7901
+ ${Aa(e, { mode: t })}
7820
7902
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
7821
7903
  </body>
7822
7904
  </html>`;
7823
7905
  }
7824
7906
  //#endregion
7825
- export { xa as assembleBundle, Ca as fetchPage, Ta as renderBundleHtml, Ea as renderPageDocument };
7907
+ export { Ea as assembleBundle, Oa as fetchPage, Aa as renderBundleHtml, ja as renderPageDocument };