webim-adapter 2.7.7 → 2.7.8

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.
@@ -5824,114 +5824,201 @@ var Ki = (e) => String(e?.group ?? "").trim(), qi = (e) => {
5824
5824
  let i = Ki(e) || `#${r}`;
5825
5825
  n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
5826
5826
  }), t.flatMap((e) => n.get(e));
5827
- };
5828
- function Ji(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
5829
- let i = Gi(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
5830
- for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
5831
- d = qi(d);
5832
- for (let [e, t] of u) u.set(e, qi(t));
5833
- let f = (e, t) => o + (Ki(e) !== Ki(t) && (Ki(e) || Ki(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
5827
+ }, Ji = 20, Yi = 12, Xi = [
5828
+ "left",
5829
+ "center",
5830
+ "right"
5831
+ ], Zi = (e) => e.points.map((e, t) => `${t ? "L" : "M"} ${e.x} ${e.y}`).join(" ");
5832
+ function Qi(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top", columns: i = "off" } = {}) {
5833
+ let a = Gi(t), o = n ? a.h : a.w, s = n ? 16 : 20, c = (n ? a.w : a.h) + (n ? 56 : 48), l = Array.isArray(e) ? e.filter((e) => e && e.id) : [], u = new Set(l.map((e) => e.id)), d = /* @__PURE__ */ new Map(), f = [];
5834
+ for (let e of l) e.parent && u.has(e.parent) && e.parent !== e.id ? (d.has(e.parent) || d.set(e.parent, []), d.get(e.parent).push(e)) : f.push(e);
5835
+ f = qi(f);
5836
+ for (let [e, t] of d) d.set(e, qi(t));
5837
+ let p = !n && Xi.includes(i), m = (e) => Xi.includes(e?.columns) ? e.columns : i, h = (e) => {
5838
+ let t = d.get(e.id) ?? [];
5839
+ if (!p) return t.map((e) => ({ nodes: [e] }));
5840
+ let n = [], r = [], i = () => {
5841
+ r.length > 1 ? n.push({
5842
+ nodes: r,
5843
+ line: m(e)
5844
+ }) : r.forEach((e) => n.push({ nodes: [e] })), r = [];
5845
+ };
5846
+ for (let e of t) {
5847
+ let t = !(d.get(e.id) ?? []).length;
5848
+ r.length && (!t || Ki(r[0]) !== Ki(e)) && i(), t ? r.push(e) : n.push({ nodes: [e] });
5849
+ }
5850
+ return i(), n;
5851
+ }, g = (e, t) => s + (Ki(e) !== Ki(t) && (Ki(e) || Ki(t)) ? 24 : 0), _ = (e, t) => g(e.nodes.at(-1), t.nodes[0]), v = (e) => o + (e.line === "center" ? 0 : Ji), y = /* @__PURE__ */ new Map(), b = (e, t) => {
5834
5852
  if (t.has(e.id)) return 0;
5835
5853
  t.add(e.id);
5836
- let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
5837
- return p.set(e.id, i), i;
5854
+ let n = h(e), r = n.reduce((e, r, i) => {
5855
+ let a = r.line ? v(r) : b(r.nodes[0], t);
5856
+ return r.line && r.nodes.forEach((e) => t.add(e.id)), e + a + (i ? _(n[i - 1], r) : 0);
5857
+ }, 0), i = Math.max(o, r);
5858
+ return y.set(e.id, i), i;
5838
5859
  };
5839
- d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
5840
- let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
5841
- if (o.has(e.id)) return;
5842
- o.add(e.id);
5843
- let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
5844
- h.push({
5860
+ f.forEach((e) => b(e, /* @__PURE__ */ new Set()));
5861
+ let x = [], S = [], C = /* @__PURE__ */ new Map(), w = 0, T = (e, t, r) => {
5862
+ x.push({
5845
5863
  node: e,
5846
- x: m,
5847
- y: b
5864
+ x: t,
5865
+ y: r
5848
5866
  });
5849
- let x = Ki(e);
5850
- if (x) {
5851
- let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
5852
- _.has(t) || _.set(t, {
5853
- title: x,
5867
+ let i = Ki(e);
5868
+ if (i) {
5869
+ let n = `${e.parent && u.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${i}`;
5870
+ C.has(n) || C.set(n, {
5871
+ title: i,
5854
5872
  color: "",
5855
5873
  members: []
5856
5874
  });
5857
- let n = _.get(t);
5858
- !n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
5859
- x: m,
5860
- y: b
5875
+ let a = C.get(n);
5876
+ !a.color && e.groupColor && (a.color = e.groupColor), a.members.push({
5877
+ x: t,
5878
+ y: r
5861
5879
  });
5862
5880
  }
5863
- v = Math.max(v, d + (n ? i.w : i.h));
5864
- let S = t, C = u.get(e.id) ?? [];
5865
- C.forEach((e, t) => {
5866
- t && (S += f(C[t - 1], e));
5867
- let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
5868
- g.push(n ? {
5869
- from: {
5870
- x: d + i.w,
5871
- y: c + i.h / 2
5881
+ w = Math.max(w, n ? t + a.w : r + a.h);
5882
+ }, E = (e, t, n, r) => {
5883
+ let i = t + (e.line === "left" ? Ji : 0), o = n * c, s = r.y + (o - r.y) / 2, l = e.line === "left" ? i - Ji / 2 : i + a.w + Ji / 2;
5884
+ e.nodes.forEach((t, n) => {
5885
+ let c = o + n * (a.h + Yi), u = c + a.h / 2;
5886
+ if (T(t, i, c), e.line === "center") S.push(n ? { points: [{
5887
+ x: i + a.w / 2,
5888
+ y: c - Yi
5889
+ }, {
5890
+ x: i + a.w / 2,
5891
+ y: c
5892
+ }] } : { points: [
5893
+ r,
5894
+ {
5895
+ x: r.x,
5896
+ y: s
5872
5897
  },
5873
- to: {
5874
- x: u,
5875
- y: l
5898
+ {
5899
+ x: i + a.w / 2,
5900
+ y: s
5901
+ },
5902
+ {
5903
+ x: i + a.w / 2,
5904
+ y: c
5876
5905
  }
5877
- } : {
5878
- from: {
5879
- x: c + i.w / 2,
5880
- y: d + i.h
5906
+ ] });
5907
+ else {
5908
+ let t = e.line === "left" ? i : i + a.w;
5909
+ S.push({ points: [
5910
+ r,
5911
+ {
5912
+ x: r.x,
5913
+ y: s
5914
+ },
5915
+ {
5916
+ x: l,
5917
+ y: s
5918
+ },
5919
+ {
5920
+ x: l,
5921
+ y: u
5922
+ },
5923
+ {
5924
+ x: t,
5925
+ y: u
5926
+ }
5927
+ ] });
5928
+ }
5929
+ });
5930
+ }, D = (e, t, r, i) => {
5931
+ if (i.has(e.id)) return;
5932
+ i.add(e.id);
5933
+ let s = t + ((y.get(e.id) ?? o) - o) / 2, l = r * c;
5934
+ T(e, n ? l : s, n ? s : l);
5935
+ let u = t, d = h(e), f = n ? {
5936
+ x: l + a.w,
5937
+ y: s + a.h / 2
5938
+ } : {
5939
+ x: s + a.w / 2,
5940
+ y: l + a.h
5941
+ };
5942
+ d.forEach((e, t) => {
5943
+ if (t && (u += _(d[t - 1], e)), e.line) {
5944
+ E(e, u, r + 1, f), e.nodes.forEach((e) => i.add(e.id)), u += v(e);
5945
+ return;
5946
+ }
5947
+ let a = e.nodes[0], s = u + ((y.get(a.id) ?? o) - o) / 2 + o / 2, l = (r + 1) * c;
5948
+ S.push({ points: n ? [
5949
+ f,
5950
+ {
5951
+ x: (f.x + l) / 2,
5952
+ y: f.y
5953
+ },
5954
+ {
5955
+ x: (f.x + l) / 2,
5956
+ y: s
5881
5957
  },
5882
- to: {
5958
+ {
5883
5959
  x: l,
5884
- y: u
5960
+ y: s
5885
5961
  }
5886
- }), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
5962
+ ] : [
5963
+ f,
5964
+ {
5965
+ x: f.x,
5966
+ y: (f.y + l) / 2
5967
+ },
5968
+ {
5969
+ x: s,
5970
+ y: (f.y + l) / 2
5971
+ },
5972
+ {
5973
+ x: s,
5974
+ y: l
5975
+ }
5976
+ ] }), D(a, u, r + 1, i), u += y.get(a.id) ?? o;
5887
5977
  });
5888
- }, b = 0, x = /* @__PURE__ */ new Set();
5889
- d.forEach((e, t) => {
5890
- t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
5978
+ }, O = 0, k = /* @__PURE__ */ new Set();
5979
+ f.forEach((e, t) => {
5980
+ t && (O += g(f[t - 1], e)), D(e, O, 0, k), O += y.get(e.id) ?? o;
5891
5981
  });
5892
- let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
5893
- let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
5982
+ let A = Math.max(O, o), j = r === "hidden" ? 0 : 22, M = [...C.values()].map((e) => {
5983
+ let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + a.w + 12, i = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : j), o = Math.max(...e.members.map((e) => e.y)) + a.h + 12 + (r === "bottom" ? j : 0);
5894
5984
  return {
5895
5985
  x: t,
5896
- y: a,
5986
+ y: i,
5897
5987
  width: n - t,
5898
- height: o - a,
5988
+ height: o - i,
5899
5989
  title: e.title,
5900
5990
  color: e.color
5901
5991
  };
5902
- }), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
5903
- if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
5904
- for (let e of h) e.x += D, e.y += O;
5905
- for (let e of g) e.from = {
5906
- x: e.from.x + D,
5907
- y: e.from.y + O
5908
- }, e.to = {
5909
- x: e.to.x + D,
5910
- y: e.to.y + O
5911
- };
5912
- for (let e of w) e.x += D, e.y += O;
5992
+ }), N = n ? Math.max(w, a.w) : A, P = n ? A : Math.max(w, a.h), F = Math.max(0, ...M.map((e) => -e.x)), I = Math.max(0, ...M.map((e) => -e.y));
5993
+ if (M.length && (N = Math.max(N, ...M.map((e) => e.x + e.width)) + F, P = Math.max(P, ...M.map((e) => e.y + e.height)) + I, F || I)) {
5994
+ for (let e of x) e.x += F, e.y += I;
5995
+ for (let e of S) e.points = e.points.map((e) => ({
5996
+ x: e.x + F,
5997
+ y: e.y + I
5998
+ }));
5999
+ for (let e of M) e.x += F, e.y += I;
5913
6000
  }
5914
6001
  return {
5915
- boxes: h,
5916
- links: g,
5917
- groups: w,
5918
- width: T,
5919
- height: E,
6002
+ boxes: x,
6003
+ links: S,
6004
+ groups: M,
6005
+ width: N,
6006
+ height: P,
5920
6007
  horizontal: n
5921
6008
  };
5922
6009
  }
5923
- var Yi = (e, t) => {
6010
+ var $i = (e, t) => {
5924
6011
  let n = String(e ?? "");
5925
6012
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
5926
- }, Xi = (e) => {
6013
+ }, ea = (e) => {
5927
6014
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
5928
6015
  if (!t) return "#ffffff";
5929
6016
  let n = t[1];
5930
6017
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
5931
6018
  let r = parseInt(n, 16);
5932
6019
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
5933
- }, Zi = (e) => !!(e?.cv?.trim?.() || e?.photo);
5934
- function Qi(e, t = {}) {
6020
+ }, ta = (e) => !!(e?.cv?.trim?.() || e?.photo || e?.profilePhoto);
6021
+ function na(e, t = {}) {
5935
6022
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ln(e);
5936
6023
  return n.map((e) => {
5937
6024
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -5947,19 +6034,26 @@ function Qi(e, t = {}) {
5947
6034
  };
5948
6035
  });
5949
6036
  }
5950
- var $i = {
6037
+ var ra = /^(https?:\/\/[^\s"<>]+|mailto:[^\s"<>]+|tel:[+\d][\d\s().-]*|\/(?!\/)[^\s"<>]*)$/i, ia = (e) => {
6038
+ let t = String(e ?? "").trim();
6039
+ return ra.test(t) ? t : "";
6040
+ }, aa = (e) => {
6041
+ e.startsWith("/") ? window.location.assign(e) : window.open(e, "_blank", "noopener,noreferrer");
6042
+ }, oa = {
5951
6043
  size: 36,
5952
6044
  pad: 10
5953
6045
  };
5954
- function ea({ node: e, onClose: t }) {
5955
- return s(() => {
6046
+ function sa({ node: e, onClose: t }) {
6047
+ s(() => {
5956
6048
  let e = (e) => e.key === "Escape" && t();
5957
6049
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
5958
- }, [t]), /* @__PURE__ */ h("div", {
6050
+ }, [t]);
6051
+ let n = e.profilePhoto || e.photo, r = e.title || e.name, i = e.title && e.name ? e.name : "", a = !!(n && e.cv), o = ia(e.href);
6052
+ return /* @__PURE__ */ h("div", {
5959
6053
  onClick: t,
5960
6054
  role: "dialog",
5961
6055
  "aria-modal": "true",
5962
- "aria-label": e.name,
6056
+ "aria-label": r,
5963
6057
  style: {
5964
6058
  position: "fixed",
5965
6059
  inset: 0,
@@ -5979,117 +6073,138 @@ function ea({ node: e, onClose: t }) {
5979
6073
  color: "var(--page-text, #111827)",
5980
6074
  border: "1px solid rgba(148, 163, 184, 0.35)",
5981
6075
  borderRadius: 14,
5982
- maxWidth: 420,
6076
+ maxWidth: a ? 900 : 440,
5983
6077
  width: "100%",
5984
- maxHeight: "80vh",
5985
- overflowY: "auto",
5986
- padding: 24,
5987
- position: "relative",
6078
+ maxHeight: "85vh",
6079
+ display: "flex",
6080
+ flexDirection: "column",
6081
+ overflow: "hidden",
5988
6082
  boxShadow: "0 24px 64px rgba(2, 6, 23, 0.5)"
5989
6083
  },
5990
- children: [
5991
- /* @__PURE__ */ h("button", {
6084
+ children: [/* @__PURE__ */ g("div", {
6085
+ style: {
6086
+ display: "flex",
6087
+ alignItems: "flex-start",
6088
+ gap: 12,
6089
+ padding: "18px 20px 14px 24px",
6090
+ borderBottom: "1px solid rgba(148, 163, 184, 0.3)"
6091
+ },
6092
+ children: [/* @__PURE__ */ g("div", {
6093
+ style: {
6094
+ flex: 1,
6095
+ minWidth: 0
6096
+ },
6097
+ children: [/* @__PURE__ */ h("div", {
6098
+ style: {
6099
+ fontSize: 18,
6100
+ fontWeight: 700,
6101
+ lineHeight: 1.35
6102
+ },
6103
+ children: r
6104
+ }), i && /* @__PURE__ */ h("div", {
6105
+ style: {
6106
+ fontSize: 14,
6107
+ opacity: .7,
6108
+ marginTop: 2
6109
+ },
6110
+ children: i
6111
+ })]
6112
+ }), /* @__PURE__ */ h("button", {
5992
6113
  type: "button",
5993
6114
  "aria-label": "Close",
5994
6115
  onClick: t,
5995
6116
  style: {
5996
- position: "absolute",
5997
- top: 10,
5998
- right: 10,
5999
- width: 30,
6000
- height: 30,
6117
+ flexShrink: 0,
6118
+ width: 32,
6119
+ height: 32,
6001
6120
  border: 0,
6002
6121
  borderRadius: 8,
6003
6122
  background: "transparent",
6004
6123
  color: "inherit",
6005
- fontSize: 18,
6124
+ fontSize: 20,
6006
6125
  lineHeight: 1,
6007
6126
  cursor: "pointer",
6008
6127
  opacity: .6
6009
6128
  },
6010
6129
  children: "×"
6011
- }),
6012
- /* @__PURE__ */ g("div", {
6130
+ })]
6131
+ }), /* @__PURE__ */ g("div", {
6132
+ style: {
6133
+ overflowY: "auto",
6134
+ padding: 24,
6135
+ display: "flex",
6136
+ flexWrap: "wrap",
6137
+ gap: 24,
6138
+ alignItems: "flex-start"
6139
+ },
6140
+ children: [n && /* @__PURE__ */ h("img", {
6141
+ src: n,
6142
+ alt: e.name || r,
6143
+ style: a ? {
6144
+ flex: "1 1 220px",
6145
+ maxWidth: 340,
6146
+ width: "100%",
6147
+ height: "auto",
6148
+ borderRadius: 10,
6149
+ objectFit: "cover"
6150
+ } : {
6151
+ width: 96,
6152
+ height: 96,
6153
+ borderRadius: "50%",
6154
+ objectFit: "cover"
6155
+ }
6156
+ }), (e.cv || o) && /* @__PURE__ */ g("div", {
6013
6157
  style: {
6014
- display: "flex",
6015
- alignItems: "center",
6016
- gap: 14,
6017
- marginBottom: e.cv ? 14 : 0
6158
+ flex: "2 1 320px",
6159
+ minWidth: 0
6018
6160
  },
6019
- children: [e.photo && /* @__PURE__ */ h("img", {
6020
- src: e.photo,
6021
- alt: "",
6161
+ children: [e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ h("p", {
6022
6162
  style: {
6023
- width: 72,
6024
- height: 72,
6025
- borderRadius: "50%",
6026
- objectFit: "cover",
6027
- flexShrink: 0
6028
- }
6029
- }), /* @__PURE__ */ g("div", {
6030
- style: { minWidth: 0 },
6031
- children: [/* @__PURE__ */ h("div", {
6032
- style: {
6033
- fontSize: 18,
6034
- fontWeight: 700
6035
- },
6036
- children: e.name
6037
- }), e.title && /* @__PURE__ */ h("div", {
6038
- style: {
6039
- fontSize: 13,
6040
- opacity: .65
6041
- },
6042
- children: e.title
6043
- })]
6163
+ fontSize: 15,
6164
+ lineHeight: 1.65,
6165
+ margin: "0 0 12px"
6166
+ },
6167
+ children: e
6168
+ }, t)), o && /* @__PURE__ */ h("a", {
6169
+ href: o,
6170
+ target: "_blank",
6171
+ rel: "noopener noreferrer",
6172
+ style: {
6173
+ display: "inline-block",
6174
+ marginTop: 6,
6175
+ padding: "8px 14px",
6176
+ borderRadius: 8,
6177
+ fontSize: 13,
6178
+ fontWeight: 600,
6179
+ textDecoration: "none",
6180
+ background: "var(--page-accent, #4f46e5)",
6181
+ color: "var(--page-accent-text, #ffffff)"
6182
+ },
6183
+ children: "Open profile ↗"
6044
6184
  })]
6045
- }),
6046
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ h("p", {
6047
- style: {
6048
- fontSize: 14,
6049
- lineHeight: 1.6,
6050
- margin: "0 0 10px"
6051
- },
6052
- children: e
6053
- }, t)),
6054
- e.href && /* @__PURE__ */ h("a", {
6055
- href: e.href,
6056
- target: "_blank",
6057
- rel: "noopener noreferrer",
6058
- style: {
6059
- display: "inline-block",
6060
- marginTop: 6,
6061
- padding: "8px 14px",
6062
- borderRadius: 8,
6063
- fontSize: 13,
6064
- fontWeight: 600,
6065
- textDecoration: "none",
6066
- background: "var(--page-accent, #4f46e5)",
6067
- color: "var(--page-accent-text, #ffffff)"
6068
- },
6069
- children: "Open profile ↗"
6070
- })
6071
- ]
6185
+ })]
6186
+ })]
6072
6187
  })
6073
6188
  });
6074
6189
  }
6075
- function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: l, hrefField: u, groupField: f, groupTitles: p = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
6076
- let C = c(), [w, T] = d(null), { tenant: E, apiUrl: D } = o(X), O = o(Jt)?.[t], [k, A] = d(null);
6190
+ function ca({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: l, hrefField: u, groupField: f, groupTitles: p = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, columns: b = "off", style: x, nodeRef: S, interactive: C = !0 }) {
6191
+ let w = c(), [T, E] = d(null), { tenant: D, apiUrl: O } = o(X), k = o(Jt)?.[t], [A, j] = d(null);
6077
6192
  s(() => {
6078
- if (!t || O) return;
6193
+ if (!t || k) return;
6079
6194
  let e = !0;
6080
- return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
6195
+ return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
6081
6196
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
6082
- e && A(n);
6083
- }).catch(() => e && A([])), () => {
6197
+ e && j(n);
6198
+ }).catch(() => e && j([])), () => {
6084
6199
  e = !1;
6085
6200
  };
6086
6201
  }, [
6087
6202
  t,
6088
- E,
6089
6203
  D,
6090
- O
6204
+ O,
6205
+ k
6091
6206
  ]);
6092
- let j = t ? Qi(O ?? k ?? [], {
6207
+ let M = t ? na(k ?? A ?? [], {
6093
6208
  nameField: n,
6094
6209
  titleField: r,
6095
6210
  photoField: i,
@@ -6097,13 +6212,14 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6097
6212
  cvField: l,
6098
6213
  hrefField: u,
6099
6214
  groupField: f
6100
- }) : e, M = Gi(v), { boxes: N, links: P, groups: F, width: I, height: L } = Ji(j, {
6215
+ }) : e, N = Gi(v), { boxes: P, links: F, groups: I, width: L, height: R } = Qi(M, {
6101
6216
  size: v,
6102
6217
  horizontal: y,
6103
- groupTitles: p
6218
+ groupTitles: p,
6219
+ columns: b
6104
6220
  });
6105
- if (!N.length) return !S && t ? /* @__PURE__ */ g("div", {
6106
- ref: x,
6221
+ if (!P.length) return !C && t ? /* @__PURE__ */ g("div", {
6222
+ ref: S,
6107
6223
  style: {
6108
6224
  padding: 18,
6109
6225
  border: "1px dashed rgba(148, 163, 184, 0.6)",
@@ -6111,7 +6227,7 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6111
6227
  fontSize: 13,
6112
6228
  opacity: .7,
6113
6229
  textAlign: "center",
6114
- ...G(b)
6230
+ ...G(x)
6115
6231
  },
6116
6232
  children: [
6117
6233
  "Org Chart — no published entries in “",
@@ -6119,27 +6235,27 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6119
6235
  "” yet"
6120
6236
  ]
6121
6237
  }) : null;
6122
- let R = new Set(N.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
6238
+ let z = new Set(P.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
6123
6239
  return /* @__PURE__ */ g("div", {
6124
- ref: x,
6240
+ ref: S,
6125
6241
  style: {
6126
6242
  maxWidth: "100%",
6127
6243
  overflowX: "auto",
6128
- ...G(b)
6244
+ ...G(x)
6129
6245
  },
6130
6246
  children: [/* @__PURE__ */ g("svg", {
6131
- viewBox: `0 0 ${I} ${L}`,
6247
+ viewBox: `0 0 ${L} ${R}`,
6132
6248
  role: "img",
6133
6249
  "aria-label": "Organization chart",
6134
6250
  style: {
6135
6251
  display: "block",
6136
6252
  width: "100%",
6137
- maxWidth: I,
6253
+ maxWidth: L,
6138
6254
  height: "auto",
6139
6255
  margin: "0 auto"
6140
6256
  },
6141
6257
  children: [
6142
- F.map((e, t) => {
6258
+ I.map((e, t) => {
6143
6259
  let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
6144
6260
  return /* @__PURE__ */ g("g", { children: [/* @__PURE__ */ h("rect", {
6145
6261
  x: e.x,
@@ -6152,29 +6268,33 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6152
6268
  x: e.x + e.width / 2,
6153
6269
  y: p === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
6154
6270
  textAnchor: "middle",
6155
- fontSize: M.title + 1,
6271
+ fontSize: N.title + 1,
6156
6272
  fontWeight: "600",
6157
6273
  opacity: "0.55",
6158
- fill: r ? Xi(e.color || _) : "var(--page-text, #111827)",
6159
- children: Yi(e.title, Math.floor(e.width / 7))
6274
+ fill: r ? ea(e.color || _) : "var(--page-text, #111827)",
6275
+ children: $i(e.title, Math.floor(e.width / 7))
6160
6276
  })] }, `group-${t}`);
6161
6277
  }),
6162
- P.map((e, t) => /* @__PURE__ */ h("path", {
6163
- d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
6278
+ F.map((e, t) => /* @__PURE__ */ h("path", {
6279
+ d: Zi(e),
6164
6280
  fill: "none",
6165
6281
  stroke: "rgba(148, 163, 184, 0.7)",
6166
6282
  strokeWidth: "1.5"
6167
6283
  }, t)),
6168
- N.map(({ node: e, x: t, y: n }) => {
6169
- let r = R.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Xi(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Xi(e.color2) : s, l = S && (Zi(e) || e.href), u = () => Zi(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), d = e.photo ? t + $i.pad + M.avatar + 8 : t + M.w / 2, f = e.photo ? "start" : "middle", p = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
6284
+ P.map(({ node: e, x: t, y: n }) => {
6285
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? ea(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? ea(e.color2) : s, l = ia(e.href), u = C && (l || ta(e)), d = () => l ? aa(l) : E(e), f = e.photo ? t + oa.pad + N.avatar + 8 : t + N.w / 2, p = e.photo ? "start" : "middle", _ = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), v = N.h / 2, y = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
6170
6286
  return /* @__PURE__ */ g("g", {
6171
- onClick: l ? u : void 0,
6172
- style: l ? { cursor: "pointer" } : void 0,
6173
- role: l ? "button" : void 0,
6174
- "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
6287
+ onClick: u ? d : void 0,
6288
+ onKeyDown: u ? (e) => {
6289
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
6290
+ } : void 0,
6291
+ tabIndex: u ? 0 : void 0,
6292
+ style: u ? { cursor: "pointer" } : void 0,
6293
+ role: u ? l ? "link" : "button" : void 0,
6294
+ "aria-label": u ? l ? `${e.name || e.title} — open link` : `Open ${e.name || e.title}'s profile` : void 0,
6175
6295
  children: [
6176
6296
  i && e.gradient ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("linearGradient", {
6177
- id: `${C}-${e.id}-grad`,
6297
+ id: `${w}-${e.id}-grad`,
6178
6298
  x1: "0",
6179
6299
  y1: "0",
6180
6300
  x2: "0",
@@ -6189,104 +6309,104 @@ function ta({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
6189
6309
  }), /* @__PURE__ */ h("rect", {
6190
6310
  x: t,
6191
6311
  y: n,
6192
- width: M.w,
6193
- height: M.h,
6312
+ width: N.w,
6313
+ height: N.h,
6194
6314
  rx: "10",
6195
- fill: `url(#${C}-${e.id}-grad)`
6315
+ fill: `url(#${w}-${e.id}-grad)`
6196
6316
  })] }) : i ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("clipPath", {
6197
- id: `${C}-${e.id}-box`,
6317
+ id: `${w}-${e.id}-box`,
6198
6318
  children: /* @__PURE__ */ h("rect", {
6199
6319
  x: t,
6200
6320
  y: n,
6201
- width: M.w,
6202
- height: M.h,
6321
+ width: N.w,
6322
+ height: N.h,
6203
6323
  rx: "10"
6204
6324
  })
6205
6325
  }), /* @__PURE__ */ g("g", {
6206
- clipPath: `url(#${C}-${e.id}-box)`,
6326
+ clipPath: `url(#${w}-${e.id}-box)`,
6207
6327
  children: [/* @__PURE__ */ h("rect", {
6208
6328
  x: t,
6209
6329
  y: n,
6210
- width: M.w,
6211
- height: _,
6330
+ width: N.w,
6331
+ height: v,
6212
6332
  fill: o
6213
6333
  }), /* @__PURE__ */ h("rect", {
6214
6334
  x: t,
6215
- y: n + _,
6216
- width: M.w,
6217
- height: M.h - _,
6335
+ y: n + v,
6336
+ width: N.w,
6337
+ height: N.h - v,
6218
6338
  fill: e.color2
6219
6339
  })]
6220
6340
  })] }) : /* @__PURE__ */ h("rect", {
6221
6341
  x: t,
6222
6342
  y: n,
6223
- width: M.w,
6224
- height: M.h,
6343
+ width: N.w,
6344
+ height: N.h,
6225
6345
  rx: "10",
6226
6346
  fill: o,
6227
6347
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
6228
6348
  strokeWidth: a ? 0 : 1.5
6229
6349
  }),
6230
6350
  e.photo && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("clipPath", {
6231
- id: `${C}-${e.id}`,
6351
+ id: `${w}-${e.id}`,
6232
6352
  children: /* @__PURE__ */ h("circle", {
6233
- cx: t + $i.pad + M.avatar / 2,
6234
- cy: n + M.h / 2,
6235
- r: M.avatar / 2
6353
+ cx: t + oa.pad + N.avatar / 2,
6354
+ cy: n + N.h / 2,
6355
+ r: N.avatar / 2
6236
6356
  })
6237
6357
  }), /* @__PURE__ */ h("image", {
6238
6358
  href: e.photo,
6239
- x: t + $i.pad,
6240
- y: n + (M.h - M.avatar) / 2,
6241
- width: M.avatar,
6242
- height: M.avatar,
6359
+ x: t + oa.pad,
6360
+ y: n + (N.h - N.avatar) / 2,
6361
+ width: N.avatar,
6362
+ height: N.avatar,
6243
6363
  preserveAspectRatio: "xMidYMid slice",
6244
- clipPath: `url(#${C}-${e.id})`
6364
+ clipPath: `url(#${w}-${e.id})`
6245
6365
  })] }),
6246
6366
  i && !e.gradient ? /* @__PURE__ */ g(m, { children: [e.title && /* @__PURE__ */ h("text", {
6247
- x: d,
6248
- y: n + _ / 2 + M.title * .35,
6249
- textAnchor: f,
6250
- fontSize: M.title,
6367
+ x: f,
6368
+ y: n + v / 2 + N.title * .35,
6369
+ textAnchor: p,
6370
+ fontSize: N.title,
6251
6371
  fontWeight: "600",
6252
6372
  fill: s,
6253
- children: Yi(e.title, p + 4)
6373
+ children: $i(e.title, _ + 4)
6254
6374
  }), e.name && /* @__PURE__ */ h("text", {
6255
- x: d,
6256
- y: n + _ + _ / 2 + M.name * .35,
6257
- textAnchor: f,
6258
- fontSize: M.name,
6375
+ x: f,
6376
+ y: n + v + v / 2 + N.name * .35,
6377
+ textAnchor: p,
6378
+ fontSize: N.name,
6259
6379
  fontWeight: "600",
6260
6380
  fill: c,
6261
- children: Yi(e.name, p)
6262
- })] }) : /* @__PURE__ */ g(m, { children: [v[0] && /* @__PURE__ */ h("text", {
6263
- x: d,
6264
- y: n + (v[1] ? M.h * .43 : M.h * .57),
6265
- textAnchor: f,
6266
- fontSize: M.name,
6381
+ children: $i(e.name, _)
6382
+ })] }) : /* @__PURE__ */ g(m, { children: [y[0] && /* @__PURE__ */ h("text", {
6383
+ x: f,
6384
+ y: n + (y[1] ? N.h * .43 : N.h * .57),
6385
+ textAnchor: p,
6386
+ fontSize: N.name,
6267
6387
  fontWeight: "600",
6268
6388
  fill: s,
6269
- children: Yi(v[0], p)
6270
- }), v[1] && /* @__PURE__ */ h("text", {
6271
- x: d,
6272
- y: n + M.h * .73,
6273
- textAnchor: f,
6274
- fontSize: M.title,
6389
+ children: $i(y[0], _)
6390
+ }), y[1] && /* @__PURE__ */ h("text", {
6391
+ x: f,
6392
+ y: n + N.h * .73,
6393
+ textAnchor: p,
6394
+ fontSize: N.title,
6275
6395
  opacity: "0.7",
6276
6396
  fill: s,
6277
- children: Yi(v[1], p + 4)
6397
+ children: $i(y[1], _ + 4)
6278
6398
  })] })
6279
6399
  ]
6280
6400
  }, e.id);
6281
6401
  })
6282
6402
  ]
6283
- }), w && /* @__PURE__ */ h(ea, {
6284
- node: w,
6285
- onClose: () => T(null)
6403
+ }), T && /* @__PURE__ */ h(sa, {
6404
+ node: T,
6405
+ onClose: () => E(null)
6286
6406
  })]
6287
6407
  });
6288
6408
  }
6289
- function na({ value: e, onCommit: t, style: n, hint: r }) {
6409
+ function la({ value: e, onCommit: t, style: n, hint: r }) {
6290
6410
  let [i, a] = d(!1), o = u(null);
6291
6411
  return s(() => {
6292
6412
  if (!i || !o.current) return;
@@ -6316,7 +6436,7 @@ function na({ value: e, onCommit: t, style: n, hint: r }) {
6316
6436
  children: e ?? ""
6317
6437
  });
6318
6438
  }
6319
- var ra = 360, ia = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", aa = (e, t) => e && t ? `cell-${e}-${t}` : "", oa = (e) => {
6439
+ var ua = 360, da = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", fa = (e, t) => e && t ? `cell-${e}-${t}` : "", pa = (e) => {
6320
6440
  if (!e || typeof e != "object") return e ?? "";
6321
6441
  let t = String(e.text ?? "");
6322
6442
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ h("a", {
@@ -6327,7 +6447,7 @@ var ra = 360, ia = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
6327
6447
  children: t
6328
6448
  }) : t;
6329
6449
  };
6330
- function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: c, linked: l, source: f, limit: p = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, caption: j = "", captionHidden: M = !1, rowHeaders: N = !1, style: P, nodeRef: F, edit: I }) {
6450
+ function ma({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: c, linked: l, source: f, limit: p = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, caption: j = "", captionHidden: M = !1, rowHeaders: N = !1, style: P, nodeRef: F, edit: I }) {
6331
6451
  let L = u(null), R = u(null), [z, B] = d(null), [V, H] = d(null), U = (e, t) => () => B({
6332
6452
  r: e,
6333
6453
  c: t
@@ -6341,7 +6461,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6341
6461
  }
6342
6462
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
6343
6463
  top: r.bottom - n.top + 4,
6344
- left: Math.max(0, Math.min(r.left - n.left, n.width - ra))
6464
+ left: Math.max(0, Math.min(r.left - n.left, n.width - ua))
6345
6465
  };
6346
6466
  (V?.top !== i.top || V?.left !== i.left) && H(i);
6347
6467
  }), s(() => {
@@ -6397,7 +6517,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6397
6517
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
6398
6518
  }, Se = /* @__PURE__ */ new Set();
6399
6519
  c && ae.forEach((t, n) => e.forEach((e, t) => {
6400
- let a = c[aa(r[n], i[t])];
6520
+ let a = c[fa(r[n], i[t])];
6401
6521
  if (!a) return;
6402
6522
  let o = Math.max(1, Number(a.c) || 1), s = Math.max(1, Number(a.r) || 1);
6403
6523
  for (let e = 0; e < s; e++) for (let r = 0; r < o; r++) (e || r) && Se.add(`${n + e},${t + r}`);
@@ -6420,7 +6540,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6420
6540
  },
6421
6541
  onClick: n,
6422
6542
  children: e
6423
- }, t), Y = z && z.r < ae.length && z.c < e.length ? z : null, Te = (e, t) => I?.labels?.[e] ?? t, Ee = Y ? c?.[aa(r[Y.r], i[Y.c])] : null, De = Math.max(1, Number(Ee?.c) || 1), Oe = Math.max(1, Number(Ee?.r) || 1);
6543
+ }, t), Y = z && z.r < ae.length && z.c < e.length ? z : null, Te = (e, t) => I?.labels?.[e] ?? t, Ee = Y ? c?.[fa(r[Y.r], i[Y.c])] : null, De = Math.max(1, Number(Ee?.c) || 1), Oe = Math.max(1, Number(Ee?.r) || 1);
6424
6544
  return /* @__PURE__ */ g("div", {
6425
6545
  ref: (e) => {
6426
6546
  R.current = e, typeof F == "function" && F(e);
@@ -6431,7 +6551,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6431
6551
  ...ye
6432
6552
  },
6433
6553
  children: [
6434
- I && /* @__PURE__ */ h("style", { children: ia }),
6554
+ I && /* @__PURE__ */ h("style", { children: da }),
6435
6555
  I && Y && V && /* @__PURE__ */ g("div", {
6436
6556
  className: "wb-tedit-bar",
6437
6557
  style: {
@@ -6513,7 +6633,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6513
6633
  } : I ? { position: "relative" } : null,
6514
6634
  ...ue
6515
6635
  },
6516
- children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(na, {
6636
+ children: I ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(la, {
6517
6637
  value: t.label ?? t,
6518
6638
  onCommit: (e) => I.header(n, e),
6519
6639
  hint: Te("editCell", "Double-click to edit"),
@@ -6544,7 +6664,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6544
6664
  },
6545
6665
  children: e.map((e, a) => {
6546
6666
  if (Se.has(`${n},${a}`)) return null;
6547
- let o = aa(r[n], i[a]), s = l?.[o], u = c?.[o], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1), p = N && a === 0 ? "th" : "td";
6667
+ let o = fa(r[n], i[a]), s = l?.[o], u = c?.[o], d = Math.max(1, Number(u?.c) || 1), f = Math.max(1, Number(u?.r) || 1), p = N && a === 0 ? "th" : "td";
6548
6668
  return /* @__PURE__ */ g(p, {
6549
6669
  ...Z("cell", p === "th" && "row-header"),
6550
6670
  scope: p === "th" ? "row" : void 0,
@@ -6563,7 +6683,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6563
6683
  ...I ? { position: "relative" } : null,
6564
6684
  ...ue
6565
6685
  },
6566
- children: [s ?? oa(t?.[a]), I && be && /* @__PURE__ */ h("span", {
6686
+ children: [s ?? pa(t?.[a]), I && be && /* @__PURE__ */ h("span", {
6567
6687
  className: "wb-tedit-rowgrip",
6568
6688
  title: Te("rowHeight", "Drag to set the row height — double-click to fit the content"),
6569
6689
  onPointerDown: Ce(n),
@@ -6578,7 +6698,7 @@ function sa({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
6578
6698
  ]
6579
6699
  });
6580
6700
  }
6581
- var ca = {
6701
+ var ha = {
6582
6702
  small: {
6583
6703
  cell: 62,
6584
6704
  font: 10.5,
@@ -6603,8 +6723,8 @@ var ca = {
6603
6723
  pad: 8,
6604
6724
  gap: 4
6605
6725
  }
6606
- }, la = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, ua = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), da = 366;
6607
- function fa(e, t = {}) {
6726
+ }, ga = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, _a = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), va = 366;
6727
+ function ya(e, t = {}) {
6608
6728
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : ln(e), a = (e) => {
6609
6729
  let t = i(r(e)), n = t ? new Date(t) : null;
6610
6730
  return n && !Number.isNaN(n.getTime()) ? n : null;
@@ -6621,7 +6741,7 @@ function fa(e, t = {}) {
6621
6741
  } : null;
6622
6742
  }).filter(Boolean);
6623
6743
  }
6624
- function pa(e) {
6744
+ function ba(e) {
6625
6745
  return (Array.isArray(e) ? e : []).map((e, t) => {
6626
6746
  let n = e?.start ? new Date(e.start) : null;
6627
6747
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -6636,19 +6756,19 @@ function pa(e) {
6636
6756
  };
6637
6757
  }).filter(Boolean);
6638
6758
  }
6639
- function ma(e) {
6759
+ function xa(e) {
6640
6760
  let t = /* @__PURE__ */ new Map();
6641
6761
  for (let n of e) {
6642
- let e = ua(n.start), r = n.end ? ua(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), da);
6762
+ let e = _a(n.start), r = n.end ? _a(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), va);
6643
6763
  for (let r = 0; r <= i; r += 1) {
6644
- let i = la(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
6764
+ let i = ga(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
6645
6765
  t.has(i) || t.set(i, []), t.get(i).push(n);
6646
6766
  }
6647
6767
  }
6648
6768
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
6649
6769
  return t;
6650
6770
  }
6651
- function ha({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: c = "", variant: l = "month", size: u = "medium", accent: f = "", eventBg: p = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
6771
+ function Sa({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: c = "", variant: l = "month", size: u = "medium", accent: f = "", eventBg: p = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
6652
6772
  let { tenant: T, apiUrl: E, locale: D } = o(X), O = o(Jt)?.[t], [k, A] = d(null), [j, M] = d(() => {
6653
6773
  let e = /* @__PURE__ */ new Date();
6654
6774
  return {
@@ -6671,13 +6791,13 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6671
6791
  E,
6672
6792
  O
6673
6793
  ]);
6674
- let N = ca[u] ?? ca.medium, P = f || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = _ || "var(--page-accent-text, #ffffff)", R = t ? fa(O ?? k ?? [], {
6794
+ let N = ha[u] ?? ha.medium, P = f || "var(--page-accent, #4f46e5)", F = v || "var(--page-border, rgba(148, 163, 184, 0.35))", I = p || P, L = _ || "var(--page-accent-text, #ffffff)", R = t ? ya(O ?? k ?? [], {
6675
6795
  titleField: n,
6676
6796
  startField: r,
6677
6797
  endField: i,
6678
6798
  hrefField: a,
6679
6799
  colorField: c
6680
- }) : pa(e), z = ma(R), B = D || void 0, V = (e, t) => {
6800
+ }) : ba(e), z = xa(R), B = D || void 0, V = (e, t) => {
6681
6801
  let n = /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
6682
6802
  ...Z("event-dot"),
6683
6803
  style: {
@@ -6820,9 +6940,9 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6820
6940
  })]
6821
6941
  });
6822
6942
  }
6823
- let ee = new Date(j.year, j.month, 1), q = y === "sunday" ? 0 : 1, J = (ee.getDay() - q + 7) % 7, te = new Date(j.year, j.month + 1, 0).getDate(), ne = Math.ceil((J + te) / 7), re = la(/* @__PURE__ */ new Date()), ie = new Intl.DateTimeFormat(B, { weekday: "short" }), ae = [];
6943
+ let ee = new Date(j.year, j.month, 1), q = y === "sunday" ? 0 : 1, J = (ee.getDay() - q + 7) % 7, te = new Date(j.year, j.month + 1, 0).getDate(), ne = Math.ceil((J + te) / 7), re = ga(/* @__PURE__ */ new Date()), ie = new Intl.DateTimeFormat(B, { weekday: "short" }), ae = [];
6824
6944
  for (let e = 0; e < ne * 7; e += 1) {
6825
- let t = e - J + 1, n = t >= 1 && t <= te, r = la(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === re;
6945
+ let t = e - J + 1, n = t >= 1 && t <= te, r = ga(new Date(j.year, j.month, t)), i = n ? z.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === re;
6826
6946
  ae.push(/* @__PURE__ */ g("div", {
6827
6947
  ...Z("day", !n && "day-outside", o && "day-today"),
6828
6948
  style: {
@@ -6892,12 +7012,12 @@ function ha({ events: e = [], source: t = "", titleField: n = "", startField: r
6892
7012
  ]
6893
7013
  });
6894
7014
  }
6895
- var ga = {
7015
+ var Ca = {
6896
7016
  small: 36,
6897
7017
  medium: 56,
6898
7018
  large: 88
6899
7019
  };
6900
- function _a(e, t = {}) {
7020
+ function wa(e, t = {}) {
6901
7021
  let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ln(e);
6902
7022
  return n.map((e) => {
6903
7023
  let n = e.data ?? e, i = sn(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(sn(n, t.nameField)) : r(n.name);
@@ -6908,7 +7028,7 @@ function _a(e, t = {}) {
6908
7028
  };
6909
7029
  }).filter((e) => e.src);
6910
7030
  }
6911
- function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: c = "medium", perView: l = 5, gap: f = 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 }) {
7031
+ function Ta({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: c = "medium", perView: l = 5, gap: f = 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 }) {
6912
7032
  let { tenant: D, apiUrl: O, locale: k } = o(X), A = Xe(k), j = o(Jt)?.[t], [M, N] = d(null), P = u(null), F = u(null), [I, L] = d(0), [R, z] = d(0), [B, V] = d(0), [H, U] = d(!0), [W, K] = d(!1), [ee, q] = d(!1), [J, te] = d(!1), [ne, re] = d(!1);
6913
7033
  s(() => {
6914
7034
  if (!t || j) return;
@@ -6948,11 +7068,11 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
6948
7068
  t = !1, r.forEach((e) => e.removeEventListener("load", n));
6949
7069
  };
6950
7070
  });
6951
- let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? _a(j ?? M ?? [], {
7071
+ let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? wa(j ?? M ?? [], {
6952
7072
  imageField: n,
6953
7073
  nameField: r,
6954
7074
  hrefField: i
6955
- }) : ie, oe = ga[c] ?? ga.medium, se = Number.isFinite(Number(f)) ? Math.max(0, Number(f)) : 48, ce = a === "marquee" ? "step" : a, le = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), ue = Math.min(3e3, Math.max(100, Number(_) || 500)), de = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), fe = (R || oe * 3) + se, pe = I ? Math.max(1, Math.floor(I / fe)) : de, me = Math.min(de, pe), he = I ? Math.min(fe, I / me) : fe;
7075
+ }) : ie, oe = Ca[c] ?? Ca.medium, se = Number.isFinite(Number(f)) ? Math.max(0, Number(f)) : 48, ce = a === "marquee" ? "step" : a, le = Math.min(3e4, Math.max(300, (Number(p) || 3) * 1e3)), ue = Math.min(3e3, Math.max(100, Number(_) || 500)), de = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), fe = (R || oe * 3) + se, pe = I ? Math.max(1, Math.floor(I / fe)) : de, me = Math.min(de, pe), he = I ? Math.min(fe, I / me) : fe;
6956
7076
  if (!ae.length) return /* @__PURE__ */ h("div", {
6957
7077
  ref: T,
6958
7078
  style: {
@@ -7169,7 +7289,7 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
7169
7289
  children: /* @__PURE__ */ h("path", { d: J ? "M8 5v14l11-7z" : "M7 5h4v14H7zM13 5h4v14h-4z" })
7170
7290
  })
7171
7291
  }),
7172
- /* @__PURE__ */ h(ya, {
7292
+ /* @__PURE__ */ h(Ea, {
7173
7293
  running: ye,
7174
7294
  every: le + ue,
7175
7295
  slide: ue,
@@ -7183,7 +7303,7 @@ function va({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
7183
7303
  ]
7184
7304
  });
7185
7305
  }
7186
- function ya({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: c, setAnimate: l }) {
7306
+ function Ea({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: c, setAnimate: l }) {
7187
7307
  s(() => {
7188
7308
  if (!e) return;
7189
7309
  let n = setInterval(() => {
@@ -7219,13 +7339,13 @@ function ya({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
7219
7339
  l
7220
7340
  ]), null;
7221
7341
  }
7222
- var ba = {
7342
+ var Da = {
7223
7343
  tablet: 991,
7224
7344
  mobileLandscape: 767,
7225
7345
  mobile: 478
7226
- }, xa = "M4 6h16M4 12h16M4 18h16", Sa = (e) => e && Ar[e] ? Ar[e] : xa;
7227
- function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: o = "", icon: l = "", title: f = "", showClose: _ = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
7228
- let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${ba[t] ?? 991}px)`, N = a(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = u(null), [F, I] = d(null);
7346
+ }, Oa = "M4 6h16M4 12h16M4 18h16", ka = (e) => e && Ar[e] ? Ar[e] : Oa;
7347
+ function Aa({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: o = "", icon: l = "", title: f = "", showClose: _ = !0, backdropClose: v = !0, closeOnLink: y = !0, forceMode: b, frame: x, editorOpen: S = !0, editorLabel: C = "Drawer", linked: w, style: T, nodeRef: E, inert: D = !1 }) {
7348
+ let [O, k] = d(!1), A = `wb-drw-${c().replace(/[^\w-]/g, "")}`, j = u(null), M = t === "always" ? "" : `(max-width: ${Da[t] ?? 991}px)`, N = a(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = u(null), [F, I] = d(null);
7229
7349
  s(() => {
7230
7350
  if (D || typeof window > "u") return;
7231
7351
  let e = () => {
@@ -7455,7 +7575,7 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
7455
7575
  strokeLinecap: "round",
7456
7576
  strokeLinejoin: "round",
7457
7577
  "aria-hidden": "true",
7458
- children: /* @__PURE__ */ h("path", { d: Sa(l) })
7578
+ children: /* @__PURE__ */ h("path", { d: ka(l) })
7459
7579
  }), o ? /* @__PURE__ */ h("span", { children: o }) : null]
7460
7580
  }),
7461
7581
  W && i !== "button" && !K && /* @__PURE__ */ g("div", {
@@ -7500,8 +7620,8 @@ function Ca({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
7500
7620
  ]
7501
7621
  });
7502
7622
  }
7503
- function wa({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
7504
- let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u = ba[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${l} { display: none !important; } }`, f = i === "inline";
7623
+ function ja({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
7624
+ let l = `wb-dbt-${c().replace(/[^\w-]/g, "")}`, u = Da[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${l} { display: none !important; } }`, f = i === "inline";
7505
7625
  return /* @__PURE__ */ g(m, { children: [d ? /* @__PURE__ */ h("style", { children: d }) : null, /* @__PURE__ */ g("button", {
7506
7626
  ref: o,
7507
7627
  type: "button",
@@ -7535,20 +7655,20 @@ function wa({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
7535
7655
  strokeLinecap: "round",
7536
7656
  strokeLinejoin: "round",
7537
7657
  "aria-hidden": "true",
7538
- children: /* @__PURE__ */ h("path", { d: Sa(r) })
7658
+ children: /* @__PURE__ */ h("path", { d: ka(r) })
7539
7659
  }), n ? /* @__PURE__ */ h("span", {
7540
7660
  ...Z("label"),
7541
7661
  children: n
7542
7662
  }) : null]
7543
7663
  })] });
7544
7664
  }
7545
- var Ta = {
7665
+ var Ma = {
7546
7666
  small: 380,
7547
7667
  medium: 560,
7548
7668
  large: 820,
7549
7669
  full: "100%"
7550
7670
  };
7551
- function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: c = !0, backdropClose: l = !0, position: f = "center", actions: p = [], showCloseAction: m = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
7671
+ function Na({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: c = !0, backdropClose: l = !0, position: f = "center", actions: p = [], showCloseAction: m = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
7552
7672
  let [C, w] = d(!1), T = u(null);
7553
7673
  s(() => {
7554
7674
  if (S || !e) return;
@@ -7573,7 +7693,7 @@ function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
7573
7693
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
7574
7694
  };
7575
7695
  }, [S, C]);
7576
- let E = Ta[a] ?? Ta.medium, D = (e) => {
7696
+ let E = Ma[a] ?? Ma.medium, D = (e) => {
7577
7697
  let t = e.variant ?? "primary", n = {
7578
7698
  padding: "9px 16px",
7579
7699
  borderRadius: 6,
@@ -7751,7 +7871,7 @@ function Ea({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
7751
7871
  })]
7752
7872
  });
7753
7873
  }
7754
- function Da({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: c = !0, linked: l, style: f, nodeRef: p, inert: m = !1 }) {
7874
+ function Pa({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: c = !0, linked: l, style: f, nodeRef: p, inert: m = !1 }) {
7755
7875
  let [_, v] = d(!1), y = u(null), b = u(null), x = r !== "click", S = () => {
7756
7876
  b.current && clearTimeout(b.current), b.current = null;
7757
7877
  }, C = () => {
@@ -7854,15 +7974,15 @@ function Da({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
7854
7974
  }), E]
7855
7975
  });
7856
7976
  }
7857
- var Oa = {
7977
+ var Fa = {
7858
7978
  PageRoot: Cn,
7859
7979
  MarkdownBlock: Hn,
7860
- CalendarBlock: ha,
7861
- LogoCarousel: va,
7862
- DialogBlock: Ea,
7863
- DrawerBlock: Ca,
7864
- DrawerTrigger: wa,
7865
- DropdownBlock: Da,
7980
+ CalendarBlock: Sa,
7981
+ LogoCarousel: Ta,
7982
+ DialogBlock: Na,
7983
+ DrawerBlock: Aa,
7984
+ DrawerTrigger: ja,
7985
+ DropdownBlock: Pa,
7866
7986
  Section: wn,
7867
7987
  Container: Tn,
7868
7988
  LinkBlock: En,
@@ -7886,8 +8006,8 @@ var Oa = {
7886
8006
  ThemeModeBlock: ji,
7887
8007
  ScrollTopBlock: Bi,
7888
8008
  CounterBlock: zi,
7889
- OrgChartBlock: ta,
7890
- TableBlock: sa,
8009
+ OrgChartBlock: ca,
8010
+ TableBlock: ma,
7891
8011
  IconBlock: jr,
7892
8012
  MapBlock: kr,
7893
8013
  MasonryBlock: Nr,
@@ -7922,39 +8042,39 @@ var Oa = {
7922
8042
  FormFile: vi,
7923
8043
  FormRecaptcha: di,
7924
8044
  FormSubmit: bi
7925
- }, ka = {
8045
+ }, Ia = {
7926
8046
  id: "auth",
7927
8047
  label: "Accounts",
7928
8048
  category: "Apps",
7929
8049
  keys: ["SiteLoginForm", "SiteAccountMenu"],
7930
8050
  ssr: "shell",
7931
8051
  settings: ["site.authRedirect"]
7932
- }, Aa = n({
8052
+ }, La = n({
7933
8053
  user: null,
7934
8054
  status: "idle",
7935
8055
  ensure: () => {},
7936
8056
  refresh: () => {},
7937
8057
  signOut: () => {}
7938
8058
  });
7939
- function ja(e, t) {
8059
+ function Ra(e, t) {
7940
8060
  return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
7941
8061
  }
7942
- function Ma(e) {
8062
+ function za(e) {
7943
8063
  let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
7944
8064
  return {
7945
8065
  mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
7946
8066
  url: i,
7947
8067
  mePath: a,
7948
8068
  logoutPath: o,
7949
- meUrl: ja(i, a),
7950
- logoutUrl: ja(i, o),
8069
+ meUrl: Ra(i, a),
8070
+ logoutUrl: Ra(i, o),
7951
8071
  loginPage: r(n.loginPage),
7952
8072
  userPath: r(n.userPath),
7953
8073
  auth: n.auth === "bearer" ? "bearer" : "cookies",
7954
8074
  tokenKey: r(n.tokenKey) || "webim_session_token"
7955
8075
  };
7956
8076
  }
7957
- function Na(e, t) {
8077
+ function Ba(e, t) {
7958
8078
  if (!t) return e ?? null;
7959
8079
  let n = e;
7960
8080
  for (let e of t.split(".")) {
@@ -7963,26 +8083,26 @@ function Na(e, t) {
7963
8083
  }
7964
8084
  return n ?? null;
7965
8085
  }
7966
- function Pa(e) {
8086
+ function Va(e) {
7967
8087
  try {
7968
8088
  return window.localStorage.getItem(e) || "";
7969
8089
  } catch {
7970
8090
  return "";
7971
8091
  }
7972
8092
  }
7973
- function Fa(e) {
8093
+ function Ha(e) {
7974
8094
  try {
7975
8095
  window.localStorage.removeItem(e);
7976
8096
  } catch {}
7977
8097
  }
7978
- var Ia = () => {
7979
- let e = o(Aa);
8098
+ var Ua = () => {
8099
+ let e = o(La);
7980
8100
  return s(() => {
7981
8101
  e.ensure();
7982
8102
  }, [e]), e;
7983
8103
  };
7984
- function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
7985
- let c = o(X), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() => Ma(c?.settings), [c?.settings]), [g, _] = d(t ?? null), [v, y] = d(t ? "user" : n ? "guest" : "idle"), b = u(!1), x = a((e, t) => fetch(`${f}${e}`, {
8104
+ function Wa({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
8105
+ let c = o(X), f = r || c?.apiUrl || "/api", p = i || c?.tenant || "", m = l(() => za(c?.settings), [c?.settings]), [g, _] = d(t ?? null), [v, y] = d(t ? "user" : n ? "guest" : "idle"), b = u(!1), x = a((e, t) => fetch(`${f}${e}`, {
7986
8106
  ...t,
7987
8107
  credentials: "include",
7988
8108
  headers: {
@@ -7994,9 +8114,9 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
7994
8114
  if (n) return Promise.resolve(null);
7995
8115
  if (m.mode === "off") return Promise.resolve(S(null));
7996
8116
  if (m.mode === "custom") {
7997
- let e = m.auth === "bearer" ? Pa(m.tokenKey) : "";
8117
+ let e = m.auth === "bearer" ? Va(m.tokenKey) : "";
7998
8118
  return !m.meUrl || m.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(m.meUrl, { ...m.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
7999
- let t = Na(e, m.userPath);
8119
+ let t = Ba(e, m.userPath);
8000
8120
  return S(t && typeof t == "object" ? t : null);
8001
8121
  }).catch(() => S(null));
8002
8122
  }
@@ -8009,12 +8129,12 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
8009
8129
  ]), w = a(() => {
8010
8130
  if (m.mode === "off") return S(null), Promise.resolve();
8011
8131
  if (m.mode === "custom") {
8012
- let e = m.auth === "bearer" ? Pa(m.tokenKey) : "";
8132
+ let e = m.auth === "bearer" ? Va(m.tokenKey) : "";
8013
8133
  return (m.logoutUrl ? fetch(m.logoutUrl, {
8014
8134
  method: "post",
8015
8135
  ...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
8016
8136
  }).catch(() => {}) : Promise.resolve()).then(() => {
8017
- m.auth === "bearer" && Fa(m.tokenKey), S(null);
8137
+ m.auth === "bearer" && Ha(m.tokenKey), S(null);
8018
8138
  });
8019
8139
  }
8020
8140
  return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
@@ -8064,18 +8184,18 @@ function La({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
8064
8184
  m.loginPage,
8065
8185
  C,
8066
8186
  w
8067
- ]), /* @__PURE__ */ h(Aa.Provider, {
8187
+ ]), /* @__PURE__ */ h(La.Provider, {
8068
8188
  value: E,
8069
8189
  children: e
8070
8190
  });
8071
8191
  }
8072
- function Ra({ when: e, children: t }) {
8073
- let { status: n } = Ia();
8192
+ function Ga({ when: e, children: t }) {
8193
+ let { status: n } = Ua();
8074
8194
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
8075
8195
  }
8076
8196
  //#endregion
8077
8197
  //#region ../ui/src/components/builder/apps/auth/views.jsx
8078
- function za({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: s, nodeRef: c, inert: l, linked: u, show: f }) {
8198
+ function Ka({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: s, nodeRef: c, inert: l, linked: u, show: f }) {
8079
8199
  let { tenant: p, apiUrl: m, settings: _ } = o(X), [v, y] = d("form"), [b, x] = d(""), [S, C] = d(!1), w = e === "register", T = l ? f || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
8080
8200
  if (e.preventDefault(), l) return;
8081
8201
  let n = new FormData(e.currentTarget);
@@ -8208,8 +8328,8 @@ function za({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
8208
8328
  ]
8209
8329
  });
8210
8330
  }
8211
- function Ba({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
8212
- let { user: c, status: l, signOut: u } = Ia(), d = a ? s || "user" : l, f = a ? {
8331
+ function qa({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
8332
+ let { user: c, status: l, signOut: u } = Ua(), d = a ? s || "user" : l, f = a ? {
8213
8333
  name: "Ada Lovelace",
8214
8334
  email: "ada@example.com"
8215
8335
  } : c;
@@ -8277,40 +8397,40 @@ function Ba({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
8277
8397
  }
8278
8398
  //#endregion
8279
8399
  //#region ../ui/src/components/builder/apps/consent/manifest.js
8280
- var Va = {
8400
+ var Ja = {
8281
8401
  id: "consent",
8282
8402
  label: "Cookie consent",
8283
8403
  category: "Apps",
8284
8404
  keys: ["CookieConsent"],
8285
8405
  ssr: "shell",
8286
8406
  settings: []
8287
- }, Ha = "webim.cookie_consent";
8288
- function Ua() {
8407
+ }, Ya = "webim.cookie_consent";
8408
+ function Xa() {
8289
8409
  try {
8290
- let e = window.localStorage.getItem(Ha), t = e ? JSON.parse(e) : null;
8410
+ let e = window.localStorage.getItem(Ya), t = e ? JSON.parse(e) : null;
8291
8411
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
8292
8412
  } catch {
8293
8413
  return "";
8294
8414
  }
8295
8415
  }
8296
- function Wa(e) {
8416
+ function Za(e) {
8297
8417
  try {
8298
8418
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
8299
8419
  } catch {}
8300
8420
  }
8301
- function Ga(e) {
8421
+ function Qa(e) {
8302
8422
  try {
8303
- window.localStorage.setItem(Ha, JSON.stringify({
8423
+ window.localStorage.setItem(Ya, JSON.stringify({
8304
8424
  choice: e,
8305
8425
  at: (/* @__PURE__ */ new Date()).toISOString()
8306
8426
  }));
8307
8427
  } catch {}
8308
- Wa(e);
8428
+ Za(e);
8309
8429
  try {
8310
8430
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
8311
8431
  } catch {}
8312
8432
  }
8313
- var Ka = {
8433
+ var $a = {
8314
8434
  bottom: {
8315
8435
  left: 0,
8316
8436
  right: 0,
@@ -8332,18 +8452,18 @@ var Ka = {
8332
8452
  maxWidth: 400
8333
8453
  }
8334
8454
  };
8335
- function qa({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: c, style: l, nodeRef: u, inert: f }) {
8455
+ function eo({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: c, style: l, nodeRef: u, inert: f }) {
8336
8456
  let [p, _] = d(!!f), [v, y] = d(null), b = (e) => {
8337
8457
  y(e), typeof u == "function" && u(e);
8338
8458
  };
8339
8459
  if (s(() => {
8340
8460
  if (f) return;
8341
- let e = Ua();
8342
- e ? Wa(e) : _(!0);
8461
+ let e = Xa();
8462
+ e ? Za(e) : _(!0);
8343
8463
  }, [f, v]), !p) return null;
8344
8464
  let x = (e) => () => {
8345
- f || (Ga(e), _(!1));
8346
- }, S = Ka[o] ?? Ka.bottom, C = {
8465
+ f || (Qa(e), _(!1));
8466
+ }, S = $a[o] ?? $a.bottom, C = {
8347
8467
  appearance: "none",
8348
8468
  font: "inherit",
8349
8469
  fontSize: 14,
@@ -8428,37 +8548,37 @@ function qa({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
8428
8548
  }
8429
8549
  //#endregion
8430
8550
  //#region ../ui/src/components/builder/apps/language/manifest.js
8431
- var Ja = {
8551
+ var to = {
8432
8552
  id: "language",
8433
8553
  label: "Language",
8434
8554
  category: "Apps",
8435
8555
  keys: ["SiteLanguagePicker"],
8436
8556
  ssr: "prefetch",
8437
8557
  settings: ["locales"]
8438
- }, Ya = {
8558
+ }, no = {
8439
8559
  id: "search",
8440
8560
  label: "Search",
8441
8561
  category: "Apps",
8442
8562
  keys: ["SiteSearch"],
8443
8563
  ssr: "prefetch",
8444
8564
  settings: []
8445
- }, Xa = 50, Za = 2e3;
8446
- function Qa() {
8565
+ }, ro = 50, io = 2e3;
8566
+ function ao() {
8447
8567
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
8448
8568
  }
8449
- function $a(e, t) {
8569
+ function oo(e, t) {
8450
8570
  let n = e?.data ?? {}, r = [];
8451
8571
  for (let e of Object.values(n)) {
8452
8572
  let t = e == null ? "" : ln(e);
8453
- if (t && r.push(t), r.join(" ").length > Za) break;
8573
+ if (t && r.push(t), r.join(" ").length > io) break;
8454
8574
  }
8455
- return r.join(" ").slice(0, Za).toLocaleLowerCase(t || void 0);
8575
+ return r.join(" ").slice(0, io).toLocaleLowerCase(t || void 0);
8456
8576
  }
8457
- function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: i = !1, layout: a = "inline", includePages: c = !0, collections: l = [], limit: f = 10, emptyText: p = "Nothing found", hint: m = "", style: _, nodeRef: v, inert: y = !1, sample: b = !1 }) {
8458
- let { tenant: x, apiUrl: S, locale: C } = o(X), [w, T] = d(() => Qa()), [E, D] = d(() => Qa()), [O, k] = d(null), [A, j] = d(!1), M = u(null), N = a === "popup";
8577
+ function so({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: i = !1, layout: a = "inline", includePages: c = !0, collections: l = [], limit: f = 10, emptyText: p = "Nothing found", hint: m = "", style: _, nodeRef: v, inert: y = !1, sample: b = !1 }) {
8578
+ let { tenant: x, apiUrl: S, locale: C } = o(X), [w, T] = d(() => ao()), [E, D] = d(() => ao()), [O, k] = d(null), [A, j] = d(!1), M = u(null), N = a === "popup";
8459
8579
  s(() => {
8460
8580
  let e = () => {
8461
- let e = Qa();
8581
+ let e = ao();
8462
8582
  T(e), D(e);
8463
8583
  };
8464
8584
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -8509,7 +8629,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8509
8629
  });
8510
8630
  }
8511
8631
  else for (let t of e.rows) {
8512
- if (!$a(t, C).includes(P)) continue;
8632
+ if (!oo(t, C).includes(P)) continue;
8513
8633
  let n = t?.data ?? {}, r = ln(n.name) || "Untitled", i = ln(n.slug);
8514
8634
  F.push({
8515
8635
  key: `entry:${t.id}`,
@@ -8518,7 +8638,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8518
8638
  kind: "entry"
8519
8639
  });
8520
8640
  }
8521
- let I = F.slice(0, Math.min(Math.max(1, f), Xa)), L = (e) => {
8641
+ let I = F.slice(0, Math.min(Math.max(1, f), ro)), L = (e) => {
8522
8642
  if (y) {
8523
8643
  e.preventDefault(), T(E), j(!0);
8524
8644
  return;
@@ -8671,7 +8791,7 @@ function eo({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
8671
8791
  }
8672
8792
  //#endregion
8673
8793
  //#region ../ui/src/components/builder/apps/shop/manifest.js
8674
- var to = {
8794
+ var co = {
8675
8795
  id: "shop",
8676
8796
  label: "Shop",
8677
8797
  category: "Shop",
@@ -8686,7 +8806,7 @@ var to = {
8686
8806
  ],
8687
8807
  ssr: "shell",
8688
8808
  settings: ["shop.enabled"]
8689
- }, no = "webim.cart.", ro = "webim.currency.", io = /* @__PURE__ */ new Map(), ao = {
8809
+ }, lo = "webim.cart.", uo = "webim.currency.", fo = /* @__PURE__ */ new Map(), po = {
8690
8810
  get(e) {
8691
8811
  try {
8692
8812
  return window.localStorage.getItem(e) ?? "";
@@ -8700,7 +8820,7 @@ var to = {
8700
8820
  } catch {}
8701
8821
  }
8702
8822
  };
8703
- function oo(e) {
8823
+ function mo(e) {
8704
8824
  if (typeof window > "u") return !1;
8705
8825
  try {
8706
8826
  return new URL(e, window.location.href).origin === window.location.origin;
@@ -8708,10 +8828,10 @@ function oo(e) {
8708
8828
  return !1;
8709
8829
  }
8710
8830
  }
8711
- async function so(e, t, n, { method: r = "GET", body: i } = {}) {
8831
+ async function ho(e, t, n, { method: r = "GET", body: i } = {}) {
8712
8832
  let a = await fetch(`${e}${n}`, {
8713
8833
  method: r,
8714
- ...oo(e) ? { credentials: "include" } : {},
8834
+ ...mo(e) ? { credentials: "include" } : {},
8715
8835
  headers: {
8716
8836
  ...t ? { "x-tenant": t } : {},
8717
8837
  ...i ? { "content-type": "application/json" } : {}
@@ -8727,7 +8847,7 @@ async function so(e, t, n, { method: r = "GET", body: i } = {}) {
8727
8847
  }
8728
8848
  return o.payload;
8729
8849
  }
8730
- var co = {
8850
+ var go = {
8731
8851
  id: "",
8732
8852
  currency: "",
8733
8853
  lines: [],
@@ -8742,29 +8862,29 @@ var co = {
8742
8862
  shipping_total: 0,
8743
8863
  total: 0
8744
8864
  };
8745
- function lo(e, t) {
8746
- let n = `${no}${t || "default"}`, r = `${ro}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
8747
- cart: co,
8865
+ function _o(e, t) {
8866
+ let n = `${lo}${t || "default"}`, r = `${uo}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
8867
+ cart: go,
8748
8868
  loading: !1,
8749
8869
  loaded: !1,
8750
8870
  error: null,
8751
- currency: ao.get(r)
8871
+ currency: po.get(r)
8752
8872
  }, o = null, s = () => i.forEach((e) => e()), c = (e) => {
8753
8873
  a = {
8754
8874
  ...a,
8755
8875
  ...e
8756
8876
  }, s();
8757
- }, l = (e) => (e && typeof e == "object" && (e.id && ao.set(n, e.id), c({
8877
+ }, l = (e) => (e && typeof e == "object" && (e.id && po.set(n, e.id), c({
8758
8878
  cart: e,
8759
8879
  loaded: !0,
8760
8880
  error: null
8761
8881
  })), e), u = () => {
8762
8882
  if (o) return o;
8763
- let r = ao.get(n), i = new URLSearchParams({
8883
+ let r = po.get(n), i = new URLSearchParams({
8764
8884
  ...r ? { id: r } : {},
8765
8885
  ...a.currency ? { currency: a.currency } : {}
8766
8886
  }).toString();
8767
- return c({ loading: !0 }), o = so(e, t, `/store/cart${i ? `?${i}` : ""}`).then(l).catch((e) => c({
8887
+ return c({ loading: !0 }), o = ho(e, t, `/store/cart${i ? `?${i}` : ""}`).then(l).catch((e) => c({
8768
8888
  error: e,
8769
8889
  loaded: !0
8770
8890
  })).finally(() => {
@@ -8773,10 +8893,10 @@ function lo(e, t) {
8773
8893
  }, d = async (r, i, o) => {
8774
8894
  c({ loading: !0 });
8775
8895
  try {
8776
- return l(await so(e, t, "/store/cart", {
8896
+ return l(await ho(e, t, "/store/cart", {
8777
8897
  method: "POST",
8778
8898
  body: {
8779
- cart_id: ao.get(n) || void 0,
8899
+ cart_id: po.get(n) || void 0,
8780
8900
  product_id: r,
8781
8901
  variant_id: i ?? null,
8782
8902
  quantity: o,
@@ -8788,7 +8908,7 @@ function lo(e, t) {
8788
8908
  }
8789
8909
  };
8790
8910
  return typeof window < "u" && window.addEventListener("storage", (e) => {
8791
- e.key === r && c({ currency: ao.get(r) }), (e.key === n || e.key === r) && u();
8911
+ e.key === r && c({ currency: po.get(r) }), (e.key === n || e.key === r) && u();
8792
8912
  }), {
8793
8913
  getState: () => a,
8794
8914
  subscribe: (e) => (i.add(e), () => i.delete(e)),
@@ -8801,10 +8921,10 @@ function lo(e, t) {
8801
8921
  setCoupon: async (r) => {
8802
8922
  c({ loading: !0 });
8803
8923
  try {
8804
- return l(await so(e, t, "/store/cart/coupon", {
8924
+ return l(await ho(e, t, "/store/cart/coupon", {
8805
8925
  method: "POST",
8806
8926
  body: {
8807
- cart_id: ao.get(n),
8927
+ cart_id: po.get(n),
8808
8928
  code: r
8809
8929
  }
8810
8930
  }));
@@ -8812,64 +8932,64 @@ function lo(e, t) {
8812
8932
  c({ loading: !1 });
8813
8933
  }
8814
8934
  },
8815
- setCountry: async (r, i) => ao.get(n) ? l(await so(e, t, "/store/cart/country", {
8935
+ setCountry: async (r, i) => po.get(n) ? l(await ho(e, t, "/store/cart/country", {
8816
8936
  method: "POST",
8817
8937
  body: {
8818
- cart_id: ao.get(n),
8938
+ cart_id: po.get(n),
8819
8939
  country: r,
8820
8940
  ...i !== void 0 && { postal_code: i }
8821
8941
  }
8822
8942
  })) : a.cart,
8823
- setDelivery: async (r) => ao.get(n) ? l(await so(e, t, "/store/cart/delivery", {
8943
+ setDelivery: async (r) => po.get(n) ? l(await ho(e, t, "/store/cart/delivery", {
8824
8944
  method: "POST",
8825
8945
  body: {
8826
- cart_id: ao.get(n),
8946
+ cart_id: po.get(n),
8827
8947
  delivery: r
8828
8948
  }
8829
8949
  })) : a.cart,
8830
8950
  setCurrency: async (i) => {
8831
- if (ao.set(r, i), c({ currency: i }), !ao.get(n)) return u();
8951
+ if (po.set(r, i), c({ currency: i }), !po.get(n)) return u();
8832
8952
  try {
8833
- return l(await so(e, t, "/store/cart/currency", {
8953
+ return l(await ho(e, t, "/store/cart/currency", {
8834
8954
  method: "POST",
8835
8955
  body: {
8836
- cart_id: ao.get(n),
8956
+ cart_id: po.get(n),
8837
8957
  currency: i
8838
8958
  }
8839
8959
  }));
8840
8960
  } catch {
8841
- return ao.set(r, ""), c({ currency: "" }), u();
8961
+ return po.set(r, ""), c({ currency: "" }), u();
8842
8962
  }
8843
8963
  },
8844
8964
  reset: () => {
8845
- ao.set(n, ""), c({ cart: co });
8965
+ po.set(n, ""), c({ cart: go });
8846
8966
  },
8847
- cartId: () => ao.get(n)
8967
+ cartId: () => po.get(n)
8848
8968
  };
8849
8969
  }
8850
- function uo(e, t) {
8970
+ function vo(e, t) {
8851
8971
  let n = `${e}|${t}`;
8852
- return io.has(n) || io.set(n, lo(e, t)), io.get(n);
8972
+ return fo.has(n) || fo.set(n, _o(e, t)), fo.get(n);
8853
8973
  }
8854
- function fo(e, t) {
8974
+ function yo(e, t) {
8855
8975
  let n = Array.isArray(e?.currencies) ? e.currencies : [];
8856
8976
  return t && n.includes(t) ? t : e?.currency || "";
8857
8977
  }
8858
- var po = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
8859
- function mo(e, t = [], n = null) {
8978
+ var bo = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" ");
8979
+ function xo(e, t = [], n = null) {
8860
8980
  let r;
8861
8981
  try {
8862
8982
  r = new Intl.DisplayNames([e || "en"], { type: "region" });
8863
8983
  } catch {
8864
8984
  r = { of: (e) => e };
8865
8985
  }
8866
- let i = (n ?? po).map((e) => ({
8986
+ let i = (n ?? bo).map((e) => ({
8867
8987
  code: e,
8868
8988
  name: r.of(e) ?? e
8869
8989
  })), a = i.filter((e) => t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0)), o = i.filter((e) => !t.includes(e.code)).sort((t, n) => t.name.localeCompare(n.name, e || void 0));
8870
8990
  return [...a, ...o];
8871
8991
  }
8872
- function ho(e, t, n) {
8992
+ function So(e, t, n) {
8873
8993
  let r = t || "USD";
8874
8994
  try {
8875
8995
  let t = new Intl.NumberFormat(n || void 0, {
@@ -8881,7 +9001,7 @@ function ho(e, t, n) {
8881
9001
  return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
8882
9002
  }
8883
9003
  }
8884
- var go = {
9004
+ var Co = {
8885
9005
  en: {
8886
9006
  add: "Add to cart",
8887
9007
  adding: "Adding…",
@@ -9213,24 +9333,24 @@ var go = {
9213
9333
  no: "Hayır"
9214
9334
  }
9215
9335
  };
9216
- function _o(e) {
9217
- let t = go[String(e || "").toLowerCase().split("-")[0]] ?? go.en, n = (e, n) => {
9218
- let r = t[e] ?? go.en[e] ?? e;
9336
+ function wo(e) {
9337
+ let t = Co[String(e || "").toLowerCase().split("-")[0]] ?? Co.en, n = (e, n) => {
9338
+ let r = t[e] ?? Co.en[e] ?? e;
9219
9339
  return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
9220
9340
  };
9221
- return n.has = (e) => e in go.en, n;
9341
+ return n.has = (e) => e in Co.en, n;
9222
9342
  }
9223
- var vo = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", yo = /* @__PURE__ */ new Map();
9224
- function bo(e, t) {
9343
+ var To = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", Eo = /* @__PURE__ */ new Map();
9344
+ function Do(e, t) {
9225
9345
  let n = `${e}|${t}`;
9226
- return yo.has(n) || yo.set(n, so(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (yo.delete(n), []))), yo.get(n);
9346
+ return Eo.has(n) || Eo.set(n, ho(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (Eo.delete(n), []))), Eo.get(n);
9227
9347
  }
9228
- function xo(e) {
9348
+ function Oo(e) {
9229
9349
  let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
9230
9350
  for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
9231
9351
  return t;
9232
9352
  }
9233
- function So(e, t, n, r) {
9353
+ function ko(e, t, n, r) {
9234
9354
  let i = (e) => e != null && Number.isFinite(Number(e));
9235
9355
  if (!i(n) && !i(r)) return "";
9236
9356
  let a;
@@ -9245,7 +9365,7 @@ function So(e, t, n, r) {
9245
9365
  day: "numeric"
9246
9366
  });
9247
9367
  }
9248
- let o = a.format(xo(i(n) ? n : r)), s = a.format(xo(i(r) ? r : n));
9368
+ let o = a.format(Oo(i(n) ? n : r)), s = a.format(Oo(i(r) ? r : n));
9249
9369
  return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
9250
9370
  from: o,
9251
9371
  to: s
@@ -9253,7 +9373,7 @@ function So(e, t, n, r) {
9253
9373
  }
9254
9374
  //#endregion
9255
9375
  //#region ../ui/src/components/builder/apps/shop/engagement.jsx
9256
- var Co = "var(--page-muted, rgba(100,116,139,1))", wo = "1px solid var(--page-border, #d1d5db)", To = "var(--page-surface, #f2f2f2)", Eo = "#f59e0b", Do = {
9376
+ var Ao = "var(--page-muted, rgba(100,116,139,1))", jo = "1px solid var(--page-border, #d1d5db)", Mo = "var(--page-surface, #f2f2f2)", No = "#f59e0b", Po = {
9257
9377
  ...vn,
9258
9378
  border: 0,
9259
9379
  borderRadius: "8px",
@@ -9261,14 +9381,14 @@ var Co = "var(--page-muted, rgba(100,116,139,1))", wo = "1px solid var(--page-bo
9261
9381
  fontSize: "14px",
9262
9382
  fontWeight: 600,
9263
9383
  fontFamily: "inherit"
9264
- }, Oo = {
9265
- ...Do,
9384
+ }, Fo = {
9385
+ ...Po,
9266
9386
  backgroundColor: "transparent",
9267
9387
  color: "var(--page-text, #111827)",
9268
- border: wo
9388
+ border: jo
9269
9389
  };
9270
- function ko() {
9271
- let { tenant: e, apiUrl: t, locale: n, settings: r } = o(X), i = l(() => _o(n), [n]), a = (e) => r?.[e] !== !1;
9390
+ function Io() {
9391
+ let { tenant: e, apiUrl: t, locale: n, settings: r } = o(X), i = l(() => wo(n), [n]), a = (e) => r?.[e] !== !1;
9272
9392
  return {
9273
9393
  tenant: e,
9274
9394
  apiUrl: t || "/api",
@@ -9279,12 +9399,12 @@ function ko() {
9279
9399
  favoritesOn: a("shop.favorites"),
9280
9400
  moderated: r?.["shop.reviewModeration"] !== "auto",
9281
9401
  loginHref: () => {
9282
- let e = Ma(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
9402
+ let e = za(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
9283
9403
  return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
9284
9404
  }
9285
9405
  };
9286
9406
  }
9287
- var Ao = (e, t) => {
9407
+ var Lo = (e, t) => {
9288
9408
  try {
9289
9409
  return new Intl.NumberFormat(t || void 0, {
9290
9410
  notation: "compact",
@@ -9293,7 +9413,7 @@ var Ao = (e, t) => {
9293
9413
  } catch {
9294
9414
  return String(e);
9295
9415
  }
9296
- }, jo = (e, t) => {
9416
+ }, Ro = (e, t) => {
9297
9417
  try {
9298
9418
  return new Intl.DateTimeFormat(t || void 0, {
9299
9419
  day: "numeric",
@@ -9303,8 +9423,8 @@ var Ao = (e, t) => {
9303
9423
  } catch {
9304
9424
  return String(e).slice(0, 10);
9305
9425
  }
9306
- }, Mo = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
9307
- function No({ fill: e = 0, size: t = 16, clipId: n }) {
9426
+ }, zo = "M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z";
9427
+ function Bo({ fill: e = 0, size: t = 16, clipId: n }) {
9308
9428
  return /* @__PURE__ */ g("svg", {
9309
9429
  width: t,
9310
9430
  height: t,
@@ -9322,18 +9442,18 @@ function No({ fill: e = 0, size: t = 16, clipId: n }) {
9322
9442
  })
9323
9443
  }) }),
9324
9444
  /* @__PURE__ */ h("path", {
9325
- d: Mo,
9445
+ d: zo,
9326
9446
  fill: "var(--page-border, #d1d5db)"
9327
9447
  }),
9328
9448
  e > 0 && /* @__PURE__ */ h("path", {
9329
- d: Mo,
9330
- fill: Eo,
9449
+ d: zo,
9450
+ fill: No,
9331
9451
  clipPath: `url(#${n})`
9332
9452
  })
9333
9453
  ]
9334
9454
  });
9335
9455
  }
9336
- function Po({ value: e = 0, size: t = 16 }) {
9456
+ function Vo({ value: e = 0, size: t = 16 }) {
9337
9457
  let n = c().replace(/:/g, "");
9338
9458
  return /* @__PURE__ */ h("span", {
9339
9459
  role: "img",
@@ -9350,14 +9470,14 @@ function Po({ value: e = 0, size: t = 16 }) {
9350
9470
  2,
9351
9471
  3,
9352
9472
  4
9353
- ].map((r) => /* @__PURE__ */ h(No, {
9473
+ ].map((r) => /* @__PURE__ */ h(Bo, {
9354
9474
  fill: Math.max(0, Math.min(1, e - r)),
9355
9475
  size: t,
9356
9476
  clipId: `${n}-${r}`
9357
9477
  }, r))
9358
9478
  });
9359
9479
  }
9360
- function Fo({ value: e, onChange: t, size: n = 28, label: r }) {
9480
+ function Ho({ value: e, onChange: t, size: n = 28, label: r }) {
9361
9481
  let i = c().replace(/:/g, ""), [a, o] = d(0), s = a || e;
9362
9482
  return /* @__PURE__ */ h("span", {
9363
9483
  role: "radiogroup",
@@ -9388,7 +9508,7 @@ function Fo({ value: e, onChange: t, size: n = 28, label: r }) {
9388
9508
  cursor: "pointer",
9389
9509
  lineHeight: 0
9390
9510
  },
9391
- children: /* @__PURE__ */ h(No, {
9511
+ children: /* @__PURE__ */ h(Bo, {
9392
9512
  fill: +(s >= r),
9393
9513
  size: n,
9394
9514
  clipId: `${i}-${r}`
@@ -9396,15 +9516,15 @@ function Fo({ value: e, onChange: t, size: n = 28, label: r }) {
9396
9516
  }, r))
9397
9517
  });
9398
9518
  }
9399
- function Io(e, { inert: t }) {
9400
- let { tenant: n, apiUrl: r, favoritesOn: i } = ko(), [a, o] = d({
9519
+ function Uo(e, { inert: t }) {
9520
+ let { tenant: n, apiUrl: r, favoritesOn: i } = Io(), [a, o] = d({
9401
9521
  favorited: !1,
9402
9522
  count: null
9403
9523
  });
9404
9524
  s(() => {
9405
9525
  if (!e || !i || t) return;
9406
9526
  let a = !0;
9407
- return so(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && o(e)).catch(() => {}), () => {
9527
+ return ho(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && o(e)).catch(() => {}), () => {
9408
9528
  a = !1;
9409
9529
  };
9410
9530
  }, [
@@ -9421,7 +9541,7 @@ function Io(e, { inert: t }) {
9421
9541
  count: Math.max(0, (e.count ?? 0) + (t ? 1 : -1))
9422
9542
  }));
9423
9543
  try {
9424
- o(await so(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
9544
+ o(await ho(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
9425
9545
  method: "POST",
9426
9546
  body: { on: t }
9427
9547
  }));
@@ -9437,7 +9557,7 @@ function Io(e, { inert: t }) {
9437
9557
  toggle: c
9438
9558
  };
9439
9559
  }
9440
- var Lo = (e) => /* @__PURE__ */ h("svg", {
9560
+ var Wo = (e) => /* @__PURE__ */ h("svg", {
9441
9561
  width: "20",
9442
9562
  height: "20",
9443
9563
  viewBox: "0 0 24 24",
@@ -9450,8 +9570,8 @@ var Lo = (e) => /* @__PURE__ */ h("svg", {
9450
9570
  strokeWidth: "1.8"
9451
9571
  })
9452
9572
  });
9453
- function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9454
- let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = ko(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Io(l, { inert: t || !l }), [f, p] = d(""), m = n ? 29 : e?.rating_count ?? 0, _ = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
9573
+ function Go({ product: e, inert: t = !1, sample: n = !1 }) {
9574
+ let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Io(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Uo(l, { inert: t || !l }), [f, p] = d(""), m = n ? 29 : e?.rating_count ?? 0, _ = n ? 4.3 : Number(e?.rating_avg ?? 0), v = n ? 110 : e?.questions_count ?? 0, y = n ? 1300 : u.count ?? e?.favorites_count ?? 0, b = (e) => (n) => {
9455
9575
  n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
9456
9576
  behavior: "smooth",
9457
9577
  block: "start"
@@ -9460,7 +9580,7 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9460
9580
  if (!(t || !l)) try {
9461
9581
  await u.toggle();
9462
9582
  } catch (e) {
9463
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(vo(i, e));
9583
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(To(i, e));
9464
9584
  }
9465
9585
  }, S = [];
9466
9586
  return a && m > 0 && S.push(/* @__PURE__ */ g("span", {
@@ -9478,13 +9598,13 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9478
9598
  maximumFractionDigits: 1
9479
9599
  })
9480
9600
  }),
9481
- /* @__PURE__ */ h(Po, { value: _ }),
9601
+ /* @__PURE__ */ h(Vo, { value: _ }),
9482
9602
  /* @__PURE__ */ h("a", {
9483
9603
  href: "#reviews",
9484
9604
  onClick: b("reviews"),
9485
9605
  ...Z("rating-link"),
9486
9606
  style: { color: "inherit" },
9487
- children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Ao(m, r) })
9607
+ children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Lo(m, r) })
9488
9608
  })
9489
9609
  ]
9490
9610
  }, "r")), o && v > 0 && S.push(/* @__PURE__ */ h("a", {
@@ -9492,7 +9612,7 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9492
9612
  onClick: b("questions"),
9493
9613
  ...Z("qa-link"),
9494
9614
  style: { color: "inherit" },
9495
- children: i("qaCount", { n: Ao(v, r) })
9615
+ children: i("qaCount", { n: Lo(v, r) })
9496
9616
  }, "q")), !S.length && !s ? null : /* @__PURE__ */ g("div", {
9497
9617
  ...Z("engagement"),
9498
9618
  style: {
@@ -9511,7 +9631,7 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9511
9631
  },
9512
9632
  children: S.flatMap((e, t) => t ? [/* @__PURE__ */ h("span", {
9513
9633
  ...Z("separator"),
9514
- style: { color: Co },
9634
+ style: { color: Ao },
9515
9635
  children: "•"
9516
9636
  }, `s${t}`), e] : [e])
9517
9637
  }),
@@ -9529,22 +9649,22 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9529
9649
  "aria-label": u.favorited ? i("unfavorite") : i("favorite"),
9530
9650
  title: u.favorited ? i("unfavorite") : i("favorite"),
9531
9651
  style: {
9532
- ...Oo,
9652
+ ...Fo,
9533
9653
  padding: "7px",
9534
9654
  borderRadius: "999px",
9535
9655
  lineHeight: 0
9536
9656
  },
9537
- children: Lo(u.favorited)
9657
+ children: Wo(u.favorited)
9538
9658
  }), y > 0 && /* @__PURE__ */ h("span", {
9539
9659
  ...Z("favorites-count"),
9540
9660
  style: { fontWeight: 600 },
9541
- children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Ao(y, r) })
9661
+ children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Lo(y, r) })
9542
9662
  })]
9543
9663
  }),
9544
9664
  f && /* @__PURE__ */ h("span", {
9545
9665
  ...Z("note"),
9546
9666
  style: {
9547
- color: Co,
9667
+ color: Ao,
9548
9668
  fontSize: "13px"
9549
9669
  },
9550
9670
  children: f
@@ -9552,7 +9672,7 @@ function Ro({ product: e, inert: t = !1, sample: n = !1 }) {
9552
9672
  ]
9553
9673
  });
9554
9674
  }
9555
- var zo = {
9675
+ var Ko = {
9556
9676
  data: [{
9557
9677
  id: "s1",
9558
9678
  author: "Ayşe Y.",
@@ -9588,8 +9708,8 @@ var zo = {
9588
9708
  ]
9589
9709
  }
9590
9710
  };
9591
- function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9592
- let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } = ko(), f = Ia(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, _] = d(null), [v, y] = d("newest"), [b, x] = d(0), [S, C] = d(5), [w, T] = d(0), [E, D] = d({
9711
+ function qo({ product: e, inert: t = !1, sample: n = !1 }) {
9712
+ let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: c, moderated: l, loginHref: u } = Io(), f = Ua(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, _] = d(null), [v, y] = d("newest"), [b, x] = d(0), [S, C] = d(5), [w, T] = d(0), [E, D] = d({
9593
9713
  rating: 0,
9594
9714
  title: "",
9595
9715
  body: ""
@@ -9597,7 +9717,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9597
9717
  if (s(() => {
9598
9718
  if (!c || !p) return;
9599
9719
  let e = !0, t = `?limit=${S}&sort=${v}${b ? `&rating=${b}` : ""}`;
9600
- return so(i, r, `/store/products/${encodeURIComponent(p)}/reviews${t}`).then((t) => e && _(t)).catch(() => e && _({
9720
+ return ho(i, r, `/store/products/${encodeURIComponent(p)}/reviews${t}`).then((t) => e && _(t)).catch(() => e && _({
9601
9721
  data: [],
9602
9722
  total: {
9603
9723
  all: 0,
@@ -9627,7 +9747,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9627
9747
  w,
9628
9748
  c
9629
9749
  ]), !c) return null;
9630
- let P = n || !p ? zo : m, F = P?.summary ?? {
9750
+ let P = n || !p ? Ko : m, F = P?.summary ?? {
9631
9751
  average: 0,
9632
9752
  count: 0,
9633
9753
  histogram: [
@@ -9660,12 +9780,12 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9660
9780
  }
9661
9781
  j(!0), N("");
9662
9782
  try {
9663
- await so(i, r, `/store/products/${encodeURIComponent(p)}/reviews`, {
9783
+ await ho(i, r, `/store/products/${encodeURIComponent(p)}/reviews`, {
9664
9784
  method: "POST",
9665
9785
  body: E
9666
9786
  }), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
9667
9787
  } catch (e) {
9668
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(vo(o, e));
9788
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(To(o, e));
9669
9789
  } finally {
9670
9790
  j(!1);
9671
9791
  }
@@ -9717,14 +9837,14 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9717
9837
  maximumFractionDigits: 1
9718
9838
  }) : "–"
9719
9839
  }),
9720
- /* @__PURE__ */ h(Po, {
9840
+ /* @__PURE__ */ h(Vo, {
9721
9841
  value: F.average,
9722
9842
  size: 18
9723
9843
  }),
9724
9844
  /* @__PURE__ */ h("span", {
9725
9845
  ...Z("reviews-count"),
9726
9846
  style: {
9727
- color: Co,
9847
+ color: Ao,
9728
9848
  fontSize: "13px"
9729
9849
  },
9730
9850
  children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
@@ -9776,7 +9896,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9776
9896
  style: {
9777
9897
  height: "8px",
9778
9898
  borderRadius: "4px",
9779
- background: To,
9899
+ background: Mo,
9780
9900
  overflow: "hidden"
9781
9901
  },
9782
9902
  children: /* @__PURE__ */ h("span", {
@@ -9785,13 +9905,13 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9785
9905
  display: "block",
9786
9906
  height: "100%",
9787
9907
  width: `${n / B * 100}%`,
9788
- background: Eo
9908
+ background: No
9789
9909
  }
9790
9910
  })
9791
9911
  }),
9792
9912
  /* @__PURE__ */ h("span", {
9793
9913
  style: {
9794
- color: Co,
9914
+ color: Ao,
9795
9915
  textAlign: "right"
9796
9916
  },
9797
9917
  children: n
@@ -9806,7 +9926,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9806
9926
  type: "button",
9807
9927
  onClick: R,
9808
9928
  ...Z("review-button"),
9809
- style: Do,
9929
+ style: Po,
9810
9930
  children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
9811
9931
  })
9812
9932
  })
@@ -9820,7 +9940,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9820
9940
  flexDirection: "column",
9821
9941
  gap: "10px",
9822
9942
  padding: "16px",
9823
- border: wo,
9943
+ border: jo,
9824
9944
  borderRadius: "12px"
9825
9945
  },
9826
9946
  children: [
@@ -9832,7 +9952,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9832
9952
  gap: "12px",
9833
9953
  fontWeight: 600
9834
9954
  },
9835
- children: [o("yourRating"), /* @__PURE__ */ h(Fo, {
9955
+ children: [o("yourRating"), /* @__PURE__ */ h(Ho, {
9836
9956
  value: E.rating,
9837
9957
  label: o("yourRating"),
9838
9958
  onChange: (e) => D((t) => ({
@@ -9877,13 +9997,13 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9877
9997
  type: "submit",
9878
9998
  disabled: A,
9879
9999
  ...Z("submit-button"),
9880
- style: Do,
10000
+ style: Po,
9881
10001
  children: o("submitReview")
9882
10002
  }), /* @__PURE__ */ h("button", {
9883
10003
  type: "button",
9884
10004
  onClick: () => k(!1),
9885
10005
  ...Z("cancel-button"),
9886
- style: Oo,
10006
+ style: Fo,
9887
10007
  children: "✕"
9888
10008
  })]
9889
10009
  })
@@ -9893,7 +10013,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9893
10013
  ...Z("note"),
9894
10014
  style: {
9895
10015
  margin: 0,
9896
- color: Co
10016
+ color: Ao
9897
10017
  },
9898
10018
  children: M
9899
10019
  }),
@@ -9937,7 +10057,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9937
10057
  onClick: () => x(0),
9938
10058
  ...Z("filter-chip"),
9939
10059
  style: {
9940
- ...Oo,
10060
+ ...Fo,
9941
10061
  padding: "6px 12px"
9942
10062
  },
9943
10063
  children: [o("starsN", { n: b }), " ✕"]
@@ -9947,7 +10067,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9947
10067
  ...Z("empty"),
9948
10068
  style: {
9949
10069
  margin: 0,
9950
- color: Co
10070
+ color: Ao
9951
10071
  },
9952
10072
  children: o("noReviews")
9953
10073
  }),
@@ -9960,7 +10080,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9960
10080
  ...Z("review"),
9961
10081
  style: {
9962
10082
  padding: "16px 0",
9963
- borderTop: wo,
10083
+ borderTop: jo,
9964
10084
  display: "flex",
9965
10085
  flexDirection: "column",
9966
10086
  gap: "6px"
@@ -9974,7 +10094,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9974
10094
  flexWrap: "wrap"
9975
10095
  },
9976
10096
  children: [
9977
- /* @__PURE__ */ h(Po, { value: e.rating }),
10097
+ /* @__PURE__ */ h(Vo, { value: e.rating }),
9978
10098
  e.title && /* @__PURE__ */ h("strong", {
9979
10099
  ...Z("review-title"),
9980
10100
  children: e.title
@@ -9985,8 +10105,8 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
9985
10105
  fontSize: "12px",
9986
10106
  padding: "2px 8px",
9987
10107
  borderRadius: "999px",
9988
- background: To,
9989
- color: Co
10108
+ background: Mo,
10109
+ color: Ao
9990
10110
  },
9991
10111
  children: o("awaitingApproval")
9992
10112
  })
@@ -10005,12 +10125,12 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
10005
10125
  ...Z("meta"),
10006
10126
  style: {
10007
10127
  fontSize: "13px",
10008
- color: Co
10128
+ color: Ao
10009
10129
  },
10010
10130
  children: [
10011
10131
  e.author || o("anonymous"),
10012
10132
  " · ",
10013
- jo(e.created_at, a),
10133
+ Ro(e.created_at, a),
10014
10134
  e.verified && /* @__PURE__ */ g("span", {
10015
10135
  ...Z("verified"),
10016
10136
  style: {
@@ -10027,7 +10147,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
10027
10147
  marginTop: "4px",
10028
10148
  padding: "10px 12px",
10029
10149
  borderRadius: "8px",
10030
- background: To,
10150
+ background: Mo,
10031
10151
  fontSize: "14px"
10032
10152
  },
10033
10153
  children: [/* @__PURE__ */ h("strong", {
@@ -10035,7 +10155,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
10035
10155
  style: {
10036
10156
  display: "block",
10037
10157
  fontSize: "12px",
10038
- color: Co,
10158
+ color: Ao,
10039
10159
  marginBottom: "2px"
10040
10160
  },
10041
10161
  children: o("shopReply")
@@ -10052,7 +10172,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
10052
10172
  onClick: () => C((e) => e + 10),
10053
10173
  ...Z("load-more"),
10054
10174
  style: {
10055
- ...Oo,
10175
+ ...Fo,
10056
10176
  alignSelf: "center"
10057
10177
  },
10058
10178
  children: o("loadMore")
@@ -10060,7 +10180,7 @@ function Bo({ product: e, inert: t = !1, sample: n = !1 }) {
10060
10180
  ]
10061
10181
  });
10062
10182
  }
10063
- var Vo = {
10183
+ var Jo = {
10064
10184
  data: [{
10065
10185
  id: "q1",
10066
10186
  author: "Can D.",
@@ -10073,12 +10193,12 @@ var Vo = {
10073
10193
  filtered: 1
10074
10194
  }
10075
10195
  };
10076
- function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10077
- let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } = ko(), u = Ia(), f = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = d(null), [_, v] = d(5), [y, b] = d(0), [x, S] = d(""), [C, w] = d(!1), [T, E] = d("");
10196
+ function Yo({ product: e, inert: t = !1, sample: n = !1 }) {
10197
+ let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: c, loginHref: l } = Io(), u = Ua(), f = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = d(null), [_, v] = d(5), [y, b] = d(0), [x, S] = d(""), [C, w] = d(!1), [T, E] = d("");
10078
10198
  if (s(() => {
10079
10199
  if (!c || !f) return;
10080
10200
  let e = !0;
10081
- return so(i, r, `/store/products/${encodeURIComponent(f)}/questions?limit=${_}`).then((t) => e && m(t)).catch(() => e && m({
10201
+ return ho(i, r, `/store/products/${encodeURIComponent(f)}/questions?limit=${_}`).then((t) => e && m(t)).catch(() => e && m({
10082
10202
  data: [],
10083
10203
  total: {
10084
10204
  all: 0,
@@ -10095,7 +10215,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10095
10215
  y,
10096
10216
  c
10097
10217
  ]), !c) return null;
10098
- let D = n || !f ? Vo : p, O = u.status === "user", k = async (e) => {
10218
+ let D = n || !f ? Jo : p, O = u.status === "user", k = async (e) => {
10099
10219
  if (e.preventDefault(), !(t || x.trim().length < 3)) {
10100
10220
  if (!O) {
10101
10221
  window.location.assign(l());
@@ -10103,12 +10223,12 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10103
10223
  }
10104
10224
  w(!0), E("");
10105
10225
  try {
10106
- await so(i, r, `/store/products/${encodeURIComponent(f)}/questions`, {
10226
+ await ho(i, r, `/store/products/${encodeURIComponent(f)}/questions`, {
10107
10227
  method: "POST",
10108
10228
  body: { question: x.trim() }
10109
10229
  }), S(""), E(o("questionPending")), b((e) => e + 1);
10110
10230
  } catch (e) {
10111
- e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(vo(o, e));
10231
+ e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(To(o, e));
10112
10232
  } finally {
10113
10233
  w(!1);
10114
10234
  }
@@ -10154,7 +10274,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10154
10274
  type: "submit",
10155
10275
  disabled: C || x.trim().length < 3,
10156
10276
  ...Z("submit-button"),
10157
- style: Do,
10277
+ style: Po,
10158
10278
  children: o("submitQuestion")
10159
10279
  })]
10160
10280
  }) : /* @__PURE__ */ h("p", {
@@ -10170,7 +10290,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10170
10290
  ...Z("note"),
10171
10291
  style: {
10172
10292
  margin: 0,
10173
- color: Co
10293
+ color: Ao
10174
10294
  },
10175
10295
  children: T
10176
10296
  }),
@@ -10178,7 +10298,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10178
10298
  ...Z("empty"),
10179
10299
  style: {
10180
10300
  margin: 0,
10181
- color: Co
10301
+ color: Ao
10182
10302
  },
10183
10303
  children: o("noQuestions")
10184
10304
  }),
@@ -10191,7 +10311,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10191
10311
  ...Z("question"),
10192
10312
  style: {
10193
10313
  padding: "14px 0",
10194
- borderTop: wo,
10314
+ borderTop: jo,
10195
10315
  display: "flex",
10196
10316
  flexDirection: "column",
10197
10317
  gap: "6px"
@@ -10232,7 +10352,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10232
10352
  ...Z("badge"),
10233
10353
  style: {
10234
10354
  fontSize: "12px",
10235
- color: Co
10355
+ color: Ao
10236
10356
  },
10237
10357
  children: o("awaitingAnswer")
10238
10358
  }),
@@ -10240,12 +10360,12 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10240
10360
  ...Z("meta"),
10241
10361
  style: {
10242
10362
  fontSize: "12px",
10243
- color: Co
10363
+ color: Ao
10244
10364
  },
10245
10365
  children: [
10246
10366
  e.author || o("anonymous"),
10247
10367
  " · ",
10248
- jo(e.created_at, a)
10368
+ Ro(e.created_at, a)
10249
10369
  ]
10250
10370
  })
10251
10371
  ]
@@ -10256,7 +10376,7 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10256
10376
  onClick: () => v((e) => e + 10),
10257
10377
  ...Z("load-more"),
10258
10378
  style: {
10259
- ...Oo,
10379
+ ...Fo,
10260
10380
  alignSelf: "center"
10261
10381
  },
10262
10382
  children: o("loadMore")
@@ -10266,8 +10386,8 @@ function Ho({ product: e, inert: t = !1, sample: n = !1 }) {
10266
10386
  }
10267
10387
  //#endregion
10268
10388
  //#region ../ui/src/components/builder/apps/shop/specs.jsx
10269
- var Uo = "1px solid var(--page-border, #d1d5db)", Wo = "var(--page-muted, rgba(100,116,139,1))", Go = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
10270
- function Ko(e, t, n, r) {
10389
+ var Xo = "1px solid var(--page-border, #d1d5db)", Zo = "var(--page-muted, rgba(100,116,139,1))", Qo = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
10390
+ function $o(e, t, n, r) {
10271
10391
  let i = n || void 0;
10272
10392
  switch (e.type) {
10273
10393
  case "integer":
@@ -10290,7 +10410,7 @@ function Ko(e, t, n, r) {
10290
10410
  gap: "6px"
10291
10411
  },
10292
10412
  children: [
10293
- n === 5 && /* @__PURE__ */ h(Po, { value: Number(t) }),
10413
+ n === 5 && /* @__PURE__ */ h(Vo, { value: Number(t) }),
10294
10414
  Number(t).toLocaleString(i),
10295
10415
  " / ",
10296
10416
  n
@@ -10322,12 +10442,12 @@ function Ko(e, t, n, r) {
10322
10442
  height: "14px",
10323
10443
  borderRadius: "4px",
10324
10444
  background: t,
10325
- border: Uo,
10445
+ border: Xo,
10326
10446
  display: "inline-block"
10327
10447
  } }), t]
10328
10448
  });
10329
10449
  case "link": {
10330
- let e = Go(t);
10450
+ let e = Qo(t);
10331
10451
  return e ? /* @__PURE__ */ h("a", {
10332
10452
  href: e,
10333
10453
  target: "_blank",
@@ -10336,7 +10456,7 @@ function Ko(e, t, n, r) {
10336
10456
  children: t
10337
10457
  }) : String(t);
10338
10458
  }
10339
- case "image": return Go(t) ? /* @__PURE__ */ h("img", {
10459
+ case "image": return Qo(t) ? /* @__PURE__ */ h("img", {
10340
10460
  src: t,
10341
10461
  alt: e.name,
10342
10462
  style: {
@@ -10347,14 +10467,14 @@ function Ko(e, t, n, r) {
10347
10467
  }
10348
10468
  }) : "";
10349
10469
  case "video":
10350
- case "file": return Go(t) ? /* @__PURE__ */ h("a", {
10470
+ case "file": return Qo(t) ? /* @__PURE__ */ h("a", {
10351
10471
  href: t,
10352
10472
  target: "_blank",
10353
10473
  rel: "noopener noreferrer",
10354
10474
  style: { color: "var(--page-accent, #111827)" },
10355
10475
  children: String(t).split("/").pop()
10356
10476
  }) : "";
10357
- case "media": return (Array.isArray(t) ? t : [t]).filter(Go).map((e, t) => /* @__PURE__ */ h("a", {
10477
+ case "media": return (Array.isArray(t) ? t : [t]).filter(Qo).map((e, t) => /* @__PURE__ */ h("a", {
10358
10478
  href: e,
10359
10479
  target: "_blank",
10360
10480
  rel: "noopener noreferrer",
@@ -10394,7 +10514,7 @@ function Ko(e, t, n, r) {
10394
10514
  default: return String(t);
10395
10515
  }
10396
10516
  }
10397
- function qo({ specs: e, locale: t, words: n }) {
10517
+ function es({ specs: e, locale: t, words: n }) {
10398
10518
  return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ g("section", {
10399
10519
  ...Z("specs"),
10400
10520
  style: {
@@ -10413,7 +10533,7 @@ function qo({ specs: e, locale: t, words: n }) {
10413
10533
  role: "table",
10414
10534
  ...Z("specs-table"),
10415
10535
  style: {
10416
- border: Uo,
10536
+ border: Xo,
10417
10537
  borderRadius: "10px",
10418
10538
  overflow: "hidden"
10419
10539
  },
@@ -10427,13 +10547,13 @@ function qo({ specs: e, locale: t, words: n }) {
10427
10547
  gridTemplateColumns: "minmax(120px, 34%) 1fr",
10428
10548
  gap: "16px",
10429
10549
  padding: "10px 14px",
10430
- borderTop: r ? Uo : 0,
10550
+ borderTop: r ? Xo : 0,
10431
10551
  fontSize: "14px"
10432
10552
  },
10433
10553
  children: [/* @__PURE__ */ h("span", {
10434
10554
  role: "rowheader",
10435
10555
  ...Z("spec-name"),
10436
- style: { color: Wo },
10556
+ style: { color: Zo },
10437
10557
  children: e.name
10438
10558
  }), /* @__PURE__ */ h("span", {
10439
10559
  role: "cell",
@@ -10444,7 +10564,7 @@ function qo({ specs: e, locale: t, words: n }) {
10444
10564
  gap: "4px 10px",
10445
10565
  alignItems: "center"
10446
10566
  },
10447
- children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [Ko(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
10567
+ children: i.map((r, a) => /* @__PURE__ */ g("span", { children: [$o(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
10448
10568
  })]
10449
10569
  }, e.key);
10450
10570
  })
@@ -10453,7 +10573,7 @@ function qo({ specs: e, locale: t, words: n }) {
10453
10573
  }
10454
10574
  //#endregion
10455
10575
  //#region ../ui/src/components/builder/apps/shop/views.jsx
10456
- var $ = "var(--page-muted, rgba(100,116,139,1))", Jo = "1px solid var(--page-border, #d1d5db)", Yo = "var(--page-surface, #f2f2f2)", Xo = {
10576
+ var $ = "var(--page-muted, rgba(100,116,139,1))", ts = "1px solid var(--page-border, #d1d5db)", ns = "var(--page-surface, #f2f2f2)", rs = {
10457
10577
  ...vn,
10458
10578
  border: 0,
10459
10579
  borderRadius: "8px",
@@ -10462,14 +10582,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", Jo = "1px solid var(--page-bor
10462
10582
  fontWeight: 600,
10463
10583
  fontFamily: "inherit",
10464
10584
  textAlign: "center"
10465
- }, Zo = {
10466
- ...Xo,
10585
+ }, is = {
10586
+ ...rs,
10467
10587
  backgroundColor: "transparent",
10468
10588
  color: "var(--page-text, #111827)",
10469
- border: Jo
10589
+ border: ts
10470
10590
  };
10471
- function Qo() {
10472
- let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(X), s = l(() => _o(n), [n]), c = i?.["shop.orderPrefix"], u = i?.["shop.orderSuffix"], d = a((e) => `${typeof c == "string" ? c : "#"}${e}${typeof u == "string" ? u : ""}`, [c, u]);
10591
+ function as() {
10592
+ let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = o(X), s = l(() => wo(n), [n]), c = i?.["shop.orderPrefix"], u = i?.["shop.orderSuffix"], d = a((e) => `${typeof c == "string" ? c : "#"}${e}${typeof u == "string" ? u : ""}`, [c, u]);
10473
10593
  return {
10474
10594
  tenant: e,
10475
10595
  apiUrl: t || "/api",
@@ -10479,8 +10599,8 @@ function Qo() {
10479
10599
  orderId: d
10480
10600
  };
10481
10601
  }
10482
- function $o(e, t, n = !0) {
10483
- let r = l(() => uo(e, t), [e, t]), i = f(r.subscribe, r.getState, r.getState);
10602
+ function os(e, t, n = !0) {
10603
+ let r = l(() => vo(e, t), [e, t]), i = f(r.subscribe, r.getState, r.getState);
10484
10604
  return s(() => {
10485
10605
  n && !i.loaded && !i.loading && r.load();
10486
10606
  }, [n, r]), {
@@ -10488,8 +10608,8 @@ function $o(e, t, n = !0) {
10488
10608
  ...i
10489
10609
  };
10490
10610
  }
10491
- var es = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
10492
- function ts({ value: e, label: t, onCommit: n }) {
10611
+ var ss = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
10612
+ function cs({ value: e, label: t, onCommit: n }) {
10493
10613
  let [r, i] = d(null), a = () => {
10494
10614
  if (r === null) return;
10495
10615
  let t = Math.max(1, Math.round(Number(r)) || 1);
@@ -10513,12 +10633,12 @@ function ts({ value: e, label: t, onCommit: n }) {
10513
10633
  }
10514
10634
  });
10515
10635
  }
10516
- var ns = "/product/{slug}", rs = (e) => !e || e === "/product?product={slug}" ? ns : e, is = (e, t) => String(rs(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
10517
- function as(e) {
10636
+ var ls = "/product/{slug}", us = (e) => !e || e === "/product?product={slug}" ? ls : e, ds = (e, t) => String(us(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
10637
+ function fs(e) {
10518
10638
  let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
10519
10639
  return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
10520
10640
  }
10521
- function os({ product: e, variant: t, locale: n, size: r = 16 }) {
10641
+ function ps({ product: e, variant: t, locale: n, size: r = 16 }) {
10522
10642
  let i = e.currency, a = t?.price ?? e.price;
10523
10643
  return /* @__PURE__ */ g("span", {
10524
10644
  ...Z("price"),
@@ -10531,7 +10651,7 @@ function os({ product: e, variant: t, locale: n, size: r = 16 }) {
10531
10651
  children: [/* @__PURE__ */ h("span", {
10532
10652
  ...Z("price-current"),
10533
10653
  style: { fontWeight: 700 },
10534
- children: ho(a, i, n)
10654
+ children: So(a, i, n)
10535
10655
  }), e.compare_at_price > a && /* @__PURE__ */ h("span", {
10536
10656
  ...Z("price-old"),
10537
10657
  style: {
@@ -10539,11 +10659,11 @@ function os({ product: e, variant: t, locale: n, size: r = 16 }) {
10539
10659
  textDecoration: "line-through",
10540
10660
  fontSize: "0.85em"
10541
10661
  },
10542
- children: ho(e.compare_at_price, i, n)
10662
+ children: So(e.compare_at_price, i, n)
10543
10663
  })]
10544
10664
  });
10545
10665
  }
10546
- var ss = [
10666
+ var ms = [
10547
10667
  1,
10548
10668
  2,
10549
10669
  3
@@ -10559,17 +10679,17 @@ var ss = [
10559
10679
  currency: "USD",
10560
10680
  sample: !0
10561
10681
  }));
10562
- function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: c = "", source: l = "catalog", loginHref: u = "", style: f, nodeRef: p, inert: m = !1, sample: _ = !1, noNavigate: v = !1 }) {
10563
- let { tenant: y, apiUrl: b, locale: x, words: S } = Qo(), C = ko(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: P, currency: F } = $o(b, y, !m), I = l === "favorites";
10682
+ function hs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: c = "", source: l = "catalog", loginHref: u = "", style: f, nodeRef: p, inert: m = !1, sample: _ = !1, noNavigate: v = !1 }) {
10683
+ let { tenant: y, apiUrl: b, locale: x, words: S } = as(), C = Io(), [w, T] = d(null), [E, D] = d(null), [O, k] = d(""), [A, j] = d({}), [M, N] = d(!1), { store: P, currency: F } = os(b, y, !m), I = l === "favorites";
10564
10684
  s(() => {
10565
10685
  let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `&currency=${encodeURIComponent(F)}` : "";
10566
10686
  if (I && m) {
10567
10687
  T([]);
10568
10688
  return;
10569
10689
  }
10570
- return N(!1), Promise.all([so(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), so(b, y, "/store/config")]).then(([t, n]) => {
10690
+ return N(!1), Promise.all([ho(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${c ? `&collection=${encodeURIComponent(c)}` : ""}`), ho(b, y, "/store/config")]).then(([t, n]) => {
10571
10691
  if (!e) return;
10572
- let r = fo(n, F);
10692
+ let r = yo(n, F);
10573
10693
  D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
10574
10694
  ...e,
10575
10695
  currency: r
@@ -10588,7 +10708,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10588
10708
  I,
10589
10709
  m
10590
10710
  ]);
10591
- let L = w?.length || !_ ? w ?? [] : ss, R = async (e) => {
10711
+ let L = w?.length || !_ ? w ?? [] : ms, R = async (e) => {
10592
10712
  if (!(m || e.sample)) {
10593
10713
  k(e.id);
10594
10714
  try {
@@ -10599,7 +10719,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10599
10719
  } catch (t) {
10600
10720
  j((n) => ({
10601
10721
  ...n,
10602
- [e.id]: vo(S, t)
10722
+ [e.id]: To(S, t)
10603
10723
  }));
10604
10724
  } finally {
10605
10725
  k("");
@@ -10644,7 +10764,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10644
10764
  gap: `${n}px`
10645
10765
  },
10646
10766
  children: L.map((e) => {
10647
- let t = as(e) === 0, n = is(r, e);
10767
+ let t = fs(e) === 0, n = ds(r, e);
10648
10768
  return /* @__PURE__ */ g("div", {
10649
10769
  ...Z("card"),
10650
10770
  style: {
@@ -10667,7 +10787,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10667
10787
  aspectRatio: "1 / 1",
10668
10788
  borderRadius: "10px",
10669
10789
  overflow: "hidden",
10670
- background: Yo
10790
+ background: ns
10671
10791
  },
10672
10792
  children: e.images?.[0] && /* @__PURE__ */ h("img", {
10673
10793
  src: e.images[0],
@@ -10700,16 +10820,16 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10700
10820
  color: $
10701
10821
  },
10702
10822
  children: [
10703
- /* @__PURE__ */ h(Po, {
10823
+ /* @__PURE__ */ h(Vo, {
10704
10824
  value: Number(e.rating_avg),
10705
10825
  size: 14
10706
10826
  }),
10707
10827
  "(",
10708
- Ao(e.rating_count, x),
10828
+ Lo(e.rating_count, x),
10709
10829
  ")"
10710
10830
  ]
10711
10831
  }),
10712
- /* @__PURE__ */ h(os, {
10832
+ /* @__PURE__ */ h(ps, {
10713
10833
  product: e,
10714
10834
  locale: x
10715
10835
  }),
@@ -10718,7 +10838,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10718
10838
  onClick: v ? (e) => e.preventDefault() : void 0,
10719
10839
  ...Z("choose-button"),
10720
10840
  style: {
10721
- ...Zo,
10841
+ ...is,
10722
10842
  display: "block"
10723
10843
  },
10724
10844
  children: S("choose")
@@ -10728,7 +10848,7 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10728
10848
  onClick: () => R(e),
10729
10849
  ...Z("add-button", t && "add-button-sold-out"),
10730
10850
  style: {
10731
- ...Xo,
10851
+ ...rs,
10732
10852
  opacity: t ? .5 : 1
10733
10853
  },
10734
10854
  children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
@@ -10748,24 +10868,24 @@ function cs({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
10748
10868
  ]
10749
10869
  });
10750
10870
  }
10751
- function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: c = !1, sample: l = !1, noNavigate: u = !1 }) {
10752
- let { tenant: f, apiUrl: p, locale: m, param: _, words: v } = Qo(), [y, b] = d(null), [x, S] = d(!1), [C, w] = d(0), [T, E] = d(""), [D, O] = d(1), [k, A] = d(!1), [j, M] = d(""), { store: N, currency: P } = $o(p, f, !c), F = e || _ || es("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
10871
+ function gs({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: c = !1, sample: l = !1, noNavigate: u = !1 }) {
10872
+ let { tenant: f, apiUrl: p, locale: m, param: _, words: v } = as(), [y, b] = d(null), [x, S] = d(!1), [C, w] = d(0), [T, E] = d(""), [D, O] = d(1), [k, A] = d(!1), [j, M] = d(""), { store: N, currency: P } = os(p, f, !c), F = e || _ || ss("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
10753
10873
  if (s(() => {
10754
10874
  let e = !0;
10755
10875
  return S(!1), (async () => {
10756
- let t = await so(p, f, "/store/config"), n = F ? await so(p, f, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await so(p, f, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
10876
+ let t = await ho(p, f, "/store/config"), n = F ? await ho(p, f, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await ho(p, f, `/store/products?limit=1${P ? `&currency=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
10757
10877
  if (e) {
10758
10878
  if (!n) {
10759
- S(!0), b(l ? ss[0] : null);
10879
+ S(!0), b(l ? ms[0] : null);
10760
10880
  return;
10761
10881
  }
10762
10882
  b({
10763
10883
  ...n,
10764
- currency: fo(t, P)
10884
+ currency: yo(t, P)
10765
10885
  }), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
10766
10886
  }
10767
10887
  })().catch(() => {
10768
- e && (S(!0), b(l ? ss[0] : null));
10888
+ e && (S(!0), b(l ? ms[0] : null));
10769
10889
  }), () => {
10770
10890
  e = !1;
10771
10891
  };
@@ -10792,7 +10912,7 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10792
10912
  try {
10793
10913
  await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
10794
10914
  } catch (e) {
10795
- M(vo(v, e));
10915
+ M(To(v, e));
10796
10916
  } finally {
10797
10917
  A(!1);
10798
10918
  }
@@ -10827,7 +10947,7 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10827
10947
  aspectRatio: "1 / 1",
10828
10948
  borderRadius: "12px",
10829
10949
  overflow: "hidden",
10830
- background: Yo
10950
+ background: ns
10831
10951
  },
10832
10952
  children: y.images?.[C] && /* @__PURE__ */ h("img", {
10833
10953
  src: y.images[C],
@@ -10858,8 +10978,8 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10858
10978
  borderRadius: "8px",
10859
10979
  overflow: "hidden",
10860
10980
  cursor: "pointer",
10861
- border: t === C ? "2px solid var(--page-accent, #111827)" : Jo,
10862
- background: Yo
10981
+ border: t === C ? "2px solid var(--page-accent, #111827)" : ts,
10982
+ background: ns
10863
10983
  },
10864
10984
  children: /* @__PURE__ */ h("img", {
10865
10985
  src: e,
@@ -10890,12 +11010,12 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10890
11010
  },
10891
11011
  children: y.name
10892
11012
  }),
10893
- /* @__PURE__ */ h(Ro, {
11013
+ /* @__PURE__ */ h(Go, {
10894
11014
  product: y,
10895
11015
  inert: c,
10896
11016
  sample: l && !!y.sample
10897
11017
  }),
10898
- /* @__PURE__ */ h(os, {
11018
+ /* @__PURE__ */ h(ps, {
10899
11019
  product: y,
10900
11020
  variant: L,
10901
11021
  locale: m,
@@ -10916,7 +11036,7 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10916
11036
  onClick: () => E(e.id),
10917
11037
  ...Z("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
10918
11038
  style: {
10919
- ...Zo,
11039
+ ...is,
10920
11040
  padding: "8px 14px",
10921
11041
  opacity: t ? .45 : 1,
10922
11042
  textDecoration: t ? "line-through" : "none",
@@ -10951,7 +11071,7 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10951
11071
  onClick: B,
10952
11072
  ...Z("add-button", z && "add-button-sold-out"),
10953
11073
  style: {
10954
- ...Xo,
11074
+ ...rs,
10955
11075
  flex: 1,
10956
11076
  opacity: z ? .5 : 1
10957
11077
  },
@@ -10982,17 +11102,17 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
10982
11102
  ]
10983
11103
  })]
10984
11104
  }),
10985
- i && /* @__PURE__ */ h(qo, {
11105
+ i && /* @__PURE__ */ h(es, {
10986
11106
  specs: y.specs,
10987
11107
  locale: m,
10988
11108
  words: v
10989
11109
  }),
10990
- n && /* @__PURE__ */ h(Bo, {
11110
+ n && /* @__PURE__ */ h(qo, {
10991
11111
  product: y,
10992
11112
  inert: c,
10993
11113
  sample: l && !!y.sample
10994
11114
  }),
10995
- r && /* @__PURE__ */ h(Ho, {
11115
+ r && /* @__PURE__ */ h(Yo, {
10996
11116
  product: y,
10997
11117
  inert: c,
10998
11118
  sample: l && !!y.sample
@@ -11000,13 +11120,13 @@ function ls({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
11000
11120
  ]
11001
11121
  });
11002
11122
  }
11003
- function us(e) {
11004
- return /* @__PURE__ */ h(cs, {
11123
+ function _s(e) {
11124
+ return /* @__PURE__ */ h(hs, {
11005
11125
  ...e,
11006
11126
  source: "favorites"
11007
11127
  });
11008
11128
  }
11009
- var ds = /* @__PURE__ */ g("svg", {
11129
+ var vs = /* @__PURE__ */ g("svg", {
11010
11130
  width: "20",
11011
11131
  height: "20",
11012
11132
  viewBox: "0 0 24 24",
@@ -11019,8 +11139,8 @@ var ds = /* @__PURE__ */ g("svg", {
11019
11139
  ...Z("icon"),
11020
11140
  children: [/* @__PURE__ */ h("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ h("path", { d: "M9 7a3 3 0 0 1 6 0" })]
11021
11141
  });
11022
- function fs({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
11023
- let { tenant: c, apiUrl: l, words: u } = Qo(), { cart: d } = $o(l, c, !a), f = o && !d.count ? 2 : d.count;
11142
+ function ys({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
11143
+ let { tenant: c, apiUrl: l, words: u } = as(), { cart: d } = os(l, c, !a), f = o && !d.count ? 2 : d.count;
11024
11144
  return /* @__PURE__ */ g("a", {
11025
11145
  ref: i,
11026
11146
  href: e,
@@ -11037,7 +11157,7 @@ function fs({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
11037
11157
  ...G(r)
11038
11158
  },
11039
11159
  children: [
11040
- ds,
11160
+ vs,
11041
11161
  n && /* @__PURE__ */ h("span", {
11042
11162
  ...Z("label"),
11043
11163
  children: t || u("cart")
@@ -11065,7 +11185,7 @@ function fs({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
11065
11185
  ]
11066
11186
  });
11067
11187
  }
11068
- function ps(e, t, n) {
11188
+ function bs(e, t, n) {
11069
11189
  if (t === "code") return e;
11070
11190
  try {
11071
11191
  if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
@@ -11078,8 +11198,8 @@ function ps(e, t, n) {
11078
11198
  return e;
11079
11199
  }
11080
11200
  }
11081
- function ms({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
11082
- let { tenant: a, apiUrl: o, locale: c } = Qo(), { store: l, currency: u } = $o(o, a, !i), [f, p] = d(null), m = {
11201
+ function xs({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
11202
+ let { tenant: a, apiUrl: o, locale: c } = as(), { store: l, currency: u } = os(o, a, !i), [f, p] = d(null), m = {
11083
11203
  display: "inline-flex",
11084
11204
  alignItems: "center",
11085
11205
  gap: 8,
@@ -11087,7 +11207,7 @@ function ms({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
11087
11207
  };
11088
11208
  s(() => {
11089
11209
  let e = !0;
11090
- return so(o, a, "/store/config").then((t) => e && p(t)).catch(() => e && p({ currencies: [] })), () => {
11210
+ return ho(o, a, "/store/config").then((t) => e && p(t)).catch(() => e && p({ currencies: [] })), () => {
11091
11211
  e = !1;
11092
11212
  };
11093
11213
  }, [o, a]);
@@ -11113,7 +11233,7 @@ function ms({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
11113
11233
  }) : null, /* @__PURE__ */ h("select", {
11114
11234
  "aria-label": t || "Currency",
11115
11235
  ...Z("select"),
11116
- value: fo(f, u),
11236
+ value: yo(f, u),
11117
11237
  onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === f.currency ? "" : e.target.value),
11118
11238
  onKeyDown: i ? (e) => e.preventDefault() : void 0,
11119
11239
  style: {
@@ -11127,24 +11247,24 @@ function ms({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
11127
11247
  },
11128
11248
  children: _.map((t) => /* @__PURE__ */ h("option", {
11129
11249
  value: t,
11130
- children: ps(t, e, c)
11250
+ children: bs(t, e, c)
11131
11251
  }, t))
11132
11252
  })]
11133
11253
  });
11134
11254
  }
11135
- var hs = {
11255
+ var Ss = {
11136
11256
  display: "flex",
11137
11257
  flexDirection: "column",
11138
11258
  gap: "6px",
11139
11259
  fontSize: "13px"
11140
- }, gs = {
11260
+ }, Cs = {
11141
11261
  margin: "0 0 12px",
11142
11262
  fontSize: "18px"
11143
11263
  };
11144
- function _s({ label: e, required: t, children: n }) {
11264
+ function ws({ label: e, required: t, children: n }) {
11145
11265
  return /* @__PURE__ */ g("label", {
11146
11266
  ...Z("field"),
11147
- style: hs,
11267
+ style: Ss,
11148
11268
  children: [/* @__PURE__ */ g("span", {
11149
11269
  ...Z("field-label"),
11150
11270
  style: { fontWeight: 500 },
@@ -11156,7 +11276,7 @@ function _s({ label: e, required: t, children: n }) {
11156
11276
  }), n]
11157
11277
  });
11158
11278
  }
11159
- var vs = [{
11279
+ var Ts = [{
11160
11280
  id: "ship:standard",
11161
11281
  type: "shipping",
11162
11282
  name: "Standard",
@@ -11172,7 +11292,7 @@ var vs = [{
11172
11292
  min_days: null,
11173
11293
  max_days: null,
11174
11294
  detail: "Main Street 1"
11175
- }], ys = {
11295
+ }], Es = {
11176
11296
  name: "",
11177
11297
  email: "",
11178
11298
  phone: "",
@@ -11187,25 +11307,25 @@ var vs = [{
11187
11307
  recipient: "",
11188
11308
  gift_message: ""
11189
11309
  };
11190
- function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
11191
- let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = Qo(), { store: m, cart: _, loaded: v } = $o(c, o, !r), [y, b] = d(null), [x, S] = d(ys), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, P] = d(!1), F = !r && es("cancelled") === "1", I = (e) => ho(e, _.currency || y?.currency, u);
11310
+ function Ds({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
11311
+ let { tenant: o, apiUrl: c, locale: u, words: f, orderId: p } = as(), { store: m, cart: _, loaded: v } = os(c, o, !r), [y, b] = d(null), [x, S] = d(Es), [C, w] = d(""), [T, E] = d(!1), [D, O] = d(""), [k, A] = d(null), [j, M] = d(""), [N, P] = d(!1), F = !r && ss("cancelled") === "1", I = (e) => So(e, _.currency || y?.currency, u);
11192
11312
  s(() => {
11193
- so(c, o, "/store/config").then((e) => {
11313
+ ho(c, o, "/store/config").then((e) => {
11194
11314
  b(e), w((t) => t || e?.methods?.[0] || "");
11195
11315
  }).catch(() => b({
11196
11316
  enabled: !1,
11197
11317
  methods: []
11198
11318
  }));
11199
11319
  }, [c, o]), s(() => {
11200
- let e = es("order");
11201
- r || !e || F || so(c, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
11320
+ let e = ss("order");
11321
+ r || !e || F || ho(c, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
11202
11322
  A(e), e?.payment_status === "paid" && m.reset();
11203
- }).catch((e) => O(vo(f, e)));
11323
+ }).catch((e) => O(To(f, e)));
11204
11324
  }, [c, o]);
11205
11325
  let L = (e) => (t) => S((n) => ({
11206
11326
  ...n,
11207
11327
  [e]: t.target.value
11208
- })), R = l(() => mo(u, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [u, y]);
11328
+ })), R = l(() => xo(u, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [u, y]);
11209
11329
  s(() => {
11210
11330
  _.country && !x.country && S((e) => ({
11211
11331
  ...e,
@@ -11218,7 +11338,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11218
11338
  try {
11219
11339
  await m.setCoupon(e), M("");
11220
11340
  } catch (e) {
11221
- O(vo(f, e));
11341
+ O(To(f, e));
11222
11342
  } finally {
11223
11343
  P(!1);
11224
11344
  }
@@ -11243,7 +11363,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11243
11363
  "paid",
11244
11364
  "cancelled"
11245
11365
  ].forEach((t) => e.searchParams.delete(t));
11246
- let t = await so(c, o, "/store/checkout", {
11366
+ let t = await ho(c, o, "/store/checkout", {
11247
11367
  method: "POST",
11248
11368
  body: {
11249
11369
  cart_id: m.cartId(),
@@ -11275,13 +11395,13 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11275
11395
  }
11276
11396
  A(t?.order ?? null), m.reset();
11277
11397
  } catch (e) {
11278
- O(vo(f, e));
11398
+ O(To(f, e));
11279
11399
  } finally {
11280
11400
  E(!1);
11281
11401
  }
11282
11402
  }
11283
- }, V = { ...G(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, U = Array.isArray(_.discounts) ? _.discounts : [], W = U.filter((e) => e.type !== "shipping"), K = U.find((e) => e.type === "shipping") ?? null, ee = r && i && !_.lines.length ? vs : Array.isArray(_.delivery_options) ? _.delivery_options : [], q = ee.find((e) => e.id === _.delivery) ?? (r && i ? ee[0] : null), J = q?.type === "pickup", te = (e) => {
11284
- r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(vo(f, e))));
11403
+ }, V = { ...G(t) }, H = r && i && !_.lines.length ? !0 : _.requires_shipping !== !1, U = Array.isArray(_.discounts) ? _.discounts : [], W = U.filter((e) => e.type !== "shipping"), K = U.find((e) => e.type === "shipping") ?? null, ee = r && i && !_.lines.length ? Ts : Array.isArray(_.delivery_options) ? _.delivery_options : [], q = ee.find((e) => e.id === _.delivery) ?? (r && i ? ee[0] : null), J = q?.type === "pickup", te = (e) => {
11404
+ r || e === _.delivery || (O(""), m.setDelivery(e).catch((e) => O(To(f, e))));
11285
11405
  };
11286
11406
  if (k) {
11287
11407
  let t = k.payment_status === "paid";
@@ -11309,7 +11429,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11309
11429
  style: {
11310
11430
  padding: "12px",
11311
11431
  borderRadius: "8px",
11312
- background: Yo
11432
+ background: ns
11313
11433
  },
11314
11434
  children: Bn(k.instructions_content)
11315
11435
  }) : k.instructions ? /* @__PURE__ */ h("pre", {
@@ -11318,7 +11438,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11318
11438
  margin: 0,
11319
11439
  padding: "12px",
11320
11440
  borderRadius: "8px",
11321
- background: Yo,
11441
+ background: ns,
11322
11442
  whiteSpace: "pre-wrap",
11323
11443
  fontFamily: "inherit"
11324
11444
  },
@@ -11329,7 +11449,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11329
11449
  style: {
11330
11450
  padding: "12px",
11331
11451
  borderRadius: "8px",
11332
- background: Yo
11452
+ background: ns
11333
11453
  },
11334
11454
  children: [
11335
11455
  /* @__PURE__ */ h("div", {
@@ -11353,13 +11473,13 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11353
11473
  /* @__PURE__ */ h("div", { children: f("pickupNote") })
11354
11474
  ]
11355
11475
  }),
11356
- !k.delivery.location && So(f, u, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ h("div", {
11476
+ !k.delivery.location && ko(f, u, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ h("div", {
11357
11477
  ...Z("delivery-detail"),
11358
11478
  style: {
11359
11479
  fontSize: "14px",
11360
11480
  color: $
11361
11481
  },
11362
- children: So(f, u, k.delivery.min_days, k.delivery.max_days)
11482
+ children: ko(f, u, k.delivery.min_days, k.delivery.max_days)
11363
11483
  })
11364
11484
  ]
11365
11485
  }),
@@ -11372,14 +11492,14 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11372
11492
  children: [
11373
11493
  f("total"),
11374
11494
  ": ",
11375
- ho(k.total, k.currency, u)
11495
+ So(k.total, k.currency, u)
11376
11496
  ]
11377
11497
  }),
11378
- !t && /* @__PURE__ */ h(Ts, {
11498
+ !t && /* @__PURE__ */ h(Ms, {
11379
11499
  reference: k.transfer_reference,
11380
11500
  words: f
11381
11501
  }),
11382
- /* @__PURE__ */ h(Es, {
11502
+ /* @__PURE__ */ h(Ns, {
11383
11503
  downloads: k.downloads,
11384
11504
  apiUrl: c,
11385
11505
  words: f,
@@ -11391,7 +11511,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11391
11511
  onClick: a ? (e) => e.preventDefault() : void 0,
11392
11512
  ...Z("continue-button"),
11393
11513
  style: {
11394
- ...Zo,
11514
+ ...is,
11395
11515
  alignSelf: "flex-start"
11396
11516
  },
11397
11517
  children: f("continue")
@@ -11399,7 +11519,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11399
11519
  ]
11400
11520
  });
11401
11521
  }
11402
- let ne = r && i && !_.lines.length ? ss.slice(0, 2).map((e) => ({
11522
+ let ne = r && i && !_.lines.length ? ms.slice(0, 2).map((e) => ({
11403
11523
  ...e,
11404
11524
  product_id: e.id,
11405
11525
  variant_id: null,
@@ -11445,7 +11565,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11445
11565
  onClick: a ? (e) => e.preventDefault() : void 0,
11446
11566
  ...Z("continue-button"),
11447
11567
  style: {
11448
- ...Zo,
11568
+ ...is,
11449
11569
  alignSelf: "flex-start"
11450
11570
  },
11451
11571
  children: f("continue")
@@ -11483,7 +11603,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11483
11603
  ...Z("section"),
11484
11604
  children: [/* @__PURE__ */ h("h3", {
11485
11605
  ...Z("heading"),
11486
- style: gs,
11606
+ style: Cs,
11487
11607
  children: f("contact")
11488
11608
  }), /* @__PURE__ */ g("div", {
11489
11609
  ...Z("fields"),
@@ -11491,7 +11611,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11491
11611
  display: "grid",
11492
11612
  gap: "12px"
11493
11613
  },
11494
- children: [/* @__PURE__ */ h(_s, {
11614
+ children: [/* @__PURE__ */ h(ws, {
11495
11615
  label: f("name"),
11496
11616
  required: !0,
11497
11617
  children: /* @__PURE__ */ h("input", {
@@ -11508,7 +11628,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11508
11628
  gridTemplateColumns: "1fr 1fr",
11509
11629
  gap: "12px"
11510
11630
  },
11511
- children: [/* @__PURE__ */ h(_s, {
11631
+ children: [/* @__PURE__ */ h(ws, {
11512
11632
  label: f("email"),
11513
11633
  required: !0,
11514
11634
  children: /* @__PURE__ */ h("input", {
@@ -11519,7 +11639,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11519
11639
  onChange: L("email"),
11520
11640
  autoComplete: "email"
11521
11641
  })
11522
- }), /* @__PURE__ */ h(_s, {
11642
+ }), /* @__PURE__ */ h(ws, {
11523
11643
  label: f("phone"),
11524
11644
  children: /* @__PURE__ */ h("input", {
11525
11645
  type: "tel",
@@ -11538,7 +11658,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11538
11658
  children: [
11539
11659
  /* @__PURE__ */ h("h3", {
11540
11660
  ...Z("heading"),
11541
- style: gs,
11661
+ style: Cs,
11542
11662
  children: f("delivery")
11543
11663
  }),
11544
11664
  /* @__PURE__ */ h("div", {
@@ -11550,17 +11670,17 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11550
11670
  gridTemplateColumns: "1fr 1fr",
11551
11671
  gap: "12px"
11552
11672
  },
11553
- children: [/* @__PURE__ */ h(_s, {
11673
+ children: [/* @__PURE__ */ h(ws, {
11554
11674
  label: f("postal"),
11555
11675
  children: /* @__PURE__ */ h("input", {
11556
11676
  ...Z("input"),
11557
11677
  style: Q,
11558
11678
  value: x.postal_code,
11559
11679
  onChange: L("postal_code"),
11560
- onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(vo(f, e))),
11680
+ onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(To(f, e))),
11561
11681
  autoComplete: "postal-code"
11562
11682
  })
11563
- }), /* @__PURE__ */ h(_s, {
11683
+ }), /* @__PURE__ */ h(ws, {
11564
11684
  label: f("country"),
11565
11685
  required: !J,
11566
11686
  children: /* @__PURE__ */ g("select", {
@@ -11573,7 +11693,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11573
11693
  S((e) => ({
11574
11694
  ...e,
11575
11695
  country: t
11576
- })), r || m.setCountry(t, x.postal_code).catch((e) => O(vo(f, e)));
11696
+ })), r || m.setCountry(t, x.postal_code).catch((e) => O(To(f, e)));
11577
11697
  },
11578
11698
  children: [/* @__PURE__ */ h("option", {
11579
11699
  value: "",
@@ -11602,7 +11722,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11602
11722
  gap: "8px"
11603
11723
  },
11604
11724
  children: ee.map((e) => {
11605
- let t = So(f, u, e.min_days, e.max_days);
11725
+ let t = ko(f, u, e.min_days, e.max_days);
11606
11726
  return /* @__PURE__ */ g("label", {
11607
11727
  ...Z("delivery-option", q?.id === e.id && "delivery-option-selected"),
11608
11728
  style: {
@@ -11611,7 +11731,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11611
11731
  gap: "10px",
11612
11732
  padding: "12px",
11613
11733
  borderRadius: "8px",
11614
- border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : Jo,
11734
+ border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : ts,
11615
11735
  cursor: "pointer"
11616
11736
  },
11617
11737
  children: [
@@ -11674,7 +11794,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11674
11794
  ...Z("section"),
11675
11795
  children: [/* @__PURE__ */ h("h3", {
11676
11796
  ...Z("heading"),
11677
- style: gs,
11797
+ style: Cs,
11678
11798
  children: f("address")
11679
11799
  }), /* @__PURE__ */ g("div", {
11680
11800
  ...Z("fields"),
@@ -11683,7 +11803,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11683
11803
  gap: "12px"
11684
11804
  },
11685
11805
  children: [
11686
- /* @__PURE__ */ h(_s, {
11806
+ /* @__PURE__ */ h(ws, {
11687
11807
  label: f("line1"),
11688
11808
  required: !0,
11689
11809
  children: /* @__PURE__ */ h("input", {
@@ -11694,7 +11814,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11694
11814
  autoComplete: "address-line1"
11695
11815
  })
11696
11816
  }),
11697
- /* @__PURE__ */ h(_s, {
11817
+ /* @__PURE__ */ h(ws, {
11698
11818
  label: f("line2"),
11699
11819
  children: /* @__PURE__ */ h("input", {
11700
11820
  ...Z("input"),
@@ -11711,7 +11831,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11711
11831
  gridTemplateColumns: "1fr 1fr",
11712
11832
  gap: "12px"
11713
11833
  },
11714
- children: [/* @__PURE__ */ h(_s, {
11834
+ children: [/* @__PURE__ */ h(ws, {
11715
11835
  label: f("city"),
11716
11836
  required: !0,
11717
11837
  children: /* @__PURE__ */ h("input", {
@@ -11721,7 +11841,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11721
11841
  onChange: L("city"),
11722
11842
  autoComplete: "address-level2"
11723
11843
  })
11724
- }), /* @__PURE__ */ h(_s, {
11844
+ }), /* @__PURE__ */ h(ws, {
11725
11845
  label: f("region"),
11726
11846
  children: /* @__PURE__ */ h("input", {
11727
11847
  ...Z("input"),
@@ -11732,7 +11852,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11732
11852
  })
11733
11853
  })]
11734
11854
  }),
11735
- /* @__PURE__ */ h(_s, {
11855
+ /* @__PURE__ */ h(ws, {
11736
11856
  label: f("note"),
11737
11857
  children: /* @__PURE__ */ h("textarea", {
11738
11858
  rows: 2,
@@ -11787,7 +11907,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11787
11907
  display: "grid",
11788
11908
  gap: "12px"
11789
11909
  },
11790
- children: [H && !J && /* @__PURE__ */ h(_s, {
11910
+ children: [H && !J && /* @__PURE__ */ h(ws, {
11791
11911
  label: f("giftRecipient"),
11792
11912
  children: /* @__PURE__ */ h("input", {
11793
11913
  ...Z("input"),
@@ -11797,7 +11917,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11797
11917
  maxLength: 200,
11798
11918
  autoComplete: "off"
11799
11919
  })
11800
- }), /* @__PURE__ */ h(_s, {
11920
+ }), /* @__PURE__ */ h(ws, {
11801
11921
  label: f("giftMessage"),
11802
11922
  children: /* @__PURE__ */ h("textarea", {
11803
11923
  rows: 3,
@@ -11818,7 +11938,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11818
11938
  children: [
11819
11939
  /* @__PURE__ */ h("h3", {
11820
11940
  ...Z("heading"),
11821
- style: gs,
11941
+ style: Cs,
11822
11942
  children: f("payment")
11823
11943
  }),
11824
11944
  !ie.length && !r && /* @__PURE__ */ h("p", {
@@ -11843,7 +11963,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11843
11963
  gap: "10px",
11844
11964
  padding: "12px",
11845
11965
  borderRadius: "8px",
11846
- border: Jo,
11966
+ border: ts,
11847
11967
  cursor: "pointer"
11848
11968
  },
11849
11969
  children: [/* @__PURE__ */ h("input", {
@@ -11870,13 +11990,13 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11870
11990
  gap: "14px",
11871
11991
  padding: "20px",
11872
11992
  borderRadius: "12px",
11873
- background: Yo
11993
+ background: ns
11874
11994
  },
11875
11995
  children: [
11876
11996
  /* @__PURE__ */ h("h3", {
11877
11997
  ...Z("summary-title"),
11878
11998
  style: {
11879
- ...gs,
11999
+ ...Cs,
11880
12000
  margin: 0
11881
12001
  },
11882
12002
  children: f("cart")
@@ -11939,13 +12059,13 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11939
12059
  gap: "8px",
11940
12060
  marginTop: "4px"
11941
12061
  },
11942
- children: [/* @__PURE__ */ h(ts, {
12062
+ children: [/* @__PURE__ */ h(cs, {
11943
12063
  value: e.quantity,
11944
12064
  label: f("quantity"),
11945
- onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(vo(f, e)))
12065
+ onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(To(f, e)))
11946
12066
  }), /* @__PURE__ */ h("button", {
11947
12067
  type: "button",
11948
- onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(vo(f, e))),
12068
+ onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(To(f, e))),
11949
12069
  ...Z("remove-button"),
11950
12070
  style: {
11951
12071
  background: "none",
@@ -11995,7 +12115,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
11995
12115
  style: {
11996
12116
  padding: "4px 10px",
11997
12117
  borderRadius: "999px",
11998
- border: Jo,
12118
+ border: ts,
11999
12119
  fontWeight: 600,
12000
12120
  letterSpacing: "0.04em"
12001
12121
  },
@@ -12043,7 +12163,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12043
12163
  onClick: () => z(j.trim()),
12044
12164
  ...Z("coupon-button"),
12045
12165
  style: {
12046
- ...Zo,
12166
+ ...is,
12047
12167
  padding: "8px 14px"
12048
12168
  },
12049
12169
  children: f("apply")
@@ -12060,7 +12180,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12060
12180
  /* @__PURE__ */ g("div", {
12061
12181
  ...Z("totals"),
12062
12182
  style: {
12063
- borderTop: Jo,
12183
+ borderTop: ts,
12064
12184
  paddingTop: "12px",
12065
12185
  display: "grid",
12066
12186
  gap: "6px",
@@ -12175,13 +12295,13 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12175
12295
  ...Z("submit-button"),
12176
12296
  disabled: T || !C || _.shipping_available === !1,
12177
12297
  style: {
12178
- ...Xo,
12298
+ ...rs,
12179
12299
  width: "100%",
12180
12300
  padding: "12px"
12181
12301
  },
12182
12302
  children: f(T ? "placing" : "placeOrder")
12183
12303
  }),
12184
- /* @__PURE__ */ h(Ss, {
12304
+ /* @__PURE__ */ h(ks, {
12185
12305
  apiUrl: c,
12186
12306
  tenant: o,
12187
12307
  words: f,
@@ -12193,7 +12313,7 @@ function bs({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
12193
12313
  })]
12194
12314
  });
12195
12315
  }
12196
- var xs = [
12316
+ var Os = [
12197
12317
  "refund",
12198
12318
  "privacy",
12199
12319
  "terms",
@@ -12204,12 +12324,12 @@ var xs = [
12204
12324
  fields: {},
12205
12325
  updated_at: null
12206
12326
  }));
12207
- function Ss({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
12208
- let [o, c] = d(i ? xs : []), [l, u] = d(null);
12327
+ function ks({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
12328
+ let [o, c] = d(i ? Os : []), [l, u] = d(null);
12209
12329
  if (s(() => {
12210
12330
  if (i) return;
12211
12331
  let n = !0;
12212
- return bo(e, t).then((e) => n && c(e)), () => {
12332
+ return Do(e, t).then((e) => n && c(e)), () => {
12213
12333
  n = !1;
12214
12334
  };
12215
12335
  }, [
@@ -12252,12 +12372,12 @@ function Ss({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
12252
12372
  display: "flex",
12253
12373
  flexWrap: "wrap",
12254
12374
  gap: "6px 14px",
12255
- borderTop: Jo,
12375
+ borderTop: ts,
12256
12376
  paddingTop: "10px"
12257
12377
  },
12258
12378
  children: o.map(m)
12259
12379
  }),
12260
- l && /* @__PURE__ */ h(Cs, {
12380
+ l && /* @__PURE__ */ h(As, {
12261
12381
  policy: l,
12262
12382
  words: n,
12263
12383
  locale: r,
@@ -12266,7 +12386,7 @@ function Ss({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
12266
12386
  ]
12267
12387
  });
12268
12388
  }
12269
- function Cs({ policy: e, words: t, locale: n, onClose: r }) {
12389
+ function As({ policy: e, words: t, locale: n, onClose: r }) {
12270
12390
  s(() => {
12271
12391
  let e = (e) => {
12272
12392
  e.key === "Escape" && r();
@@ -12304,7 +12424,7 @@ function Cs({ policy: e, words: t, locale: n, onClose: r }) {
12304
12424
  style: {
12305
12425
  background: "var(--page-bg, #fff)",
12306
12426
  color: "var(--page-text, #111827)",
12307
- border: Jo,
12427
+ border: ts,
12308
12428
  borderRadius: "12px",
12309
12429
  width: "min(720px, 100%)",
12310
12430
  maxHeight: "85vh",
@@ -12319,7 +12439,7 @@ function Cs({ policy: e, words: t, locale: n, onClose: r }) {
12319
12439
  alignItems: "center",
12320
12440
  gap: "12px",
12321
12441
  padding: "16px 20px",
12322
- borderBottom: Jo
12442
+ borderBottom: ts
12323
12443
  },
12324
12444
  children: [/* @__PURE__ */ h("strong", {
12325
12445
  ...Z("modal-title"),
@@ -12334,7 +12454,7 @@ function Cs({ policy: e, words: t, locale: n, onClose: r }) {
12334
12454
  "aria-label": t("close"),
12335
12455
  ...Z("modal-close"),
12336
12456
  style: {
12337
- ...Zo,
12457
+ ...is,
12338
12458
  padding: "4px 10px"
12339
12459
  },
12340
12460
  children: "×"
@@ -12388,12 +12508,12 @@ function Cs({ policy: e, words: t, locale: n, onClose: r }) {
12388
12508
  })
12389
12509
  });
12390
12510
  }
12391
- var ws = {
12511
+ var js = {
12392
12512
  year: "numeric",
12393
12513
  month: "short",
12394
12514
  day: "numeric"
12395
12515
  };
12396
- function Ts({ reference: e, words: t }) {
12516
+ function Ms({ reference: e, words: t }) {
12397
12517
  let [n, r] = d(!1);
12398
12518
  if (!e) return null;
12399
12519
  let i = () => {
@@ -12441,7 +12561,7 @@ function Ts({ reference: e, words: t }) {
12441
12561
  onClick: i,
12442
12562
  ...Z("copy-button"),
12443
12563
  style: {
12444
- ...Zo,
12564
+ ...is,
12445
12565
  padding: "6px 12px"
12446
12566
  },
12447
12567
  children: t(n ? "copied" : "copy")
@@ -12458,7 +12578,7 @@ function Ts({ reference: e, words: t }) {
12458
12578
  ]
12459
12579
  });
12460
12580
  }
12461
- function Es({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12581
+ function Ns({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12462
12582
  let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
12463
12583
  if (!a.length) return null;
12464
12584
  let o = (e) => {
@@ -12488,7 +12608,7 @@ function Es({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12488
12608
  alignItems: "center",
12489
12609
  gap: "12px",
12490
12610
  padding: "10px 12px",
12491
- border: Jo,
12611
+ border: ts,
12492
12612
  borderRadius: "8px"
12493
12613
  },
12494
12614
  children: [/* @__PURE__ */ g("div", {
@@ -12518,7 +12638,7 @@ function Es({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12518
12638
  onClick: i ? (e) => e.preventDefault() : void 0,
12519
12639
  ...Z("download-button"),
12520
12640
  style: {
12521
- ...Xo,
12641
+ ...rs,
12522
12642
  padding: "6px 14px",
12523
12643
  textDecoration: "none",
12524
12644
  fontSize: "14px"
@@ -12536,7 +12656,7 @@ function Es({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
12536
12656
  })]
12537
12657
  });
12538
12658
  }
12539
- function Ds({ tracking: e, words: t, noNavigate: n }) {
12659
+ function Ps({ tracking: e, words: t, noNavigate: n }) {
12540
12660
  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 : "";
12541
12661
  return !r && !i && !a ? null : /* @__PURE__ */ g("div", {
12542
12662
  ...Z("tracking"),
@@ -12571,12 +12691,12 @@ function Ds({ tracking: e, words: t, noNavigate: n }) {
12571
12691
  ]
12572
12692
  });
12573
12693
  }
12574
- function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
12575
- let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = Qo(), [m, _] = d(null), [v, y] = d(!1), [b, x] = d("");
12694
+ function Fs({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
12695
+ let { tenant: c, apiUrl: l, locale: u, words: f, orderId: p } = as(), [m, _] = d(null), [v, y] = d(!1), [b, x] = d("");
12576
12696
  s(() => {
12577
12697
  if (i) return;
12578
12698
  let e = !0;
12579
- return so(l, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && _(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
12699
+ return ho(l, c, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && _(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
12580
12700
  e && (y(t?.code === "LOGIN_REQUIRED"), _([]));
12581
12701
  }), () => {
12582
12702
  e = !1;
@@ -12607,7 +12727,7 @@ function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12607
12727
  items: []
12608
12728
  }] : m ?? [], C = (e) => {
12609
12729
  try {
12610
- return new Intl.DateTimeFormat(u || void 0, ws).format(new Date(e));
12730
+ return new Intl.DateTimeFormat(u || void 0, js).format(new Date(e));
12611
12731
  } catch {
12612
12732
  return String(e).slice(0, 10);
12613
12733
  }
@@ -12650,7 +12770,7 @@ function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12650
12770
  S.map((e) => /* @__PURE__ */ g("div", {
12651
12771
  ...Z("order", b === e.id && "order-open"),
12652
12772
  style: {
12653
- border: Jo,
12773
+ border: ts,
12654
12774
  borderRadius: "10px",
12655
12775
  overflow: "hidden"
12656
12776
  },
@@ -12691,13 +12811,13 @@ function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12691
12811
  fontSize: "13px",
12692
12812
  padding: "2px 10px",
12693
12813
  borderRadius: "999px",
12694
- background: Yo
12814
+ background: ns
12695
12815
  },
12696
12816
  children: [f(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${f(`pay_${e.payment_status}`)}`]
12697
12817
  }),
12698
12818
  /* @__PURE__ */ h("strong", {
12699
12819
  ...Z("order-total"),
12700
- children: ho(e.total, e.currency, u)
12820
+ children: So(e.total, e.currency, u)
12701
12821
  })
12702
12822
  ]
12703
12823
  }), b === e.id && e.items?.length > 0 && /* @__PURE__ */ g("div", {
@@ -12727,19 +12847,19 @@ function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12727
12847
  })
12728
12848
  ] }), /* @__PURE__ */ h("span", {
12729
12849
  ...Z("order-item-price"),
12730
- children: ho(t.total, e.currency, u)
12850
+ children: So(t.total, e.currency, u)
12731
12851
  })]
12732
12852
  }, t.id)),
12733
- e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(Ts, {
12853
+ e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ h(Ms, {
12734
12854
  reference: e.transfer_reference,
12735
12855
  words: f
12736
12856
  }),
12737
- /* @__PURE__ */ h(Ds, {
12857
+ /* @__PURE__ */ h(Ps, {
12738
12858
  tracking: e.tracking,
12739
12859
  words: f,
12740
12860
  noNavigate: o
12741
12861
  }),
12742
- /* @__PURE__ */ h(Es, {
12862
+ /* @__PURE__ */ h(Ns, {
12743
12863
  downloads: e.downloads,
12744
12864
  apiUrl: l,
12745
12865
  words: f,
@@ -12754,21 +12874,21 @@ function Os({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
12754
12874
  }
12755
12875
  //#endregion
12756
12876
  //#region ../ui/src/components/builder/apps/language/views.jsx
12757
- function ks(e) {
12877
+ function Is(e) {
12758
12878
  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());
12759
12879
  return [...new Set(n.map((e) => e.trim()))];
12760
12880
  }
12761
- var As = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
12762
- function js(e, t) {
12881
+ var Ls = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
12882
+ function Rs(e, t) {
12763
12883
  let n = String(e ?? "").toUpperCase();
12764
12884
  if (t === "code") return n;
12765
12885
  let r = "";
12766
12886
  try {
12767
- r = As(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
12887
+ r = Ls(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
12768
12888
  } catch {}
12769
12889
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
12770
12890
  }
12771
- function Ms(e, t) {
12891
+ function zs(e, t) {
12772
12892
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
12773
12893
  if (typeof window > "u") return n || "?";
12774
12894
  try {
@@ -12778,8 +12898,8 @@ function Ms(e, t) {
12778
12898
  return n || "/";
12779
12899
  }
12780
12900
  }
12781
- function Ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
12782
- let l = o(X), u = ks(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
12901
+ function Bs({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: s, inert: c }) {
12902
+ let l = o(X), u = Is(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
12783
12903
  display: "inline-flex",
12784
12904
  alignItems: "center",
12785
12905
  gap: 8,
@@ -12817,7 +12937,7 @@ function Ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
12817
12937
  children: n ?? "·"
12818
12938
  }), /* @__PURE__ */ h("a", {
12819
12939
  ...Z("link", e === f && "link-current"),
12820
- href: Ms(e, e === d),
12940
+ href: zs(e, e === d),
12821
12941
  hrefLang: e,
12822
12942
  "aria-current": e === f ? "true" : void 0,
12823
12943
  onClick: c ? (e) => e.preventDefault() : void 0,
@@ -12827,7 +12947,7 @@ function Ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
12827
12947
  textDecoration: "none",
12828
12948
  cursor: c ? "default" : "pointer"
12829
12949
  },
12830
- children: js(e, t)
12950
+ children: Rs(e, t)
12831
12951
  })]
12832
12952
  }, e))]
12833
12953
  }) : /* @__PURE__ */ g("div", {
@@ -12839,7 +12959,7 @@ function Ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
12839
12959
  value: f,
12840
12960
  onChange: c ? void 0 : (e) => {
12841
12961
  let t = e.target.value;
12842
- window.location.assign(Ms(t, t === d));
12962
+ window.location.assign(zs(t, t === d));
12843
12963
  },
12844
12964
  onKeyDown: c ? (e) => e.preventDefault() : void 0,
12845
12965
  style: {
@@ -12855,54 +12975,54 @@ function Ns({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
12855
12975
  ...Z("option", e === f && "option-current"),
12856
12976
  key: e,
12857
12977
  value: e
12858
- }, js(e, t)))
12978
+ }, Rs(e, t)))
12859
12979
  })]
12860
12980
  });
12861
12981
  }
12862
12982
  //#endregion
12863
12983
  //#region ../ui/src/components/builder/apps/index.js
12864
- var Ps = [
12865
- ka,
12984
+ var Vs = [
12985
+ Ia,
12986
+ to,
12866
12987
  Ja,
12867
- Va,
12868
- Ya,
12869
- to
12870
- ], Fs = {
12871
- SiteLoginForm: za,
12872
- SiteAccountMenu: Ba,
12873
- SiteLanguagePicker: Ns,
12874
- CookieConsent: qa,
12875
- SiteSearch: eo,
12876
- ShopProductGrid: cs,
12877
- ShopProduct: ls,
12878
- ShopCartButton: fs,
12879
- ShopCheckout: bs,
12880
- ShopOrderHistory: Os,
12881
- ShopCurrencyPicker: ms,
12882
- ShopFavorites: us
12988
+ no,
12989
+ co
12990
+ ], Hs = {
12991
+ SiteLoginForm: Ka,
12992
+ SiteAccountMenu: qa,
12993
+ SiteLanguagePicker: Bs,
12994
+ CookieConsent: eo,
12995
+ SiteSearch: so,
12996
+ ShopProductGrid: hs,
12997
+ ShopProduct: gs,
12998
+ ShopCartButton: ys,
12999
+ ShopCheckout: Ds,
13000
+ ShopOrderHistory: Fs,
13001
+ ShopCurrencyPicker: xs,
13002
+ ShopFavorites: _s
12883
13003
  };
12884
- new Set(Ps.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
13004
+ new Set(Vs.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
12885
13005
  //#endregion
12886
13006
  //#region ../ui/src/components/builder/three/runtime.js
12887
- var Is = "0.185.1", Ls = "4.2.0", Rs = "https://cdn.jsdelivr.net/npm", zs = `${Rs}/three@${Is}/+esm`, Bs = `${Rs}/@google/model-viewer@${Ls}/dist/model-viewer.min.js`, Vs = (e) => import(
13007
+ var Us = "0.185.1", Ws = "4.2.0", Gs = "https://cdn.jsdelivr.net/npm", Ks = `${Gs}/three@${Us}/+esm`, qs = `${Gs}/@google/model-viewer@${Ws}/dist/model-viewer.min.js`, Js = (e) => import(
12888
13008
  /* @vite-ignore */
12889
13009
  /* webpackIgnore: true */
12890
13010
  e
12891
- ), Hs = /* @__PURE__ */ new Map();
12892
- function Us(e) {
12893
- if (Hs.has(e)) return Hs.get(e);
13011
+ ), Ys = /* @__PURE__ */ new Map();
13012
+ function Xs(e) {
13013
+ if (Ys.has(e)) return Ys.get(e);
12894
13014
  if (typeof window > "u") return new Promise(() => {});
12895
- let t = Vs(e).catch((t) => {
12896
- throw Hs.delete(e), t;
13015
+ let t = Js(e).catch((t) => {
13016
+ throw Ys.delete(e), t;
12897
13017
  });
12898
- return Hs.set(e, t), t;
13018
+ return Ys.set(e, t), t;
12899
13019
  }
12900
- var Ws = () => Us(zs), Gs = (e) => Us(`${Rs}/three@${Is}/examples/jsm/${e}/+esm`);
12901
- function Ks() {
12902
- return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Us(Bs);
13020
+ var Zs = () => Xs(Ks), Qs = (e) => Xs(`${Gs}/three@${Us}/examples/jsm/${e}/+esm`);
13021
+ function $s() {
13022
+ return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Xs(qs);
12903
13023
  }
12904
- var qs = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Js = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
12905
- function Ys(e, t) {
13024
+ var ec = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, tc = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
13025
+ function nc(e, t) {
12906
13026
  let n = 0, r = 0, i = 0, a = !0, o = (e) => {
12907
13027
  n = requestAnimationFrame(o), i ||= e;
12908
13028
  let a = r ? (e - r) / 1e3 : 0;
@@ -12921,7 +13041,7 @@ function Ys(e, t) {
12921
13041
  s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
12922
13042
  };
12923
13043
  }
12924
- function Xs(e, t, n = {}) {
13044
+ function rc(e, t, n = {}) {
12925
13045
  let r = {
12926
13046
  radius: n.distance ?? 4,
12927
13047
  polar: n.polar ?? Math.PI / 2.4,
@@ -12970,13 +13090,13 @@ function Xs(e, t, n = {}) {
12970
13090
  }
12971
13091
  //#endregion
12972
13092
  //#region ../ui/src/components/builder/three/views.jsx
12973
- var Zs = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Qs = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, $s = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ec = (e) => typeof e == "string" && !!e.trim();
12974
- function tc({ label: e, note: t, height: n, nodeRef: r, style: i }) {
13093
+ var ic = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, ac = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, oc = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, sc = (e) => typeof e == "string" && !!e.trim();
13094
+ function cc({ label: e, note: t, height: n, nodeRef: r, style: i }) {
12975
13095
  return /* @__PURE__ */ g("div", {
12976
13096
  ref: r,
12977
13097
  style: {
12978
13098
  ...G(i),
12979
- minHeight: Zs(n, 320),
13099
+ minHeight: ic(n, 320),
12980
13100
  display: "flex",
12981
13101
  flexDirection: "column",
12982
13102
  alignItems: "center",
@@ -13004,24 +13124,24 @@ function tc({ label: e, note: t, height: n, nodeRef: r, style: i }) {
13004
13124
  }) : null]
13005
13125
  });
13006
13126
  }
13007
- function nc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: c, ar: l, exposure: u, shadow: f, fieldOfView: p, environment: m, style: g, nodeRef: _, inert: v }) {
13127
+ function lc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: c, ar: l, exposure: u, shadow: f, fieldOfView: p, environment: m, style: g, nodeRef: _, inert: v }) {
13008
13128
  let [y, b] = d(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = d(!1);
13009
13129
  s(() => {
13010
13130
  if (y || !e) return;
13011
13131
  let t = !0;
13012
- return Ks().then(() => t && b(!0), () => t && S(!0)), () => {
13132
+ return $s().then(() => t && b(!0), () => t && S(!0)), () => {
13013
13133
  t = !1;
13014
13134
  };
13015
13135
  }, [y, e]);
13016
13136
  let C = {
13017
13137
  display: "block",
13018
13138
  width: "100%",
13019
- minHeight: Zs(r, 360),
13020
- height: Zs(r, 360),
13139
+ minHeight: ic(r, 360),
13140
+ height: ic(r, 360),
13021
13141
  backgroundColor: i || "transparent",
13022
13142
  ...G(g)
13023
13143
  };
13024
- if (!e) return v ? /* @__PURE__ */ h(tc, {
13144
+ if (!e) return v ? /* @__PURE__ */ h(cc, {
13025
13145
  nodeRef: _,
13026
13146
  style: g,
13027
13147
  height: r,
@@ -13056,13 +13176,13 @@ function nc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
13056
13176
  poster: t || void 0,
13057
13177
  style: C,
13058
13178
  "camera-controls": w(!v && c !== !1),
13059
- "auto-rotate": w(T && !qs()),
13060
- "auto-rotate-delay": T ? String(Zs(o, 0)) : void 0,
13179
+ "auto-rotate": w(T && !ec()),
13180
+ "auto-rotate-delay": T ? String(ic(o, 0)) : void 0,
13061
13181
  "rotation-per-second": "18deg",
13062
13182
  ar: w(!v && l === !0),
13063
13183
  "ar-modes": "webxr scene-viewer quick-look",
13064
- "shadow-intensity": String(Qs(f, 100)),
13065
- exposure: String(Qs(u, 100)),
13184
+ "shadow-intensity": String(ac(f, 100)),
13185
+ exposure: String(ac(u, 100)),
13066
13186
  "field-of-view": p ? `${Number(p)}deg` : void 0,
13067
13187
  "environment-image": m && m !== "neutral" ? m : "neutral",
13068
13188
  "interaction-prompt": v ? "none" : void 0,
@@ -13080,7 +13200,7 @@ function nc({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
13080
13200
  }) : null
13081
13201
  });
13082
13202
  }
13083
- var rc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ic = [
13203
+ var uc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), dc = [
13084
13204
  "precision highp float;",
13085
13205
  "uniform vec2 u_res;",
13086
13206
  "uniform float u_time;",
@@ -13103,7 +13223,7 @@ var rc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
13103
13223
  " return v;",
13104
13224
  "}",
13105
13225
  ""
13106
- ].join("\n"), ac = {
13226
+ ].join("\n"), fc = {
13107
13227
  gradient: [
13108
13228
  "void main(){",
13109
13229
  " vec2 uv = gl_FragCoord.xy / u_res;",
@@ -13155,7 +13275,7 @@ var rc = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
13155
13275
  "}"
13156
13276
  ].join("\n")
13157
13277
  };
13158
- function oc(e, t) {
13278
+ function pc(e, t) {
13159
13279
  let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
13160
13280
  if (!n) return t;
13161
13281
  let r = parseInt(n[1], 16);
@@ -13165,7 +13285,7 @@ function oc(e, t) {
13165
13285
  (r & 255) / 255
13166
13286
  ];
13167
13287
  }
13168
- function sc(e, t, n) {
13288
+ function mc(e, t, n) {
13169
13289
  let r = e.createShader(t);
13170
13290
  if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
13171
13291
  let t = e.getShaderInfoLog(r);
@@ -13173,13 +13293,13 @@ function sc(e, t, n) {
13173
13293
  }
13174
13294
  return r;
13175
13295
  }
13176
- function cc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: m }) {
13296
+ function hc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: c, interactive: l, style: f, nodeRef: p, inert: m }) {
13177
13297
  let _ = u(null), v = u(null), y = u(null), [b, x] = d("");
13178
13298
  s(() => () => {
13179
13299
  let e = y.current;
13180
13300
  y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
13181
13301
  }, []);
13182
- let S = typeof t == "string" && t.trim() ? t : ac[e] ?? ac.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Qs(a, 100), D = Math.max(.05, Qs(o, 100));
13302
+ let S = typeof t == "string" && t.trim() ? t : fc[e] ?? fc.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = ac(a, 100), D = Math.max(.05, ac(o, 100));
13183
13303
  return s(() => {
13184
13304
  let e = _.current, t = v.current;
13185
13305
  if (!e || !t) return;
@@ -13194,7 +13314,7 @@ function cc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13194
13314
  }
13195
13315
  let r = null;
13196
13316
  try {
13197
- let e = sc(n, n.VERTEX_SHADER, rc), t = sc(n, n.FRAGMENT_SHADER, ic + S);
13317
+ let e = mc(n, n.VERTEX_SHADER, uc), t = mc(n, n.FRAGMENT_SHADER, dc + S);
13198
13318
  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");
13199
13319
  x("");
13200
13320
  } catch (e) {
@@ -13230,28 +13350,28 @@ function cc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13230
13350
  };
13231
13351
  l !== !1 && t.addEventListener("pointermove", u);
13232
13352
  let d = () => {
13233
- let r = Js(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
13353
+ let r = tc(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
13234
13354
  (e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
13235
13355
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
13236
13356
  f?.observe(t), d();
13237
- let p = qs(), m = {
13238
- a: oc(C, [
13357
+ let p = ec(), m = {
13358
+ a: pc(C, [
13239
13359
  .35,
13240
13360
  .4,
13241
13361
  .95
13242
13362
  ]),
13243
- b: oc(w, [
13363
+ b: pc(w, [
13244
13364
  .05,
13245
13365
  .06,
13246
13366
  .16
13247
13367
  ]),
13248
- c: oc(T, [
13368
+ c: pc(T, [
13249
13369
  .95,
13250
13370
  .35,
13251
13371
  .6
13252
13372
  ])
13253
13373
  }, h = {};
13254
- return h.stop = Ys(t, (t, r) => {
13374
+ return h.stop = nc(t, (t, r) => {
13255
13375
  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?.();
13256
13376
  }), () => {
13257
13377
  h.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
@@ -13270,7 +13390,7 @@ function cc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13270
13390
  },
13271
13391
  style: {
13272
13392
  position: "relative",
13273
- minHeight: Zs(c, 320),
13393
+ minHeight: ic(c, 320),
13274
13394
  overflow: "hidden",
13275
13395
  ...G(f)
13276
13396
  },
@@ -13302,7 +13422,7 @@ function cc({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
13302
13422
  }) : null]
13303
13423
  });
13304
13424
  }
13305
- function lc(e, t) {
13425
+ function gc(e, t) {
13306
13426
  let n = new e.Scene(), r = new e.BoxGeometry();
13307
13427
  r.deleteAttribute("uv");
13308
13428
  let i = new e.Mesh(r, new e.MeshBasicMaterial({
@@ -13318,23 +13438,23 @@ function lc(e, t) {
13318
13438
  let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
13319
13439
  return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
13320
13440
  }
13321
- var uc = /* @__PURE__ */ new Map();
13322
- function dc(e) {
13323
- if (uc.has(e)) return uc.get(e);
13324
- let t = Gs("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
13441
+ var _c = /* @__PURE__ */ new Map();
13442
+ function vc(e) {
13443
+ if (_c.has(e)) return _c.get(e);
13444
+ let t = Qs("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
13325
13445
  new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
13326
13446
  })).catch((t) => {
13327
- throw uc.delete(e), t;
13447
+ throw _c.delete(e), t;
13328
13448
  });
13329
- return uc.set(e, t), t;
13449
+ return _c.set(e, t), t;
13330
13450
  }
13331
- function fc(e, t) {
13451
+ function yc(e, t) {
13332
13452
  let n = new e.Box3().setFromObject(t);
13333
13453
  if (n.isEmpty()) return t;
13334
13454
  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();
13335
13455
  return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
13336
13456
  }
13337
- var pc = {
13457
+ var bc = {
13338
13458
  box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
13339
13459
  sphere: (e) => new e.SphereGeometry(.62, 48, 32),
13340
13460
  torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
@@ -13343,50 +13463,50 @@ var pc = {
13343
13463
  cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
13344
13464
  plane: (e) => new e.PlaneGeometry(1.4, 1.4),
13345
13465
  capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
13346
- }, mc = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
13347
- function hc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: m }) {
13348
- let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !qs(), S = o !== !1 && !m;
13466
+ }, xc = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
13467
+ function Sc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: c, height: l, style: f, nodeRef: p, inert: m }) {
13468
+ let g = u(null), [_, v] = d(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !ec(), S = o !== !1 && !m;
13349
13469
  return s(() => {
13350
13470
  let e = g.current;
13351
13471
  if (!e) return;
13352
13472
  let i = !0, o = null;
13353
- return Ws().then((s) => {
13473
+ return Zs().then((s) => {
13354
13474
  if (!i || !e) return;
13355
13475
  let l = new s.WebGLRenderer({
13356
13476
  antialias: !0,
13357
13477
  alpha: !t
13358
13478
  });
13359
- l.setPixelRatio(Js()), l.shadowMap.enabled = c !== !1, l.shadowMap.type = s.PCFSoftShadowMap, l.outputColorSpace = s.SRGBColorSpace, l.toneMapping = s.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
13479
+ l.setPixelRatio(tc()), l.shadowMap.enabled = c !== !1, l.shadowMap.type = s.PCFSoftShadowMap, l.outputColorSpace = s.SRGBColorSpace, l.toneMapping = s.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
13360
13480
  let u = new s.Scene();
13361
- t && (u.background = new s.Color(t)), u.environment = lc(s, l);
13362
- let d = new s.PerspectiveCamera(mc(r, 45), 1, .1, 400), f = Xs(d, l.domElement, {
13363
- distance: mc(n, 5),
13481
+ t && (u.background = new s.Color(t)), u.environment = gc(s, l);
13482
+ let d = new s.PerspectiveCamera(xc(r, 45), 1, .1, 400), f = rc(d, l.domElement, {
13483
+ distance: xc(n, 5),
13364
13484
  enableZoom: S
13365
13485
  }), p = new s.DirectionalLight(16777215, 2.2);
13366
13486
  p.position.set(4, 7, 5), p.castShadow = c !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new s.AmbientLight(16777215, .35));
13367
13487
  let m = [], h = new s.Group(), g = (e, t) => {
13368
- let n = mc(t.scale, 1);
13369
- e.position.set(mc(t.x, 0), mc(t.y, 0), mc(t.z, 0)), e.rotation.set($s(t.rx), $s(t.ry), $s(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = $s(t.spin);
13488
+ let n = xc(t.scale, 1);
13489
+ e.position.set(xc(t.x, 0), xc(t.y, 0), xc(t.z, 0)), e.rotation.set(oc(t.rx), oc(t.ry), oc(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = oc(t.spin);
13370
13490
  };
13371
13491
  for (let e of y) {
13372
13492
  if (e.shape === "model") {
13373
- if (!ec(e.src)) continue;
13493
+ if (!sc(e.src)) continue;
13374
13494
  let t = new s.Group();
13375
- g(t, e), h.add(t), dc(e.src).then((e) => {
13495
+ g(t, e), h.add(t), vc(e.src).then((e) => {
13376
13496
  if (!i) return;
13377
- let n = fc(s, e.clone(!0));
13497
+ let n = yc(s, e.clone(!0));
13378
13498
  n.traverse((e) => {
13379
13499
  e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
13380
13500
  }), t.add(n);
13381
13501
  }, () => {});
13382
13502
  continue;
13383
13503
  }
13384
- let t = (pc[e.shape] ?? pc.box)(s), n = new s.MeshStandardMaterial({
13504
+ let t = (bc[e.shape] ?? bc.box)(s), n = new s.MeshStandardMaterial({
13385
13505
  color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
13386
- metalness: Math.min(1, Math.max(0, Qs(e.metalness, 10))),
13387
- roughness: Math.min(1, Math.max(0, Qs(e.roughness, 35))),
13388
- transparent: Qs(e.opacity, 100) < 1,
13389
- opacity: Math.min(1, Math.max(0, Qs(e.opacity, 100))),
13506
+ metalness: Math.min(1, Math.max(0, ac(e.metalness, 10))),
13507
+ roughness: Math.min(1, Math.max(0, ac(e.roughness, 35))),
13508
+ transparent: ac(e.opacity, 100) < 1,
13509
+ opacity: Math.min(1, Math.max(0, ac(e.opacity, 100))),
13390
13510
  flatShading: e.flat === !0,
13391
13511
  wireframe: e.wireframe === !0,
13392
13512
  side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
@@ -13397,14 +13517,14 @@ function hc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13397
13517
  let _ = null;
13398
13518
  if (c !== !1) {
13399
13519
  let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
13400
- _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = mc(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
13520
+ _ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = xc(c === !0 ? 0 : c, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
13401
13521
  }
13402
13522
  let v = () => {
13403
13523
  let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
13404
13524
  l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
13405
13525
  }, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
13406
13526
  b?.observe(e), v();
13407
- let C = $s(Number.isFinite(Number(a)) ? a : 20), w = Ys(e, (e) => {
13527
+ let C = oc(Number.isFinite(Number(a)) ? a : 20), w = nc(e, (e) => {
13408
13528
  f.autoSpin(x ? C : 0, e), f.update();
13409
13529
  for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
13410
13530
  l.render(u, d);
@@ -13428,7 +13548,7 @@ function hc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13428
13548
  a,
13429
13549
  S,
13430
13550
  c
13431
- ]), _ && m ? /* @__PURE__ */ h(tc, {
13551
+ ]), _ && m ? /* @__PURE__ */ h(cc, {
13432
13552
  nodeRef: p,
13433
13553
  style: f,
13434
13554
  height: l,
@@ -13439,27 +13559,27 @@ function hc({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
13439
13559
  g.current = e, typeof p == "function" && p(e);
13440
13560
  },
13441
13561
  style: {
13442
- minHeight: Zs(l, 380),
13443
- height: Zs(l, 380),
13562
+ minHeight: ic(l, 380),
13563
+ height: ic(l, 380),
13444
13564
  overflow: "hidden",
13445
13565
  touchAction: S ? "pan-y" : void 0,
13446
13566
  ...G(f)
13447
13567
  }
13448
13568
  });
13449
13569
  }
13450
- function gc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
13570
+ function Cc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
13451
13571
  let o = u(null), [c, l] = d("");
13452
13572
  return s(() => {
13453
13573
  let t = o.current;
13454
13574
  if (a || !t || typeof e != "string" || !e.trim()) return;
13455
13575
  let r = !0, i = null;
13456
- return Ws().then((a) => {
13576
+ return Zs().then((a) => {
13457
13577
  if (!r || !t) return;
13458
13578
  let o = new a.WebGLRenderer({
13459
13579
  antialias: !0,
13460
13580
  alpha: !n
13461
13581
  });
13462
- o.setPixelRatio(Js()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
13582
+ o.setPixelRatio(tc()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
13463
13583
  let s = new a.Scene();
13464
13584
  n && (s.background = new a.Color(n));
13465
13585
  let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
@@ -13482,7 +13602,7 @@ function gc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13482
13602
  o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
13483
13603
  }, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
13484
13604
  f?.observe(t), d();
13485
- let p = !1, m = Ys(t, (e, t) => {
13605
+ let p = !1, m = nc(t, (e, t) => {
13486
13606
  if (!p && typeof u?.frame == "function") try {
13487
13607
  u.frame(e, t);
13488
13608
  } catch (e) {
@@ -13504,7 +13624,7 @@ function gc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13504
13624
  e,
13505
13625
  a,
13506
13626
  n
13507
- ]), a ? /* @__PURE__ */ h(tc, {
13627
+ ]), a ? /* @__PURE__ */ h(cc, {
13508
13628
  nodeRef: i,
13509
13629
  style: r,
13510
13630
  height: t,
@@ -13515,8 +13635,8 @@ function gc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13515
13635
  o.current = e, typeof i == "function" && i(e);
13516
13636
  },
13517
13637
  style: {
13518
- minHeight: Zs(t, 380),
13519
- height: Zs(t, 380),
13638
+ minHeight: ic(t, 380),
13639
+ height: ic(t, 380),
13520
13640
  overflow: "hidden",
13521
13641
  position: "relative",
13522
13642
  touchAction: "pan-y",
@@ -13539,30 +13659,30 @@ function gc({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
13539
13659
  }) : null
13540
13660
  });
13541
13661
  }
13542
- var _c = {
13543
- ModelViewerBlock: nc,
13544
- ShaderBlock: cc,
13545
- SceneBlock: hc,
13546
- ThreeCanvasBlock: gc
13547
- }, vc = "2.44.0", yc = "https://cdn.jsdelivr.net/npm", bc = `${yc}/@rive-app/canvas@${vc}/+esm`, xc = `${yc}/@rive-app/canvas@${vc}/rive.wasm`, Sc = (e) => import(
13662
+ var wc = {
13663
+ ModelViewerBlock: lc,
13664
+ ShaderBlock: hc,
13665
+ SceneBlock: Sc,
13666
+ ThreeCanvasBlock: Cc
13667
+ }, Tc = "2.44.0", Ec = "https://cdn.jsdelivr.net/npm", Dc = `${Ec}/@rive-app/canvas@${Tc}/+esm`, Oc = `${Ec}/@rive-app/canvas@${Tc}/rive.wasm`, kc = (e) => import(
13548
13668
  /* @vite-ignore */
13549
13669
  /* webpackIgnore: true */
13550
13670
  e
13551
- ), Cc = null;
13552
- function wc() {
13553
- return typeof window > "u" ? new Promise(() => {}) : Cc || (Cc = Sc(bc).then((e) => {
13671
+ ), Ac = null;
13672
+ function jc() {
13673
+ return typeof window > "u" ? new Promise(() => {}) : Ac || (Ac = kc(Dc).then((e) => {
13554
13674
  let t = e?.default ?? e;
13555
- return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(xc), t;
13675
+ return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(Oc), t;
13556
13676
  }).catch((e) => {
13557
- throw Cc = null, e;
13558
- }), Cc);
13677
+ throw Ac = null, e;
13678
+ }), Ac);
13559
13679
  }
13560
- var Tc = /* @__PURE__ */ new Map(), Ec = {
13680
+ var Mc = /* @__PURE__ */ new Map(), Nc = {
13561
13681
  56: "number",
13562
13682
  58: "trigger",
13563
13683
  59: "boolean"
13564
- }, Dc = /* @__PURE__ */ new Set();
13565
- function Oc(e, t) {
13684
+ }, Pc = /* @__PURE__ */ new Set();
13685
+ function Fc(e, t) {
13566
13686
  if (!e || !t) return;
13567
13687
  let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
13568
13688
  name: String(e?.name ?? ""),
@@ -13571,15 +13691,15 @@ function Oc(e, t) {
13571
13691
  name: String(e?.name ?? ""),
13572
13692
  inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
13573
13693
  name: String(e?.name ?? ""),
13574
- type: Ec[e?.type] ?? "unknown"
13694
+ type: Nc[e?.type] ?? "unknown"
13575
13695
  }))
13576
13696
  }))
13577
13697
  }));
13578
- Tc.set(e, { artboards: n }), Dc.forEach((t) => t(e));
13698
+ Mc.set(e, { artboards: n }), Pc.forEach((t) => t(e));
13579
13699
  }
13580
13700
  //#endregion
13581
13701
  //#region ../ui/src/components/builder/rive/views.jsx
13582
- var kc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ac = [
13702
+ var Ic = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Lc = [
13583
13703
  "contain",
13584
13704
  "cover",
13585
13705
  "fill",
@@ -13588,7 +13708,7 @@ var kc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
13588
13708
  "scaleDown",
13589
13709
  "none",
13590
13710
  "layout"
13591
- ], jc = [
13711
+ ], Rc = [
13592
13712
  "center",
13593
13713
  "topLeft",
13594
13714
  "topCenter",
@@ -13598,8 +13718,8 @@ var kc = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
13598
13718
  "bottomLeft",
13599
13719
  "bottomCenter",
13600
13720
  "bottomRight"
13601
- ], Mc = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Nc = 131;
13602
- function Pc(e, t, n, r) {
13721
+ ], zc = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Bc = 131;
13722
+ function Vc(e, t, n, r) {
13603
13723
  if (!e || !t || !n) return;
13604
13724
  let i = [];
13605
13725
  try {
@@ -13610,15 +13730,15 @@ function Pc(e, t, n, r) {
13610
13730
  let a = i.find((e) => e?.name === n);
13611
13731
  a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
13612
13732
  }
13613
- function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: c, animation: l, fit: f = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
13733
+ function Hc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: c, animation: l, fit: f = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: _, clickInput: v, style: y, nodeRef: b, inert: x }) {
13614
13734
  let S = u(null), C = u(null), w = u(null), T = u(""), [E, D] = d(!1), [O, k] = d(!1);
13615
13735
  s(() => {
13616
13736
  let t = C.current, n = S.current;
13617
13737
  if (D(!1), k(!1), !e || !t) return;
13618
13738
  let r = !0, i = null, s = null, u = null;
13619
- return wc().then((d) => {
13739
+ return jc().then((d) => {
13620
13740
  if (!r) return;
13621
- let h = o !== "animation", g = m !== !1 && !Mc();
13741
+ let h = o !== "animation", g = m !== !1 && !zc();
13622
13742
  try {
13623
13743
  i = new d.Rive({
13624
13744
  src: e,
@@ -13628,8 +13748,8 @@ function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13628
13748
  animations: !h && l ? l : void 0,
13629
13749
  autoplay: g,
13630
13750
  layout: new d.Layout({
13631
- fit: Ac.includes(f) ? f : "contain",
13632
- alignment: jc.includes(p) ? p : "center"
13751
+ fit: Lc.includes(f) ? f : "contain",
13752
+ alignment: Rc.includes(p) ? p : "center"
13633
13753
  }),
13634
13754
  shouldDisableRiveListeners: !!x,
13635
13755
  isTouchScrollEnabled: !0,
@@ -13637,7 +13757,7 @@ function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13637
13757
  if (!r) return;
13638
13758
  i.resizeDrawingSurfaceToCanvas();
13639
13759
  let t = i.contents;
13640
- if (Oc(e, t), h) {
13760
+ if (Fc(e, t), h) {
13641
13761
  let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
13642
13762
  if (T.current = c || e, !c && e) try {
13643
13763
  i.play(e), g || i.pause(e);
@@ -13653,7 +13773,7 @@ function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13653
13773
  }
13654
13774
  w.current = i, n && (n.rive = i), i.on(d.EventType.RiveEvent, (e) => {
13655
13775
  let t = e?.data;
13656
- x || t?.type !== Nc || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
13776
+ x || t?.type !== Bc || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
13657
13777
  }), n && typeof ResizeObserver < "u" && (s = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), s.observe(n)), n && typeof IntersectionObserver < "u" && (u = new IntersectionObserver(([e]) => {
13658
13778
  i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
13659
13779
  }), u.observe(n));
@@ -13674,11 +13794,11 @@ function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13674
13794
  m,
13675
13795
  x
13676
13796
  ]);
13677
- let A = !x && E, j = (e, t) => A && Pc(w.current, T.current, e, t), M = {
13797
+ let A = !x && E, j = (e, t) => A && Vc(w.current, T.current, e, t), M = {
13678
13798
  position: "relative",
13679
13799
  display: "block",
13680
13800
  width: "100%",
13681
- height: kc(r, 360),
13801
+ height: Ic(r, 360),
13682
13802
  backgroundColor: i || "transparent",
13683
13803
  overflow: "hidden",
13684
13804
  ...G(y)
@@ -13740,35 +13860,35 @@ function Fc({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
13740
13860
  }), /* @__PURE__ */ h("span", { children: "Pick a .riv file in the Settings panel." })]
13741
13861
  }) : null;
13742
13862
  }
13743
- var Ic = { RiveBlock: Fc }, Lc = /* @__PURE__ */ new Map();
13744
- function Rc(e) {
13745
- if (Lc.has(e)) return Lc.get(e);
13863
+ var Uc = { RiveBlock: Hc }, Wc = /* @__PURE__ */ new Map();
13864
+ function Gc(e) {
13865
+ if (Wc.has(e)) return Wc.get(e);
13746
13866
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
13747
13867
  /* @vite-ignore */
13748
13868
  /* webpackIgnore: true */
13749
13869
  t
13750
13870
  ).finally(() => URL.revokeObjectURL(t));
13751
- return Lc.set(e, n), n;
13871
+ return Wc.set(e, n), n;
13752
13872
  }
13753
- function zc(e) {
13873
+ function Kc(e) {
13754
13874
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
13755
13875
  return n && typeof n == "object" ? n : {};
13756
13876
  }
13757
13877
  //#endregion
13758
13878
  //#region ../ui/src/components/builder/plugins/view.jsx
13759
- async function Bc(e, t) {
13760
- let n = await Rc(e);
13879
+ async function qc(e, t) {
13880
+ let n = await Gc(e);
13761
13881
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
13762
13882
  }
13763
- var Vc = {
13883
+ var Jc = {
13764
13884
  padding: "10px 12px",
13765
13885
  border: "1px dashed rgba(148, 163, 184, 0.5)",
13766
13886
  borderRadius: 8,
13767
13887
  fontSize: 12,
13768
13888
  opacity: .6
13769
13889
  };
13770
- function Hc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13771
- let a = o(X), c = zc(a?.settings)[e], l = u(null), d = u(null), f = {
13890
+ function Yc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13891
+ let a = o(X), c = Kc(a?.settings)[e], l = u(null), d = u(null), f = {
13772
13892
  tenant: a?.tenant ?? "",
13773
13893
  apiUrl: a?.apiUrl ?? "/api",
13774
13894
  locale: a?.locale ?? "",
@@ -13780,7 +13900,7 @@ function Hc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13780
13900
  let e = l.current;
13781
13901
  if (!c?.code || !e) return;
13782
13902
  let n = !0;
13783
- return Bc(c.code, t).then((e) => {
13903
+ return qc(c.code, t).then((e) => {
13784
13904
  if (!(!n || !e || !l.current)) {
13785
13905
  d.current = e;
13786
13906
  try {
@@ -13810,7 +13930,7 @@ function Hc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13810
13930
  }) : /* @__PURE__ */ g("div", {
13811
13931
  ref: i,
13812
13932
  style: {
13813
- ...Vc,
13933
+ ...Jc,
13814
13934
  ...G(r)
13815
13935
  },
13816
13936
  children: [
@@ -13822,7 +13942,7 @@ function Hc({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
13822
13942
  }
13823
13943
  //#endregion
13824
13944
  //#region ../ui/src/components/builder/render.jsx
13825
- function Uc(e, t, n) {
13945
+ function Xc(e, t, n) {
13826
13946
  let r = { "data-wb": e };
13827
13947
  t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
13828
13948
  let i = J(t.classNames);
@@ -13836,7 +13956,7 @@ function Uc(e, t, n) {
13836
13956
  classes: i
13837
13957
  };
13838
13958
  }
13839
- function Wc({ View: e, markup: n, ...r }) {
13959
+ function Zc({ View: e, markup: n, ...r }) {
13840
13960
  let a = e(r);
13841
13961
  if (!i(a) || typeof a.type != "string") return a;
13842
13962
  let o = [a.props.className, ...n.classes].filter(Boolean).join(" ");
@@ -13845,62 +13965,62 @@ function Wc({ View: e, markup: n, ...r }) {
13845
13965
  ...o ? { className: o } : {}
13846
13966
  });
13847
13967
  }
13848
- var Gc = /* @__PURE__ */ new Set([
13968
+ var Qc = /* @__PURE__ */ new Set([
13849
13969
  "FormInput",
13850
13970
  "FormTextarea",
13851
13971
  "FormSelect"
13852
13972
  ]);
13853
- function Kc(e, t, n, r) {
13973
+ function $c(e, t, n, r) {
13854
13974
  if (t.forNode === "__none") return "";
13855
13975
  let i = t.forNode ? n[t.forNode] : null;
13856
13976
  if (!t.forNode) {
13857
13977
  let t = n[r]?.nodes ?? [];
13858
13978
  i = n[t[t.indexOf(e) + 1]] ?? null;
13859
13979
  }
13860
- return !i || !Gc.has(i.type?.resolvedName) ? "" : i.props?.htmlId || fi(i.props?.name) || "";
13861
- }
13862
- var qc = "slot-", Jc = {
13863
- ...Oa,
13864
- ...Fs,
13865
- ..._c,
13866
- ...Ic,
13867
- PluginBlock: Hc
13980
+ return !i || !Qc.has(i.type?.resolvedName) ? "" : i.props?.htmlId || fi(i.props?.name) || "";
13981
+ }
13982
+ var el = "slot-", tl = {
13983
+ ...Fa,
13984
+ ...Hs,
13985
+ ...wc,
13986
+ ...Uc,
13987
+ PluginBlock: Yc
13868
13988
  };
13869
- function Yc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13989
+ function nl(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13870
13990
  let o = n[t];
13871
13991
  if (!o || o.hidden) return null;
13872
13992
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
13873
13993
  if (s === "ComponentInstance") {
13874
13994
  let s = o.props?.componentId, l = r?.[s];
13875
13995
  if (!l?.template || i.has(s)) return null;
13876
- let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(qc)).map(([e, t]) => [e.slice(5), Yc(t, n, r, i, a)]));
13877
- return /* @__PURE__ */ h(e, { children: Yc(l.template.rootId, l.template.nodes, r, u, {
13996
+ let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(el)).map(([e, t]) => [e.slice(5), nl(t, n, r, i, a)]));
13997
+ return /* @__PURE__ */ h(e, { children: nl(l.template.rootId, l.template.nodes, r, u, {
13878
13998
  ...pt(c.values, a),
13879
13999
  slots: d
13880
14000
  }) }, t);
13881
14001
  }
13882
- let l = Jc[s];
14002
+ let l = tl[s];
13883
14003
  if (!l) return null;
13884
- let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => Yc(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, Yc(t, n, r, i, a)])) : void 0, g = /* @__PURE__ */ h(typeof l == "function" ? Wc : l, {
14004
+ let u = c.compSlot?.id, d = u && a?.slots && Object.hasOwn(a.slots, u) ? a.slots[u] : void 0, f = d === void 0 ? (o.nodes ?? []).map((e) => nl(e, n, r, i, a)).filter(Boolean) : [d].filter(Boolean), p = Object.entries(o.linkedNodes ?? {}), m = p.length ? Object.fromEntries(p.map(([e, t]) => [e, nl(t, n, r, i, a)])) : void 0, g = /* @__PURE__ */ h(typeof l == "function" ? Zc : l, {
13885
14005
  ...typeof l == "function" ? {
13886
14006
  View: l,
13887
- markup: Uc(t, c, a?.skipTarget)
14007
+ markup: Xc(t, c, a?.skipTarget)
13888
14008
  } : null,
13889
14009
  ...c,
13890
14010
  ...s === "CollectionList" ? {
13891
14011
  templateId: o.linkedNodes?.card,
13892
- renderTemplate: o.linkedNodes?.card ? (e) => Yc(o.linkedNodes.card, n, r, i, {
14012
+ renderTemplate: o.linkedNodes?.card ? (e) => nl(o.linkedNodes.card, n, r, i, {
13893
14013
  ...a,
13894
14014
  mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
13895
14015
  }) : void 0
13896
14016
  } : null,
13897
- ...s === "FormLabel" ? { htmlFor: Kc(t, c, n, o.parent) } : null,
14017
+ ...s === "FormLabel" ? { htmlFor: $c(t, c, n, o.parent) } : null,
13898
14018
  linked: m,
13899
14019
  nodeRef: (e) => {
13900
14020
  e && (e.setAttribute("data-wb", t), ce(e, c), a?.skipTarget?.id === t && (e.id = c.htmlId || a.skipTarget.htmlId, e.tabIndex = -1), se(e, a?.events === !1 ? [] : c.events));
13901
14021
  },
13902
14022
  children: f.length ? f : void 0
13903
- }, t), _ = c.when && c.when !== "always" ? /* @__PURE__ */ h(Ra, {
14023
+ }, t), _ = c.when && c.when !== "always" ? /* @__PURE__ */ h(Ga, {
13904
14024
  when: c.when,
13905
14025
  children: g
13906
14026
  }, t) : g;
@@ -13911,9 +14031,9 @@ function Yc(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
13911
14031
  }
13912
14032
  //#endregion
13913
14033
  //#region ../ui/src/components/builder/PageRenderer.jsx
13914
- var Xc = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Zc = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Pe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
14034
+ var rl = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), il = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(Pe(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
13915
14035
  .webim-page[data-webim-mode="dark"] { ${Object.entries(Pe(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
13916
- function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: _, siteUser: v, param: y }) {
14036
+ function al({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: c, apiUrl: u, datasets: d, locale: f, direction: p, settings: _, siteUser: v, param: y }) {
13917
14037
  let b = a?.js?.trim(), S = _ && _["site.code"] && typeof _["site.code"] == "object" ? _["site.code"] : null, C = typeof S?.js == "string" ? S.js.trim() : "", T = typeof S?.css == "string" ? S.css.trim() : "";
13918
14038
  if (s(() => {
13919
14039
  if (!C) return;
@@ -13931,15 +14051,15 @@ function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13931
14051
  minHeight: "100%",
13932
14052
  display: "flex",
13933
14053
  flexDirection: "column"
13934
- }, k = at(e, n), A = Yc("ROOT", e, n, void 0, k ? { skipTarget: k } : void 0), j = k ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { children: $e }), /* @__PURE__ */ h("a", {
14054
+ }, k = at(e, n), A = nl("ROOT", e, n, void 0, k ? { skipTarget: k } : void 0), j = k ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("style", { children: $e }), /* @__PURE__ */ h("a", {
13935
14055
  className: "webim-skip",
13936
14056
  href: `#${k.htmlId}`,
13937
14057
  children: Xe(f || _?.locales?.default)("skip")
13938
- })] }) : null, M = l(() => ({ render: (t, r) => Yc(t, e, n, void 0, { mapProps: r }) }), [e, n]), N = Ce(e, n), P = Se(e, n), F = a?.css?.trim(), I = V(o), L = Ne(t), R = [L.font, L.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ae[e]), z = [.../* @__PURE__ */ new Set([...w(e, n), ...R])].map((e) => /* @__PURE__ */ h("link", {
14058
+ })] }) : null, M = l(() => ({ render: (t, r) => nl(t, e, n, void 0, { mapProps: r }) }), [e, n]), N = Ce(e, n), P = Se(e, n), F = a?.css?.trim(), I = V(o), L = Ne(t), R = [L.font, L.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !Ae[e]), z = [.../* @__PURE__ */ new Set([...w(e, n), ...R])].map((e) => /* @__PURE__ */ h("link", {
13939
14059
  rel: "stylesheet",
13940
14060
  precedence: "default",
13941
14061
  href: x(e)
13942
- }, e)), B = Zc(L), H = ze(t);
14062
+ }, e)), B = il(L), H = ze(t);
13943
14063
  return r === "auto" ? /* @__PURE__ */ h(X.Provider, {
13944
14064
  value: {
13945
14065
  tenant: c || "",
@@ -13948,7 +14068,7 @@ function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13948
14068
  settings: _ ?? null,
13949
14069
  param: y || ""
13950
14070
  },
13951
- children: /* @__PURE__ */ h(La, {
14071
+ children: /* @__PURE__ */ h(Wa, {
13952
14072
  initialUser: v,
13953
14073
  children: /* @__PURE__ */ h(Jt.Provider, {
13954
14074
  value: d ?? null,
@@ -13964,8 +14084,8 @@ function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13964
14084
  },
13965
14085
  children: [
13966
14086
  j,
13967
- /* @__PURE__ */ h("style", { children: `.webim-page { ${Xc(Pe(L.light))} }
13968
- @media (prefers-color-scheme: dark) { .webim-page { ${Xc(Pe(L.dark))} } }` }),
14087
+ /* @__PURE__ */ h("style", { children: `.webim-page { ${rl(Pe(L.light))} }
14088
+ @media (prefers-color-scheme: dark) { .webim-page { ${rl(Pe(L.dark))} } }` }),
13969
14089
  /* @__PURE__ */ h("style", { children: B }),
13970
14090
  z,
13971
14091
  /* @__PURE__ */ h("style", { children: D }),
@@ -13989,7 +14109,7 @@ function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
13989
14109
  settings: _ ?? null,
13990
14110
  param: y || ""
13991
14111
  },
13992
- children: /* @__PURE__ */ h(La, {
14112
+ children: /* @__PURE__ */ h(Wa, {
13993
14113
  initialUser: v,
13994
14114
  children: /* @__PURE__ */ h(Jt.Provider, {
13995
14115
  value: d ?? null,
@@ -14024,8 +14144,8 @@ function Qc({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
14024
14144
  }
14025
14145
  //#endregion
14026
14146
  //#region src/WebimContent.jsx
14027
- function $c({ bundle: e, mode: t = "auto", style: n }) {
14028
- return e?.blocks?.ROOT ? /* @__PURE__ */ h(Qc, {
14147
+ function ol({ bundle: e, mode: t = "auto", style: n }) {
14148
+ return e?.blocks?.ROOT ? /* @__PURE__ */ h(al, {
14029
14149
  blocks: e.blocks,
14030
14150
  theme: e.theme,
14031
14151
  components: e.components,
@@ -14044,7 +14164,7 @@ function $c({ bundle: e, mode: t = "auto", style: n }) {
14044
14164
  }
14045
14165
  //#endregion
14046
14166
  //#region src/WebimPage.jsx
14047
- function el({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: m }) {
14167
+ function sl({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mode: o = "auto", style: c, fallback: l = null, errorFallback: f = null, onLoad: p, onError: m }) {
14048
14168
  let [g, _] = d({ status: "loading" }), v = u({
14049
14169
  onLoad: p,
14050
14170
  onError: m
@@ -14081,11 +14201,11 @@ function el({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, mo
14081
14201
  r,
14082
14202
  i,
14083
14203
  a
14084
- ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h($c, {
14204
+ ]), g.status === "loading" ? l : g.status === "error" ? typeof f == "function" ? f(g.error) : f : /* @__PURE__ */ h(ol, {
14085
14205
  bundle: g.bundle,
14086
14206
  mode: o,
14087
14207
  style: c
14088
14208
  });
14089
14209
  }
14090
14210
  //#endregion
14091
- export { Qc as PageRenderer, $c as WebimContent, el as WebimPage, qe as fetchPage, Bn as renderRichContent, Ue as resolveTheme };
14211
+ export { al as PageRenderer, ol as WebimContent, sl as WebimPage, qe as fetchPage, Bn as renderRichContent, Ue as resolveTheme };