webim-adapter 2.6.0 → 2.6.1

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.
@@ -267,30 +267,30 @@ function R(e) {
267
267
  R !== void 0 && U.push(`blur(${I(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
268
268
  let ee = M(P);
269
269
  ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
270
- let { textStrokeWidth: te, textStrokeColor: W } = t;
271
- delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${I(te ?? 1)} ${W || "currentColor"}`);
272
- let { clipText: ne } = t;
273
- delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
274
- let { transitions: G, transitionDuration: K, transitionEasing: re, transitionProperty: ie } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
270
+ let { textStrokeWidth: te, textStrokeColor: ne } = t;
271
+ delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${I(te ?? 1)} ${ne || "currentColor"}`);
272
+ let { clipText: re } = t;
273
+ delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
274
+ let { transitions: W, transitionDuration: G, transitionEasing: ie, transitionProperty: ae } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
275
275
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
276
- let oe = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
277
- if (K !== void 0 && oe.push(`${ie || "all"} ${ae(K)} ${re || "ease"}`), oe.length && (t.transition = oe.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
276
+ let se = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
277
+ if (G !== void 0 && se.push(`${ae || "all"} ${oe(G)} ${ie || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
278
278
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
279
279
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
280
280
  }
281
281
  delete t.backgroundVideo;
282
- let { overlayColor: se, overlayOpacity: ce } = t;
283
- if (delete t.overlayColor, delete t.overlayOpacity, se) {
284
- let e = `color-mix(in srgb, ${se} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
282
+ let { overlayColor: ce, overlayOpacity: le } = t;
283
+ if (delete t.overlayColor, delete t.overlayOpacity, ce) {
284
+ let e = `color-mix(in srgb, ${ce} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
285
285
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
286
286
  }
287
287
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
288
- let { backgroundLayers: le } = t;
288
+ let { backgroundLayers: ue } = t;
289
289
  delete t.backgroundLayers;
290
- let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
291
- if (ue.length) {
290
+ let de = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
291
+ if (de.length) {
292
292
  let e = [], n = [], r = [], i = [], a = [];
293
- for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
293
+ for (let t of de) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
294
294
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
295
295
  else {
296
296
  if (!t.src) continue;
@@ -324,8 +324,8 @@ var z = {
324
324
  "submit",
325
325
  "keydown",
326
326
  "inview"
327
- ], ee = ["load", "pagescroll"], te = [...U, ...ee], W = /^[A-Za-z_$][\w$]*$/;
328
- function ne(e, t) {
327
+ ], ee = ["load", "pagescroll"], te = [...U, ...ee], ne = /^[A-Za-z_$][\w$]*$/;
328
+ function re(e, t) {
329
329
  let n = String(t ?? "").trim();
330
330
  if (!n) return [e];
331
331
  let r = e.closest?.(".webim-page") ?? e.closest?.(".builder-canvas") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
@@ -337,15 +337,15 @@ function ne(e, t) {
337
337
  }
338
338
  return [];
339
339
  }
340
- function G(e, t) {
340
+ function W(e, t) {
341
341
  for (let t of e.__webimEvents ?? []) t();
342
342
  let n = [];
343
343
  for (let r of t ?? []) {
344
344
  let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
345
- if (!te.includes(t) || (i ? !a.length : !W.test(o))) continue;
345
+ if (!te.includes(t) || (i ? !a.length : !ne.test(o))) continue;
346
346
  let s = (t) => {
347
347
  if (i) {
348
- for (let t of ne(e, r?.target)) N(t, a);
348
+ for (let t of re(e, r?.target)) N(t, a);
349
349
  return;
350
350
  }
351
351
  let n = window[o];
@@ -368,7 +368,7 @@ function G(e, t) {
368
368
  }
369
369
  e.__webimEvents = n;
370
370
  }
371
- function K(e, t, n = []) {
371
+ function G(e, t, n = []) {
372
372
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
373
373
  let r = H(t.classNames), i = H(e.getAttribute("data-wb-class"));
374
374
  for (let t of i) r.includes(t) || e.classList.remove(t);
@@ -382,33 +382,33 @@ function K(e, t, n = []) {
382
382
  }
383
383
  return a;
384
384
  }
385
- var re = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
386
- function ie(e, t, n, r = !1) {
387
- let i = Object.entries(R(t)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
385
+ var ie = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
386
+ function ae(e, t, n, r = !1) {
387
+ let i = Object.entries(R(t)).map(([e, t]) => `${ie(e)}: ${t} !important;`).join(" ");
388
388
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
389
389
  }
390
- var ae = (e) => /^[a-z][a-z0-9-]{0,39}$/.test(String(e ?? ""));
391
- function oe(e, t, n = "") {
390
+ var oe = (e) => /^[a-z][a-z0-9-]{0,39}$/.test(String(e ?? ""));
391
+ function se(e, t, n = "") {
392
392
  return `[data-wb="${e}"] [data-wb-part~="${t}"]:not([data-wb="${e}"] [data-wb] [data-wb-part])${n}`;
393
393
  }
394
- function se(e) {
394
+ function ce(e) {
395
395
  let t = e?.partStyles;
396
396
  if (t && typeof t == "object" && !Array.isArray(t)) return t;
397
397
  let n = e?.parts;
398
398
  return n && typeof n == "object" && !Array.isArray(n) ? n : {};
399
399
  }
400
- var ce = (e) => Object.entries(se(e)).filter(([e, t]) => ae(e) && t && typeof t == "object").sort(([e], [t]) => e.split("-").length - t.split("-").length);
401
- function le(e, t, n, r = "", i = !1) {
402
- let a = Object.entries(R(n)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
403
- return a ? `${oe(e, t, i ? "" : r)} { ${a} }` : "";
400
+ var le = (e) => Object.entries(ce(e)).filter(([e, t]) => oe(e) && t && typeof t == "object").sort(([e], [t]) => e.split("-").length - t.split("-").length);
401
+ function ue(e, t, n, r = "", i = !1) {
402
+ let a = Object.entries(R(n)).map(([e, t]) => `${ie(e)}: ${t} !important;`).join(" ");
403
+ return a ? `${se(e, t, i ? "" : r)} { ${a} }` : "";
404
404
  }
405
- function ue(e, t, n, r) {
406
- return ce(t).flatMap(([t, i]) => [le(e, t, i.style), ...Object.entries(z).map(([a, o]) => le(e, t, i[a], o, n === a && r === t))]).filter(Boolean).join("\n");
405
+ function de(e, t, n, r) {
406
+ return le(t).flatMap(([t, i]) => [ue(e, t, i.style), ...Object.entries(z).map(([a, o]) => ue(e, t, i[a], o, n === a && r === t))]).filter(Boolean).join("\n");
407
407
  }
408
- function de(e, t, n) {
409
- return [...Object.entries(z).map(([r, i]) => ie(e, t?.[r], i, n === r)), ue(e, t)].filter(Boolean).join("\n");
408
+ function fe(e, t, n) {
409
+ return [...Object.entries(z).map(([r, i]) => ae(e, t?.[r], i, n === r)), de(e, t)].filter(Boolean).join("\n");
410
410
  }
411
- var fe = [
411
+ var pe = [
412
412
  {
413
413
  key: "tablet",
414
414
  max: 991
@@ -421,23 +421,23 @@ var fe = [
421
421
  key: "mobile",
422
422
  max: 478
423
423
  }
424
- ], pe = (e) => Object.entries(R(e)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
425
- function me(e, t) {
426
- let n = ce(t);
427
- return fe.map(({ key: r, max: i }) => {
428
- let a = [], o = t?.[r] ? pe(t[r]) : "";
424
+ ], me = (e) => Object.entries(R(e)).map(([e, t]) => `${ie(e)}: ${t} !important;`).join(" ");
425
+ function he(e, t) {
426
+ let n = le(t);
427
+ return pe.map(({ key: r, max: i }) => {
428
+ let a = [], o = t?.[r] ? me(t[r]) : "";
429
429
  o && a.push(`[data-wb="${e}"] { ${o} }`);
430
430
  for (let [t, i] of n) {
431
- let n = i[r] ? pe(i[r]) : "";
432
- n && a.push(`${oe(e, t)} { ${n} }`);
431
+ let n = i[r] ? me(i[r]) : "";
432
+ n && a.push(`${se(e, t)} { ${n} }`);
433
433
  }
434
434
  return a.length ? `@media (max-width: ${i}px) { ${a.join(" ")} }` : "";
435
435
  }).filter(Boolean).join("\n");
436
436
  }
437
- function he(e, t) {
437
+ function ge(e, t) {
438
438
  let n = [], r = (e) => {
439
439
  for (let [t, r] of Object.entries(e || {})) {
440
- let e = me(t, r.props);
440
+ let e = he(t, r.props);
441
441
  e && n.push(e);
442
442
  }
443
443
  };
@@ -445,10 +445,10 @@ function he(e, t) {
445
445
  for (let e of Object.values(t || {})) r(e.template?.nodes);
446
446
  return n.join("\n");
447
447
  }
448
- function ge(e, t) {
448
+ function _e(e, t) {
449
449
  let n = [], r = (e) => {
450
450
  for (let [t, r] of Object.entries(e || {})) {
451
- let e = de(t, r.props);
451
+ let e = fe(t, r.props);
452
452
  e && n.push(e);
453
453
  }
454
454
  };
@@ -456,15 +456,15 @@ function ge(e, t) {
456
456
  for (let e of Object.values(t || {})) r(e.template?.nodes);
457
457
  return n.join("\n");
458
458
  }
459
- var _e = ":where(.webim-page, .wb-artboard) :where([data-wb-link]) { color: var(--page-link, inherit); text-decoration-line: var(--page-link-decoration, underline); }\n:where(.webim-page, .wb-artboard) :where([data-wb-link]):hover { color: var(--page-link-hover, var(--page-link, inherit)); text-decoration-line: var(--page-link-hover-decoration, underline); }", ve = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ye = {
460
- fontFamily: ve,
459
+ var ve = ":where(.webim-page, .wb-artboard) :where([data-wb-link]) { color: var(--page-link, inherit); text-decoration-line: var(--page-link-decoration, underline); }\n:where(.webim-page, .wb-artboard) :where([data-wb-link]):hover { color: var(--page-link-hover, var(--page-link, inherit)); text-decoration-line: var(--page-link-hover-decoration, underline); }", ye = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", be = {
460
+ fontFamily: ye,
461
461
  fontStyle: "normal",
462
462
  fontWeight: 400,
463
463
  letterSpacing: "normal",
464
464
  textTransform: "none",
465
465
  lineHeight: 1.4,
466
466
  textShadow: "none"
467
- }, be = {
467
+ }, xe = {
468
468
  light: {
469
469
  background: "#f2f2f2",
470
470
  surface: "#f2f2f2",
@@ -509,36 +509,36 @@ var _e = ":where(.webim-page, .wb-artboard) :where([data-wb-link]) { color: var(
509
509
  contrastText: "#052e2b"
510
510
  }
511
511
  }
512
- }, xe = {
512
+ }, Se = {
513
513
  h1: 40,
514
514
  h2: 32,
515
515
  h3: 26,
516
516
  h4: 22,
517
517
  h5: 19,
518
518
  h6: 16
519
- }, Se = [
519
+ }, Ce = [
520
520
  "always",
521
521
  "hover",
522
522
  "never"
523
- ], Ce = {
523
+ ], K = {
524
524
  font: "system",
525
525
  headingFont: "inherit",
526
- headings: xe,
526
+ headings: Se,
527
527
  bodySize: 16,
528
- light: be.light,
529
- dark: be.dark
528
+ light: xe.light,
529
+ dark: xe.dark
530
530
  }, q = {
531
531
  system: {
532
532
  label: "System",
533
- value: ve
533
+ value: ye
534
534
  },
535
535
  inter: {
536
536
  label: "Inter",
537
- value: `"Inter", ${ve}`
537
+ value: `"Inter", ${ye}`
538
538
  },
539
539
  outfit: {
540
540
  label: "Outfit",
541
- value: `"Outfit", ${ve}`
541
+ value: `"Outfit", ${ye}`
542
542
  },
543
543
  serif: {
544
544
  label: "Serif",
@@ -567,23 +567,23 @@ var _e = ":where(.webim-page, .wb-artboard) :where([data-wb-link]) { color: var(
567
567
  function Te(e) {
568
568
  let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, linkUnderline: s, ...c } = e ?? {};
569
569
  return {
570
- font: r ?? Ce.font,
571
- headingFont: i ?? Ce.headingFont,
570
+ font: r ?? K.font,
571
+ headingFont: i ?? K.headingFont,
572
572
  headings: {
573
- ...xe,
573
+ ...Se,
574
574
  ...a ?? {}
575
575
  },
576
576
  bodySize: o ?? 16,
577
- linkUnderline: Se.includes(s) ? s : "always",
578
- light: we(be.light, c, t),
579
- dark: we(be.dark, n)
577
+ linkUnderline: Ce.includes(s) ? s : "always",
578
+ light: we(xe.light, c, t),
579
+ dark: we(xe.dark, n)
580
580
  };
581
581
  }
582
582
  function Ee(e) {
583
583
  return {
584
584
  "--page-bg": e.background,
585
585
  "--page-surface": e.surface ?? e.background,
586
- "--page-border": e.border ?? be.light.border,
586
+ "--page-border": e.border ?? xe.light.border,
587
587
  "--page-text": e.text,
588
588
  "--page-accent": e.accent,
589
589
  "--page-accent-text": e.accentText,
@@ -604,7 +604,7 @@ function De(e) {
604
604
  return {
605
605
  backgroundColor: "var(--page-bg)",
606
606
  color: "var(--page-text)",
607
- fontFamily: J(t.font, ve),
607
+ fontFamily: J(t.font, ye),
608
608
  "--page-heading-font": t.headingFont === "inherit" ? "inherit" : J(t.headingFont, "inherit"),
609
609
  ...ke(t.headings),
610
610
  "--page-body-size": Oe(t.bodySize, 16),
@@ -617,9 +617,9 @@ function Oe(e, t) {
617
617
  }
618
618
  function ke(e) {
619
619
  let t = {};
620
- for (let n of Object.keys(xe)) {
621
- let r = e?.[n] ?? xe[n];
622
- t[`--page-${n}`] = Oe(r, xe[n]);
620
+ for (let n of Object.keys(Se)) {
621
+ let r = e?.[n] ?? Se[n];
622
+ t[`--page-${n}`] = Oe(r, Se[n]);
623
623
  }
624
624
  return t;
625
625
  }
@@ -1025,7 +1025,7 @@ var jt = {
1025
1025
  fontWeight: 700,
1026
1026
  lineHeight: 1.2,
1027
1027
  fontFamily: "var(--page-heading-font, inherit)"
1028
- }, Mt = xe, Nt = (e) => `var(--page-${e}, ${xe[e] ?? xe.h2}px)`, Pt = {
1028
+ }, Mt = Se, Nt = (e) => `var(--page-${e}, ${Se[e] ?? Se.h2}px)`, Pt = {
1029
1029
  margin: 0,
1030
1030
  fontSize: "var(--page-body-size, 16px)"
1031
1031
  }, Ft = {
@@ -3772,20 +3772,20 @@ function wr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3772
3772
  N,
3773
3773
  A
3774
3774
  ]), !k && !y) return null;
3775
- let B = Math.max(1, Number(t) || 6), V = y ? O?.all ?? [] : F ?? L ?? [], H = y ? O?.parentField : _, U = y ? O?.collection : k, ee = y ? St(V, H, O?.entry) : A && v ? V.filter((e) => xt(e, _).length === 0) : V, te = p && (F || y || A || k.startsWith("api:")) ? ee.slice((I - 1) * B, I * B) : ee.slice(0, B), W = Math.min(Math.max(Number(r) || 3, 1), 6), ne = n === "list" ? {
3775
+ let B = Math.max(1, Number(t) || 6), V = y ? O?.all ?? [] : F ?? L ?? [], H = y ? O?.parentField : _, U = y ? O?.collection : k, ee = y ? St(V, H, O?.entry) : A && v ? V.filter((e) => xt(e, _).length === 0) : V, te = p && (F || y || A || k.startsWith("api:")) ? ee.slice((I - 1) * B, I * B) : ee.slice(0, B), ne = Math.min(Math.max(Number(r) || 3, 1), 6), re = n === "list" ? {
3776
3776
  display: "flex",
3777
3777
  flexDirection: "column",
3778
3778
  gap: Cr(b, 20)
3779
3779
  } : {
3780
3780
  display: "grid",
3781
- gridTemplateColumns: `repeat(${W}, minmax(0, 1fr))`,
3781
+ gridTemplateColumns: `repeat(${ne}, minmax(0, 1fr))`,
3782
3782
  gap: Cr(b, 24)
3783
- }, G = d ?? (u && E?.render ? (e) => E.render(u, e) : null);
3784
- return l && G ? /* @__PURE__ */ h("div", {
3783
+ }, W = d ?? (u && E?.render ? (e) => E.render(u, e) : null);
3784
+ return l && W ? /* @__PURE__ */ h("div", {
3785
3785
  ref: S,
3786
3786
  style: {
3787
3787
  width: "100%",
3788
- ...ne,
3788
+ ...re,
3789
3789
  ...R(x)
3790
3790
  },
3791
3791
  children: te.map((e) => /* @__PURE__ */ h("div", {
@@ -3797,14 +3797,14 @@ function wr({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3797
3797
  parentField: H,
3798
3798
  collection: U
3799
3799
  },
3800
- children: G((t) => At(t, e))
3800
+ children: W((t) => At(t, e))
3801
3801
  })
3802
3802
  }, e.id ?? e?.data?.slug))
3803
3803
  }) : /* @__PURE__ */ h("div", {
3804
3804
  ref: S,
3805
3805
  style: {
3806
3806
  width: "100%",
3807
- ...ne,
3807
+ ...re,
3808
3808
  ...R(x)
3809
3809
  },
3810
3810
  children: te.map((e) => {
@@ -5240,14 +5240,14 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5240
5240
  };
5241
5241
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
5242
5242
  }, [N, I]);
5243
- let { tenant: H, apiUrl: U } = s(Y), ee = s(ht), te = ee?.[u], W = C ? gt(ee) : 1, [ne, G] = f(null);
5243
+ let { tenant: H, apiUrl: U } = s(Y), ee = s(ht), te = ee?.[u], ne = C ? gt(ee) : 1, [re, W] = f(null);
5244
5244
  if (c(() => {
5245
5245
  if (!u || te) return;
5246
- let e = !0, t = Math.max(1, Number(p) || 10), n = C && !u.startsWith("api:") ? `?offset=${(W - 1) * t}&limit=${t}` : "", r = u.startsWith("api:") ? `${U}/data/${encodeURIComponent(u.slice(4))}` : `${U}/dynamic/${encodeURIComponent(u)}${n}`;
5246
+ let e = !0, t = Math.max(1, Number(p) || 10), n = C && !u.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = u.startsWith("api:") ? `${U}/data/${encodeURIComponent(u.slice(4))}` : `${U}/dynamic/${encodeURIComponent(u)}${n}`;
5247
5247
  return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
5248
5248
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
5249
- return e && G(n);
5250
- }).catch(() => e && G([])), () => {
5249
+ return e && W(n);
5250
+ }).catch(() => e && W([])), () => {
5251
5251
  e = !1;
5252
5252
  };
5253
5253
  }, [
@@ -5256,42 +5256,42 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5256
5256
  U,
5257
5257
  te,
5258
5258
  C,
5259
- W,
5259
+ ne,
5260
5260
  p
5261
5261
  ]), !e.length) return null;
5262
- let K = Math.max(1, Number(p) || 10), re = u ? C ? te || u.startsWith("api:") ? (te ?? ne ?? []).slice((W - 1) * K, W * K) : (ne ?? []).slice(0, K) : (te ?? ne ?? []).slice(0, K) : null, ie = re ? re.map((t) => e.map((e) => kt(Dt(t?.data, e.field)))) : t, ae = !!u && !(u && !te && ne === null) && ie.length === 0, oe = b ? {
5262
+ let G = Math.max(1, Number(p) || 10), ie = u ? C ? te || u.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * G, ne * G) : (re ?? []).slice(0, G) : (te ?? re ?? []).slice(0, G) : null, ae = ie ? ie.map((t) => e.map((e) => kt(Dt(t?.data, e.field)))) : t, oe = !!u && !(u && !te && re === null) && ae.length === 0, se = b ? {
5263
5263
  y: 6,
5264
5264
  x: 10
5265
5265
  } : {
5266
5266
  y: 10,
5267
5267
  x: 14
5268
- }, se = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, ce = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, le = y ? { border: ce } : { borderBottom: ce }, ue = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), de = [
5268
+ }, ce = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : se.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : se.x}px`, le = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ue = y ? { border: le } : { borderBottom: le }, de = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), fe = [
5269
5269
  "left",
5270
5270
  "center",
5271
5271
  "right"
5272
- ], fe = (t) => de.includes(e[t]?.align) ? e[t].align : "", pe = (e) => fe(e) || (de.includes(O) ? O : "left"), me = Number.isFinite(Number(A)) && Number(A) > 0 ? Number(A) : 0, he = R(j), ge = !me && he && he.maxHeight !== void 0 ? he.maxHeight : 0, _e = me || ge, ve = ge ? {
5273
- ...he,
5272
+ ], pe = (t) => fe.includes(e[t]?.align) ? e[t].align : "", me = (e) => pe(e) || (fe.includes(O) ? O : "left"), he = Number.isFinite(Number(A)) && Number(A) > 0 ? Number(A) : 0, ge = R(j), _e = !he && ge && ge.maxHeight !== void 0 ? ge.maxHeight : 0, ve = he || _e, ye = _e ? {
5273
+ ...ge,
5274
5274
  maxHeight: void 0
5275
- } : he, ye = !!N && N.rows !== !1, be = (t) => (r) => {
5275
+ } : ge, be = !!N && N.rows !== !1, xe = (t) => (r) => {
5276
5276
  if (!N?.resize || t >= e.length - 1) return;
5277
5277
  r.preventDefault(), r.stopPropagation();
5278
5278
  let i = P.current, a = i ? i.clientWidth : 0;
5279
5279
  if (!a) return;
5280
- let o = ue ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
5280
+ let o = de ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
5281
5281
  let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
5282
5282
  i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
5283
5283
  }, u = () => {
5284
5284
  window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
5285
5285
  };
5286
5286
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
5287
- }, xe = /* @__PURE__ */ new Set();
5288
- o && ie.forEach((t, n) => e.forEach((e, t) => {
5287
+ }, Se = /* @__PURE__ */ new Set();
5288
+ o && ae.forEach((t, n) => e.forEach((e, t) => {
5289
5289
  let a = o[oi(r[n], i[t])];
5290
5290
  if (!a) return;
5291
5291
  let s = Math.max(1, Number(a.c) || 1), c = Math.max(1, Number(a.r) || 1);
5292
- for (let e = 0; e < c; e++) for (let r = 0; r < s; r++) (e || r) && xe.add(`${n + e},${t + r}`);
5292
+ for (let e = 0; e < c; e++) for (let r = 0; r < s; r++) (e || r) && Se.add(`${n + e},${t + r}`);
5293
5293
  }));
5294
- let Se = (e) => (t) => {
5294
+ let Ce = (e) => (t) => {
5295
5295
  if (!N?.resizeRow) return;
5296
5296
  t.preventDefault(), t.stopPropagation();
5297
5297
  let n = t.currentTarget.closest("tr");
@@ -5300,7 +5300,7 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5300
5300
  window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
5301
5301
  };
5302
5302
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
5303
- }, Ce = (e, t, n, r) => r ? null : /* @__PURE__ */ h("span", {
5303
+ }, K = (e, t, n, r) => r ? null : /* @__PURE__ */ h("span", {
5304
5304
  className: "wb-tedit-btn",
5305
5305
  role: "button",
5306
5306
  "data-hint": t,
@@ -5309,7 +5309,7 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5309
5309
  },
5310
5310
  onClick: n,
5311
5311
  children: e
5312
- }, t), q = I && I.r < ie.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? o?.[oi(r[q.r], i[q.c])] : null, Te = Math.max(1, Number(we?.c) || 1), Ee = Math.max(1, Number(we?.r) || 1);
5312
+ }, t), q = I && I.r < ae.length && I.c < e.length ? I : null, J = (e, t) => N?.labels?.[e] ?? t, we = q ? o?.[oi(r[q.r], i[q.c])] : null, Te = Math.max(1, Number(we?.c) || 1), Ee = Math.max(1, Number(we?.r) || 1);
5313
5313
  return /* @__PURE__ */ g("div", {
5314
5314
  ref: (e) => {
5315
5315
  F.current = e, typeof M == "function" && M(e);
@@ -5317,7 +5317,7 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5317
5317
  style: {
5318
5318
  width: "100%",
5319
5319
  ...N ? { position: "relative" } : null,
5320
- ...ve
5320
+ ...ye
5321
5321
  },
5322
5322
  children: [
5323
5323
  N && /* @__PURE__ */ h("style", { children: ai }),
@@ -5333,29 +5333,29 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5333
5333
  className: "wb-tedit-at",
5334
5334
  children: `R${q.r + 1}·C${q.c + 1}`
5335
5335
  }),
5336
- Ce("+↑", J("rowAbove", "Insert row above"), () => N.addRow(q.r - 1)),
5337
- Ce("+↓", J("rowBelow", "Insert row below"), () => N.addRow(q.r)),
5338
- Ce("↑", J("rowUp", "Move row up"), () => N.moveRow(q.r, -1), q.r === 0),
5339
- Ce("↓", J("rowDown", "Move row down"), () => N.moveRow(q.r, 1), q.r >= ie.length - 1),
5340
- Ce("✕ row", J("rowDelete", "Delete row"), () => N.dropRow(q.r), ie.length <= 1),
5336
+ K("+↑", J("rowAbove", "Insert row above"), () => N.addRow(q.r - 1)),
5337
+ K("+↓", J("rowBelow", "Insert row below"), () => N.addRow(q.r)),
5338
+ K("↑", J("rowUp", "Move row up"), () => N.moveRow(q.r, -1), q.r === 0),
5339
+ K("↓", J("rowDown", "Move row down"), () => N.moveRow(q.r, 1), q.r >= ae.length - 1),
5340
+ K("✕ row", J("rowDelete", "Delete row"), () => N.dropRow(q.r), ae.length <= 1),
5341
5341
  /* @__PURE__ */ h("span", { className: "wb-tedit-sep" }),
5342
- Ce("+←", J("colLeft", "Insert column left"), () => N.addColumn(q.c - 1)),
5343
- Ce("+→", J("colRight", "Insert column right"), () => N.addColumn(q.c)),
5344
- Ce("←", J("colMoveLeft", "Move column left"), () => N.moveColumn(q.c, -1), q.c === 0),
5345
- Ce("→", J("colMoveRight", "Move column right"), () => N.moveColumn(q.c, 1), q.c >= e.length - 1),
5346
- Ce("✕ col", J("colDelete", "Delete column"), () => N.dropColumn(q.c), e.length <= 1),
5342
+ K("+←", J("colLeft", "Insert column left"), () => N.addColumn(q.c - 1)),
5343
+ K("+→", J("colRight", "Insert column right"), () => N.addColumn(q.c)),
5344
+ K("←", J("colMoveLeft", "Move column left"), () => N.moveColumn(q.c, -1), q.c === 0),
5345
+ K("→", J("colMoveRight", "Move column right"), () => N.moveColumn(q.c, 1), q.c >= e.length - 1),
5346
+ K("✕ col", J("colDelete", "Delete column"), () => N.dropColumn(q.c), e.length <= 1),
5347
5347
  /* @__PURE__ */ h("span", { className: "wb-tedit-sep" }),
5348
- Ce("↔", J("mergeRight", "Merge with the cell on the right"), () => N.merge(q.r, q.c, "right"), q.c + Te >= e.length),
5349
- Ce("↕", J("mergeDown", "Merge with the cell below"), () => N.merge(q.r, q.c, "down"), q.r + Ee >= ie.length),
5350
- Ce("⤫", J("split", "Split this cell"), () => N.split(q.r, q.c), Te === 1 && Ee === 1)
5348
+ K("↔", J("mergeRight", "Merge with the cell on the right"), () => N.merge(q.r, q.c, "right"), q.c + Te >= e.length),
5349
+ K("↕", J("mergeDown", "Merge with the cell below"), () => N.merge(q.r, q.c, "down"), q.r + Ee >= ae.length),
5350
+ K("⤫", J("split", "Split this cell"), () => N.split(q.r, q.c), Te === 1 && Ee === 1)
5351
5351
  ]
5352
5352
  }),
5353
5353
  /* @__PURE__ */ h("div", {
5354
5354
  style: {
5355
5355
  width: "100%",
5356
5356
  overflowX: "auto",
5357
- ..._e ? {
5358
- maxHeight: _e,
5357
+ ...ve ? {
5358
+ maxHeight: ve,
5359
5359
  overflowY: "auto"
5360
5360
  } : null
5361
5361
  },
@@ -5367,20 +5367,20 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5367
5367
  borderCollapse: T && _ !== !1 ? "separate" : "collapse",
5368
5368
  borderSpacing: 0,
5369
5369
  fontSize: 14,
5370
- ...ue ? { tableLayout: "fixed" } : null,
5371
- ...y ? { border: ce } : {}
5370
+ ...de ? { tableLayout: "fixed" } : null,
5371
+ ...y ? { border: le } : {}
5372
5372
  },
5373
5373
  children: [
5374
- ue && /* @__PURE__ */ h("colgroup", { children: n.map((e, t) => /* @__PURE__ */ h("col", { style: { width: `${e}%` } }, t)) }),
5374
+ de && /* @__PURE__ */ h("colgroup", { children: n.map((e, t) => /* @__PURE__ */ h("col", { style: { width: `${e}%` } }, t)) }),
5375
5375
  _ === !1 ? null : /* @__PURE__ */ h("thead", { children: /* @__PURE__ */ h("tr", {
5376
5376
  ...X("header-row"),
5377
5377
  children: e.map((t, n) => /* @__PURE__ */ h("th", {
5378
5378
  ...X("header-cell"),
5379
5379
  className: N ? "wb-tedit-head" : void 0,
5380
5380
  style: {
5381
- textAlign: pe(n),
5381
+ textAlign: me(n),
5382
5382
  fontWeight: 600,
5383
- padding: se,
5383
+ padding: ce,
5384
5384
  ...typeof D == "string" && D ? { color: D } : null,
5385
5385
  background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
5386
5386
  ...T ? {
@@ -5388,7 +5388,7 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5388
5388
  top: 0,
5389
5389
  zIndex: 2
5390
5390
  } : N ? { position: "relative" } : null,
5391
- ...le
5391
+ ...ue
5392
5392
  },
5393
5393
  children: N ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(ri, {
5394
5394
  value: t.label ?? t,
@@ -5398,21 +5398,21 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5398
5398
  }), n < e.length - 1 && /* @__PURE__ */ h("span", {
5399
5399
  className: "wb-tedit-grip",
5400
5400
  title: J("colWidth", "Drag to resize the column"),
5401
- onPointerDown: be(n)
5401
+ onPointerDown: xe(n)
5402
5402
  })] }) : t.label ?? t
5403
5403
  }, n))
5404
5404
  }) }),
5405
- /* @__PURE__ */ g("tbody", { children: [ae && /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", {
5405
+ /* @__PURE__ */ g("tbody", { children: [oe && /* @__PURE__ */ h("tr", { children: /* @__PURE__ */ h("td", {
5406
5406
  colSpan: e.length,
5407
5407
  ...X("empty"),
5408
5408
  style: {
5409
- padding: se,
5409
+ padding: ce,
5410
5410
  textAlign: "center",
5411
5411
  opacity: .6,
5412
- ...le
5412
+ ...ue
5413
5413
  },
5414
5414
  children: w || "No data yet"
5415
- }) }), ie.map((t, n) => /* @__PURE__ */ h("tr", {
5415
+ }) }), ae.map((t, n) => /* @__PURE__ */ h("tr", {
5416
5416
  ...X("row", n % 2 == 1 && "row-alt"),
5417
5417
  className: N ? "wb-tedit-row" : void 0,
5418
5418
  style: {
@@ -5420,25 +5420,25 @@ function ci({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
5420
5420
  ...Number.isFinite(Number(a?.[n])) && a[n] > 0 ? { height: a[n] } : null
5421
5421
  },
5422
5422
  children: e.map((e, a) => {
5423
- if (xe.has(`${n},${a}`)) return null;
5423
+ if (Se.has(`${n},${a}`)) return null;
5424
5424
  let s = oi(r[n], i[a]), c = l?.[s], u = o?.[s], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1);
5425
5425
  return /* @__PURE__ */ g("td", {
5426
5426
  ...X("cell"),
5427
5427
  className: N ? `wb-tedit-cell${I?.r === n && I?.c === a ? " wb-tedit-cellon" : ""}` : void 0,
5428
- onMouseDownCapture: ye ? V(n, a) : void 0,
5428
+ onMouseDownCapture: be ? V(n, a) : void 0,
5429
5429
  "data-cell": N ? `${n}-${a}` : void 0,
5430
5430
  colSpan: d > 1 ? d : void 0,
5431
5431
  rowSpan: f > 1 ? f : void 0,
5432
5432
  style: {
5433
- padding: se,
5434
- ...fe(a) ? { textAlign: fe(a) } : null,
5433
+ padding: ce,
5434
+ ...pe(a) ? { textAlign: pe(a) } : null,
5435
5435
  ...N ? { position: "relative" } : null,
5436
- ...le
5436
+ ...ue
5437
5437
  },
5438
- children: [c ?? si(t?.[a]), N && ye && /* @__PURE__ */ h("span", {
5438
+ children: [c ?? si(t?.[a]), N && be && /* @__PURE__ */ h("span", {
5439
5439
  className: "wb-tedit-rowgrip",
5440
5440
  title: J("rowHeight", "Drag to set the row height — double-click to fit the content"),
5441
- onPointerDown: Se(n),
5441
+ onPointerDown: Ce(n),
5442
5442
  onDoubleClick: () => N.resizeRow(n, 0)
5443
5443
  })]
5444
5444
  }, a);
@@ -5617,7 +5617,7 @@ function gi({ events: e = [], source: t = "", titleField: n = "", startField: r
5617
5617
  padding: "4px 8px"
5618
5618
  },
5619
5619
  children: t < 0 ? "‹" : "›"
5620
- }), W = /* @__PURE__ */ g("div", {
5620
+ }), ne = /* @__PURE__ */ g("div", {
5621
5621
  ...X("header"),
5622
5622
  style: {
5623
5623
  display: "flex",
@@ -5653,7 +5653,7 @@ function gi({ events: e = [], source: t = "", titleField: n = "", startField: r
5653
5653
  width: "100%",
5654
5654
  ...R(S)
5655
5655
  },
5656
- children: [W, e.length ? /* @__PURE__ */ h("div", {
5656
+ children: [ne, e.length ? /* @__PURE__ */ h("div", {
5657
5657
  style: {
5658
5658
  display: "flex",
5659
5659
  flexDirection: "column",
@@ -5692,10 +5692,10 @@ function gi({ events: e = [], source: t = "", titleField: n = "", startField: r
5692
5692
  })]
5693
5693
  });
5694
5694
  }
5695
- 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(), ie = Math.ceil((K + re) / 7), ae = ui(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(V, { weekday: "short" }), se = [];
5696
- for (let e = 0; e < ie * 7; e += 1) {
5697
- let t = e - K + 1, n = t >= 1 && t <= re, r = ui(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
5698
- se.push(/* @__PURE__ */ g("div", {
5695
+ let re = new Date(j.year, j.month, 1), W = y === "sunday" ? 0 : 1, G = (re.getDay() - W + 7) % 7, ie = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((G + ie) / 7), oe = ui(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), ce = [];
5696
+ for (let e = 0; e < ae * 7; e += 1) {
5697
+ let t = e - G + 1, n = t >= 1 && t <= ie, r = ui(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
5698
+ ce.push(/* @__PURE__ */ g("div", {
5699
5699
  ...X("day", !n && "day-outside", o && "day-today"),
5700
5700
  style: {
5701
5701
  minHeight: N.cell,
@@ -5741,7 +5741,7 @@ function gi({ events: e = [], source: t = "", titleField: n = "", startField: r
5741
5741
  ...R(S)
5742
5742
  },
5743
5743
  children: [
5744
- W,
5744
+ ne,
5745
5745
  /* @__PURE__ */ g("div", {
5746
5746
  ...X("grid"),
5747
5747
  style: {
@@ -5757,8 +5757,8 @@ function gi({ events: e = [], source: t = "", titleField: n = "", startField: r
5757
5757
  textAlign: "center",
5758
5758
  padding: `0 0 ${N.pad}px`
5759
5759
  },
5760
- children: oe.format(new Date(2024, 0, 7 + G + t))
5761
- }, `head-${t}`)), se]
5760
+ children: se.format(new Date(2024, 0, 7 + W + t))
5761
+ }, `head-${t}`)), ce]
5762
5762
  }),
5763
5763
  /* @__PURE__ */ h("div", { style: { borderTop: `1px solid ${F}` } })
5764
5764
  ]
@@ -5781,7 +5781,7 @@ function vi(e, t = {}) {
5781
5781
  }).filter((e) => e.src);
5782
5782
  }
5783
5783
  function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 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 }) {
5784
- let { tenant: D, apiUrl: O } = s(Y), k = s(ht)?.[t], [A, j] = f(null), M = d(null), N = d(null), [P, F] = f(0), [I, L] = f(0), [z, B] = f(0), [V, H] = f(!0), [U, ee] = f(!1), [te, W] = f(!1);
5784
+ let { tenant: D, apiUrl: O } = s(Y), k = s(ht)?.[t], [A, j] = f(null), M = d(null), N = d(null), [P, F] = f(0), [I, L] = f(0), [z, B] = f(0), [V, H] = f(!0), [U, ee] = f(!1), [te, ne] = f(!1);
5785
5785
  c(() => {
5786
5786
  if (!t || k) return;
5787
5787
  let e = !0;
@@ -5798,7 +5798,7 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5798
5798
  k
5799
5799
  ]), c(() => {
5800
5800
  if (typeof window > "u" || !window.matchMedia) return;
5801
- let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => W(e.matches);
5801
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
5802
5802
  return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
5803
5803
  }, []), c(() => {
5804
5804
  let e = N.current;
@@ -5811,7 +5811,7 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5811
5811
  let e = M.current;
5812
5812
  if (!e) return;
5813
5813
  let t = !0, n = () => {
5814
- let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * K);
5814
+ let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
5815
5815
  t && n.length && L(Math.ceil(Math.max(...n)));
5816
5816
  };
5817
5817
  n();
@@ -5820,12 +5820,12 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5820
5820
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
5821
5821
  };
5822
5822
  });
5823
- let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? vi(k ?? A ?? [], {
5823
+ let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? vi(k ?? A ?? [], {
5824
5824
  imageField: n,
5825
5825
  nameField: r,
5826
5826
  hrefField: i
5827
- }) : ne, K = _i[o] ?? _i.medium, re = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, ie = a === "marquee" ? "step" : a, ae = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), ce = (I || K * 3) + re, le = P ? Math.max(1, Math.floor(P / ce)) : se, ue = Math.min(se, le), de = P ? Math.min(ce, P / ue) : ce;
5828
- if (!G.length) return /* @__PURE__ */ h("div", {
5827
+ }) : re, G = _i[o] ?? _i.medium, ie = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 48, ae = a === "marquee" ? "step" : a, oe = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), se = Math.min(3e3, Math.max(100, Number(_) || 500)), ce = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), le = (I || G * 3) + ie, ue = P ? Math.max(1, Math.floor(P / le)) : ce, de = Math.min(ce, ue), fe = P ? Math.min(le, P / de) : le;
5828
+ if (!W.length) return /* @__PURE__ */ h("div", {
5829
5829
  ref: T,
5830
5830
  style: {
5831
5831
  width: "100%",
@@ -5837,7 +5837,7 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5837
5837
  alignItems: "center",
5838
5838
  justifyContent: "center",
5839
5839
  flexWrap: "wrap",
5840
- gap: re
5840
+ gap: ie
5841
5841
  },
5842
5842
  children: [
5843
5843
  0,
@@ -5847,16 +5847,16 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5847
5847
  4
5848
5848
  ].map((e) => /* @__PURE__ */ h("div", {
5849
5849
  style: {
5850
- height: K,
5851
- width: K * 3,
5850
+ height: G,
5851
+ width: G * 3,
5852
5852
  border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
5853
5853
  borderRadius: 6,
5854
5854
  display: "flex",
5855
5855
  alignItems: "center",
5856
5856
  justifyContent: "center",
5857
- fontSize: Math.max(10, Math.round(K / 4)),
5857
+ fontSize: Math.max(10, Math.round(G / 4)),
5858
5858
  opacity: .45,
5859
- ...ye
5859
+ ...be
5860
5860
  },
5861
5861
  children: "LOGO"
5862
5862
  }, e))
@@ -5871,22 +5871,22 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5871
5871
  children: C
5872
5872
  }) : null
5873
5873
  });
5874
- let fe = G.length, pe = ie === "step" && fe > ue, me = ie === "slider", he = pe && !E && !U && !te, ge = v === "right", _e = ge ? fe : 0, ve = pe ? [...G, ...G] : G, be = pe ? z * de : 0, xe = (e, t, n) => {
5874
+ let pe = W.length, me = ae === "step" && pe > de, he = ae === "slider", ge = me && !E && !U && !te, _e = v === "right", ve = _e ? pe : 0, ye = me ? [...W, ...W] : W, xe = me ? z * fe : 0, Se = (e, t, n) => {
5875
5875
  let r = /* @__PURE__ */ h("img", {
5876
5876
  ...X("logo"),
5877
5877
  src: e.src,
5878
5878
  alt: e.alt ?? "",
5879
5879
  style: {
5880
- height: K,
5880
+ height: G,
5881
5881
  width: "auto",
5882
5882
  maxWidth: "100%",
5883
5883
  objectFit: "contain",
5884
5884
  display: "block"
5885
5885
  }
5886
- }), i = pe ? {
5887
- width: de,
5886
+ }), i = me ? {
5887
+ width: fe,
5888
5888
  flex: "0 0 auto",
5889
- padding: `0 ${re / 2}px`,
5889
+ padding: `0 ${ie / 2}px`,
5890
5890
  justifyContent: "center"
5891
5891
  } : {};
5892
5892
  return e.href && !E ? /* @__PURE__ */ h("a", {
@@ -5911,31 +5911,31 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5911
5911
  ...n ? { "aria-hidden": "true" } : {},
5912
5912
  children: r
5913
5913
  }, `${n ? "c" : "o"}-${t}`);
5914
- }, Se = /* @__PURE__ */ h("div", {
5914
+ }, Ce = /* @__PURE__ */ h("div", {
5915
5915
  ref: M,
5916
5916
  ...X("track"),
5917
5917
  className: "wb-logos-track",
5918
5918
  style: {
5919
5919
  display: "flex",
5920
5920
  alignItems: "center",
5921
- ...pe ? {
5922
- width: ve.length * de,
5923
- transform: `translateX(-${be}px)`,
5924
- transition: V ? `transform ${oe}ms ease` : "none"
5925
- } : me ? {
5926
- gap: re,
5921
+ ...me ? {
5922
+ width: ye.length * fe,
5923
+ transform: `translateX(-${xe}px)`,
5924
+ transition: V ? `transform ${se}ms ease` : "none"
5925
+ } : he ? {
5926
+ gap: ie,
5927
5927
  overflowX: "auto",
5928
5928
  scrollBehavior: "smooth",
5929
5929
  scrollSnapType: "x proximity"
5930
5930
  } : {
5931
- gap: re,
5931
+ gap: ie,
5932
5932
  flexWrap: "wrap",
5933
5933
  justifyContent: "center"
5934
5934
  }
5935
5935
  },
5936
- children: ve.map((e, t) => xe(e, t, pe && t >= fe))
5937
- }), Ce = (e) => {
5938
- if (me) {
5936
+ children: ye.map((e, t) => Se(e, t, me && t >= pe))
5937
+ }), K = (e) => {
5938
+ if (he) {
5939
5939
  let t = M.current;
5940
5940
  t && t.scrollBy({
5941
5941
  left: e * Math.max(120, t.clientWidth * .8),
@@ -5944,19 +5944,19 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5944
5944
  return;
5945
5945
  }
5946
5946
  let t = z + e;
5947
- if (t >= 0 && t <= fe) {
5947
+ if (t >= 0 && t <= pe) {
5948
5948
  H(!0), B(t);
5949
5949
  return;
5950
5950
  }
5951
- let n = t < 0 ? fe : 0;
5951
+ let n = t < 0 ? pe : 0;
5952
5952
  H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
5953
5953
  H(!0), B(n + e);
5954
5954
  }));
5955
- }, q = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", J = q !== "off" && (me ? P > 0 : pe), we = (e) => /* @__PURE__ */ h("button", {
5955
+ }, q = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", J = q !== "off" && (he ? P > 0 : me), we = (e) => /* @__PURE__ */ h("button", {
5956
5956
  type: "button",
5957
5957
  "aria-label": e < 0 ? "Previous logos" : "Next logos",
5958
5958
  ...X("arrow", e < 0 ? "arrow-prev" : "arrow-next"),
5959
- onClick: () => Ce(e),
5959
+ onClick: () => K(e),
5960
5960
  className: `wb-logos-arrow${q === "hover" ? " wb-logos-arrow-shy" : ""}`,
5961
5961
  style: { [e < 0 ? "left" : "right"]: 0 },
5962
5962
  children: e < 0 ? "‹" : "›"
@@ -5995,10 +5995,10 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
5995
5995
  border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
5996
5996
  }
5997
5997
  ` }),
5998
- pe ? /* @__PURE__ */ g("div", {
5998
+ me ? /* @__PURE__ */ g("div", {
5999
5999
  style: {
6000
6000
  position: "relative",
6001
- width: ue * de,
6001
+ width: de * fe,
6002
6002
  maxWidth: "100%",
6003
6003
  margin: "0 auto"
6004
6004
  },
@@ -6006,23 +6006,23 @@ function yi({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6006
6006
  J ? we(-1) : null,
6007
6007
  /* @__PURE__ */ h("div", {
6008
6008
  style: { overflow: "hidden" },
6009
- children: Se
6009
+ children: Ce
6010
6010
  }),
6011
6011
  J ? we(1) : null
6012
6012
  ]
6013
6013
  }) : /* @__PURE__ */ g(m, { children: [
6014
6014
  J ? we(-1) : null,
6015
- Se,
6015
+ Ce,
6016
6016
  J ? we(1) : null
6017
6017
  ] }),
6018
6018
  /* @__PURE__ */ h(bi, {
6019
- running: he,
6020
- every: ae + oe,
6021
- slide: oe,
6022
- step: ge ? -1 : 1,
6019
+ running: ge,
6020
+ every: oe + se,
6021
+ slide: se,
6022
+ step: _e ? -1 : 1,
6023
6023
  index: z,
6024
- total: fe,
6025
- home: _e,
6024
+ total: pe,
6025
+ home: ve,
6026
6026
  setIndex: B,
6027
6027
  setAnimate: H
6028
6028
  })
@@ -9007,12 +9007,37 @@ function qa(e, t, n = !0) {
9007
9007
  ...i
9008
9008
  };
9009
9009
  }
9010
- var Ja = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "", Ya = "/product/{slug}", Xa = (e) => !e || e === "/product?product={slug}" ? Ya : e, Za = (e, t) => String(Xa(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9011
- function Qa(e) {
9010
+ var Ja = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
9011
+ function Ya({ value: e, label: t, onCommit: n }) {
9012
+ let [r, i] = f(null), a = () => {
9013
+ if (r === null) return;
9014
+ let t = Math.max(1, Math.round(Number(r)) || 1);
9015
+ i(null), t !== Number(e) && n(t);
9016
+ };
9017
+ return /* @__PURE__ */ h("input", {
9018
+ type: "number",
9019
+ ...X("quantity-input"),
9020
+ min: 1,
9021
+ "aria-label": t,
9022
+ value: r ?? e,
9023
+ onChange: (e) => i(e.target.value),
9024
+ onBlur: a,
9025
+ onKeyDown: (e) => {
9026
+ e.key === "Enter" && a();
9027
+ },
9028
+ style: {
9029
+ ...Z,
9030
+ width: "64px",
9031
+ padding: "4px 8px"
9032
+ }
9033
+ });
9034
+ }
9035
+ var Xa = "/product/{slug}", Za = (e) => !e || e === "/product?product={slug}" ? Xa : e, Qa = (e, t) => String(Za(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
9036
+ function $a(e) {
9012
9037
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
9013
9038
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
9014
9039
  }
9015
- function $a({ product: e, variant: t, locale: n, size: r = 16 }) {
9040
+ function eo({ product: e, variant: t, locale: n, size: r = 16 }) {
9016
9041
  let i = e.currency, a = t?.price ?? e.price;
9017
9042
  return /* @__PURE__ */ g("span", {
9018
9043
  ...X("price"),
@@ -9037,7 +9062,7 @@ function $a({ product: e, variant: t, locale: n, size: r = 16 }) {
9037
9062
  })]
9038
9063
  });
9039
9064
  }
9040
- var eo = [
9065
+ var to = [
9041
9066
  1,
9042
9067
  2,
9043
9068
  3
@@ -9053,7 +9078,7 @@ var eo = [
9053
9078
  currency: "USD",
9054
9079
  sample: !0
9055
9080
  }));
9056
- function to({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: _ = !1, noNavigate: v = !1 }) {
9081
+ function no({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: _ = !1, noNavigate: v = !1 }) {
9057
9082
  let { tenant: y, apiUrl: b, locale: x, words: S } = Ka(), C = Ca(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = qa(b, y, !m), I = l === "favorites";
9058
9083
  c(() => {
9059
9084
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `&currency=${encodeURIComponent(F)}` : "";
@@ -9082,7 +9107,7 @@ function to({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9082
9107
  I,
9083
9108
  m
9084
9109
  ]);
9085
- let L = w?.length || !_ ? w ?? [] : eo, z = async (e) => {
9110
+ let L = w?.length || !_ ? w ?? [] : to, z = async (e) => {
9086
9111
  if (!(m || e.sample)) {
9087
9112
  k(e.id);
9088
9113
  try {
@@ -9138,7 +9163,7 @@ function to({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9138
9163
  gap: `${n}px`
9139
9164
  },
9140
9165
  children: L.map((e) => {
9141
- let t = Qa(e) === 0, n = Za(r, e);
9166
+ let t = $a(e) === 0, n = Qa(r, e);
9142
9167
  return /* @__PURE__ */ g("div", {
9143
9168
  ...X("card"),
9144
9169
  style: {
@@ -9203,7 +9228,7 @@ function to({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9203
9228
  ")"
9204
9229
  ]
9205
9230
  }),
9206
- /* @__PURE__ */ h($a, {
9231
+ /* @__PURE__ */ h(eo, {
9207
9232
  product: e,
9208
9233
  locale: x
9209
9234
  }),
@@ -9242,7 +9267,7 @@ function to({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
9242
9267
  ]
9243
9268
  });
9244
9269
  }
9245
- function no({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
9270
+ function ro({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
9246
9271
  let { tenant: d, apiUrl: p, locale: m, param: _, words: v } = Ka(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = qa(p, d, !s), F = e || _ || Ja("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
9247
9272
  if (c(() => {
9248
9273
  let e = !0;
@@ -9250,7 +9275,7 @@ function no({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9250
9275
  let t = await Q(p, d, "/store/config"), n = F ? await Q(p, d, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await Q(p, d, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
9251
9276
  if (e) {
9252
9277
  if (!n) {
9253
- S(!0), b(l ? eo[0] : null);
9278
+ S(!0), b(l ? to[0] : null);
9254
9279
  return;
9255
9280
  }
9256
9281
  b({
@@ -9259,7 +9284,7 @@ function no({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9259
9284
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
9260
9285
  }
9261
9286
  })().catch(() => {
9262
- e && (S(!0), b(l ? eo[0] : null));
9287
+ e && (S(!0), b(l ? to[0] : null));
9263
9288
  }), () => {
9264
9289
  e = !1;
9265
9290
  };
@@ -9389,7 +9414,7 @@ function no({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9389
9414
  inert: s,
9390
9415
  sample: l && !!y.sample
9391
9416
  }),
9392
- /* @__PURE__ */ h($a, {
9417
+ /* @__PURE__ */ h(eo, {
9393
9418
  product: y,
9394
9419
  variant: L,
9395
9420
  locale: m,
@@ -9494,13 +9519,13 @@ function no({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
9494
9519
  ]
9495
9520
  });
9496
9521
  }
9497
- function ro(e) {
9498
- return /* @__PURE__ */ h(to, {
9522
+ function io(e) {
9523
+ return /* @__PURE__ */ h(no, {
9499
9524
  ...e,
9500
9525
  source: "favorites"
9501
9526
  });
9502
9527
  }
9503
- var io = /* @__PURE__ */ g("svg", {
9528
+ var ao = /* @__PURE__ */ g("svg", {
9504
9529
  width: "20",
9505
9530
  height: "20",
9506
9531
  viewBox: "0 0 24 24",
@@ -9513,7 +9538,7 @@ var io = /* @__PURE__ */ g("svg", {
9513
9538
  ...X("icon"),
9514
9539
  children: [/* @__PURE__ */ h("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ h("path", { d: "M9 7a3 3 0 0 1 6 0" })]
9515
9540
  });
9516
- function ao({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
9541
+ function oo({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
9517
9542
  let { tenant: c, apiUrl: l, words: u } = Ka(), { cart: d } = qa(l, c, !a), f = o && !d.count ? 2 : d.count;
9518
9543
  return /* @__PURE__ */ g("a", {
9519
9544
  ref: i,
@@ -9531,7 +9556,7 @@ function ao({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
9531
9556
  ...R(r)
9532
9557
  },
9533
9558
  children: [
9534
- io,
9559
+ ao,
9535
9560
  n && /* @__PURE__ */ h("span", {
9536
9561
  ...X("label"),
9537
9562
  children: t || u("cart")
@@ -9559,7 +9584,7 @@ function ao({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
9559
9584
  ]
9560
9585
  });
9561
9586
  }
9562
- function oo(e, t, n) {
9587
+ function so(e, t, n) {
9563
9588
  if (t === "code") return e;
9564
9589
  try {
9565
9590
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -9572,7 +9597,7 @@ function oo(e, t, n) {
9572
9597
  return e;
9573
9598
  }
9574
9599
  }
9575
- function so({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
9600
+ function co({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
9576
9601
  let { tenant: a, apiUrl: o, locale: s } = Ka(), { store: l, currency: u } = qa(o, a, !i), [d, p] = f(null), m = {
9577
9602
  display: "inline-flex",
9578
9603
  alignItems: "center",
@@ -9621,24 +9646,24 @@ function so({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
9621
9646
  },
9622
9647
  children: _.map((t) => /* @__PURE__ */ h("option", {
9623
9648
  value: t,
9624
- children: oo(t, e, s)
9649
+ children: so(t, e, s)
9625
9650
  }, t))
9626
9651
  })]
9627
9652
  });
9628
9653
  }
9629
- var co = {
9654
+ var lo = {
9630
9655
  display: "flex",
9631
9656
  flexDirection: "column",
9632
9657
  gap: "6px",
9633
9658
  fontSize: "13px"
9634
- }, lo = {
9659
+ }, uo = {
9635
9660
  margin: "0 0 12px",
9636
9661
  fontSize: "18px"
9637
9662
  };
9638
- function uo({ label: e, required: t, children: n }) {
9663
+ function fo({ label: e, required: t, children: n }) {
9639
9664
  return /* @__PURE__ */ g("label", {
9640
9665
  ...X("field"),
9641
- style: co,
9666
+ style: lo,
9642
9667
  children: [/* @__PURE__ */ g("span", {
9643
9668
  ...X("field-label"),
9644
9669
  style: { fontWeight: 500 },
@@ -9650,7 +9675,7 @@ function uo({ label: e, required: t, children: n }) {
9650
9675
  }), n]
9651
9676
  });
9652
9677
  }
9653
- var fo = [{
9678
+ var po = [{
9654
9679
  id: "ship:standard",
9655
9680
  type: "shipping",
9656
9681
  name: "Standard",
@@ -9666,7 +9691,7 @@ var fo = [{
9666
9691
  min_days: null,
9667
9692
  max_days: null,
9668
9693
  detail: "Main Street 1"
9669
- }], po = {
9694
+ }], mo = {
9670
9695
  name: "",
9671
9696
  email: "",
9672
9697
  phone: "",
@@ -9681,8 +9706,8 @@ var fo = [{
9681
9706
  recipient: "",
9682
9707
  gift_message: ""
9683
9708
  };
9684
- function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
9685
- let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = Ka(), { store: m, cart: _, loaded: v } = qa(s, o, !r), [y, b] = f(null), [x, S] = f(po), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && Ja("cancelled") === "1", I = (e) => la(e, _.currency || y?.currency, l);
9709
+ function ho({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
9710
+ let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = Ka(), { store: m, cart: _, loaded: v } = qa(s, o, !r), [y, b] = f(null), [x, S] = f(mo), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && Ja("cancelled") === "1", I = (e) => la(e, _.currency || y?.currency, l);
9686
9711
  c(() => {
9687
9712
  Q(s, o, "/store/config").then((e) => {
9688
9713
  b(e), w((t) => t || e?.methods?.[0] || "");
@@ -9719,7 +9744,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9719
9744
  }
9720
9745
  }, V = async (e) => {
9721
9746
  if (e.preventDefault(), !r) {
9722
- if ((U && !K ? [
9747
+ if ((U && !G ? [
9723
9748
  "name",
9724
9749
  "email",
9725
9750
  "line1",
@@ -9774,7 +9799,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9774
9799
  E(!1);
9775
9800
  }
9776
9801
  }
9777
- }, H = { ...R(t) }, U = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], te = ee.filter((e) => e.type !== "shipping"), W = ee.find((e) => e.type === "shipping") ?? null, ne = r && i && !_.lines.length ? fo : Array.isArray(_.delivery_options) ? _.delivery_options : [], G = ne.find((e) => e.id === _.delivery) ?? (r && i ? ne[0] : null), K = G?.type === "pickup", re = (e) => {
9802
+ }, H = { ...R(t) }, U = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, ee = Array.isArray(_.discounts) ? _.discounts : [], te = ee.filter((e) => e.type !== "shipping"), ne = ee.find((e) => e.type === "shipping") ?? null, re = r && i && !_.lines.length ? po : Array.isArray(_.delivery_options) ? _.delivery_options : [], W = re.find((e) => e.id === _.delivery) ?? (r && i ? re[0] : null), G = W?.type === "pickup", ie = (e) => {
9778
9803
  r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(fa(d, e))));
9779
9804
  };
9780
9805
  if (k) {
@@ -9869,11 +9894,11 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9869
9894
  la(k.total, k.currency, l)
9870
9895
  ]
9871
9896
  }),
9872
- !t && /* @__PURE__ */ h(yo, {
9897
+ !t && /* @__PURE__ */ h(bo, {
9873
9898
  reference: k.transfer_reference,
9874
9899
  words: d
9875
9900
  }),
9876
- /* @__PURE__ */ h(bo, {
9901
+ /* @__PURE__ */ h(xo, {
9877
9902
  downloads: k.downloads,
9878
9903
  apiUrl: s,
9879
9904
  words: d,
@@ -9893,7 +9918,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9893
9918
  ]
9894
9919
  });
9895
9920
  }
9896
- let ie = r && i && !_.lines.length ? eo.slice(0, 2).map((e) => ({
9921
+ let ae = r && i && !_.lines.length ? to.slice(0, 2).map((e) => ({
9897
9922
  ...e,
9898
9923
  product_id: e.id,
9899
9924
  variant_id: null,
@@ -9902,7 +9927,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9902
9927
  total: e.price,
9903
9928
  image: "",
9904
9929
  variant_title: ""
9905
- })) : _.lines, ae = r && i && !_.lines.length ? ie.reduce((e, t) => e + t.total, 0) : _.subtotal;
9930
+ })) : _.lines, oe = r && i && !_.lines.length ? ae.reduce((e, t) => e + t.total, 0) : _.subtotal;
9906
9931
  if (y && !y.enabled && !r) return /* @__PURE__ */ h("div", {
9907
9932
  ref: n,
9908
9933
  style: H,
@@ -9912,7 +9937,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9912
9937
  children: d("closed")
9913
9938
  })
9914
9939
  });
9915
- if (v && !ie.length && !r) return /* @__PURE__ */ g("div", {
9940
+ if (v && !ae.length && !r) return /* @__PURE__ */ g("div", {
9916
9941
  ref: n,
9917
9942
  style: {
9918
9943
  display: "flex",
@@ -9946,7 +9971,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9946
9971
  })
9947
9972
  ]
9948
9973
  });
9949
- let oe = y?.methods ?? [];
9974
+ let se = y?.methods ?? [];
9950
9975
  return /* @__PURE__ */ g("form", {
9951
9976
  ref: n,
9952
9977
  onSubmit: V,
@@ -9977,7 +10002,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9977
10002
  ...X("section"),
9978
10003
  children: [/* @__PURE__ */ h("h3", {
9979
10004
  ...X("heading"),
9980
- style: lo,
10005
+ style: uo,
9981
10006
  children: d("contact")
9982
10007
  }), /* @__PURE__ */ g("div", {
9983
10008
  ...X("fields"),
@@ -9985,7 +10010,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
9985
10010
  display: "grid",
9986
10011
  gap: "12px"
9987
10012
  },
9988
- children: [/* @__PURE__ */ h(uo, {
10013
+ children: [/* @__PURE__ */ h(fo, {
9989
10014
  label: d("name"),
9990
10015
  required: !0,
9991
10016
  children: /* @__PURE__ */ h("input", {
@@ -10002,7 +10027,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10002
10027
  gridTemplateColumns: "1fr 1fr",
10003
10028
  gap: "12px"
10004
10029
  },
10005
- children: [/* @__PURE__ */ h(uo, {
10030
+ children: [/* @__PURE__ */ h(fo, {
10006
10031
  label: d("email"),
10007
10032
  required: !0,
10008
10033
  children: /* @__PURE__ */ h("input", {
@@ -10013,7 +10038,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10013
10038
  onChange: L("email"),
10014
10039
  autoComplete: "email"
10015
10040
  })
10016
- }), /* @__PURE__ */ h(uo, {
10041
+ }), /* @__PURE__ */ h(fo, {
10017
10042
  label: d("phone"),
10018
10043
  children: /* @__PURE__ */ h("input", {
10019
10044
  type: "tel",
@@ -10032,7 +10057,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10032
10057
  children: [
10033
10058
  /* @__PURE__ */ h("h3", {
10034
10059
  ...X("heading"),
10035
- style: lo,
10060
+ style: uo,
10036
10061
  children: d("delivery")
10037
10062
  }),
10038
10063
  /* @__PURE__ */ h("div", {
@@ -10044,7 +10069,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10044
10069
  gridTemplateColumns: "1fr 1fr",
10045
10070
  gap: "12px"
10046
10071
  },
10047
- children: [/* @__PURE__ */ h(uo, {
10072
+ children: [/* @__PURE__ */ h(fo, {
10048
10073
  label: d("postal"),
10049
10074
  children: /* @__PURE__ */ h("input", {
10050
10075
  ...X("input"),
@@ -10054,9 +10079,9 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10054
10079
  onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(fa(d, e))),
10055
10080
  autoComplete: "postal-code"
10056
10081
  })
10057
- }), /* @__PURE__ */ h(uo, {
10082
+ }), /* @__PURE__ */ h(fo, {
10058
10083
  label: d("country"),
10059
- required: !K,
10084
+ required: !G,
10060
10085
  children: /* @__PURE__ */ g("select", {
10061
10086
  ...X("select"),
10062
10087
  style: Z,
@@ -10080,7 +10105,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10080
10105
  })]
10081
10106
  })
10082
10107
  }),
10083
- !ne.length && /* @__PURE__ */ h("p", {
10108
+ !re.length && /* @__PURE__ */ h("p", {
10084
10109
  ...X("note"),
10085
10110
  style: {
10086
10111
  margin: 0,
@@ -10095,17 +10120,17 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10095
10120
  display: "grid",
10096
10121
  gap: "8px"
10097
10122
  },
10098
- children: ne.map((e) => {
10123
+ children: re.map((e) => {
10099
10124
  let t = ga(d, l, e.min_days, e.max_days);
10100
10125
  return /* @__PURE__ */ g("label", {
10101
- ...X("delivery-option", G?.id === e.id && "delivery-option-selected"),
10126
+ ...X("delivery-option", W?.id === e.id && "delivery-option-selected"),
10102
10127
  style: {
10103
10128
  display: "flex",
10104
10129
  alignItems: "flex-start",
10105
10130
  gap: "10px",
10106
10131
  padding: "12px",
10107
10132
  borderRadius: "8px",
10108
- border: G?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : Ha,
10133
+ border: W?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : Ha,
10109
10134
  cursor: "pointer"
10110
10135
  },
10111
10136
  children: [
@@ -10114,8 +10139,8 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10114
10139
  ...X("radio"),
10115
10140
  name: "delivery",
10116
10141
  value: e.id,
10117
- checked: G?.id === e.id,
10118
- onChange: () => re(e.id),
10142
+ checked: W?.id === e.id,
10143
+ onChange: () => ie(e.id),
10119
10144
  style: { marginTop: "3px" }
10120
10145
  }),
10121
10146
  /* @__PURE__ */ g("span", {
@@ -10164,11 +10189,11 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10164
10189
  })
10165
10190
  ]
10166
10191
  }),
10167
- U && !K && /* @__PURE__ */ g("section", {
10192
+ U && !G && /* @__PURE__ */ g("section", {
10168
10193
  ...X("section"),
10169
10194
  children: [/* @__PURE__ */ h("h3", {
10170
10195
  ...X("heading"),
10171
- style: lo,
10196
+ style: uo,
10172
10197
  children: d("address")
10173
10198
  }), /* @__PURE__ */ g("div", {
10174
10199
  ...X("fields"),
@@ -10177,7 +10202,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10177
10202
  gap: "12px"
10178
10203
  },
10179
10204
  children: [
10180
- /* @__PURE__ */ h(uo, {
10205
+ /* @__PURE__ */ h(fo, {
10181
10206
  label: d("line1"),
10182
10207
  required: !0,
10183
10208
  children: /* @__PURE__ */ h("input", {
@@ -10188,7 +10213,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10188
10213
  autoComplete: "address-line1"
10189
10214
  })
10190
10215
  }),
10191
- /* @__PURE__ */ h(uo, {
10216
+ /* @__PURE__ */ h(fo, {
10192
10217
  label: d("line2"),
10193
10218
  children: /* @__PURE__ */ h("input", {
10194
10219
  ...X("input"),
@@ -10205,7 +10230,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10205
10230
  gridTemplateColumns: "1fr 1fr",
10206
10231
  gap: "12px"
10207
10232
  },
10208
- children: [/* @__PURE__ */ h(uo, {
10233
+ children: [/* @__PURE__ */ h(fo, {
10209
10234
  label: d("city"),
10210
10235
  required: !0,
10211
10236
  children: /* @__PURE__ */ h("input", {
@@ -10215,7 +10240,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10215
10240
  onChange: L("city"),
10216
10241
  autoComplete: "address-level2"
10217
10242
  })
10218
- }), /* @__PURE__ */ h(uo, {
10243
+ }), /* @__PURE__ */ h(fo, {
10219
10244
  label: d("region"),
10220
10245
  children: /* @__PURE__ */ h("input", {
10221
10246
  ...X("input"),
@@ -10226,7 +10251,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10226
10251
  })
10227
10252
  })]
10228
10253
  }),
10229
- /* @__PURE__ */ h(uo, {
10254
+ /* @__PURE__ */ h(fo, {
10230
10255
  label: d("note"),
10231
10256
  children: /* @__PURE__ */ h("textarea", {
10232
10257
  rows: 2,
@@ -10281,7 +10306,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10281
10306
  display: "grid",
10282
10307
  gap: "12px"
10283
10308
  },
10284
- children: [U && !K && /* @__PURE__ */ h(uo, {
10309
+ children: [U && !G && /* @__PURE__ */ h(fo, {
10285
10310
  label: d("giftRecipient"),
10286
10311
  children: /* @__PURE__ */ h("input", {
10287
10312
  ...X("input"),
@@ -10291,7 +10316,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10291
10316
  maxLength: 200,
10292
10317
  autoComplete: "off"
10293
10318
  })
10294
- }), /* @__PURE__ */ h(uo, {
10319
+ }), /* @__PURE__ */ h(fo, {
10295
10320
  label: d("giftMessage"),
10296
10321
  children: /* @__PURE__ */ h("textarea", {
10297
10322
  rows: 3,
@@ -10312,10 +10337,10 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10312
10337
  children: [
10313
10338
  /* @__PURE__ */ h("h3", {
10314
10339
  ...X("heading"),
10315
- style: lo,
10340
+ style: uo,
10316
10341
  children: d("payment")
10317
10342
  }),
10318
- !oe.length && !r && /* @__PURE__ */ h("p", {
10343
+ !se.length && !r && /* @__PURE__ */ h("p", {
10319
10344
  ...X("note"),
10320
10345
  style: {
10321
10346
  margin: 0,
@@ -10329,7 +10354,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10329
10354
  display: "grid",
10330
10355
  gap: "8px"
10331
10356
  },
10332
- children: (r && !oe.length ? ["stripe", "bank_transfer"] : oe).map((e) => /* @__PURE__ */ g("label", {
10357
+ children: (r && !se.length ? ["stripe", "bank_transfer"] : se).map((e) => /* @__PURE__ */ g("label", {
10333
10358
  ...X("payment-option", C === e && "payment-option-selected"),
10334
10359
  style: {
10335
10360
  display: "flex",
@@ -10370,12 +10395,12 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10370
10395
  /* @__PURE__ */ h("h3", {
10371
10396
  ...X("summary-title"),
10372
10397
  style: {
10373
- ...lo,
10398
+ ...uo,
10374
10399
  margin: 0
10375
10400
  },
10376
10401
  children: d("cart")
10377
10402
  }),
10378
- ie.map((e) => /* @__PURE__ */ g("div", {
10403
+ ae.map((e) => /* @__PURE__ */ g("div", {
10379
10404
  ...X("line"),
10380
10405
  style: {
10381
10406
  display: "flex",
@@ -10433,18 +10458,10 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10433
10458
  gap: "8px",
10434
10459
  marginTop: "4px"
10435
10460
  },
10436
- children: [/* @__PURE__ */ h("input", {
10437
- type: "number",
10438
- ...X("quantity-input"),
10439
- min: 1,
10440
- "aria-label": d("quantity"),
10461
+ children: [/* @__PURE__ */ h(Ya, {
10441
10462
  value: e.quantity,
10442
- onChange: (t) => !r && m.setLine(e.product_id, e.variant_id, Math.max(1, Number(t.target.value) || 1)).catch((e) => O(fa(d, e))),
10443
- style: {
10444
- ...Z,
10445
- width: "64px",
10446
- padding: "4px 8px"
10447
- }
10463
+ label: d("quantity"),
10464
+ onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(fa(d, e)))
10448
10465
  }), /* @__PURE__ */ h("button", {
10449
10466
  type: "button",
10450
10467
  onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(fa(d, e))),
@@ -10575,7 +10592,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10575
10592
  display: "flex",
10576
10593
  justifyContent: "space-between"
10577
10594
  },
10578
- children: [/* @__PURE__ */ h("span", { children: d("subtotal") }), /* @__PURE__ */ h("span", { children: I(ae) })]
10595
+ children: [/* @__PURE__ */ h("span", { children: d("subtotal") }), /* @__PURE__ */ h("span", { children: I(oe) })]
10579
10596
  }),
10580
10597
  te.length ? te.map((e) => /* @__PURE__ */ g("div", {
10581
10598
  ...X("summary-row"),
@@ -10604,7 +10621,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10604
10621
  justifyContent: "space-between",
10605
10622
  gap: "8px"
10606
10623
  },
10607
- children: [/* @__PURE__ */ g("span", { children: [G?.name ?? d("shipping"), W ? ` · ${W.title}` : ""] }), /* @__PURE__ */ g("span", { children: [W && /* @__PURE__ */ h("span", {
10624
+ children: [/* @__PURE__ */ g("span", { children: [W?.name ?? d("shipping"), ne ? ` · ${ne.title}` : ""] }), /* @__PURE__ */ g("span", { children: [ne && /* @__PURE__ */ h("span", {
10608
10625
  ...X("shipping-old"),
10609
10626
  style: {
10610
10627
  color: $,
@@ -10612,7 +10629,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10612
10629
  marginRight: "6px"
10613
10630
  },
10614
10631
  children: I(_.shipping_before)
10615
- }), (W ? _.shipping_total : G?.amount ?? _.shipping_total) ? I(W ? _.shipping_total : G?.amount ?? _.shipping_total) : d("free")] })]
10632
+ }), (ne ? _.shipping_total : W?.amount ?? _.shipping_total) ? I(ne ? _.shipping_total : W?.amount ?? _.shipping_total) : d("free")] })]
10616
10633
  }),
10617
10634
  !_.tax_included && _.tax_total > 0 && /* @__PURE__ */ g("div", {
10618
10635
  ...X("summary-row"),
@@ -10635,7 +10652,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10635
10652
  fontWeight: 700,
10636
10653
  fontSize: "16px"
10637
10654
  },
10638
- children: [/* @__PURE__ */ h("span", { children: d("total") }), /* @__PURE__ */ h("span", { children: I(r && i && !_.lines.length ? ae : _.total) })]
10655
+ children: [/* @__PURE__ */ h("span", { children: d("total") }), /* @__PURE__ */ h("span", { children: I(r && i && !_.lines.length ? oe : _.total) })]
10639
10656
  }),
10640
10657
  _.tax_included && _.tax_total > 0 && /* @__PURE__ */ g("div", {
10641
10658
  ...X("summary-row", "summary-row-muted"),
@@ -10683,7 +10700,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10683
10700
  },
10684
10701
  children: d(T ? "placing" : "placeOrder")
10685
10702
  }),
10686
- /* @__PURE__ */ h(go, {
10703
+ /* @__PURE__ */ h(_o, {
10687
10704
  apiUrl: s,
10688
10705
  tenant: o,
10689
10706
  words: d,
@@ -10695,7 +10712,7 @@ function mo({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
10695
10712
  })]
10696
10713
  });
10697
10714
  }
10698
- var ho = [
10715
+ var go = [
10699
10716
  "refund",
10700
10717
  "privacy",
10701
10718
  "terms",
@@ -10706,8 +10723,8 @@ var ho = [
10706
10723
  fields: {},
10707
10724
  updated_at: null
10708
10725
  }));
10709
- function go({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
10710
- let [o, s] = f(i ? ho : []), [l, u] = f(null);
10726
+ function _o({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
10727
+ let [o, s] = f(i ? go : []), [l, u] = f(null);
10711
10728
  if (c(() => {
10712
10729
  if (i) return;
10713
10730
  let n = !0;
@@ -10759,7 +10776,7 @@ function go({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
10759
10776
  },
10760
10777
  children: o.map(m)
10761
10778
  }),
10762
- l && /* @__PURE__ */ h(_o, {
10779
+ l && /* @__PURE__ */ h(vo, {
10763
10780
  policy: l,
10764
10781
  words: n,
10765
10782
  locale: r,
@@ -10768,7 +10785,7 @@ function go({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
10768
10785
  ]
10769
10786
  });
10770
10787
  }
10771
- function _o({ policy: e, words: t, locale: n, onClose: r }) {
10788
+ function vo({ policy: e, words: t, locale: n, onClose: r }) {
10772
10789
  c(() => {
10773
10790
  let e = (e) => {
10774
10791
  e.key === "Escape" && r();
@@ -10890,12 +10907,12 @@ function _o({ policy: e, words: t, locale: n, onClose: r }) {
10890
10907
  })
10891
10908
  });
10892
10909
  }
10893
- var vo = {
10910
+ var yo = {
10894
10911
  year: "numeric",
10895
10912
  month: "short",
10896
10913
  day: "numeric"
10897
10914
  };
10898
- function yo({ reference: e, words: t }) {
10915
+ function bo({ reference: e, words: t }) {
10899
10916
  let [n, r] = f(!1);
10900
10917
  if (!e) return null;
10901
10918
  let i = () => {
@@ -10960,7 +10977,7 @@ function yo({ reference: e, words: t }) {
10960
10977
  ]
10961
10978
  });
10962
10979
  }
10963
- function bo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
10980
+ function xo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
10964
10981
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
10965
10982
  if (!a.length) return null;
10966
10983
  let o = (e) => {
@@ -11038,7 +11055,7 @@ function bo({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
11038
11055
  })]
11039
11056
  });
11040
11057
  }
11041
- function xo({ tracking: e, words: t, noNavigate: n }) {
11058
+ function So({ tracking: e, words: t, noNavigate: n }) {
11042
11059
  let r = typeof e?.carrier == "string" ? e.carrier : "", i = typeof e?.number == "string" ? e.number : "", a = typeof e?.url == "string" && /^https?:\/\//i.test(e.url) ? e.url : "";
11043
11060
  return !r && !i && !a ? null : /* @__PURE__ */ g("div", {
11044
11061
  ...X("tracking"),
@@ -11073,7 +11090,7 @@ function xo({ tracking: e, words: t, noNavigate: n }) {
11073
11090
  ]
11074
11091
  });
11075
11092
  }
11076
- function So({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11093
+ function Co({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
11077
11094
  let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = Ka(), [m, _] = f(null), [v, y] = f(!1), [b, x] = f("");
11078
11095
  c(() => {
11079
11096
  if (i) return;
@@ -11109,7 +11126,7 @@ function So({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11109
11126
  items: []
11110
11127
  }] : m ?? [], C = (e) => {
11111
11128
  try {
11112
- return new Intl.DateTimeFormat(u || void 0, vo).format(new Date(e));
11129
+ return new Intl.DateTimeFormat(u || void 0, yo).format(new Date(e));
11113
11130
  } catch {
11114
11131
  return String(e).slice(0, 10);
11115
11132
  }
@@ -11232,16 +11249,16 @@ function So({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11232
11249
  children: la(t.total, e.currency, u)
11233
11250
  })]
11234
11251
  }, t.id)),
11235
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(yo, {
11252
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(bo, {
11236
11253
  reference: e.transfer_reference,
11237
11254
  words: d
11238
11255
  }),
11239
- /* @__PURE__ */ h(xo, {
11256
+ /* @__PURE__ */ h(So, {
11240
11257
  tracking: e.tracking,
11241
11258
  words: d,
11242
11259
  noNavigate: o
11243
11260
  }),
11244
- /* @__PURE__ */ h(bo, {
11261
+ /* @__PURE__ */ h(xo, {
11245
11262
  downloads: e.downloads,
11246
11263
  apiUrl: l,
11247
11264
  words: d,
@@ -11256,21 +11273,21 @@ function So({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
11256
11273
  }
11257
11274
  //#endregion
11258
11275
  //#region ../ui/src/components/builder/apps/language/views.jsx
11259
- function Co(e) {
11276
+ function wo(e) {
11260
11277
  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());
11261
11278
  return [...new Set(n.map((e) => e.trim()))];
11262
11279
  }
11263
- var wo = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11264
- function To(e, t) {
11280
+ var To = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
11281
+ function Eo(e, t) {
11265
11282
  let n = String(e ?? "").toUpperCase();
11266
11283
  if (t === "code") return n;
11267
11284
  let r = "";
11268
11285
  try {
11269
- r = wo(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11286
+ r = To(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
11270
11287
  } catch {}
11271
11288
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
11272
11289
  }
11273
- function Eo(e, t) {
11290
+ function Do(e, t) {
11274
11291
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
11275
11292
  if (typeof window > "u") return n || "?";
11276
11293
  try {
@@ -11280,8 +11297,8 @@ function Eo(e, t) {
11280
11297
  return n || "/";
11281
11298
  }
11282
11299
  }
11283
- function Do({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
11284
- let l = s(Y), u = Co(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11300
+ function Oo({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
11301
+ let l = s(Y), u = wo(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
11285
11302
  display: "inline-flex",
11286
11303
  alignItems: "center",
11287
11304
  gap: 8,
@@ -11319,7 +11336,7 @@ function Do({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11319
11336
  children: n ?? "·"
11320
11337
  }), /* @__PURE__ */ h("a", {
11321
11338
  ...X("link", e === f && "link-current"),
11322
- href: Eo(e, e === d),
11339
+ href: Do(e, e === d),
11323
11340
  hrefLang: e,
11324
11341
  "aria-current": e === f ? "true" : void 0,
11325
11342
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -11329,7 +11346,7 @@ function Do({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11329
11346
  textDecoration: "none",
11330
11347
  cursor: c ? "default" : "pointer"
11331
11348
  },
11332
- children: To(e, t)
11349
+ children: Eo(e, t)
11333
11350
  })]
11334
11351
  }, e))]
11335
11352
  }) : /* @__PURE__ */ g("div", {
@@ -11341,7 +11358,7 @@ function Do({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11341
11358
  value: f,
11342
11359
  onChange: c ? void 0 : (e) => {
11343
11360
  let t = e.target.value;
11344
- window.location.assign(Eo(t, t === d));
11361
+ window.location.assign(Do(t, t === d));
11345
11362
  },
11346
11363
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
11347
11364
  style: {
@@ -11357,54 +11374,54 @@ function Do({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
11357
11374
  ...X("option", e === f && "option-current"),
11358
11375
  key: e,
11359
11376
  value: e
11360
- }, To(e, t)))
11377
+ }, Eo(e, t)))
11361
11378
  })]
11362
11379
  });
11363
11380
  }
11364
11381
  //#endregion
11365
11382
  //#region ../ui/src/components/builder/apps/index.js
11366
- var Oo = [
11383
+ var ko = [
11367
11384
  Ti,
11368
11385
  Wi,
11369
11386
  Li,
11370
11387
  Gi,
11371
11388
  Zi
11372
- ], ko = {
11389
+ ], Ao = {
11373
11390
  SiteLoginForm: Fi,
11374
11391
  SiteAccountMenu: Ii,
11375
- SiteLanguagePicker: Do,
11392
+ SiteLanguagePicker: Oo,
11376
11393
  CookieConsent: Ui,
11377
11394
  SiteSearch: Xi,
11378
- ShopProductGrid: to,
11379
- ShopProduct: no,
11380
- ShopCartButton: ao,
11381
- ShopCheckout: mo,
11382
- ShopOrderHistory: So,
11383
- ShopCurrencyPicker: so,
11384
- ShopFavorites: ro
11395
+ ShopProductGrid: no,
11396
+ ShopProduct: ro,
11397
+ ShopCartButton: oo,
11398
+ ShopCheckout: ho,
11399
+ ShopOrderHistory: Co,
11400
+ ShopCurrencyPicker: co,
11401
+ ShopFavorites: io
11385
11402
  };
11386
- new Set(Oo.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
11403
+ new Set(ko.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
11387
11404
  //#endregion
11388
11405
  //#region ../ui/src/components/builder/three/runtime.js
11389
- var Ao = "0.185.1", jo = "4.2.0", Mo = "https://cdn.jsdelivr.net/npm", No = `${Mo}/three@${Ao}/+esm`, Po = `${Mo}/@google/model-viewer@${jo}/dist/model-viewer.min.js`, Fo = (e) => import(
11406
+ var jo = "0.185.1", Mo = "4.2.0", No = "https://cdn.jsdelivr.net/npm", Po = `${No}/three@${jo}/+esm`, Fo = `${No}/@google/model-viewer@${Mo}/dist/model-viewer.min.js`, Io = (e) => import(
11390
11407
  /* @vite-ignore */
11391
11408
  /* webpackIgnore: true */
11392
11409
  e
11393
- ), Io = /* @__PURE__ */ new Map();
11394
- function Lo(e) {
11395
- if (Io.has(e)) return Io.get(e);
11410
+ ), Lo = /* @__PURE__ */ new Map();
11411
+ function Ro(e) {
11412
+ if (Lo.has(e)) return Lo.get(e);
11396
11413
  if (typeof window > "u") return new Promise(() => {});
11397
- let t = Fo(e).catch((t) => {
11398
- throw Io.delete(e), t;
11414
+ let t = Io(e).catch((t) => {
11415
+ throw Lo.delete(e), t;
11399
11416
  });
11400
- return Io.set(e, t), t;
11417
+ return Lo.set(e, t), t;
11401
11418
  }
11402
- var Ro = () => Lo(No), zo = (e) => Lo(`${Mo}/three@${Ao}/examples/jsm/${e}/+esm`);
11403
- function Bo() {
11404
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Lo(Po);
11419
+ var zo = () => Ro(Po), Bo = (e) => Ro(`${No}/three@${jo}/examples/jsm/${e}/+esm`);
11420
+ function Vo() {
11421
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ro(Fo);
11405
11422
  }
11406
- var Vo = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Ho = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
11407
- function Uo(e, t) {
11423
+ var Ho = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Uo = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
11424
+ function Wo(e, t) {
11408
11425
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
11409
11426
  n = requestAnimationFrame(o), i ||= e;
11410
11427
  let a = r ? (e - r) / 1e3 : 0;
@@ -11423,7 +11440,7 @@ function Uo(e, t) {
11423
11440
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
11424
11441
  };
11425
11442
  }
11426
- function Wo(e, t, n = {}) {
11443
+ function Go(e, t, n = {}) {
11427
11444
  let r = {
11428
11445
  radius: n.distance ?? 4,
11429
11446
  polar: n.polar ?? Math.PI / 2.4,
@@ -11472,13 +11489,13 @@ function Wo(e, t, n = {}) {
11472
11489
  }
11473
11490
  //#endregion
11474
11491
  //#region ../ui/src/components/builder/three/views.jsx
11475
- var Go = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ko = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, qo = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Jo = (e) => typeof e == "string" && !!e.trim();
11476
- function Yo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11492
+ var Ko = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, qo = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Jo = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Yo = (e) => typeof e == "string" && !!e.trim();
11493
+ function Xo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11477
11494
  return /* @__PURE__ */ g("div", {
11478
11495
  ref: r,
11479
11496
  style: {
11480
11497
  ...R(i),
11481
- minHeight: Go(n, 320),
11498
+ minHeight: Ko(n, 320),
11482
11499
  display: "flex",
11483
11500
  flexDirection: "column",
11484
11501
  alignItems: "center",
@@ -11487,7 +11504,7 @@ function Yo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11487
11504
  border: "1px dashed rgba(148,163,184,.55)",
11488
11505
  borderRadius: 10,
11489
11506
  background: "rgba(148,163,184,.08)",
11490
- ...ye,
11507
+ ...be,
11491
11508
  color: "rgba(100,116,139,.95)",
11492
11509
  fontSize: 13,
11493
11510
  textAlign: "center",
@@ -11506,24 +11523,24 @@ function Yo({ label: e, note: t, height: n, nodeRef: r, style: i }) {
11506
11523
  }) : null]
11507
11524
  });
11508
11525
  }
11509
- function Xo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: g, nodeRef: _, inert: v }) {
11526
+ function Zo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: g, nodeRef: _, inert: v }) {
11510
11527
  let [y, b] = f(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = f(!1);
11511
11528
  c(() => {
11512
11529
  if (y || !e) return;
11513
11530
  let t = !0;
11514
- return Bo().then(() => t && b(!0), () => t && S(!0)), () => {
11531
+ return Vo().then(() => t && b(!0), () => t && S(!0)), () => {
11515
11532
  t = !1;
11516
11533
  };
11517
11534
  }, [y, e]);
11518
11535
  let C = {
11519
11536
  display: "block",
11520
11537
  width: "100%",
11521
- minHeight: Go(r, 360),
11522
- height: Go(r, 360),
11538
+ minHeight: Ko(r, 360),
11539
+ height: Ko(r, 360),
11523
11540
  backgroundColor: i || "transparent",
11524
11541
  ...R(g)
11525
11542
  };
11526
- if (!e) return v ? /* @__PURE__ */ h(Yo, {
11543
+ if (!e) return v ? /* @__PURE__ */ h(Xo, {
11527
11544
  nodeRef: _,
11528
11545
  style: g,
11529
11546
  height: r,
@@ -11558,13 +11575,13 @@ function Xo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
11558
11575
  poster: t || void 0,
11559
11576
  style: C,
11560
11577
  "camera-controls": w(!v && s !== !1),
11561
- "auto-rotate": w(T && !Vo()),
11562
- "auto-rotate-delay": T ? String(Go(o, 0)) : void 0,
11578
+ "auto-rotate": w(T && !Ho()),
11579
+ "auto-rotate-delay": T ? String(Ko(o, 0)) : void 0,
11563
11580
  "rotation-per-second": "18deg",
11564
11581
  ar: w(!v && l === !0),
11565
11582
  "ar-modes": "webxr scene-viewer quick-look",
11566
- "shadow-intensity": String(Ko(d, 100)),
11567
- exposure: String(Ko(u, 100)),
11583
+ "shadow-intensity": String(qo(d, 100)),
11584
+ exposure: String(qo(u, 100)),
11568
11585
  "field-of-view": p ? `${Number(p)}deg` : void 0,
11569
11586
  "environment-image": m && m !== "neutral" ? m : "neutral",
11570
11587
  "interaction-prompt": v ? "none" : void 0,
@@ -11582,7 +11599,7 @@ function Xo({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
11582
11599
  }) : null
11583
11600
  });
11584
11601
  }
11585
- var Zo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Qo = [
11602
+ var Qo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), $o = [
11586
11603
  "precision highp float;",
11587
11604
  "uniform vec2 u_res;",
11588
11605
  "uniform float u_time;",
@@ -11605,7 +11622,7 @@ var Zo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
11605
11622
  " return v;",
11606
11623
  "}",
11607
11624
  ""
11608
- ].join("\n"), $o = {
11625
+ ].join("\n"), es = {
11609
11626
  gradient: [
11610
11627
  "void main(){",
11611
11628
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -11657,7 +11674,7 @@ var Zo = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
11657
11674
  "}"
11658
11675
  ].join("\n")
11659
11676
  };
11660
- function es(e, t) {
11677
+ function ts(e, t) {
11661
11678
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
11662
11679
  if (!n) return t;
11663
11680
  let r = parseInt(n[1], 16);
@@ -11667,7 +11684,7 @@ function es(e, t) {
11667
11684
  (r & 255) / 255
11668
11685
  ];
11669
11686
  }
11670
- function ts(e, t, n) {
11687
+ function ns(e, t, n) {
11671
11688
  let r = e.createShader(t);
11672
11689
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
11673
11690
  let t = e.getShaderInfoLog(r);
@@ -11675,13 +11692,13 @@ function ts(e, t, n) {
11675
11692
  }
11676
11693
  return r;
11677
11694
  }
11678
- function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
11695
+ function rs({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
11679
11696
  let _ = d(null), v = d(null), y = d(null), [b, x] = f("");
11680
11697
  c(() => () => {
11681
11698
  let e = y.current;
11682
11699
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
11683
11700
  }, []);
11684
- let S = typeof t == "string" && t.trim() ? t : $o[e] ?? $o.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Ko(a, 100), D = Math.max(.05, Ko(o, 100));
11701
+ let S = typeof t == "string" && t.trim() ? t : es[e] ?? es.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = qo(a, 100), D = Math.max(.05, qo(o, 100));
11685
11702
  return c(() => {
11686
11703
  let e = _.current, t = v.current;
11687
11704
  if (!e || !t) return;
@@ -11696,7 +11713,7 @@ function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11696
11713
  }
11697
11714
  let r = null;
11698
11715
  try {
11699
- let e = ts(n, n.VERTEX_SHADER, Zo), t = ts(n, n.FRAGMENT_SHADER, Qo + S);
11716
+ let e = ns(n, n.VERTEX_SHADER, Qo), t = ns(n, n.FRAGMENT_SHADER, $o + S);
11700
11717
  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");
11701
11718
  x("");
11702
11719
  } catch (e) {
@@ -11732,28 +11749,28 @@ function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11732
11749
  };
11733
11750
  l !== !1 && t.addEventListener("pointermove", u);
11734
11751
  let d = () => {
11735
- let r = Ho(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
11752
+ let r = Uo(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
11736
11753
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
11737
11754
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
11738
11755
  f?.observe(t), d();
11739
- let p = Vo(), m = {
11740
- a: es(C, [
11756
+ let p = Ho(), m = {
11757
+ a: ts(C, [
11741
11758
  .35,
11742
11759
  .4,
11743
11760
  .95
11744
11761
  ]),
11745
- b: es(w, [
11762
+ b: ts(w, [
11746
11763
  .05,
11747
11764
  .06,
11748
11765
  .16
11749
11766
  ]),
11750
- c: es(T, [
11767
+ c: ts(T, [
11751
11768
  .95,
11752
11769
  .35,
11753
11770
  .6
11754
11771
  ])
11755
11772
  }, h = {};
11756
- return h.stop = Uo(t, (t, r) => {
11773
+ return h.stop = Wo(t, (t, r) => {
11757
11774
  d(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (p ? 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), p && h.stop?.();
11758
11775
  }), () => {
11759
11776
  h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -11772,7 +11789,7 @@ function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11772
11789
  },
11773
11790
  style: {
11774
11791
  position: "relative",
11775
- minHeight: Go(s, 320),
11792
+ minHeight: Ko(s, 320),
11776
11793
  overflow: "hidden",
11777
11794
  ...R(u)
11778
11795
  },
@@ -11794,7 +11811,7 @@ function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11794
11811
  justifyContent: "center",
11795
11812
  padding: 12,
11796
11813
  background: "rgba(15,23,42,.75)",
11797
- ...ye,
11814
+ ...be,
11798
11815
  color: "#fecaca",
11799
11816
  fontSize: 11,
11800
11817
  whiteSpace: "pre-wrap",
@@ -11804,7 +11821,7 @@ function ns({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
11804
11821
  }) : null]
11805
11822
  });
11806
11823
  }
11807
- function rs(e, t) {
11824
+ function is(e, t) {
11808
11825
  let n = new e.Scene(), r = new e.BoxGeometry();
11809
11826
  r.deleteAttribute("uv");
11810
11827
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -11820,23 +11837,23 @@ function rs(e, t) {
11820
11837
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
11821
11838
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
11822
11839
  }
11823
- var is = /* @__PURE__ */ new Map();
11824
- function as(e) {
11825
- if (is.has(e)) return is.get(e);
11826
- let t = zo("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
11840
+ var as = /* @__PURE__ */ new Map();
11841
+ function os(e) {
11842
+ if (as.has(e)) return as.get(e);
11843
+ let t = Bo("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
11827
11844
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
11828
11845
  })).catch((t) => {
11829
- throw is.delete(e), t;
11846
+ throw as.delete(e), t;
11830
11847
  });
11831
- return is.set(e, t), t;
11848
+ return as.set(e, t), t;
11832
11849
  }
11833
- function os(e, t) {
11850
+ function ss(e, t) {
11834
11851
  let n = new e.Box3().setFromObject(t);
11835
11852
  if (n.isEmpty()) return t;
11836
11853
  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();
11837
11854
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
11838
11855
  }
11839
- var ss = {
11856
+ var cs = {
11840
11857
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
11841
11858
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
11842
11859
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -11845,50 +11862,50 @@ var ss = {
11845
11862
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
11846
11863
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
11847
11864
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
11848
- }, cs = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
11849
- function ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
11850
- let g = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Vo(), S = o !== !1 && !m;
11865
+ }, ls = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
11866
+ function us({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
11867
+ let g = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Ho(), S = o !== !1 && !m;
11851
11868
  return c(() => {
11852
11869
  let e = g.current;
11853
11870
  if (!e) return;
11854
11871
  let i = !0, o = null;
11855
- return Ro().then((c) => {
11872
+ return zo().then((c) => {
11856
11873
  if (!i || !e) return;
11857
11874
  let l = new c.WebGLRenderer({
11858
11875
  antialias: !0,
11859
11876
  alpha: !t
11860
11877
  });
11861
- l.setPixelRatio(Ho()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
11878
+ l.setPixelRatio(Uo()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
11862
11879
  let u = new c.Scene();
11863
- t && (u.background = new c.Color(t)), u.environment = rs(c, l);
11864
- let d = new c.PerspectiveCamera(cs(r, 45), 1, .1, 400), f = Wo(d, l.domElement, {
11865
- distance: cs(n, 5),
11880
+ t && (u.background = new c.Color(t)), u.environment = is(c, l);
11881
+ let d = new c.PerspectiveCamera(ls(r, 45), 1, .1, 400), f = Go(d, l.domElement, {
11882
+ distance: ls(n, 5),
11866
11883
  enableZoom: S
11867
11884
  }), p = new c.DirectionalLight(16777215, 2.2);
11868
11885
  p.position.set(4, 7, 5), p.castShadow = s !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new c.AmbientLight(16777215, .35));
11869
11886
  let m = [], h = new c.Group(), g = (e, t) => {
11870
- let n = cs(t.scale, 1);
11871
- e.position.set(cs(t.x, 0), cs(t.y, 0), cs(t.z, 0)), e.rotation.set(qo(t.rx), qo(t.ry), qo(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = qo(t.spin);
11887
+ let n = ls(t.scale, 1);
11888
+ e.position.set(ls(t.x, 0), ls(t.y, 0), ls(t.z, 0)), e.rotation.set(Jo(t.rx), Jo(t.ry), Jo(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Jo(t.spin);
11872
11889
  };
11873
11890
  for (let e of y) {
11874
11891
  if (e.shape === "model") {
11875
- if (!Jo(e.src)) continue;
11892
+ if (!Yo(e.src)) continue;
11876
11893
  let t = new c.Group();
11877
- g(t, e), h.add(t), as(e.src).then((e) => {
11894
+ g(t, e), h.add(t), os(e.src).then((e) => {
11878
11895
  if (!i) return;
11879
- let n = os(c, e.clone(!0));
11896
+ let n = ss(c, e.clone(!0));
11880
11897
  n.traverse((e) => {
11881
11898
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
11882
11899
  }), t.add(n);
11883
11900
  }, () => {});
11884
11901
  continue;
11885
11902
  }
11886
- let t = (ss[e.shape] ?? ss.box)(c), n = new c.MeshStandardMaterial({
11903
+ let t = (cs[e.shape] ?? cs.box)(c), n = new c.MeshStandardMaterial({
11887
11904
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
11888
- metalness: Math.min(1, Math.max(0, Ko(e.metalness, 10))),
11889
- roughness: Math.min(1, Math.max(0, Ko(e.roughness, 35))),
11890
- transparent: Ko(e.opacity, 100) < 1,
11891
- opacity: Math.min(1, Math.max(0, Ko(e.opacity, 100))),
11905
+ metalness: Math.min(1, Math.max(0, qo(e.metalness, 10))),
11906
+ roughness: Math.min(1, Math.max(0, qo(e.roughness, 35))),
11907
+ transparent: qo(e.opacity, 100) < 1,
11908
+ opacity: Math.min(1, Math.max(0, qo(e.opacity, 100))),
11892
11909
  flatShading: e.flat === !0,
11893
11910
  wireframe: e.wireframe === !0,
11894
11911
  side: e.shape === "plane" ? c.DoubleSide : c.FrontSide
@@ -11899,14 +11916,14 @@ function ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11899
11916
  let _ = null;
11900
11917
  if (s !== !1) {
11901
11918
  let e = new c.ShadowMaterial({ opacity: .22 }), t = new c.PlaneGeometry(60, 60);
11902
- _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = cs(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
11919
+ _ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = ls(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
11903
11920
  }
11904
11921
  let v = () => {
11905
11922
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
11906
11923
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
11907
11924
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
11908
11925
  b?.observe(e), v();
11909
- let C = qo(Number.isFinite(Number(a)) ? a : 20), w = Uo(e, (e) => {
11926
+ let C = Jo(Number.isFinite(Number(a)) ? a : 20), w = Wo(e, (e) => {
11910
11927
  f.autoSpin(x ? C : 0, e), f.update();
11911
11928
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
11912
11929
  l.render(u, d);
@@ -11930,7 +11947,7 @@ function ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11930
11947
  a,
11931
11948
  S,
11932
11949
  s
11933
- ]), _ && m ? /* @__PURE__ */ h(Yo, {
11950
+ ]), _ && m ? /* @__PURE__ */ h(Xo, {
11934
11951
  nodeRef: p,
11935
11952
  style: u,
11936
11953
  height: l,
@@ -11941,27 +11958,27 @@ function ls({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
11941
11958
  g.current = e, typeof p == "function" && p(e);
11942
11959
  },
11943
11960
  style: {
11944
- minHeight: Go(l, 380),
11945
- height: Go(l, 380),
11961
+ minHeight: Ko(l, 380),
11962
+ height: Ko(l, 380),
11946
11963
  overflow: "hidden",
11947
11964
  touchAction: S ? "pan-y" : void 0,
11948
11965
  ...R(u)
11949
11966
  }
11950
11967
  });
11951
11968
  }
11952
- function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
11969
+ function ds({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
11953
11970
  let o = d(null), [s, l] = f("");
11954
11971
  return c(() => {
11955
11972
  let t = o.current;
11956
11973
  if (a || !t || typeof e != "string" || !e.trim()) return;
11957
11974
  let r = !0, i = null;
11958
- return Ro().then((a) => {
11975
+ return zo().then((a) => {
11959
11976
  if (!r || !t) return;
11960
11977
  let o = new a.WebGLRenderer({
11961
11978
  antialias: !0,
11962
11979
  alpha: !n
11963
11980
  });
11964
- o.setPixelRatio(Ho()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
11981
+ o.setPixelRatio(Uo()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
11965
11982
  let s = new a.Scene();
11966
11983
  n && (s.background = new a.Color(n));
11967
11984
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -11984,7 +12001,7 @@ function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
11984
12001
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
11985
12002
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
11986
12003
  f?.observe(t), d();
11987
- let p = !1, m = Uo(t, (e, t) => {
12004
+ let p = !1, m = Wo(t, (e, t) => {
11988
12005
  if (!p && typeof u?.frame == "function") try {
11989
12006
  u.frame(e, t);
11990
12007
  } catch (e) {
@@ -12006,7 +12023,7 @@ function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12006
12023
  e,
12007
12024
  a,
12008
12025
  n
12009
- ]), a ? /* @__PURE__ */ h(Yo, {
12026
+ ]), a ? /* @__PURE__ */ h(Xo, {
12010
12027
  nodeRef: i,
12011
12028
  style: r,
12012
12029
  height: t,
@@ -12017,8 +12034,8 @@ function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12017
12034
  o.current = e, typeof i == "function" && i(e);
12018
12035
  },
12019
12036
  style: {
12020
- minHeight: Go(t, 380),
12021
- height: Go(t, 380),
12037
+ minHeight: Ko(t, 380),
12038
+ height: Ko(t, 380),
12022
12039
  overflow: "hidden",
12023
12040
  position: "relative",
12024
12041
  touchAction: "pan-y",
@@ -12033,7 +12050,7 @@ function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12033
12050
  padding: "6px 8px",
12034
12051
  borderRadius: 6,
12035
12052
  background: "rgba(127,29,29,.85)",
12036
- ...ye,
12053
+ ...be,
12037
12054
  color: "#fee2e2",
12038
12055
  fontSize: 11
12039
12056
  },
@@ -12041,30 +12058,30 @@ function us({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
12041
12058
  }) : null
12042
12059
  });
12043
12060
  }
12044
- var ds = {
12045
- ModelViewerBlock: Xo,
12046
- ShaderBlock: ns,
12047
- SceneBlock: ls,
12048
- ThreeCanvasBlock: us
12049
- }, fs = "2.44.0", ps = "https://cdn.jsdelivr.net/npm", ms = `${ps}/@rive-app/canvas@${fs}/+esm`, hs = `${ps}/@rive-app/canvas@${fs}/rive.wasm`, gs = (e) => import(
12061
+ var fs = {
12062
+ ModelViewerBlock: Zo,
12063
+ ShaderBlock: rs,
12064
+ SceneBlock: us,
12065
+ ThreeCanvasBlock: ds
12066
+ }, ps = "2.44.0", ms = "https://cdn.jsdelivr.net/npm", hs = `${ms}/@rive-app/canvas@${ps}/+esm`, gs = `${ms}/@rive-app/canvas@${ps}/rive.wasm`, _s = (e) => import(
12050
12067
  /* @vite-ignore */
12051
12068
  /* webpackIgnore: true */
12052
12069
  e
12053
- ), _s = null;
12054
- function vs() {
12055
- return typeof window > "u" ? new Promise(() => {}) : _s || (_s = gs(ms).then((e) => {
12070
+ ), vs = null;
12071
+ function ys() {
12072
+ return typeof window > "u" ? new Promise(() => {}) : vs || (vs = _s(hs).then((e) => {
12056
12073
  let t = e?.default ?? e;
12057
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(hs), t;
12074
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(gs), t;
12058
12075
  }).catch((e) => {
12059
- throw _s = null, e;
12060
- }), _s);
12076
+ throw vs = null, e;
12077
+ }), vs);
12061
12078
  }
12062
- var ys = /* @__PURE__ */ new Map(), bs = {
12079
+ var bs = /* @__PURE__ */ new Map(), xs = {
12063
12080
  56: "number",
12064
12081
  58: "trigger",
12065
12082
  59: "boolean"
12066
- }, xs = /* @__PURE__ */ new Set();
12067
- function Ss(e, t) {
12083
+ }, Ss = /* @__PURE__ */ new Set();
12084
+ function Cs(e, t) {
12068
12085
  if (!e || !t) return;
12069
12086
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
12070
12087
  name: String(e?.name ?? ""),
@@ -12073,15 +12090,15 @@ function Ss(e, t) {
12073
12090
  name: String(e?.name ?? ""),
12074
12091
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
12075
12092
  name: String(e?.name ?? ""),
12076
- type: bs[e?.type] ?? "unknown"
12093
+ type: xs[e?.type] ?? "unknown"
12077
12094
  }))
12078
12095
  }))
12079
12096
  }));
12080
- ys.set(e, { artboards: n }), xs.forEach((t) => t(e));
12097
+ bs.set(e, { artboards: n }), Ss.forEach((t) => t(e));
12081
12098
  }
12082
12099
  //#endregion
12083
12100
  //#region ../ui/src/components/builder/rive/views.jsx
12084
- var Cs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ws = [
12101
+ var ws = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ts = [
12085
12102
  "contain",
12086
12103
  "cover",
12087
12104
  "fill",
@@ -12090,7 +12107,7 @@ var Cs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12090
12107
  "scaleDown",
12091
12108
  "none",
12092
12109
  "layout"
12093
- ], Ts = [
12110
+ ], Es = [
12094
12111
  "center",
12095
12112
  "topLeft",
12096
12113
  "topCenter",
@@ -12100,8 +12117,8 @@ var Cs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
12100
12117
  "bottomLeft",
12101
12118
  "bottomCenter",
12102
12119
  "bottomRight"
12103
- ], Es = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Ds = 131;
12104
- function Os(e, t, n, r) {
12120
+ ], Ds = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Os = 131;
12121
+ function ks(e, t, n, r) {
12105
12122
  if (!e || !t || !n) return;
12106
12123
  let i = [];
12107
12124
  try {
@@ -12112,15 +12129,15 @@ function Os(e, t, n, r) {
12112
12129
  let a = i.find((e) => e?.name === n);
12113
12130
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
12114
12131
  }
12115
- function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
12132
+ function As({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
12116
12133
  let S = d(null), C = d(null), w = d(null), T = d(""), [E, D] = f(!1), [O, k] = f(!1);
12117
12134
  c(() => {
12118
12135
  let t = C.current, n = S.current;
12119
12136
  if (D(!1), k(!1), !e || !t) return;
12120
12137
  let r = !0, i = null, c = null, d = null;
12121
- return vs().then((f) => {
12138
+ return ys().then((f) => {
12122
12139
  if (!r) return;
12123
- let h = o !== "animation", g = m !== !1 && !Es();
12140
+ let h = o !== "animation", g = m !== !1 && !Ds();
12124
12141
  try {
12125
12142
  i = new f.Rive({
12126
12143
  src: e,
@@ -12130,8 +12147,8 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12130
12147
  animations: !h && l ? l : void 0,
12131
12148
  autoplay: g,
12132
12149
  layout: new f.Layout({
12133
- fit: ws.includes(u) ? u : "contain",
12134
- alignment: Ts.includes(p) ? p : "center"
12150
+ fit: Ts.includes(u) ? u : "contain",
12151
+ alignment: Es.includes(p) ? p : "center"
12135
12152
  }),
12136
12153
  shouldDisableRiveListeners: !!x,
12137
12154
  isTouchScrollEnabled: !0,
@@ -12139,7 +12156,7 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12139
12156
  if (!r) return;
12140
12157
  i.resizeDrawingSurfaceToCanvas();
12141
12158
  let t = i.contents;
12142
- if (Ss(e, t), h) {
12159
+ if (Cs(e, t), h) {
12143
12160
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
12144
12161
  if (T.current = s || e, !s && e) try {
12145
12162
  i.play(e), g || i.pause(e);
@@ -12155,7 +12172,7 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12155
12172
  }
12156
12173
  w.current = i, n && (n.rive = i), i.on(f.EventType.RiveEvent, (e) => {
12157
12174
  let t = e?.data;
12158
- x || t?.type !== Ds || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12175
+ x || t?.type !== Os || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
12159
12176
  }), n && typeof ResizeObserver < "u" && (c = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), c.observe(n)), n && typeof IntersectionObserver < "u" && (d = new IntersectionObserver(([e]) => {
12160
12177
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
12161
12178
  }), d.observe(n));
@@ -12176,11 +12193,11 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12176
12193
  m,
12177
12194
  x
12178
12195
  ]);
12179
- let A = !x && E, j = (e, t) => A && Os(w.current, T.current, e, t), M = {
12196
+ let A = !x && E, j = (e, t) => A && ks(w.current, T.current, e, t), M = {
12180
12197
  position: "relative",
12181
12198
  display: "block",
12182
12199
  width: "100%",
12183
- height: Cs(r, 360),
12200
+ height: ws(r, 360),
12184
12201
  backgroundColor: i || "transparent",
12185
12202
  overflow: "hidden",
12186
12203
  ...R(y)
@@ -12230,7 +12247,7 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12230
12247
  border: "1px dashed rgba(148,163,184,.55)",
12231
12248
  borderRadius: 10,
12232
12249
  background: "rgba(148,163,184,.08)",
12233
- ...ye,
12250
+ ...be,
12234
12251
  color: "rgba(100,116,139,.95)",
12235
12252
  fontSize: 13,
12236
12253
  textAlign: "center",
@@ -12242,35 +12259,35 @@ function ks({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
12242
12259
  }), /* @__PURE__ */ h("span", { children: "Pick a .riv file in the Settings panel." })]
12243
12260
  }) : null;
12244
12261
  }
12245
- var As = { RiveBlock: ks }, js = /* @__PURE__ */ new Map();
12246
- function Ms(e) {
12247
- if (js.has(e)) return js.get(e);
12262
+ var js = { RiveBlock: As }, Ms = /* @__PURE__ */ new Map();
12263
+ function Ns(e) {
12264
+ if (Ms.has(e)) return Ms.get(e);
12248
12265
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
12249
12266
  /* @vite-ignore */
12250
12267
  /* webpackIgnore: true */
12251
12268
  t
12252
12269
  ).finally(() => URL.revokeObjectURL(t));
12253
- return js.set(e, n), n;
12270
+ return Ms.set(e, n), n;
12254
12271
  }
12255
- function Ns(e) {
12272
+ function Ps(e) {
12256
12273
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
12257
12274
  return n && typeof n == "object" ? n : {};
12258
12275
  }
12259
12276
  //#endregion
12260
12277
  //#region ../ui/src/components/builder/plugins/view.jsx
12261
- async function Ps(e, t) {
12262
- let n = await Ms(e);
12278
+ async function Fs(e, t) {
12279
+ let n = await Ns(e);
12263
12280
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
12264
12281
  }
12265
- var Fs = {
12282
+ var Is = {
12266
12283
  padding: "10px 12px",
12267
12284
  border: "1px dashed rgba(148, 163, 184, 0.5)",
12268
12285
  borderRadius: 8,
12269
12286
  fontSize: 12,
12270
12287
  opacity: .6
12271
12288
  };
12272
- function Is({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12273
- let a = s(Y), o = Ns(a?.settings)[e], l = d(null), u = d(null), f = {
12289
+ function Ls({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12290
+ let a = s(Y), o = Ps(a?.settings)[e], l = d(null), u = d(null), f = {
12274
12291
  tenant: a?.tenant ?? "",
12275
12292
  apiUrl: a?.apiUrl ?? "/api",
12276
12293
  locale: a?.locale ?? "",
@@ -12282,7 +12299,7 @@ function Is({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12282
12299
  let e = l.current;
12283
12300
  if (!o?.code || !e) return;
12284
12301
  let n = !0;
12285
- return Ps(o.code, t).then((e) => {
12302
+ return Fs(o.code, t).then((e) => {
12286
12303
  if (!(!n || !e || !l.current)) {
12287
12304
  u.current = e;
12288
12305
  try {
@@ -12312,7 +12329,7 @@ function Is({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12312
12329
  }) : /* @__PURE__ */ g("div", {
12313
12330
  ref: i,
12314
12331
  style: {
12315
- ...Fs,
12332
+ ...Is,
12316
12333
  ...R(r)
12317
12334
  },
12318
12335
  children: [
@@ -12324,7 +12341,7 @@ function Is({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
12324
12341
  }
12325
12342
  //#endregion
12326
12343
  //#region ../ui/src/components/builder/render.jsx
12327
- function Ls(e, t) {
12344
+ function Rs(e, t) {
12328
12345
  let n = { "data-wb": e };
12329
12346
  t.htmlId && (n.id = t.htmlId);
12330
12347
  let r = H(t.classNames);
@@ -12338,7 +12355,7 @@ function Ls(e, t) {
12338
12355
  classes: r
12339
12356
  };
12340
12357
  }
12341
- function Rs({ View: e, markup: t, ...r }) {
12358
+ function zs({ View: e, markup: t, ...r }) {
12342
12359
  let i = e(r);
12343
12360
  if (!a(i) || typeof i.type != "string") return i;
12344
12361
  let o = [i.props.className, ...t.classes].filter(Boolean).join(" ");
@@ -12347,14 +12364,14 @@ function Rs({ View: e, markup: t, ...r }) {
12347
12364
  ...o ? { className: o } : {}
12348
12365
  });
12349
12366
  }
12350
- var zs = {
12367
+ var Bs = {
12351
12368
  ...wi,
12352
- ...ko,
12353
- ...ds,
12354
- ...As,
12355
- PluginBlock: Is
12369
+ ...Ao,
12370
+ ...fs,
12371
+ ...js,
12372
+ PluginBlock: Ls
12356
12373
  };
12357
- function Bs(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12374
+ function Vs(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12358
12375
  let o = n[e];
12359
12376
  if (!o || o.hidden) return null;
12360
12377
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -12362,26 +12379,26 @@ function Bs(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12362
12379
  let n = o.props?.componentId, s = r?.[n];
12363
12380
  if (!s?.template || i.has(n)) return null;
12364
12381
  let c = new Set(i).add(n);
12365
- return /* @__PURE__ */ h(t, { children: Bs(s.template.rootId, s.template.nodes, r, c, a) }, e);
12382
+ return /* @__PURE__ */ h(t, { children: Vs(s.template.rootId, s.template.nodes, r, c, a) }, e);
12366
12383
  }
12367
- let l = zs[s];
12384
+ let l = Bs[s];
12368
12385
  if (!l) return null;
12369
- let u = (o.nodes ?? []).map((e) => Bs(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, Bs(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ h(typeof l == "function" ? Rs : l, {
12386
+ let u = (o.nodes ?? []).map((e) => Vs(e, n, r, i, a)).filter(Boolean), d = Object.entries(o.linkedNodes ?? {}), f = d.length ? Object.fromEntries(d.map(([e, t]) => [e, Vs(t, n, r, i, a)])) : void 0, p = /* @__PURE__ */ h(typeof l == "function" ? zs : l, {
12370
12387
  ...typeof l == "function" ? {
12371
12388
  View: l,
12372
- markup: Ls(e, c)
12389
+ markup: Rs(e, c)
12373
12390
  } : null,
12374
12391
  ...c,
12375
12392
  ...s === "CollectionList" ? {
12376
12393
  templateId: o.linkedNodes?.card,
12377
- renderTemplate: o.linkedNodes?.card ? (e) => Bs(o.linkedNodes.card, n, r, i, {
12394
+ renderTemplate: o.linkedNodes?.card ? (e) => Vs(o.linkedNodes.card, n, r, i, {
12378
12395
  ...a,
12379
12396
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
12380
12397
  }) : void 0
12381
12398
  } : null,
12382
12399
  linked: f,
12383
12400
  nodeRef: (t) => {
12384
- t && (t.setAttribute("data-wb", e), K(t, c), G(t, a?.events === !1 ? [] : c.events));
12401
+ t && (t.setAttribute("data-wb", e), G(t, c), W(t, a?.events === !1 ? [] : c.events));
12385
12402
  },
12386
12403
  children: u.length ? u : void 0
12387
12404
  }, e), m = c.when && c.when !== "always" ? /* @__PURE__ */ h(Pi, {
@@ -12395,9 +12412,9 @@ function Bs(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
12395
12412
  }
12396
12413
  //#endregion
12397
12414
  //#region ../ui/src/components/builder/PageRenderer.jsx
12398
- var Vs = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Hs = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ee(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12415
+ var Hs = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Us = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Ee(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
12399
12416
  .webim-page[data-webim-mode="dark"] { ${Object.entries(Ee(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
12400
- function Us({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: _, param: v }) {
12417
+ function Ws({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: d, locale: f, direction: p, settings: m, siteUser: _, param: v }) {
12401
12418
  let b = a?.js?.trim();
12402
12419
  if (c(() => {
12403
12420
  if (!b) return;
@@ -12407,15 +12424,15 @@ function Us({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12407
12424
  let x = {
12408
12425
  lang: f || void 0,
12409
12426
  dir: y(p, f)
12410
- }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }\n" + _e, C = {
12427
+ }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }\n" + ve, C = {
12411
12428
  minHeight: "100%",
12412
12429
  display: "flex",
12413
12430
  flexDirection: "column"
12414
- }, T = Bs("ROOT", e, n), E = u(() => ({ render: (t, r) => Bs(t, e, n, void 0, { mapProps: r }) }), [e, n]), O = ge(e, n), k = he(e, n), A = a?.css?.trim(), j = P(o), M = Te(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !q[e]), F = [.../* @__PURE__ */ new Set([...D(e, n), ...N])].map((e) => /* @__PURE__ */ h("link", {
12431
+ }, T = Vs("ROOT", e, n), E = u(() => ({ render: (t, r) => Vs(t, e, n, void 0, { mapProps: r }) }), [e, n]), O = _e(e, n), k = ge(e, n), A = a?.css?.trim(), j = P(o), M = Te(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !q[e]), F = [.../* @__PURE__ */ new Set([...D(e, n), ...N])].map((e) => /* @__PURE__ */ h("link", {
12415
12432
  rel: "stylesheet",
12416
12433
  precedence: "default",
12417
12434
  href: w(e)
12418
- }, e)), I = Hs(M);
12435
+ }, e)), I = Us(M);
12419
12436
  return r === "auto" ? /* @__PURE__ */ h(Y.Provider, {
12420
12437
  value: {
12421
12438
  tenant: s || "",
@@ -12439,8 +12456,8 @@ function Us({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12439
12456
  ...i
12440
12457
  },
12441
12458
  children: [
12442
- /* @__PURE__ */ h("style", { children: `.webim-page { ${Vs(Ee(M.light))} }
12443
- @media (prefers-color-scheme: dark) { .webim-page { ${Vs(Ee(M.dark))} } }` }),
12459
+ /* @__PURE__ */ h("style", { children: `.webim-page { ${Hs(Ee(M.light))} }
12460
+ @media (prefers-color-scheme: dark) { .webim-page { ${Hs(Ee(M.dark))} } }` }),
12444
12461
  /* @__PURE__ */ h("style", { children: I }),
12445
12462
  F,
12446
12463
  /* @__PURE__ */ h("style", { children: S }),
@@ -12494,8 +12511,8 @@ function Us({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
12494
12511
  }
12495
12512
  //#endregion
12496
12513
  //#region src/WebimContent.jsx
12497
- function Ws({ bundle: e, mode: t = "auto", style: n }) {
12498
- return e?.blocks?.ROOT ? /* @__PURE__ */ h(Us, {
12514
+ function Gs({ bundle: e, mode: t = "auto", style: n }) {
12515
+ return e?.blocks?.ROOT ? /* @__PURE__ */ h(Ws, {
12499
12516
  blocks: e.blocks,
12500
12517
  theme: e.theme,
12501
12518
  components: e.components,
@@ -12514,24 +12531,24 @@ function Ws({ bundle: e, mode: t = "auto", style: n }) {
12514
12531
  }
12515
12532
  //#endregion
12516
12533
  //#region src/fetchPage.js
12517
- var Gs = async (e) => {
12534
+ var Ks = async (e) => {
12518
12535
  let t = await e.json().catch(() => null);
12519
12536
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
12520
12537
  return t?.payload ?? t;
12521
12538
  };
12522
- async function Ks({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
12539
+ async function qs({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
12523
12540
  if (!e) throw Error("fetchPage: apiUrl is required");
12524
12541
  if (!n) throw Error("fetchPage: slug is required");
12525
12542
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
12526
12543
  ...t ? { "x-tenant": t } : {},
12527
12544
  ...a ? { authorization: `Bearer ${a}` } : {}
12528
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Gs), c(`${l}/settings/public`, { headers: u }).then(Gs)]), p = Ne({
12545
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Ks), c(`${l}/settings/public`, { headers: u }).then(Ks)]), p = Ne({
12529
12546
  page: d,
12530
12547
  settings: f,
12531
12548
  tenant: t,
12532
12549
  apiUrl: l,
12533
12550
  locale: r
12534
- }), m = [...new Set(qs(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
12551
+ }), m = [...new Set(Js(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
12535
12552
  "TableBlock",
12536
12553
  "OrgChartBlock",
12537
12554
  "NavbarBlock",
@@ -12540,7 +12557,7 @@ async function Ks({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
12540
12557
  "LogoCarousel"
12541
12558
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
12542
12559
  if (m.length) {
12543
- 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(Gs).then((e) => {
12560
+ 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(Ks).then((e) => {
12544
12561
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
12545
12562
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
12546
12563
  }).catch(() => [[t, []]])));
@@ -12552,7 +12569,7 @@ async function Ks({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
12552
12569
  __page: Math.floor(h)
12553
12570
  }), p;
12554
12571
  }
12555
- function qs(e, t) {
12572
+ function Js(e, t) {
12556
12573
  let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
12557
12574
  Object.values(e ?? {}).forEach((e) => {
12558
12575
  n.push(e);
@@ -12564,40 +12581,40 @@ function qs(e, t) {
12564
12581
  }
12565
12582
  //#endregion
12566
12583
  //#region src/ssr.jsx
12567
- var Js = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
12584
+ var Ys = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
12568
12585
  "&": "&amp;",
12569
12586
  "<": "&lt;",
12570
12587
  ">": "&gt;",
12571
12588
  "\"": "&quot;"
12572
12589
  })[e]);
12573
- function Ys(t, { mode: n = "auto", style: r } = {}) {
12574
- return e(/* @__PURE__ */ h(Ws, {
12590
+ function Xs(t, { mode: n = "auto", style: r } = {}) {
12591
+ return e(/* @__PURE__ */ h(Gs, {
12575
12592
  bundle: t,
12576
12593
  mode: n,
12577
12594
  style: r
12578
12595
  }));
12579
12596
  }
12580
- function Xs(e, { mode: t = "auto", lang: n } = {}) {
12597
+ function Zs(e, { mode: t = "auto", lang: n } = {}) {
12581
12598
  let r = e.seo ?? {}, i = n || e.locale || "en", a = y(e.direction, i), o = Pe(e) || "Page", s = e.custom?.js?.trim(), c = [
12582
12599
  "<meta charset=\"utf-8\"/>",
12583
12600
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
12584
- `<title>${Js(o)}</title>`,
12585
- r.description && `<meta name="description" content="${Js(r.description)}"/>`,
12586
- `<meta property="og:title" content="${Js(o)}"/>`,
12587
- r.image && `<meta property="og:image" content="${Js(r.image)}"/>`,
12601
+ `<title>${Ys(o)}</title>`,
12602
+ r.description && `<meta name="description" content="${Ys(r.description)}"/>`,
12603
+ `<meta property="og:title" content="${Ys(o)}"/>`,
12604
+ r.image && `<meta property="og:image" content="${Ys(r.image)}"/>`,
12588
12605
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
12589
12606
  "<style>html,body{margin:0;height:100%}</style>"
12590
12607
  ].filter(Boolean).join("\n");
12591
12608
  return `<!doctype html>
12592
- <html lang="${Js(i)}"${a ? ` dir="${a}"` : ""}>
12609
+ <html lang="${Ys(i)}"${a ? ` dir="${a}"` : ""}>
12593
12610
  <head>
12594
12611
  ${c}
12595
12612
  </head>
12596
12613
  <body>
12597
- ${Ys(e, { mode: t })}
12614
+ ${Xs(e, { mode: t })}
12598
12615
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
12599
12616
  </body>
12600
12617
  </html>`;
12601
12618
  }
12602
12619
  //#endregion
12603
- export { Ne as assembleBundle, Pe as documentTitle, Ks as fetchPage, Ys as renderBundleHtml, Xs as renderPageDocument };
12620
+ export { Ne as assembleBundle, Pe as documentTitle, qs as fetchPage, Xs as renderBundleHtml, Zs as renderPageDocument };