webim-adapter 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +972 -717
- package/build/webim-embed.js +12 -12
- package/build/webim-ssr.js +986 -731
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -2303,12 +2303,12 @@ function dr(e, t, n) {
|
|
|
2303
2303
|
return r ? e.filter((e) => ur(e, t).includes(r)) : [];
|
|
2304
2304
|
}
|
|
2305
2305
|
function fr(e, t, n) {
|
|
2306
|
-
return !e || !t ? [] :
|
|
2306
|
+
return !e || !t ? [] : Jo(_r(e.data, t)).map((r, i) => ({
|
|
2307
2307
|
...e,
|
|
2308
2308
|
id: `${e.id ?? "entry"}:${t}:${i}`,
|
|
2309
2309
|
data: {
|
|
2310
2310
|
...e.data ?? {},
|
|
2311
|
-
[t]:
|
|
2311
|
+
[t]: es(r, n?.[r], i)
|
|
2312
2312
|
}
|
|
2313
2313
|
}));
|
|
2314
2314
|
}
|
|
@@ -3710,7 +3710,7 @@ function Pi({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
3710
3710
|
})
|
|
3711
3711
|
})
|
|
3712
3712
|
] })]
|
|
3713
|
-
});
|
|
3713
|
+
}, "live");
|
|
3714
3714
|
}
|
|
3715
3715
|
var Fi = (e) => typeof e == "string" && e.startsWith(":"), Ii = (e, t) => ({
|
|
3716
3716
|
position: "absolute",
|
|
@@ -5596,7 +5596,7 @@ function Aa({ style: e, action: t, method: n, name: r, enctype: i, formSlug: a,
|
|
|
5596
5596
|
display: z === "success" ? "none" : "flex"
|
|
5597
5597
|
},
|
|
5598
5598
|
children: o && a ? /* @__PURE__ */ _(h, { children: [
|
|
5599
|
-
W && /* @__PURE__ */ g(
|
|
5599
|
+
W && /* @__PURE__ */ g(xo, {
|
|
5600
5600
|
steps: U.map((e) => ({ label: e.section?.label ?? B("start") })),
|
|
5601
5601
|
active: G + 1,
|
|
5602
5602
|
style: { marginBottom: 8 }
|
|
@@ -6050,7 +6050,7 @@ function Ka(e, t, n = "asc", r) {
|
|
|
6050
6050
|
}).map(({ row: e }) => e);
|
|
6051
6051
|
}
|
|
6052
6052
|
function qa({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: i, titleField: a = "name", textField: o, custom: l, templateId: u, renderTemplate: d, paged: p, filters: m, parentField: h, topLevel: v, childrenOf: y, itemsOf: b, sortBy: x = "", sortDir: S = "asc", gap: C, style: w, nodeRef: T }) {
|
|
6053
|
-
let { tenant: E, apiUrl: D, revision: O, locale: k } = s(Z), A = s(cr), j = s(ir), M = s(lr), N = typeof b == "string" && b ? b : null, P =
|
|
6053
|
+
let { tenant: E, apiUrl: D, revision: O, locale: k } = s(Z), A = s(cr), j = s(ir), M = s(lr), N = typeof b == "string" && b ? b : null, P = $o(N ? Jo(_r(M?.entry?.data, N)) : null), F = y || N ? null : e, I = !!h && !y && !N, L = typeof x == "string" && x !== "" && !N, [, R] = f(0);
|
|
6054
6054
|
c(() => {
|
|
6055
6055
|
if (typeof window > "u") return;
|
|
6056
6056
|
let e = () => R((e) => e + 1);
|
|
@@ -6906,7 +6906,258 @@ function po({ from: e, to: t, duration: n, delay: r, decimals: i, prefix: a, suf
|
|
|
6906
6906
|
}) : null]
|
|
6907
6907
|
});
|
|
6908
6908
|
}
|
|
6909
|
-
|
|
6909
|
+
var mo = "@keyframes wb-type-blink { 50% { opacity: 0; } }";
|
|
6910
|
+
function ho({ phrases: e, tag: t, typeSpeed: n, deleteSpeed: r, hold: i, pause: a, startDelay: o, loop: s, caret: l, caretColor: u, style: d, nodeRef: p, inert: m }) {
|
|
6911
|
+
let h = (Array.isArray(e) ? e : []).map((e) => typeof e == "string" ? e : e?.text).filter((e) => typeof e == "string" && e.length), v = h[0] ?? "", [y, b] = f(v), x = [
|
|
6912
|
+
"h1",
|
|
6913
|
+
"h2",
|
|
6914
|
+
"h3",
|
|
6915
|
+
"h4",
|
|
6916
|
+
"h5",
|
|
6917
|
+
"h6",
|
|
6918
|
+
"p",
|
|
6919
|
+
"span",
|
|
6920
|
+
"div"
|
|
6921
|
+
].includes(t) ? t : "p", S = (e, t) => Number.isFinite(Number(e)) && e !== "" && e != null ? Math.max(0, Number(e)) : t, C = {
|
|
6922
|
+
type: S(n, 55),
|
|
6923
|
+
erase: S(r, 35),
|
|
6924
|
+
hold: S(i, 1700),
|
|
6925
|
+
pause: S(a, 380),
|
|
6926
|
+
start: S(o, 400)
|
|
6927
|
+
};
|
|
6928
|
+
c(() => {
|
|
6929
|
+
if (m || typeof window > "u" || !h.length) {
|
|
6930
|
+
b(v);
|
|
6931
|
+
return;
|
|
6932
|
+
}
|
|
6933
|
+
if (!document.getElementById("wb-typewriter-css")) {
|
|
6934
|
+
let e = document.createElement("style");
|
|
6935
|
+
e.id = "wb-typewriter-css", e.textContent = mo, document.head.appendChild(e);
|
|
6936
|
+
}
|
|
6937
|
+
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
6938
|
+
b(v);
|
|
6939
|
+
return;
|
|
6940
|
+
}
|
|
6941
|
+
let e = 0, t = 0, n = !1, r = 0, i = () => {
|
|
6942
|
+
let a = h[e];
|
|
6943
|
+
t += n ? -1 : 1, b(a.slice(0, t));
|
|
6944
|
+
let o = n ? C.erase : C.type;
|
|
6945
|
+
if (!n && t >= a.length) {
|
|
6946
|
+
if (s === !1 && e === h.length - 1 || h.length === 1 && s === !1) return;
|
|
6947
|
+
n = !0, o = C.hold;
|
|
6948
|
+
} else n && t <= 0 && (n = !1, e = (e + 1) % h.length, o = C.pause);
|
|
6949
|
+
r = setTimeout(i, o);
|
|
6950
|
+
};
|
|
6951
|
+
return b(""), r = setTimeout(i, C.start), () => clearTimeout(r);
|
|
6952
|
+
}, [
|
|
6953
|
+
m,
|
|
6954
|
+
h.join("\0"),
|
|
6955
|
+
C.type,
|
|
6956
|
+
C.erase,
|
|
6957
|
+
C.hold,
|
|
6958
|
+
C.pause,
|
|
6959
|
+
C.start,
|
|
6960
|
+
s
|
|
6961
|
+
]);
|
|
6962
|
+
let w = l === "none" ? null : {
|
|
6963
|
+
display: "inline-block",
|
|
6964
|
+
width: l === "bar" ? "2px" : "0.55em",
|
|
6965
|
+
height: "1.05em",
|
|
6966
|
+
marginLeft: l === "bar" ? "2px" : "4px",
|
|
6967
|
+
verticalAlign: "text-bottom",
|
|
6968
|
+
background: typeof u == "string" && u ? u : "var(--page-accent, #3b82f6)",
|
|
6969
|
+
animation: m ? "none" : "wb-type-blink 1s step-end infinite"
|
|
6970
|
+
};
|
|
6971
|
+
return /* @__PURE__ */ _(x, {
|
|
6972
|
+
ref: p,
|
|
6973
|
+
style: {
|
|
6974
|
+
margin: 0,
|
|
6975
|
+
...Y(d)
|
|
6976
|
+
},
|
|
6977
|
+
children: [
|
|
6978
|
+
/* @__PURE__ */ g("span", {
|
|
6979
|
+
"aria-hidden": "true",
|
|
6980
|
+
...Q("text"),
|
|
6981
|
+
children: y.length || !m ? y : v
|
|
6982
|
+
}),
|
|
6983
|
+
w && /* @__PURE__ */ g("span", {
|
|
6984
|
+
"aria-hidden": "true",
|
|
6985
|
+
...Q("caret"),
|
|
6986
|
+
style: w
|
|
6987
|
+
}),
|
|
6988
|
+
h.length > 0 && /* @__PURE__ */ g("span", {
|
|
6989
|
+
style: Dt,
|
|
6990
|
+
children: h.map((e) => /[.!?…:;]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`).join(" ")
|
|
6991
|
+
})
|
|
6992
|
+
]
|
|
6993
|
+
});
|
|
6994
|
+
}
|
|
6995
|
+
var go = "a, button, [role=\"button\"], input[type=\"submit\"], label, summary, .magnetic, .tag";
|
|
6996
|
+
function _o({ dotSize: e, ringSize: t, color: n, blend: r, trail: i, grow: a, hideNative: o, hover: s, magnetic: u, strength: p, shape: m, anchor: h, showRing: v, linked: y, style: b, nodeRef: x, inert: S }) {
|
|
6997
|
+
let C = m === "custom", w = v !== !1, T = h === "top-left", E = `wb-cur-${l().replace(/[^a-zA-Z0-9_-]/g, "")}`, D = d(null), O = d(null), k = d(null), [A, j] = f(!1), M = Math.max(2, Number(e) || 7), N = Math.max(8, Number(t) || 34), P = typeof n == "string" && n ? n : "#ffffff", F = typeof r == "string" && r ? r : "difference", I = Math.max(1, (Number(a) || 180) / 100), L = Math.min(1, Math.max(.02, (Number(i) || 18) / 100)), R = Math.max(0, Number.isFinite(Number(p)) && p !== "" && p != null ? Number(p) : 30) / 100, z = typeof s == "string" && s.trim() ? s : go;
|
|
6998
|
+
return c(() => {
|
|
6999
|
+
if (S || typeof window > "u" || !window.matchMedia) return;
|
|
7000
|
+
let e = window.matchMedia("(hover: hover) and (pointer: fine)"), t = () => j(e.matches);
|
|
7001
|
+
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
7002
|
+
}, [S]), c(() => {
|
|
7003
|
+
let e = D.current, t = O.current, n = k.current;
|
|
7004
|
+
if (S || !A || !e || !t || !n) return;
|
|
7005
|
+
let r = e.closest(".webim-page, .wb-artboard") || document.documentElement, i = window.matchMedia("(prefers-reduced-motion: reduce)").matches, a = 0, s = 0, c = 0, l = 0, d = !1, f = !1, p = 1, m = 0, h = null;
|
|
7006
|
+
o !== !1 && r.classList.add(E);
|
|
7007
|
+
let g = () => {
|
|
7008
|
+
let r = e.getBoundingClientRect();
|
|
7009
|
+
c += (a - c) * (i ? 1 : L), l += (s - l) * (i ? 1 : L), p += ((f ? I : 1) - p) * (i ? 1 : .2);
|
|
7010
|
+
let o = C ? t.offsetWidth : M, u = C ? t.offsetHeight : M, d = T ? 0 : o / 2, h = T ? 0 : u / 2;
|
|
7011
|
+
t.style.transform = `translate(${a - r.left - d}px, ${s - r.top - h}px)`, n.style.transform = `translate(${c - r.left - N / 2}px, ${l - r.top - N / 2}px) scale(${p.toFixed(3)})`, m = requestAnimationFrame(g);
|
|
7012
|
+
}, _ = (e) => {
|
|
7013
|
+
t.style.opacity = e ? "1" : "0", n.style.opacity = e ? "1" : "0";
|
|
7014
|
+
}, v = () => {
|
|
7015
|
+
h && (h.style.translate = ""), h = null;
|
|
7016
|
+
}, y = (e) => {
|
|
7017
|
+
a = e.clientX, s = e.clientY;
|
|
7018
|
+
let t = r.contains(e.target);
|
|
7019
|
+
if (d ||= (c = a, l = s, !0), _(t), f = t && !!e.target?.closest?.(z), u === !1) return;
|
|
7020
|
+
let n = t ? e.target?.closest?.(".magnetic") : null;
|
|
7021
|
+
if (n !== h && v(), !n || i) return;
|
|
7022
|
+
let o = n.getBoundingClientRect();
|
|
7023
|
+
h = n, n.style.translate = `${((a - (o.left + o.width / 2)) * R * .83).toFixed(1)}px ${((s - (o.top + o.height / 2)) * R * 1.17).toFixed(1)}px`;
|
|
7024
|
+
}, b = (e) => {
|
|
7025
|
+
e.relatedTarget || (_(!1), v());
|
|
7026
|
+
};
|
|
7027
|
+
return _(!1), m = requestAnimationFrame(g), document.addEventListener("pointermove", y, { passive: !0 }), document.addEventListener("pointerout", b, { passive: !0 }), () => {
|
|
7028
|
+
cancelAnimationFrame(m), document.removeEventListener("pointermove", y), document.removeEventListener("pointerout", b), r.classList.remove(E), v();
|
|
7029
|
+
};
|
|
7030
|
+
}, [
|
|
7031
|
+
S,
|
|
7032
|
+
A,
|
|
7033
|
+
E,
|
|
7034
|
+
o,
|
|
7035
|
+
M,
|
|
7036
|
+
N,
|
|
7037
|
+
L,
|
|
7038
|
+
I,
|
|
7039
|
+
z,
|
|
7040
|
+
u,
|
|
7041
|
+
R,
|
|
7042
|
+
C,
|
|
7043
|
+
T
|
|
7044
|
+
]), S ? /* @__PURE__ */ _("div", {
|
|
7045
|
+
ref: x,
|
|
7046
|
+
style: {
|
|
7047
|
+
...tt,
|
|
7048
|
+
display: "inline-flex",
|
|
7049
|
+
alignItems: "center",
|
|
7050
|
+
gap: 8,
|
|
7051
|
+
padding: "6px 10px",
|
|
7052
|
+
border: "1px dashed rgba(148, 163, 184, .6)",
|
|
7053
|
+
borderRadius: 8,
|
|
7054
|
+
fontSize: 12,
|
|
7055
|
+
color: "rgba(148, 163, 184, 1)",
|
|
7056
|
+
...Y(b)
|
|
7057
|
+
},
|
|
7058
|
+
children: [
|
|
7059
|
+
/* @__PURE__ */ g("span", {
|
|
7060
|
+
style: {
|
|
7061
|
+
position: "relative",
|
|
7062
|
+
width: 18,
|
|
7063
|
+
height: 18,
|
|
7064
|
+
borderRadius: "50%",
|
|
7065
|
+
border: "1px solid currentColor",
|
|
7066
|
+
display: "inline-block"
|
|
7067
|
+
},
|
|
7068
|
+
children: /* @__PURE__ */ g("span", { style: {
|
|
7069
|
+
position: "absolute",
|
|
7070
|
+
left: 6,
|
|
7071
|
+
top: 6,
|
|
7072
|
+
width: 4,
|
|
7073
|
+
height: 4,
|
|
7074
|
+
borderRadius: "50%",
|
|
7075
|
+
background: "currentColor"
|
|
7076
|
+
} })
|
|
7077
|
+
}),
|
|
7078
|
+
"Custom cursor",
|
|
7079
|
+
C && /* @__PURE__ */ g("div", {
|
|
7080
|
+
style: {
|
|
7081
|
+
marginLeft: 6,
|
|
7082
|
+
padding: 6,
|
|
7083
|
+
border: "1px dashed rgba(148, 163, 184, .6)",
|
|
7084
|
+
borderRadius: 6,
|
|
7085
|
+
minWidth: 40,
|
|
7086
|
+
minHeight: 24
|
|
7087
|
+
},
|
|
7088
|
+
children: y?.content
|
|
7089
|
+
})
|
|
7090
|
+
]
|
|
7091
|
+
}, "edit") : /* @__PURE__ */ _("div", {
|
|
7092
|
+
ref: (e) => {
|
|
7093
|
+
D.current = e, typeof x == "function" && x(e);
|
|
7094
|
+
},
|
|
7095
|
+
"aria-hidden": "true",
|
|
7096
|
+
style: {
|
|
7097
|
+
position: "fixed",
|
|
7098
|
+
left: 0,
|
|
7099
|
+
top: 0,
|
|
7100
|
+
width: 0,
|
|
7101
|
+
height: 0,
|
|
7102
|
+
zIndex: 2147482500,
|
|
7103
|
+
pointerEvents: "none"
|
|
7104
|
+
},
|
|
7105
|
+
children: [
|
|
7106
|
+
A && o !== !1 && /* @__PURE__ */ g("style", { children: `.${E}, .${E} * { cursor: none !important; }` }),
|
|
7107
|
+
/* @__PURE__ */ g("div", {
|
|
7108
|
+
ref: k,
|
|
7109
|
+
...Q("ring"),
|
|
7110
|
+
style: {
|
|
7111
|
+
position: "absolute",
|
|
7112
|
+
left: 0,
|
|
7113
|
+
top: 0,
|
|
7114
|
+
width: N,
|
|
7115
|
+
height: N,
|
|
7116
|
+
borderRadius: "50%",
|
|
7117
|
+
border: `1px solid ${P}`,
|
|
7118
|
+
mixBlendMode: F,
|
|
7119
|
+
opacity: 0,
|
|
7120
|
+
transition: "opacity .25s",
|
|
7121
|
+
willChange: "transform",
|
|
7122
|
+
display: A && w ? "block" : "none"
|
|
7123
|
+
}
|
|
7124
|
+
}),
|
|
7125
|
+
C ? /* @__PURE__ */ g("div", {
|
|
7126
|
+
ref: O,
|
|
7127
|
+
...Q("content"),
|
|
7128
|
+
style: {
|
|
7129
|
+
position: "absolute",
|
|
7130
|
+
left: 0,
|
|
7131
|
+
top: 0,
|
|
7132
|
+
width: "max-content",
|
|
7133
|
+
opacity: 0,
|
|
7134
|
+
transition: "opacity .25s",
|
|
7135
|
+
willChange: "transform",
|
|
7136
|
+
display: A ? "block" : "none"
|
|
7137
|
+
},
|
|
7138
|
+
children: y?.content
|
|
7139
|
+
}) : /* @__PURE__ */ g("div", {
|
|
7140
|
+
ref: O,
|
|
7141
|
+
...Q("dot"),
|
|
7142
|
+
style: {
|
|
7143
|
+
position: "absolute",
|
|
7144
|
+
left: 0,
|
|
7145
|
+
top: 0,
|
|
7146
|
+
width: M,
|
|
7147
|
+
height: M,
|
|
7148
|
+
borderRadius: "50%",
|
|
7149
|
+
background: P,
|
|
7150
|
+
mixBlendMode: F,
|
|
7151
|
+
opacity: 0,
|
|
7152
|
+
transition: "opacity .25s",
|
|
7153
|
+
willChange: "transform",
|
|
7154
|
+
display: A ? "block" : "none"
|
|
7155
|
+
}
|
|
7156
|
+
})
|
|
7157
|
+
]
|
|
7158
|
+
});
|
|
7159
|
+
}
|
|
7160
|
+
function vo({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: a, bg: o, fg: s, style: l, nodeRef: u, inert: d, frame: p, builder: m }) {
|
|
6910
7161
|
let [h, v] = f(!!d), [y, b] = f(null), x = (e) => {
|
|
6911
7162
|
b(e), typeof u == "function" && u(e);
|
|
6912
7163
|
};
|
|
@@ -7008,7 +7259,7 @@ function mo({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
|
|
|
7008
7259
|
}) : null]
|
|
7009
7260
|
});
|
|
7010
7261
|
}
|
|
7011
|
-
var
|
|
7262
|
+
var yo = {
|
|
7012
7263
|
facebook: {
|
|
7013
7264
|
label: "Facebook",
|
|
7014
7265
|
color: "#1877f2",
|
|
@@ -7075,8 +7326,8 @@ var ho = {
|
|
|
7075
7326
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
7076
7327
|
}
|
|
7077
7328
|
};
|
|
7078
|
-
function
|
|
7079
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
7329
|
+
function bo({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
7330
|
+
let l = Array.isArray(e) ? e.filter((e) => e && yo[e.network]) : [];
|
|
7080
7331
|
if (!l.length) return null;
|
|
7081
7332
|
let u = Math.min(Math.max(Number(r) || 18, 10), 64), d = Math.round(u * 1.9), f = Number.isFinite(Number(i)) ? Number(i) : 10, p = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, m = c ? (e) => e.preventDefault() : void 0;
|
|
7082
7333
|
return /* @__PURE__ */ g("div", {
|
|
@@ -7089,7 +7340,7 @@ function go({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
7089
7340
|
...Y(o)
|
|
7090
7341
|
},
|
|
7091
7342
|
children: l.map((e, r) => {
|
|
7092
|
-
let i =
|
|
7343
|
+
let i = yo[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : p(i);
|
|
7093
7344
|
return /* @__PURE__ */ g("a", {
|
|
7094
7345
|
...Q("link", /^[a-z]+$/.test(e.network ?? "") && `link-${e.network}`),
|
|
7095
7346
|
href: e.url || "#",
|
|
@@ -7125,7 +7376,7 @@ function go({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
7125
7376
|
})
|
|
7126
7377
|
});
|
|
7127
7378
|
}
|
|
7128
|
-
function
|
|
7379
|
+
function xo({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
7129
7380
|
if (!e.length) return null;
|
|
7130
7381
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
7131
7382
|
width: 32,
|
|
@@ -7208,7 +7459,7 @@ function _o({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
7208
7459
|
})
|
|
7209
7460
|
});
|
|
7210
7461
|
}
|
|
7211
|
-
var
|
|
7462
|
+
var So = {
|
|
7212
7463
|
small: {
|
|
7213
7464
|
w: 132,
|
|
7214
7465
|
h: 46,
|
|
@@ -7230,25 +7481,25 @@ var vo = {
|
|
|
7230
7481
|
title: 12.5,
|
|
7231
7482
|
avatar: 46
|
|
7232
7483
|
}
|
|
7233
|
-
},
|
|
7234
|
-
|
|
7235
|
-
var
|
|
7484
|
+
}, Co = (e) => So[e] ?? So.medium;
|
|
7485
|
+
So.medium.w, So.medium.h;
|
|
7486
|
+
var wo = (e) => String(e?.group ?? "").trim(), To = (e) => {
|
|
7236
7487
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
7237
7488
|
return e.forEach((e, r) => {
|
|
7238
|
-
let i =
|
|
7489
|
+
let i = wo(e) || `#${r}`;
|
|
7239
7490
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
7240
7491
|
}), t.flatMap((e) => n.get(e));
|
|
7241
|
-
},
|
|
7492
|
+
}, Eo = 20, Do = 12, Oo = [
|
|
7242
7493
|
"left",
|
|
7243
7494
|
"center",
|
|
7244
7495
|
"right"
|
|
7245
|
-
],
|
|
7246
|
-
function
|
|
7247
|
-
let a =
|
|
7496
|
+
], ko = (e) => e.points.map((e, t) => `${t ? "L" : "M"} ${e.x} ${e.y}`).join(" ");
|
|
7497
|
+
function Ao(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top", columns: i = "off" } = {}) {
|
|
7498
|
+
let a = Co(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 = [];
|
|
7248
7499
|
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);
|
|
7249
|
-
f =
|
|
7250
|
-
for (let [e, t] of d) d.set(e,
|
|
7251
|
-
let p = !n &&
|
|
7500
|
+
f = To(f);
|
|
7501
|
+
for (let [e, t] of d) d.set(e, To(t));
|
|
7502
|
+
let p = !n && Oo.includes(i), m = (e) => Oo.includes(e?.columns) ? e.columns : i, h = (e) => {
|
|
7252
7503
|
let t = d.get(e.id) ?? [];
|
|
7253
7504
|
if (!p) return t.map((e) => ({ nodes: [e] }));
|
|
7254
7505
|
let n = [], r = [], i = () => {
|
|
@@ -7259,10 +7510,10 @@ function Eo(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
|
|
|
7259
7510
|
};
|
|
7260
7511
|
for (let e of t) {
|
|
7261
7512
|
let t = !(d.get(e.id) ?? []).length;
|
|
7262
|
-
r.length && (!t ||
|
|
7513
|
+
r.length && (!t || wo(r[0]) !== wo(e)) && i(), t ? r.push(e) : n.push({ nodes: [e] });
|
|
7263
7514
|
}
|
|
7264
7515
|
return i(), n;
|
|
7265
|
-
}, g = (e, t) => s + (
|
|
7516
|
+
}, g = (e, t) => s + (wo(e) !== wo(t) && (wo(e) || wo(t)) ? 24 : 0), _ = (e, t) => g(e.nodes.at(-1), t.nodes[0]), v = (e) => o + (e.line === "center" ? 0 : Eo), y = /* @__PURE__ */ new Map(), b = (e, t) => {
|
|
7266
7517
|
if (t.has(e.id)) return 0;
|
|
7267
7518
|
t.add(e.id);
|
|
7268
7519
|
let n = h(e), r = n.reduce((e, r, i) => {
|
|
@@ -7278,7 +7529,7 @@ function Eo(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
|
|
|
7278
7529
|
x: t,
|
|
7279
7530
|
y: r
|
|
7280
7531
|
});
|
|
7281
|
-
let i =
|
|
7532
|
+
let i = wo(e);
|
|
7282
7533
|
if (i) {
|
|
7283
7534
|
let n = `${e.parent && u.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${i}`;
|
|
7284
7535
|
C.has(n) || C.set(n, {
|
|
@@ -7294,12 +7545,12 @@ function Eo(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
|
|
|
7294
7545
|
}
|
|
7295
7546
|
w = Math.max(w, n ? t + a.w : r + a.h);
|
|
7296
7547
|
}, E = (e, t, n, r) => {
|
|
7297
|
-
let i = t + (e.line === "left" ?
|
|
7548
|
+
let i = t + (e.line === "left" ? Eo : 0), o = n * c, s = r.y + (o - r.y) / 2, l = e.line === "left" ? i - Eo / 2 : i + a.w + Eo / 2;
|
|
7298
7549
|
e.nodes.forEach((t, n) => {
|
|
7299
|
-
let c = o + n * (a.h +
|
|
7550
|
+
let c = o + n * (a.h + Do), u = c + a.h / 2;
|
|
7300
7551
|
if (T(t, i, c), e.line === "center") S.push(n ? { points: [{
|
|
7301
7552
|
x: i + a.w / 2,
|
|
7302
|
-
y: c -
|
|
7553
|
+
y: c - Do
|
|
7303
7554
|
}, {
|
|
7304
7555
|
x: i + a.w / 2,
|
|
7305
7556
|
y: c
|
|
@@ -7421,18 +7672,18 @@ function Eo(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top",
|
|
|
7421
7672
|
horizontal: n
|
|
7422
7673
|
};
|
|
7423
7674
|
}
|
|
7424
|
-
var
|
|
7675
|
+
var jo = (e, t) => {
|
|
7425
7676
|
let n = String(e ?? "");
|
|
7426
7677
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
7427
|
-
},
|
|
7678
|
+
}, Mo = (e) => {
|
|
7428
7679
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
7429
7680
|
if (!t) return "#ffffff";
|
|
7430
7681
|
let n = t[1];
|
|
7431
7682
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
7432
7683
|
let r = parseInt(n, 16);
|
|
7433
7684
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
7434
|
-
},
|
|
7435
|
-
function
|
|
7685
|
+
}, No = (e) => !!(e?.cv?.trim?.() || e?.photo || e?.profilePhoto || e?.profile?.length);
|
|
7686
|
+
function Po(e, t = {}) {
|
|
7436
7687
|
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 ? "" : yr(e);
|
|
7437
7688
|
return n.map((e) => {
|
|
7438
7689
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -7448,21 +7699,21 @@ function Ao(e, t = {}) {
|
|
|
7448
7699
|
};
|
|
7449
7700
|
});
|
|
7450
7701
|
}
|
|
7451
|
-
var
|
|
7702
|
+
var Fo = /^(https?:\/\/[^\s"<>]+|mailto:[^\s"<>]+|tel:[+\d][\d\s().-]*|\/(?!\/)[^\s"<>]*)$/i, Io = (e) => {
|
|
7452
7703
|
let t = String(e ?? "").trim();
|
|
7453
|
-
return
|
|
7454
|
-
},
|
|
7704
|
+
return Fo.test(t) ? t : "";
|
|
7705
|
+
}, Lo = (e) => {
|
|
7455
7706
|
e.startsWith("/") ? window.location.assign(e) : window.open(e, "_blank", "noopener,noreferrer");
|
|
7456
|
-
},
|
|
7707
|
+
}, Ro = {
|
|
7457
7708
|
size: 36,
|
|
7458
7709
|
pad: 10
|
|
7459
7710
|
};
|
|
7460
|
-
function
|
|
7711
|
+
function zo({ node: e, onClose: t }) {
|
|
7461
7712
|
c(() => {
|
|
7462
7713
|
let e = (e) => e.key === "Escape" && t();
|
|
7463
7714
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
7464
7715
|
}, [t]);
|
|
7465
|
-
let n = e.profile?.length ? e.profile : null, r = n ? "" : e.profilePhoto || e.photo, i = e.title || e.name, a = e.title && e.name ? e.name : "", o = !!(n || r && e.cv), s =
|
|
7716
|
+
let n = e.profile?.length ? e.profile : null, r = n ? "" : e.profilePhoto || e.photo, i = e.title || e.name, a = e.title && e.name ? e.name : "", o = !!(n || r && e.cv), s = Io(e.href);
|
|
7466
7717
|
return /* @__PURE__ */ g("div", {
|
|
7467
7718
|
onClick: t,
|
|
7468
7719
|
role: "dialog",
|
|
@@ -7611,10 +7862,10 @@ function Fo({ node: e, onClose: t }) {
|
|
|
7611
7862
|
})
|
|
7612
7863
|
});
|
|
7613
7864
|
}
|
|
7614
|
-
function
|
|
7615
|
-
return e.chart?.people?.length ? /* @__PURE__ */ g(
|
|
7865
|
+
function Bo(e) {
|
|
7866
|
+
return e.chart?.people?.length ? /* @__PURE__ */ g(Vo, { ...e }) : /* @__PURE__ */ g(Ho, { ...e });
|
|
7616
7867
|
}
|
|
7617
|
-
function
|
|
7868
|
+
function Vo({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }) {
|
|
7618
7869
|
let [a, o] = f(null), s = u(() => Fn(e), [e]), c = u(() => new Set(e.people.map((e) => e.parent)), [e]);
|
|
7619
7870
|
return /* @__PURE__ */ _("div", {
|
|
7620
7871
|
ref: r,
|
|
@@ -7664,7 +7915,7 @@ function Lo({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }
|
|
|
7664
7915
|
profilePhoto: n.photo,
|
|
7665
7916
|
href: n.link,
|
|
7666
7917
|
profile: u
|
|
7667
|
-
}, f =
|
|
7918
|
+
}, f = Io(n.link), p = i && (f || No(d)), m = () => f ? Lo(f) : o(d);
|
|
7668
7919
|
return /* @__PURE__ */ g("g", {
|
|
7669
7920
|
onClick: p ? m : void 0,
|
|
7670
7921
|
onKeyDown: p ? (e) => {
|
|
@@ -7690,13 +7941,13 @@ function Lo({ chart: e, profiles: t, style: n, nodeRef: r, interactive: i = !0 }
|
|
|
7690
7941
|
}, n.id);
|
|
7691
7942
|
})
|
|
7692
7943
|
]
|
|
7693
|
-
}), a && /* @__PURE__ */ g(
|
|
7944
|
+
}), a && /* @__PURE__ */ g(zo, {
|
|
7694
7945
|
node: a,
|
|
7695
7946
|
onClose: () => o(null)
|
|
7696
7947
|
})]
|
|
7697
7948
|
});
|
|
7698
7949
|
}
|
|
7699
|
-
function
|
|
7950
|
+
function Ho({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: i, parentField: a, cvField: o, hrefField: u, groupField: d, groupTitles: p = "top", groupBg: m = "", size: v = "medium", horizontal: y = !1, columns: b = "off", style: x, nodeRef: S, interactive: C = !0 }) {
|
|
7700
7951
|
let w = l(), [T, E] = f(null), { tenant: D, apiUrl: O, revision: k } = s(Z), A = s(ir)?.[t], [j, M] = f(null);
|
|
7701
7952
|
c(() => {
|
|
7702
7953
|
if (!t || A) return;
|
|
@@ -7714,7 +7965,7 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7714
7965
|
O,
|
|
7715
7966
|
A
|
|
7716
7967
|
]);
|
|
7717
|
-
let N = t ?
|
|
7968
|
+
let N = t ? Po(A ?? j ?? [], {
|
|
7718
7969
|
nameField: n,
|
|
7719
7970
|
titleField: r,
|
|
7720
7971
|
photoField: i,
|
|
@@ -7722,7 +7973,7 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7722
7973
|
cvField: o,
|
|
7723
7974
|
hrefField: u,
|
|
7724
7975
|
groupField: d
|
|
7725
|
-
}) : e, P =
|
|
7976
|
+
}) : e, P = Co(v), { boxes: F, links: I, groups: L, width: R, height: z } = Ao(N, {
|
|
7726
7977
|
size: v,
|
|
7727
7978
|
horizontal: y,
|
|
7728
7979
|
groupTitles: p,
|
|
@@ -7781,18 +8032,18 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7781
8032
|
fontSize: P.title + 1,
|
|
7782
8033
|
fontWeight: "600",
|
|
7783
8034
|
opacity: "0.55",
|
|
7784
|
-
fill: r ?
|
|
7785
|
-
children:
|
|
8035
|
+
fill: r ? Mo(e.color || m) : "var(--page-text, #111827)",
|
|
8036
|
+
children: jo(e.title, Math.floor(e.width / 7))
|
|
7786
8037
|
})] }, `group-${t}`);
|
|
7787
8038
|
}),
|
|
7788
8039
|
I.map((e, t) => /* @__PURE__ */ g("path", {
|
|
7789
|
-
d:
|
|
8040
|
+
d: ko(e),
|
|
7790
8041
|
fill: "none",
|
|
7791
8042
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
7792
8043
|
strokeWidth: "1.5"
|
|
7793
8044
|
}, t)),
|
|
7794
8045
|
F.map(({ node: e, x: t, y: n }) => {
|
|
7795
|
-
let r = B.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 ?
|
|
8046
|
+
let r = B.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 ? Mo(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Mo(e.color2) : s, l = Io(e.href), u = C && (l || No(e)), d = () => l ? Lo(l) : E(e), f = e.photo ? t + Ro.pad + P.avatar + 8 : t + P.w / 2, p = e.photo ? "start" : "middle", m = e.photo ? Math.floor((P.w - P.avatar - 26) / 7) : Math.floor(P.w / 7.6), v = P.h / 2, y = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
7796
8047
|
return /* @__PURE__ */ _("g", {
|
|
7797
8048
|
onClick: u ? d : void 0,
|
|
7798
8049
|
onKeyDown: u ? (e) => {
|
|
@@ -7860,13 +8111,13 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7860
8111
|
e.photo && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("clipPath", {
|
|
7861
8112
|
id: `${w}-${e.id}`,
|
|
7862
8113
|
children: /* @__PURE__ */ g("circle", {
|
|
7863
|
-
cx: t +
|
|
8114
|
+
cx: t + Ro.pad + P.avatar / 2,
|
|
7864
8115
|
cy: n + P.h / 2,
|
|
7865
8116
|
r: P.avatar / 2
|
|
7866
8117
|
})
|
|
7867
8118
|
}), /* @__PURE__ */ g("image", {
|
|
7868
8119
|
href: e.photo,
|
|
7869
|
-
x: t +
|
|
8120
|
+
x: t + Ro.pad,
|
|
7870
8121
|
y: n + (P.h - P.avatar) / 2,
|
|
7871
8122
|
width: P.avatar,
|
|
7872
8123
|
height: P.avatar,
|
|
@@ -7880,7 +8131,7 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7880
8131
|
fontSize: P.title,
|
|
7881
8132
|
fontWeight: "600",
|
|
7882
8133
|
fill: s,
|
|
7883
|
-
children:
|
|
8134
|
+
children: jo(e.title, m + 4)
|
|
7884
8135
|
}), e.name && /* @__PURE__ */ g("text", {
|
|
7885
8136
|
x: f,
|
|
7886
8137
|
y: n + v + v / 2 + P.name * .35,
|
|
@@ -7888,7 +8139,7 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7888
8139
|
fontSize: P.name,
|
|
7889
8140
|
fontWeight: "600",
|
|
7890
8141
|
fill: c,
|
|
7891
|
-
children:
|
|
8142
|
+
children: jo(e.name, m)
|
|
7892
8143
|
})] }) : /* @__PURE__ */ _(h, { children: [y[0] && /* @__PURE__ */ g("text", {
|
|
7893
8144
|
x: f,
|
|
7894
8145
|
y: n + (y[1] ? P.h * .43 : P.h * .57),
|
|
@@ -7896,7 +8147,7 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7896
8147
|
fontSize: P.name,
|
|
7897
8148
|
fontWeight: "600",
|
|
7898
8149
|
fill: s,
|
|
7899
|
-
children:
|
|
8150
|
+
children: jo(y[0], m)
|
|
7900
8151
|
}), y[1] && /* @__PURE__ */ g("text", {
|
|
7901
8152
|
x: f,
|
|
7902
8153
|
y: n + P.h * .73,
|
|
@@ -7904,19 +8155,19 @@ function Ro({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
7904
8155
|
fontSize: P.title,
|
|
7905
8156
|
opacity: "0.7",
|
|
7906
8157
|
fill: s,
|
|
7907
|
-
children:
|
|
8158
|
+
children: jo(y[1], m + 4)
|
|
7908
8159
|
})] })
|
|
7909
8160
|
]
|
|
7910
8161
|
}, e.id);
|
|
7911
8162
|
})
|
|
7912
8163
|
]
|
|
7913
|
-
}), T && /* @__PURE__ */ g(
|
|
8164
|
+
}), T && /* @__PURE__ */ g(zo, {
|
|
7914
8165
|
node: T,
|
|
7915
8166
|
onClose: () => E(null)
|
|
7916
8167
|
})]
|
|
7917
8168
|
});
|
|
7918
8169
|
}
|
|
7919
|
-
function
|
|
8170
|
+
function Uo({ value: e, onCommit: t, style: n, hint: r }) {
|
|
7920
8171
|
let [i, a] = f(!1), o = d(null);
|
|
7921
8172
|
return c(() => {
|
|
7922
8173
|
if (!i || !o.current) return;
|
|
@@ -7946,7 +8197,7 @@ function zo({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
7946
8197
|
children: e ?? ""
|
|
7947
8198
|
});
|
|
7948
8199
|
}
|
|
7949
|
-
var
|
|
8200
|
+
var Wo = 360, Go = "\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", Ko = (e, t) => e && t ? `cell-${e}-${t}` : "", qo = (e) => {
|
|
7950
8201
|
if (!e || typeof e != "object") return e ?? "";
|
|
7951
8202
|
let t = String(e.text ?? "");
|
|
7952
8203
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ g("a", {
|
|
@@ -7956,7 +8207,7 @@ var Bo = 360, Vo = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
7956
8207
|
style: { color: "var(--page-accent, #4f46e5)" },
|
|
7957
8208
|
children: t
|
|
7958
8209
|
}) : t;
|
|
7959
|
-
},
|
|
8210
|
+
}, Jo = (e) => (Array.isArray(e) ? e : e == null ? [] : [e]).map((e) => typeof e == "string" ? e : e?.url).filter((e) => typeof e == "string" && e.trim()), Yo = (e) => {
|
|
7960
8211
|
if (!Number.isFinite(e) || e < 0) return "";
|
|
7961
8212
|
if (e < 1024) return `${e} B`;
|
|
7962
8213
|
let t = [
|
|
@@ -7969,27 +8220,27 @@ var Bo = 360, Vo = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
7969
8220
|
n /= 1024, r++;
|
|
7970
8221
|
while (n >= 1024 && r < t.length - 1);
|
|
7971
8222
|
return `${n.toFixed(1)} ${t[r]}`;
|
|
7972
|
-
},
|
|
8223
|
+
}, Xo = (e) => {
|
|
7973
8224
|
try {
|
|
7974
8225
|
let t = new URL(e, typeof window > "u" ? "http://localhost" : window.location.href), n = t.pathname.match(/^(.*\/files\/[0-9a-f-]{36})\/?$/i);
|
|
7975
8226
|
return n ? (t.pathname = `${n[1]}/meta`, t.toString()) : null;
|
|
7976
8227
|
} catch {
|
|
7977
8228
|
return null;
|
|
7978
8229
|
}
|
|
7979
|
-
},
|
|
7980
|
-
let t =
|
|
8230
|
+
}, Zo = /* @__PURE__ */ new Map(), Qo = (e) => {
|
|
8231
|
+
let t = Xo(e);
|
|
7981
8232
|
if (!t) return Promise.resolve(null);
|
|
7982
|
-
if (!
|
|
8233
|
+
if (!Zo.has(t)) {
|
|
7983
8234
|
let e = (e) => fetch(t, { credentials: e }).then((e) => e.ok ? e.json() : null);
|
|
7984
|
-
|
|
8235
|
+
Zo.set(t, e("include").catch(() => e("omit")).then((e) => e?.payload ?? null).catch(() => null).then((e) => (e || Zo.delete(t), e)));
|
|
7985
8236
|
}
|
|
7986
|
-
return
|
|
8237
|
+
return Zo.get(t);
|
|
7987
8238
|
};
|
|
7988
|
-
function
|
|
8239
|
+
function $o(e) {
|
|
7989
8240
|
let [t, n] = f({});
|
|
7990
8241
|
return c(() => {
|
|
7991
8242
|
let t = !0;
|
|
7992
|
-
for (let r of e ?? [])
|
|
8243
|
+
for (let r of e ?? []) Qo(r).then((e) => t && n((t) => ({
|
|
7993
8244
|
...t,
|
|
7994
8245
|
[r]: e
|
|
7995
8246
|
})));
|
|
@@ -7998,11 +8249,11 @@ function Yo(e) {
|
|
|
7998
8249
|
};
|
|
7999
8250
|
}, [(e ?? []).join("\n")]), t;
|
|
8000
8251
|
}
|
|
8001
|
-
var
|
|
8252
|
+
var es = (e, t, n) => {
|
|
8002
8253
|
let r = String(t?.name ?? ""), i = r.includes(".") ? r.split(".").pop() : String(t?.mime ?? "").split("/").pop();
|
|
8003
8254
|
return {
|
|
8004
8255
|
name: r,
|
|
8005
|
-
size:
|
|
8256
|
+
size: Yo(Number(t?.size)),
|
|
8006
8257
|
bytes: Number.isFinite(Number(t?.size)) ? Number(t.size) : "",
|
|
8007
8258
|
type: String(i ?? "").toUpperCase(),
|
|
8008
8259
|
url: e,
|
|
@@ -8010,8 +8261,8 @@ var Xo = (e, t, n) => {
|
|
|
8010
8261
|
index: n + 1
|
|
8011
8262
|
};
|
|
8012
8263
|
};
|
|
8013
|
-
function
|
|
8014
|
-
let B = d(null), V = s(lr), H = F && !u ?
|
|
8264
|
+
function ts({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: i = [], heights: a = [], spans: o, linked: l, source: u, limit: p = 10, header: m = !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, valign: k, borderColor: A, maxHeight: j, caption: M = "", captionHidden: N = !1, rowHeaders: P = !1, repeat: F = "", renderCell: I, style: L, nodeRef: R, edit: z }) {
|
|
8265
|
+
let B = d(null), V = s(lr), H = F && !u ? Jo(_r(V?.entry?.data, F)) : null, U = $o(H), W = d(null), [G, K] = f(null), [q, ee] = f(null), te = (e, t) => () => {
|
|
8015
8266
|
K({
|
|
8016
8267
|
r: e,
|
|
8017
8268
|
c: t
|
|
@@ -8026,7 +8277,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8026
8277
|
}
|
|
8027
8278
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
8028
8279
|
top: r.bottom - n.top + 4,
|
|
8029
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
8280
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Wo))
|
|
8030
8281
|
};
|
|
8031
8282
|
(q?.top !== i.top || q?.left !== i.left) && ee(i);
|
|
8032
8283
|
}), c(() => {
|
|
@@ -8058,7 +8309,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8058
8309
|
]), !e.length) return null;
|
|
8059
8310
|
let ue = Math.max(1, Number(p) || 10), de = u ? C ? oe || u.startsWith("api:") ? (oe ?? ce ?? []).slice((se - 1) * ue, se * ue) : (ce ?? []).slice(0, ue) : (oe ?? ce ?? []).slice(0, ue) : null, fe = de ? de.map((t) => e.map((e) => yr(_r(t?.data, e.field)))) : t, pe = !!u && !(u && !oe && ce === null) && fe.length === 0, me = H && I && fe.length ? [...H.map((e, t) => ({
|
|
8060
8311
|
r: 0,
|
|
8061
|
-
file:
|
|
8312
|
+
file: es(e, U[e], t)
|
|
8062
8313
|
})), ...fe.slice(1).map((e, t) => ({
|
|
8063
8314
|
r: t + 1,
|
|
8064
8315
|
file: null
|
|
@@ -8102,7 +8353,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8102
8353
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
8103
8354
|
}, Ne = /* @__PURE__ */ new Set();
|
|
8104
8355
|
o && fe.forEach((t, n) => e.forEach((e, t) => {
|
|
8105
|
-
let a = o[
|
|
8356
|
+
let a = o[Ko(r[n], i[t])];
|
|
8106
8357
|
if (!a) return;
|
|
8107
8358
|
let s = Math.max(1, Number(a.c) || 1), c = Math.max(1, Number(a.r) || 1);
|
|
8108
8359
|
for (let e = 0; e < c; e++) for (let r = 0; r < s; r++) (e || r) && Ne.add(`${n + e},${t + r}`);
|
|
@@ -8125,7 +8376,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8125
8376
|
},
|
|
8126
8377
|
onClick: n,
|
|
8127
8378
|
children: e
|
|
8128
|
-
}, t), X = G && G.r < fe.length && G.c < e.length ? G : null, Ie = (e, t) => z?.labels?.[e] ?? t, Le = X ? o?.[
|
|
8379
|
+
}, t), X = G && G.r < fe.length && G.c < e.length ? G : null, Ie = (e, t) => z?.labels?.[e] ?? t, Le = X ? o?.[Ko(r[X.r], i[X.c])] : null, Re = Math.max(1, Number(Le?.c) || 1), ze = Math.max(1, Number(Le?.r) || 1);
|
|
8129
8380
|
return /* @__PURE__ */ _("div", {
|
|
8130
8381
|
ref: (e) => {
|
|
8131
8382
|
W.current = e, typeof R == "function" && R(e);
|
|
@@ -8136,7 +8387,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8136
8387
|
...Ae
|
|
8137
8388
|
},
|
|
8138
8389
|
children: [
|
|
8139
|
-
z && /* @__PURE__ */ g("style", { children:
|
|
8390
|
+
z && /* @__PURE__ */ g("style", { children: Go }),
|
|
8140
8391
|
z && X && q && /* @__PURE__ */ _("div", {
|
|
8141
8392
|
className: "wb-tedit-bar",
|
|
8142
8393
|
style: {
|
|
@@ -8218,7 +8469,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8218
8469
|
} : z ? { position: "relative" } : null,
|
|
8219
8470
|
...ye
|
|
8220
8471
|
},
|
|
8221
|
-
children: z ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
8472
|
+
children: z ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(Uo, {
|
|
8222
8473
|
value: t.label ?? t,
|
|
8223
8474
|
onCommit: (e) => z.header(n, e),
|
|
8224
8475
|
hint: Ie("editCell", "Double-click to edit"),
|
|
@@ -8251,7 +8502,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8251
8502
|
},
|
|
8252
8503
|
children: e.map((e, a) => {
|
|
8253
8504
|
if (Ne.has(`${t},${a}`)) return null;
|
|
8254
|
-
let s =
|
|
8505
|
+
let s = Ko(r[t], i[a]), u = n ? he(s, n) : l?.[s], d = o?.[s], f = Math.max(1, Number(d?.c) || 1), p = Math.max(1, Number(d?.r) || 1), m = P && a === 0 ? "th" : "td";
|
|
8255
8506
|
return /* @__PURE__ */ _(m, {
|
|
8256
8507
|
...Q("cell", m === "th" && "row-header"),
|
|
8257
8508
|
scope: m === "th" ? "row" : void 0,
|
|
@@ -8271,7 +8522,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8271
8522
|
...z ? { position: "relative" } : null,
|
|
8272
8523
|
...ye
|
|
8273
8524
|
},
|
|
8274
|
-
children: [u ??
|
|
8525
|
+
children: [u ?? qo(c?.[a]), z && je && /* @__PURE__ */ g("span", {
|
|
8275
8526
|
className: "wb-tedit-rowgrip",
|
|
8276
8527
|
title: Ie("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
8277
8528
|
onPointerDown: Pe(t),
|
|
@@ -8287,7 +8538,7 @@ function Zo({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
8287
8538
|
]
|
|
8288
8539
|
});
|
|
8289
8540
|
}
|
|
8290
|
-
var
|
|
8541
|
+
var ns = {
|
|
8291
8542
|
small: {
|
|
8292
8543
|
cell: 62,
|
|
8293
8544
|
font: 10.5,
|
|
@@ -8312,8 +8563,8 @@ var Qo = {
|
|
|
8312
8563
|
pad: 8,
|
|
8313
8564
|
gap: 4
|
|
8314
8565
|
}
|
|
8315
|
-
},
|
|
8316
|
-
function
|
|
8566
|
+
}, rs = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, is = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), as = 366;
|
|
8567
|
+
function os(e, t = {}) {
|
|
8317
8568
|
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 ? "" : yr(e), a = (e) => {
|
|
8318
8569
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
8319
8570
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
@@ -8330,7 +8581,7 @@ function ns(e, t = {}) {
|
|
|
8330
8581
|
} : null;
|
|
8331
8582
|
}).filter(Boolean);
|
|
8332
8583
|
}
|
|
8333
|
-
function
|
|
8584
|
+
function ss(e) {
|
|
8334
8585
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
8335
8586
|
let n = e?.start ? new Date(e.start) : null;
|
|
8336
8587
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -8345,19 +8596,19 @@ function rs(e) {
|
|
|
8345
8596
|
};
|
|
8346
8597
|
}).filter(Boolean);
|
|
8347
8598
|
}
|
|
8348
|
-
function
|
|
8599
|
+
function cs(e) {
|
|
8349
8600
|
let t = /* @__PURE__ */ new Map();
|
|
8350
8601
|
for (let n of e) {
|
|
8351
|
-
let e =
|
|
8602
|
+
let e = is(n.start), r = n.end ? is(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), as);
|
|
8352
8603
|
for (let r = 0; r <= i; r += 1) {
|
|
8353
|
-
let i =
|
|
8604
|
+
let i = rs(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
8354
8605
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
8355
8606
|
}
|
|
8356
8607
|
}
|
|
8357
8608
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
8358
8609
|
return t;
|
|
8359
8610
|
}
|
|
8360
|
-
function
|
|
8611
|
+
function ls({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: i = "", hrefField: a = "", colorField: o = "", variant: l = "month", size: u = "medium", accent: d = "", eventBg: p = "", eventText: m = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
8361
8612
|
let { tenant: T, apiUrl: E, revision: D, locale: O } = s(Z), k = s(ir)?.[t], [A, j] = f(null), [M, N] = f(() => {
|
|
8362
8613
|
let e = /* @__PURE__ */ new Date();
|
|
8363
8614
|
return {
|
|
@@ -8381,13 +8632,13 @@ function as({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
8381
8632
|
E,
|
|
8382
8633
|
k
|
|
8383
8634
|
]);
|
|
8384
|
-
let P =
|
|
8635
|
+
let P = ns[u] ?? ns.medium, F = d || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = p || F, R = m || "var(--page-accent-text, #ffffff)", z = t ? os(k ?? A ?? [], {
|
|
8385
8636
|
titleField: n,
|
|
8386
8637
|
startField: r,
|
|
8387
8638
|
endField: i,
|
|
8388
8639
|
hrefField: a,
|
|
8389
8640
|
colorField: o
|
|
8390
|
-
}) :
|
|
8641
|
+
}) : ss(e), B = cs(z), V = O || void 0, H = (e, t) => {
|
|
8391
8642
|
let n = /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
|
|
8392
8643
|
...Q("event-dot"),
|
|
8393
8644
|
style: {
|
|
@@ -8530,9 +8781,9 @@ function as({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
8530
8781
|
})]
|
|
8531
8782
|
});
|
|
8532
8783
|
}
|
|
8533
|
-
let q = new Date(M.year, M.month, 1), ee = y === "sunday" ? 0 : 1, te = (q.getDay() - ee + 7) % 7, ne = new Date(M.year, M.month + 1, 0).getDate(), re = Math.ceil((te + ne) / 7), ie =
|
|
8784
|
+
let q = new Date(M.year, M.month, 1), ee = y === "sunday" ? 0 : 1, te = (q.getDay() - ee + 7) % 7, ne = new Date(M.year, M.month + 1, 0).getDate(), re = Math.ceil((te + ne) / 7), ie = rs(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
8534
8785
|
for (let e = 0; e < re * 7; e += 1) {
|
|
8535
|
-
let t = e - te + 1, n = t >= 1 && t <= ne, r =
|
|
8786
|
+
let t = e - te + 1, n = t >= 1 && t <= ne, r = rs(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
8536
8787
|
J.push(/* @__PURE__ */ _("div", {
|
|
8537
8788
|
...Q("day", !n && "day-outside", o && "day-today"),
|
|
8538
8789
|
style: {
|
|
@@ -8602,12 +8853,12 @@ function as({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
8602
8853
|
]
|
|
8603
8854
|
});
|
|
8604
8855
|
}
|
|
8605
|
-
var
|
|
8856
|
+
var us = {
|
|
8606
8857
|
small: 36,
|
|
8607
8858
|
medium: 56,
|
|
8608
8859
|
large: 88
|
|
8609
8860
|
};
|
|
8610
|
-
function
|
|
8861
|
+
function ds(e, t = {}) {
|
|
8611
8862
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : yr(e);
|
|
8612
8863
|
return n.map((e) => {
|
|
8613
8864
|
let n = e.data ?? e, i = _r(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(_r(n, t.nameField)) : r(n.name);
|
|
@@ -8618,7 +8869,7 @@ function ss(e, t = {}) {
|
|
|
8618
8869
|
};
|
|
8619
8870
|
}).filter((e) => e.src);
|
|
8620
8871
|
}
|
|
8621
|
-
function
|
|
8872
|
+
function fs({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: i = "", variant: a = "step", size: o = "medium", perView: l = 5, gap: u = 48, hold: p = 3, slideMs: m = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
8622
8873
|
let { tenant: D, apiUrl: O, revision: k, locale: A } = s(Z), j = Et(A), M = s(ir)?.[t], [N, P] = f(null), F = d(null), I = d(null), [L, R] = f(0), [z, B] = f(0), [V, H] = f(0), [U, W] = f(!0), [G, K] = f(!1), [q, ee] = f(!1), [te, ne] = f(!1), [re, ie] = f(!1);
|
|
8623
8874
|
c(() => {
|
|
8624
8875
|
if (!t || M) return;
|
|
@@ -8659,11 +8910,11 @@ function cs({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
8659
8910
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
8660
8911
|
};
|
|
8661
8912
|
});
|
|
8662
|
-
let ae = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], J = t ?
|
|
8913
|
+
let ae = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], J = t ? ds(M ?? N ?? [], {
|
|
8663
8914
|
imageField: n,
|
|
8664
8915
|
nameField: r,
|
|
8665
8916
|
hrefField: i
|
|
8666
|
-
}) : ae, oe =
|
|
8917
|
+
}) : ae, oe = us[o] ?? us.medium, se = Number.isFinite(Number(u)) ? Math.max(0, Number(u)) : 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(m) || 500)), de = Math.min(12, Math.max(1, Math.round(Number(l) || 5))), fe = (z || oe * 3) + se, pe = L ? Math.max(1, Math.floor(L / fe)) : de, me = Math.min(de, pe), he = L ? Math.min(fe, L / me) : fe;
|
|
8667
8918
|
if (!J.length) return /* @__PURE__ */ g("div", {
|
|
8668
8919
|
ref: T,
|
|
8669
8920
|
style: {
|
|
@@ -8880,7 +9131,7 @@ function cs({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
8880
9131
|
children: /* @__PURE__ */ g("path", { d: te ? "M8 5v14l11-7z" : "M7 5h4v14H7zM13 5h4v14h-4z" })
|
|
8881
9132
|
})
|
|
8882
9133
|
}),
|
|
8883
|
-
/* @__PURE__ */ g(
|
|
9134
|
+
/* @__PURE__ */ g(ps, {
|
|
8884
9135
|
running: ye,
|
|
8885
9136
|
every: le + ue,
|
|
8886
9137
|
slide: ue,
|
|
@@ -8894,7 +9145,7 @@ function cs({ logos: e = [], source: t = "", imageField: n = "", nameField: r =
|
|
|
8894
9145
|
]
|
|
8895
9146
|
});
|
|
8896
9147
|
}
|
|
8897
|
-
function
|
|
9148
|
+
function ps({ running: e, every: t, slide: n, step: r, index: i, total: a, home: o, setIndex: s, setAnimate: l }) {
|
|
8898
9149
|
c(() => {
|
|
8899
9150
|
if (!e) return;
|
|
8900
9151
|
let n = setInterval(() => {
|
|
@@ -8930,13 +9181,13 @@ function ls({ running: e, every: t, slide: n, step: r, index: i, total: a, home:
|
|
|
8930
9181
|
l
|
|
8931
9182
|
]), null;
|
|
8932
9183
|
}
|
|
8933
|
-
var
|
|
9184
|
+
var ms = {
|
|
8934
9185
|
tablet: 991,
|
|
8935
9186
|
mobileLandscape: 767,
|
|
8936
9187
|
mobile: 478
|
|
8937
|
-
},
|
|
8938
|
-
function
|
|
8939
|
-
let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${
|
|
9188
|
+
}, hs = "M4 6h16M4 12h16M4 18h16", gs = (e) => e && Xi[e] ? Xi[e] : hs;
|
|
9189
|
+
function _s({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", width: r = 300, trigger: i = "button", triggerLabel: a = "", icon: s = "", title: u = "", showClose: p = !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 }) {
|
|
9190
|
+
let [O, k] = f(!1), A = `wb-drw-${l().replace(/[^\w-]/g, "")}`, j = d(null), M = t === "always" ? "" : `(max-width: ${ms[t] ?? 991}px)`, N = o(() => b ? b === "drawer" : !M || typeof window < "u" && window.matchMedia(M).matches, [b, M]), P = d(null), [F, I] = f(null);
|
|
8940
9191
|
c(() => {
|
|
8941
9192
|
if (D) {
|
|
8942
9193
|
I(null), k(!1);
|
|
@@ -9093,11 +9344,12 @@ function ps({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
9093
9344
|
className: "wb-drw-head",
|
|
9094
9345
|
style: {
|
|
9095
9346
|
alignItems: "center",
|
|
9347
|
+
justifyContent: u ? void 0 : "flex-end",
|
|
9096
9348
|
gap: 12,
|
|
9097
9349
|
padding: "14px 16px",
|
|
9098
9350
|
...W ? { display: "flex" } : null
|
|
9099
9351
|
},
|
|
9100
|
-
children: [/* @__PURE__ */ g("span", {
|
|
9352
|
+
children: [u && /* @__PURE__ */ g("span", {
|
|
9101
9353
|
...Q("title"),
|
|
9102
9354
|
style: {
|
|
9103
9355
|
flexGrow: 1,
|
|
@@ -9171,7 +9423,7 @@ function ps({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
9171
9423
|
strokeLinecap: "round",
|
|
9172
9424
|
strokeLinejoin: "round",
|
|
9173
9425
|
"aria-hidden": "true",
|
|
9174
|
-
children: /* @__PURE__ */ g("path", { d:
|
|
9426
|
+
children: /* @__PURE__ */ g("path", { d: gs(s) })
|
|
9175
9427
|
}), a ? /* @__PURE__ */ g("span", { children: a }) : null]
|
|
9176
9428
|
}),
|
|
9177
9429
|
W && i !== "button" && !G && /* @__PURE__ */ _("div", {
|
|
@@ -9216,8 +9468,8 @@ function ps({ drawerId: e = "", breakpoint: t = "tablet", side: n = "left", widt
|
|
|
9216
9468
|
]
|
|
9217
9469
|
});
|
|
9218
9470
|
}
|
|
9219
|
-
function
|
|
9220
|
-
let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u =
|
|
9471
|
+
function vs({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r = "", forceMode: i, style: a, nodeRef: o, inert: s = !1 }) {
|
|
9472
|
+
let c = `wb-dbt-${l().replace(/[^\w-]/g, "")}`, u = ms[t], d = i || t === "always" || !u ? "" : `@media (min-width: ${u + 1}px) { .${c} { display: none !important; } }`, f = i === "inline";
|
|
9221
9473
|
return /* @__PURE__ */ _(h, { children: [d ? /* @__PURE__ */ g("style", { children: d }) : null, /* @__PURE__ */ _("button", {
|
|
9222
9474
|
ref: o,
|
|
9223
9475
|
type: "button",
|
|
@@ -9251,20 +9503,20 @@ function ms({ target: e = "", breakpoint: t = "tablet", label: n = "", icon: r =
|
|
|
9251
9503
|
strokeLinecap: "round",
|
|
9252
9504
|
strokeLinejoin: "round",
|
|
9253
9505
|
"aria-hidden": "true",
|
|
9254
|
-
children: /* @__PURE__ */ g("path", { d:
|
|
9506
|
+
children: /* @__PURE__ */ g("path", { d: gs(r) })
|
|
9255
9507
|
}), n ? /* @__PURE__ */ g("span", {
|
|
9256
9508
|
...Q("label"),
|
|
9257
9509
|
children: n
|
|
9258
9510
|
}) : null]
|
|
9259
9511
|
})] });
|
|
9260
9512
|
}
|
|
9261
|
-
var
|
|
9513
|
+
var ys = {
|
|
9262
9514
|
small: 380,
|
|
9263
9515
|
medium: 560,
|
|
9264
9516
|
large: 820,
|
|
9265
9517
|
full: "100%"
|
|
9266
9518
|
};
|
|
9267
|
-
function
|
|
9519
|
+
function bs({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: a = "medium", title: o = "", showClose: s = !0, backdropClose: l = !0, position: u = "center", actions: p = [], showCloseAction: m = !1, closeLabel: h = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
9268
9520
|
let [C, w] = f(!1), T = d(null);
|
|
9269
9521
|
c(() => {
|
|
9270
9522
|
S && w(!1);
|
|
@@ -9291,7 +9543,7 @@ function gs({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
9291
9543
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
9292
9544
|
};
|
|
9293
9545
|
}, [S, C]);
|
|
9294
|
-
let E =
|
|
9546
|
+
let E = ys[a] ?? ys.medium, D = (e) => {
|
|
9295
9547
|
let t = e.variant ?? "primary", n = {
|
|
9296
9548
|
padding: "9px 16px",
|
|
9297
9549
|
borderRadius: 6,
|
|
@@ -9389,11 +9641,12 @@ function gs({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
9389
9641
|
style: {
|
|
9390
9642
|
display: "flex",
|
|
9391
9643
|
alignItems: "center",
|
|
9644
|
+
justifyContent: o ? void 0 : "flex-end",
|
|
9392
9645
|
gap: 12,
|
|
9393
9646
|
padding: "16px 20px",
|
|
9394
9647
|
borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
9395
9648
|
},
|
|
9396
|
-
children: [/* @__PURE__ */ g("span", {
|
|
9649
|
+
children: [o && /* @__PURE__ */ g("span", {
|
|
9397
9650
|
...Q("title"),
|
|
9398
9651
|
style: {
|
|
9399
9652
|
fontWeight: 700,
|
|
@@ -9469,7 +9722,7 @@ function gs({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
9469
9722
|
})]
|
|
9470
9723
|
});
|
|
9471
9724
|
}
|
|
9472
|
-
function
|
|
9725
|
+
function xs({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: i = "left", panelWidth: a = "", offset: o = 8, editorOpen: s = !0, linked: l, style: u, nodeRef: p, inert: m = !1 }) {
|
|
9473
9726
|
let [h, v] = f(!1);
|
|
9474
9727
|
c(() => {
|
|
9475
9728
|
m && v(!1);
|
|
@@ -9576,15 +9829,15 @@ function _s({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
9576
9829
|
}), E]
|
|
9577
9830
|
});
|
|
9578
9831
|
}
|
|
9579
|
-
var
|
|
9832
|
+
var Ss = {
|
|
9580
9833
|
PageRoot: Br,
|
|
9581
9834
|
MarkdownBlock: ai,
|
|
9582
|
-
CalendarBlock:
|
|
9583
|
-
LogoCarousel:
|
|
9584
|
-
DialogBlock:
|
|
9585
|
-
DrawerBlock:
|
|
9586
|
-
DrawerTrigger:
|
|
9587
|
-
DropdownBlock:
|
|
9835
|
+
CalendarBlock: ls,
|
|
9836
|
+
LogoCarousel: fs,
|
|
9837
|
+
DialogBlock: bs,
|
|
9838
|
+
DrawerBlock: _s,
|
|
9839
|
+
DrawerTrigger: vs,
|
|
9840
|
+
DropdownBlock: xs,
|
|
9588
9841
|
Section: Vr,
|
|
9589
9842
|
Container: Hr,
|
|
9590
9843
|
LinkBlock: Ur,
|
|
@@ -9605,13 +9858,15 @@ var vs = {
|
|
|
9605
9858
|
SectionIndexBlock: Qa,
|
|
9606
9859
|
SlideTextBlock: Za,
|
|
9607
9860
|
PaginationBlock: $a,
|
|
9608
|
-
StepperBlock:
|
|
9609
|
-
SocialLinksBlock:
|
|
9861
|
+
StepperBlock: xo,
|
|
9862
|
+
SocialLinksBlock: bo,
|
|
9610
9863
|
ThemeModeBlock: io,
|
|
9611
|
-
ScrollTopBlock:
|
|
9864
|
+
ScrollTopBlock: vo,
|
|
9865
|
+
CustomCursorBlock: _o,
|
|
9866
|
+
TypewriterBlock: ho,
|
|
9612
9867
|
CounterBlock: po,
|
|
9613
|
-
OrgChartBlock:
|
|
9614
|
-
TableBlock:
|
|
9868
|
+
OrgChartBlock: Bo,
|
|
9869
|
+
TableBlock: ts,
|
|
9615
9870
|
IconBlock: Zi,
|
|
9616
9871
|
MapBlock: Yi,
|
|
9617
9872
|
MasonryBlock: $i,
|
|
@@ -9646,15 +9901,15 @@ var vs = {
|
|
|
9646
9901
|
FormFile: Va,
|
|
9647
9902
|
FormRecaptcha: Pa,
|
|
9648
9903
|
FormSubmit: Ua
|
|
9649
|
-
},
|
|
9904
|
+
}, Cs = {
|
|
9650
9905
|
id: "access",
|
|
9651
9906
|
label: "Accessibility toolbar",
|
|
9652
9907
|
category: "Apps",
|
|
9653
9908
|
keys: ["AccessibilityToolbar"],
|
|
9654
9909
|
ssr: "shell",
|
|
9655
9910
|
settings: []
|
|
9656
|
-
},
|
|
9657
|
-
function
|
|
9911
|
+
}, ws = /^[A-Za-z0-9_-]{4,64}$/;
|
|
9912
|
+
function Ts(e) {
|
|
9658
9913
|
try {
|
|
9659
9914
|
let t = new URL(String(e || "").trim());
|
|
9660
9915
|
return t.protocol === "https:" || t.protocol === "http:" ? t.origin : "";
|
|
@@ -9662,10 +9917,10 @@ function xs(e) {
|
|
|
9662
9917
|
return "";
|
|
9663
9918
|
}
|
|
9664
9919
|
}
|
|
9665
|
-
var
|
|
9666
|
-
function
|
|
9667
|
-
let r =
|
|
9668
|
-
return n || a || !r || !
|
|
9920
|
+
var Es = (e) => ws.test(String(e || "").trim());
|
|
9921
|
+
function Ds({ server: e, siteKey: t, inert: n }) {
|
|
9922
|
+
let r = Ts(e), i = String(t || "").trim(), a = typeof window < "u" && !!window.__WEBIM_DASHBOARD__;
|
|
9923
|
+
return n || a || !r || !Es(i) ? null : /* @__PURE__ */ g("script", {
|
|
9669
9924
|
async: !0,
|
|
9670
9925
|
src: `${r}/widget.js`,
|
|
9671
9926
|
"data-site": i
|
|
@@ -9673,39 +9928,39 @@ function Cs({ server: e, siteKey: t, inert: n }) {
|
|
|
9673
9928
|
}
|
|
9674
9929
|
//#endregion
|
|
9675
9930
|
//#region ../ui/src/components/builder/apps/auth/manifest.js
|
|
9676
|
-
var
|
|
9931
|
+
var Os = {
|
|
9677
9932
|
id: "auth",
|
|
9678
9933
|
label: "Accounts",
|
|
9679
9934
|
category: "Apps",
|
|
9680
9935
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
9681
9936
|
ssr: "shell",
|
|
9682
9937
|
settings: ["site.authRedirect"]
|
|
9683
|
-
},
|
|
9938
|
+
}, ks = r({
|
|
9684
9939
|
user: null,
|
|
9685
9940
|
status: "idle",
|
|
9686
9941
|
ensure: () => {},
|
|
9687
9942
|
refresh: () => {},
|
|
9688
9943
|
signOut: () => {}
|
|
9689
9944
|
});
|
|
9690
|
-
function
|
|
9945
|
+
function As(e, t) {
|
|
9691
9946
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
9692
9947
|
}
|
|
9693
|
-
function
|
|
9948
|
+
function js(e) {
|
|
9694
9949
|
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);
|
|
9695
9950
|
return {
|
|
9696
9951
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
9697
9952
|
url: i,
|
|
9698
9953
|
mePath: a,
|
|
9699
9954
|
logoutPath: o,
|
|
9700
|
-
meUrl:
|
|
9701
|
-
logoutUrl:
|
|
9955
|
+
meUrl: As(i, a),
|
|
9956
|
+
logoutUrl: As(i, o),
|
|
9702
9957
|
loginPage: r(n.loginPage),
|
|
9703
9958
|
userPath: r(n.userPath),
|
|
9704
9959
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
9705
9960
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
9706
9961
|
};
|
|
9707
9962
|
}
|
|
9708
|
-
function
|
|
9963
|
+
function Ms(e, t) {
|
|
9709
9964
|
if (!t) return e ?? null;
|
|
9710
9965
|
let n = e;
|
|
9711
9966
|
for (let e of t.split(".")) {
|
|
@@ -9714,26 +9969,26 @@ function Os(e, t) {
|
|
|
9714
9969
|
}
|
|
9715
9970
|
return n ?? null;
|
|
9716
9971
|
}
|
|
9717
|
-
function
|
|
9972
|
+
function Ns(e) {
|
|
9718
9973
|
try {
|
|
9719
9974
|
return window.localStorage.getItem(e) || "";
|
|
9720
9975
|
} catch {
|
|
9721
9976
|
return "";
|
|
9722
9977
|
}
|
|
9723
9978
|
}
|
|
9724
|
-
function
|
|
9979
|
+
function Ps(e) {
|
|
9725
9980
|
try {
|
|
9726
9981
|
window.localStorage.removeItem(e);
|
|
9727
9982
|
} catch {}
|
|
9728
9983
|
}
|
|
9729
|
-
var
|
|
9730
|
-
let e = s(
|
|
9984
|
+
var Fs = () => {
|
|
9985
|
+
let e = s(ks);
|
|
9731
9986
|
return c(() => {
|
|
9732
9987
|
e.ensure();
|
|
9733
9988
|
}, [e]), e;
|
|
9734
9989
|
};
|
|
9735
|
-
function
|
|
9736
|
-
let a = s(Z), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() =>
|
|
9990
|
+
function Is({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i }) {
|
|
9991
|
+
let a = s(Z), l = r || a?.apiUrl || "/api", p = i || a?.tenant || "", m = u(() => js(a?.settings), [a?.settings]), [h, _] = f(t ?? null), [v, y] = f(t ? "user" : n ? "guest" : "idle"), b = d(!1), x = o((e, t) => fetch(`${l}${e}`, {
|
|
9737
9992
|
...t,
|
|
9738
9993
|
credentials: "include",
|
|
9739
9994
|
headers: {
|
|
@@ -9745,9 +10000,9 @@ function Ms({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
9745
10000
|
if (n) return Promise.resolve(null);
|
|
9746
10001
|
if (m.mode === "off") return Promise.resolve(S(null));
|
|
9747
10002
|
if (m.mode === "custom") {
|
|
9748
|
-
let e = m.auth === "bearer" ?
|
|
10003
|
+
let e = m.auth === "bearer" ? Ns(m.tokenKey) : "";
|
|
9749
10004
|
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) => {
|
|
9750
|
-
let t =
|
|
10005
|
+
let t = Ms(e, m.userPath);
|
|
9751
10006
|
return S(t && typeof t == "object" ? t : null);
|
|
9752
10007
|
}).catch(() => S(null));
|
|
9753
10008
|
}
|
|
@@ -9760,12 +10015,12 @@ function Ms({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
9760
10015
|
]), w = o(() => {
|
|
9761
10016
|
if (m.mode === "off") return S(null), Promise.resolve();
|
|
9762
10017
|
if (m.mode === "custom") {
|
|
9763
|
-
let e = m.auth === "bearer" ?
|
|
10018
|
+
let e = m.auth === "bearer" ? Ns(m.tokenKey) : "";
|
|
9764
10019
|
return (m.logoutUrl ? fetch(m.logoutUrl, {
|
|
9765
10020
|
method: "post",
|
|
9766
10021
|
...m.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
9767
10022
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
9768
|
-
m.auth === "bearer" &&
|
|
10023
|
+
m.auth === "bearer" && Ps(m.tokenKey), S(null);
|
|
9769
10024
|
});
|
|
9770
10025
|
}
|
|
9771
10026
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -9815,18 +10070,18 @@ function Ms({ children: e, initialUser: t, disabled: n, apiUrl: r, tenant: i })
|
|
|
9815
10070
|
m.loginPage,
|
|
9816
10071
|
C,
|
|
9817
10072
|
w
|
|
9818
|
-
]), /* @__PURE__ */ g(
|
|
10073
|
+
]), /* @__PURE__ */ g(ks.Provider, {
|
|
9819
10074
|
value: E,
|
|
9820
10075
|
children: e
|
|
9821
10076
|
});
|
|
9822
10077
|
}
|
|
9823
|
-
function
|
|
9824
|
-
let { status: n } =
|
|
10078
|
+
function Ls({ when: e, children: t }) {
|
|
10079
|
+
let { status: n } = Fs();
|
|
9825
10080
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
9826
10081
|
}
|
|
9827
10082
|
//#endregion
|
|
9828
10083
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
9829
|
-
function
|
|
10084
|
+
function Rs({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: i = "Name", submitLabel: a, style: o, nodeRef: c, inert: l, linked: u, show: d }) {
|
|
9830
10085
|
let { tenant: p, apiUrl: m, settings: h } = s(Z), [v, y] = f("form"), [b, x] = f(""), [S, C] = f(!1), w = e === "register", T = l ? d || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
9831
10086
|
if (e.preventDefault(), l) return;
|
|
9832
10087
|
let n = new FormData(e.currentTarget);
|
|
@@ -9959,8 +10214,8 @@ function Ps({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
9959
10214
|
]
|
|
9960
10215
|
});
|
|
9961
10216
|
}
|
|
9962
|
-
function
|
|
9963
|
-
let { user: c, status: l, signOut: u } =
|
|
10217
|
+
function zs({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
10218
|
+
let { user: c, status: l, signOut: u } = Fs(), d = a ? s || "user" : l, f = a ? {
|
|
9964
10219
|
name: "Ada Lovelace",
|
|
9965
10220
|
email: "ada@example.com"
|
|
9966
10221
|
} : c;
|
|
@@ -10028,40 +10283,40 @@ function Fs({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
10028
10283
|
}
|
|
10029
10284
|
//#endregion
|
|
10030
10285
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
10031
|
-
var
|
|
10286
|
+
var Bs = {
|
|
10032
10287
|
id: "consent",
|
|
10033
10288
|
label: "Cookie consent",
|
|
10034
10289
|
category: "Apps",
|
|
10035
10290
|
keys: ["CookieConsent"],
|
|
10036
10291
|
ssr: "shell",
|
|
10037
10292
|
settings: []
|
|
10038
|
-
},
|
|
10039
|
-
function
|
|
10293
|
+
}, Vs = "webim.cookie_consent";
|
|
10294
|
+
function Hs() {
|
|
10040
10295
|
try {
|
|
10041
|
-
let e = window.localStorage.getItem(
|
|
10296
|
+
let e = window.localStorage.getItem(Vs), t = e ? JSON.parse(e) : null;
|
|
10042
10297
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
10043
10298
|
} catch {
|
|
10044
10299
|
return "";
|
|
10045
10300
|
}
|
|
10046
10301
|
}
|
|
10047
|
-
function
|
|
10302
|
+
function Us(e) {
|
|
10048
10303
|
try {
|
|
10049
10304
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
10050
10305
|
} catch {}
|
|
10051
10306
|
}
|
|
10052
|
-
function
|
|
10307
|
+
function Ws(e) {
|
|
10053
10308
|
try {
|
|
10054
|
-
window.localStorage.setItem(
|
|
10309
|
+
window.localStorage.setItem(Vs, JSON.stringify({
|
|
10055
10310
|
choice: e,
|
|
10056
10311
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
10057
10312
|
}));
|
|
10058
10313
|
} catch {}
|
|
10059
|
-
|
|
10314
|
+
Us(e);
|
|
10060
10315
|
try {
|
|
10061
10316
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
10062
10317
|
} catch {}
|
|
10063
10318
|
}
|
|
10064
|
-
var
|
|
10319
|
+
var Gs = {
|
|
10065
10320
|
bottom: {
|
|
10066
10321
|
left: 0,
|
|
10067
10322
|
right: 0,
|
|
@@ -10083,18 +10338,18 @@ var Vs = {
|
|
|
10083
10338
|
maxWidth: 400
|
|
10084
10339
|
}
|
|
10085
10340
|
};
|
|
10086
|
-
function
|
|
10341
|
+
function Ks({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: a, position: o, linked: s, style: l, nodeRef: u, inert: d }) {
|
|
10087
10342
|
let [p, m] = f(!!d), [v, y] = f(null), b = (e) => {
|
|
10088
10343
|
y(e), typeof u == "function" && u(e);
|
|
10089
10344
|
};
|
|
10090
10345
|
if (c(() => {
|
|
10091
10346
|
if (d) return;
|
|
10092
|
-
let e =
|
|
10093
|
-
e ?
|
|
10347
|
+
let e = Hs();
|
|
10348
|
+
e ? Us(e) : m(!0);
|
|
10094
10349
|
}, [d, v]), !p) return null;
|
|
10095
10350
|
let x = (e) => () => {
|
|
10096
|
-
d || (
|
|
10097
|
-
}, S =
|
|
10351
|
+
d || (Ws(e), m(!1));
|
|
10352
|
+
}, S = Gs[o] ?? Gs.bottom, C = {
|
|
10098
10353
|
appearance: "none",
|
|
10099
10354
|
font: "inherit",
|
|
10100
10355
|
fontSize: 14,
|
|
@@ -10179,37 +10434,37 @@ function Hs({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
10179
10434
|
}
|
|
10180
10435
|
//#endregion
|
|
10181
10436
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
10182
|
-
var
|
|
10437
|
+
var qs = {
|
|
10183
10438
|
id: "language",
|
|
10184
10439
|
label: "Language",
|
|
10185
10440
|
category: "Apps",
|
|
10186
10441
|
keys: ["SiteLanguagePicker"],
|
|
10187
10442
|
ssr: "prefetch",
|
|
10188
10443
|
settings: ["locales"]
|
|
10189
|
-
},
|
|
10444
|
+
}, Js = {
|
|
10190
10445
|
id: "search",
|
|
10191
10446
|
label: "Search",
|
|
10192
10447
|
category: "Apps",
|
|
10193
10448
|
keys: ["SiteSearch"],
|
|
10194
10449
|
ssr: "prefetch",
|
|
10195
10450
|
settings: []
|
|
10196
|
-
},
|
|
10197
|
-
function
|
|
10451
|
+
}, Ys = 50, Xs = 2e3;
|
|
10452
|
+
function Zs() {
|
|
10198
10453
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
10199
10454
|
}
|
|
10200
|
-
function
|
|
10455
|
+
function Qs(e, t) {
|
|
10201
10456
|
let n = e?.data ?? {}, r = [];
|
|
10202
10457
|
for (let e of Object.values(n)) {
|
|
10203
10458
|
let t = e == null ? "" : yr(e);
|
|
10204
|
-
if (t && r.push(t), r.join(" ").length >
|
|
10459
|
+
if (t && r.push(t), r.join(" ").length > Xs) break;
|
|
10205
10460
|
}
|
|
10206
|
-
return r.join(" ").slice(0,
|
|
10461
|
+
return r.join(" ").slice(0, Xs).toLocaleLowerCase(t || void 0);
|
|
10207
10462
|
}
|
|
10208
|
-
function
|
|
10209
|
-
let { tenant: x, apiUrl: S, locale: C } = s(Z), [w, T] = f(() =>
|
|
10463
|
+
function $s({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: a = "inline", includePages: o = !0, collections: l = [], limit: u = 10, emptyText: p = "Nothing found", hint: m = "", style: h, nodeRef: v, inert: y = !1, sample: b = !1 }) {
|
|
10464
|
+
let { tenant: x, apiUrl: S, locale: C } = s(Z), [w, T] = f(() => Zs()), [E, D] = f(() => Zs()), [O, k] = f(null), [A, j] = f(!1), M = d(null), N = a === "popup";
|
|
10210
10465
|
c(() => {
|
|
10211
10466
|
let e = () => {
|
|
10212
|
-
let e =
|
|
10467
|
+
let e = Zs();
|
|
10213
10468
|
T(e), D(e);
|
|
10214
10469
|
};
|
|
10215
10470
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -10260,7 +10515,7 @@ function Ys({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
10260
10515
|
});
|
|
10261
10516
|
}
|
|
10262
10517
|
else for (let t of e.rows) {
|
|
10263
|
-
if (!
|
|
10518
|
+
if (!Qs(t, C).includes(P)) continue;
|
|
10264
10519
|
let n = t?.data ?? {}, r = yr(n.name) || "Untitled", i = yr(n.slug);
|
|
10265
10520
|
F.push({
|
|
10266
10521
|
key: `entry:${t.id}`,
|
|
@@ -10269,7 +10524,7 @@ function Ys({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
10269
10524
|
kind: "entry"
|
|
10270
10525
|
});
|
|
10271
10526
|
}
|
|
10272
|
-
let I = F.slice(0, Math.min(Math.max(1, u),
|
|
10527
|
+
let I = F.slice(0, Math.min(Math.max(1, u), Ys)), L = (e) => {
|
|
10273
10528
|
if (y) {
|
|
10274
10529
|
e.preventDefault(), T(E), j(!0);
|
|
10275
10530
|
return;
|
|
@@ -10422,7 +10677,7 @@ function Ys({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
10422
10677
|
}
|
|
10423
10678
|
//#endregion
|
|
10424
10679
|
//#region ../ui/src/components/builder/apps/shop/manifest.js
|
|
10425
|
-
var
|
|
10680
|
+
var ec = {
|
|
10426
10681
|
id: "shop",
|
|
10427
10682
|
label: "Shop",
|
|
10428
10683
|
category: "Shop",
|
|
@@ -10437,7 +10692,7 @@ var Xs = {
|
|
|
10437
10692
|
],
|
|
10438
10693
|
ssr: "shell",
|
|
10439
10694
|
settings: ["shop.enabled"]
|
|
10440
|
-
},
|
|
10695
|
+
}, tc = "webim.cart.", nc = "webim.currency.", rc = /* @__PURE__ */ new Map(), ic = {
|
|
10441
10696
|
get(e) {
|
|
10442
10697
|
try {
|
|
10443
10698
|
return window.localStorage.getItem(e) ?? "";
|
|
@@ -10451,7 +10706,7 @@ var Xs = {
|
|
|
10451
10706
|
} catch {}
|
|
10452
10707
|
}
|
|
10453
10708
|
};
|
|
10454
|
-
function
|
|
10709
|
+
function ac(e) {
|
|
10455
10710
|
if (typeof window > "u") return !1;
|
|
10456
10711
|
try {
|
|
10457
10712
|
return new URL(e, window.location.href).origin === window.location.origin;
|
|
@@ -10459,10 +10714,10 @@ function tc(e) {
|
|
|
10459
10714
|
return !1;
|
|
10460
10715
|
}
|
|
10461
10716
|
}
|
|
10462
|
-
async function
|
|
10717
|
+
async function oc(e, t, n, { method: r = "GET", body: i } = {}) {
|
|
10463
10718
|
let a = await fetch(`${e}${n}`, {
|
|
10464
10719
|
method: r,
|
|
10465
|
-
...
|
|
10720
|
+
...ac(e) ? { credentials: "include" } : {},
|
|
10466
10721
|
headers: {
|
|
10467
10722
|
...t ? { "x-tenant": t } : {},
|
|
10468
10723
|
...i ? { "content-type": "application/json" } : {}
|
|
@@ -10478,7 +10733,7 @@ async function nc(e, t, n, { method: r = "GET", body: i } = {}) {
|
|
|
10478
10733
|
}
|
|
10479
10734
|
return o.payload;
|
|
10480
10735
|
}
|
|
10481
|
-
var
|
|
10736
|
+
var sc = {
|
|
10482
10737
|
id: "",
|
|
10483
10738
|
currency: "",
|
|
10484
10739
|
lines: [],
|
|
@@ -10493,29 +10748,29 @@ var rc = {
|
|
|
10493
10748
|
shipping_total: 0,
|
|
10494
10749
|
total: 0
|
|
10495
10750
|
};
|
|
10496
|
-
function
|
|
10497
|
-
let n = `${
|
|
10498
|
-
cart:
|
|
10751
|
+
function cc(e, t) {
|
|
10752
|
+
let n = `${tc}${t || "default"}`, r = `${nc}${t || "default"}`, i = /* @__PURE__ */ new Set(), a = {
|
|
10753
|
+
cart: sc,
|
|
10499
10754
|
loading: !1,
|
|
10500
10755
|
loaded: !1,
|
|
10501
10756
|
error: null,
|
|
10502
|
-
currency:
|
|
10757
|
+
currency: ic.get(r)
|
|
10503
10758
|
}, o = null, s = () => i.forEach((e) => e()), c = (e) => {
|
|
10504
10759
|
a = {
|
|
10505
10760
|
...a,
|
|
10506
10761
|
...e
|
|
10507
10762
|
}, s();
|
|
10508
|
-
}, l = (e) => (e && typeof e == "object" && (e.id &&
|
|
10763
|
+
}, l = (e) => (e && typeof e == "object" && (e.id && ic.set(n, e.id), c({
|
|
10509
10764
|
cart: e,
|
|
10510
10765
|
loaded: !0,
|
|
10511
10766
|
error: null
|
|
10512
10767
|
})), e), u = () => {
|
|
10513
10768
|
if (o) return o;
|
|
10514
|
-
let r =
|
|
10769
|
+
let r = ic.get(n), i = new URLSearchParams({
|
|
10515
10770
|
...r ? { id: r } : {},
|
|
10516
10771
|
...a.currency ? { currency: a.currency } : {}
|
|
10517
10772
|
}).toString();
|
|
10518
|
-
return c({ loading: !0 }), o =
|
|
10773
|
+
return c({ loading: !0 }), o = oc(e, t, `/store/cart${i ? `?${i}` : ""}`).then(l).catch((e) => c({
|
|
10519
10774
|
error: e,
|
|
10520
10775
|
loaded: !0
|
|
10521
10776
|
})).finally(() => {
|
|
@@ -10524,10 +10779,10 @@ function ic(e, t) {
|
|
|
10524
10779
|
}, d = async (r, i, o) => {
|
|
10525
10780
|
c({ loading: !0 });
|
|
10526
10781
|
try {
|
|
10527
|
-
return l(await
|
|
10782
|
+
return l(await oc(e, t, "/store/cart", {
|
|
10528
10783
|
method: "POST",
|
|
10529
10784
|
body: {
|
|
10530
|
-
cart_id:
|
|
10785
|
+
cart_id: ic.get(n) || void 0,
|
|
10531
10786
|
product_id: r,
|
|
10532
10787
|
variant_id: i ?? null,
|
|
10533
10788
|
quantity: o,
|
|
@@ -10539,7 +10794,7 @@ function ic(e, t) {
|
|
|
10539
10794
|
}
|
|
10540
10795
|
};
|
|
10541
10796
|
return typeof window < "u" && window.addEventListener("storage", (e) => {
|
|
10542
|
-
e.key === r && c({ currency:
|
|
10797
|
+
e.key === r && c({ currency: ic.get(r) }), (e.key === n || e.key === r) && u();
|
|
10543
10798
|
}), {
|
|
10544
10799
|
getState: () => a,
|
|
10545
10800
|
subscribe: (e) => (i.add(e), () => i.delete(e)),
|
|
@@ -10552,10 +10807,10 @@ function ic(e, t) {
|
|
|
10552
10807
|
setCoupon: async (r) => {
|
|
10553
10808
|
c({ loading: !0 });
|
|
10554
10809
|
try {
|
|
10555
|
-
return l(await
|
|
10810
|
+
return l(await oc(e, t, "/store/cart/coupon", {
|
|
10556
10811
|
method: "POST",
|
|
10557
10812
|
body: {
|
|
10558
|
-
cart_id:
|
|
10813
|
+
cart_id: ic.get(n),
|
|
10559
10814
|
code: r
|
|
10560
10815
|
}
|
|
10561
10816
|
}));
|
|
@@ -10563,64 +10818,64 @@ function ic(e, t) {
|
|
|
10563
10818
|
c({ loading: !1 });
|
|
10564
10819
|
}
|
|
10565
10820
|
},
|
|
10566
|
-
setCountry: async (r, i) =>
|
|
10821
|
+
setCountry: async (r, i) => ic.get(n) ? l(await oc(e, t, "/store/cart/country", {
|
|
10567
10822
|
method: "POST",
|
|
10568
10823
|
body: {
|
|
10569
|
-
cart_id:
|
|
10824
|
+
cart_id: ic.get(n),
|
|
10570
10825
|
country: r,
|
|
10571
10826
|
...i !== void 0 && { postal_code: i }
|
|
10572
10827
|
}
|
|
10573
10828
|
})) : a.cart,
|
|
10574
|
-
setDelivery: async (r) =>
|
|
10829
|
+
setDelivery: async (r) => ic.get(n) ? l(await oc(e, t, "/store/cart/delivery", {
|
|
10575
10830
|
method: "POST",
|
|
10576
10831
|
body: {
|
|
10577
|
-
cart_id:
|
|
10832
|
+
cart_id: ic.get(n),
|
|
10578
10833
|
delivery: r
|
|
10579
10834
|
}
|
|
10580
10835
|
})) : a.cart,
|
|
10581
10836
|
setCurrency: async (i) => {
|
|
10582
|
-
if (
|
|
10837
|
+
if (ic.set(r, i), c({ currency: i }), !ic.get(n)) return u();
|
|
10583
10838
|
try {
|
|
10584
|
-
return l(await
|
|
10839
|
+
return l(await oc(e, t, "/store/cart/currency", {
|
|
10585
10840
|
method: "POST",
|
|
10586
10841
|
body: {
|
|
10587
|
-
cart_id:
|
|
10842
|
+
cart_id: ic.get(n),
|
|
10588
10843
|
currency: i
|
|
10589
10844
|
}
|
|
10590
10845
|
}));
|
|
10591
10846
|
} catch {
|
|
10592
|
-
return
|
|
10847
|
+
return ic.set(r, ""), c({ currency: "" }), u();
|
|
10593
10848
|
}
|
|
10594
10849
|
},
|
|
10595
10850
|
reset: () => {
|
|
10596
|
-
|
|
10851
|
+
ic.set(n, ""), c({ cart: sc });
|
|
10597
10852
|
},
|
|
10598
|
-
cartId: () =>
|
|
10853
|
+
cartId: () => ic.get(n)
|
|
10599
10854
|
};
|
|
10600
10855
|
}
|
|
10601
|
-
function
|
|
10856
|
+
function lc(e, t) {
|
|
10602
10857
|
let n = `${e}|${t}`;
|
|
10603
|
-
return
|
|
10858
|
+
return rc.has(n) || rc.set(n, cc(e, t)), rc.get(n);
|
|
10604
10859
|
}
|
|
10605
|
-
function
|
|
10860
|
+
function uc(e, t) {
|
|
10606
10861
|
let n = Array.isArray(e?.currencies) ? e.currencies : [];
|
|
10607
10862
|
return t && n.includes(t) ? t : e?.currency || "";
|
|
10608
10863
|
}
|
|
10609
|
-
var
|
|
10610
|
-
function
|
|
10864
|
+
var dc = "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(" ");
|
|
10865
|
+
function fc(e, t = [], n = null) {
|
|
10611
10866
|
let r;
|
|
10612
10867
|
try {
|
|
10613
10868
|
r = new Intl.DisplayNames([e || "en"], { type: "region" });
|
|
10614
10869
|
} catch {
|
|
10615
10870
|
r = { of: (e) => e };
|
|
10616
10871
|
}
|
|
10617
|
-
let i = (n ??
|
|
10872
|
+
let i = (n ?? dc).map((e) => ({
|
|
10618
10873
|
code: e,
|
|
10619
10874
|
name: r.of(e) ?? e
|
|
10620
10875
|
})), 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));
|
|
10621
10876
|
return [...a, ...o];
|
|
10622
10877
|
}
|
|
10623
|
-
function
|
|
10878
|
+
function pc(e, t, n) {
|
|
10624
10879
|
let r = t || "USD";
|
|
10625
10880
|
try {
|
|
10626
10881
|
let t = new Intl.NumberFormat(n || void 0, {
|
|
@@ -10632,7 +10887,7 @@ function lc(e, t, n) {
|
|
|
10632
10887
|
return `${(Number(e || 0) / 100).toFixed(2)} ${r}`;
|
|
10633
10888
|
}
|
|
10634
10889
|
}
|
|
10635
|
-
var
|
|
10890
|
+
var mc = {
|
|
10636
10891
|
en: {
|
|
10637
10892
|
add: "Add to cart",
|
|
10638
10893
|
adding: "Adding…",
|
|
@@ -10964,24 +11219,24 @@ var uc = {
|
|
|
10964
11219
|
no: "Hayır"
|
|
10965
11220
|
}
|
|
10966
11221
|
};
|
|
10967
|
-
function
|
|
10968
|
-
let t =
|
|
10969
|
-
let r = t[e] ??
|
|
11222
|
+
function hc(e) {
|
|
11223
|
+
let t = mc[String(e || "").toLowerCase().split("-")[0]] ?? mc.en, n = (e, n) => {
|
|
11224
|
+
let r = t[e] ?? mc.en[e] ?? e;
|
|
10970
11225
|
return n ? r.replace(/\{(\w+)\}/g, (e, t) => t in n ? String(n[t]) : e) : r;
|
|
10971
11226
|
};
|
|
10972
|
-
return n.has = (e) => e in
|
|
11227
|
+
return n.has = (e) => e in mc.en, n;
|
|
10973
11228
|
}
|
|
10974
|
-
var
|
|
10975
|
-
function
|
|
11229
|
+
var gc = (e, t) => t?.code && e.has(t.code) ? e(t.code) : t?.message ?? "", _c = /* @__PURE__ */ new Map();
|
|
11230
|
+
function vc(e, t) {
|
|
10976
11231
|
let n = `${e}|${t}`;
|
|
10977
|
-
return
|
|
11232
|
+
return _c.has(n) || _c.set(n, oc(e, t, "/store/policies").then((e) => Array.isArray(e) ? e : []).catch(() => (_c.delete(n), []))), _c.get(n);
|
|
10978
11233
|
}
|
|
10979
|
-
function
|
|
11234
|
+
function yc(e) {
|
|
10980
11235
|
let t = /* @__PURE__ */ new Date(), n = Math.max(0, Math.round(Number(e) || 0));
|
|
10981
11236
|
for (; n > 0;) t.setDate(t.getDate() + 1), t.getDay() !== 0 && t.getDay() !== 6 && --n;
|
|
10982
11237
|
return t;
|
|
10983
11238
|
}
|
|
10984
|
-
function
|
|
11239
|
+
function bc(e, t, n, r) {
|
|
10985
11240
|
let i = (e) => e != null && Number.isFinite(Number(e));
|
|
10986
11241
|
if (!i(n) && !i(r)) return "";
|
|
10987
11242
|
let a;
|
|
@@ -10996,7 +11251,7 @@ function gc(e, t, n, r) {
|
|
|
10996
11251
|
day: "numeric"
|
|
10997
11252
|
});
|
|
10998
11253
|
}
|
|
10999
|
-
let o = a.format(
|
|
11254
|
+
let o = a.format(yc(i(n) ? n : r)), s = a.format(yc(i(r) ? r : n));
|
|
11000
11255
|
return o === s ? e("arrives", { date: o }) : e("arrivesRange", {
|
|
11001
11256
|
from: o,
|
|
11002
11257
|
to: s
|
|
@@ -11004,7 +11259,7 @@ function gc(e, t, n, r) {
|
|
|
11004
11259
|
}
|
|
11005
11260
|
//#endregion
|
|
11006
11261
|
//#region ../ui/src/components/builder/apps/shop/engagement.jsx
|
|
11007
|
-
var
|
|
11262
|
+
var xc = "var(--page-muted, rgba(100,116,139,1))", Sc = "1px solid var(--page-border, #d1d5db)", Cc = "var(--page-surface, #f2f2f2)", wc = "#f59e0b", Tc = {
|
|
11008
11263
|
...Fr,
|
|
11009
11264
|
border: 0,
|
|
11010
11265
|
borderRadius: "8px",
|
|
@@ -11012,14 +11267,14 @@ var _c = "var(--page-muted, rgba(100,116,139,1))", vc = "1px solid var(--page-bo
|
|
|
11012
11267
|
fontSize: "14px",
|
|
11013
11268
|
fontWeight: 600,
|
|
11014
11269
|
fontFamily: "inherit"
|
|
11015
|
-
},
|
|
11016
|
-
...
|
|
11270
|
+
}, Ec = {
|
|
11271
|
+
...Tc,
|
|
11017
11272
|
backgroundColor: "transparent",
|
|
11018
11273
|
color: "var(--page-text, #111827)",
|
|
11019
|
-
border:
|
|
11274
|
+
border: Sc
|
|
11020
11275
|
};
|
|
11021
|
-
function
|
|
11022
|
-
let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Z), i = u(() =>
|
|
11276
|
+
function Dc() {
|
|
11277
|
+
let { tenant: e, apiUrl: t, locale: n, settings: r } = s(Z), i = u(() => hc(n), [n]), a = (e) => r?.[e] !== !1;
|
|
11023
11278
|
return {
|
|
11024
11279
|
tenant: e,
|
|
11025
11280
|
apiUrl: t || "/api",
|
|
@@ -11030,12 +11285,12 @@ function Cc() {
|
|
|
11030
11285
|
favoritesOn: a("shop.favorites"),
|
|
11031
11286
|
moderated: r?.["shop.reviewModeration"] !== "auto",
|
|
11032
11287
|
loginHref: () => {
|
|
11033
|
-
let e =
|
|
11288
|
+
let e = js(r).loginPage || "/login", t = typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`;
|
|
11034
11289
|
return t ? `${e}${e.includes("?") ? "&" : "?"}next=${encodeURIComponent(t)}` : e;
|
|
11035
11290
|
}
|
|
11036
11291
|
};
|
|
11037
11292
|
}
|
|
11038
|
-
var
|
|
11293
|
+
var Oc = (e, t) => {
|
|
11039
11294
|
try {
|
|
11040
11295
|
return new Intl.NumberFormat(t || void 0, {
|
|
11041
11296
|
notation: "compact",
|
|
@@ -11044,7 +11299,7 @@ var wc = (e, t) => {
|
|
|
11044
11299
|
} catch {
|
|
11045
11300
|
return String(e);
|
|
11046
11301
|
}
|
|
11047
|
-
},
|
|
11302
|
+
}, kc = (e, t) => {
|
|
11048
11303
|
try {
|
|
11049
11304
|
return new Intl.DateTimeFormat(t || void 0, {
|
|
11050
11305
|
day: "numeric",
|
|
@@ -11054,8 +11309,8 @@ var wc = (e, t) => {
|
|
|
11054
11309
|
} catch {
|
|
11055
11310
|
return String(e).slice(0, 10);
|
|
11056
11311
|
}
|
|
11057
|
-
},
|
|
11058
|
-
function
|
|
11312
|
+
}, Ac = "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";
|
|
11313
|
+
function jc({ fill: e = 0, size: t = 16, clipId: n }) {
|
|
11059
11314
|
return /* @__PURE__ */ _("svg", {
|
|
11060
11315
|
width: t,
|
|
11061
11316
|
height: t,
|
|
@@ -11073,18 +11328,18 @@ function Dc({ fill: e = 0, size: t = 16, clipId: n }) {
|
|
|
11073
11328
|
})
|
|
11074
11329
|
}) }),
|
|
11075
11330
|
/* @__PURE__ */ g("path", {
|
|
11076
|
-
d:
|
|
11331
|
+
d: Ac,
|
|
11077
11332
|
fill: "var(--page-border, #d1d5db)"
|
|
11078
11333
|
}),
|
|
11079
11334
|
e > 0 && /* @__PURE__ */ g("path", {
|
|
11080
|
-
d:
|
|
11081
|
-
fill:
|
|
11335
|
+
d: Ac,
|
|
11336
|
+
fill: wc,
|
|
11082
11337
|
clipPath: `url(#${n})`
|
|
11083
11338
|
})
|
|
11084
11339
|
]
|
|
11085
11340
|
});
|
|
11086
11341
|
}
|
|
11087
|
-
function
|
|
11342
|
+
function Mc({ value: e = 0, size: t = 16 }) {
|
|
11088
11343
|
let n = l().replace(/:/g, "");
|
|
11089
11344
|
return /* @__PURE__ */ g("span", {
|
|
11090
11345
|
role: "img",
|
|
@@ -11101,14 +11356,14 @@ function Oc({ value: e = 0, size: t = 16 }) {
|
|
|
11101
11356
|
2,
|
|
11102
11357
|
3,
|
|
11103
11358
|
4
|
|
11104
|
-
].map((r) => /* @__PURE__ */ g(
|
|
11359
|
+
].map((r) => /* @__PURE__ */ g(jc, {
|
|
11105
11360
|
fill: Math.max(0, Math.min(1, e - r)),
|
|
11106
11361
|
size: t,
|
|
11107
11362
|
clipId: `${n}-${r}`
|
|
11108
11363
|
}, r))
|
|
11109
11364
|
});
|
|
11110
11365
|
}
|
|
11111
|
-
function
|
|
11366
|
+
function Nc({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
11112
11367
|
let i = l().replace(/:/g, ""), [a, o] = f(0), s = a || e;
|
|
11113
11368
|
return /* @__PURE__ */ g("span", {
|
|
11114
11369
|
role: "radiogroup",
|
|
@@ -11139,7 +11394,7 @@ function kc({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
|
11139
11394
|
cursor: "pointer",
|
|
11140
11395
|
lineHeight: 0
|
|
11141
11396
|
},
|
|
11142
|
-
children: /* @__PURE__ */ g(
|
|
11397
|
+
children: /* @__PURE__ */ g(jc, {
|
|
11143
11398
|
fill: +(s >= r),
|
|
11144
11399
|
size: n,
|
|
11145
11400
|
clipId: `${i}-${r}`
|
|
@@ -11147,15 +11402,15 @@ function kc({ value: e, onChange: t, size: n = 28, label: r }) {
|
|
|
11147
11402
|
}, r))
|
|
11148
11403
|
});
|
|
11149
11404
|
}
|
|
11150
|
-
function
|
|
11151
|
-
let { tenant: n, apiUrl: r, favoritesOn: i } =
|
|
11405
|
+
function Pc(e, { inert: t }) {
|
|
11406
|
+
let { tenant: n, apiUrl: r, favoritesOn: i } = Dc(), [a, o] = f({
|
|
11152
11407
|
favorited: !1,
|
|
11153
11408
|
count: null
|
|
11154
11409
|
});
|
|
11155
11410
|
c(() => {
|
|
11156
11411
|
if (!e || !i || t) return;
|
|
11157
11412
|
let a = !0;
|
|
11158
|
-
return
|
|
11413
|
+
return oc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`).then((e) => a && o(e)).catch(() => {}), () => {
|
|
11159
11414
|
a = !1;
|
|
11160
11415
|
};
|
|
11161
11416
|
}, [
|
|
@@ -11172,7 +11427,7 @@ function Ac(e, { inert: t }) {
|
|
|
11172
11427
|
count: Math.max(0, (e.count ?? 0) + (t ? 1 : -1))
|
|
11173
11428
|
}));
|
|
11174
11429
|
try {
|
|
11175
|
-
o(await
|
|
11430
|
+
o(await oc(r, n, `/store/products/${encodeURIComponent(e)}/favorite`, {
|
|
11176
11431
|
method: "POST",
|
|
11177
11432
|
body: { on: t }
|
|
11178
11433
|
}));
|
|
@@ -11188,7 +11443,7 @@ function Ac(e, { inert: t }) {
|
|
|
11188
11443
|
toggle: s
|
|
11189
11444
|
};
|
|
11190
11445
|
}
|
|
11191
|
-
var
|
|
11446
|
+
var Fc = (e) => /* @__PURE__ */ g("svg", {
|
|
11192
11447
|
width: "20",
|
|
11193
11448
|
height: "20",
|
|
11194
11449
|
viewBox: "0 0 24 24",
|
|
@@ -11201,8 +11456,8 @@ var jc = (e) => /* @__PURE__ */ g("svg", {
|
|
|
11201
11456
|
strokeWidth: "1.8"
|
|
11202
11457
|
})
|
|
11203
11458
|
});
|
|
11204
|
-
function
|
|
11205
|
-
let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } =
|
|
11459
|
+
function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
11460
|
+
let { locale: r, words: i, reviewsOn: a, questionsOn: o, favoritesOn: s, loginHref: c } = Dc(), l = e?.sample ? "" : e?.slug || e?.id || "", u = Pc(l, { inert: t || !l }), [d, p] = f(""), m = n ? 29 : e?.rating_count ?? 0, h = 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) => {
|
|
11206
11461
|
n.preventDefault(), !t && document.getElementById(e)?.scrollIntoView({
|
|
11207
11462
|
behavior: "smooth",
|
|
11208
11463
|
block: "start"
|
|
@@ -11211,7 +11466,7 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11211
11466
|
if (!(t || !l)) try {
|
|
11212
11467
|
await u.toggle();
|
|
11213
11468
|
} catch (e) {
|
|
11214
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(
|
|
11469
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(c()) : p(gc(i, e));
|
|
11215
11470
|
}
|
|
11216
11471
|
}, S = [];
|
|
11217
11472
|
return a && m > 0 && S.push(/* @__PURE__ */ _("span", {
|
|
@@ -11229,13 +11484,13 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11229
11484
|
maximumFractionDigits: 1
|
|
11230
11485
|
})
|
|
11231
11486
|
}),
|
|
11232
|
-
/* @__PURE__ */ g(
|
|
11487
|
+
/* @__PURE__ */ g(Mc, { value: h }),
|
|
11233
11488
|
/* @__PURE__ */ g("a", {
|
|
11234
11489
|
href: "#reviews",
|
|
11235
11490
|
onClick: b("reviews"),
|
|
11236
11491
|
...Q("rating-link"),
|
|
11237
11492
|
style: { color: "inherit" },
|
|
11238
|
-
children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n:
|
|
11493
|
+
children: m === 1 ? i("reviewsOne") : i("reviewsCount", { n: Oc(m, r) })
|
|
11239
11494
|
})
|
|
11240
11495
|
]
|
|
11241
11496
|
}, "r")), o && v > 0 && S.push(/* @__PURE__ */ g("a", {
|
|
@@ -11243,7 +11498,7 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11243
11498
|
onClick: b("questions"),
|
|
11244
11499
|
...Q("qa-link"),
|
|
11245
11500
|
style: { color: "inherit" },
|
|
11246
|
-
children: i("qaCount", { n:
|
|
11501
|
+
children: i("qaCount", { n: Oc(v, r) })
|
|
11247
11502
|
}, "q")), !S.length && !s ? null : /* @__PURE__ */ _("div", {
|
|
11248
11503
|
...Q("engagement"),
|
|
11249
11504
|
style: {
|
|
@@ -11262,7 +11517,7 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11262
11517
|
},
|
|
11263
11518
|
children: S.flatMap((e, t) => t ? [/* @__PURE__ */ g("span", {
|
|
11264
11519
|
...Q("separator"),
|
|
11265
|
-
style: { color:
|
|
11520
|
+
style: { color: xc },
|
|
11266
11521
|
children: "•"
|
|
11267
11522
|
}, `s${t}`), e] : [e])
|
|
11268
11523
|
}),
|
|
@@ -11280,22 +11535,22 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11280
11535
|
"aria-label": u.favorited ? i("unfavorite") : i("favorite"),
|
|
11281
11536
|
title: u.favorited ? i("unfavorite") : i("favorite"),
|
|
11282
11537
|
style: {
|
|
11283
|
-
...
|
|
11538
|
+
...Ec,
|
|
11284
11539
|
padding: "7px",
|
|
11285
11540
|
borderRadius: "999px",
|
|
11286
11541
|
lineHeight: 0
|
|
11287
11542
|
},
|
|
11288
|
-
children:
|
|
11543
|
+
children: Fc(u.favorited)
|
|
11289
11544
|
}), y > 0 && /* @__PURE__ */ g("span", {
|
|
11290
11545
|
...Q("favorites-count"),
|
|
11291
11546
|
style: { fontWeight: 600 },
|
|
11292
|
-
children: y === 1 ? i("lovedByOne") : i("lovedBy", { n:
|
|
11547
|
+
children: y === 1 ? i("lovedByOne") : i("lovedBy", { n: Oc(y, r) })
|
|
11293
11548
|
})]
|
|
11294
11549
|
}),
|
|
11295
11550
|
d && /* @__PURE__ */ g("span", {
|
|
11296
11551
|
...Q("note"),
|
|
11297
11552
|
style: {
|
|
11298
|
-
color:
|
|
11553
|
+
color: xc,
|
|
11299
11554
|
fontSize: "13px"
|
|
11300
11555
|
},
|
|
11301
11556
|
children: d
|
|
@@ -11303,7 +11558,7 @@ function Mc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11303
11558
|
]
|
|
11304
11559
|
});
|
|
11305
11560
|
}
|
|
11306
|
-
var
|
|
11561
|
+
var Lc = {
|
|
11307
11562
|
data: [{
|
|
11308
11563
|
id: "s1",
|
|
11309
11564
|
author: "Ayşe Y.",
|
|
@@ -11339,8 +11594,8 @@ var Nc = {
|
|
|
11339
11594
|
]
|
|
11340
11595
|
}
|
|
11341
11596
|
};
|
|
11342
|
-
function
|
|
11343
|
-
let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } =
|
|
11597
|
+
function Rc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
11598
|
+
let { tenant: r, apiUrl: i, locale: a, words: o, reviewsOn: s, moderated: l, loginHref: u } = Dc(), d = Fs(), p = e?.sample ? "" : e?.slug || e?.id || "", [m, h] = f(null), [v, y] = f("newest"), [b, x] = f(0), [S, C] = f(5), [w, T] = f(0), [E, D] = f({
|
|
11344
11599
|
rating: 0,
|
|
11345
11600
|
title: "",
|
|
11346
11601
|
body: ""
|
|
@@ -11348,7 +11603,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11348
11603
|
if (c(() => {
|
|
11349
11604
|
if (!s || !p) return;
|
|
11350
11605
|
let e = !0, t = `?limit=${S}&sort=${v}${b ? `&rating=${b}` : ""}`;
|
|
11351
|
-
return
|
|
11606
|
+
return oc(i, r, `/store/products/${encodeURIComponent(p)}/reviews${t}`).then((t) => e && h(t)).catch(() => e && h({
|
|
11352
11607
|
data: [],
|
|
11353
11608
|
total: {
|
|
11354
11609
|
all: 0,
|
|
@@ -11378,7 +11633,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11378
11633
|
w,
|
|
11379
11634
|
s
|
|
11380
11635
|
]), !s) return null;
|
|
11381
|
-
let P = n || !p ?
|
|
11636
|
+
let P = n || !p ? Lc : m, F = P?.summary ?? {
|
|
11382
11637
|
average: 0,
|
|
11383
11638
|
count: 0,
|
|
11384
11639
|
histogram: [
|
|
@@ -11411,12 +11666,12 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11411
11666
|
}
|
|
11412
11667
|
j(!0), N("");
|
|
11413
11668
|
try {
|
|
11414
|
-
await
|
|
11669
|
+
await oc(i, r, `/store/products/${encodeURIComponent(p)}/reviews`, {
|
|
11415
11670
|
method: "POST",
|
|
11416
11671
|
body: E
|
|
11417
11672
|
}), k(!1), N(o(l ? "reviewPending" : "reviewThanks")), T((e) => e + 1);
|
|
11418
11673
|
} catch (e) {
|
|
11419
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(
|
|
11674
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(u()) : N(gc(o, e));
|
|
11420
11675
|
} finally {
|
|
11421
11676
|
j(!1);
|
|
11422
11677
|
}
|
|
@@ -11468,14 +11723,14 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11468
11723
|
maximumFractionDigits: 1
|
|
11469
11724
|
}) : "–"
|
|
11470
11725
|
}),
|
|
11471
|
-
/* @__PURE__ */ g(
|
|
11726
|
+
/* @__PURE__ */ g(Mc, {
|
|
11472
11727
|
value: F.average,
|
|
11473
11728
|
size: 18
|
|
11474
11729
|
}),
|
|
11475
11730
|
/* @__PURE__ */ g("span", {
|
|
11476
11731
|
...Q("reviews-count"),
|
|
11477
11732
|
style: {
|
|
11478
|
-
color:
|
|
11733
|
+
color: xc,
|
|
11479
11734
|
fontSize: "13px"
|
|
11480
11735
|
},
|
|
11481
11736
|
children: F.count === 1 ? o("reviewsOne") : o("reviewsCount", { n: F.count })
|
|
@@ -11527,7 +11782,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11527
11782
|
style: {
|
|
11528
11783
|
height: "8px",
|
|
11529
11784
|
borderRadius: "4px",
|
|
11530
|
-
background:
|
|
11785
|
+
background: Cc,
|
|
11531
11786
|
overflow: "hidden"
|
|
11532
11787
|
},
|
|
11533
11788
|
children: /* @__PURE__ */ g("span", {
|
|
@@ -11536,13 +11791,13 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11536
11791
|
display: "block",
|
|
11537
11792
|
height: "100%",
|
|
11538
11793
|
width: `${n / B * 100}%`,
|
|
11539
|
-
background:
|
|
11794
|
+
background: wc
|
|
11540
11795
|
}
|
|
11541
11796
|
})
|
|
11542
11797
|
}),
|
|
11543
11798
|
/* @__PURE__ */ g("span", {
|
|
11544
11799
|
style: {
|
|
11545
|
-
color:
|
|
11800
|
+
color: xc,
|
|
11546
11801
|
textAlign: "right"
|
|
11547
11802
|
},
|
|
11548
11803
|
children: n
|
|
@@ -11557,7 +11812,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11557
11812
|
type: "button",
|
|
11558
11813
|
onClick: R,
|
|
11559
11814
|
...Q("review-button"),
|
|
11560
|
-
style:
|
|
11815
|
+
style: Tc,
|
|
11561
11816
|
children: o(L || t ? I ? "editReview" : "writeReview" : "signInToReview")
|
|
11562
11817
|
})
|
|
11563
11818
|
})
|
|
@@ -11571,7 +11826,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11571
11826
|
flexDirection: "column",
|
|
11572
11827
|
gap: "10px",
|
|
11573
11828
|
padding: "16px",
|
|
11574
|
-
border:
|
|
11829
|
+
border: Sc,
|
|
11575
11830
|
borderRadius: "12px"
|
|
11576
11831
|
},
|
|
11577
11832
|
children: [
|
|
@@ -11583,7 +11838,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11583
11838
|
gap: "12px",
|
|
11584
11839
|
fontWeight: 600
|
|
11585
11840
|
},
|
|
11586
|
-
children: [o("yourRating"), /* @__PURE__ */ g(
|
|
11841
|
+
children: [o("yourRating"), /* @__PURE__ */ g(Nc, {
|
|
11587
11842
|
value: E.rating,
|
|
11588
11843
|
label: o("yourRating"),
|
|
11589
11844
|
onChange: (e) => D((t) => ({
|
|
@@ -11628,13 +11883,13 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11628
11883
|
type: "submit",
|
|
11629
11884
|
disabled: A,
|
|
11630
11885
|
...Q("submit-button"),
|
|
11631
|
-
style:
|
|
11886
|
+
style: Tc,
|
|
11632
11887
|
children: o("submitReview")
|
|
11633
11888
|
}), /* @__PURE__ */ g("button", {
|
|
11634
11889
|
type: "button",
|
|
11635
11890
|
onClick: () => k(!1),
|
|
11636
11891
|
...Q("cancel-button"),
|
|
11637
|
-
style:
|
|
11892
|
+
style: Ec,
|
|
11638
11893
|
children: "✕"
|
|
11639
11894
|
})]
|
|
11640
11895
|
})
|
|
@@ -11644,7 +11899,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11644
11899
|
...Q("note"),
|
|
11645
11900
|
style: {
|
|
11646
11901
|
margin: 0,
|
|
11647
|
-
color:
|
|
11902
|
+
color: xc
|
|
11648
11903
|
},
|
|
11649
11904
|
children: M
|
|
11650
11905
|
}),
|
|
@@ -11688,7 +11943,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11688
11943
|
onClick: () => x(0),
|
|
11689
11944
|
...Q("filter-chip"),
|
|
11690
11945
|
style: {
|
|
11691
|
-
...
|
|
11946
|
+
...Ec,
|
|
11692
11947
|
padding: "6px 12px"
|
|
11693
11948
|
},
|
|
11694
11949
|
children: [o("starsN", { n: b }), " ✕"]
|
|
@@ -11698,7 +11953,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11698
11953
|
...Q("empty"),
|
|
11699
11954
|
style: {
|
|
11700
11955
|
margin: 0,
|
|
11701
|
-
color:
|
|
11956
|
+
color: xc
|
|
11702
11957
|
},
|
|
11703
11958
|
children: o("noReviews")
|
|
11704
11959
|
}),
|
|
@@ -11711,7 +11966,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11711
11966
|
...Q("review"),
|
|
11712
11967
|
style: {
|
|
11713
11968
|
padding: "16px 0",
|
|
11714
|
-
borderTop:
|
|
11969
|
+
borderTop: Sc,
|
|
11715
11970
|
display: "flex",
|
|
11716
11971
|
flexDirection: "column",
|
|
11717
11972
|
gap: "6px"
|
|
@@ -11725,7 +11980,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11725
11980
|
flexWrap: "wrap"
|
|
11726
11981
|
},
|
|
11727
11982
|
children: [
|
|
11728
|
-
/* @__PURE__ */ g(
|
|
11983
|
+
/* @__PURE__ */ g(Mc, { value: e.rating }),
|
|
11729
11984
|
e.title && /* @__PURE__ */ g("strong", {
|
|
11730
11985
|
...Q("review-title"),
|
|
11731
11986
|
children: e.title
|
|
@@ -11736,8 +11991,8 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11736
11991
|
fontSize: "12px",
|
|
11737
11992
|
padding: "2px 8px",
|
|
11738
11993
|
borderRadius: "999px",
|
|
11739
|
-
background:
|
|
11740
|
-
color:
|
|
11994
|
+
background: Cc,
|
|
11995
|
+
color: xc
|
|
11741
11996
|
},
|
|
11742
11997
|
children: o("awaitingApproval")
|
|
11743
11998
|
})
|
|
@@ -11756,12 +12011,12 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11756
12011
|
...Q("meta"),
|
|
11757
12012
|
style: {
|
|
11758
12013
|
fontSize: "13px",
|
|
11759
|
-
color:
|
|
12014
|
+
color: xc
|
|
11760
12015
|
},
|
|
11761
12016
|
children: [
|
|
11762
12017
|
e.author || o("anonymous"),
|
|
11763
12018
|
" · ",
|
|
11764
|
-
|
|
12019
|
+
kc(e.created_at, a),
|
|
11765
12020
|
e.verified && /* @__PURE__ */ _("span", {
|
|
11766
12021
|
...Q("verified"),
|
|
11767
12022
|
style: {
|
|
@@ -11778,7 +12033,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11778
12033
|
marginTop: "4px",
|
|
11779
12034
|
padding: "10px 12px",
|
|
11780
12035
|
borderRadius: "8px",
|
|
11781
|
-
background:
|
|
12036
|
+
background: Cc,
|
|
11782
12037
|
fontSize: "14px"
|
|
11783
12038
|
},
|
|
11784
12039
|
children: [/* @__PURE__ */ g("strong", {
|
|
@@ -11786,7 +12041,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11786
12041
|
style: {
|
|
11787
12042
|
display: "block",
|
|
11788
12043
|
fontSize: "12px",
|
|
11789
|
-
color:
|
|
12044
|
+
color: xc,
|
|
11790
12045
|
marginBottom: "2px"
|
|
11791
12046
|
},
|
|
11792
12047
|
children: o("shopReply")
|
|
@@ -11803,7 +12058,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11803
12058
|
onClick: () => C((e) => e + 10),
|
|
11804
12059
|
...Q("load-more"),
|
|
11805
12060
|
style: {
|
|
11806
|
-
...
|
|
12061
|
+
...Ec,
|
|
11807
12062
|
alignSelf: "center"
|
|
11808
12063
|
},
|
|
11809
12064
|
children: o("loadMore")
|
|
@@ -11811,7 +12066,7 @@ function Pc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11811
12066
|
]
|
|
11812
12067
|
});
|
|
11813
12068
|
}
|
|
11814
|
-
var
|
|
12069
|
+
var zc = {
|
|
11815
12070
|
data: [{
|
|
11816
12071
|
id: "q1",
|
|
11817
12072
|
author: "Can D.",
|
|
@@ -11824,12 +12079,12 @@ var Fc = {
|
|
|
11824
12079
|
filtered: 1
|
|
11825
12080
|
}
|
|
11826
12081
|
};
|
|
11827
|
-
function
|
|
11828
|
-
let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } =
|
|
12082
|
+
function Bc({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
12083
|
+
let { tenant: r, apiUrl: i, locale: a, words: o, questionsOn: s, loginHref: l } = Dc(), u = Fs(), d = e?.sample ? "" : e?.slug || e?.id || "", [p, m] = f(null), [h, v] = f(5), [y, b] = f(0), [x, S] = f(""), [C, w] = f(!1), [T, E] = f("");
|
|
11829
12084
|
if (c(() => {
|
|
11830
12085
|
if (!s || !d) return;
|
|
11831
12086
|
let e = !0;
|
|
11832
|
-
return
|
|
12087
|
+
return oc(i, r, `/store/products/${encodeURIComponent(d)}/questions?limit=${h}`).then((t) => e && m(t)).catch(() => e && m({
|
|
11833
12088
|
data: [],
|
|
11834
12089
|
total: {
|
|
11835
12090
|
all: 0,
|
|
@@ -11846,7 +12101,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11846
12101
|
y,
|
|
11847
12102
|
s
|
|
11848
12103
|
]), !s) return null;
|
|
11849
|
-
let D = n || !d ?
|
|
12104
|
+
let D = n || !d ? zc : p, O = u.status === "user", k = async (e) => {
|
|
11850
12105
|
if (e.preventDefault(), !(t || x.trim().length < 3)) {
|
|
11851
12106
|
if (!O) {
|
|
11852
12107
|
window.location.assign(l());
|
|
@@ -11854,12 +12109,12 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11854
12109
|
}
|
|
11855
12110
|
w(!0), E("");
|
|
11856
12111
|
try {
|
|
11857
|
-
await
|
|
12112
|
+
await oc(i, r, `/store/products/${encodeURIComponent(d)}/questions`, {
|
|
11858
12113
|
method: "POST",
|
|
11859
12114
|
body: { question: x.trim() }
|
|
11860
12115
|
}), S(""), E(o("questionPending")), b((e) => e + 1);
|
|
11861
12116
|
} catch (e) {
|
|
11862
|
-
e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(
|
|
12117
|
+
e?.code === "LOGIN_REQUIRED" ? window.location.assign(l()) : E(gc(o, e));
|
|
11863
12118
|
} finally {
|
|
11864
12119
|
w(!1);
|
|
11865
12120
|
}
|
|
@@ -11905,7 +12160,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11905
12160
|
type: "submit",
|
|
11906
12161
|
disabled: C || x.trim().length < 3,
|
|
11907
12162
|
...Q("submit-button"),
|
|
11908
|
-
style:
|
|
12163
|
+
style: Tc,
|
|
11909
12164
|
children: o("submitQuestion")
|
|
11910
12165
|
})]
|
|
11911
12166
|
}) : /* @__PURE__ */ g("p", {
|
|
@@ -11921,7 +12176,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11921
12176
|
...Q("note"),
|
|
11922
12177
|
style: {
|
|
11923
12178
|
margin: 0,
|
|
11924
|
-
color:
|
|
12179
|
+
color: xc
|
|
11925
12180
|
},
|
|
11926
12181
|
children: T
|
|
11927
12182
|
}),
|
|
@@ -11929,7 +12184,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11929
12184
|
...Q("empty"),
|
|
11930
12185
|
style: {
|
|
11931
12186
|
margin: 0,
|
|
11932
|
-
color:
|
|
12187
|
+
color: xc
|
|
11933
12188
|
},
|
|
11934
12189
|
children: o("noQuestions")
|
|
11935
12190
|
}),
|
|
@@ -11942,7 +12197,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11942
12197
|
...Q("question"),
|
|
11943
12198
|
style: {
|
|
11944
12199
|
padding: "14px 0",
|
|
11945
|
-
borderTop:
|
|
12200
|
+
borderTop: Sc,
|
|
11946
12201
|
display: "flex",
|
|
11947
12202
|
flexDirection: "column",
|
|
11948
12203
|
gap: "6px"
|
|
@@ -11983,7 +12238,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11983
12238
|
...Q("badge"),
|
|
11984
12239
|
style: {
|
|
11985
12240
|
fontSize: "12px",
|
|
11986
|
-
color:
|
|
12241
|
+
color: xc
|
|
11987
12242
|
},
|
|
11988
12243
|
children: o("awaitingAnswer")
|
|
11989
12244
|
}),
|
|
@@ -11991,12 +12246,12 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
11991
12246
|
...Q("meta"),
|
|
11992
12247
|
style: {
|
|
11993
12248
|
fontSize: "12px",
|
|
11994
|
-
color:
|
|
12249
|
+
color: xc
|
|
11995
12250
|
},
|
|
11996
12251
|
children: [
|
|
11997
12252
|
e.author || o("anonymous"),
|
|
11998
12253
|
" · ",
|
|
11999
|
-
|
|
12254
|
+
kc(e.created_at, a)
|
|
12000
12255
|
]
|
|
12001
12256
|
})
|
|
12002
12257
|
]
|
|
@@ -12007,7 +12262,7 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
12007
12262
|
onClick: () => v((e) => e + 10),
|
|
12008
12263
|
...Q("load-more"),
|
|
12009
12264
|
style: {
|
|
12010
|
-
...
|
|
12265
|
+
...Ec,
|
|
12011
12266
|
alignSelf: "center"
|
|
12012
12267
|
},
|
|
12013
12268
|
children: o("loadMore")
|
|
@@ -12017,8 +12272,8 @@ function Ic({ product: e, inert: t = !1, sample: n = !1 }) {
|
|
|
12017
12272
|
}
|
|
12018
12273
|
//#endregion
|
|
12019
12274
|
//#region ../ui/src/components/builder/apps/shop/specs.jsx
|
|
12020
|
-
var
|
|
12021
|
-
function
|
|
12275
|
+
var Vc = "1px solid var(--page-border, #d1d5db)", Hc = "var(--page-muted, rgba(100,116,139,1))", Uc = (e) => /^(https?:)?\/\//i.test(String(e)) || String(e).startsWith("/") ? String(e) : "";
|
|
12276
|
+
function Wc(e, t, n, r) {
|
|
12022
12277
|
let i = n || void 0;
|
|
12023
12278
|
switch (e.type) {
|
|
12024
12279
|
case "integer":
|
|
@@ -12041,7 +12296,7 @@ function Bc(e, t, n, r) {
|
|
|
12041
12296
|
gap: "6px"
|
|
12042
12297
|
},
|
|
12043
12298
|
children: [
|
|
12044
|
-
n === 5 && /* @__PURE__ */ g(
|
|
12299
|
+
n === 5 && /* @__PURE__ */ g(Mc, { value: Number(t) }),
|
|
12045
12300
|
Number(t).toLocaleString(i),
|
|
12046
12301
|
" / ",
|
|
12047
12302
|
n
|
|
@@ -12073,12 +12328,12 @@ function Bc(e, t, n, r) {
|
|
|
12073
12328
|
height: "14px",
|
|
12074
12329
|
borderRadius: "4px",
|
|
12075
12330
|
background: t,
|
|
12076
|
-
border:
|
|
12331
|
+
border: Vc,
|
|
12077
12332
|
display: "inline-block"
|
|
12078
12333
|
} }), t]
|
|
12079
12334
|
});
|
|
12080
12335
|
case "link": {
|
|
12081
|
-
let e =
|
|
12336
|
+
let e = Uc(t);
|
|
12082
12337
|
return e ? /* @__PURE__ */ g("a", {
|
|
12083
12338
|
href: e,
|
|
12084
12339
|
target: "_blank",
|
|
@@ -12087,7 +12342,7 @@ function Bc(e, t, n, r) {
|
|
|
12087
12342
|
children: t
|
|
12088
12343
|
}) : String(t);
|
|
12089
12344
|
}
|
|
12090
|
-
case "image": return
|
|
12345
|
+
case "image": return Uc(t) ? /* @__PURE__ */ g("img", {
|
|
12091
12346
|
src: t,
|
|
12092
12347
|
alt: e.name,
|
|
12093
12348
|
style: {
|
|
@@ -12098,14 +12353,14 @@ function Bc(e, t, n, r) {
|
|
|
12098
12353
|
}
|
|
12099
12354
|
}) : "";
|
|
12100
12355
|
case "video":
|
|
12101
|
-
case "file": return
|
|
12356
|
+
case "file": return Uc(t) ? /* @__PURE__ */ g("a", {
|
|
12102
12357
|
href: t,
|
|
12103
12358
|
target: "_blank",
|
|
12104
12359
|
rel: "noopener noreferrer",
|
|
12105
12360
|
style: { color: "var(--page-accent, #111827)" },
|
|
12106
12361
|
children: String(t).split("/").pop()
|
|
12107
12362
|
}) : "";
|
|
12108
|
-
case "media": return (Array.isArray(t) ? t : [t]).filter(
|
|
12363
|
+
case "media": return (Array.isArray(t) ? t : [t]).filter(Uc).map((e, t) => /* @__PURE__ */ g("a", {
|
|
12109
12364
|
href: e,
|
|
12110
12365
|
target: "_blank",
|
|
12111
12366
|
rel: "noopener noreferrer",
|
|
@@ -12145,7 +12400,7 @@ function Bc(e, t, n, r) {
|
|
|
12145
12400
|
default: return String(t);
|
|
12146
12401
|
}
|
|
12147
12402
|
}
|
|
12148
|
-
function
|
|
12403
|
+
function Gc({ specs: e, locale: t, words: n }) {
|
|
12149
12404
|
return !Array.isArray(e) || !e.length ? null : /* @__PURE__ */ _("section", {
|
|
12150
12405
|
...Q("specs"),
|
|
12151
12406
|
style: {
|
|
@@ -12164,7 +12419,7 @@ function Vc({ specs: e, locale: t, words: n }) {
|
|
|
12164
12419
|
role: "table",
|
|
12165
12420
|
...Q("specs-table"),
|
|
12166
12421
|
style: {
|
|
12167
|
-
border:
|
|
12422
|
+
border: Vc,
|
|
12168
12423
|
borderRadius: "10px",
|
|
12169
12424
|
overflow: "hidden"
|
|
12170
12425
|
},
|
|
@@ -12178,13 +12433,13 @@ function Vc({ specs: e, locale: t, words: n }) {
|
|
|
12178
12433
|
gridTemplateColumns: "minmax(120px, 34%) 1fr",
|
|
12179
12434
|
gap: "16px",
|
|
12180
12435
|
padding: "10px 14px",
|
|
12181
|
-
borderTop: r ?
|
|
12436
|
+
borderTop: r ? Vc : 0,
|
|
12182
12437
|
fontSize: "14px"
|
|
12183
12438
|
},
|
|
12184
12439
|
children: [/* @__PURE__ */ g("span", {
|
|
12185
12440
|
role: "rowheader",
|
|
12186
12441
|
...Q("spec-name"),
|
|
12187
|
-
style: { color:
|
|
12442
|
+
style: { color: Hc },
|
|
12188
12443
|
children: e.name
|
|
12189
12444
|
}), /* @__PURE__ */ g("span", {
|
|
12190
12445
|
role: "cell",
|
|
@@ -12195,7 +12450,7 @@ function Vc({ specs: e, locale: t, words: n }) {
|
|
|
12195
12450
|
gap: "4px 10px",
|
|
12196
12451
|
alignItems: "center"
|
|
12197
12452
|
},
|
|
12198
|
-
children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [
|
|
12453
|
+
children: i.map((r, a) => /* @__PURE__ */ _("span", { children: [Wc(e, r, t, n), a < i.length - 1 && e.type !== "color" ? "," : ""] }, a))
|
|
12199
12454
|
})]
|
|
12200
12455
|
}, e.key);
|
|
12201
12456
|
})
|
|
@@ -12204,7 +12459,7 @@ function Vc({ specs: e, locale: t, words: n }) {
|
|
|
12204
12459
|
}
|
|
12205
12460
|
//#endregion
|
|
12206
12461
|
//#region ../ui/src/components/builder/apps/shop/views.jsx
|
|
12207
|
-
var $ = "var(--page-muted, rgba(100,116,139,1))",
|
|
12462
|
+
var $ = "var(--page-muted, rgba(100,116,139,1))", Kc = "1px solid var(--page-border, #d1d5db)", qc = "var(--page-surface, #f2f2f2)", Jc = {
|
|
12208
12463
|
...Fr,
|
|
12209
12464
|
border: 0,
|
|
12210
12465
|
borderRadius: "8px",
|
|
@@ -12213,14 +12468,14 @@ var $ = "var(--page-muted, rgba(100,116,139,1))", Hc = "1px solid var(--page-bor
|
|
|
12213
12468
|
fontWeight: 600,
|
|
12214
12469
|
fontFamily: "inherit",
|
|
12215
12470
|
textAlign: "center"
|
|
12216
|
-
},
|
|
12217
|
-
...
|
|
12471
|
+
}, Yc = {
|
|
12472
|
+
...Jc,
|
|
12218
12473
|
backgroundColor: "transparent",
|
|
12219
12474
|
color: "var(--page-text, #111827)",
|
|
12220
|
-
border:
|
|
12475
|
+
border: Kc
|
|
12221
12476
|
};
|
|
12222
|
-
function
|
|
12223
|
-
let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Z), a = u(() =>
|
|
12477
|
+
function Xc() {
|
|
12478
|
+
let { tenant: e, apiUrl: t, locale: n, param: r, settings: i } = s(Z), a = u(() => hc(n), [n]), c = i?.["shop.orderPrefix"], l = i?.["shop.orderSuffix"], d = o((e) => `${typeof c == "string" ? c : "#"}${e}${typeof l == "string" ? l : ""}`, [c, l]);
|
|
12224
12479
|
return {
|
|
12225
12480
|
tenant: e,
|
|
12226
12481
|
apiUrl: t || "/api",
|
|
@@ -12230,8 +12485,8 @@ function Kc() {
|
|
|
12230
12485
|
orderId: d
|
|
12231
12486
|
};
|
|
12232
12487
|
}
|
|
12233
|
-
function
|
|
12234
|
-
let r = u(() =>
|
|
12488
|
+
function Zc(e, t, n = !0) {
|
|
12489
|
+
let r = u(() => lc(e, t), [e, t]), i = p(r.subscribe, r.getState, r.getState);
|
|
12235
12490
|
return c(() => {
|
|
12236
12491
|
n && !i.loaded && !i.loading && r.load();
|
|
12237
12492
|
}, [n, r]), {
|
|
@@ -12239,8 +12494,8 @@ function qc(e, t, n = !0) {
|
|
|
12239
12494
|
...i
|
|
12240
12495
|
};
|
|
12241
12496
|
}
|
|
12242
|
-
var
|
|
12243
|
-
function
|
|
12497
|
+
var Qc = (e) => typeof window > "u" ? "" : new URLSearchParams(window.location.search).get(e) ?? "";
|
|
12498
|
+
function $c({ value: e, label: t, onCommit: n }) {
|
|
12244
12499
|
let [r, i] = f(null), a = () => {
|
|
12245
12500
|
if (r === null) return;
|
|
12246
12501
|
let t = Math.max(1, Math.round(Number(r)) || 1);
|
|
@@ -12264,12 +12519,12 @@ function Yc({ value: e, label: t, onCommit: n }) {
|
|
|
12264
12519
|
}
|
|
12265
12520
|
});
|
|
12266
12521
|
}
|
|
12267
|
-
var
|
|
12268
|
-
function
|
|
12522
|
+
var el = "/product/{slug}", tl = (e) => !e || e === "/product?product={slug}" ? el : e, nl = (e, t) => String(tl(e)).replace(/\{slug\}/g, encodeURIComponent(t.slug)).replace(/\{id\}/g, t.id);
|
|
12523
|
+
function rl(e) {
|
|
12269
12524
|
let t = e.variants?.length ? e.variants.map((e) => e.stock) : [e.stock];
|
|
12270
12525
|
return t.some((e) => e == null) ? null : t.reduce((e, t) => e + Number(t), 0);
|
|
12271
12526
|
}
|
|
12272
|
-
function
|
|
12527
|
+
function il({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
12273
12528
|
let i = e.currency, a = t?.price ?? e.price;
|
|
12274
12529
|
return /* @__PURE__ */ _("span", {
|
|
12275
12530
|
...Q("price"),
|
|
@@ -12282,7 +12537,7 @@ function el({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
|
12282
12537
|
children: [/* @__PURE__ */ g("span", {
|
|
12283
12538
|
...Q("price-current"),
|
|
12284
12539
|
style: { fontWeight: 700 },
|
|
12285
|
-
children:
|
|
12540
|
+
children: pc(a, i, n)
|
|
12286
12541
|
}), e.compare_at_price > a && /* @__PURE__ */ g("span", {
|
|
12287
12542
|
...Q("price-old"),
|
|
12288
12543
|
style: {
|
|
@@ -12290,11 +12545,11 @@ function el({ product: e, variant: t, locale: n, size: r = 16 }) {
|
|
|
12290
12545
|
textDecoration: "line-through",
|
|
12291
12546
|
fontSize: "0.85em"
|
|
12292
12547
|
},
|
|
12293
|
-
children:
|
|
12548
|
+
children: pc(e.compare_at_price, i, n)
|
|
12294
12549
|
})]
|
|
12295
12550
|
});
|
|
12296
12551
|
}
|
|
12297
|
-
var
|
|
12552
|
+
var al = [
|
|
12298
12553
|
1,
|
|
12299
12554
|
2,
|
|
12300
12555
|
3
|
|
@@ -12310,17 +12565,17 @@ var tl = [
|
|
|
12310
12565
|
currency: "USD",
|
|
12311
12566
|
sample: !0
|
|
12312
12567
|
}));
|
|
12313
|
-
function
|
|
12314
|
-
let { tenant: y, apiUrl: b, locale: x, words: S } =
|
|
12568
|
+
function ol({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/product/{slug}", showButton: i = !0, buttonLabel: a = "", emptyText: o = "", collection: s = "", source: l = "catalog", loginHref: u = "", style: d, nodeRef: p, inert: m = !1, sample: h = !1, noNavigate: v = !1 }) {
|
|
12569
|
+
let { tenant: y, apiUrl: b, locale: x, words: S } = Xc(), C = Dc(), [w, T] = f(null), [E, D] = f(null), [O, k] = f(""), [A, j] = f({}), [M, N] = f(!1), { store: P, currency: F } = Zc(b, y, !m), I = l === "favorites";
|
|
12315
12570
|
c(() => {
|
|
12316
12571
|
let e = !0, n = Math.max(1, Math.min(100, Number(t) || 12)), r = F ? `¤cy=${encodeURIComponent(F)}` : "";
|
|
12317
12572
|
if (I && m) {
|
|
12318
12573
|
T([]);
|
|
12319
12574
|
return;
|
|
12320
12575
|
}
|
|
12321
|
-
return N(!1), Promise.all([
|
|
12576
|
+
return N(!1), Promise.all([oc(b, y, I ? `/store/my/favorites?limit=${n}${r}` : `/store/products?limit=${n}${r}${s ? `&collection=${encodeURIComponent(s)}` : ""}`), oc(b, y, "/store/config")]).then(([t, n]) => {
|
|
12322
12577
|
if (!e) return;
|
|
12323
|
-
let r =
|
|
12578
|
+
let r = uc(n, F);
|
|
12324
12579
|
D(n), T(Array.isArray(t?.data) ? t.data.map((e) => ({
|
|
12325
12580
|
...e,
|
|
12326
12581
|
currency: r
|
|
@@ -12339,7 +12594,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12339
12594
|
I,
|
|
12340
12595
|
m
|
|
12341
12596
|
]);
|
|
12342
|
-
let L = w?.length || !h ? w ?? [] :
|
|
12597
|
+
let L = w?.length || !h ? w ?? [] : al, R = async (e) => {
|
|
12343
12598
|
if (!(m || e.sample)) {
|
|
12344
12599
|
k(e.id);
|
|
12345
12600
|
try {
|
|
@@ -12350,7 +12605,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12350
12605
|
} catch (t) {
|
|
12351
12606
|
j((n) => ({
|
|
12352
12607
|
...n,
|
|
12353
|
-
[e.id]:
|
|
12608
|
+
[e.id]: gc(S, t)
|
|
12354
12609
|
}));
|
|
12355
12610
|
} finally {
|
|
12356
12611
|
k("");
|
|
@@ -12395,7 +12650,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12395
12650
|
gap: `${n}px`
|
|
12396
12651
|
},
|
|
12397
12652
|
children: L.map((e) => {
|
|
12398
|
-
let t =
|
|
12653
|
+
let t = rl(e) === 0, n = nl(r, e);
|
|
12399
12654
|
return /* @__PURE__ */ _("div", {
|
|
12400
12655
|
...Q("card"),
|
|
12401
12656
|
style: {
|
|
@@ -12418,7 +12673,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12418
12673
|
aspectRatio: "1 / 1",
|
|
12419
12674
|
borderRadius: "10px",
|
|
12420
12675
|
overflow: "hidden",
|
|
12421
|
-
background:
|
|
12676
|
+
background: qc
|
|
12422
12677
|
},
|
|
12423
12678
|
children: e.images?.[0] && /* @__PURE__ */ g("img", {
|
|
12424
12679
|
src: e.images[0],
|
|
@@ -12451,16 +12706,16 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12451
12706
|
color: $
|
|
12452
12707
|
},
|
|
12453
12708
|
children: [
|
|
12454
|
-
/* @__PURE__ */ g(
|
|
12709
|
+
/* @__PURE__ */ g(Mc, {
|
|
12455
12710
|
value: Number(e.rating_avg),
|
|
12456
12711
|
size: 14
|
|
12457
12712
|
}),
|
|
12458
12713
|
"(",
|
|
12459
|
-
|
|
12714
|
+
Oc(e.rating_count, x),
|
|
12460
12715
|
")"
|
|
12461
12716
|
]
|
|
12462
12717
|
}),
|
|
12463
|
-
/* @__PURE__ */ g(
|
|
12718
|
+
/* @__PURE__ */ g(il, {
|
|
12464
12719
|
product: e,
|
|
12465
12720
|
locale: x
|
|
12466
12721
|
}),
|
|
@@ -12469,7 +12724,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12469
12724
|
onClick: v ? (e) => e.preventDefault() : void 0,
|
|
12470
12725
|
...Q("choose-button"),
|
|
12471
12726
|
style: {
|
|
12472
|
-
...
|
|
12727
|
+
...Yc,
|
|
12473
12728
|
display: "block"
|
|
12474
12729
|
},
|
|
12475
12730
|
children: S("choose")
|
|
@@ -12479,7 +12734,7 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12479
12734
|
onClick: () => R(e),
|
|
12480
12735
|
...Q("add-button", t && "add-button-sold-out"),
|
|
12481
12736
|
style: {
|
|
12482
|
-
...
|
|
12737
|
+
...Jc,
|
|
12483
12738
|
opacity: t ? .5 : 1
|
|
12484
12739
|
},
|
|
12485
12740
|
children: t ? S("soldOut") : O === e.id ? S("adding") : a || S("add")
|
|
@@ -12499,24 +12754,24 @@ function nl({ columns: e = 3, limit: t = 12, gap: n = 20, productHref: r = "/pro
|
|
|
12499
12754
|
]
|
|
12500
12755
|
});
|
|
12501
12756
|
}
|
|
12502
|
-
function
|
|
12503
|
-
let { tenant: d, apiUrl: p, locale: m, param: h, words: v } =
|
|
12757
|
+
function sl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuestions: r = !0, showSpecs: i = !0, style: a, nodeRef: o, inert: s = !1, sample: l = !1, noNavigate: u = !1 }) {
|
|
12758
|
+
let { tenant: d, apiUrl: p, locale: m, param: h, words: v } = Xc(), [y, b] = f(null), [x, S] = f(!1), [C, w] = f(0), [T, E] = f(""), [D, O] = f(1), [k, A] = f(!1), [j, M] = f(""), { store: N, currency: P } = Zc(p, d, !s), F = e || h || Qc("product"), I = P ? `?currency=${encodeURIComponent(P)}` : "";
|
|
12504
12759
|
if (c(() => {
|
|
12505
12760
|
let e = !0;
|
|
12506
12761
|
return S(!1), (async () => {
|
|
12507
|
-
let t = await
|
|
12762
|
+
let t = await oc(p, d, "/store/config"), n = F ? await oc(p, d, `/store/products/${encodeURIComponent(F)}${I}`) : l || u ? (await oc(p, d, `/store/products?limit=1${P ? `¤cy=${encodeURIComponent(P)}` : ""}`))?.data?.[0] : null;
|
|
12508
12763
|
if (e) {
|
|
12509
12764
|
if (!n) {
|
|
12510
|
-
S(!0), b(l ?
|
|
12765
|
+
S(!0), b(l ? al[0] : null);
|
|
12511
12766
|
return;
|
|
12512
12767
|
}
|
|
12513
12768
|
b({
|
|
12514
12769
|
...n,
|
|
12515
|
-
currency:
|
|
12770
|
+
currency: uc(t, P)
|
|
12516
12771
|
}), E((e) => n.variants?.some((t) => t.id === e) ? e : n.variants?.[0]?.id ?? ""), w(0);
|
|
12517
12772
|
}
|
|
12518
12773
|
})().catch(() => {
|
|
12519
|
-
e && (S(!0), b(l ?
|
|
12774
|
+
e && (S(!0), b(l ? al[0] : null));
|
|
12520
12775
|
}), () => {
|
|
12521
12776
|
e = !1;
|
|
12522
12777
|
};
|
|
@@ -12543,7 +12798,7 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12543
12798
|
try {
|
|
12544
12799
|
await N.add(y.id, L?.id ?? null, Math.max(1, Number(D) || 1)), M(v("added"));
|
|
12545
12800
|
} catch (e) {
|
|
12546
|
-
M(
|
|
12801
|
+
M(gc(v, e));
|
|
12547
12802
|
} finally {
|
|
12548
12803
|
A(!1);
|
|
12549
12804
|
}
|
|
@@ -12578,7 +12833,7 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12578
12833
|
aspectRatio: "1 / 1",
|
|
12579
12834
|
borderRadius: "12px",
|
|
12580
12835
|
overflow: "hidden",
|
|
12581
|
-
background:
|
|
12836
|
+
background: qc
|
|
12582
12837
|
},
|
|
12583
12838
|
children: y.images?.[C] && /* @__PURE__ */ g("img", {
|
|
12584
12839
|
src: y.images[C],
|
|
@@ -12609,8 +12864,8 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12609
12864
|
borderRadius: "8px",
|
|
12610
12865
|
overflow: "hidden",
|
|
12611
12866
|
cursor: "pointer",
|
|
12612
|
-
border: t === C ? "2px solid var(--page-accent, #111827)" :
|
|
12613
|
-
background:
|
|
12867
|
+
border: t === C ? "2px solid var(--page-accent, #111827)" : Kc,
|
|
12868
|
+
background: qc
|
|
12614
12869
|
},
|
|
12615
12870
|
children: /* @__PURE__ */ g("img", {
|
|
12616
12871
|
src: e,
|
|
@@ -12641,12 +12896,12 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12641
12896
|
},
|
|
12642
12897
|
children: y.name
|
|
12643
12898
|
}),
|
|
12644
|
-
/* @__PURE__ */ g(
|
|
12899
|
+
/* @__PURE__ */ g(Ic, {
|
|
12645
12900
|
product: y,
|
|
12646
12901
|
inert: s,
|
|
12647
12902
|
sample: l && !!y.sample
|
|
12648
12903
|
}),
|
|
12649
|
-
/* @__PURE__ */ g(
|
|
12904
|
+
/* @__PURE__ */ g(il, {
|
|
12650
12905
|
product: y,
|
|
12651
12906
|
variant: L,
|
|
12652
12907
|
locale: m,
|
|
@@ -12667,7 +12922,7 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12667
12922
|
onClick: () => E(e.id),
|
|
12668
12923
|
...Q("variant", e.id === T && "variant-selected", t && "variant-sold-out"),
|
|
12669
12924
|
style: {
|
|
12670
|
-
...
|
|
12925
|
+
...Yc,
|
|
12671
12926
|
padding: "8px 14px",
|
|
12672
12927
|
opacity: t ? .45 : 1,
|
|
12673
12928
|
textDecoration: t ? "line-through" : "none",
|
|
@@ -12702,7 +12957,7 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12702
12957
|
onClick: B,
|
|
12703
12958
|
...Q("add-button", z && "add-button-sold-out"),
|
|
12704
12959
|
style: {
|
|
12705
|
-
...
|
|
12960
|
+
...Jc,
|
|
12706
12961
|
flex: 1,
|
|
12707
12962
|
opacity: z ? .5 : 1
|
|
12708
12963
|
},
|
|
@@ -12733,17 +12988,17 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12733
12988
|
]
|
|
12734
12989
|
})]
|
|
12735
12990
|
}),
|
|
12736
|
-
i && /* @__PURE__ */ g(
|
|
12991
|
+
i && /* @__PURE__ */ g(Gc, {
|
|
12737
12992
|
specs: y.specs,
|
|
12738
12993
|
locale: m,
|
|
12739
12994
|
words: v
|
|
12740
12995
|
}),
|
|
12741
|
-
n && /* @__PURE__ */ g(
|
|
12996
|
+
n && /* @__PURE__ */ g(Rc, {
|
|
12742
12997
|
product: y,
|
|
12743
12998
|
inert: s,
|
|
12744
12999
|
sample: l && !!y.sample
|
|
12745
13000
|
}),
|
|
12746
|
-
r && /* @__PURE__ */ g(
|
|
13001
|
+
r && /* @__PURE__ */ g(Bc, {
|
|
12747
13002
|
product: y,
|
|
12748
13003
|
inert: s,
|
|
12749
13004
|
sample: l && !!y.sample
|
|
@@ -12751,13 +13006,13 @@ function rl({ slug: e = "", buttonLabel: t = "", showReviews: n = !0, showQuesti
|
|
|
12751
13006
|
]
|
|
12752
13007
|
});
|
|
12753
13008
|
}
|
|
12754
|
-
function
|
|
12755
|
-
return /* @__PURE__ */ g(
|
|
13009
|
+
function cl(e) {
|
|
13010
|
+
return /* @__PURE__ */ g(ol, {
|
|
12756
13011
|
...e,
|
|
12757
13012
|
source: "favorites"
|
|
12758
13013
|
});
|
|
12759
13014
|
}
|
|
12760
|
-
var
|
|
13015
|
+
var ll = /* @__PURE__ */ _("svg", {
|
|
12761
13016
|
width: "20",
|
|
12762
13017
|
height: "20",
|
|
12763
13018
|
viewBox: "0 0 24 24",
|
|
@@ -12770,8 +13025,8 @@ var al = /* @__PURE__ */ _("svg", {
|
|
|
12770
13025
|
...Q("icon"),
|
|
12771
13026
|
children: [/* @__PURE__ */ g("path", { d: "M6 7h12l-1 13H7L6 7Z" }), /* @__PURE__ */ g("path", { d: "M9 7a3 3 0 0 1 6 0" })]
|
|
12772
13027
|
});
|
|
12773
|
-
function
|
|
12774
|
-
let { tenant: c, apiUrl: l, words: u } =
|
|
13028
|
+
function ul({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nodeRef: i, inert: a = !1, sample: o = !1, noNavigate: s = !1 }) {
|
|
13029
|
+
let { tenant: c, apiUrl: l, words: u } = Xc(), { cart: d } = Zc(l, c, !a), f = o && !d.count ? 2 : d.count;
|
|
12775
13030
|
return /* @__PURE__ */ _("a", {
|
|
12776
13031
|
ref: i,
|
|
12777
13032
|
href: e,
|
|
@@ -12788,7 +13043,7 @@ function ol({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
12788
13043
|
...Y(r)
|
|
12789
13044
|
},
|
|
12790
13045
|
children: [
|
|
12791
|
-
|
|
13046
|
+
ll,
|
|
12792
13047
|
n && /* @__PURE__ */ g("span", {
|
|
12793
13048
|
...Q("label"),
|
|
12794
13049
|
children: t || u("cart")
|
|
@@ -12816,7 +13071,7 @@ function ol({ href: e = "/cart", label: t = "", showLabel: n = !1, style: r, nod
|
|
|
12816
13071
|
]
|
|
12817
13072
|
});
|
|
12818
13073
|
}
|
|
12819
|
-
function
|
|
13074
|
+
function dl(e, t, n) {
|
|
12820
13075
|
if (t === "code") return e;
|
|
12821
13076
|
try {
|
|
12822
13077
|
if (t === "name") return `${new Intl.DisplayNames([n || "en"], { type: "currency" }).of(e) ?? e} (${e})`;
|
|
@@ -12829,8 +13084,8 @@ function sl(e, t, n) {
|
|
|
12829
13084
|
return e;
|
|
12830
13085
|
}
|
|
12831
13086
|
}
|
|
12832
|
-
function
|
|
12833
|
-
let { tenant: a, apiUrl: o, locale: s } =
|
|
13087
|
+
function fl({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert: i = !1 }) {
|
|
13088
|
+
let { tenant: a, apiUrl: o, locale: s } = Xc(), { store: l, currency: u } = Zc(o, a, !i), [d, p] = f(null), m = {
|
|
12834
13089
|
display: "inline-flex",
|
|
12835
13090
|
alignItems: "center",
|
|
12836
13091
|
gap: 8,
|
|
@@ -12838,7 +13093,7 @@ function cl({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
12838
13093
|
};
|
|
12839
13094
|
c(() => {
|
|
12840
13095
|
let e = !0;
|
|
12841
|
-
return
|
|
13096
|
+
return oc(o, a, "/store/config").then((t) => e && p(t)).catch(() => e && p({ currencies: [] })), () => {
|
|
12842
13097
|
e = !1;
|
|
12843
13098
|
};
|
|
12844
13099
|
}, [o, a]);
|
|
@@ -12864,7 +13119,7 @@ function cl({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
12864
13119
|
}) : null, /* @__PURE__ */ g("select", {
|
|
12865
13120
|
"aria-label": t || "Currency",
|
|
12866
13121
|
...Q("select"),
|
|
12867
|
-
value:
|
|
13122
|
+
value: uc(d, u),
|
|
12868
13123
|
onChange: i ? void 0 : (e) => l.setCurrency(e.target.value === d.currency ? "" : e.target.value),
|
|
12869
13124
|
onKeyDown: i ? (e) => e.preventDefault() : void 0,
|
|
12870
13125
|
style: {
|
|
@@ -12878,24 +13133,24 @@ function cl({ display: e = "symbol", label: t = "", style: n, nodeRef: r, inert:
|
|
|
12878
13133
|
},
|
|
12879
13134
|
children: h.map((t) => /* @__PURE__ */ g("option", {
|
|
12880
13135
|
value: t,
|
|
12881
|
-
children:
|
|
13136
|
+
children: dl(t, e, s)
|
|
12882
13137
|
}, t))
|
|
12883
13138
|
})]
|
|
12884
13139
|
});
|
|
12885
13140
|
}
|
|
12886
|
-
var
|
|
13141
|
+
var pl = {
|
|
12887
13142
|
display: "flex",
|
|
12888
13143
|
flexDirection: "column",
|
|
12889
13144
|
gap: "6px",
|
|
12890
13145
|
fontSize: "13px"
|
|
12891
|
-
},
|
|
13146
|
+
}, ml = {
|
|
12892
13147
|
margin: "0 0 12px",
|
|
12893
13148
|
fontSize: "18px"
|
|
12894
13149
|
};
|
|
12895
|
-
function
|
|
13150
|
+
function hl({ label: e, required: t, children: n }) {
|
|
12896
13151
|
return /* @__PURE__ */ _("label", {
|
|
12897
13152
|
...Q("field"),
|
|
12898
|
-
style:
|
|
13153
|
+
style: pl,
|
|
12899
13154
|
children: [/* @__PURE__ */ _("span", {
|
|
12900
13155
|
...Q("field-label"),
|
|
12901
13156
|
style: { fontWeight: 500 },
|
|
@@ -12907,7 +13162,7 @@ function dl({ label: e, required: t, children: n }) {
|
|
|
12907
13162
|
}), n]
|
|
12908
13163
|
});
|
|
12909
13164
|
}
|
|
12910
|
-
var
|
|
13165
|
+
var gl = [{
|
|
12911
13166
|
id: "ship:standard",
|
|
12912
13167
|
type: "shipping",
|
|
12913
13168
|
name: "Standard",
|
|
@@ -12923,7 +13178,7 @@ var fl = [{
|
|
|
12923
13178
|
min_days: null,
|
|
12924
13179
|
max_days: null,
|
|
12925
13180
|
detail: "Main Street 1"
|
|
12926
|
-
}],
|
|
13181
|
+
}], _l = {
|
|
12927
13182
|
name: "",
|
|
12928
13183
|
email: "",
|
|
12929
13184
|
phone: "",
|
|
@@ -12938,25 +13193,25 @@ var fl = [{
|
|
|
12938
13193
|
recipient: "",
|
|
12939
13194
|
gift_message: ""
|
|
12940
13195
|
};
|
|
12941
|
-
function
|
|
12942
|
-
let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } =
|
|
13196
|
+
function vl({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample: i = !1, noNavigate: a = !1 }) {
|
|
13197
|
+
let { tenant: o, apiUrl: s, locale: l, words: d, orderId: p } = Xc(), { store: m, cart: h, loaded: v } = Zc(s, o, !r), [y, b] = f(null), [x, S] = f(_l), [C, w] = f(""), [T, E] = f(!1), [D, O] = f(""), [k, A] = f(null), [j, M] = f(""), [N, P] = f(!1), F = !r && Qc("cancelled") === "1", I = (e) => pc(e, h.currency || y?.currency, l);
|
|
12943
13198
|
c(() => {
|
|
12944
|
-
|
|
13199
|
+
oc(s, o, "/store/config").then((e) => {
|
|
12945
13200
|
b(e), w((t) => t || e?.methods?.[0] || "");
|
|
12946
13201
|
}).catch(() => b({
|
|
12947
13202
|
enabled: !1,
|
|
12948
13203
|
methods: []
|
|
12949
13204
|
}));
|
|
12950
13205
|
}, [s, o]), c(() => {
|
|
12951
|
-
let e =
|
|
12952
|
-
r || !e || F ||
|
|
13206
|
+
let e = Qc("order");
|
|
13207
|
+
r || !e || F || oc(s, o, `/store/orders/${encodeURIComponent(e)}`).then((e) => {
|
|
12953
13208
|
A(e), e?.payment_status === "paid" && m.reset();
|
|
12954
|
-
}).catch((e) => O(
|
|
13209
|
+
}).catch((e) => O(gc(d, e)));
|
|
12955
13210
|
}, [s, o]);
|
|
12956
13211
|
let L = (e) => (t) => S((n) => ({
|
|
12957
13212
|
...n,
|
|
12958
13213
|
[e]: t.target.value
|
|
12959
|
-
})), R = u(() =>
|
|
13214
|
+
})), R = u(() => fc(l, y?.zone_countries ?? [], y && !y.ships_elsewhere && y.zone_countries?.length ? y.zone_countries : null), [l, y]);
|
|
12960
13215
|
c(() => {
|
|
12961
13216
|
h.country && !x.country && S((e) => ({
|
|
12962
13217
|
...e,
|
|
@@ -12969,7 +13224,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
12969
13224
|
try {
|
|
12970
13225
|
await m.setCoupon(e), M("");
|
|
12971
13226
|
} catch (e) {
|
|
12972
|
-
O(
|
|
13227
|
+
O(gc(d, e));
|
|
12973
13228
|
} finally {
|
|
12974
13229
|
P(!1);
|
|
12975
13230
|
}
|
|
@@ -12994,7 +13249,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
12994
13249
|
"paid",
|
|
12995
13250
|
"cancelled"
|
|
12996
13251
|
].forEach((t) => e.searchParams.delete(t));
|
|
12997
|
-
let t = await
|
|
13252
|
+
let t = await oc(s, o, "/store/checkout", {
|
|
12998
13253
|
method: "POST",
|
|
12999
13254
|
body: {
|
|
13000
13255
|
cart_id: m.cartId(),
|
|
@@ -13026,13 +13281,13 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13026
13281
|
}
|
|
13027
13282
|
A(t?.order ?? null), m.reset();
|
|
13028
13283
|
} catch (e) {
|
|
13029
|
-
O(
|
|
13284
|
+
O(gc(d, e));
|
|
13030
13285
|
} finally {
|
|
13031
13286
|
E(!1);
|
|
13032
13287
|
}
|
|
13033
13288
|
}
|
|
13034
|
-
}, V = { ...Y(t) }, H = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, U = Array.isArray(h.discounts) ? h.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, K = r && i && !h.lines.length ?
|
|
13035
|
-
r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(
|
|
13289
|
+
}, V = { ...Y(t) }, H = r && i && !h.lines.length ? !0 : h.requires_shipping !== !1, U = Array.isArray(h.discounts) ? h.discounts : [], W = U.filter((e) => e.type !== "shipping"), G = U.find((e) => e.type === "shipping") ?? null, K = r && i && !h.lines.length ? gl : Array.isArray(h.delivery_options) ? h.delivery_options : [], q = K.find((e) => e.id === h.delivery) ?? (r && i ? K[0] : null), ee = q?.type === "pickup", te = (e) => {
|
|
13290
|
+
r || e === h.delivery || (O(""), m.setDelivery(e).catch((e) => O(gc(d, e))));
|
|
13036
13291
|
};
|
|
13037
13292
|
if (k) {
|
|
13038
13293
|
let t = k.payment_status === "paid";
|
|
@@ -13060,7 +13315,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13060
13315
|
style: {
|
|
13061
13316
|
padding: "12px",
|
|
13062
13317
|
borderRadius: "8px",
|
|
13063
|
-
background:
|
|
13318
|
+
background: qc
|
|
13064
13319
|
},
|
|
13065
13320
|
children: ri(k.instructions_content)
|
|
13066
13321
|
}) : k.instructions ? /* @__PURE__ */ g("pre", {
|
|
@@ -13069,7 +13324,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13069
13324
|
margin: 0,
|
|
13070
13325
|
padding: "12px",
|
|
13071
13326
|
borderRadius: "8px",
|
|
13072
|
-
background:
|
|
13327
|
+
background: qc,
|
|
13073
13328
|
whiteSpace: "pre-wrap",
|
|
13074
13329
|
fontFamily: "inherit"
|
|
13075
13330
|
},
|
|
@@ -13080,7 +13335,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13080
13335
|
style: {
|
|
13081
13336
|
padding: "12px",
|
|
13082
13337
|
borderRadius: "8px",
|
|
13083
|
-
background:
|
|
13338
|
+
background: qc
|
|
13084
13339
|
},
|
|
13085
13340
|
children: [
|
|
13086
13341
|
/* @__PURE__ */ g("div", {
|
|
@@ -13104,13 +13359,13 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13104
13359
|
/* @__PURE__ */ g("div", { children: d("pickupNote") })
|
|
13105
13360
|
]
|
|
13106
13361
|
}),
|
|
13107
|
-
!k.delivery.location &&
|
|
13362
|
+
!k.delivery.location && bc(d, l, k.delivery.min_days, k.delivery.max_days) && /* @__PURE__ */ g("div", {
|
|
13108
13363
|
...Q("delivery-detail"),
|
|
13109
13364
|
style: {
|
|
13110
13365
|
fontSize: "14px",
|
|
13111
13366
|
color: $
|
|
13112
13367
|
},
|
|
13113
|
-
children:
|
|
13368
|
+
children: bc(d, l, k.delivery.min_days, k.delivery.max_days)
|
|
13114
13369
|
})
|
|
13115
13370
|
]
|
|
13116
13371
|
}),
|
|
@@ -13123,14 +13378,14 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13123
13378
|
children: [
|
|
13124
13379
|
d("total"),
|
|
13125
13380
|
": ",
|
|
13126
|
-
|
|
13381
|
+
pc(k.total, k.currency, l)
|
|
13127
13382
|
]
|
|
13128
13383
|
}),
|
|
13129
|
-
!t && /* @__PURE__ */ g(
|
|
13384
|
+
!t && /* @__PURE__ */ g(Cl, {
|
|
13130
13385
|
reference: k.transfer_reference,
|
|
13131
13386
|
words: d
|
|
13132
13387
|
}),
|
|
13133
|
-
/* @__PURE__ */ g(
|
|
13388
|
+
/* @__PURE__ */ g(wl, {
|
|
13134
13389
|
downloads: k.downloads,
|
|
13135
13390
|
apiUrl: s,
|
|
13136
13391
|
words: d,
|
|
@@ -13142,7 +13397,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13142
13397
|
onClick: a ? (e) => e.preventDefault() : void 0,
|
|
13143
13398
|
...Q("continue-button"),
|
|
13144
13399
|
style: {
|
|
13145
|
-
...
|
|
13400
|
+
...Yc,
|
|
13146
13401
|
alignSelf: "flex-start"
|
|
13147
13402
|
},
|
|
13148
13403
|
children: d("continue")
|
|
@@ -13150,7 +13405,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13150
13405
|
]
|
|
13151
13406
|
});
|
|
13152
13407
|
}
|
|
13153
|
-
let ne = r && i && !h.lines.length ?
|
|
13408
|
+
let ne = r && i && !h.lines.length ? al.slice(0, 2).map((e) => ({
|
|
13154
13409
|
...e,
|
|
13155
13410
|
product_id: e.id,
|
|
13156
13411
|
variant_id: null,
|
|
@@ -13196,7 +13451,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13196
13451
|
onClick: a ? (e) => e.preventDefault() : void 0,
|
|
13197
13452
|
...Q("continue-button"),
|
|
13198
13453
|
style: {
|
|
13199
|
-
...
|
|
13454
|
+
...Yc,
|
|
13200
13455
|
alignSelf: "flex-start"
|
|
13201
13456
|
},
|
|
13202
13457
|
children: d("continue")
|
|
@@ -13234,7 +13489,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13234
13489
|
...Q("section"),
|
|
13235
13490
|
children: [/* @__PURE__ */ g("h3", {
|
|
13236
13491
|
...Q("heading"),
|
|
13237
|
-
style:
|
|
13492
|
+
style: ml,
|
|
13238
13493
|
children: d("contact")
|
|
13239
13494
|
}), /* @__PURE__ */ _("div", {
|
|
13240
13495
|
...Q("fields"),
|
|
@@ -13242,7 +13497,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13242
13497
|
display: "grid",
|
|
13243
13498
|
gap: "12px"
|
|
13244
13499
|
},
|
|
13245
|
-
children: [/* @__PURE__ */ g(
|
|
13500
|
+
children: [/* @__PURE__ */ g(hl, {
|
|
13246
13501
|
label: d("name"),
|
|
13247
13502
|
required: !0,
|
|
13248
13503
|
children: /* @__PURE__ */ g("input", {
|
|
@@ -13259,7 +13514,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13259
13514
|
gridTemplateColumns: "1fr 1fr",
|
|
13260
13515
|
gap: "12px"
|
|
13261
13516
|
},
|
|
13262
|
-
children: [/* @__PURE__ */ g(
|
|
13517
|
+
children: [/* @__PURE__ */ g(hl, {
|
|
13263
13518
|
label: d("email"),
|
|
13264
13519
|
required: !0,
|
|
13265
13520
|
children: /* @__PURE__ */ g("input", {
|
|
@@ -13270,7 +13525,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13270
13525
|
onChange: L("email"),
|
|
13271
13526
|
autoComplete: "email"
|
|
13272
13527
|
})
|
|
13273
|
-
}), /* @__PURE__ */ g(
|
|
13528
|
+
}), /* @__PURE__ */ g(hl, {
|
|
13274
13529
|
label: d("phone"),
|
|
13275
13530
|
children: /* @__PURE__ */ g("input", {
|
|
13276
13531
|
type: "tel",
|
|
@@ -13289,7 +13544,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13289
13544
|
children: [
|
|
13290
13545
|
/* @__PURE__ */ g("h3", {
|
|
13291
13546
|
...Q("heading"),
|
|
13292
|
-
style:
|
|
13547
|
+
style: ml,
|
|
13293
13548
|
children: d("delivery")
|
|
13294
13549
|
}),
|
|
13295
13550
|
/* @__PURE__ */ g("div", {
|
|
@@ -13301,17 +13556,17 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13301
13556
|
gridTemplateColumns: "1fr 1fr",
|
|
13302
13557
|
gap: "12px"
|
|
13303
13558
|
},
|
|
13304
|
-
children: [/* @__PURE__ */ g(
|
|
13559
|
+
children: [/* @__PURE__ */ g(hl, {
|
|
13305
13560
|
label: d("postal"),
|
|
13306
13561
|
children: /* @__PURE__ */ g("input", {
|
|
13307
13562
|
...Q("input"),
|
|
13308
13563
|
style: ma,
|
|
13309
13564
|
value: x.postal_code,
|
|
13310
13565
|
onChange: L("postal_code"),
|
|
13311
|
-
onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(
|
|
13566
|
+
onBlur: () => !r && x.country && m.setCountry(x.country, x.postal_code).catch((e) => O(gc(d, e))),
|
|
13312
13567
|
autoComplete: "postal-code"
|
|
13313
13568
|
})
|
|
13314
|
-
}), /* @__PURE__ */ g(
|
|
13569
|
+
}), /* @__PURE__ */ g(hl, {
|
|
13315
13570
|
label: d("country"),
|
|
13316
13571
|
required: !ee,
|
|
13317
13572
|
children: /* @__PURE__ */ _("select", {
|
|
@@ -13324,7 +13579,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13324
13579
|
S((e) => ({
|
|
13325
13580
|
...e,
|
|
13326
13581
|
country: t
|
|
13327
|
-
})), r || m.setCountry(t, x.postal_code).catch((e) => O(
|
|
13582
|
+
})), r || m.setCountry(t, x.postal_code).catch((e) => O(gc(d, e)));
|
|
13328
13583
|
},
|
|
13329
13584
|
children: [/* @__PURE__ */ g("option", {
|
|
13330
13585
|
value: "",
|
|
@@ -13353,7 +13608,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13353
13608
|
gap: "8px"
|
|
13354
13609
|
},
|
|
13355
13610
|
children: K.map((e) => {
|
|
13356
|
-
let t =
|
|
13611
|
+
let t = bc(d, l, e.min_days, e.max_days);
|
|
13357
13612
|
return /* @__PURE__ */ _("label", {
|
|
13358
13613
|
...Q("delivery-option", q?.id === e.id && "delivery-option-selected"),
|
|
13359
13614
|
style: {
|
|
@@ -13362,7 +13617,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13362
13617
|
gap: "10px",
|
|
13363
13618
|
padding: "12px",
|
|
13364
13619
|
borderRadius: "8px",
|
|
13365
|
-
border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" :
|
|
13620
|
+
border: q?.id === e.id ? "1px solid var(--page-accent, #4f46e5)" : Kc,
|
|
13366
13621
|
cursor: "pointer"
|
|
13367
13622
|
},
|
|
13368
13623
|
children: [
|
|
@@ -13425,7 +13680,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13425
13680
|
...Q("section"),
|
|
13426
13681
|
children: [/* @__PURE__ */ g("h3", {
|
|
13427
13682
|
...Q("heading"),
|
|
13428
|
-
style:
|
|
13683
|
+
style: ml,
|
|
13429
13684
|
children: d("address")
|
|
13430
13685
|
}), /* @__PURE__ */ _("div", {
|
|
13431
13686
|
...Q("fields"),
|
|
@@ -13434,7 +13689,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13434
13689
|
gap: "12px"
|
|
13435
13690
|
},
|
|
13436
13691
|
children: [
|
|
13437
|
-
/* @__PURE__ */ g(
|
|
13692
|
+
/* @__PURE__ */ g(hl, {
|
|
13438
13693
|
label: d("line1"),
|
|
13439
13694
|
required: !0,
|
|
13440
13695
|
children: /* @__PURE__ */ g("input", {
|
|
@@ -13445,7 +13700,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13445
13700
|
autoComplete: "address-line1"
|
|
13446
13701
|
})
|
|
13447
13702
|
}),
|
|
13448
|
-
/* @__PURE__ */ g(
|
|
13703
|
+
/* @__PURE__ */ g(hl, {
|
|
13449
13704
|
label: d("line2"),
|
|
13450
13705
|
children: /* @__PURE__ */ g("input", {
|
|
13451
13706
|
...Q("input"),
|
|
@@ -13462,7 +13717,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13462
13717
|
gridTemplateColumns: "1fr 1fr",
|
|
13463
13718
|
gap: "12px"
|
|
13464
13719
|
},
|
|
13465
|
-
children: [/* @__PURE__ */ g(
|
|
13720
|
+
children: [/* @__PURE__ */ g(hl, {
|
|
13466
13721
|
label: d("city"),
|
|
13467
13722
|
required: !0,
|
|
13468
13723
|
children: /* @__PURE__ */ g("input", {
|
|
@@ -13472,7 +13727,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13472
13727
|
onChange: L("city"),
|
|
13473
13728
|
autoComplete: "address-level2"
|
|
13474
13729
|
})
|
|
13475
|
-
}), /* @__PURE__ */ g(
|
|
13730
|
+
}), /* @__PURE__ */ g(hl, {
|
|
13476
13731
|
label: d("region"),
|
|
13477
13732
|
children: /* @__PURE__ */ g("input", {
|
|
13478
13733
|
...Q("input"),
|
|
@@ -13483,7 +13738,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13483
13738
|
})
|
|
13484
13739
|
})]
|
|
13485
13740
|
}),
|
|
13486
|
-
/* @__PURE__ */ g(
|
|
13741
|
+
/* @__PURE__ */ g(hl, {
|
|
13487
13742
|
label: d("note"),
|
|
13488
13743
|
children: /* @__PURE__ */ g("textarea", {
|
|
13489
13744
|
rows: 2,
|
|
@@ -13538,7 +13793,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13538
13793
|
display: "grid",
|
|
13539
13794
|
gap: "12px"
|
|
13540
13795
|
},
|
|
13541
|
-
children: [H && !ee && /* @__PURE__ */ g(
|
|
13796
|
+
children: [H && !ee && /* @__PURE__ */ g(hl, {
|
|
13542
13797
|
label: d("giftRecipient"),
|
|
13543
13798
|
children: /* @__PURE__ */ g("input", {
|
|
13544
13799
|
...Q("input"),
|
|
@@ -13548,7 +13803,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13548
13803
|
maxLength: 200,
|
|
13549
13804
|
autoComplete: "off"
|
|
13550
13805
|
})
|
|
13551
|
-
}), /* @__PURE__ */ g(
|
|
13806
|
+
}), /* @__PURE__ */ g(hl, {
|
|
13552
13807
|
label: d("giftMessage"),
|
|
13553
13808
|
children: /* @__PURE__ */ g("textarea", {
|
|
13554
13809
|
rows: 3,
|
|
@@ -13569,7 +13824,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13569
13824
|
children: [
|
|
13570
13825
|
/* @__PURE__ */ g("h3", {
|
|
13571
13826
|
...Q("heading"),
|
|
13572
|
-
style:
|
|
13827
|
+
style: ml,
|
|
13573
13828
|
children: d("payment")
|
|
13574
13829
|
}),
|
|
13575
13830
|
!ie.length && !r && /* @__PURE__ */ g("p", {
|
|
@@ -13594,7 +13849,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13594
13849
|
gap: "10px",
|
|
13595
13850
|
padding: "12px",
|
|
13596
13851
|
borderRadius: "8px",
|
|
13597
|
-
border:
|
|
13852
|
+
border: Kc,
|
|
13598
13853
|
cursor: "pointer"
|
|
13599
13854
|
},
|
|
13600
13855
|
children: [/* @__PURE__ */ g("input", {
|
|
@@ -13621,13 +13876,13 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13621
13876
|
gap: "14px",
|
|
13622
13877
|
padding: "20px",
|
|
13623
13878
|
borderRadius: "12px",
|
|
13624
|
-
background:
|
|
13879
|
+
background: qc
|
|
13625
13880
|
},
|
|
13626
13881
|
children: [
|
|
13627
13882
|
/* @__PURE__ */ g("h3", {
|
|
13628
13883
|
...Q("summary-title"),
|
|
13629
13884
|
style: {
|
|
13630
|
-
...
|
|
13885
|
+
...ml,
|
|
13631
13886
|
margin: 0
|
|
13632
13887
|
},
|
|
13633
13888
|
children: d("cart")
|
|
@@ -13690,13 +13945,13 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13690
13945
|
gap: "8px",
|
|
13691
13946
|
marginTop: "4px"
|
|
13692
13947
|
},
|
|
13693
|
-
children: [/* @__PURE__ */ g(
|
|
13948
|
+
children: [/* @__PURE__ */ g($c, {
|
|
13694
13949
|
value: e.quantity,
|
|
13695
13950
|
label: d("quantity"),
|
|
13696
|
-
onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(
|
|
13951
|
+
onCommit: (t) => !r && m.setLine(e.product_id, e.variant_id, t).catch((e) => O(gc(d, e)))
|
|
13697
13952
|
}), /* @__PURE__ */ g("button", {
|
|
13698
13953
|
type: "button",
|
|
13699
|
-
onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(
|
|
13954
|
+
onClick: () => !r && m.setLine(e.product_id, e.variant_id, 0).catch((e) => O(gc(d, e))),
|
|
13700
13955
|
...Q("remove-button"),
|
|
13701
13956
|
style: {
|
|
13702
13957
|
background: "none",
|
|
@@ -13746,7 +14001,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13746
14001
|
style: {
|
|
13747
14002
|
padding: "4px 10px",
|
|
13748
14003
|
borderRadius: "999px",
|
|
13749
|
-
border:
|
|
14004
|
+
border: Kc,
|
|
13750
14005
|
fontWeight: 600,
|
|
13751
14006
|
letterSpacing: "0.04em"
|
|
13752
14007
|
},
|
|
@@ -13794,7 +14049,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13794
14049
|
onClick: () => z(j.trim()),
|
|
13795
14050
|
...Q("coupon-button"),
|
|
13796
14051
|
style: {
|
|
13797
|
-
...
|
|
14052
|
+
...Yc,
|
|
13798
14053
|
padding: "8px 14px"
|
|
13799
14054
|
},
|
|
13800
14055
|
children: d("apply")
|
|
@@ -13811,7 +14066,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13811
14066
|
/* @__PURE__ */ _("div", {
|
|
13812
14067
|
...Q("totals"),
|
|
13813
14068
|
style: {
|
|
13814
|
-
borderTop:
|
|
14069
|
+
borderTop: Kc,
|
|
13815
14070
|
paddingTop: "12px",
|
|
13816
14071
|
display: "grid",
|
|
13817
14072
|
gap: "6px",
|
|
@@ -13926,13 +14181,13 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13926
14181
|
...Q("submit-button"),
|
|
13927
14182
|
disabled: T || !C || h.shipping_available === !1,
|
|
13928
14183
|
style: {
|
|
13929
|
-
...
|
|
14184
|
+
...Jc,
|
|
13930
14185
|
width: "100%",
|
|
13931
14186
|
padding: "12px"
|
|
13932
14187
|
},
|
|
13933
14188
|
children: d(T ? "placing" : "placeOrder")
|
|
13934
14189
|
}),
|
|
13935
|
-
/* @__PURE__ */ g(
|
|
14190
|
+
/* @__PURE__ */ g(bl, {
|
|
13936
14191
|
apiUrl: s,
|
|
13937
14192
|
tenant: o,
|
|
13938
14193
|
words: d,
|
|
@@ -13944,7 +14199,7 @@ function ml({ continueHref: e = "/", style: t, nodeRef: n, inert: r = !1, sample
|
|
|
13944
14199
|
})]
|
|
13945
14200
|
});
|
|
13946
14201
|
}
|
|
13947
|
-
var
|
|
14202
|
+
var yl = [
|
|
13948
14203
|
"refund",
|
|
13949
14204
|
"privacy",
|
|
13950
14205
|
"terms",
|
|
@@ -13955,12 +14210,12 @@ var hl = [
|
|
|
13955
14210
|
fields: {},
|
|
13956
14211
|
updated_at: null
|
|
13957
14212
|
}));
|
|
13958
|
-
function
|
|
13959
|
-
let [o, s] = f(i ?
|
|
14213
|
+
function bl({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a }) {
|
|
14214
|
+
let [o, s] = f(i ? yl : []), [l, u] = f(null);
|
|
13960
14215
|
if (c(() => {
|
|
13961
14216
|
if (i) return;
|
|
13962
14217
|
let n = !0;
|
|
13963
|
-
return
|
|
14218
|
+
return vc(e, t).then((e) => n && s(e)), () => {
|
|
13964
14219
|
n = !1;
|
|
13965
14220
|
};
|
|
13966
14221
|
}, [
|
|
@@ -14003,12 +14258,12 @@ function gl({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
|
|
|
14003
14258
|
display: "flex",
|
|
14004
14259
|
flexWrap: "wrap",
|
|
14005
14260
|
gap: "6px 14px",
|
|
14006
|
-
borderTop:
|
|
14261
|
+
borderTop: Kc,
|
|
14007
14262
|
paddingTop: "10px"
|
|
14008
14263
|
},
|
|
14009
14264
|
children: o.map(m)
|
|
14010
14265
|
}),
|
|
14011
|
-
l && /* @__PURE__ */ g(
|
|
14266
|
+
l && /* @__PURE__ */ g(xl, {
|
|
14012
14267
|
policy: l,
|
|
14013
14268
|
words: n,
|
|
14014
14269
|
locale: r,
|
|
@@ -14017,7 +14272,7 @@ function gl({ apiUrl: e, tenant: t, words: n, locale: r, sample: i, inert: a })
|
|
|
14017
14272
|
]
|
|
14018
14273
|
});
|
|
14019
14274
|
}
|
|
14020
|
-
function
|
|
14275
|
+
function xl({ policy: e, words: t, locale: n, onClose: r }) {
|
|
14021
14276
|
c(() => {
|
|
14022
14277
|
let e = (e) => {
|
|
14023
14278
|
e.key === "Escape" && r();
|
|
@@ -14055,7 +14310,7 @@ function _l({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
14055
14310
|
style: {
|
|
14056
14311
|
background: "var(--page-bg, #fff)",
|
|
14057
14312
|
color: "var(--page-text, #111827)",
|
|
14058
|
-
border:
|
|
14313
|
+
border: Kc,
|
|
14059
14314
|
borderRadius: "12px",
|
|
14060
14315
|
width: "min(720px, 100%)",
|
|
14061
14316
|
maxHeight: "85vh",
|
|
@@ -14070,7 +14325,7 @@ function _l({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
14070
14325
|
alignItems: "center",
|
|
14071
14326
|
gap: "12px",
|
|
14072
14327
|
padding: "16px 20px",
|
|
14073
|
-
borderBottom:
|
|
14328
|
+
borderBottom: Kc
|
|
14074
14329
|
},
|
|
14075
14330
|
children: [/* @__PURE__ */ g("strong", {
|
|
14076
14331
|
...Q("modal-title"),
|
|
@@ -14085,7 +14340,7 @@ function _l({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
14085
14340
|
"aria-label": t("close"),
|
|
14086
14341
|
...Q("modal-close"),
|
|
14087
14342
|
style: {
|
|
14088
|
-
...
|
|
14343
|
+
...Yc,
|
|
14089
14344
|
padding: "4px 10px"
|
|
14090
14345
|
},
|
|
14091
14346
|
children: "×"
|
|
@@ -14139,12 +14394,12 @@ function _l({ policy: e, words: t, locale: n, onClose: r }) {
|
|
|
14139
14394
|
})
|
|
14140
14395
|
});
|
|
14141
14396
|
}
|
|
14142
|
-
var
|
|
14397
|
+
var Sl = {
|
|
14143
14398
|
year: "numeric",
|
|
14144
14399
|
month: "short",
|
|
14145
14400
|
day: "numeric"
|
|
14146
14401
|
};
|
|
14147
|
-
function
|
|
14402
|
+
function Cl({ reference: e, words: t }) {
|
|
14148
14403
|
let [n, r] = f(!1);
|
|
14149
14404
|
if (!e) return null;
|
|
14150
14405
|
let i = () => {
|
|
@@ -14192,7 +14447,7 @@ function yl({ reference: e, words: t }) {
|
|
|
14192
14447
|
onClick: i,
|
|
14193
14448
|
...Q("copy-button"),
|
|
14194
14449
|
style: {
|
|
14195
|
-
...
|
|
14450
|
+
...Yc,
|
|
14196
14451
|
padding: "6px 12px"
|
|
14197
14452
|
},
|
|
14198
14453
|
children: t(n ? "copied" : "copy")
|
|
@@ -14209,7 +14464,7 @@ function yl({ reference: e, words: t }) {
|
|
|
14209
14464
|
]
|
|
14210
14465
|
});
|
|
14211
14466
|
}
|
|
14212
|
-
function
|
|
14467
|
+
function wl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
14213
14468
|
let a = Array.isArray(e) ? e.filter((e) => e && e.token && !e.revoked_at) : [];
|
|
14214
14469
|
if (!a.length) return null;
|
|
14215
14470
|
let o = (e) => {
|
|
@@ -14239,7 +14494,7 @@ function bl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
14239
14494
|
alignItems: "center",
|
|
14240
14495
|
gap: "12px",
|
|
14241
14496
|
padding: "10px 12px",
|
|
14242
|
-
border:
|
|
14497
|
+
border: Kc,
|
|
14243
14498
|
borderRadius: "8px"
|
|
14244
14499
|
},
|
|
14245
14500
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -14269,7 +14524,7 @@ function bl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
14269
14524
|
onClick: i ? (e) => e.preventDefault() : void 0,
|
|
14270
14525
|
...Q("download-button"),
|
|
14271
14526
|
style: {
|
|
14272
|
-
...
|
|
14527
|
+
...Jc,
|
|
14273
14528
|
padding: "6px 14px",
|
|
14274
14529
|
textDecoration: "none",
|
|
14275
14530
|
fontSize: "14px"
|
|
@@ -14287,7 +14542,7 @@ function bl({ downloads: e, apiUrl: t, words: n, locale: r, noNavigate: i }) {
|
|
|
14287
14542
|
})]
|
|
14288
14543
|
});
|
|
14289
14544
|
}
|
|
14290
|
-
function
|
|
14545
|
+
function Tl({ tracking: e, words: t, noNavigate: n }) {
|
|
14291
14546
|
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 : "";
|
|
14292
14547
|
return !r && !i && !a ? null : /* @__PURE__ */ _("div", {
|
|
14293
14548
|
...Q("tracking"),
|
|
@@ -14322,12 +14577,12 @@ function xl({ tracking: e, words: t, noNavigate: n }) {
|
|
|
14322
14577
|
]
|
|
14323
14578
|
});
|
|
14324
14579
|
}
|
|
14325
|
-
function
|
|
14326
|
-
let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } =
|
|
14580
|
+
function El({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, inert: i = !1, sample: a = !1, noNavigate: o = !1 }) {
|
|
14581
|
+
let { tenant: s, apiUrl: l, locale: u, words: d, orderId: p } = Xc(), [m, h] = f(null), [v, y] = f(!1), [b, x] = f("");
|
|
14327
14582
|
c(() => {
|
|
14328
14583
|
if (i) return;
|
|
14329
14584
|
let e = !0;
|
|
14330
|
-
return
|
|
14585
|
+
return oc(l, s, `/store/my/orders?limit=${Math.max(1, Math.min(100, Number(t) || 20))}`).then((t) => e && h(Array.isArray(t?.data) ? t.data : [])).catch((t) => {
|
|
14331
14586
|
e && (y(t?.code === "LOGIN_REQUIRED"), h([]));
|
|
14332
14587
|
}), () => {
|
|
14333
14588
|
e = !1;
|
|
@@ -14358,7 +14613,7 @@ function Sl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
14358
14613
|
items: []
|
|
14359
14614
|
}] : m ?? [], C = (e) => {
|
|
14360
14615
|
try {
|
|
14361
|
-
return new Intl.DateTimeFormat(u || void 0,
|
|
14616
|
+
return new Intl.DateTimeFormat(u || void 0, Sl).format(new Date(e));
|
|
14362
14617
|
} catch {
|
|
14363
14618
|
return String(e).slice(0, 10);
|
|
14364
14619
|
}
|
|
@@ -14401,7 +14656,7 @@ function Sl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
14401
14656
|
S.map((e) => /* @__PURE__ */ _("div", {
|
|
14402
14657
|
...Q("order", b === e.id && "order-open"),
|
|
14403
14658
|
style: {
|
|
14404
|
-
border:
|
|
14659
|
+
border: Kc,
|
|
14405
14660
|
borderRadius: "10px",
|
|
14406
14661
|
overflow: "hidden"
|
|
14407
14662
|
},
|
|
@@ -14442,13 +14697,13 @@ function Sl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
14442
14697
|
fontSize: "13px",
|
|
14443
14698
|
padding: "2px 10px",
|
|
14444
14699
|
borderRadius: "999px",
|
|
14445
|
-
background:
|
|
14700
|
+
background: qc
|
|
14446
14701
|
},
|
|
14447
14702
|
children: [d(`st_${e.status}`), e.payment_status === "paid" ? "" : ` · ${d(`pay_${e.payment_status}`)}`]
|
|
14448
14703
|
}),
|
|
14449
14704
|
/* @__PURE__ */ g("strong", {
|
|
14450
14705
|
...Q("order-total"),
|
|
14451
|
-
children:
|
|
14706
|
+
children: pc(e.total, e.currency, u)
|
|
14452
14707
|
})
|
|
14453
14708
|
]
|
|
14454
14709
|
}), b === e.id && e.items?.length > 0 && /* @__PURE__ */ _("div", {
|
|
@@ -14478,19 +14733,19 @@ function Sl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
14478
14733
|
})
|
|
14479
14734
|
] }), /* @__PURE__ */ g("span", {
|
|
14480
14735
|
...Q("order-item-price"),
|
|
14481
|
-
children:
|
|
14736
|
+
children: pc(t.total, e.currency, u)
|
|
14482
14737
|
})]
|
|
14483
14738
|
}, t.id)),
|
|
14484
|
-
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(
|
|
14739
|
+
e.payment_status === "unpaid" && e.status !== "cancelled" && /* @__PURE__ */ g(Cl, {
|
|
14485
14740
|
reference: e.transfer_reference,
|
|
14486
14741
|
words: d
|
|
14487
14742
|
}),
|
|
14488
|
-
/* @__PURE__ */ g(
|
|
14743
|
+
/* @__PURE__ */ g(Tl, {
|
|
14489
14744
|
tracking: e.tracking,
|
|
14490
14745
|
words: d,
|
|
14491
14746
|
noNavigate: o
|
|
14492
14747
|
}),
|
|
14493
|
-
/* @__PURE__ */ g(
|
|
14748
|
+
/* @__PURE__ */ g(wl, {
|
|
14494
14749
|
downloads: e.downloads,
|
|
14495
14750
|
apiUrl: l,
|
|
14496
14751
|
words: d,
|
|
@@ -14505,21 +14760,21 @@ function Sl({ loginHref: e = "/login", limit: t = 20, style: n, nodeRef: r, iner
|
|
|
14505
14760
|
}
|
|
14506
14761
|
//#endregion
|
|
14507
14762
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
14508
|
-
function
|
|
14763
|
+
function Dl(e) {
|
|
14509
14764
|
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());
|
|
14510
14765
|
return [...new Set(n.map((e) => e.trim()))];
|
|
14511
14766
|
}
|
|
14512
|
-
var
|
|
14513
|
-
function
|
|
14767
|
+
var Ol = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
14768
|
+
function kl(e, t) {
|
|
14514
14769
|
let n = String(e ?? "").toUpperCase();
|
|
14515
14770
|
if (t === "code") return n;
|
|
14516
14771
|
let r = "";
|
|
14517
14772
|
try {
|
|
14518
|
-
r =
|
|
14773
|
+
r = Ol(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
14519
14774
|
} catch {}
|
|
14520
14775
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
14521
14776
|
}
|
|
14522
|
-
function
|
|
14777
|
+
function Al(e, t) {
|
|
14523
14778
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
14524
14779
|
if (typeof window > "u") return n || "?";
|
|
14525
14780
|
try {
|
|
@@ -14529,8 +14784,8 @@ function El(e, t) {
|
|
|
14529
14784
|
return n || "/";
|
|
14530
14785
|
}
|
|
14531
14786
|
}
|
|
14532
|
-
function
|
|
14533
|
-
let l = s(Z), u =
|
|
14787
|
+
function jl({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: c }) {
|
|
14788
|
+
let l = s(Z), u = Dl(l?.settings), d = u[0] ?? "", f = u.includes(l?.locale) ? l.locale : d, p = {
|
|
14534
14789
|
display: "inline-flex",
|
|
14535
14790
|
alignItems: "center",
|
|
14536
14791
|
gap: 8,
|
|
@@ -14568,7 +14823,7 @@ function Dl({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
14568
14823
|
children: n ?? "·"
|
|
14569
14824
|
}), /* @__PURE__ */ g("a", {
|
|
14570
14825
|
...Q("link", e === f && "link-current"),
|
|
14571
|
-
href:
|
|
14826
|
+
href: Al(e, e === d),
|
|
14572
14827
|
hrefLang: e,
|
|
14573
14828
|
"aria-current": e === f ? "true" : void 0,
|
|
14574
14829
|
onClick: c ? (e) => e.preventDefault() : void 0,
|
|
@@ -14578,7 +14833,7 @@ function Dl({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
14578
14833
|
textDecoration: "none",
|
|
14579
14834
|
cursor: c ? "default" : "pointer"
|
|
14580
14835
|
},
|
|
14581
|
-
children:
|
|
14836
|
+
children: kl(e, t)
|
|
14582
14837
|
})]
|
|
14583
14838
|
}, e))]
|
|
14584
14839
|
}) : /* @__PURE__ */ _("div", {
|
|
@@ -14590,7 +14845,7 @@ function Dl({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
14590
14845
|
value: f,
|
|
14591
14846
|
onChange: c ? void 0 : (e) => {
|
|
14592
14847
|
let t = e.target.value;
|
|
14593
|
-
window.location.assign(
|
|
14848
|
+
window.location.assign(Al(t, t === d));
|
|
14594
14849
|
},
|
|
14595
14850
|
onKeyDown: c ? (e) => e.preventDefault() : void 0,
|
|
14596
14851
|
style: {
|
|
@@ -14606,56 +14861,56 @@ function Dl({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
14606
14861
|
...Q("option", e === f && "option-current"),
|
|
14607
14862
|
key: e,
|
|
14608
14863
|
value: e
|
|
14609
|
-
},
|
|
14864
|
+
}, kl(e, t)))
|
|
14610
14865
|
})]
|
|
14611
14866
|
});
|
|
14612
14867
|
}
|
|
14613
14868
|
//#endregion
|
|
14614
14869
|
//#region ../ui/src/components/builder/apps/index.js
|
|
14615
|
-
var
|
|
14616
|
-
|
|
14617
|
-
|
|
14618
|
-
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
],
|
|
14623
|
-
SiteLoginForm:
|
|
14624
|
-
SiteAccountMenu:
|
|
14625
|
-
SiteLanguagePicker:
|
|
14626
|
-
CookieConsent:
|
|
14627
|
-
SiteSearch:
|
|
14628
|
-
AccessibilityToolbar:
|
|
14629
|
-
ShopProductGrid:
|
|
14630
|
-
ShopProduct:
|
|
14631
|
-
ShopCartButton:
|
|
14632
|
-
ShopCheckout:
|
|
14633
|
-
ShopOrderHistory:
|
|
14634
|
-
ShopCurrencyPicker:
|
|
14635
|
-
ShopFavorites:
|
|
14870
|
+
var Ml = [
|
|
14871
|
+
Os,
|
|
14872
|
+
qs,
|
|
14873
|
+
Bs,
|
|
14874
|
+
Js,
|
|
14875
|
+
Cs,
|
|
14876
|
+
ec
|
|
14877
|
+
], Nl = {
|
|
14878
|
+
SiteLoginForm: Rs,
|
|
14879
|
+
SiteAccountMenu: zs,
|
|
14880
|
+
SiteLanguagePicker: jl,
|
|
14881
|
+
CookieConsent: Ks,
|
|
14882
|
+
SiteSearch: $s,
|
|
14883
|
+
AccessibilityToolbar: Ds,
|
|
14884
|
+
ShopProductGrid: ol,
|
|
14885
|
+
ShopProduct: sl,
|
|
14886
|
+
ShopCartButton: ul,
|
|
14887
|
+
ShopCheckout: vl,
|
|
14888
|
+
ShopOrderHistory: El,
|
|
14889
|
+
ShopCurrencyPicker: fl,
|
|
14890
|
+
ShopFavorites: cl
|
|
14636
14891
|
};
|
|
14637
|
-
new Set(
|
|
14892
|
+
new Set(Ml.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
14638
14893
|
//#endregion
|
|
14639
14894
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
14640
|
-
var
|
|
14895
|
+
var Pl = "0.185.1", Fl = "4.2.0", Il = "https://cdn.jsdelivr.net/npm", Ll = `${Il}/three@${Pl}/+esm`, Rl = `${Il}/@google/model-viewer@${Fl}/dist/model-viewer.min.js`, zl = (e) => import(
|
|
14641
14896
|
/* @vite-ignore */
|
|
14642
14897
|
/* webpackIgnore: true */
|
|
14643
14898
|
e
|
|
14644
|
-
),
|
|
14645
|
-
function
|
|
14646
|
-
if (
|
|
14899
|
+
), Bl = /* @__PURE__ */ new Map();
|
|
14900
|
+
function Vl(e) {
|
|
14901
|
+
if (Bl.has(e)) return Bl.get(e);
|
|
14647
14902
|
if (typeof window > "u") return new Promise(() => {});
|
|
14648
|
-
let t =
|
|
14649
|
-
throw
|
|
14903
|
+
let t = zl(e).catch((t) => {
|
|
14904
|
+
throw Bl.delete(e), t;
|
|
14650
14905
|
});
|
|
14651
|
-
return
|
|
14906
|
+
return Bl.set(e, t), t;
|
|
14652
14907
|
}
|
|
14653
|
-
var
|
|
14654
|
-
function
|
|
14655
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
14908
|
+
var Hl = () => Vl(Ll), Ul = (e) => Vl(`${Il}/three@${Pl}/examples/jsm/${e}/+esm`);
|
|
14909
|
+
function Wl() {
|
|
14910
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Vl(Rl);
|
|
14656
14911
|
}
|
|
14657
|
-
var
|
|
14658
|
-
function
|
|
14912
|
+
var Gl = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Kl = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
14913
|
+
function ql(e, t) {
|
|
14659
14914
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
14660
14915
|
n = requestAnimationFrame(o), i ||= e;
|
|
14661
14916
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -14674,7 +14929,7 @@ function Ul(e, t) {
|
|
|
14674
14929
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
14675
14930
|
};
|
|
14676
14931
|
}
|
|
14677
|
-
function
|
|
14932
|
+
function Jl(e, t, n = {}) {
|
|
14678
14933
|
let r = {
|
|
14679
14934
|
radius: n.distance ?? 4,
|
|
14680
14935
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -14723,13 +14978,13 @@ function Wl(e, t, n = {}) {
|
|
|
14723
14978
|
}
|
|
14724
14979
|
//#endregion
|
|
14725
14980
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
14726
|
-
var
|
|
14727
|
-
function
|
|
14981
|
+
var Yl = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Xl = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Zl = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, Ql = (e) => typeof e == "string" && !!e.trim();
|
|
14982
|
+
function $l({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
14728
14983
|
return /* @__PURE__ */ _("div", {
|
|
14729
14984
|
ref: r,
|
|
14730
14985
|
style: {
|
|
14731
14986
|
...Y(i),
|
|
14732
|
-
minHeight:
|
|
14987
|
+
minHeight: Yl(n, 320),
|
|
14733
14988
|
display: "flex",
|
|
14734
14989
|
flexDirection: "column",
|
|
14735
14990
|
alignItems: "center",
|
|
@@ -14757,24 +15012,24 @@ function Yl({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
14757
15012
|
}) : null]
|
|
14758
15013
|
});
|
|
14759
15014
|
}
|
|
14760
|
-
function
|
|
15015
|
+
function eu({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotateDelay: o, cameraControls: s, ar: l, exposure: u, shadow: d, fieldOfView: p, environment: m, style: h, nodeRef: _, inert: v }) {
|
|
14761
15016
|
let [y, b] = f(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = f(!1);
|
|
14762
15017
|
c(() => {
|
|
14763
15018
|
if (y || !e) return;
|
|
14764
15019
|
let t = !0;
|
|
14765
|
-
return
|
|
15020
|
+
return Wl().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
14766
15021
|
t = !1;
|
|
14767
15022
|
};
|
|
14768
15023
|
}, [y, e]);
|
|
14769
15024
|
let C = {
|
|
14770
15025
|
display: "block",
|
|
14771
15026
|
width: "100%",
|
|
14772
|
-
minHeight:
|
|
14773
|
-
height:
|
|
15027
|
+
minHeight: Yl(r, 360),
|
|
15028
|
+
height: Yl(r, 360),
|
|
14774
15029
|
backgroundColor: i || "transparent",
|
|
14775
15030
|
...Y(h)
|
|
14776
15031
|
};
|
|
14777
|
-
if (!e) return v ? /* @__PURE__ */ g(
|
|
15032
|
+
if (!e) return v ? /* @__PURE__ */ g($l, {
|
|
14778
15033
|
nodeRef: _,
|
|
14779
15034
|
style: h,
|
|
14780
15035
|
height: r,
|
|
@@ -14809,13 +15064,13 @@ function Xl({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
|
|
|
14809
15064
|
poster: t || void 0,
|
|
14810
15065
|
style: C,
|
|
14811
15066
|
"camera-controls": w(!v && s !== !1),
|
|
14812
|
-
"auto-rotate": w(T && !
|
|
14813
|
-
"auto-rotate-delay": T ? String(
|
|
15067
|
+
"auto-rotate": w(T && !Gl()),
|
|
15068
|
+
"auto-rotate-delay": T ? String(Yl(o, 0)) : void 0,
|
|
14814
15069
|
"rotation-per-second": "18deg",
|
|
14815
15070
|
ar: w(!v && l === !0),
|
|
14816
15071
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
14817
|
-
"shadow-intensity": String(
|
|
14818
|
-
exposure: String(
|
|
15072
|
+
"shadow-intensity": String(Xl(d, 100)),
|
|
15073
|
+
exposure: String(Xl(u, 100)),
|
|
14819
15074
|
"field-of-view": p ? `${Number(p)}deg` : void 0,
|
|
14820
15075
|
"environment-image": m && m !== "neutral" ? m : "neutral",
|
|
14821
15076
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -14833,7 +15088,7 @@ function Xl({ src: e, poster: t, alt: n, height: r, bg: i, autoRotate: a, rotate
|
|
|
14833
15088
|
}) : null
|
|
14834
15089
|
});
|
|
14835
15090
|
}
|
|
14836
|
-
var
|
|
15091
|
+
var tu = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), nu = [
|
|
14837
15092
|
"precision highp float;",
|
|
14838
15093
|
"uniform vec2 u_res;",
|
|
14839
15094
|
"uniform float u_time;",
|
|
@@ -14856,7 +15111,7 @@ var Zl = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
14856
15111
|
" return v;",
|
|
14857
15112
|
"}",
|
|
14858
15113
|
""
|
|
14859
|
-
].join("\n"),
|
|
15114
|
+
].join("\n"), ru = {
|
|
14860
15115
|
gradient: [
|
|
14861
15116
|
"void main(){",
|
|
14862
15117
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -14908,7 +15163,7 @@ var Zl = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
14908
15163
|
"}"
|
|
14909
15164
|
].join("\n")
|
|
14910
15165
|
};
|
|
14911
|
-
function
|
|
15166
|
+
function iu(e, t) {
|
|
14912
15167
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
14913
15168
|
if (!n) return t;
|
|
14914
15169
|
let r = parseInt(n[1], 16);
|
|
@@ -14918,7 +15173,7 @@ function eu(e, t) {
|
|
|
14918
15173
|
(r & 255) / 255
|
|
14919
15174
|
];
|
|
14920
15175
|
}
|
|
14921
|
-
function
|
|
15176
|
+
function au(e, t, n) {
|
|
14922
15177
|
let r = e.createShader(t);
|
|
14923
15178
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
14924
15179
|
let t = e.getShaderInfoLog(r);
|
|
@@ -14926,13 +15181,13 @@ function tu(e, t, n) {
|
|
|
14926
15181
|
}
|
|
14927
15182
|
return r;
|
|
14928
15183
|
}
|
|
14929
|
-
function
|
|
15184
|
+
function ou({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, scale: o, height: s, interactive: l, style: u, nodeRef: p, inert: m }) {
|
|
14930
15185
|
let h = d(null), v = d(null), y = d(null), [b, x] = f("");
|
|
14931
15186
|
c(() => () => {
|
|
14932
15187
|
let e = y.current;
|
|
14933
15188
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
14934
15189
|
}, []);
|
|
14935
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
15190
|
+
let S = typeof t == "string" && t.trim() ? t : ru[e] ?? ru.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(i ?? ""), E = Xl(a, 100), D = Math.max(.05, Xl(o, 100));
|
|
14936
15191
|
return c(() => {
|
|
14937
15192
|
let e = h.current, t = v.current;
|
|
14938
15193
|
if (!e || !t) return;
|
|
@@ -14947,7 +15202,7 @@ function nu({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
14947
15202
|
}
|
|
14948
15203
|
let r = null;
|
|
14949
15204
|
try {
|
|
14950
|
-
let e =
|
|
15205
|
+
let e = au(n, n.VERTEX_SHADER, tu), t = au(n, n.FRAGMENT_SHADER, nu + S);
|
|
14951
15206
|
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");
|
|
14952
15207
|
x("");
|
|
14953
15208
|
} catch (e) {
|
|
@@ -14983,28 +15238,28 @@ function nu({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
14983
15238
|
};
|
|
14984
15239
|
l !== !1 && t.addEventListener("pointermove", u);
|
|
14985
15240
|
let d = () => {
|
|
14986
|
-
let r =
|
|
15241
|
+
let r = Kl(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
14987
15242
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
14988
15243
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
14989
15244
|
f?.observe(t), d();
|
|
14990
|
-
let p =
|
|
14991
|
-
a:
|
|
15245
|
+
let p = Gl(), m = {
|
|
15246
|
+
a: iu(C, [
|
|
14992
15247
|
.35,
|
|
14993
15248
|
.4,
|
|
14994
15249
|
.95
|
|
14995
15250
|
]),
|
|
14996
|
-
b:
|
|
15251
|
+
b: iu(w, [
|
|
14997
15252
|
.05,
|
|
14998
15253
|
.06,
|
|
14999
15254
|
.16
|
|
15000
15255
|
]),
|
|
15001
|
-
c:
|
|
15256
|
+
c: iu(T, [
|
|
15002
15257
|
.95,
|
|
15003
15258
|
.35,
|
|
15004
15259
|
.6
|
|
15005
15260
|
])
|
|
15006
15261
|
}, g = {};
|
|
15007
|
-
return g.stop =
|
|
15262
|
+
return g.stop = ql(t, (t, r) => {
|
|
15008
15263
|
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 && g.stop?.();
|
|
15009
15264
|
}), () => {
|
|
15010
15265
|
g.stop?.(), f?.disconnect(), t.removeEventListener("pointermove", u), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -15023,7 +15278,7 @@ function nu({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
15023
15278
|
},
|
|
15024
15279
|
style: {
|
|
15025
15280
|
position: "relative",
|
|
15026
|
-
minHeight:
|
|
15281
|
+
minHeight: Yl(s, 320),
|
|
15027
15282
|
overflow: "hidden",
|
|
15028
15283
|
...Y(u)
|
|
15029
15284
|
},
|
|
@@ -15055,7 +15310,7 @@ function nu({ preset: e, code: t, colorA: n, colorB: r, colorC: i, speed: a, sca
|
|
|
15055
15310
|
}) : null]
|
|
15056
15311
|
});
|
|
15057
15312
|
}
|
|
15058
|
-
function
|
|
15313
|
+
function su(e, t) {
|
|
15059
15314
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
15060
15315
|
r.deleteAttribute("uv");
|
|
15061
15316
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -15071,23 +15326,23 @@ function ru(e, t) {
|
|
|
15071
15326
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
15072
15327
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
15073
15328
|
}
|
|
15074
|
-
var
|
|
15075
|
-
function
|
|
15076
|
-
if (
|
|
15077
|
-
let t =
|
|
15329
|
+
var cu = /* @__PURE__ */ new Map();
|
|
15330
|
+
function lu(e) {
|
|
15331
|
+
if (cu.has(e)) return cu.get(e);
|
|
15332
|
+
let t = Ul("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
15078
15333
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
15079
15334
|
})).catch((t) => {
|
|
15080
|
-
throw
|
|
15335
|
+
throw cu.delete(e), t;
|
|
15081
15336
|
});
|
|
15082
|
-
return
|
|
15337
|
+
return cu.set(e, t), t;
|
|
15083
15338
|
}
|
|
15084
|
-
function
|
|
15339
|
+
function uu(e, t) {
|
|
15085
15340
|
let n = new e.Box3().setFromObject(t);
|
|
15086
15341
|
if (n.isEmpty()) return t;
|
|
15087
15342
|
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();
|
|
15088
15343
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
15089
15344
|
}
|
|
15090
|
-
var
|
|
15345
|
+
var du = {
|
|
15091
15346
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
15092
15347
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
15093
15348
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -15096,50 +15351,50 @@ var su = {
|
|
|
15096
15351
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
15097
15352
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
15098
15353
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
15099
|
-
},
|
|
15100
|
-
function
|
|
15101
|
-
let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !
|
|
15354
|
+
}, fu = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
15355
|
+
function pu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: i, spinSpeed: a, controls: o, ground: s, height: l, style: u, nodeRef: p, inert: m }) {
|
|
15356
|
+
let h = d(null), [_, v] = f(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = i !== !1 && !Gl(), S = o !== !1 && !m;
|
|
15102
15357
|
return c(() => {
|
|
15103
15358
|
let e = h.current;
|
|
15104
15359
|
if (!e) return;
|
|
15105
15360
|
let i = !0, o = null;
|
|
15106
|
-
return
|
|
15361
|
+
return Hl().then((c) => {
|
|
15107
15362
|
if (!i || !e) return;
|
|
15108
15363
|
let l = new c.WebGLRenderer({
|
|
15109
15364
|
antialias: !0,
|
|
15110
15365
|
alpha: !t
|
|
15111
15366
|
});
|
|
15112
|
-
l.setPixelRatio(
|
|
15367
|
+
l.setPixelRatio(Kl()), l.shadowMap.enabled = s !== !1, l.shadowMap.type = c.PCFSoftShadowMap, l.outputColorSpace = c.SRGBColorSpace, l.toneMapping = c.ACESFilmicToneMapping, l.domElement.style.display = "block", l.domElement.style.width = "100%", l.domElement.style.height = "100%", e.appendChild(l.domElement);
|
|
15113
15368
|
let u = new c.Scene();
|
|
15114
|
-
t && (u.background = new c.Color(t)), u.environment =
|
|
15115
|
-
let d = new c.PerspectiveCamera(
|
|
15116
|
-
distance:
|
|
15369
|
+
t && (u.background = new c.Color(t)), u.environment = su(c, l);
|
|
15370
|
+
let d = new c.PerspectiveCamera(fu(r, 45), 1, .1, 400), f = Jl(d, l.domElement, {
|
|
15371
|
+
distance: fu(n, 5),
|
|
15117
15372
|
enableZoom: S
|
|
15118
15373
|
}), p = new c.DirectionalLight(16777215, 2.2);
|
|
15119
15374
|
p.position.set(4, 7, 5), p.castShadow = s !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, u.add(p, new c.AmbientLight(16777215, .35));
|
|
15120
15375
|
let m = [], h = new c.Group(), g = (e, t) => {
|
|
15121
|
-
let n =
|
|
15122
|
-
e.position.set(
|
|
15376
|
+
let n = fu(t.scale, 1);
|
|
15377
|
+
e.position.set(fu(t.x, 0), fu(t.y, 0), fu(t.z, 0)), e.rotation.set(Zl(t.rx), Zl(t.ry), Zl(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Zl(t.spin);
|
|
15123
15378
|
};
|
|
15124
15379
|
for (let e of y) {
|
|
15125
15380
|
if (e.shape === "model") {
|
|
15126
|
-
if (!
|
|
15381
|
+
if (!Ql(e.src)) continue;
|
|
15127
15382
|
let t = new c.Group();
|
|
15128
|
-
g(t, e), h.add(t),
|
|
15383
|
+
g(t, e), h.add(t), lu(e.src).then((e) => {
|
|
15129
15384
|
if (!i) return;
|
|
15130
|
-
let n =
|
|
15385
|
+
let n = uu(c, e.clone(!0));
|
|
15131
15386
|
n.traverse((e) => {
|
|
15132
15387
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
15133
15388
|
}), t.add(n);
|
|
15134
15389
|
}, () => {});
|
|
15135
15390
|
continue;
|
|
15136
15391
|
}
|
|
15137
|
-
let t = (
|
|
15392
|
+
let t = (du[e.shape] ?? du.box)(c), n = new c.MeshStandardMaterial({
|
|
15138
15393
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
15139
|
-
metalness: Math.min(1, Math.max(0,
|
|
15140
|
-
roughness: Math.min(1, Math.max(0,
|
|
15141
|
-
transparent:
|
|
15142
|
-
opacity: Math.min(1, Math.max(0,
|
|
15394
|
+
metalness: Math.min(1, Math.max(0, Xl(e.metalness, 10))),
|
|
15395
|
+
roughness: Math.min(1, Math.max(0, Xl(e.roughness, 35))),
|
|
15396
|
+
transparent: Xl(e.opacity, 100) < 1,
|
|
15397
|
+
opacity: Math.min(1, Math.max(0, Xl(e.opacity, 100))),
|
|
15143
15398
|
flatShading: e.flat === !0,
|
|
15144
15399
|
wireframe: e.wireframe === !0,
|
|
15145
15400
|
side: e.shape === "plane" ? c.DoubleSide : c.FrontSide
|
|
@@ -15150,14 +15405,14 @@ function lu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
15150
15405
|
let _ = null;
|
|
15151
15406
|
if (s !== !1) {
|
|
15152
15407
|
let e = new c.ShadowMaterial({ opacity: .22 }), t = new c.PlaneGeometry(60, 60);
|
|
15153
|
-
_ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
15408
|
+
_ = new c.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = fu(s === !0 ? 0 : s, -.85), _.receiveShadow = !0, u.add(_), m.push(t, e);
|
|
15154
15409
|
}
|
|
15155
15410
|
let v = () => {
|
|
15156
15411
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
15157
15412
|
l.setSize(t, n, !1), d.aspect = t / n, d.updateProjectionMatrix();
|
|
15158
15413
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
15159
15414
|
b?.observe(e), v();
|
|
15160
|
-
let C =
|
|
15415
|
+
let C = Zl(Number.isFinite(Number(a)) ? a : 20), w = ql(e, (e) => {
|
|
15161
15416
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
15162
15417
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
15163
15418
|
l.render(u, d);
|
|
@@ -15181,7 +15436,7 @@ function lu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
15181
15436
|
a,
|
|
15182
15437
|
S,
|
|
15183
15438
|
s
|
|
15184
|
-
]), _ && m ? /* @__PURE__ */ g(
|
|
15439
|
+
]), _ && m ? /* @__PURE__ */ g($l, {
|
|
15185
15440
|
nodeRef: p,
|
|
15186
15441
|
style: u,
|
|
15187
15442
|
height: l,
|
|
@@ -15192,27 +15447,27 @@ function lu({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
15192
15447
|
h.current = e, typeof p == "function" && p(e);
|
|
15193
15448
|
},
|
|
15194
15449
|
style: {
|
|
15195
|
-
minHeight:
|
|
15196
|
-
height:
|
|
15450
|
+
minHeight: Yl(l, 380),
|
|
15451
|
+
height: Yl(l, 380),
|
|
15197
15452
|
overflow: "hidden",
|
|
15198
15453
|
touchAction: S ? "pan-y" : void 0,
|
|
15199
15454
|
...Y(u)
|
|
15200
15455
|
}
|
|
15201
15456
|
});
|
|
15202
15457
|
}
|
|
15203
|
-
function
|
|
15458
|
+
function mu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a }) {
|
|
15204
15459
|
let o = d(null), [s, l] = f("");
|
|
15205
15460
|
return c(() => {
|
|
15206
15461
|
let t = o.current;
|
|
15207
15462
|
if (a || !t || typeof e != "string" || !e.trim()) return;
|
|
15208
15463
|
let r = !0, i = null;
|
|
15209
|
-
return
|
|
15464
|
+
return Hl().then((a) => {
|
|
15210
15465
|
if (!r || !t) return;
|
|
15211
15466
|
let o = new a.WebGLRenderer({
|
|
15212
15467
|
antialias: !0,
|
|
15213
15468
|
alpha: !n
|
|
15214
15469
|
});
|
|
15215
|
-
o.setPixelRatio(
|
|
15470
|
+
o.setPixelRatio(Kl()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
15216
15471
|
let s = new a.Scene();
|
|
15217
15472
|
n && (s.background = new a.Color(n));
|
|
15218
15473
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -15235,7 +15490,7 @@ function uu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
15235
15490
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
15236
15491
|
}, f = typeof ResizeObserver > "u" ? null : new ResizeObserver(d);
|
|
15237
15492
|
f?.observe(t), d();
|
|
15238
|
-
let p = !1, m =
|
|
15493
|
+
let p = !1, m = ql(t, (e, t) => {
|
|
15239
15494
|
if (!p && typeof u?.frame == "function") try {
|
|
15240
15495
|
u.frame(e, t);
|
|
15241
15496
|
} catch (e) {
|
|
@@ -15257,7 +15512,7 @@ function uu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
15257
15512
|
e,
|
|
15258
15513
|
a,
|
|
15259
15514
|
n
|
|
15260
|
-
]), a ? /* @__PURE__ */ g(
|
|
15515
|
+
]), a ? /* @__PURE__ */ g($l, {
|
|
15261
15516
|
nodeRef: i,
|
|
15262
15517
|
style: r,
|
|
15263
15518
|
height: t,
|
|
@@ -15268,8 +15523,8 @@ function uu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
15268
15523
|
o.current = e, typeof i == "function" && i(e);
|
|
15269
15524
|
},
|
|
15270
15525
|
style: {
|
|
15271
|
-
minHeight:
|
|
15272
|
-
height:
|
|
15526
|
+
minHeight: Yl(t, 380),
|
|
15527
|
+
height: Yl(t, 380),
|
|
15273
15528
|
overflow: "hidden",
|
|
15274
15529
|
position: "relative",
|
|
15275
15530
|
touchAction: "pan-y",
|
|
@@ -15292,30 +15547,30 @@ function uu({ code: e, height: t, background: n, style: r, nodeRef: i, inert: a
|
|
|
15292
15547
|
}) : null
|
|
15293
15548
|
});
|
|
15294
15549
|
}
|
|
15295
|
-
var
|
|
15296
|
-
ModelViewerBlock:
|
|
15297
|
-
ShaderBlock:
|
|
15298
|
-
SceneBlock:
|
|
15299
|
-
ThreeCanvasBlock:
|
|
15300
|
-
},
|
|
15550
|
+
var hu = {
|
|
15551
|
+
ModelViewerBlock: eu,
|
|
15552
|
+
ShaderBlock: ou,
|
|
15553
|
+
SceneBlock: pu,
|
|
15554
|
+
ThreeCanvasBlock: mu
|
|
15555
|
+
}, gu = "2.44.0", _u = "https://cdn.jsdelivr.net/npm", vu = `${_u}/@rive-app/canvas@${gu}/+esm`, yu = `${_u}/@rive-app/canvas@${gu}/rive.wasm`, bu = (e) => import(
|
|
15301
15556
|
/* @vite-ignore */
|
|
15302
15557
|
/* webpackIgnore: true */
|
|
15303
15558
|
e
|
|
15304
|
-
),
|
|
15305
|
-
function
|
|
15306
|
-
return typeof window > "u" ? new Promise(() => {}) :
|
|
15559
|
+
), xu = null;
|
|
15560
|
+
function Su() {
|
|
15561
|
+
return typeof window > "u" ? new Promise(() => {}) : xu || (xu = bu(vu).then((e) => {
|
|
15307
15562
|
let t = e?.default ?? e;
|
|
15308
|
-
return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(
|
|
15563
|
+
return t?.RuntimeLoader?.setWasmUrl && t.RuntimeLoader.setWasmUrl(yu), t;
|
|
15309
15564
|
}).catch((e) => {
|
|
15310
|
-
throw
|
|
15311
|
-
}),
|
|
15565
|
+
throw xu = null, e;
|
|
15566
|
+
}), xu);
|
|
15312
15567
|
}
|
|
15313
|
-
var
|
|
15568
|
+
var Cu = /* @__PURE__ */ new Map(), wu = {
|
|
15314
15569
|
56: "number",
|
|
15315
15570
|
58: "trigger",
|
|
15316
15571
|
59: "boolean"
|
|
15317
|
-
},
|
|
15318
|
-
function
|
|
15572
|
+
}, Tu = /* @__PURE__ */ new Set();
|
|
15573
|
+
function Eu(e, t) {
|
|
15319
15574
|
if (!e || !t) return;
|
|
15320
15575
|
let n = (Array.isArray(t.artboards) ? t.artboards : []).map((e) => ({
|
|
15321
15576
|
name: String(e?.name ?? ""),
|
|
@@ -15324,15 +15579,15 @@ function Su(e, t) {
|
|
|
15324
15579
|
name: String(e?.name ?? ""),
|
|
15325
15580
|
inputs: (Array.isArray(e?.inputs) ? e.inputs : []).map((e) => ({
|
|
15326
15581
|
name: String(e?.name ?? ""),
|
|
15327
|
-
type:
|
|
15582
|
+
type: wu[e?.type] ?? "unknown"
|
|
15328
15583
|
}))
|
|
15329
15584
|
}))
|
|
15330
15585
|
}));
|
|
15331
|
-
|
|
15586
|
+
Cu.set(e, { artboards: n }), Tu.forEach((t) => t(e));
|
|
15332
15587
|
}
|
|
15333
15588
|
//#endregion
|
|
15334
15589
|
//#region ../ui/src/components/builder/rive/views.jsx
|
|
15335
|
-
var
|
|
15590
|
+
var Du = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Ou = [
|
|
15336
15591
|
"contain",
|
|
15337
15592
|
"cover",
|
|
15338
15593
|
"fill",
|
|
@@ -15341,7 +15596,7 @@ var Cu = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
|
|
|
15341
15596
|
"scaleDown",
|
|
15342
15597
|
"none",
|
|
15343
15598
|
"layout"
|
|
15344
|
-
],
|
|
15599
|
+
], ku = [
|
|
15345
15600
|
"center",
|
|
15346
15601
|
"topLeft",
|
|
15347
15602
|
"topCenter",
|
|
@@ -15351,8 +15606,8 @@ var Cu = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t,
|
|
|
15351
15606
|
"bottomLeft",
|
|
15352
15607
|
"bottomCenter",
|
|
15353
15608
|
"bottomRight"
|
|
15354
|
-
],
|
|
15355
|
-
function
|
|
15609
|
+
], Au = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, ju = 131;
|
|
15610
|
+
function Mu(e, t, n, r) {
|
|
15356
15611
|
if (!e || !t || !n) return;
|
|
15357
15612
|
let i = [];
|
|
15358
15613
|
try {
|
|
@@ -15363,15 +15618,15 @@ function Ou(e, t, n, r) {
|
|
|
15363
15618
|
let a = i.find((e) => e?.name === n);
|
|
15364
15619
|
a && (a.type === 58 ? r && a.fire() : a.type === 59 ? a.value = !!r : a.type === 56 && (a.value = +!!r));
|
|
15365
15620
|
}
|
|
15366
|
-
function
|
|
15621
|
+
function Nu({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o = "stateMachine", stateMachine: s, animation: l, fit: u = "contain", alignment: p = "center", autoplay: m = !0, hoverInput: h, clickInput: v, style: y, nodeRef: b, inert: x }) {
|
|
15367
15622
|
let S = d(null), C = d(null), w = d(null), T = d(""), [E, D] = f(!1), [O, k] = f(!1);
|
|
15368
15623
|
c(() => {
|
|
15369
15624
|
let t = C.current, n = S.current;
|
|
15370
15625
|
if (D(!1), k(!1), !e || !t) return;
|
|
15371
15626
|
let r = !0, i = null, c = null, d = null;
|
|
15372
|
-
return
|
|
15627
|
+
return Su().then((f) => {
|
|
15373
15628
|
if (!r) return;
|
|
15374
|
-
let h = o !== "animation", g = m !== !1 && !
|
|
15629
|
+
let h = o !== "animation", g = m !== !1 && !Au();
|
|
15375
15630
|
try {
|
|
15376
15631
|
i = new f.Rive({
|
|
15377
15632
|
src: e,
|
|
@@ -15381,8 +15636,8 @@ function ku({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
15381
15636
|
animations: !h && l ? l : void 0,
|
|
15382
15637
|
autoplay: g,
|
|
15383
15638
|
layout: new f.Layout({
|
|
15384
|
-
fit:
|
|
15385
|
-
alignment:
|
|
15639
|
+
fit: Ou.includes(u) ? u : "contain",
|
|
15640
|
+
alignment: ku.includes(p) ? p : "center"
|
|
15386
15641
|
}),
|
|
15387
15642
|
shouldDisableRiveListeners: !!x,
|
|
15388
15643
|
isTouchScrollEnabled: !0,
|
|
@@ -15390,7 +15645,7 @@ function ku({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
15390
15645
|
if (!r) return;
|
|
15391
15646
|
i.resizeDrawingSurfaceToCanvas();
|
|
15392
15647
|
let t = i.contents;
|
|
15393
|
-
if (
|
|
15648
|
+
if (Eu(e, t), h) {
|
|
15394
15649
|
let e = ((t?.artboards ?? []).find((e) => e.name === (a || i.activeArtboard)) ?? t?.artboards?.[0])?.stateMachines?.[0]?.name ?? "";
|
|
15395
15650
|
if (T.current = s || e, !s && e) try {
|
|
15396
15651
|
i.play(e), g || i.pause(e);
|
|
@@ -15406,7 +15661,7 @@ function ku({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
15406
15661
|
}
|
|
15407
15662
|
w.current = i, n && (n.rive = i), i.on(f.EventType.RiveEvent, (e) => {
|
|
15408
15663
|
let t = e?.data;
|
|
15409
|
-
x || t?.type !==
|
|
15664
|
+
x || t?.type !== ju || !t?.url || (t.target === "_self" ? window.location.assign(t.url) : window.open(t.url, t.target || "_blank", "noopener"));
|
|
15410
15665
|
}), n && typeof ResizeObserver < "u" && (c = new ResizeObserver(() => i?.resizeDrawingSurfaceToCanvas()), c.observe(n)), n && typeof IntersectionObserver < "u" && (d = new IntersectionObserver(([e]) => {
|
|
15411
15666
|
i && (e?.isIntersecting ? i.startRendering?.() : i.stopRendering?.());
|
|
15412
15667
|
}), d.observe(n));
|
|
@@ -15427,11 +15682,11 @@ function ku({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
15427
15682
|
m,
|
|
15428
15683
|
x
|
|
15429
15684
|
]);
|
|
15430
|
-
let A = !x && E, j = (e, t) => A &&
|
|
15685
|
+
let A = !x && E, j = (e, t) => A && Mu(w.current, T.current, e, t), M = {
|
|
15431
15686
|
position: "relative",
|
|
15432
15687
|
display: "block",
|
|
15433
15688
|
width: "100%",
|
|
15434
|
-
height:
|
|
15689
|
+
height: Du(r, 360),
|
|
15435
15690
|
backgroundColor: i || "transparent",
|
|
15436
15691
|
overflow: "hidden",
|
|
15437
15692
|
...Y(y)
|
|
@@ -15493,27 +15748,27 @@ function ku({ src: e, poster: t, alt: n, height: r, bg: i, artboard: a, mode: o
|
|
|
15493
15748
|
}), /* @__PURE__ */ g("span", { children: "Pick a .riv file in the Settings panel." })]
|
|
15494
15749
|
}) : null;
|
|
15495
15750
|
}
|
|
15496
|
-
var
|
|
15497
|
-
function
|
|
15751
|
+
var Pu = { RiveBlock: Nu }, Fu = /\.(mp4|webm|ogv|ogg|mov|m4v)(\?|#|$)/i, Iu = /\.(jpe?g|png|gif|webp|avif|svg|bmp)(\?|#|$)/i, Lu = /\.(pdf|docx?|xlsx?|pptx?|odt|ods|odp|txt|csv|zip|rar|7z|mp3|wav|m4a)(\?|#|$)/i, Ru = /vimeo\.com\/(?:video\/)?(\d+)/i, zu = "data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20320%20240%22%3E%3Crect%20width%3D%22320%22%20height%3D%22240%22%20fill%3D%22%231e293b%22%2F%3E%3Ccircle%20cx%3D%22160%22%20cy%3D%22120%22%20r%3D%2234%22%20fill%3D%22rgba(255%2C255%2C255%2C0.16)%22%2F%3E%3Cpath%20d%3D%22M150%20102%20L178%20120%20L150%20138%20Z%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E";
|
|
15752
|
+
function Bu(e, t = "") {
|
|
15498
15753
|
let n = String(e ?? "");
|
|
15499
|
-
return bi(n) && /youtu/i.test(n) ? "youtube" :
|
|
15754
|
+
return bi(n) && /youtu/i.test(n) ? "youtube" : Ru.test(n) ? "vimeo" : String(t).startsWith("video/") || Fu.test(n) ? "video" : String(t).startsWith("image/") || Iu.test(n) ? "image" : t || Lu.test(n) ? "document" : "unknown";
|
|
15500
15755
|
}
|
|
15501
|
-
var
|
|
15502
|
-
function
|
|
15503
|
-
return
|
|
15756
|
+
var Vu = /* @__PURE__ */ new Map();
|
|
15757
|
+
function Hu(e) {
|
|
15758
|
+
return Vu.has(e) || Vu.set(e, new Promise((t) => {
|
|
15504
15759
|
let n = new Image();
|
|
15505
15760
|
n.onload = () => t("image"), n.onerror = () => {
|
|
15506
15761
|
fetch(e, { method: "HEAD" }).then((e) => t(String(e.headers.get("content-type") ?? "").startsWith("video/") ? "video" : "drop")).catch(() => t("drop"));
|
|
15507
15762
|
}, n.src = e;
|
|
15508
|
-
})),
|
|
15763
|
+
})), Vu.get(e);
|
|
15509
15764
|
}
|
|
15510
|
-
function
|
|
15765
|
+
function Uu(e, t = 0) {
|
|
15511
15766
|
let [n, r] = f({}), i = e.filter((e) => e.kind === "unknown" && !(e.src in n)).map((e) => e.src).join("|");
|
|
15512
15767
|
return c(() => {
|
|
15513
15768
|
if (!i || typeof window > "u") return;
|
|
15514
15769
|
let e = !0;
|
|
15515
15770
|
return i.split("|").forEach((t) => {
|
|
15516
|
-
|
|
15771
|
+
Hu(t).then((n) => e && r((e) => ({
|
|
15517
15772
|
...e,
|
|
15518
15773
|
[t]: n
|
|
15519
15774
|
})));
|
|
@@ -15526,31 +15781,31 @@ function zu(e, t = 0) {
|
|
|
15526
15781
|
return t === "drop" ? null : {
|
|
15527
15782
|
...e,
|
|
15528
15783
|
kind: t,
|
|
15529
|
-
thumb: t === "video" ?
|
|
15784
|
+
thumb: t === "video" ? Gu(e.src, "video", e.poster) : e.thumb
|
|
15530
15785
|
};
|
|
15531
15786
|
}).filter(Boolean).slice(0, Math.max(0, Number(t) || 0) || void 0).map((e, t) => ({
|
|
15532
15787
|
...e,
|
|
15533
15788
|
index: t + 1
|
|
15534
15789
|
}));
|
|
15535
15790
|
}
|
|
15536
|
-
var
|
|
15537
|
-
function
|
|
15538
|
-
return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${bi(e)}/hqdefault.jpg` :
|
|
15791
|
+
var Wu = (e) => e === "video" || e === "youtube" || e === "vimeo";
|
|
15792
|
+
function Gu(e, t, n) {
|
|
15793
|
+
return n || (t === "image" || t === "unknown" ? e : t === "youtube" ? `https://i.ytimg.com/vi/${bi(e)}/hqdefault.jpg` : zu);
|
|
15539
15794
|
}
|
|
15540
|
-
var
|
|
15795
|
+
var Ku = (e) => e == null ? "" : yr(e), qu = (e) => (Array.isArray(e) ? e : [e]).map((e) => e && typeof e == "object" ? {
|
|
15541
15796
|
url: e.url ?? e.src ?? "",
|
|
15542
15797
|
mime: e.mime ?? ""
|
|
15543
15798
|
} : {
|
|
15544
15799
|
url: e,
|
|
15545
15800
|
mime: ""
|
|
15546
|
-
}).filter((e) => typeof e.url == "string" && e.url.trim()),
|
|
15801
|
+
}).filter((e) => typeof e.url == "string" && e.url.trim()), Ju = (e) => {
|
|
15547
15802
|
try {
|
|
15548
15803
|
return decodeURIComponent(String(e).split(/[?#]/)[0].split("/").pop() ?? "");
|
|
15549
15804
|
} catch {
|
|
15550
15805
|
return "";
|
|
15551
15806
|
}
|
|
15552
15807
|
};
|
|
15553
|
-
function
|
|
15808
|
+
function Yu({ items: e, entries: t, mediaField: n, nameField: r, posterField: i, limit: a }) {
|
|
15554
15809
|
let o = Math.max(0, Number(a) || 0), s = [], c = (e) => o && s.length >= o ? !1 : (s.push({
|
|
15555
15810
|
...e,
|
|
15556
15811
|
index: s.length + 1
|
|
@@ -15558,14 +15813,14 @@ function Gu({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
|
|
|
15558
15813
|
if (Array.isArray(t)) {
|
|
15559
15814
|
for (let e of t) {
|
|
15560
15815
|
if (!e || typeof e != "object") continue;
|
|
15561
|
-
let t = e.data ?? e, a =
|
|
15562
|
-
for (let { url: r, mime: i } of
|
|
15563
|
-
let t =
|
|
15816
|
+
let t = e.data ?? e, a = Ku(r ? _r(t, r) : t.name), o = i ? qu(_r(t, i))[0]?.url ?? "" : "";
|
|
15817
|
+
for (let { url: r, mime: i } of qu(_r(t, n))) {
|
|
15818
|
+
let t = Bu(r, i);
|
|
15564
15819
|
if (t !== "document" && !c({
|
|
15565
15820
|
src: r,
|
|
15566
15821
|
kind: t,
|
|
15567
15822
|
poster: o,
|
|
15568
|
-
thumb:
|
|
15823
|
+
thumb: Gu(r, t, o),
|
|
15569
15824
|
name: a,
|
|
15570
15825
|
alt: a,
|
|
15571
15826
|
entry: e
|
|
@@ -15576,12 +15831,12 @@ function Gu({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
|
|
|
15576
15831
|
}
|
|
15577
15832
|
for (let t of Array.isArray(e) ? e : []) {
|
|
15578
15833
|
if (!t || typeof t != "object" || !t.src) continue;
|
|
15579
|
-
let e =
|
|
15834
|
+
let e = Bu(t.src, t.mime), n = t.name || "";
|
|
15580
15835
|
if (e !== "document" && !c({
|
|
15581
15836
|
src: t.src,
|
|
15582
15837
|
kind: e,
|
|
15583
15838
|
poster: t.poster,
|
|
15584
|
-
thumb:
|
|
15839
|
+
thumb: Gu(t.src, e, t.poster),
|
|
15585
15840
|
name: n,
|
|
15586
15841
|
alt: t.alt || n,
|
|
15587
15842
|
entry: null
|
|
@@ -15589,7 +15844,7 @@ function Gu({ items: e, entries: t, mediaField: n, nameField: r, posterField: i,
|
|
|
15589
15844
|
}
|
|
15590
15845
|
return s;
|
|
15591
15846
|
}
|
|
15592
|
-
function
|
|
15847
|
+
function Xu(e) {
|
|
15593
15848
|
let t = e.entry && typeof e.entry == "object" ? e.entry : { id: `item-${e.index}` };
|
|
15594
15849
|
return {
|
|
15595
15850
|
...t,
|
|
@@ -15597,13 +15852,13 @@ function Ku(e) {
|
|
|
15597
15852
|
...t.data ?? {},
|
|
15598
15853
|
src: e.src,
|
|
15599
15854
|
thumb: e.thumb,
|
|
15600
|
-
name: e.name ||
|
|
15601
|
-
kind:
|
|
15855
|
+
name: e.name || Ju(e.src),
|
|
15856
|
+
kind: Wu(e.kind) ? "video" : "image",
|
|
15602
15857
|
index: e.index
|
|
15603
15858
|
}
|
|
15604
15859
|
};
|
|
15605
15860
|
}
|
|
15606
|
-
function
|
|
15861
|
+
function Zu({ item: e }) {
|
|
15607
15862
|
return /* @__PURE__ */ _("span", {
|
|
15608
15863
|
...Q("tile-media"),
|
|
15609
15864
|
style: {
|
|
@@ -15624,10 +15879,10 @@ function qu({ item: e }) {
|
|
|
15624
15879
|
objectFit: "cover",
|
|
15625
15880
|
borderRadius: "inherit"
|
|
15626
15881
|
}
|
|
15627
|
-
}),
|
|
15882
|
+
}), Wu(e.kind) && /* @__PURE__ */ g(Qu, {})]
|
|
15628
15883
|
});
|
|
15629
15884
|
}
|
|
15630
|
-
function
|
|
15885
|
+
function Qu() {
|
|
15631
15886
|
return /* @__PURE__ */ g("span", {
|
|
15632
15887
|
...Q("play"),
|
|
15633
15888
|
"aria-hidden": "true",
|
|
@@ -15655,7 +15910,7 @@ function Ju() {
|
|
|
15655
15910
|
})
|
|
15656
15911
|
});
|
|
15657
15912
|
}
|
|
15658
|
-
function
|
|
15913
|
+
function $u({ item: e, autoplay: t }) {
|
|
15659
15914
|
let n = {
|
|
15660
15915
|
maxWidth: "92vw",
|
|
15661
15916
|
maxHeight: "80vh",
|
|
@@ -15664,7 +15919,7 @@ function Yu({ item: e, autoplay: t }) {
|
|
|
15664
15919
|
display: "block"
|
|
15665
15920
|
};
|
|
15666
15921
|
if (e.kind === "youtube" || e.kind === "vimeo") {
|
|
15667
|
-
let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${bi(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(
|
|
15922
|
+
let r = e.kind === "youtube" ? `https://www.youtube-nocookie.com/embed/${bi(e.src)}?rel=0${t ? "&autoplay=1" : ""}` : `https://player.vimeo.com/video/${e.src.match(Ru)?.[1]}${t ? "?autoplay=1" : ""}`;
|
|
15668
15923
|
return /* @__PURE__ */ g("iframe", {
|
|
15669
15924
|
...Q("media"),
|
|
15670
15925
|
src: r,
|
|
@@ -15683,7 +15938,7 @@ function Yu({ item: e, autoplay: t }) {
|
|
|
15683
15938
|
return e.kind === "video" ? /* @__PURE__ */ g("video", {
|
|
15684
15939
|
...Q("media"),
|
|
15685
15940
|
src: e.src,
|
|
15686
|
-
poster: e.thumb ===
|
|
15941
|
+
poster: e.thumb === zu ? void 0 : e.thumb,
|
|
15687
15942
|
controls: !0,
|
|
15688
15943
|
autoPlay: t,
|
|
15689
15944
|
playsInline: !0,
|
|
@@ -15698,7 +15953,7 @@ function Yu({ item: e, autoplay: t }) {
|
|
|
15698
15953
|
style: n
|
|
15699
15954
|
});
|
|
15700
15955
|
}
|
|
15701
|
-
var
|
|
15956
|
+
var ed = {
|
|
15702
15957
|
position: "absolute",
|
|
15703
15958
|
top: "50%",
|
|
15704
15959
|
transform: "translateY(-50%)",
|
|
@@ -15713,7 +15968,7 @@ var Xu = {
|
|
|
15713
15968
|
alignItems: "center",
|
|
15714
15969
|
justifyContent: "center"
|
|
15715
15970
|
};
|
|
15716
|
-
function
|
|
15971
|
+
function td({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }) {
|
|
15717
15972
|
let o = Et(a), { loop: s = !0, caption: l = !0, counter: u = !0, thumbs: f = !1, backdrop: p = "", color: m = "", autoplay: v = !0 } = i, y = e[t], b = d(null), x = e.length, S = s || t > 0, C = s || t < x - 1, w = (e) => n((t) => {
|
|
15718
15973
|
let n = t + e;
|
|
15719
15974
|
return s ? (n + x) % x : Math.min(Math.max(n, 0), x - 1);
|
|
@@ -15726,7 +15981,7 @@ function Zu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
|
|
|
15726
15981
|
window.removeEventListener("keydown", e), t.style.overflow = n;
|
|
15727
15982
|
};
|
|
15728
15983
|
}, [x, s]), !y) return null;
|
|
15729
|
-
let T = (e) => e.stopPropagation(), E = y.name ||
|
|
15984
|
+
let T = (e) => e.stopPropagation(), E = y.name || Ju(y.src);
|
|
15730
15985
|
return /* @__PURE__ */ _("div", {
|
|
15731
15986
|
...Q("backdrop"),
|
|
15732
15987
|
role: "dialog",
|
|
@@ -15755,7 +16010,7 @@ function Zu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
|
|
|
15755
16010
|
alignItems: "center",
|
|
15756
16011
|
justifyContent: "center"
|
|
15757
16012
|
},
|
|
15758
|
-
children: /* @__PURE__ */ g(
|
|
16013
|
+
children: /* @__PURE__ */ g($u, {
|
|
15759
16014
|
item: y,
|
|
15760
16015
|
autoplay: v
|
|
15761
16016
|
}, t)
|
|
@@ -15856,7 +16111,7 @@ function Zu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
|
|
|
15856
16111
|
T(e), w(-1);
|
|
15857
16112
|
},
|
|
15858
16113
|
style: {
|
|
15859
|
-
...
|
|
16114
|
+
...ed,
|
|
15860
16115
|
left: 16,
|
|
15861
16116
|
opacity: S ? 1 : .3
|
|
15862
16117
|
},
|
|
@@ -15880,7 +16135,7 @@ function Zu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
|
|
|
15880
16135
|
T(e), w(1);
|
|
15881
16136
|
},
|
|
15882
16137
|
style: {
|
|
15883
|
-
...
|
|
16138
|
+
...ed,
|
|
15884
16139
|
right: 16,
|
|
15885
16140
|
opacity: C ? 1 : .3
|
|
15886
16141
|
},
|
|
@@ -15899,11 +16154,11 @@ function Zu({ list: e, index: t, onIndex: n, onClose: r, options: i, locale: a }
|
|
|
15899
16154
|
]
|
|
15900
16155
|
});
|
|
15901
16156
|
}
|
|
15902
|
-
function
|
|
16157
|
+
function nd(e, t, n) {
|
|
15903
16158
|
let [r, i] = f(null);
|
|
15904
16159
|
return {
|
|
15905
16160
|
open: i,
|
|
15906
|
-
overlay: r !== null && e[r] && typeof document < "u" ? m(/* @__PURE__ */ g(
|
|
16161
|
+
overlay: r !== null && e[r] && typeof document < "u" ? m(/* @__PURE__ */ g(td, {
|
|
15907
16162
|
list: e,
|
|
15908
16163
|
index: r,
|
|
15909
16164
|
onIndex: i,
|
|
@@ -15913,7 +16168,7 @@ function Qu(e, t, n) {
|
|
|
15913
16168
|
}), document.body) : null
|
|
15914
16169
|
};
|
|
15915
16170
|
}
|
|
15916
|
-
function
|
|
16171
|
+
function rd(e, t, n) {
|
|
15917
16172
|
return {
|
|
15918
16173
|
role: "button",
|
|
15919
16174
|
tabIndex: 0,
|
|
@@ -15926,7 +16181,7 @@ function $u(e, t, n) {
|
|
|
15926
16181
|
}
|
|
15927
16182
|
};
|
|
15928
16183
|
}
|
|
15929
|
-
function
|
|
16184
|
+
function id(e) {
|
|
15930
16185
|
let { tenant: t, apiUrl: n, revision: r, locale: i } = s(Z), a = s(ir)?.[e], [o, l] = f(null);
|
|
15931
16186
|
return c(() => {
|
|
15932
16187
|
if (!e || a) return;
|
|
@@ -15949,11 +16204,11 @@ function ed(e) {
|
|
|
15949
16204
|
a
|
|
15950
16205
|
]), e ? a ?? o : null;
|
|
15951
16206
|
}
|
|
15952
|
-
var
|
|
16207
|
+
var ad = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((e) => e?.id === t || e?.data?.slug === t || e?.slug === t) : e, od = (e, t) => ({
|
|
15953
16208
|
display: "grid",
|
|
15954
16209
|
gridTemplateColumns: `repeat(${Math.min(Math.max(Number(e) || 4, 1), 8)}, minmax(0, 1fr))`,
|
|
15955
16210
|
gap: t === "" || t == null || !Number.isFinite(Number(t)) ? 12 : Math.max(0, Number(t))
|
|
15956
|
-
}),
|
|
16211
|
+
}), sd = (e) => ({
|
|
15957
16212
|
loop: e.loop !== !1,
|
|
15958
16213
|
caption: e.caption !== !1,
|
|
15959
16214
|
counter: e.counter !== !1,
|
|
@@ -15961,7 +16216,7 @@ var td = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
|
|
|
15961
16216
|
autoplay: e.autoplay !== !1,
|
|
15962
16217
|
backdrop: e.backdrop || "",
|
|
15963
16218
|
color: e.color || ""
|
|
15964
|
-
}),
|
|
16219
|
+
}), cd = {
|
|
15965
16220
|
en: {
|
|
15966
16221
|
all: "All",
|
|
15967
16222
|
prev: "Previous page",
|
|
@@ -15976,7 +16231,7 @@ var td = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
|
|
|
15976
16231
|
page: (e) => `${e}. sayfa`,
|
|
15977
16232
|
count: (e) => `${e} görsel`
|
|
15978
16233
|
}
|
|
15979
|
-
},
|
|
16234
|
+
}, ld = (e) => cd[String(e ?? "").slice(0, 2)] ?? cd.en, ud = (e) => ({
|
|
15980
16235
|
padding: "7px 14px",
|
|
15981
16236
|
borderRadius: 999,
|
|
15982
16237
|
cursor: "pointer",
|
|
@@ -15986,8 +16241,8 @@ var td = (e, t, n) => t === "@card" ? n?.entry ? [n.entry] : [] : t ? e.filter((
|
|
|
15986
16241
|
background: e ? "var(--page-accent, #4f46e5)" : "transparent",
|
|
15987
16242
|
color: e ? "var(--page-accent-text, #ffffff)" : "inherit"
|
|
15988
16243
|
});
|
|
15989
|
-
function
|
|
15990
|
-
let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: o = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: d = "", whereField: p = "", whereValue: m = "", filterField: v = "", allLabel: y = "", perPage: b = 0, sortBy: x = "", sortDir: S = "asc", templateId: C, renderTemplate: w, style: T, nodeRef: E, inert: D } = e, { locale: O } = s(Z), k = s(cr), A = s(lr), j =
|
|
16244
|
+
function dd(e) {
|
|
16245
|
+
let { items: t = [], source: n = "", entry: r = "", mediaField: i = "", nameField: a = "", posterField: o = "", limit: c = 0, emptyText: l = "", columns: u = 4, gap: d = "", whereField: p = "", whereValue: m = "", filterField: v = "", allLabel: y = "", perPage: b = 0, sortBy: x = "", sortDir: S = "asc", templateId: C, renderTemplate: w, style: T, nodeRef: E, inert: D } = e, { locale: O } = s(Z), k = s(cr), A = s(lr), j = id(n), [M, N] = f(""), [P, F] = f(0), I = ld(O), L = n ? ad(j ?? [], r, A) : null, R = L && p && String(m ?? "").trim() ? L.filter((e) => yr(_r(e?.data, p)) === String(m).trim()) : L, z = Uu(Yu({
|
|
15991
16246
|
items: t,
|
|
15992
16247
|
entries: R && x ? Ka(R, x, S, O) : R,
|
|
15993
16248
|
mediaField: i,
|
|
@@ -15996,22 +16251,22 @@ function sd(e) {
|
|
|
15996
16251
|
}), c), B = (e) => v && e.entry ? yr(_r(e.entry?.data ?? e.entry, v)) : "", V = v ? [...new Set(z.map(B).filter(Boolean))] : [], H = V.includes(M) ? M : "", U = (H ? z.filter((e) => B(e) === H) : z).map((e, t) => ({
|
|
15997
16252
|
...e,
|
|
15998
16253
|
index: t + 1
|
|
15999
|
-
})), W = Math.max(0, Number(b) || 0), G = W ? Math.max(1, Math.ceil(U.length / W)) : 1, K = Math.min(P, G - 1), q = W ? U.slice(K * W, (K + 1) * W) : U, { open: ee, overlay: te } =
|
|
16254
|
+
})), W = Math.max(0, Number(b) || 0), G = W ? Math.max(1, Math.ceil(U.length / W)) : 1, K = Math.min(P, G - 1), q = W ? U.slice(K * W, (K + 1) * W) : U, { open: ee, overlay: te } = nd(U, sd(e), O), ne = w ?? (C && k?.render ? (e) => k.render(C, e) : null), re = !!n && j === null, ie = V.length > 1 || G > 1, ae = (e) => {
|
|
16000
16255
|
N(e), F(0);
|
|
16001
16256
|
}, J = /* @__PURE__ */ _("div", {
|
|
16002
16257
|
ref: ie ? void 0 : E,
|
|
16003
16258
|
...Q("grid"),
|
|
16004
16259
|
style: {
|
|
16005
16260
|
width: "100%",
|
|
16006
|
-
...
|
|
16261
|
+
...od(u, d),
|
|
16007
16262
|
...ie ? null : Y(T)
|
|
16008
16263
|
},
|
|
16009
16264
|
children: [
|
|
16010
16265
|
q.map((t) => {
|
|
16011
|
-
let n =
|
|
16266
|
+
let n = Xu(t);
|
|
16012
16267
|
return /* @__PURE__ */ g("div", {
|
|
16013
|
-
...Q("item",
|
|
16014
|
-
...D ? null :
|
|
16268
|
+
...Q("item", Wu(t.kind) && "item-video"),
|
|
16269
|
+
...D ? null : rd(() => ee(t.index - 1), n.data.name, O),
|
|
16015
16270
|
style: {
|
|
16016
16271
|
minWidth: 0,
|
|
16017
16272
|
position: "relative",
|
|
@@ -16023,7 +16278,7 @@ function sd(e) {
|
|
|
16023
16278
|
entry: n
|
|
16024
16279
|
},
|
|
16025
16280
|
children: ne((e) => Dr(e, n, O))
|
|
16026
|
-
}), e.playMark !== !1 &&
|
|
16281
|
+
}), e.playMark !== !1 && Wu(t.kind) && /* @__PURE__ */ g(Qu, {})] }) : /* @__PURE__ */ g(Zu, { item: t })
|
|
16027
16282
|
}, `${t.index}-${t.src}`);
|
|
16028
16283
|
}),
|
|
16029
16284
|
!U.length && !re && (n ? l : null) && /* @__PURE__ */ g("div", {
|
|
@@ -16062,7 +16317,7 @@ function sd(e) {
|
|
|
16062
16317
|
"aria-pressed": H === e,
|
|
16063
16318
|
...Q("filter", H === e && "filter-active"),
|
|
16064
16319
|
onClick: () => ae(e),
|
|
16065
|
-
style:
|
|
16320
|
+
style: ud(H === e),
|
|
16066
16321
|
children: e || y || I.all
|
|
16067
16322
|
}, e || "__all"))
|
|
16068
16323
|
}),
|
|
@@ -16084,7 +16339,7 @@ function sd(e) {
|
|
|
16084
16339
|
disabled: K === 0,
|
|
16085
16340
|
"aria-label": I.prev,
|
|
16086
16341
|
onClick: () => F(K - 1),
|
|
16087
|
-
style:
|
|
16342
|
+
style: ud(!1),
|
|
16088
16343
|
children: "←"
|
|
16089
16344
|
}),
|
|
16090
16345
|
Array.from({ length: G }, (e, t) => /* @__PURE__ */ g("button", {
|
|
@@ -16093,7 +16348,7 @@ function sd(e) {
|
|
|
16093
16348
|
"aria-current": t === K ? "page" : void 0,
|
|
16094
16349
|
...Q("page", t === K && "page-active"),
|
|
16095
16350
|
onClick: () => F(t),
|
|
16096
|
-
style:
|
|
16351
|
+
style: ud(t === K),
|
|
16097
16352
|
children: t + 1
|
|
16098
16353
|
}, t)),
|
|
16099
16354
|
/* @__PURE__ */ g("button", {
|
|
@@ -16102,7 +16357,7 @@ function sd(e) {
|
|
|
16102
16357
|
disabled: K === G - 1,
|
|
16103
16358
|
"aria-label": I.next,
|
|
16104
16359
|
onClick: () => F(K + 1),
|
|
16105
|
-
style:
|
|
16360
|
+
style: ud(!1),
|
|
16106
16361
|
children: "→"
|
|
16107
16362
|
}),
|
|
16108
16363
|
/* @__PURE__ */ g("span", {
|
|
@@ -16120,48 +16375,48 @@ function sd(e) {
|
|
|
16120
16375
|
]
|
|
16121
16376
|
}) : J;
|
|
16122
16377
|
}
|
|
16123
|
-
var
|
|
16124
|
-
function
|
|
16125
|
-
if (
|
|
16378
|
+
var fd = { LightboxGallery: dd }, pd = /* @__PURE__ */ new Map();
|
|
16379
|
+
function md(e) {
|
|
16380
|
+
if (pd.has(e)) return pd.get(e);
|
|
16126
16381
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
16127
16382
|
/* @vite-ignore */
|
|
16128
16383
|
/* webpackIgnore: true */
|
|
16129
16384
|
t
|
|
16130
16385
|
).finally(() => URL.revokeObjectURL(t));
|
|
16131
|
-
return
|
|
16386
|
+
return pd.set(e, n), n;
|
|
16132
16387
|
}
|
|
16133
|
-
function
|
|
16388
|
+
function hd({ apiUrl: e, tenant: t, id: n, version: r }) {
|
|
16134
16389
|
let i = new URLSearchParams({
|
|
16135
16390
|
...t ? { tenant: t } : {},
|
|
16136
16391
|
...r ? { v: r } : {}
|
|
16137
16392
|
}), a = `${e}/plugins/${encodeURIComponent(n)}/code.js?${i}`;
|
|
16138
|
-
if (
|
|
16393
|
+
if (pd.has(a)) return pd.get(a);
|
|
16139
16394
|
let o = import(
|
|
16140
16395
|
/* @vite-ignore */
|
|
16141
16396
|
/* webpackIgnore: true */
|
|
16142
16397
|
a
|
|
16143
16398
|
);
|
|
16144
|
-
return o.catch(() =>
|
|
16399
|
+
return o.catch(() => pd.delete(a)), pd.set(a, o), o;
|
|
16145
16400
|
}
|
|
16146
|
-
function
|
|
16401
|
+
function gd(e) {
|
|
16147
16402
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
16148
16403
|
return n && typeof n == "object" ? n : {};
|
|
16149
16404
|
}
|
|
16150
16405
|
//#endregion
|
|
16151
16406
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
16152
|
-
async function
|
|
16153
|
-
let r = e.code ? await
|
|
16407
|
+
async function _d(e, t, n) {
|
|
16408
|
+
let r = e.code ? await md(e.code) : await hd(t);
|
|
16154
16409
|
return (Array.isArray(r?.default?.blocks) ? r.default.blocks : []).find((e) => e?.id === n && typeof e.mount == "function") ?? null;
|
|
16155
16410
|
}
|
|
16156
|
-
var
|
|
16411
|
+
var vd = {
|
|
16157
16412
|
padding: "10px 12px",
|
|
16158
16413
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
16159
16414
|
borderRadius: 8,
|
|
16160
16415
|
fontSize: 12,
|
|
16161
16416
|
opacity: .6
|
|
16162
16417
|
};
|
|
16163
|
-
function
|
|
16164
|
-
let a = s(Z), o =
|
|
16418
|
+
function yd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
16419
|
+
let a = s(Z), o = gd(a?.settings)[e], l = d(null), u = d(null), f = {
|
|
16165
16420
|
tenant: a?.tenant ?? "",
|
|
16166
16421
|
apiUrl: a?.apiUrl ?? "/api",
|
|
16167
16422
|
locale: a?.locale ?? "",
|
|
@@ -16173,7 +16428,7 @@ function hd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
16173
16428
|
let n = l.current;
|
|
16174
16429
|
if (!o || !(o.code || o.version) || !n) return;
|
|
16175
16430
|
let r = !0;
|
|
16176
|
-
return
|
|
16431
|
+
return _d(o, {
|
|
16177
16432
|
apiUrl: p.current.apiUrl,
|
|
16178
16433
|
tenant: p.current.tenant,
|
|
16179
16434
|
id: e,
|
|
@@ -16213,7 +16468,7 @@ function hd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
16213
16468
|
}) : /* @__PURE__ */ _("div", {
|
|
16214
16469
|
ref: i,
|
|
16215
16470
|
style: {
|
|
16216
|
-
...
|
|
16471
|
+
...vd,
|
|
16217
16472
|
...Y(r)
|
|
16218
16473
|
},
|
|
16219
16474
|
children: [
|
|
@@ -16225,7 +16480,7 @@ function hd({ pluginId: e, blockId: t, props: n, style: r, nodeRef: i }) {
|
|
|
16225
16480
|
}
|
|
16226
16481
|
//#endregion
|
|
16227
16482
|
//#region ../ui/src/components/builder/render.jsx
|
|
16228
|
-
function
|
|
16483
|
+
function bd(e, t, n) {
|
|
16229
16484
|
let r = { "data-wb": e };
|
|
16230
16485
|
t.htmlId && (r.id = t.htmlId), n && n.id === e && (r.id = t.htmlId || n.htmlId, r.tabIndex = -1);
|
|
16231
16486
|
let i = me(t.classNames);
|
|
@@ -16241,7 +16496,7 @@ function gd(e, t, n) {
|
|
|
16241
16496
|
classes: i
|
|
16242
16497
|
};
|
|
16243
16498
|
}
|
|
16244
|
-
function
|
|
16499
|
+
function xd({ View: e, markup: t, ...r }) {
|
|
16245
16500
|
let i = e(r);
|
|
16246
16501
|
if (!a(i) || typeof i.type != "string") return i;
|
|
16247
16502
|
let o = [i.props.className, ...t.classes].filter(Boolean).join(" ");
|
|
@@ -16250,71 +16505,71 @@ function _d({ View: e, markup: t, ...r }) {
|
|
|
16250
16505
|
...o ? { className: o } : {}
|
|
16251
16506
|
});
|
|
16252
16507
|
}
|
|
16253
|
-
var
|
|
16508
|
+
var Sd = /* @__PURE__ */ new Set([
|
|
16254
16509
|
"FormInput",
|
|
16255
16510
|
"FormTextarea",
|
|
16256
16511
|
"FormSelect"
|
|
16257
16512
|
]);
|
|
16258
|
-
function
|
|
16513
|
+
function Cd(e, t, n, r) {
|
|
16259
16514
|
if (t.forNode === "__none") return "";
|
|
16260
16515
|
let i = t.forNode ? n[t.forNode] : null;
|
|
16261
16516
|
if (!t.forNode) {
|
|
16262
16517
|
let t = n[r]?.nodes ?? [];
|
|
16263
16518
|
i = n[t[t.indexOf(e) + 1]] ?? null;
|
|
16264
16519
|
}
|
|
16265
|
-
return !i || !
|
|
16266
|
-
}
|
|
16267
|
-
var
|
|
16268
|
-
...
|
|
16269
|
-
...
|
|
16270
|
-
...
|
|
16271
|
-
...
|
|
16272
|
-
...
|
|
16273
|
-
PluginBlock:
|
|
16520
|
+
return !i || !Sd.has(i.type?.resolvedName) ? "" : i.props?.htmlId || Fa(i.props?.name) || "";
|
|
16521
|
+
}
|
|
16522
|
+
var wd = "slot-", Td = {
|
|
16523
|
+
...Ss,
|
|
16524
|
+
...Nl,
|
|
16525
|
+
...hu,
|
|
16526
|
+
...Pu,
|
|
16527
|
+
...fd,
|
|
16528
|
+
PluginBlock: yd
|
|
16274
16529
|
};
|
|
16275
|
-
function
|
|
16530
|
+
function Ed(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
16276
16531
|
let o = n[e];
|
|
16277
16532
|
if (!o || o.hidden) return null;
|
|
16278
16533
|
let s = o.type?.resolvedName, c = Xe(o.props ?? {}, a?.elementDefaults?.[s]), l = a?.mapProps ? a.mapProps(c, s) : c;
|
|
16279
16534
|
if (s === "ComponentInstance") {
|
|
16280
16535
|
let s = o.props?.componentId, c = r?.[s];
|
|
16281
16536
|
if (!c?.template || i.has(s)) return null;
|
|
16282
|
-
let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(
|
|
16283
|
-
return /* @__PURE__ */ g(t, { children:
|
|
16537
|
+
let u = new Set(i).add(s), d = Object.fromEntries(Object.entries(o.linkedNodes ?? {}).filter(([e]) => e.startsWith(wd)).map(([e, t]) => [e.slice(5), Ed(t, n, r, i, a)]));
|
|
16538
|
+
return /* @__PURE__ */ g(t, { children: Ed(c.template.rootId, c.template.nodes, r, u, {
|
|
16284
16539
|
...Bt(l.values, a),
|
|
16285
16540
|
slots: d
|
|
16286
16541
|
}) }, e);
|
|
16287
16542
|
}
|
|
16288
|
-
let u =
|
|
16543
|
+
let u = Td[s];
|
|
16289
16544
|
if (!u) return null;
|
|
16290
|
-
let d = l.compSlot?.id, f = d && a?.slots && Object.hasOwn(a.slots, d) ? a.slots[d] : void 0, p = f === void 0 ? (o.nodes ?? []).map((e) =>
|
|
16545
|
+
let d = l.compSlot?.id, f = d && a?.slots && Object.hasOwn(a.slots, d) ? a.slots[d] : void 0, p = f === void 0 ? (o.nodes ?? []).map((e) => Ed(e, n, r, i, a)).filter(Boolean) : [f].filter(Boolean), m = Object.entries(o.linkedNodes ?? {}), h = m.length ? Object.fromEntries(m.map(([e, t]) => [e, Ed(t, n, r, i, a)])) : void 0, _ = /* @__PURE__ */ g(typeof u == "function" ? xd : u, {
|
|
16291
16546
|
...typeof u == "function" ? {
|
|
16292
16547
|
View: u,
|
|
16293
|
-
markup:
|
|
16548
|
+
markup: bd(e, l, a?.skipTarget)
|
|
16294
16549
|
} : null,
|
|
16295
16550
|
...l,
|
|
16296
16551
|
...s === "CollectionList" ? {
|
|
16297
16552
|
templateId: o.linkedNodes?.card,
|
|
16298
|
-
renderTemplate: o.linkedNodes?.card ? (e) =>
|
|
16553
|
+
renderTemplate: o.linkedNodes?.card ? (e) => Ed(o.linkedNodes.card, n, r, i, {
|
|
16299
16554
|
...a,
|
|
16300
16555
|
mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
|
|
16301
16556
|
}) : void 0
|
|
16302
16557
|
} : null,
|
|
16303
|
-
...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) =>
|
|
16558
|
+
...s === "LightboxGallery" && o.linkedNodes?.item ? { renderTemplate: (e) => Ed(o.linkedNodes.item, n, r, i, {
|
|
16304
16559
|
...a,
|
|
16305
16560
|
mapProps: a?.mapProps ? (t, n) => a.mapProps(e(t, n), n) : e
|
|
16306
16561
|
}) } : null,
|
|
16307
|
-
...s === "TableBlock" && l.repeat ? { renderCell: (e, t) => o.linkedNodes?.[e] ?
|
|
16562
|
+
...s === "TableBlock" && l.repeat ? { renderCell: (e, t) => o.linkedNodes?.[e] ? Ed(o.linkedNodes[e], n, r, i, {
|
|
16308
16563
|
...a,
|
|
16309
16564
|
mapProps: a?.mapProps ? (e, n) => a.mapProps(t(e, n), n) : t
|
|
16310
16565
|
}) : null } : null,
|
|
16311
|
-
...s === "FormLabel" ? { htmlFor:
|
|
16566
|
+
...s === "FormLabel" ? { htmlFor: Cd(e, l, n, o.parent) } : null,
|
|
16312
16567
|
linked: h,
|
|
16313
16568
|
nodeRef: (t) => {
|
|
16314
16569
|
t && (t.setAttribute("data-wb", e), Se(t, l), a?.skipTarget?.id === e && (t.id = l.htmlId || a.skipTarget.htmlId, t.tabIndex = -1), xe(t, a?.events === !1 ? [] : l.events));
|
|
16315
16570
|
},
|
|
16316
16571
|
children: p.length ? p : void 0
|
|
16317
|
-
}, e), v = l.when && l.when !== "always" ? /* @__PURE__ */ g(
|
|
16572
|
+
}, e), v = l.when && l.when !== "always" ? /* @__PURE__ */ g(Ls, {
|
|
16318
16573
|
when: l.when,
|
|
16319
16574
|
children: _
|
|
16320
16575
|
}, e) : _;
|
|
@@ -16325,9 +16580,9 @@ function Sd(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
16325
16580
|
}
|
|
16326
16581
|
//#endregion
|
|
16327
16582
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
16328
|
-
var
|
|
16583
|
+
var Dd = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Od = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ft(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
16329
16584
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(ft(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
16330
|
-
function
|
|
16585
|
+
function kd({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: a, animations: o, tenant: s, apiUrl: l, datasets: f, locale: p, direction: m, settings: v, siteUser: y, param: x }) {
|
|
16331
16586
|
let S = a?.js?.trim(), C = v && v["site.code"] && typeof v["site.code"] == "object" ? v["site.code"] : null, w = typeof C?.js == "string" ? C.js.trim() : "", T = typeof C?.css == "string" ? C.css.trim() : "";
|
|
16332
16587
|
c(() => {
|
|
16333
16588
|
if (!w) return;
|
|
@@ -16347,14 +16602,14 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16347
16602
|
minHeight: "100%",
|
|
16348
16603
|
display: "flex",
|
|
16349
16604
|
flexDirection: "column"
|
|
16350
|
-
}, M = Ft(e, n), N = Je(v), P =
|
|
16605
|
+
}, M = Ft(e, n), N = Je(v), P = Ed("ROOT", e, n, void 0, {
|
|
16351
16606
|
skipTarget: M || void 0,
|
|
16352
16607
|
elementDefaults: N
|
|
16353
16608
|
}), F = M ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("style", { children: kt }), /* @__PURE__ */ g("a", {
|
|
16354
16609
|
className: "webim-skip",
|
|
16355
16610
|
href: `#${M.htmlId}`,
|
|
16356
16611
|
children: Et(p || v?.locales?.default)("skip")
|
|
16357
|
-
})] }) : null, I = u(() => ({ render: (t, r) =>
|
|
16612
|
+
})] }) : null, I = u(() => ({ render: (t, r) => Ed(t, e, n, void 0, {
|
|
16358
16613
|
mapProps: r,
|
|
16359
16614
|
elementDefaults: N
|
|
16360
16615
|
}) }), [
|
|
@@ -16365,7 +16620,7 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16365
16620
|
rel: "stylesheet",
|
|
16366
16621
|
precedence: "default",
|
|
16367
16622
|
href: E(e)
|
|
16368
|
-
}, e)), W =
|
|
16623
|
+
}, e)), W = Od(V), G = _t(t);
|
|
16369
16624
|
return r === "auto" ? /* @__PURE__ */ g(Z.Provider, {
|
|
16370
16625
|
value: {
|
|
16371
16626
|
tenant: s || "",
|
|
@@ -16374,7 +16629,7 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16374
16629
|
settings: v ?? null,
|
|
16375
16630
|
param: x || ""
|
|
16376
16631
|
},
|
|
16377
|
-
children: /* @__PURE__ */ g(
|
|
16632
|
+
children: /* @__PURE__ */ g(Is, {
|
|
16378
16633
|
initialUser: y,
|
|
16379
16634
|
children: /* @__PURE__ */ g(ir.Provider, {
|
|
16380
16635
|
value: f ?? null,
|
|
@@ -16391,8 +16646,8 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16391
16646
|
},
|
|
16392
16647
|
children: [
|
|
16393
16648
|
F,
|
|
16394
|
-
/* @__PURE__ */ g("style", { children: `.webim-page { ${
|
|
16395
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
16649
|
+
/* @__PURE__ */ g("style", { children: `.webim-page { ${Dd(ft(V.light))} }
|
|
16650
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Dd(ft(V.dark))} } }` }),
|
|
16396
16651
|
/* @__PURE__ */ g("style", { children: W }),
|
|
16397
16652
|
U,
|
|
16398
16653
|
/* @__PURE__ */ g("style", { children: A }),
|
|
@@ -16416,7 +16671,7 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16416
16671
|
settings: v ?? null,
|
|
16417
16672
|
param: x || ""
|
|
16418
16673
|
},
|
|
16419
|
-
children: /* @__PURE__ */ g(
|
|
16674
|
+
children: /* @__PURE__ */ g(Is, {
|
|
16420
16675
|
initialUser: y,
|
|
16421
16676
|
children: /* @__PURE__ */ g(ir.Provider, {
|
|
16422
16677
|
value: f ?? null,
|
|
@@ -16452,7 +16707,7 @@ function Td({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
16452
16707
|
}
|
|
16453
16708
|
//#endregion
|
|
16454
16709
|
//#region src/WebimContent.jsx
|
|
16455
|
-
function
|
|
16710
|
+
function Ad(e) {
|
|
16456
16711
|
let t = e?.apiUrl, n = e?.tenant, r = e?.slug;
|
|
16457
16712
|
c(() => {
|
|
16458
16713
|
if (typeof window > "u" || !r || !t || new URLSearchParams(window.location.search).has("preview") || navigator.doNotTrack === "1" || window.doNotTrack === "1") return;
|
|
@@ -16475,8 +16730,8 @@ function Ed(e) {
|
|
|
16475
16730
|
r
|
|
16476
16731
|
]);
|
|
16477
16732
|
}
|
|
16478
|
-
function
|
|
16479
|
-
return
|
|
16733
|
+
function jd({ bundle: e, mode: t = "auto", style: n }) {
|
|
16734
|
+
return Ad(e), e?.blocks?.ROOT ? /* @__PURE__ */ g(kd, {
|
|
16480
16735
|
blocks: e.blocks,
|
|
16481
16736
|
theme: e.theme,
|
|
16482
16737
|
components: e.components,
|
|
@@ -16495,24 +16750,24 @@ function Dd({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
16495
16750
|
}
|
|
16496
16751
|
//#endregion
|
|
16497
16752
|
//#region src/fetchPage.js
|
|
16498
|
-
var
|
|
16753
|
+
var Md = async (e) => {
|
|
16499
16754
|
let t = await e.json().catch(() => null);
|
|
16500
16755
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
16501
16756
|
return t?.payload ?? t;
|
|
16502
16757
|
};
|
|
16503
|
-
async function
|
|
16758
|
+
async function Nd({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
16504
16759
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
16505
16760
|
if (!n) throw Error("fetchPage: slug is required");
|
|
16506
16761
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
16507
16762
|
...t ? { "x-tenant": t } : {},
|
|
16508
16763
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
16509
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
16764
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Md), c(`${l}/settings/public`, { headers: u }).then(Md)]), p = Ct({
|
|
16510
16765
|
page: d,
|
|
16511
16766
|
settings: f,
|
|
16512
16767
|
tenant: t,
|
|
16513
16768
|
apiUrl: l,
|
|
16514
16769
|
locale: r
|
|
16515
|
-
}), m = [...new Set(
|
|
16770
|
+
}), m = [...new Set(Pd(p.blocks, p.components).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
|
|
16516
16771
|
"TableBlock",
|
|
16517
16772
|
"OrgChartBlock",
|
|
16518
16773
|
"NavbarBlock",
|
|
@@ -16523,7 +16778,7 @@ async function kd({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
16523
16778
|
"LogoCarousel"
|
|
16524
16779
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
16525
16780
|
if (m.length) {
|
|
16526
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
16781
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Md).then((e) => {
|
|
16527
16782
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
16528
16783
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
16529
16784
|
}).catch(() => [[t, []]])));
|
|
@@ -16535,7 +16790,7 @@ async function kd({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
16535
16790
|
__page: Math.floor(h)
|
|
16536
16791
|
}), p;
|
|
16537
16792
|
}
|
|
16538
|
-
function
|
|
16793
|
+
function Pd(e, t) {
|
|
16539
16794
|
let n = [], r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
16540
16795
|
Object.values(e ?? {}).forEach((e) => {
|
|
16541
16796
|
n.push(e);
|
|
@@ -16547,41 +16802,41 @@ function Ad(e, t) {
|
|
|
16547
16802
|
}
|
|
16548
16803
|
//#endregion
|
|
16549
16804
|
//#region src/ssr.jsx
|
|
16550
|
-
var
|
|
16805
|
+
var Fd = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
16551
16806
|
"&": "&",
|
|
16552
16807
|
"<": "<",
|
|
16553
16808
|
">": ">",
|
|
16554
16809
|
"\"": """
|
|
16555
16810
|
})[e]);
|
|
16556
|
-
function
|
|
16557
|
-
return e(/* @__PURE__ */ g(
|
|
16811
|
+
function Id(t, { mode: n = "auto", style: r } = {}) {
|
|
16812
|
+
return e(/* @__PURE__ */ g(jd, {
|
|
16558
16813
|
bundle: t,
|
|
16559
16814
|
mode: n,
|
|
16560
16815
|
style: r
|
|
16561
16816
|
}));
|
|
16562
16817
|
}
|
|
16563
|
-
function
|
|
16818
|
+
function Ld(e, { mode: t = "auto", lang: n } = {}) {
|
|
16564
16819
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = b(e.direction, i), o = wt(e) || "Page", s = e.custom?.js?.trim(), c = e.settings?.["site.code"], l = typeof c?.js == "string" ? c.js.trim() : "", u = (e) => `<script>${e.replaceAll("<\/script", "<\\/script")}<\/script>`, d = [
|
|
16565
16820
|
"<meta charset=\"utf-8\"/>",
|
|
16566
16821
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
16567
|
-
`<title>${
|
|
16568
|
-
r.description && `<meta name="description" content="${
|
|
16569
|
-
`<meta property="og:title" content="${
|
|
16570
|
-
r.image && `<meta property="og:image" content="${
|
|
16822
|
+
`<title>${Fd(o)}</title>`,
|
|
16823
|
+
r.description && `<meta name="description" content="${Fd(r.description)}"/>`,
|
|
16824
|
+
`<meta property="og:title" content="${Fd(o)}"/>`,
|
|
16825
|
+
r.image && `<meta property="og:image" content="${Fd(r.image)}"/>`,
|
|
16571
16826
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
16572
16827
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
16573
16828
|
].filter(Boolean).join("\n");
|
|
16574
16829
|
return `<!doctype html>
|
|
16575
|
-
<html lang="${
|
|
16830
|
+
<html lang="${Fd(i)}"${a ? ` dir="${a}"` : ""}>
|
|
16576
16831
|
<head>
|
|
16577
16832
|
${d}
|
|
16578
16833
|
</head>
|
|
16579
16834
|
<body>
|
|
16580
|
-
${
|
|
16835
|
+
${Id(e, { mode: t })}
|
|
16581
16836
|
${l ? u(l) : ""}
|
|
16582
16837
|
${s ? u(s) : ""}
|
|
16583
16838
|
</body>
|
|
16584
16839
|
</html>`;
|
|
16585
16840
|
}
|
|
16586
16841
|
//#endregion
|
|
16587
|
-
export { Ct as assembleBundle, wt as documentTitle,
|
|
16842
|
+
export { Ct as assembleBundle, wt as documentTitle, Nd as fetchPage, Id as renderBundleHtml, Ld as renderPageDocument };
|