webim-adapter 0.21.0 → 0.23.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 +900 -840
- package/build/webim-embed.js +11 -11
- package/build/webim-ssr.js +694 -636
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -1,36 +1,198 @@
|
|
|
1
1
|
import { Fragment as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
2
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
var f = new Map([
|
|
4
|
+
{
|
|
5
|
+
family: "Bebas Neue",
|
|
6
|
+
fallback: "sans-serif",
|
|
7
|
+
weights: "400"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
family: "Crimson Text",
|
|
11
|
+
fallback: "serif",
|
|
12
|
+
weights: "400;600;700"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
family: "DM Sans",
|
|
16
|
+
fallback: "sans-serif",
|
|
17
|
+
weights: "100..1000"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
family: "Fira Sans",
|
|
21
|
+
fallback: "sans-serif",
|
|
22
|
+
weights: "100;200;300;400;500;600;700;800;900"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
family: "Inter",
|
|
26
|
+
fallback: "sans-serif",
|
|
27
|
+
weights: "100..900"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
family: "JetBrains Mono",
|
|
31
|
+
fallback: "monospace",
|
|
32
|
+
weights: "100..800"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
family: "Josefin Sans",
|
|
36
|
+
fallback: "sans-serif",
|
|
37
|
+
weights: "100..700"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
family: "Karla",
|
|
41
|
+
fallback: "sans-serif",
|
|
42
|
+
weights: "200..800"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
family: "Lato",
|
|
46
|
+
fallback: "sans-serif",
|
|
47
|
+
weights: "100;300;400;700;900"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
family: "Lora",
|
|
51
|
+
fallback: "serif",
|
|
52
|
+
weights: "400..700"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
family: "Manrope",
|
|
56
|
+
fallback: "sans-serif",
|
|
57
|
+
weights: "200..800"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
family: "Merriweather",
|
|
61
|
+
fallback: "serif",
|
|
62
|
+
weights: "300..900"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
family: "Montserrat",
|
|
66
|
+
fallback: "sans-serif",
|
|
67
|
+
weights: "100..900"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
family: "Nunito",
|
|
71
|
+
fallback: "sans-serif",
|
|
72
|
+
weights: "200..1000"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
family: "Open Sans",
|
|
76
|
+
fallback: "sans-serif",
|
|
77
|
+
weights: "300..800"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
family: "Oswald",
|
|
81
|
+
fallback: "sans-serif",
|
|
82
|
+
weights: "200..700"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
family: "Outfit",
|
|
86
|
+
fallback: "sans-serif",
|
|
87
|
+
weights: "100..900"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
family: "Playfair Display",
|
|
91
|
+
fallback: "serif",
|
|
92
|
+
weights: "400..900"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
family: "Poppins",
|
|
96
|
+
fallback: "sans-serif",
|
|
97
|
+
weights: "100;200;300;400;500;600;700;800;900"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
family: "Quicksand",
|
|
101
|
+
fallback: "sans-serif",
|
|
102
|
+
weights: "300..700"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
family: "Raleway",
|
|
106
|
+
fallback: "sans-serif",
|
|
107
|
+
weights: "100..900"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
family: "Roboto",
|
|
111
|
+
fallback: "sans-serif",
|
|
112
|
+
weights: "100..900"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
family: "Rubik",
|
|
116
|
+
fallback: "sans-serif",
|
|
117
|
+
weights: "300..900"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
family: "Source Sans 3",
|
|
121
|
+
fallback: "sans-serif",
|
|
122
|
+
weights: "200..900"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
family: "Space Grotesk",
|
|
126
|
+
fallback: "sans-serif",
|
|
127
|
+
weights: "300..700"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
family: "Work Sans",
|
|
131
|
+
fallback: "sans-serif",
|
|
132
|
+
weights: "100..900"
|
|
133
|
+
}
|
|
134
|
+
].map((e) => [e.family, e])), p = (e) => `"${e.family}", ${e.fallback}`, m = (e) => {
|
|
135
|
+
let t = f.get(e)?.weights;
|
|
136
|
+
return `family=${e.replace(/ /g, "+")}${t ? `:wght@${t}` : ""}`;
|
|
137
|
+
};
|
|
138
|
+
function h(e) {
|
|
139
|
+
return e.length ? `https://fonts.googleapis.com/css2?${e.map(m).join("&")}&display=swap` : null;
|
|
140
|
+
}
|
|
141
|
+
var g = (e) => h([e]), _ = (e) => {
|
|
142
|
+
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
143
|
+
return t ? t[1] : null;
|
|
144
|
+
}, v = (e) => {
|
|
145
|
+
let t = f.get(e);
|
|
146
|
+
return t ? p(t) : null;
|
|
147
|
+
};
|
|
148
|
+
function y(e, t) {
|
|
149
|
+
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
150
|
+
for (let t of Object.values(e || {})) for (let e of [
|
|
151
|
+
"style",
|
|
152
|
+
"hover",
|
|
153
|
+
"pressed",
|
|
154
|
+
"focused"
|
|
155
|
+
]) {
|
|
156
|
+
let r = _(t.props?.[e]?.fontFamily);
|
|
157
|
+
r && n.add(r);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
r(e);
|
|
161
|
+
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
162
|
+
return [...n].sort();
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
3
165
|
//#region ../ui/src/components/builder/styles.js
|
|
4
|
-
var
|
|
166
|
+
var b = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
|
|
5
167
|
"borderWidth",
|
|
6
168
|
"borderStyle",
|
|
7
169
|
"borderColor",
|
|
8
170
|
"borderRadius",
|
|
9
171
|
"gap"
|
|
10
172
|
];
|
|
11
|
-
function
|
|
173
|
+
function C(e) {
|
|
12
174
|
let t = {};
|
|
13
|
-
for (let n of
|
|
175
|
+
for (let n of S) {
|
|
14
176
|
let r = e?.[n];
|
|
15
|
-
r != null && r !== "" && (t[n] =
|
|
177
|
+
r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
|
|
16
178
|
}
|
|
17
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
179
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
|
|
18
180
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
19
181
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
20
182
|
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
21
183
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
22
|
-
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
184
|
+
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
23
185
|
[
|
|
24
186
|
s,
|
|
25
187
|
c,
|
|
26
188
|
l,
|
|
27
189
|
u
|
|
28
|
-
].some((e) => e !== void 0) && d.push(`${
|
|
29
|
-
let
|
|
190
|
+
].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
|
|
191
|
+
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${x(e.x ?? 0)}, ${x(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: C } = t;
|
|
30
192
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
31
|
-
let w = (Array.isArray(
|
|
32
|
-
(
|
|
33
|
-
let T = (e) => `${e.inset ? "inset " : ""}${
|
|
193
|
+
let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
|
|
194
|
+
(h !== void 0 || g !== void 0) && w.push(`translate(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
|
|
195
|
+
let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
|
|
34
196
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
35
197
|
let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
|
|
36
198
|
[
|
|
@@ -48,76 +210,76 @@ function h(e) {
|
|
|
48
210
|
color: j,
|
|
49
211
|
inset: M
|
|
50
212
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let P = (e) => e.type === "blur" ? `blur(${
|
|
213
|
+
let P = (e) => e.type === "blur" ? `blur(${x(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: ee, filterContrast: te, filterSaturate: B } = t;
|
|
52
214
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
|
-
let
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
let { textStrokeWidth:
|
|
58
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
59
|
-
let { clipText:
|
|
60
|
-
delete t.clipText,
|
|
61
|
-
let { transitions:
|
|
215
|
+
let V = F(I);
|
|
216
|
+
R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
|
|
217
|
+
let ne = F(L);
|
|
218
|
+
ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
219
|
+
let { textStrokeWidth: re, textStrokeColor: ie } = t;
|
|
220
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
|
|
221
|
+
let { clipText: ae } = t;
|
|
222
|
+
delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
223
|
+
let { transitions: oe, transitionDuration: se, transitionEasing: ce, transitionProperty: le } = t, ue = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
224
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
225
|
+
let H = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ue(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
226
|
+
if (se !== void 0 && H.push(`${le || "all"} ${ue(se)} ${ce || "ease"}`), H.length && (t.transition = H.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
227
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
228
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
229
|
}
|
|
68
230
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
231
|
+
let { overlayColor: U, overlayOpacity: de } = t;
|
|
232
|
+
if (delete t.overlayColor, delete t.overlayOpacity, U) {
|
|
233
|
+
let e = `color-mix(in srgb, ${U} ${de ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
234
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
235
|
}
|
|
74
236
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
237
|
+
let { backgroundLayers: fe } = t;
|
|
76
238
|
delete t.backgroundLayers;
|
|
77
|
-
let pe = (Array.isArray(
|
|
239
|
+
let pe = (Array.isArray(fe) ? fe : []).filter((e) => e && e.on !== !1);
|
|
78
240
|
if (pe.length) {
|
|
79
241
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
242
|
for (let t of pe) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
81
243
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
82
244
|
else {
|
|
83
245
|
if (!t.src) continue;
|
|
84
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
246
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
85
247
|
}
|
|
86
248
|
e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
|
|
87
249
|
}
|
|
88
250
|
return t;
|
|
89
251
|
}
|
|
90
|
-
var
|
|
252
|
+
var w = {
|
|
91
253
|
hover: ":hover",
|
|
92
254
|
pressed: ":active",
|
|
93
255
|
focused: ":focus"
|
|
94
|
-
},
|
|
256
|
+
}, T = /* @__PURE__ */ new Set([
|
|
95
257
|
"style",
|
|
96
258
|
"class",
|
|
97
259
|
"id",
|
|
98
260
|
"data-wb",
|
|
99
261
|
"data-wb-class",
|
|
100
262
|
"data-slot"
|
|
101
|
-
]),
|
|
102
|
-
function
|
|
263
|
+
]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
|
|
264
|
+
function D(e, t, n = []) {
|
|
103
265
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
104
266
|
for (let t of n) e.removeAttribute(t);
|
|
105
267
|
let r = [];
|
|
106
268
|
for (let n of t.attributes ?? []) {
|
|
107
269
|
let t = String(n?.name ?? "").trim();
|
|
108
|
-
|
|
270
|
+
E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
|
|
109
271
|
}
|
|
110
272
|
return r;
|
|
111
273
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
114
|
-
let i = Object.entries(
|
|
274
|
+
var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
275
|
+
function k(e, t, n, r = !1) {
|
|
276
|
+
let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
|
|
115
277
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
116
278
|
}
|
|
117
|
-
function
|
|
118
|
-
return Object.entries(
|
|
279
|
+
function A(e, t, n) {
|
|
280
|
+
return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
119
281
|
}
|
|
120
|
-
var
|
|
282
|
+
var j = [
|
|
121
283
|
{
|
|
122
284
|
key: "tablet",
|
|
123
285
|
max: 991
|
|
@@ -130,17 +292,17 @@ var C = [
|
|
|
130
292
|
key: "mobile",
|
|
131
293
|
max: 478
|
|
132
294
|
}
|
|
133
|
-
],
|
|
134
|
-
function
|
|
135
|
-
return
|
|
136
|
-
let i = t?.[n] ?
|
|
295
|
+
], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
|
|
296
|
+
function N(e, t) {
|
|
297
|
+
return j.map(({ key: n, max: r }) => {
|
|
298
|
+
let i = t?.[n] ? M(t[n]) : "";
|
|
137
299
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
138
300
|
}).filter(Boolean).join("\n");
|
|
139
301
|
}
|
|
140
|
-
function
|
|
302
|
+
function P(e, t) {
|
|
141
303
|
let n = [], r = (e) => {
|
|
142
304
|
for (let [t, r] of Object.entries(e || {})) {
|
|
143
|
-
let e =
|
|
305
|
+
let e = N(t, r.props);
|
|
144
306
|
e && n.push(e);
|
|
145
307
|
}
|
|
146
308
|
};
|
|
@@ -148,10 +310,10 @@ function E(e, t) {
|
|
|
148
310
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
149
311
|
return n.join("\n");
|
|
150
312
|
}
|
|
151
|
-
function
|
|
313
|
+
function F(e, t) {
|
|
152
314
|
let n = [], r = (e) => {
|
|
153
315
|
for (let [t, r] of Object.entries(e || {})) {
|
|
154
|
-
let e =
|
|
316
|
+
let e = A(t, r.props);
|
|
155
317
|
e && n.push(e);
|
|
156
318
|
}
|
|
157
319
|
};
|
|
@@ -159,7 +321,7 @@ function D(e, t) {
|
|
|
159
321
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
160
322
|
return n.join("\n");
|
|
161
323
|
}
|
|
162
|
-
var
|
|
324
|
+
var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
|
|
163
325
|
light: {
|
|
164
326
|
background: "#ffffff",
|
|
165
327
|
text: "#111827",
|
|
@@ -196,23 +358,23 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
196
358
|
contrastText: "#052e2b"
|
|
197
359
|
}
|
|
198
360
|
}
|
|
199
|
-
},
|
|
361
|
+
}, R = {
|
|
200
362
|
font: "system",
|
|
201
363
|
headingFont: "inherit",
|
|
202
|
-
light:
|
|
203
|
-
dark:
|
|
204
|
-
},
|
|
364
|
+
light: L.light,
|
|
365
|
+
dark: L.dark
|
|
366
|
+
}, z = {
|
|
205
367
|
system: {
|
|
206
368
|
label: "System",
|
|
207
|
-
value:
|
|
369
|
+
value: I
|
|
208
370
|
},
|
|
209
371
|
inter: {
|
|
210
372
|
label: "Inter",
|
|
211
|
-
value: `"Inter", ${
|
|
373
|
+
value: `"Inter", ${I}`
|
|
212
374
|
},
|
|
213
375
|
outfit: {
|
|
214
376
|
label: "Outfit",
|
|
215
|
-
value: `"Outfit", ${
|
|
377
|
+
value: `"Outfit", ${I}`
|
|
216
378
|
},
|
|
217
379
|
serif: {
|
|
218
380
|
label: "Serif",
|
|
@@ -222,7 +384,7 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
222
384
|
label: "Mono",
|
|
223
385
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
224
386
|
}
|
|
225
|
-
},
|
|
387
|
+
}, ee = (e, t) => z[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), te = (e, ...t) => {
|
|
226
388
|
let n = Object.assign({}, e, ...t);
|
|
227
389
|
return n.primary = {
|
|
228
390
|
...e.primary,
|
|
@@ -238,16 +400,16 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
238
400
|
}), {})
|
|
239
401
|
}, n;
|
|
240
402
|
};
|
|
241
|
-
function
|
|
403
|
+
function B(e) {
|
|
242
404
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
243
405
|
return {
|
|
244
|
-
font: r ??
|
|
245
|
-
headingFont: i ??
|
|
246
|
-
light:
|
|
247
|
-
dark:
|
|
406
|
+
font: r ?? R.font,
|
|
407
|
+
headingFont: i ?? R.headingFont,
|
|
408
|
+
light: te(L.light, a, t),
|
|
409
|
+
dark: te(L.dark, n)
|
|
248
410
|
};
|
|
249
411
|
}
|
|
250
|
-
function
|
|
412
|
+
function V(e) {
|
|
251
413
|
return {
|
|
252
414
|
"--page-bg": e.background,
|
|
253
415
|
"--page-text": e.text,
|
|
@@ -263,28 +425,28 @@ function F(e) {
|
|
|
263
425
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
264
426
|
};
|
|
265
427
|
}
|
|
266
|
-
function
|
|
267
|
-
let t =
|
|
428
|
+
function ne(e) {
|
|
429
|
+
let t = B(e);
|
|
268
430
|
return {
|
|
269
431
|
backgroundColor: "var(--page-bg)",
|
|
270
432
|
color: "var(--page-text)",
|
|
271
|
-
fontFamily:
|
|
272
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
433
|
+
fontFamily: ee(t.font, I),
|
|
434
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
|
|
273
435
|
};
|
|
274
436
|
}
|
|
275
|
-
function
|
|
276
|
-
let n =
|
|
437
|
+
function re(e, t = "light") {
|
|
438
|
+
let n = B(e);
|
|
277
439
|
return {
|
|
278
|
-
...
|
|
279
|
-
...
|
|
440
|
+
...ne(e),
|
|
441
|
+
...V(n[t] ?? n.light)
|
|
280
442
|
};
|
|
281
443
|
}
|
|
282
|
-
function
|
|
444
|
+
function ie(e, t) {
|
|
283
445
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
284
446
|
}
|
|
285
447
|
//#endregion
|
|
286
448
|
//#region src/bundle.js
|
|
287
|
-
function
|
|
449
|
+
function ae({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
288
450
|
let a = {
|
|
289
451
|
...t?.global ?? {},
|
|
290
452
|
...t?.tenant ?? {}
|
|
@@ -294,7 +456,7 @@ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
294
456
|
title: e.title,
|
|
295
457
|
slug: e.slug,
|
|
296
458
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
297
|
-
theme:
|
|
459
|
+
theme: ie(o, a.builder_themes?.themes),
|
|
298
460
|
components: a.builder_components?.components ?? {},
|
|
299
461
|
custom: o.custom,
|
|
300
462
|
seo: o.seo,
|
|
@@ -308,18 +470,18 @@ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
308
470
|
}
|
|
309
471
|
//#endregion
|
|
310
472
|
//#region src/fetchPage.js
|
|
311
|
-
var
|
|
473
|
+
var oe = async (e) => {
|
|
312
474
|
let t = await e.json().catch(() => null);
|
|
313
475
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
314
476
|
return t?.payload ?? t;
|
|
315
477
|
};
|
|
316
|
-
async function
|
|
478
|
+
async function se({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
317
479
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
318
480
|
if (!n) throw Error("fetchPage: slug is required");
|
|
319
481
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
320
482
|
...t ? { "x-tenant": t } : {},
|
|
321
483
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
322
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
484
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(oe), c(`${l}/settings/public`, { headers: u }).then(oe)]), p = ae({
|
|
323
485
|
page: d,
|
|
324
486
|
settings: f,
|
|
325
487
|
tenant: t,
|
|
@@ -327,7 +489,7 @@ async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
327
489
|
locale: r
|
|
328
490
|
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
329
491
|
if (m.length) {
|
|
330
|
-
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(
|
|
492
|
+
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(oe).then((e) => {
|
|
331
493
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
332
494
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
333
495
|
}).catch(() => [[t, []]])));
|
|
@@ -339,138 +501,9 @@ async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
339
501
|
__page: Math.floor(h)
|
|
340
502
|
}), p;
|
|
341
503
|
}
|
|
342
|
-
new Map([
|
|
343
|
-
{
|
|
344
|
-
family: "Bebas Neue",
|
|
345
|
-
fallback: "sans-serif"
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
family: "Crimson Text",
|
|
349
|
-
fallback: "serif"
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
family: "DM Sans",
|
|
353
|
-
fallback: "sans-serif"
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
family: "Fira Sans",
|
|
357
|
-
fallback: "sans-serif"
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
family: "Inter",
|
|
361
|
-
fallback: "sans-serif"
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
family: "JetBrains Mono",
|
|
365
|
-
fallback: "monospace"
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
family: "Josefin Sans",
|
|
369
|
-
fallback: "sans-serif"
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
family: "Karla",
|
|
373
|
-
fallback: "sans-serif"
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
family: "Lato",
|
|
377
|
-
fallback: "sans-serif"
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
family: "Lora",
|
|
381
|
-
fallback: "serif"
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
family: "Manrope",
|
|
385
|
-
fallback: "sans-serif"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
family: "Merriweather",
|
|
389
|
-
fallback: "serif"
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
family: "Montserrat",
|
|
393
|
-
fallback: "sans-serif"
|
|
394
|
-
},
|
|
395
|
-
{
|
|
396
|
-
family: "Nunito",
|
|
397
|
-
fallback: "sans-serif"
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
family: "Open Sans",
|
|
401
|
-
fallback: "sans-serif"
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
family: "Oswald",
|
|
405
|
-
fallback: "sans-serif"
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
family: "Outfit",
|
|
409
|
-
fallback: "sans-serif"
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
family: "Playfair Display",
|
|
413
|
-
fallback: "serif"
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
family: "Poppins",
|
|
417
|
-
fallback: "sans-serif"
|
|
418
|
-
},
|
|
419
|
-
{
|
|
420
|
-
family: "Quicksand",
|
|
421
|
-
fallback: "sans-serif"
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
family: "Raleway",
|
|
425
|
-
fallback: "sans-serif"
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
family: "Roboto",
|
|
429
|
-
fallback: "sans-serif"
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
family: "Rubik",
|
|
433
|
-
fallback: "sans-serif"
|
|
434
|
-
},
|
|
435
|
-
{
|
|
436
|
-
family: "Source Sans 3",
|
|
437
|
-
fallback: "sans-serif"
|
|
438
|
-
},
|
|
439
|
-
{
|
|
440
|
-
family: "Space Grotesk",
|
|
441
|
-
fallback: "sans-serif"
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
family: "Work Sans",
|
|
445
|
-
fallback: "sans-serif"
|
|
446
|
-
}
|
|
447
|
-
].map((e) => [e.family, e]));
|
|
448
|
-
function re(e) {
|
|
449
|
-
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
450
|
-
}
|
|
451
|
-
var z = (e) => re([e]), ie = (e) => {
|
|
452
|
-
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
453
|
-
return t ? t[1] : null;
|
|
454
|
-
};
|
|
455
|
-
function ae(e, t) {
|
|
456
|
-
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
457
|
-
for (let t of Object.values(e || {})) for (let e of [
|
|
458
|
-
"style",
|
|
459
|
-
"hover",
|
|
460
|
-
"pressed",
|
|
461
|
-
"focused"
|
|
462
|
-
]) {
|
|
463
|
-
let r = ie(t.props?.[e]?.fontFamily);
|
|
464
|
-
r && n.add(r);
|
|
465
|
-
}
|
|
466
|
-
};
|
|
467
|
-
r(e);
|
|
468
|
-
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
469
|
-
return [...n].sort();
|
|
470
|
-
}
|
|
471
504
|
//#endregion
|
|
472
505
|
//#region ../ui/src/components/builder/locale.js
|
|
473
|
-
var
|
|
506
|
+
var ce = /* @__PURE__ */ new Set([
|
|
474
507
|
"ar",
|
|
475
508
|
"he",
|
|
476
509
|
"fa",
|
|
@@ -481,34 +514,34 @@ var oe = /* @__PURE__ */ new Set([
|
|
|
481
514
|
"yi",
|
|
482
515
|
"dv",
|
|
483
516
|
"ckb"
|
|
484
|
-
]),
|
|
517
|
+
]), le = (e) => ce.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ue = (e, t) => e === "ltr" || e === "rtl" ? e : t ? le(t) : void 0, H = t({
|
|
485
518
|
tenant: "",
|
|
486
519
|
apiUrl: "/api",
|
|
487
520
|
locale: "",
|
|
488
521
|
settings: null
|
|
489
|
-
}),
|
|
522
|
+
}), U = t(null), de = (e) => {
|
|
490
523
|
let t = Number(e?.__page);
|
|
491
524
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
492
525
|
if (typeof window > "u") return 1;
|
|
493
526
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
494
527
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
495
|
-
},
|
|
528
|
+
}, fe = () => {
|
|
496
529
|
if (typeof window > "u") return {};
|
|
497
530
|
let e = {};
|
|
498
531
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
499
532
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
500
533
|
}), e;
|
|
501
|
-
},
|
|
534
|
+
}, pe = (e) => {
|
|
502
535
|
let t = {
|
|
503
536
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
504
|
-
...
|
|
537
|
+
...fe()
|
|
505
538
|
};
|
|
506
539
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
507
|
-
},
|
|
508
|
-
function
|
|
540
|
+
}, me = t(null), he = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
541
|
+
function W(e, t) {
|
|
509
542
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
510
543
|
}
|
|
511
|
-
var
|
|
544
|
+
var ge = (e) => {
|
|
512
545
|
let t = [];
|
|
513
546
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
514
547
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -518,36 +551,36 @@ var pe = (e) => {
|
|
|
518
551
|
}
|
|
519
552
|
return t;
|
|
520
553
|
};
|
|
521
|
-
function
|
|
554
|
+
function G(e) {
|
|
522
555
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
523
556
|
}
|
|
524
|
-
function
|
|
525
|
-
let n = t?.data ?? {}, r =
|
|
557
|
+
function _e(e, t) {
|
|
558
|
+
let n = t?.data ?? {}, r = ge(n);
|
|
526
559
|
if (!r.length) return e;
|
|
527
|
-
let i = RegExp(`:(${r.map(
|
|
560
|
+
let i = RegExp(`:(${r.map(he).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
528
561
|
return a(e);
|
|
529
562
|
}
|
|
530
|
-
var
|
|
563
|
+
var ve = {
|
|
531
564
|
margin: 0,
|
|
532
565
|
fontWeight: 700,
|
|
533
566
|
lineHeight: 1.2,
|
|
534
567
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
535
|
-
},
|
|
568
|
+
}, ye = { margin: 0 }, K = {
|
|
536
569
|
display: "inline-block",
|
|
537
570
|
textDecoration: "none",
|
|
538
571
|
cursor: "pointer",
|
|
539
572
|
backgroundColor: "var(--page-accent, #111827)",
|
|
540
573
|
color: "var(--page-accent-text, #ffffff)"
|
|
541
|
-
},
|
|
574
|
+
}, be = {
|
|
542
575
|
flexGrow: 1,
|
|
543
576
|
display: "flex",
|
|
544
577
|
flexDirection: "column",
|
|
545
578
|
position: "relative"
|
|
546
|
-
},
|
|
579
|
+
}, xe = {
|
|
547
580
|
display: "flex",
|
|
548
581
|
flexDirection: "column"
|
|
549
582
|
};
|
|
550
|
-
function
|
|
583
|
+
function Se({ style: e }) {
|
|
551
584
|
let t = e?.backgroundVideo;
|
|
552
585
|
if (!t) return null;
|
|
553
586
|
let n = {
|
|
@@ -573,32 +606,32 @@ function ye({ style: e }) {
|
|
|
573
606
|
background: r
|
|
574
607
|
} })] });
|
|
575
608
|
}
|
|
576
|
-
var
|
|
609
|
+
var Ce = (e, t) => e?.backgroundVideo ? {
|
|
577
610
|
position: "relative",
|
|
578
611
|
...t,
|
|
579
|
-
...
|
|
612
|
+
...C(e)
|
|
580
613
|
} : {
|
|
581
614
|
...t,
|
|
582
|
-
...
|
|
615
|
+
...C(e)
|
|
583
616
|
};
|
|
584
|
-
function
|
|
617
|
+
function we({ style: e, nodeRef: t, children: n }) {
|
|
585
618
|
return /* @__PURE__ */ d("div", {
|
|
586
619
|
ref: t,
|
|
587
620
|
style: {
|
|
588
|
-
...
|
|
589
|
-
...
|
|
621
|
+
...be,
|
|
622
|
+
...C(e)
|
|
590
623
|
},
|
|
591
|
-
children: [/* @__PURE__ */ u(
|
|
624
|
+
children: [/* @__PURE__ */ u(Se, { style: e }), n]
|
|
592
625
|
});
|
|
593
626
|
}
|
|
594
|
-
function
|
|
627
|
+
function Te({ style: e, nodeRef: t, children: n }) {
|
|
595
628
|
return /* @__PURE__ */ d("section", {
|
|
596
629
|
ref: t,
|
|
597
|
-
style:
|
|
598
|
-
children: [/* @__PURE__ */ u(
|
|
630
|
+
style: Ce(e, xe),
|
|
631
|
+
children: [/* @__PURE__ */ u(Se, { style: e }), n]
|
|
599
632
|
});
|
|
600
633
|
}
|
|
601
|
-
function
|
|
634
|
+
function Ee({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
602
635
|
let i = t ? {
|
|
603
636
|
position: "relative",
|
|
604
637
|
minHeight: 240
|
|
@@ -607,32 +640,32 @@ function Ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
607
640
|
ref: n,
|
|
608
641
|
style: i ? {
|
|
609
642
|
...i,
|
|
610
|
-
...
|
|
611
|
-
} :
|
|
612
|
-
children: [/* @__PURE__ */ u(
|
|
643
|
+
...Ce(e)
|
|
644
|
+
} : Ce(e),
|
|
645
|
+
children: [/* @__PURE__ */ u(Se, { style: e }), r]
|
|
613
646
|
});
|
|
614
647
|
}
|
|
615
|
-
function
|
|
648
|
+
function De({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
616
649
|
return /* @__PURE__ */ u(n, {
|
|
617
650
|
ref: a,
|
|
618
651
|
style: {
|
|
619
|
-
...
|
|
620
|
-
...
|
|
652
|
+
...ve,
|
|
653
|
+
...C(r)
|
|
621
654
|
},
|
|
622
|
-
children:
|
|
655
|
+
children: q(t, e, i)
|
|
623
656
|
});
|
|
624
657
|
}
|
|
625
|
-
var
|
|
626
|
-
fontFamily:
|
|
658
|
+
var Oe = {
|
|
659
|
+
fontFamily: z.mono.value,
|
|
627
660
|
background: "rgba(148, 163, 184, 0.18)",
|
|
628
661
|
padding: "1px 5px",
|
|
629
662
|
borderRadius: 4,
|
|
630
663
|
fontSize: "0.9em"
|
|
631
664
|
};
|
|
632
|
-
function
|
|
665
|
+
function ke(e, t = [], n, r) {
|
|
633
666
|
let i = e;
|
|
634
667
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
635
|
-
style:
|
|
668
|
+
style: Oe,
|
|
636
669
|
children: i
|
|
637
670
|
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
|
|
638
671
|
href: n,
|
|
@@ -642,13 +675,13 @@ function Ee(e, t = [], n, r) {
|
|
|
642
675
|
children: i
|
|
643
676
|
})), i;
|
|
644
677
|
}
|
|
645
|
-
function
|
|
678
|
+
function q(t, n, r) {
|
|
646
679
|
return t?.length ? t.map((t, n) => {
|
|
647
680
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
648
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
681
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: q(t.parts, "", r) }, n);
|
|
649
682
|
let i = t.text;
|
|
650
683
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
651
|
-
style:
|
|
684
|
+
style: Oe,
|
|
652
685
|
children: i
|
|
653
686
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
654
687
|
style: {
|
|
@@ -665,13 +698,13 @@ function K(t, n, r) {
|
|
|
665
698
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
666
699
|
}) : n;
|
|
667
700
|
}
|
|
668
|
-
function
|
|
701
|
+
function Ae({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
669
702
|
return /* @__PURE__ */ u("span", {
|
|
670
|
-
style:
|
|
671
|
-
children: e?.length ?
|
|
703
|
+
style: C(a),
|
|
704
|
+
children: e?.length ? q(e, t) : ke(t, n, r, i)
|
|
672
705
|
});
|
|
673
706
|
}
|
|
674
|
-
var
|
|
707
|
+
var je = {
|
|
675
708
|
h1: 40,
|
|
676
709
|
h2: 32,
|
|
677
710
|
h3: 26,
|
|
@@ -679,7 +712,7 @@ var Oe = {
|
|
|
679
712
|
h5: 19,
|
|
680
713
|
h6: 16
|
|
681
714
|
};
|
|
682
|
-
function
|
|
715
|
+
function Me({ align: e = "center", width: t, wrap: n } = {}) {
|
|
683
716
|
let r = t ? `${t}%` : void 0;
|
|
684
717
|
if (e === "full") return { width: "100%" };
|
|
685
718
|
let i = e === "left" || e === "right";
|
|
@@ -713,8 +746,8 @@ function ke({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
713
746
|
marginRight: "auto"
|
|
714
747
|
};
|
|
715
748
|
}
|
|
716
|
-
function
|
|
717
|
-
let r = n ?? ((e, n) =>
|
|
749
|
+
function Ne(e = [], t, n) {
|
|
750
|
+
let r = n ?? ((e, n) => q(e, n, t));
|
|
718
751
|
return e.map((t, n) => {
|
|
719
752
|
let i = {
|
|
720
753
|
marginTop: 0,
|
|
@@ -736,7 +769,7 @@ function Ae(e = [], t, n) {
|
|
|
736
769
|
marginLeft: 0,
|
|
737
770
|
marginRight: 0,
|
|
738
771
|
...i,
|
|
739
|
-
...
|
|
772
|
+
...Me(t)
|
|
740
773
|
},
|
|
741
774
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
742
775
|
href: t.href,
|
|
@@ -755,16 +788,16 @@ function Ae(e = [], t, n) {
|
|
|
755
788
|
})]
|
|
756
789
|
}, n);
|
|
757
790
|
}
|
|
758
|
-
if (t.type === "video") return
|
|
791
|
+
if (t.type === "video") return We(t.url) ? /* @__PURE__ */ u("div", {
|
|
759
792
|
style: {
|
|
760
793
|
...i,
|
|
761
|
-
...
|
|
794
|
+
...Me({
|
|
762
795
|
align: t.align,
|
|
763
796
|
wrap: t.wrap,
|
|
764
797
|
width: t.width ?? 100
|
|
765
798
|
})
|
|
766
799
|
},
|
|
767
|
-
children: /* @__PURE__ */ u(
|
|
800
|
+
children: /* @__PURE__ */ u(Ge, {
|
|
768
801
|
url: t.url,
|
|
769
802
|
autoplay: t.autoplay,
|
|
770
803
|
muted: t.muted,
|
|
@@ -826,17 +859,17 @@ function Ae(e = [], t, n) {
|
|
|
826
859
|
}
|
|
827
860
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
828
861
|
style: {
|
|
829
|
-
...
|
|
862
|
+
...Fe,
|
|
830
863
|
...i
|
|
831
864
|
},
|
|
832
865
|
children: r(t.parts, t.text)
|
|
833
866
|
}, n);
|
|
834
|
-
if (
|
|
867
|
+
if (je[t.type]) {
|
|
835
868
|
let e = t.type;
|
|
836
869
|
return /* @__PURE__ */ u(e, {
|
|
837
870
|
style: {
|
|
838
|
-
...
|
|
839
|
-
fontSize:
|
|
871
|
+
...ve,
|
|
872
|
+
fontSize: je[t.type],
|
|
840
873
|
...i
|
|
841
874
|
},
|
|
842
875
|
children: r(t.parts, t.text)
|
|
@@ -844,95 +877,95 @@ function Ae(e = [], t, n) {
|
|
|
844
877
|
}
|
|
845
878
|
return /* @__PURE__ */ u("p", {
|
|
846
879
|
style: {
|
|
847
|
-
...
|
|
880
|
+
...ye,
|
|
848
881
|
...i
|
|
849
882
|
},
|
|
850
883
|
children: r(t.parts, t.text)
|
|
851
884
|
}, n);
|
|
852
885
|
});
|
|
853
886
|
}
|
|
854
|
-
function
|
|
887
|
+
function Pe({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
855
888
|
return /* @__PURE__ */ u("div", {
|
|
856
889
|
ref: r,
|
|
857
890
|
style: {
|
|
858
891
|
display: "flow-root",
|
|
859
|
-
...
|
|
892
|
+
...C(t)
|
|
860
893
|
},
|
|
861
|
-
children:
|
|
894
|
+
children: Ne(e, n)
|
|
862
895
|
});
|
|
863
896
|
}
|
|
864
|
-
var
|
|
897
|
+
var Fe = {
|
|
865
898
|
margin: 0,
|
|
866
899
|
padding: "8px 0 8px 20px",
|
|
867
900
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
868
901
|
};
|
|
869
|
-
function
|
|
902
|
+
function Ie({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
870
903
|
return /* @__PURE__ */ u("blockquote", {
|
|
871
904
|
ref: i,
|
|
872
905
|
style: {
|
|
873
|
-
...
|
|
874
|
-
...
|
|
906
|
+
...Fe,
|
|
907
|
+
...C(n)
|
|
875
908
|
},
|
|
876
|
-
children:
|
|
909
|
+
children: q(t, e, r)
|
|
877
910
|
});
|
|
878
911
|
}
|
|
879
|
-
function
|
|
912
|
+
function Le({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
880
913
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
881
914
|
ref: r,
|
|
882
915
|
style: {
|
|
883
916
|
margin: 0,
|
|
884
917
|
paddingLeft: 24,
|
|
885
|
-
...
|
|
918
|
+
...C(n)
|
|
886
919
|
},
|
|
887
920
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
888
921
|
style: { marginBottom: 4 },
|
|
889
|
-
children:
|
|
922
|
+
children: q(e.parts, e.text)
|
|
890
923
|
}, t))
|
|
891
924
|
});
|
|
892
925
|
}
|
|
893
|
-
function
|
|
926
|
+
function Re({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
894
927
|
return /* @__PURE__ */ u("p", {
|
|
895
928
|
ref: i,
|
|
896
929
|
style: {
|
|
897
|
-
...
|
|
898
|
-
...
|
|
930
|
+
...ye,
|
|
931
|
+
...C(n)
|
|
899
932
|
},
|
|
900
|
-
children:
|
|
933
|
+
children: q(t, e, r)
|
|
901
934
|
});
|
|
902
935
|
}
|
|
903
|
-
var
|
|
936
|
+
var ze = {
|
|
904
937
|
color: "var(--page-accent, inherit)",
|
|
905
938
|
textDecoration: "underline",
|
|
906
939
|
textUnderlineOffset: 3,
|
|
907
940
|
cursor: "pointer"
|
|
908
941
|
};
|
|
909
|
-
function
|
|
942
|
+
function Be({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
910
943
|
return /* @__PURE__ */ u("a", {
|
|
911
944
|
ref: o,
|
|
912
945
|
href: n || "#",
|
|
913
946
|
target: r || void 0,
|
|
914
947
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
915
948
|
style: {
|
|
916
|
-
...
|
|
917
|
-
...
|
|
949
|
+
...ze,
|
|
950
|
+
...C(i)
|
|
918
951
|
},
|
|
919
|
-
children:
|
|
952
|
+
children: q(t, e, a)
|
|
920
953
|
});
|
|
921
954
|
}
|
|
922
|
-
function
|
|
955
|
+
function Ve({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
923
956
|
return /* @__PURE__ */ u("a", {
|
|
924
957
|
ref: o,
|
|
925
958
|
href: n || "#",
|
|
926
959
|
target: r || void 0,
|
|
927
960
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
928
961
|
style: {
|
|
929
|
-
...
|
|
930
|
-
...
|
|
962
|
+
...K,
|
|
963
|
+
...C(i)
|
|
931
964
|
},
|
|
932
|
-
children:
|
|
965
|
+
children: q(t, e, a)
|
|
933
966
|
});
|
|
934
967
|
}
|
|
935
|
-
function
|
|
968
|
+
function He({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
936
969
|
return e ? /* @__PURE__ */ u("img", {
|
|
937
970
|
ref: r,
|
|
938
971
|
src: e,
|
|
@@ -940,11 +973,11 @@ function ze({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
940
973
|
style: {
|
|
941
974
|
display: "block",
|
|
942
975
|
maxWidth: "100%",
|
|
943
|
-
...
|
|
976
|
+
...C(n)
|
|
944
977
|
}
|
|
945
978
|
}) : null;
|
|
946
979
|
}
|
|
947
|
-
function
|
|
980
|
+
function Ue({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
948
981
|
return e ? /* @__PURE__ */ u("video", {
|
|
949
982
|
ref: s,
|
|
950
983
|
src: e,
|
|
@@ -958,13 +991,13 @@ function Be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
958
991
|
display: "block",
|
|
959
992
|
width: "100%",
|
|
960
993
|
maxWidth: "100%",
|
|
961
|
-
...
|
|
994
|
+
...C(o)
|
|
962
995
|
}
|
|
963
996
|
}) : null;
|
|
964
997
|
}
|
|
965
|
-
var
|
|
966
|
-
function
|
|
967
|
-
let c =
|
|
998
|
+
var We = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
999
|
+
function Ge({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1000
|
+
let c = We(e);
|
|
968
1001
|
if (!c) return null;
|
|
969
1002
|
let l = new URLSearchParams({ rel: "0" });
|
|
970
1003
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
@@ -973,7 +1006,7 @@ function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
973
1006
|
position: "relative",
|
|
974
1007
|
width: "100%",
|
|
975
1008
|
paddingTop: "56.25%",
|
|
976
|
-
...
|
|
1009
|
+
...C(o)
|
|
977
1010
|
},
|
|
978
1011
|
children: /* @__PURE__ */ u("iframe", {
|
|
979
1012
|
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
@@ -990,7 +1023,7 @@ function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
990
1023
|
})
|
|
991
1024
|
});
|
|
992
1025
|
}
|
|
993
|
-
function
|
|
1026
|
+
function Ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
994
1027
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
995
1028
|
ref: i,
|
|
996
1029
|
src: e,
|
|
@@ -1002,11 +1035,11 @@ function Ue({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1002
1035
|
width: "100%",
|
|
1003
1036
|
height: 300,
|
|
1004
1037
|
border: 0,
|
|
1005
|
-
...
|
|
1038
|
+
...C(r)
|
|
1006
1039
|
}
|
|
1007
1040
|
}) : null;
|
|
1008
1041
|
}
|
|
1009
|
-
function
|
|
1042
|
+
function qe({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1010
1043
|
let [a, o] = c(null);
|
|
1011
1044
|
return i(() => {
|
|
1012
1045
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -1022,10 +1055,10 @@ function We({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1022
1055
|
ref: (e) => {
|
|
1023
1056
|
o(e), r && r(e);
|
|
1024
1057
|
},
|
|
1025
|
-
style:
|
|
1058
|
+
style: C(n)
|
|
1026
1059
|
});
|
|
1027
1060
|
}
|
|
1028
|
-
function
|
|
1061
|
+
function Je({ height: e, nodeRef: t }) {
|
|
1029
1062
|
return /* @__PURE__ */ u("div", {
|
|
1030
1063
|
ref: t,
|
|
1031
1064
|
style: {
|
|
@@ -1035,18 +1068,18 @@ function Ge({ height: e, nodeRef: t }) {
|
|
|
1035
1068
|
}
|
|
1036
1069
|
});
|
|
1037
1070
|
}
|
|
1038
|
-
function
|
|
1071
|
+
function Ye({ style: e, nodeRef: t }) {
|
|
1039
1072
|
return /* @__PURE__ */ u("div", {
|
|
1040
1073
|
ref: t,
|
|
1041
1074
|
style: {
|
|
1042
1075
|
height: 1,
|
|
1043
1076
|
alignSelf: "stretch",
|
|
1044
1077
|
flexShrink: 0,
|
|
1045
|
-
...
|
|
1078
|
+
...C(e)
|
|
1046
1079
|
}
|
|
1047
1080
|
});
|
|
1048
1081
|
}
|
|
1049
|
-
var
|
|
1082
|
+
var Xe = {
|
|
1050
1083
|
position: "absolute",
|
|
1051
1084
|
top: "50%",
|
|
1052
1085
|
transform: "translateY(-50%)",
|
|
@@ -1063,7 +1096,7 @@ var qe = {
|
|
|
1063
1096
|
alignItems: "center",
|
|
1064
1097
|
justifyContent: "center",
|
|
1065
1098
|
padding: 0
|
|
1066
|
-
},
|
|
1099
|
+
}, Ze = {
|
|
1067
1100
|
bottom: {
|
|
1068
1101
|
inset: "auto 0 0 0",
|
|
1069
1102
|
padding: "40px 24px 20px",
|
|
@@ -1082,56 +1115,56 @@ var qe = {
|
|
|
1082
1115
|
padding: 24,
|
|
1083
1116
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1084
1117
|
}
|
|
1085
|
-
},
|
|
1086
|
-
function
|
|
1087
|
-
let [p, m] = c(0), [
|
|
1118
|
+
}, Qe = 48;
|
|
1119
|
+
function $e({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1120
|
+
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1088
1121
|
if (i(() => {
|
|
1089
|
-
if (!n ||
|
|
1122
|
+
if (!n || h || _ || e < 2) return;
|
|
1090
1123
|
let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
|
|
1091
1124
|
return () => clearInterval(t);
|
|
1092
1125
|
}, [
|
|
1093
1126
|
n,
|
|
1094
|
-
|
|
1095
|
-
|
|
1127
|
+
h,
|
|
1128
|
+
_,
|
|
1096
1129
|
r,
|
|
1097
1130
|
e
|
|
1098
1131
|
]), !e) return null;
|
|
1099
|
-
let
|
|
1100
|
-
if (!
|
|
1101
|
-
let { dx: e } =
|
|
1102
|
-
|
|
1132
|
+
let b = (t) => m((t + e) % e), x = () => {
|
|
1133
|
+
if (!_) return;
|
|
1134
|
+
let { dx: e } = _;
|
|
1135
|
+
v(null), e < -48 ? b(y + 1) : e > Qe && b(y - 1);
|
|
1103
1136
|
};
|
|
1104
1137
|
return /* @__PURE__ */ d("div", {
|
|
1105
1138
|
ref: f,
|
|
1106
|
-
onMouseEnter: () =>
|
|
1107
|
-
onMouseLeave: () =>
|
|
1139
|
+
onMouseEnter: () => g(!0),
|
|
1140
|
+
onMouseLeave: () => g(!1),
|
|
1108
1141
|
onPointerDown: o && e > 1 ? (e) => {
|
|
1109
|
-
e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId),
|
|
1142
|
+
e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), v({
|
|
1110
1143
|
startX: e.clientX,
|
|
1111
1144
|
dx: 0
|
|
1112
1145
|
}));
|
|
1113
1146
|
} : void 0,
|
|
1114
|
-
onPointerMove:
|
|
1147
|
+
onPointerMove: _ ? (e) => v((t) => t && {
|
|
1115
1148
|
...t,
|
|
1116
1149
|
dx: e.clientX - t.startX
|
|
1117
1150
|
}) : void 0,
|
|
1118
|
-
onPointerUp:
|
|
1119
|
-
onPointerCancel:
|
|
1151
|
+
onPointerUp: x,
|
|
1152
|
+
onPointerCancel: x,
|
|
1120
1153
|
style: {
|
|
1121
1154
|
position: "relative",
|
|
1122
1155
|
overflow: "hidden",
|
|
1123
1156
|
width: "100%",
|
|
1124
1157
|
touchAction: "pan-y",
|
|
1125
|
-
userSelect:
|
|
1126
|
-
cursor:
|
|
1127
|
-
...
|
|
1158
|
+
userSelect: _ ? "none" : void 0,
|
|
1159
|
+
cursor: _ ? "grabbing" : void 0,
|
|
1160
|
+
...C(s)
|
|
1128
1161
|
},
|
|
1129
1162
|
children: [/* @__PURE__ */ u("div", {
|
|
1130
1163
|
style: {
|
|
1131
1164
|
display: "flex",
|
|
1132
1165
|
height: a,
|
|
1133
|
-
transform: `translateX(calc(${-
|
|
1134
|
-
transition:
|
|
1166
|
+
transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
|
|
1167
|
+
transition: _ ? "none" : "transform 450ms ease"
|
|
1135
1168
|
},
|
|
1136
1169
|
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
|
|
1137
1170
|
style: {
|
|
@@ -1147,20 +1180,20 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1147
1180
|
type: "button",
|
|
1148
1181
|
"aria-label": "Previous slide",
|
|
1149
1182
|
style: {
|
|
1150
|
-
...
|
|
1183
|
+
...Xe,
|
|
1151
1184
|
left: 12
|
|
1152
1185
|
},
|
|
1153
|
-
onClick: () =>
|
|
1186
|
+
onClick: () => b(y - 1),
|
|
1154
1187
|
children: "‹"
|
|
1155
1188
|
}),
|
|
1156
1189
|
/* @__PURE__ */ u("button", {
|
|
1157
1190
|
type: "button",
|
|
1158
1191
|
"aria-label": "Next slide",
|
|
1159
1192
|
style: {
|
|
1160
|
-
...
|
|
1193
|
+
...Xe,
|
|
1161
1194
|
right: 12
|
|
1162
1195
|
},
|
|
1163
|
-
onClick: () =>
|
|
1196
|
+
onClick: () => b(y + 1),
|
|
1164
1197
|
children: "›"
|
|
1165
1198
|
}),
|
|
1166
1199
|
/* @__PURE__ */ u("div", {
|
|
@@ -1176,7 +1209,7 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1176
1209
|
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
|
|
1177
1210
|
type: "button",
|
|
1178
1211
|
"aria-label": `Go to slide ${t + 1}`,
|
|
1179
|
-
onClick: () =>
|
|
1212
|
+
onClick: () => b(t),
|
|
1180
1213
|
style: {
|
|
1181
1214
|
width: 8,
|
|
1182
1215
|
height: 8,
|
|
@@ -1184,14 +1217,14 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1184
1217
|
border: 0,
|
|
1185
1218
|
padding: 0,
|
|
1186
1219
|
cursor: "pointer",
|
|
1187
|
-
background: t ===
|
|
1220
|
+
background: t === y ? "#ffffff" : "rgba(255, 255, 255, 0.45)"
|
|
1188
1221
|
}
|
|
1189
1222
|
}, t))
|
|
1190
1223
|
})
|
|
1191
1224
|
] })]
|
|
1192
1225
|
});
|
|
1193
1226
|
}
|
|
1194
|
-
var
|
|
1227
|
+
var et = (e, t) => ({
|
|
1195
1228
|
position: "absolute",
|
|
1196
1229
|
inset: 0,
|
|
1197
1230
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1199,18 +1232,18 @@ var Ze = (e, t) => ({
|
|
|
1199
1232
|
backgroundSize: "cover",
|
|
1200
1233
|
backgroundPosition: "center"
|
|
1201
1234
|
});
|
|
1202
|
-
function
|
|
1203
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1235
|
+
function tt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1236
|
+
return e.length ? /* @__PURE__ */ u($e, {
|
|
1204
1237
|
...r,
|
|
1205
1238
|
count: e.length,
|
|
1206
1239
|
renderSlide: (r) => {
|
|
1207
1240
|
let i = e[r];
|
|
1208
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1241
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: et(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1209
1242
|
style: {
|
|
1210
1243
|
position: "absolute",
|
|
1211
1244
|
color: "#fff",
|
|
1212
1245
|
textAlign: n,
|
|
1213
|
-
...
|
|
1246
|
+
...Ze[t] ?? Ze.bottom
|
|
1214
1247
|
},
|
|
1215
1248
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1216
1249
|
style: {
|
|
@@ -1230,13 +1263,13 @@ function Qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1230
1263
|
}
|
|
1231
1264
|
}) : null;
|
|
1232
1265
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1266
|
+
function nt({ slides: e = [], linked: t, ...n }) {
|
|
1267
|
+
return e.length ? /* @__PURE__ */ u($e, {
|
|
1235
1268
|
...n,
|
|
1236
1269
|
count: e.length,
|
|
1237
1270
|
renderSlide: (n) => {
|
|
1238
1271
|
let r = e[n];
|
|
1239
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1272
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: et(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1240
1273
|
style: {
|
|
1241
1274
|
position: "absolute",
|
|
1242
1275
|
inset: 0,
|
|
@@ -1248,16 +1281,16 @@ function $e({ slides: e = [], linked: t, ...n }) {
|
|
|
1248
1281
|
}
|
|
1249
1282
|
}) : null;
|
|
1250
1283
|
}
|
|
1251
|
-
function
|
|
1252
|
-
let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0),
|
|
1284
|
+
function rt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
|
|
1285
|
+
let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), h = f ? (e) => e.preventDefault() : void 0, [g, _] = c(null), v = a && !f && g !== null && p[g];
|
|
1253
1286
|
i(() => {
|
|
1254
|
-
if (!
|
|
1287
|
+
if (!v) return;
|
|
1255
1288
|
let e = (e) => {
|
|
1256
|
-
e.key === "Escape" &&
|
|
1289
|
+
e.key === "Escape" && _(null), e.key === "ArrowRight" && _((e) => (e + 1) % p.length), e.key === "ArrowLeft" && _((e) => (e - 1 + p.length) % p.length);
|
|
1257
1290
|
};
|
|
1258
1291
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1259
|
-
}, [
|
|
1260
|
-
let
|
|
1292
|
+
}, [v, p.length]);
|
|
1293
|
+
let y = (e) => {
|
|
1261
1294
|
if (typeof e.name == "string" && e.name.trim()) return e.name;
|
|
1262
1295
|
if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
|
|
1263
1296
|
try {
|
|
@@ -1273,7 +1306,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1273
1306
|
columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
|
|
1274
1307
|
columnGap: m,
|
|
1275
1308
|
width: "100%",
|
|
1276
|
-
...
|
|
1309
|
+
...C(o)
|
|
1277
1310
|
},
|
|
1278
1311
|
children: [
|
|
1279
1312
|
p.map((e, t) => {
|
|
@@ -1292,7 +1325,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1292
1325
|
display: "block",
|
|
1293
1326
|
borderRadius: "inherit"
|
|
1294
1327
|
}
|
|
1295
|
-
}), r &&
|
|
1328
|
+
}), r && y(e) && /* @__PURE__ */ u("span", {
|
|
1296
1329
|
style: {
|
|
1297
1330
|
position: "absolute",
|
|
1298
1331
|
insetInline: 0,
|
|
@@ -1306,11 +1339,11 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1306
1339
|
overflow: "hidden",
|
|
1307
1340
|
textOverflow: "ellipsis"
|
|
1308
1341
|
},
|
|
1309
|
-
children:
|
|
1342
|
+
children: y(e)
|
|
1310
1343
|
})]
|
|
1311
1344
|
}), i = e.href ? /* @__PURE__ */ u("a", {
|
|
1312
1345
|
href: e.href,
|
|
1313
|
-
onClick:
|
|
1346
|
+
onClick: h,
|
|
1314
1347
|
target: e.target || void 0,
|
|
1315
1348
|
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1316
1349
|
style: {
|
|
@@ -1321,8 +1354,8 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1321
1354
|
}) : a && !f ? /* @__PURE__ */ u("span", {
|
|
1322
1355
|
role: "button",
|
|
1323
1356
|
tabIndex: 0,
|
|
1324
|
-
onClick: () =>
|
|
1325
|
-
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") &&
|
|
1357
|
+
onClick: () => _(t),
|
|
1358
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && _(t),
|
|
1326
1359
|
style: {
|
|
1327
1360
|
display: "block",
|
|
1328
1361
|
borderRadius: "inherit",
|
|
@@ -1350,10 +1383,10 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1350
1383
|
},
|
|
1351
1384
|
children: "Pick images in Settings to fill the gallery"
|
|
1352
1385
|
}),
|
|
1353
|
-
|
|
1386
|
+
v && /* @__PURE__ */ d("div", {
|
|
1354
1387
|
role: "dialog",
|
|
1355
1388
|
"aria-modal": "true",
|
|
1356
|
-
onClick: () =>
|
|
1389
|
+
onClick: () => _(null),
|
|
1357
1390
|
style: {
|
|
1358
1391
|
position: "fixed",
|
|
1359
1392
|
inset: 0,
|
|
@@ -1367,8 +1400,8 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1367
1400
|
},
|
|
1368
1401
|
children: [
|
|
1369
1402
|
/* @__PURE__ */ u("img", {
|
|
1370
|
-
src: p[
|
|
1371
|
-
alt: p[
|
|
1403
|
+
src: p[g].src,
|
|
1404
|
+
alt: p[g].alt ?? "",
|
|
1372
1405
|
onClick: (e) => e.stopPropagation(),
|
|
1373
1406
|
style: {
|
|
1374
1407
|
maxWidth: "92vw",
|
|
@@ -1377,19 +1410,19 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1377
1410
|
boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
|
|
1378
1411
|
}
|
|
1379
1412
|
}),
|
|
1380
|
-
|
|
1413
|
+
y(p[g]) && /* @__PURE__ */ u("div", {
|
|
1381
1414
|
style: {
|
|
1382
1415
|
color: "#fff",
|
|
1383
1416
|
fontSize: 14,
|
|
1384
1417
|
marginTop: 12,
|
|
1385
1418
|
opacity: .85
|
|
1386
1419
|
},
|
|
1387
|
-
children:
|
|
1420
|
+
children: y(p[g])
|
|
1388
1421
|
}),
|
|
1389
1422
|
/* @__PURE__ */ u("button", {
|
|
1390
1423
|
type: "button",
|
|
1391
1424
|
"aria-label": "Close",
|
|
1392
|
-
onClick: () =>
|
|
1425
|
+
onClick: () => _(null),
|
|
1393
1426
|
style: {
|
|
1394
1427
|
position: "absolute",
|
|
1395
1428
|
top: 16,
|
|
@@ -1407,7 +1440,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1407
1440
|
type: "button",
|
|
1408
1441
|
"aria-label": "Previous",
|
|
1409
1442
|
onClick: (e) => {
|
|
1410
|
-
e.stopPropagation(),
|
|
1443
|
+
e.stopPropagation(), _((e) => (e - 1 + p.length) % p.length);
|
|
1411
1444
|
},
|
|
1412
1445
|
style: {
|
|
1413
1446
|
position: "absolute",
|
|
@@ -1426,7 +1459,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1426
1459
|
type: "button",
|
|
1427
1460
|
"aria-label": "Next",
|
|
1428
1461
|
onClick: (e) => {
|
|
1429
|
-
e.stopPropagation(),
|
|
1462
|
+
e.stopPropagation(), _((e) => (e + 1) % p.length);
|
|
1430
1463
|
},
|
|
1431
1464
|
style: {
|
|
1432
1465
|
position: "absolute",
|
|
@@ -1447,29 +1480,29 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1447
1480
|
]
|
|
1448
1481
|
});
|
|
1449
1482
|
}
|
|
1450
|
-
var
|
|
1483
|
+
var it = {
|
|
1451
1484
|
color: "inherit",
|
|
1452
1485
|
textDecoration: "none",
|
|
1453
1486
|
fontSize: 14,
|
|
1454
1487
|
opacity: .85
|
|
1455
|
-
},
|
|
1488
|
+
}, at = {
|
|
1456
1489
|
background: "var(--page-bg, #ffffff)",
|
|
1457
1490
|
color: "var(--page-text, #111827)",
|
|
1458
1491
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1459
1492
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1460
1493
|
zIndex: 60
|
|
1461
1494
|
};
|
|
1462
|
-
function
|
|
1463
|
-
let [
|
|
1495
|
+
function ot({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
|
|
1496
|
+
let [h, g] = c(null), [_, v] = c(!1), [y, b] = c(!1), [x, S] = c(null);
|
|
1464
1497
|
i(() => {
|
|
1465
|
-
if (!
|
|
1466
|
-
let e = new ResizeObserver(() =>
|
|
1467
|
-
return e.observe(
|
|
1468
|
-
}, [
|
|
1469
|
-
let w = p === "hamburger" || p === "auto" &&
|
|
1498
|
+
if (!h) return;
|
|
1499
|
+
let e = new ResizeObserver(() => v(h.offsetWidth < m));
|
|
1500
|
+
return e.observe(h), () => e.disconnect();
|
|
1501
|
+
}, [h, m]);
|
|
1502
|
+
let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ d("a", {
|
|
1470
1503
|
href: e.href || "#",
|
|
1471
1504
|
style: {
|
|
1472
|
-
...
|
|
1505
|
+
...it,
|
|
1473
1506
|
display: "block",
|
|
1474
1507
|
...t
|
|
1475
1508
|
},
|
|
@@ -1485,7 +1518,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1485
1518
|
}, e.key);
|
|
1486
1519
|
return /* @__PURE__ */ d("nav", {
|
|
1487
1520
|
ref: (e) => {
|
|
1488
|
-
|
|
1521
|
+
g(e), f && f(e);
|
|
1489
1522
|
},
|
|
1490
1523
|
style: {
|
|
1491
1524
|
display: "flex",
|
|
@@ -1495,7 +1528,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1495
1528
|
padding: "14px 24px",
|
|
1496
1529
|
width: "100%",
|
|
1497
1530
|
position: "relative",
|
|
1498
|
-
...
|
|
1531
|
+
...C(s)
|
|
1499
1532
|
},
|
|
1500
1533
|
children: [
|
|
1501
1534
|
(n || t) && (() => {
|
|
@@ -1534,8 +1567,8 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1534
1567
|
/* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
|
|
1535
1568
|
w ? /* @__PURE__ */ u("button", {
|
|
1536
1569
|
type: "button",
|
|
1537
|
-
"aria-label":
|
|
1538
|
-
onClick: () =>
|
|
1570
|
+
"aria-label": y ? "Close menu" : "Open menu",
|
|
1571
|
+
onClick: () => b(!y),
|
|
1539
1572
|
style: {
|
|
1540
1573
|
background: "transparent",
|
|
1541
1574
|
border: 0,
|
|
@@ -1545,7 +1578,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1545
1578
|
lineHeight: 1,
|
|
1546
1579
|
padding: 4
|
|
1547
1580
|
},
|
|
1548
|
-
children:
|
|
1581
|
+
children: y ? "✕" : "☰"
|
|
1549
1582
|
}) : /* @__PURE__ */ u("div", {
|
|
1550
1583
|
style: {
|
|
1551
1584
|
display: "flex",
|
|
@@ -1557,7 +1590,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1557
1590
|
let t = e.children ?? [];
|
|
1558
1591
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1559
1592
|
href: e.href || "#",
|
|
1560
|
-
style:
|
|
1593
|
+
style: it,
|
|
1561
1594
|
children: e.label
|
|
1562
1595
|
}, e.key);
|
|
1563
1596
|
let n = e.type === "mega";
|
|
@@ -1566,12 +1599,12 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1566
1599
|
position: n ? "static" : "relative",
|
|
1567
1600
|
display: "inline-flex"
|
|
1568
1601
|
},
|
|
1569
|
-
onMouseEnter: () =>
|
|
1570
|
-
onMouseLeave: () =>
|
|
1602
|
+
onMouseEnter: () => S(e.key),
|
|
1603
|
+
onMouseLeave: () => S(null),
|
|
1571
1604
|
children: [/* @__PURE__ */ d("a", {
|
|
1572
1605
|
href: e.href || "#",
|
|
1573
1606
|
style: {
|
|
1574
|
-
...
|
|
1607
|
+
...it,
|
|
1575
1608
|
cursor: "pointer"
|
|
1576
1609
|
},
|
|
1577
1610
|
children: [
|
|
@@ -1585,9 +1618,9 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1585
1618
|
children: "▼"
|
|
1586
1619
|
})
|
|
1587
1620
|
]
|
|
1588
|
-
}),
|
|
1621
|
+
}), x === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
1589
1622
|
style: {
|
|
1590
|
-
...
|
|
1623
|
+
...at,
|
|
1591
1624
|
position: "absolute",
|
|
1592
1625
|
left: 0,
|
|
1593
1626
|
right: 0,
|
|
@@ -1603,7 +1636,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1603
1636
|
}))
|
|
1604
1637
|
}) : /* @__PURE__ */ u("div", {
|
|
1605
1638
|
style: {
|
|
1606
|
-
...
|
|
1639
|
+
...at,
|
|
1607
1640
|
position: "absolute",
|
|
1608
1641
|
top: "100%",
|
|
1609
1642
|
left: 0,
|
|
@@ -1621,7 +1654,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1621
1654
|
}, e.key);
|
|
1622
1655
|
})
|
|
1623
1656
|
}),
|
|
1624
|
-
w &&
|
|
1657
|
+
w && y && /* @__PURE__ */ u("div", {
|
|
1625
1658
|
style: {
|
|
1626
1659
|
flexBasis: "100%",
|
|
1627
1660
|
width: "100%",
|
|
@@ -1632,7 +1665,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1632
1665
|
children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1633
1666
|
href: t.href || "#",
|
|
1634
1667
|
style: {
|
|
1635
|
-
...
|
|
1668
|
+
...it,
|
|
1636
1669
|
padding: "10px 4px",
|
|
1637
1670
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1638
1671
|
opacity: 1
|
|
@@ -1643,13 +1676,13 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1643
1676
|
]
|
|
1644
1677
|
});
|
|
1645
1678
|
}
|
|
1646
|
-
function
|
|
1679
|
+
function st({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1647
1680
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1648
1681
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
1649
1682
|
ref: r,
|
|
1650
1683
|
style: {
|
|
1651
1684
|
width: "100%",
|
|
1652
|
-
...
|
|
1685
|
+
...C(n)
|
|
1653
1686
|
},
|
|
1654
1687
|
children: [/* @__PURE__ */ u("div", {
|
|
1655
1688
|
style: {
|
|
@@ -1683,7 +1716,7 @@ function it({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1683
1716
|
}, e.key))]
|
|
1684
1717
|
}) : null;
|
|
1685
1718
|
}
|
|
1686
|
-
function
|
|
1719
|
+
function ct({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1687
1720
|
let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
1688
1721
|
if (!e.length) return null;
|
|
1689
1722
|
let s = (e) => o((t) => {
|
|
@@ -1694,7 +1727,7 @@ function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1694
1727
|
ref: i,
|
|
1695
1728
|
style: {
|
|
1696
1729
|
width: "100%",
|
|
1697
|
-
...
|
|
1730
|
+
...C(r)
|
|
1698
1731
|
},
|
|
1699
1732
|
children: e.map((n, r) => {
|
|
1700
1733
|
let i = a.has(n.key);
|
|
@@ -1740,15 +1773,15 @@ function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1740
1773
|
})
|
|
1741
1774
|
});
|
|
1742
1775
|
}
|
|
1743
|
-
var
|
|
1776
|
+
var lt = {
|
|
1744
1777
|
display: "flex",
|
|
1745
1778
|
flexDirection: "column",
|
|
1746
1779
|
gap: "12px"
|
|
1747
|
-
},
|
|
1780
|
+
}, J = {
|
|
1748
1781
|
fontSize: "14px",
|
|
1749
1782
|
fontWeight: 500,
|
|
1750
1783
|
color: "var(--page-text, #111827)"
|
|
1751
|
-
},
|
|
1784
|
+
}, Y = {
|
|
1752
1785
|
padding: "10px 12px",
|
|
1753
1786
|
border: "1px solid #d1d5db",
|
|
1754
1787
|
borderRadius: "6px",
|
|
@@ -1758,18 +1791,18 @@ var ot = {
|
|
|
1758
1791
|
boxSizing: "border-box",
|
|
1759
1792
|
backgroundColor: "#ffffff",
|
|
1760
1793
|
color: "#111827"
|
|
1761
|
-
},
|
|
1794
|
+
}, ut = {
|
|
1762
1795
|
display: "flex",
|
|
1763
1796
|
alignItems: "center",
|
|
1764
1797
|
gap: "8px",
|
|
1765
1798
|
fontSize: "14px",
|
|
1766
1799
|
color: "var(--page-text, #111827)"
|
|
1767
|
-
},
|
|
1800
|
+
}, X = (e) => e ? {
|
|
1768
1801
|
readOnly: !0,
|
|
1769
1802
|
tabIndex: -1,
|
|
1770
1803
|
onMouseDown: (e) => e.preventDefault()
|
|
1771
1804
|
} : {};
|
|
1772
|
-
function
|
|
1805
|
+
function dt(e, t) {
|
|
1773
1806
|
if (!e) return !0;
|
|
1774
1807
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1775
1808
|
switch (e.op) {
|
|
@@ -1783,11 +1816,11 @@ function ct(e, t) {
|
|
|
1783
1816
|
default: return !1;
|
|
1784
1817
|
}
|
|
1785
1818
|
}
|
|
1786
|
-
var
|
|
1819
|
+
var ft = {
|
|
1787
1820
|
display: "flex",
|
|
1788
1821
|
flexDirection: "column",
|
|
1789
1822
|
gap: 6
|
|
1790
|
-
},
|
|
1823
|
+
}, pt = {
|
|
1791
1824
|
font: "inherit",
|
|
1792
1825
|
fontSize: 15,
|
|
1793
1826
|
padding: "10px 12px",
|
|
@@ -1798,16 +1831,16 @@ var lt = {
|
|
|
1798
1831
|
width: "100%",
|
|
1799
1832
|
boxSizing: "border-box"
|
|
1800
1833
|
};
|
|
1801
|
-
function
|
|
1834
|
+
function mt(e, t) {
|
|
1802
1835
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1803
1836
|
if (!e?.parentField) return n;
|
|
1804
1837
|
let r = t?.[e.parentField];
|
|
1805
1838
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1806
1839
|
}
|
|
1807
|
-
function
|
|
1840
|
+
function ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1808
1841
|
let a = /* @__PURE__ */ d("span", {
|
|
1809
1842
|
style: {
|
|
1810
|
-
...
|
|
1843
|
+
...J,
|
|
1811
1844
|
fontSize: 14
|
|
1812
1845
|
},
|
|
1813
1846
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1816,7 +1849,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1816
1849
|
required: e.required || void 0,
|
|
1817
1850
|
placeholder: e.placeholder || void 0,
|
|
1818
1851
|
disabled: r || void 0,
|
|
1819
|
-
style:
|
|
1852
|
+
style: pt,
|
|
1820
1853
|
value: t ?? "",
|
|
1821
1854
|
onChange: (t) => n(e.name, t.target.value)
|
|
1822
1855
|
};
|
|
@@ -1845,7 +1878,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1845
1878
|
borderRadius: 8,
|
|
1846
1879
|
display: "block"
|
|
1847
1880
|
}
|
|
1848
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
1881
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ge, {
|
|
1849
1882
|
url: e.src,
|
|
1850
1883
|
style: { width: "100%" }
|
|
1851
1884
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -1857,14 +1890,14 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1857
1890
|
display: "block"
|
|
1858
1891
|
}
|
|
1859
1892
|
}) : null : /* @__PURE__ */ d("label", {
|
|
1860
|
-
style:
|
|
1893
|
+
style: ft,
|
|
1861
1894
|
children: [
|
|
1862
1895
|
a,
|
|
1863
1896
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
1864
1897
|
...o,
|
|
1865
1898
|
rows: 4,
|
|
1866
1899
|
style: {
|
|
1867
|
-
...
|
|
1900
|
+
...pt,
|
|
1868
1901
|
resize: "vertical"
|
|
1869
1902
|
}
|
|
1870
1903
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -1873,7 +1906,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1873
1906
|
children: [/* @__PURE__ */ u("option", {
|
|
1874
1907
|
value: "",
|
|
1875
1908
|
children: e.placeholder || "—"
|
|
1876
|
-
}),
|
|
1909
|
+
}), mt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
1877
1910
|
value: typeof e == "string" ? e : e.value,
|
|
1878
1911
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1879
1912
|
}, t))]
|
|
@@ -1920,19 +1953,19 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1920
1953
|
]
|
|
1921
1954
|
});
|
|
1922
1955
|
}
|
|
1923
|
-
function
|
|
1924
|
-
let { tenant:
|
|
1956
|
+
function gt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
1957
|
+
let { tenant: y, apiUrl: b } = r(H), [x, S] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = h ? v || "form" : x;
|
|
1925
1958
|
i(() => {
|
|
1926
1959
|
if (!f || !s) return;
|
|
1927
1960
|
let e = !0;
|
|
1928
|
-
return fetch(`${
|
|
1961
|
+
return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
|
|
1929
1962
|
e = !1;
|
|
1930
1963
|
};
|
|
1931
1964
|
}, [
|
|
1932
1965
|
f,
|
|
1933
1966
|
s,
|
|
1934
|
-
|
|
1935
|
-
|
|
1967
|
+
y,
|
|
1968
|
+
b
|
|
1936
1969
|
]);
|
|
1937
1970
|
let j = [{
|
|
1938
1971
|
section: null,
|
|
@@ -1942,13 +1975,13 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1942
1975
|
section: e,
|
|
1943
1976
|
fields: []
|
|
1944
1977
|
}) : j[j.length - 1].fields.push(e);
|
|
1945
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1978
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || dt(e.section.condition, E)).map((e) => ({
|
|
1946
1979
|
...e,
|
|
1947
|
-
fields: e.fields.filter((e) =>
|
|
1948
|
-
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields),
|
|
1980
|
+
fields: e.fields.filter((e) => dt(e.condition, E))
|
|
1981
|
+
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
1949
1982
|
let t = E[e.name];
|
|
1950
1983
|
return e.required && (t == null || t === "" || t === !1);
|
|
1951
|
-
}),
|
|
1984
|
+
}), R = F >= N.length - 1, z = (e, t) => D((n) => {
|
|
1952
1985
|
let r = {
|
|
1953
1986
|
...n,
|
|
1954
1987
|
[e]: t
|
|
@@ -1958,7 +1991,7 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1958
1991
|
});
|
|
1959
1992
|
return /* @__PURE__ */ d("div", {
|
|
1960
1993
|
ref: m,
|
|
1961
|
-
style:
|
|
1994
|
+
style: C(e),
|
|
1962
1995
|
children: [
|
|
1963
1996
|
/* @__PURE__ */ u("form", {
|
|
1964
1997
|
action: t || void 0,
|
|
@@ -1966,28 +1999,28 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1966
1999
|
name: a || void 0,
|
|
1967
2000
|
encType: o || void 0,
|
|
1968
2001
|
onSubmit: async (e) => {
|
|
1969
|
-
if (e.preventDefault(), !
|
|
2002
|
+
if (e.preventDefault(), !h) {
|
|
1970
2003
|
if (s) {
|
|
1971
2004
|
let t = {};
|
|
1972
2005
|
if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
|
|
1973
2006
|
else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
1974
2007
|
try {
|
|
1975
|
-
let e = await fetch(`${
|
|
2008
|
+
let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
|
|
1976
2009
|
method: "post",
|
|
1977
2010
|
headers: {
|
|
1978
2011
|
"content-type": "application/json",
|
|
1979
|
-
...
|
|
2012
|
+
...y ? { "x-tenant": y } : {}
|
|
1980
2013
|
},
|
|
1981
2014
|
body: JSON.stringify(t)
|
|
1982
2015
|
}), n = await e.json().catch(() => null);
|
|
1983
|
-
|
|
2016
|
+
S(e.ok && n?.success !== !1 ? "success" : "error");
|
|
1984
2017
|
} catch {
|
|
1985
|
-
|
|
2018
|
+
S("error");
|
|
1986
2019
|
}
|
|
1987
2020
|
return;
|
|
1988
2021
|
}
|
|
1989
2022
|
if (!t) {
|
|
1990
|
-
|
|
2023
|
+
S("success");
|
|
1991
2024
|
return;
|
|
1992
2025
|
}
|
|
1993
2026
|
try {
|
|
@@ -1995,18 +2028,18 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1995
2028
|
method: n || "post",
|
|
1996
2029
|
body: new FormData(e.currentTarget)
|
|
1997
2030
|
});
|
|
1998
|
-
|
|
2031
|
+
S(r.ok ? "success" : "error");
|
|
1999
2032
|
} catch {
|
|
2000
|
-
|
|
2033
|
+
S("error");
|
|
2001
2034
|
}
|
|
2002
2035
|
}
|
|
2003
2036
|
},
|
|
2004
2037
|
style: {
|
|
2005
|
-
...
|
|
2038
|
+
...lt,
|
|
2006
2039
|
display: A === "success" ? "none" : "flex"
|
|
2007
2040
|
},
|
|
2008
2041
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2009
|
-
P && /* @__PURE__ */ u(
|
|
2042
|
+
P && /* @__PURE__ */ u(Rt, {
|
|
2010
2043
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2011
2044
|
active: F + 1,
|
|
2012
2045
|
style: { marginBottom: 8 }
|
|
@@ -2019,12 +2052,12 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2019
2052
|
},
|
|
2020
2053
|
children: N[F].section.help
|
|
2021
2054
|
}),
|
|
2022
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2055
|
+
I.map((e) => /* @__PURE__ */ u(ht, {
|
|
2023
2056
|
field: e,
|
|
2024
2057
|
value: E[e.name],
|
|
2025
2058
|
values: E,
|
|
2026
|
-
onChange:
|
|
2027
|
-
inert:
|
|
2059
|
+
onChange: z,
|
|
2060
|
+
inert: h
|
|
2028
2061
|
}, e.name)),
|
|
2029
2062
|
/* @__PURE__ */ d("div", {
|
|
2030
2063
|
style: {
|
|
@@ -2035,10 +2068,10 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2035
2068
|
},
|
|
2036
2069
|
children: [P && F > 0 && /* @__PURE__ */ u("button", {
|
|
2037
2070
|
type: "button",
|
|
2038
|
-
disabled:
|
|
2071
|
+
disabled: h || void 0,
|
|
2039
2072
|
onClick: () => k(F - 1),
|
|
2040
2073
|
style: {
|
|
2041
|
-
...
|
|
2074
|
+
...K,
|
|
2042
2075
|
background: "transparent",
|
|
2043
2076
|
color: "inherit",
|
|
2044
2077
|
border: 0,
|
|
@@ -2046,26 +2079,26 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2046
2079
|
cursor: "pointer"
|
|
2047
2080
|
},
|
|
2048
2081
|
children: "Back"
|
|
2049
|
-
}), P && !
|
|
2082
|
+
}), P && !R ? /* @__PURE__ */ u("button", {
|
|
2050
2083
|
type: "button",
|
|
2051
|
-
disabled:
|
|
2084
|
+
disabled: h || L.length > 0,
|
|
2052
2085
|
onClick: () => k(F + 1),
|
|
2053
2086
|
style: {
|
|
2054
|
-
...
|
|
2087
|
+
...K,
|
|
2055
2088
|
border: 0,
|
|
2056
2089
|
padding: "10px 22px",
|
|
2057
2090
|
borderRadius: 8,
|
|
2058
2091
|
fontSize: 15,
|
|
2059
2092
|
fontWeight: 600,
|
|
2060
2093
|
cursor: "pointer",
|
|
2061
|
-
opacity:
|
|
2094
|
+
opacity: L.length ? .5 : 1
|
|
2062
2095
|
},
|
|
2063
2096
|
children: "Next"
|
|
2064
2097
|
}) : /* @__PURE__ */ u("button", {
|
|
2065
2098
|
type: "submit",
|
|
2066
|
-
disabled:
|
|
2099
|
+
disabled: h || void 0,
|
|
2067
2100
|
style: {
|
|
2068
|
-
...
|
|
2101
|
+
...K,
|
|
2069
2102
|
border: 0,
|
|
2070
2103
|
padding: "10px 22px",
|
|
2071
2104
|
borderRadius: 8,
|
|
@@ -2076,26 +2109,26 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2076
2109
|
children: p || "Submit"
|
|
2077
2110
|
})]
|
|
2078
2111
|
})
|
|
2079
|
-
] }) :
|
|
2112
|
+
] }) : g
|
|
2080
2113
|
}),
|
|
2081
2114
|
/* @__PURE__ */ u("div", {
|
|
2082
2115
|
style: { display: A === "success" ? "block" : "none" },
|
|
2083
|
-
children:
|
|
2116
|
+
children: _?.success ?? null
|
|
2084
2117
|
}),
|
|
2085
2118
|
/* @__PURE__ */ u("div", {
|
|
2086
2119
|
style: {
|
|
2087
2120
|
display: A === "error" ? "block" : "none",
|
|
2088
2121
|
marginTop: 12
|
|
2089
2122
|
},
|
|
2090
|
-
children:
|
|
2123
|
+
children: _?.error ?? null
|
|
2091
2124
|
})
|
|
2092
2125
|
]
|
|
2093
2126
|
});
|
|
2094
2127
|
}
|
|
2095
|
-
var
|
|
2128
|
+
var Z = null, _t = null, vt = (e) => {
|
|
2096
2129
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2097
|
-
if (
|
|
2098
|
-
if (
|
|
2130
|
+
if (Z && _t === t) return Z;
|
|
2131
|
+
if (Z && typeof window < "u") {
|
|
2099
2132
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2100
2133
|
delete window[e];
|
|
2101
2134
|
} catch {
|
|
@@ -2103,27 +2136,27 @@ var X = null, mt = null, ht = (e) => {
|
|
|
2103
2136
|
}
|
|
2104
2137
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2105
2138
|
}
|
|
2106
|
-
return
|
|
2139
|
+
return _t = t, Z = new Promise((e) => {
|
|
2107
2140
|
if (typeof window > "u") return;
|
|
2108
2141
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2109
2142
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2110
2143
|
let n = document.createElement("script");
|
|
2111
2144
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2112
|
-
}),
|
|
2145
|
+
}), Z;
|
|
2113
2146
|
};
|
|
2114
|
-
function
|
|
2115
|
-
let p = r(
|
|
2116
|
-
if (
|
|
2117
|
-
if (l || !
|
|
2147
|
+
function yt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2148
|
+
let p = r(H), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2149
|
+
if (_.current = f, i(() => {
|
|
2150
|
+
if (l || !h || !g.current) return;
|
|
2118
2151
|
let e = !0, r = (t) => {
|
|
2119
|
-
e && typeof
|
|
2152
|
+
e && typeof _.current == "function" && _.current(t);
|
|
2120
2153
|
};
|
|
2121
|
-
return
|
|
2122
|
-
if (!(!e || !
|
|
2123
|
-
|
|
2154
|
+
return vt(a).then((i) => {
|
|
2155
|
+
if (!(!e || !g.current || !i?.render)) {
|
|
2156
|
+
g.current.innerHTML = "", r("");
|
|
2124
2157
|
try {
|
|
2125
|
-
i.render(
|
|
2126
|
-
sitekey:
|
|
2158
|
+
i.render(g.current, {
|
|
2159
|
+
sitekey: h,
|
|
2127
2160
|
theme: t === "dark" ? "dark" : "light",
|
|
2128
2161
|
size: n === "compact" ? "compact" : "normal",
|
|
2129
2162
|
callback: (e) => r(typeof e == "string" ? e : ""),
|
|
@@ -2137,7 +2170,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2137
2170
|
};
|
|
2138
2171
|
}, [
|
|
2139
2172
|
l,
|
|
2140
|
-
|
|
2173
|
+
h,
|
|
2141
2174
|
t,
|
|
2142
2175
|
n,
|
|
2143
2176
|
a
|
|
@@ -2145,7 +2178,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2145
2178
|
let e = t === "dark";
|
|
2146
2179
|
return /* @__PURE__ */ d("div", {
|
|
2147
2180
|
ref: c,
|
|
2148
|
-
style:
|
|
2181
|
+
style: C(o),
|
|
2149
2182
|
children: [/* @__PURE__ */ d("div", {
|
|
2150
2183
|
style: {
|
|
2151
2184
|
width: n === "compact" ? 164 : 302,
|
|
@@ -2184,7 +2217,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2184
2217
|
children: "reCAPTCHA"
|
|
2185
2218
|
})
|
|
2186
2219
|
]
|
|
2187
|
-
}), !
|
|
2220
|
+
}), !h && /* @__PURE__ */ u("div", {
|
|
2188
2221
|
style: {
|
|
2189
2222
|
marginTop: 6,
|
|
2190
2223
|
fontSize: 11,
|
|
@@ -2194,23 +2227,23 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2194
2227
|
})]
|
|
2195
2228
|
});
|
|
2196
2229
|
}
|
|
2197
|
-
return
|
|
2230
|
+
return h ? /* @__PURE__ */ u("div", {
|
|
2198
2231
|
ref: c,
|
|
2199
|
-
style:
|
|
2200
|
-
children: /* @__PURE__ */ u("div", { ref:
|
|
2232
|
+
style: C(o),
|
|
2233
|
+
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2201
2234
|
}) : null;
|
|
2202
2235
|
}
|
|
2203
|
-
function
|
|
2236
|
+
function bt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2204
2237
|
return /* @__PURE__ */ u("label", {
|
|
2205
2238
|
ref: r,
|
|
2206
2239
|
style: {
|
|
2207
|
-
...
|
|
2208
|
-
...
|
|
2240
|
+
...J,
|
|
2241
|
+
...C(n)
|
|
2209
2242
|
},
|
|
2210
|
-
children:
|
|
2243
|
+
children: q(t, e, i)
|
|
2211
2244
|
});
|
|
2212
2245
|
}
|
|
2213
|
-
function
|
|
2246
|
+
function xt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2214
2247
|
return /* @__PURE__ */ u("input", {
|
|
2215
2248
|
ref: a,
|
|
2216
2249
|
type: e,
|
|
@@ -2218,13 +2251,13 @@ function vt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2218
2251
|
placeholder: n,
|
|
2219
2252
|
required: !o && !!r,
|
|
2220
2253
|
style: {
|
|
2221
|
-
...
|
|
2222
|
-
...
|
|
2254
|
+
...Y,
|
|
2255
|
+
...C(i)
|
|
2223
2256
|
},
|
|
2224
|
-
...
|
|
2257
|
+
...X(o)
|
|
2225
2258
|
});
|
|
2226
2259
|
}
|
|
2227
|
-
function
|
|
2260
|
+
function St({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2228
2261
|
return /* @__PURE__ */ u("textarea", {
|
|
2229
2262
|
ref: a,
|
|
2230
2263
|
name: e || void 0,
|
|
@@ -2232,19 +2265,19 @@ function yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2232
2265
|
rows: n,
|
|
2233
2266
|
required: !o && !!r,
|
|
2234
2267
|
style: {
|
|
2235
|
-
...
|
|
2268
|
+
...Y,
|
|
2236
2269
|
resize: "vertical",
|
|
2237
|
-
...
|
|
2270
|
+
...C(i)
|
|
2238
2271
|
},
|
|
2239
|
-
...
|
|
2272
|
+
...X(o)
|
|
2240
2273
|
});
|
|
2241
2274
|
}
|
|
2242
|
-
function
|
|
2275
|
+
function Ct({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2243
2276
|
return /* @__PURE__ */ d("label", {
|
|
2244
2277
|
ref: o,
|
|
2245
2278
|
style: {
|
|
2246
|
-
...
|
|
2247
|
-
...
|
|
2279
|
+
...ut,
|
|
2280
|
+
...C(a)
|
|
2248
2281
|
},
|
|
2249
2282
|
children: [/* @__PURE__ */ u("input", {
|
|
2250
2283
|
type: e,
|
|
@@ -2260,7 +2293,7 @@ function bt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2260
2293
|
}), t]
|
|
2261
2294
|
});
|
|
2262
2295
|
}
|
|
2263
|
-
function
|
|
2296
|
+
function wt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2264
2297
|
return /* @__PURE__ */ d("select", {
|
|
2265
2298
|
ref: a,
|
|
2266
2299
|
name: e || void 0,
|
|
@@ -2269,9 +2302,9 @@ function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2269
2302
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2270
2303
|
tabIndex: o ? -1 : void 0,
|
|
2271
2304
|
style: {
|
|
2272
|
-
...
|
|
2305
|
+
...Y,
|
|
2273
2306
|
appearance: "auto",
|
|
2274
|
-
...
|
|
2307
|
+
...C(i)
|
|
2275
2308
|
},
|
|
2276
2309
|
children: [t !== "" && /* @__PURE__ */ u("option", {
|
|
2277
2310
|
value: "",
|
|
@@ -2283,19 +2316,19 @@ function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2283
2316
|
}, t))]
|
|
2284
2317
|
});
|
|
2285
2318
|
}
|
|
2286
|
-
function
|
|
2319
|
+
function Tt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2287
2320
|
let [s, l] = c(null);
|
|
2288
2321
|
return /* @__PURE__ */ d("label", {
|
|
2289
2322
|
ref: a,
|
|
2290
2323
|
style: {
|
|
2291
|
-
...
|
|
2324
|
+
...Y,
|
|
2292
2325
|
display: "flex",
|
|
2293
2326
|
alignItems: "center",
|
|
2294
2327
|
gap: "8px",
|
|
2295
2328
|
cursor: o ? "default" : "pointer",
|
|
2296
2329
|
borderStyle: "dashed",
|
|
2297
2330
|
color: s ? "#111827" : "#6b7280",
|
|
2298
|
-
...
|
|
2331
|
+
...C(i)
|
|
2299
2332
|
},
|
|
2300
2333
|
children: [
|
|
2301
2334
|
/* @__PURE__ */ u("input", {
|
|
@@ -2315,12 +2348,12 @@ function St({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2315
2348
|
]
|
|
2316
2349
|
});
|
|
2317
2350
|
}
|
|
2318
|
-
function
|
|
2351
|
+
function Et({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2319
2352
|
return /* @__PURE__ */ u("button", {
|
|
2320
2353
|
ref: n,
|
|
2321
2354
|
type: r ? "button" : "submit",
|
|
2322
2355
|
style: {
|
|
2323
|
-
...
|
|
2356
|
+
...K,
|
|
2324
2357
|
border: 0,
|
|
2325
2358
|
cursor: "pointer",
|
|
2326
2359
|
alignSelf: "flex-start",
|
|
@@ -2330,12 +2363,12 @@ function Ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2330
2363
|
fontWeight: 600,
|
|
2331
2364
|
lineHeight: 1.4,
|
|
2332
2365
|
fontFamily: "inherit",
|
|
2333
|
-
...
|
|
2366
|
+
...C(t)
|
|
2334
2367
|
},
|
|
2335
2368
|
children: e
|
|
2336
2369
|
});
|
|
2337
2370
|
}
|
|
2338
|
-
function
|
|
2371
|
+
function Dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2339
2372
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2340
2373
|
return /* @__PURE__ */ u("div", {
|
|
2341
2374
|
ref: r,
|
|
@@ -2344,7 +2377,7 @@ function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2344
2377
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
2345
2378
|
gap: 16,
|
|
2346
2379
|
width: "100%",
|
|
2347
|
-
...
|
|
2380
|
+
...C(n)
|
|
2348
2381
|
},
|
|
2349
2382
|
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
|
|
2350
2383
|
style: { minWidth: 0 },
|
|
@@ -2352,63 +2385,71 @@ function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2352
2385
|
}, t))
|
|
2353
2386
|
});
|
|
2354
2387
|
}
|
|
2355
|
-
function
|
|
2356
|
-
let { tenant:
|
|
2388
|
+
function Ot({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2389
|
+
let { tenant: v, apiUrl: y, locale: b } = r(H), x = r(me), S = r(U), [, w] = c(0);
|
|
2390
|
+
i(() => {
|
|
2391
|
+
if (typeof window > "u") return;
|
|
2392
|
+
let e = () => w((e) => e + 1);
|
|
2393
|
+
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
2394
|
+
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2395
|
+
};
|
|
2396
|
+
}, []);
|
|
2397
|
+
let T = pe(h), E = JSON.stringify(T), D = E !== "{}" && !e?.startsWith?.("api:"), O = D ? null : S?.[e], k = m ? de(S) : 1, [A, j] = c(null);
|
|
2357
2398
|
if (i(() => {
|
|
2358
|
-
if (!e ||
|
|
2399
|
+
if (!e || O) return;
|
|
2359
2400
|
let n = !0, r = new URLSearchParams();
|
|
2360
|
-
if (
|
|
2401
|
+
if (b && r.set("locale", b), D && r.set("data_filter", E), m && !e.startsWith("api:")) {
|
|
2361
2402
|
let e = Math.max(1, Number(t) || 6);
|
|
2362
|
-
r.set("offset", String((
|
|
2403
|
+
r.set("offset", String((k - 1) * e)), r.set("limit", String(e));
|
|
2363
2404
|
}
|
|
2364
|
-
let i = r.toString(), a = e.startsWith("api:") ? `${
|
|
2365
|
-
return fetch(a, { headers:
|
|
2405
|
+
let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2406
|
+
return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
|
|
2366
2407
|
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2367
|
-
return n &&
|
|
2368
|
-
}).catch(() => n &&
|
|
2408
|
+
return n && j(t.filter((e) => e && typeof e == "object"));
|
|
2409
|
+
}).catch(() => n && j([])), () => {
|
|
2369
2410
|
n = !1;
|
|
2370
2411
|
};
|
|
2371
2412
|
}, [
|
|
2372
2413
|
e,
|
|
2414
|
+
v,
|
|
2373
2415
|
y,
|
|
2374
2416
|
b,
|
|
2375
|
-
x,
|
|
2376
|
-
D,
|
|
2377
|
-
m,
|
|
2378
2417
|
O,
|
|
2418
|
+
m,
|
|
2419
|
+
k,
|
|
2379
2420
|
t,
|
|
2380
|
-
|
|
2381
|
-
|
|
2421
|
+
D,
|
|
2422
|
+
E
|
|
2382
2423
|
]), !e) return null;
|
|
2383
|
-
let
|
|
2424
|
+
let M = Math.max(1, Number(t) || 6), N = m ? O || e.startsWith("api:") ? (O ?? A ?? []).slice((k - 1) * M, k * M) : (A ?? []).slice(0, M) : (O ?? A ?? []).slice(0, M), P = Math.min(Math.max(Number(a) || 3, 1), 6), F = n === "list" ? {
|
|
2384
2425
|
display: "flex",
|
|
2385
2426
|
flexDirection: "column",
|
|
2386
2427
|
gap: 20
|
|
2387
2428
|
} : {
|
|
2388
2429
|
display: "grid",
|
|
2389
|
-
gridTemplateColumns: `repeat(${
|
|
2430
|
+
gridTemplateColumns: `repeat(${P}, minmax(0, 1fr))`,
|
|
2390
2431
|
gap: 24
|
|
2391
2432
|
};
|
|
2392
|
-
return f && p &&
|
|
2393
|
-
ref:
|
|
2433
|
+
return f && p && x?.render ? /* @__PURE__ */ u("div", {
|
|
2434
|
+
ref: _,
|
|
2394
2435
|
style: {
|
|
2395
2436
|
width: "100%",
|
|
2396
|
-
...
|
|
2397
|
-
...
|
|
2437
|
+
...F,
|
|
2438
|
+
...C(g)
|
|
2398
2439
|
},
|
|
2399
|
-
children:
|
|
2440
|
+
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
2400
2441
|
style: { minWidth: 0 },
|
|
2401
|
-
children:
|
|
2442
|
+
children: x.render(p, (t) => _e(t, e))
|
|
2402
2443
|
}, e.id ?? e?.data?.slug))
|
|
2403
2444
|
}) : /* @__PURE__ */ u("div", {
|
|
2404
|
-
ref:
|
|
2445
|
+
ref: _,
|
|
2405
2446
|
style: {
|
|
2406
2447
|
width: "100%",
|
|
2407
|
-
...
|
|
2408
|
-
...
|
|
2448
|
+
...F,
|
|
2449
|
+
...C(g)
|
|
2409
2450
|
},
|
|
2410
|
-
children:
|
|
2411
|
-
let t = o ?
|
|
2451
|
+
children: N.map((e) => {
|
|
2452
|
+
let t = o ? W(e?.data, o) : null, r = s ? G(W(e?.data, s)) : null, i = l ? W(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : G(i), f = n === "list";
|
|
2412
2453
|
return /* @__PURE__ */ d("div", {
|
|
2413
2454
|
style: {
|
|
2414
2455
|
display: "flex",
|
|
@@ -2455,7 +2496,7 @@ function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2455
2496
|
lineHeight: 1.55,
|
|
2456
2497
|
opacity: .85
|
|
2457
2498
|
},
|
|
2458
|
-
children:
|
|
2499
|
+
children: Ne(a)
|
|
2459
2500
|
})
|
|
2460
2501
|
]
|
|
2461
2502
|
})]
|
|
@@ -2463,16 +2504,20 @@ function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2463
2504
|
})
|
|
2464
2505
|
});
|
|
2465
2506
|
}
|
|
2466
|
-
function
|
|
2467
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2507
|
+
function kt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
2508
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : fe(), s = {
|
|
2509
|
+
height: 34,
|
|
2510
|
+
padding: "0 12px",
|
|
2511
|
+
borderRadius: 8,
|
|
2512
|
+
border: "1px solid var(--page-border, rgba(100, 116, 139, 0.4))",
|
|
2513
|
+
background: "var(--page-bg, #ffffff)",
|
|
2473
2514
|
color: "var(--page-text, #111827)",
|
|
2515
|
+
fontSize: 13,
|
|
2516
|
+
fontFamily: "inherit",
|
|
2517
|
+
outline: "none",
|
|
2474
2518
|
minWidth: 140,
|
|
2475
|
-
flex: "
|
|
2519
|
+
flex: "0 1 auto",
|
|
2520
|
+
boxSizing: "border-box"
|
|
2476
2521
|
}, c = (e) => {
|
|
2477
2522
|
let t = e && typeof e == "object" ? e.value : e, n = e && typeof e == "object" ? e.label ?? e.value : e;
|
|
2478
2523
|
return {
|
|
@@ -2483,75 +2528,90 @@ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2483
2528
|
return /* @__PURE__ */ d("form", {
|
|
2484
2529
|
ref: r,
|
|
2485
2530
|
method: "get",
|
|
2486
|
-
onSubmit:
|
|
2531
|
+
onSubmit: (e) => {
|
|
2532
|
+
if (i) {
|
|
2533
|
+
e.preventDefault();
|
|
2534
|
+
return;
|
|
2535
|
+
}
|
|
2536
|
+
if (typeof window > "u" || !window.history?.pushState) return;
|
|
2537
|
+
e.preventDefault();
|
|
2538
|
+
let t = new URLSearchParams(window.location.search);
|
|
2539
|
+
for (let e of [...t.keys()]) (e.startsWith("f_") || e === "page") && t.delete(e);
|
|
2540
|
+
for (let [n, r] of new FormData(e.currentTarget).entries()) n.startsWith("f_") && typeof r == "string" && r.trim() !== "" && t.set(n, r);
|
|
2541
|
+
let n = t.toString();
|
|
2542
|
+
window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange"));
|
|
2543
|
+
},
|
|
2487
2544
|
style: {
|
|
2488
2545
|
display: "flex",
|
|
2489
2546
|
flexWrap: "wrap",
|
|
2490
|
-
alignItems: "
|
|
2491
|
-
gap:
|
|
2547
|
+
alignItems: "center",
|
|
2548
|
+
gap: 8,
|
|
2492
2549
|
width: "100%",
|
|
2493
|
-
...
|
|
2550
|
+
...C(n)
|
|
2494
2551
|
},
|
|
2495
|
-
children: [a.map((e) => /* @__PURE__ */ d("
|
|
2552
|
+
children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
2553
|
+
name: `f_${e.name}`,
|
|
2554
|
+
defaultValue: o[e.name] ?? "",
|
|
2496
2555
|
style: s,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
return /* @__PURE__ */ u("option", {
|
|
2508
|
-
value: t.value,
|
|
2509
|
-
children: t.label
|
|
2510
|
-
}, t.value);
|
|
2511
|
-
})]
|
|
2512
|
-
}) : e.type === "switch" ? /* @__PURE__ */ d("select", {
|
|
2513
|
-
name: `f_${e.name}`,
|
|
2514
|
-
defaultValue: o[e.name] ?? "",
|
|
2515
|
-
style: J,
|
|
2516
|
-
...Y(i),
|
|
2517
|
-
children: [
|
|
2518
|
-
/* @__PURE__ */ u("option", {
|
|
2519
|
-
value: "",
|
|
2520
|
-
children: "—"
|
|
2521
|
-
}),
|
|
2522
|
-
/* @__PURE__ */ u("option", {
|
|
2523
|
-
value: "true",
|
|
2524
|
-
children: "Yes"
|
|
2525
|
-
}),
|
|
2526
|
-
/* @__PURE__ */ u("option", {
|
|
2527
|
-
value: "false",
|
|
2528
|
-
children: "No"
|
|
2529
|
-
})
|
|
2530
|
-
]
|
|
2531
|
-
}) : /* @__PURE__ */ u("input", {
|
|
2532
|
-
type: "text",
|
|
2533
|
-
name: `f_${e.name}`,
|
|
2534
|
-
defaultValue: o[e.name] ?? "",
|
|
2535
|
-
placeholder: e.label || e.name,
|
|
2536
|
-
style: J,
|
|
2537
|
-
...Y(i)
|
|
2556
|
+
...X(i),
|
|
2557
|
+
children: [/* @__PURE__ */ u("option", {
|
|
2558
|
+
value: "",
|
|
2559
|
+
children: e.label || e.name
|
|
2560
|
+
}), (Array.isArray(e.options) ? e.options : []).map((e) => {
|
|
2561
|
+
let t = c(e);
|
|
2562
|
+
return /* @__PURE__ */ u("option", {
|
|
2563
|
+
value: t.value,
|
|
2564
|
+
children: t.label
|
|
2565
|
+
}, t.value);
|
|
2538
2566
|
})]
|
|
2567
|
+
}, e.name) : e.type === "switch" ? /* @__PURE__ */ d("select", {
|
|
2568
|
+
name: `f_${e.name}`,
|
|
2569
|
+
defaultValue: o[e.name] ?? "",
|
|
2570
|
+
style: s,
|
|
2571
|
+
...X(i),
|
|
2572
|
+
children: [
|
|
2573
|
+
/* @__PURE__ */ u("option", {
|
|
2574
|
+
value: "",
|
|
2575
|
+
children: e.label || e.name
|
|
2576
|
+
}),
|
|
2577
|
+
/* @__PURE__ */ u("option", {
|
|
2578
|
+
value: "true",
|
|
2579
|
+
children: "Yes"
|
|
2580
|
+
}),
|
|
2581
|
+
/* @__PURE__ */ u("option", {
|
|
2582
|
+
value: "false",
|
|
2583
|
+
children: "No"
|
|
2584
|
+
})
|
|
2585
|
+
]
|
|
2586
|
+
}, e.name) : /* @__PURE__ */ u("input", {
|
|
2587
|
+
type: "text",
|
|
2588
|
+
name: `f_${e.name}`,
|
|
2589
|
+
defaultValue: o[e.name] ?? "",
|
|
2590
|
+
placeholder: e.label || e.name,
|
|
2591
|
+
style: s,
|
|
2592
|
+
...X(i)
|
|
2539
2593
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
2540
2594
|
type: "submit",
|
|
2541
2595
|
style: {
|
|
2542
|
-
...
|
|
2543
|
-
|
|
2596
|
+
...s,
|
|
2597
|
+
minWidth: 0,
|
|
2598
|
+
padding: "0 18px",
|
|
2599
|
+
border: "none",
|
|
2600
|
+
background: "var(--page-accent, #111827)",
|
|
2601
|
+
color: "var(--page-accent-text, #ffffff)",
|
|
2602
|
+
fontWeight: 600,
|
|
2603
|
+
cursor: i ? "default" : "pointer"
|
|
2544
2604
|
},
|
|
2545
|
-
...
|
|
2605
|
+
...X(i),
|
|
2546
2606
|
children: t
|
|
2547
2607
|
})]
|
|
2548
2608
|
});
|
|
2549
2609
|
}
|
|
2550
|
-
function
|
|
2610
|
+
function At({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2551
2611
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
2552
2612
|
ref: r,
|
|
2553
2613
|
"aria-label": "Breadcrumb",
|
|
2554
|
-
style: { ...
|
|
2614
|
+
style: { ...C(n) },
|
|
2555
2615
|
children: /* @__PURE__ */ u("ol", {
|
|
2556
2616
|
style: {
|
|
2557
2617
|
display: "flex",
|
|
@@ -2597,27 +2657,27 @@ function Dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2597
2657
|
})
|
|
2598
2658
|
}) : null;
|
|
2599
2659
|
}
|
|
2600
|
-
function
|
|
2601
|
-
let { tenant:
|
|
2660
|
+
function jt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
|
|
2661
|
+
let { tenant: g, apiUrl: _ } = r(H), v = r(U), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2602
2662
|
i(() => {
|
|
2603
|
-
if (!o || Number.isFinite(
|
|
2604
|
-
let e = !0, t = o.startsWith("api:") ? `${
|
|
2605
|
-
return fetch(t, { headers:
|
|
2663
|
+
if (!o || Number.isFinite(x)) return;
|
|
2664
|
+
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
2665
|
+
return fetch(t, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
|
|
2606
2666
|
if (!e) return;
|
|
2607
2667
|
let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
|
|
2608
|
-
|
|
2609
|
-
}).catch(() => e &&
|
|
2668
|
+
b(Number.isFinite(r) ? r : 0);
|
|
2669
|
+
}).catch(() => e && b(0)), () => {
|
|
2610
2670
|
e = !1;
|
|
2611
2671
|
};
|
|
2612
2672
|
}, [
|
|
2613
2673
|
o,
|
|
2674
|
+
g,
|
|
2614
2675
|
_,
|
|
2615
|
-
|
|
2616
|
-
S
|
|
2676
|
+
x
|
|
2617
2677
|
]);
|
|
2618
|
-
let
|
|
2678
|
+
let S = Math.max(1, Number(s) || 6), w = Number.isFinite(x) ? x : y;
|
|
2619
2679
|
if (o && w === null || o && f && !(w > 0)) return null;
|
|
2620
|
-
let T = Math.min(Math.max(o ? Math.ceil(w /
|
|
2680
|
+
let T = Math.min(Math.max(o ? Math.ceil(w / S) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? de(v) : Number(t) || 1, 1), T), D = (e) => {
|
|
2621
2681
|
if (o) {
|
|
2622
2682
|
if (typeof window < "u") {
|
|
2623
2683
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2641,7 +2701,7 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2641
2701
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2642
2702
|
});
|
|
2643
2703
|
return /* @__PURE__ */ d("nav", {
|
|
2644
|
-
ref:
|
|
2704
|
+
ref: h,
|
|
2645
2705
|
"aria-label": "Pagination",
|
|
2646
2706
|
style: {
|
|
2647
2707
|
display: "flex",
|
|
@@ -2649,7 +2709,7 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2649
2709
|
gap: 8,
|
|
2650
2710
|
alignItems: "center",
|
|
2651
2711
|
justifyContent: O,
|
|
2652
|
-
...
|
|
2712
|
+
...C(m)
|
|
2653
2713
|
},
|
|
2654
2714
|
children: [
|
|
2655
2715
|
n && /* @__PURE__ */ u("a", {
|
|
@@ -2682,15 +2742,15 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2682
2742
|
]
|
|
2683
2743
|
});
|
|
2684
2744
|
}
|
|
2685
|
-
var
|
|
2745
|
+
var Mt = "webim.page_mode", Nt = () => {
|
|
2686
2746
|
if (typeof window > "u") return "auto";
|
|
2687
2747
|
try {
|
|
2688
|
-
let e = window.localStorage.getItem(
|
|
2748
|
+
let e = window.localStorage.getItem(Mt);
|
|
2689
2749
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2690
2750
|
} catch {
|
|
2691
2751
|
return "auto";
|
|
2692
2752
|
}
|
|
2693
|
-
},
|
|
2753
|
+
}, Pt = (e) => {
|
|
2694
2754
|
let t = {
|
|
2695
2755
|
width: 16,
|
|
2696
2756
|
height: 16,
|
|
@@ -2722,13 +2782,13 @@ var kt = "webim.page_mode", At = () => {
|
|
|
2722
2782
|
rx: "2"
|
|
2723
2783
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
2724
2784
|
});
|
|
2725
|
-
},
|
|
2785
|
+
}, Q = {
|
|
2726
2786
|
light: "Light theme",
|
|
2727
2787
|
dark: "Dark theme",
|
|
2728
2788
|
auto: "Follow the device theme"
|
|
2729
2789
|
};
|
|
2730
|
-
function
|
|
2731
|
-
let [o, l] = c(a ? "auto" :
|
|
2790
|
+
function Ft({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
2791
|
+
let [o, l] = c(a ? "auto" : Nt), d = s(null), f = (e) => {
|
|
2732
2792
|
d.current = e, typeof r == "function" && r(e);
|
|
2733
2793
|
};
|
|
2734
2794
|
i(() => {
|
|
@@ -2736,14 +2796,14 @@ function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
2736
2796
|
let e = d.current?.closest?.(".webim-page");
|
|
2737
2797
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2738
2798
|
try {
|
|
2739
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
2799
|
+
o === "auto" ? window.localStorage.removeItem(Mt) : window.localStorage.setItem(Mt, o);
|
|
2740
2800
|
} catch {}
|
|
2741
2801
|
}, [o, a]);
|
|
2742
2802
|
let p = t === !1 ? ["light", "dark"] : [
|
|
2743
2803
|
"light",
|
|
2744
2804
|
"dark",
|
|
2745
2805
|
"auto"
|
|
2746
|
-
], m = p.includes(o) ? o : p[0],
|
|
2806
|
+
], m = p.includes(o) ? o : p[0], h = {
|
|
2747
2807
|
appearance: "none",
|
|
2748
2808
|
border: 0,
|
|
2749
2809
|
margin: 0,
|
|
@@ -2767,43 +2827,43 @@ function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
2767
2827
|
padding: 3,
|
|
2768
2828
|
borderRadius: 999,
|
|
2769
2829
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2770
|
-
...
|
|
2830
|
+
...C(n)
|
|
2771
2831
|
},
|
|
2772
2832
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
2773
2833
|
type: "button",
|
|
2774
|
-
title:
|
|
2775
|
-
"aria-label":
|
|
2834
|
+
title: Q[e],
|
|
2835
|
+
"aria-label": Q[e],
|
|
2776
2836
|
"aria-pressed": e === m,
|
|
2777
2837
|
onClick: a ? void 0 : () => l(e),
|
|
2778
2838
|
style: {
|
|
2779
|
-
...
|
|
2839
|
+
...h,
|
|
2780
2840
|
width: 28,
|
|
2781
2841
|
height: 28,
|
|
2782
2842
|
color: e === m ? "var(--page-accent-text, #ffffff)" : "inherit",
|
|
2783
2843
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2784
2844
|
opacity: e === m ? 1 : .7
|
|
2785
2845
|
},
|
|
2786
|
-
children:
|
|
2846
|
+
children: Pt(e)
|
|
2787
2847
|
}, e))
|
|
2788
2848
|
});
|
|
2789
|
-
let
|
|
2849
|
+
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2790
2850
|
return /* @__PURE__ */ u("button", {
|
|
2791
2851
|
ref: f,
|
|
2792
2852
|
type: "button",
|
|
2793
|
-
title:
|
|
2794
|
-
"aria-label": `Theme: ${
|
|
2795
|
-
onClick: a ? void 0 : () => l(
|
|
2853
|
+
title: Q[m],
|
|
2854
|
+
"aria-label": `Theme: ${Q[m]} — switch to ${Q[g]}`,
|
|
2855
|
+
onClick: a ? void 0 : () => l(g),
|
|
2796
2856
|
style: {
|
|
2797
|
-
...
|
|
2857
|
+
...h,
|
|
2798
2858
|
width: 36,
|
|
2799
2859
|
height: 36,
|
|
2800
2860
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2801
|
-
...
|
|
2861
|
+
...C(n)
|
|
2802
2862
|
},
|
|
2803
|
-
children:
|
|
2863
|
+
children: Pt(m)
|
|
2804
2864
|
});
|
|
2805
2865
|
}
|
|
2806
|
-
var
|
|
2866
|
+
var It = {
|
|
2807
2867
|
facebook: {
|
|
2808
2868
|
label: "Facebook",
|
|
2809
2869
|
color: "#1877f2",
|
|
@@ -2870,10 +2930,10 @@ var Nt = {
|
|
|
2870
2930
|
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"
|
|
2871
2931
|
}
|
|
2872
2932
|
};
|
|
2873
|
-
function
|
|
2874
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
2933
|
+
function Lt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
2934
|
+
let l = Array.isArray(e) ? e.filter((e) => e && It[e.network]) : [];
|
|
2875
2935
|
if (!l.length) return null;
|
|
2876
|
-
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color,
|
|
2936
|
+
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
2877
2937
|
return /* @__PURE__ */ u("div", {
|
|
2878
2938
|
ref: s,
|
|
2879
2939
|
style: {
|
|
@@ -2881,13 +2941,13 @@ function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
2881
2941
|
flexWrap: "wrap",
|
|
2882
2942
|
alignItems: "center",
|
|
2883
2943
|
gap: p,
|
|
2884
|
-
...
|
|
2944
|
+
...C(o)
|
|
2885
2945
|
},
|
|
2886
2946
|
children: l.map((e, r) => {
|
|
2887
|
-
let i =
|
|
2947
|
+
let i = It[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
2888
2948
|
return /* @__PURE__ */ u("a", {
|
|
2889
2949
|
href: e.url || "#",
|
|
2890
|
-
onClick:
|
|
2950
|
+
onClick: h,
|
|
2891
2951
|
"aria-label": e.label || i.label,
|
|
2892
2952
|
title: e.label || i.label,
|
|
2893
2953
|
...a !== !1 && !c ? {
|
|
@@ -2918,7 +2978,7 @@ function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
2918
2978
|
})
|
|
2919
2979
|
});
|
|
2920
2980
|
}
|
|
2921
|
-
function
|
|
2981
|
+
function Rt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2922
2982
|
if (!t.length) return null;
|
|
2923
2983
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
2924
2984
|
width: 32,
|
|
@@ -2956,7 +3016,7 @@ function Ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2956
3016
|
flexDirection: r ? "column" : "row",
|
|
2957
3017
|
alignItems: r ? "stretch" : "flex-start",
|
|
2958
3018
|
gap: r ? 4 : 8,
|
|
2959
|
-
...
|
|
3019
|
+
...C(i)
|
|
2960
3020
|
},
|
|
2961
3021
|
children: t.map((t, n) => {
|
|
2962
3022
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
@@ -2996,7 +3056,7 @@ function Ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2996
3056
|
})
|
|
2997
3057
|
});
|
|
2998
3058
|
}
|
|
2999
|
-
var
|
|
3059
|
+
var zt = {
|
|
3000
3060
|
small: {
|
|
3001
3061
|
w: 132,
|
|
3002
3062
|
h: 46,
|
|
@@ -3018,10 +3078,10 @@ var Q = {
|
|
|
3018
3078
|
title: 12.5,
|
|
3019
3079
|
avatar: 46
|
|
3020
3080
|
}
|
|
3021
|
-
},
|
|
3022
|
-
|
|
3023
|
-
function
|
|
3024
|
-
let r =
|
|
3081
|
+
}, Bt = (e) => zt[e] ?? zt.medium;
|
|
3082
|
+
zt.medium.w, zt.medium.h;
|
|
3083
|
+
function Vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3084
|
+
let r = Bt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
3025
3085
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
3026
3086
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3027
3087
|
if (t.has(e.id)) return 0;
|
|
@@ -3073,19 +3133,19 @@ function Lt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3073
3133
|
horizontal: n
|
|
3074
3134
|
};
|
|
3075
3135
|
}
|
|
3076
|
-
var
|
|
3136
|
+
var Ht = (e, t) => {
|
|
3077
3137
|
let n = String(e ?? "");
|
|
3078
3138
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3079
|
-
},
|
|
3139
|
+
}, Ut = (e) => {
|
|
3080
3140
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3081
3141
|
if (!t) return "#ffffff";
|
|
3082
3142
|
let n = t[1];
|
|
3083
3143
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3084
3144
|
let r = parseInt(n, 16);
|
|
3085
3145
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3086
|
-
},
|
|
3087
|
-
function
|
|
3088
|
-
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 ? "" :
|
|
3146
|
+
}, Wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3147
|
+
function Gt(e, t = {}) {
|
|
3148
|
+
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 ? "" : G(e);
|
|
3089
3149
|
return n.map((e) => {
|
|
3090
3150
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3091
3151
|
return {
|
|
@@ -3099,11 +3159,11 @@ function Vt(e, t = {}) {
|
|
|
3099
3159
|
};
|
|
3100
3160
|
});
|
|
3101
3161
|
}
|
|
3102
|
-
var
|
|
3162
|
+
var Kt = {
|
|
3103
3163
|
size: 36,
|
|
3104
3164
|
pad: 10
|
|
3105
3165
|
};
|
|
3106
|
-
function
|
|
3166
|
+
function qt({ node: e, onClose: t }) {
|
|
3107
3167
|
return i(() => {
|
|
3108
3168
|
let e = (e) => e.key === "Escape" && t();
|
|
3109
3169
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3221,8 +3281,8 @@ function Ut({ node: e, onClose: t }) {
|
|
|
3221
3281
|
})
|
|
3222
3282
|
});
|
|
3223
3283
|
}
|
|
3224
|
-
function
|
|
3225
|
-
let
|
|
3284
|
+
function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3285
|
+
let b = a(), [x, S] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
|
|
3226
3286
|
i(() => {
|
|
3227
3287
|
if (!t || E) return;
|
|
3228
3288
|
let e = !0;
|
|
@@ -3238,19 +3298,19 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3238
3298
|
T,
|
|
3239
3299
|
E
|
|
3240
3300
|
]);
|
|
3241
|
-
let k = t ?
|
|
3301
|
+
let k = t ? Gt(E ?? D ?? [], {
|
|
3242
3302
|
nameField: n,
|
|
3243
3303
|
titleField: o,
|
|
3244
3304
|
photoField: s,
|
|
3245
3305
|
parentField: f,
|
|
3246
3306
|
cvField: p,
|
|
3247
3307
|
hrefField: m
|
|
3248
|
-
}) : e, A =
|
|
3249
|
-
size:
|
|
3250
|
-
horizontal:
|
|
3308
|
+
}) : e, A = Bt(h), { boxes: j, links: M, width: N, height: P } = Vt(k, {
|
|
3309
|
+
size: h,
|
|
3310
|
+
horizontal: g
|
|
3251
3311
|
});
|
|
3252
|
-
if (!j.length) return !
|
|
3253
|
-
ref:
|
|
3312
|
+
if (!j.length) return !y && t ? /* @__PURE__ */ d("div", {
|
|
3313
|
+
ref: v,
|
|
3254
3314
|
style: {
|
|
3255
3315
|
padding: 18,
|
|
3256
3316
|
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
@@ -3258,7 +3318,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3258
3318
|
fontSize: 13,
|
|
3259
3319
|
opacity: .7,
|
|
3260
3320
|
textAlign: "center",
|
|
3261
|
-
...
|
|
3321
|
+
...C(_)
|
|
3262
3322
|
},
|
|
3263
3323
|
children: [
|
|
3264
3324
|
"Org Chart — no published entries in “",
|
|
@@ -3268,11 +3328,11 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3268
3328
|
}) : null;
|
|
3269
3329
|
let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
3270
3330
|
return /* @__PURE__ */ d("div", {
|
|
3271
|
-
ref:
|
|
3331
|
+
ref: v,
|
|
3272
3332
|
style: {
|
|
3273
3333
|
maxWidth: "100%",
|
|
3274
3334
|
overflowX: "auto",
|
|
3275
|
-
...
|
|
3335
|
+
...C(_)
|
|
3276
3336
|
},
|
|
3277
3337
|
children: [/* @__PURE__ */ d("svg", {
|
|
3278
3338
|
viewBox: `0 0 ${N} ${P}`,
|
|
@@ -3286,12 +3346,12 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3286
3346
|
margin: "0 auto"
|
|
3287
3347
|
},
|
|
3288
3348
|
children: [M.map((e, t) => /* @__PURE__ */ u("path", {
|
|
3289
|
-
d:
|
|
3349
|
+
d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
|
|
3290
3350
|
fill: "none",
|
|
3291
3351
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3292
3352
|
strokeWidth: "1.5"
|
|
3293
3353
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
3294
|
-
let r = F.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 ?
|
|
3354
|
+
let r = F.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 ? Ut(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ut(e.color2) : s, f = y && (Wt(e) || e.href), p = () => Wt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Kt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3295
3355
|
return /* @__PURE__ */ d("g", {
|
|
3296
3356
|
onClick: f ? p : void 0,
|
|
3297
3357
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -3299,7 +3359,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3299
3359
|
"aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
3300
3360
|
children: [
|
|
3301
3361
|
i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
|
|
3302
|
-
id: `${
|
|
3362
|
+
id: `${b}-${e.id}-grad`,
|
|
3303
3363
|
x1: "0",
|
|
3304
3364
|
y1: "0",
|
|
3305
3365
|
x2: "0",
|
|
@@ -3317,9 +3377,9 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3317
3377
|
width: A.w,
|
|
3318
3378
|
height: A.h,
|
|
3319
3379
|
rx: "10",
|
|
3320
|
-
fill: `url(#${
|
|
3380
|
+
fill: `url(#${b}-${e.id}-grad)`
|
|
3321
3381
|
})] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
3322
|
-
id: `${
|
|
3382
|
+
id: `${b}-${e.id}-box`,
|
|
3323
3383
|
children: /* @__PURE__ */ u("rect", {
|
|
3324
3384
|
x: t,
|
|
3325
3385
|
y: n,
|
|
@@ -3328,7 +3388,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3328
3388
|
rx: "10"
|
|
3329
3389
|
})
|
|
3330
3390
|
}), /* @__PURE__ */ d("g", {
|
|
3331
|
-
clipPath: `url(#${
|
|
3391
|
+
clipPath: `url(#${b}-${e.id}-box)`,
|
|
3332
3392
|
children: [/* @__PURE__ */ u("rect", {
|
|
3333
3393
|
x: t,
|
|
3334
3394
|
y: n,
|
|
@@ -3353,20 +3413,20 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3353
3413
|
strokeWidth: a ? 0 : 1.5
|
|
3354
3414
|
}),
|
|
3355
3415
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
3356
|
-
id: `${
|
|
3416
|
+
id: `${b}-${e.id}`,
|
|
3357
3417
|
children: /* @__PURE__ */ u("circle", {
|
|
3358
|
-
cx: t +
|
|
3418
|
+
cx: t + Kt.pad + A.avatar / 2,
|
|
3359
3419
|
cy: n + A.h / 2,
|
|
3360
3420
|
r: A.avatar / 2
|
|
3361
3421
|
})
|
|
3362
3422
|
}), /* @__PURE__ */ u("image", {
|
|
3363
3423
|
href: e.photo,
|
|
3364
|
-
x: t +
|
|
3424
|
+
x: t + Kt.pad,
|
|
3365
3425
|
y: n + (A.h - A.avatar) / 2,
|
|
3366
3426
|
width: A.avatar,
|
|
3367
3427
|
height: A.avatar,
|
|
3368
3428
|
preserveAspectRatio: "xMidYMid slice",
|
|
3369
|
-
clipPath: `url(#${
|
|
3429
|
+
clipPath: `url(#${b}-${e.id})`
|
|
3370
3430
|
})] }),
|
|
3371
3431
|
i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
|
|
3372
3432
|
x: m,
|
|
@@ -3375,7 +3435,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3375
3435
|
fontSize: A.title,
|
|
3376
3436
|
fontWeight: "600",
|
|
3377
3437
|
fill: s,
|
|
3378
|
-
children:
|
|
3438
|
+
children: Ht(e.title, g + 4)
|
|
3379
3439
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
3380
3440
|
x: m,
|
|
3381
3441
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -3383,7 +3443,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3383
3443
|
fontSize: A.name,
|
|
3384
3444
|
fontWeight: "600",
|
|
3385
3445
|
fill: c,
|
|
3386
|
-
children:
|
|
3446
|
+
children: Ht(e.name, g)
|
|
3387
3447
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
3388
3448
|
x: m,
|
|
3389
3449
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -3391,7 +3451,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3391
3451
|
fontSize: A.name,
|
|
3392
3452
|
fontWeight: "600",
|
|
3393
3453
|
fill: s,
|
|
3394
|
-
children:
|
|
3454
|
+
children: Ht(v[0], g)
|
|
3395
3455
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
3396
3456
|
x: m,
|
|
3397
3457
|
y: n + A.h * .73,
|
|
@@ -3399,44 +3459,44 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3399
3459
|
fontSize: A.title,
|
|
3400
3460
|
opacity: "0.7",
|
|
3401
3461
|
fill: s,
|
|
3402
|
-
children:
|
|
3462
|
+
children: Ht(v[1], g + 4)
|
|
3403
3463
|
})] })
|
|
3404
3464
|
]
|
|
3405
3465
|
}, e.id);
|
|
3406
3466
|
})]
|
|
3407
|
-
}),
|
|
3408
|
-
node:
|
|
3409
|
-
onClose: () =>
|
|
3467
|
+
}), x && /* @__PURE__ */ u(qt, {
|
|
3468
|
+
node: x,
|
|
3469
|
+
onClose: () => S(null)
|
|
3410
3470
|
})]
|
|
3411
3471
|
});
|
|
3412
3472
|
}
|
|
3413
|
-
function
|
|
3414
|
-
let { tenant:
|
|
3473
|
+
function Yt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: h }) {
|
|
3474
|
+
let { tenant: g, apiUrl: _ } = r(H), v = r(U), y = v?.[n], b = f ? de(v) : 1, [x, S] = c(null);
|
|
3415
3475
|
if (i(() => {
|
|
3416
|
-
if (!n ||
|
|
3417
|
-
let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(
|
|
3418
|
-
return fetch(i, { headers:
|
|
3476
|
+
if (!n || y) return;
|
|
3477
|
+
let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${r}`;
|
|
3478
|
+
return fetch(i, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
|
|
3419
3479
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3420
|
-
return e &&
|
|
3421
|
-
}).catch(() => e &&
|
|
3480
|
+
return e && S(n);
|
|
3481
|
+
}).catch(() => e && S([])), () => {
|
|
3422
3482
|
e = !1;
|
|
3423
3483
|
};
|
|
3424
3484
|
}, [
|
|
3425
3485
|
n,
|
|
3486
|
+
g,
|
|
3426
3487
|
_,
|
|
3427
|
-
|
|
3428
|
-
b,
|
|
3488
|
+
y,
|
|
3429
3489
|
f,
|
|
3430
|
-
|
|
3490
|
+
b,
|
|
3431
3491
|
a
|
|
3432
3492
|
]), !e.length) return null;
|
|
3433
|
-
let w = Math.max(1, Number(a) || 10), T = n ? f ?
|
|
3493
|
+
let w = Math.max(1, Number(a) || 10), T = n ? f ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * w, b * w) : (x ?? []).slice(0, w) : (y ?? x ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => G(W(t?.data, e.field)))) : t, D = !!n && !(n && !y && x === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
|
|
3434
3494
|
return /* @__PURE__ */ u("div", {
|
|
3435
|
-
ref:
|
|
3495
|
+
ref: h,
|
|
3436
3496
|
style: {
|
|
3437
3497
|
width: "100%",
|
|
3438
3498
|
overflowX: "auto",
|
|
3439
|
-
...
|
|
3499
|
+
...C(m)
|
|
3440
3500
|
},
|
|
3441
3501
|
children: /* @__PURE__ */ d("table", {
|
|
3442
3502
|
style: {
|
|
@@ -3476,79 +3536,79 @@ function Gt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
3476
3536
|
})
|
|
3477
3537
|
});
|
|
3478
3538
|
}
|
|
3479
|
-
var
|
|
3480
|
-
PageRoot:
|
|
3481
|
-
Section:
|
|
3482
|
-
Container:
|
|
3483
|
-
Heading:
|
|
3484
|
-
TextBlock:
|
|
3485
|
-
ButtonBlock:
|
|
3486
|
-
ImageBlock:
|
|
3487
|
-
Spacer:
|
|
3488
|
-
Divider:
|
|
3489
|
-
SliderBlock:
|
|
3490
|
-
CanvasSlider:
|
|
3491
|
-
TabsBlock:
|
|
3492
|
-
QuickStack:
|
|
3493
|
-
CollectionList:
|
|
3494
|
-
CollectionSearch:
|
|
3495
|
-
BreadcrumbsBlock:
|
|
3496
|
-
PaginationBlock:
|
|
3497
|
-
StepperBlock:
|
|
3498
|
-
SocialLinksBlock:
|
|
3499
|
-
ThemeModeBlock:
|
|
3500
|
-
OrgChartBlock:
|
|
3501
|
-
TableBlock:
|
|
3502
|
-
MasonryBlock:
|
|
3503
|
-
AccordionBlock:
|
|
3504
|
-
NavbarBlock:
|
|
3505
|
-
ListBlock:
|
|
3506
|
-
TextSpan:
|
|
3507
|
-
QuoteBlock:
|
|
3508
|
-
TextLink:
|
|
3509
|
-
RichTextBlock:
|
|
3510
|
-
RichContentBlock:
|
|
3511
|
-
VideoBlock:
|
|
3512
|
-
YouTubeBlock:
|
|
3513
|
-
IframeBlock:
|
|
3514
|
-
EmbedBlock:
|
|
3515
|
-
FormBlock:
|
|
3516
|
-
FormLabel:
|
|
3517
|
-
FormInput:
|
|
3518
|
-
FormTextarea:
|
|
3519
|
-
FormCheckbox: (e) => /* @__PURE__ */ u(
|
|
3539
|
+
var Xt = {
|
|
3540
|
+
PageRoot: we,
|
|
3541
|
+
Section: Te,
|
|
3542
|
+
Container: Ee,
|
|
3543
|
+
Heading: De,
|
|
3544
|
+
TextBlock: Re,
|
|
3545
|
+
ButtonBlock: Ve,
|
|
3546
|
+
ImageBlock: He,
|
|
3547
|
+
Spacer: Je,
|
|
3548
|
+
Divider: Ye,
|
|
3549
|
+
SliderBlock: tt,
|
|
3550
|
+
CanvasSlider: nt,
|
|
3551
|
+
TabsBlock: st,
|
|
3552
|
+
QuickStack: Dt,
|
|
3553
|
+
CollectionList: Ot,
|
|
3554
|
+
CollectionSearch: kt,
|
|
3555
|
+
BreadcrumbsBlock: At,
|
|
3556
|
+
PaginationBlock: jt,
|
|
3557
|
+
StepperBlock: Rt,
|
|
3558
|
+
SocialLinksBlock: Lt,
|
|
3559
|
+
ThemeModeBlock: Ft,
|
|
3560
|
+
OrgChartBlock: Jt,
|
|
3561
|
+
TableBlock: Yt,
|
|
3562
|
+
MasonryBlock: rt,
|
|
3563
|
+
AccordionBlock: ct,
|
|
3564
|
+
NavbarBlock: ot,
|
|
3565
|
+
ListBlock: Le,
|
|
3566
|
+
TextSpan: Ae,
|
|
3567
|
+
QuoteBlock: Ie,
|
|
3568
|
+
TextLink: Be,
|
|
3569
|
+
RichTextBlock: Pe,
|
|
3570
|
+
RichContentBlock: Pe,
|
|
3571
|
+
VideoBlock: Ue,
|
|
3572
|
+
YouTubeBlock: Ge,
|
|
3573
|
+
IframeBlock: Ke,
|
|
3574
|
+
EmbedBlock: qe,
|
|
3575
|
+
FormBlock: gt,
|
|
3576
|
+
FormLabel: bt,
|
|
3577
|
+
FormInput: xt,
|
|
3578
|
+
FormTextarea: St,
|
|
3579
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Ct, {
|
|
3520
3580
|
kind: "checkbox",
|
|
3521
3581
|
...e
|
|
3522
3582
|
}),
|
|
3523
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
3583
|
+
FormRadio: (e) => /* @__PURE__ */ u(Ct, {
|
|
3524
3584
|
kind: "radio",
|
|
3525
3585
|
...e
|
|
3526
3586
|
}),
|
|
3527
|
-
FormSelect:
|
|
3528
|
-
FormFile:
|
|
3529
|
-
FormRecaptcha:
|
|
3530
|
-
FormSubmit:
|
|
3531
|
-
},
|
|
3587
|
+
FormSelect: wt,
|
|
3588
|
+
FormFile: Tt,
|
|
3589
|
+
FormRecaptcha: yt,
|
|
3590
|
+
FormSubmit: Et
|
|
3591
|
+
}, Zt = {
|
|
3532
3592
|
id: "auth",
|
|
3533
3593
|
label: "Accounts",
|
|
3534
3594
|
category: "Apps",
|
|
3535
3595
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3536
3596
|
ssr: "shell",
|
|
3537
3597
|
settings: ["site.authRedirect"]
|
|
3538
|
-
},
|
|
3598
|
+
}, Qt = t({
|
|
3539
3599
|
user: null,
|
|
3540
3600
|
status: "idle",
|
|
3541
3601
|
ensure: () => {},
|
|
3542
3602
|
refresh: () => {},
|
|
3543
3603
|
signOut: () => {}
|
|
3544
|
-
}),
|
|
3545
|
-
let e = r(
|
|
3604
|
+
}), $t = () => {
|
|
3605
|
+
let e = r(Qt);
|
|
3546
3606
|
return i(() => {
|
|
3547
3607
|
e.ensure();
|
|
3548
3608
|
}, [e]), e;
|
|
3549
3609
|
};
|
|
3550
|
-
function
|
|
3551
|
-
let d = r(
|
|
3610
|
+
function en({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
|
|
3611
|
+
let d = r(H), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
|
|
3552
3612
|
...t,
|
|
3553
3613
|
credentials: "include",
|
|
3554
3614
|
headers: {
|
|
@@ -3580,28 +3640,28 @@ function Xt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
|
|
|
3580
3640
|
b,
|
|
3581
3641
|
x
|
|
3582
3642
|
]);
|
|
3583
|
-
return /* @__PURE__ */ u(
|
|
3643
|
+
return /* @__PURE__ */ u(Qt.Provider, {
|
|
3584
3644
|
value: C,
|
|
3585
3645
|
children: e
|
|
3586
3646
|
});
|
|
3587
3647
|
}
|
|
3588
|
-
function
|
|
3589
|
-
let { status: n } =
|
|
3648
|
+
function tn({ when: e, children: t }) {
|
|
3649
|
+
let { status: n } = $t();
|
|
3590
3650
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3591
3651
|
}
|
|
3592
3652
|
//#endregion
|
|
3593
3653
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3594
|
-
function
|
|
3595
|
-
let { tenant:
|
|
3654
|
+
function nn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
3655
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(H), [v, y] = c("form"), [b, x] = c(""), [S, w] = c(!1), T = e === "register", E = f ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
3596
3656
|
if (e.preventDefault(), f) return;
|
|
3597
3657
|
let n = new FormData(e.currentTarget);
|
|
3598
|
-
w(!0),
|
|
3658
|
+
w(!0), x("");
|
|
3599
3659
|
try {
|
|
3600
|
-
let e = await fetch(`${
|
|
3660
|
+
let e = await fetch(`${g || "/api"}/site/${T ? "register" : "login"}`, {
|
|
3601
3661
|
method: "post",
|
|
3602
3662
|
headers: {
|
|
3603
3663
|
"content-type": "application/json",
|
|
3604
|
-
...
|
|
3664
|
+
...h ? { "x-tenant": h } : {}
|
|
3605
3665
|
},
|
|
3606
3666
|
credentials: "same-origin",
|
|
3607
3667
|
body: JSON.stringify({
|
|
@@ -3611,15 +3671,15 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3611
3671
|
})
|
|
3612
3672
|
}), r = await e.json().catch(() => null);
|
|
3613
3673
|
if (!e.ok || r?.success === !1) {
|
|
3614
|
-
|
|
3674
|
+
x(r?.error?.message || "Sign-in failed"), y("error"), w(!1);
|
|
3615
3675
|
return;
|
|
3616
3676
|
}
|
|
3617
|
-
if (
|
|
3618
|
-
let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(
|
|
3677
|
+
if (y("success"), typeof window < "u") {
|
|
3678
|
+
let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(_?.["site.authRedirect"]) || D(_?.["apps.auth.redirect"]) || "/";
|
|
3619
3679
|
window.location.assign(e);
|
|
3620
3680
|
}
|
|
3621
3681
|
} catch {
|
|
3622
|
-
|
|
3682
|
+
x("Sign-in failed"), y("error"), w(!1);
|
|
3623
3683
|
}
|
|
3624
3684
|
};
|
|
3625
3685
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3628,7 +3688,7 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3628
3688
|
display: "grid",
|
|
3629
3689
|
gap: 12,
|
|
3630
3690
|
maxWidth: 360,
|
|
3631
|
-
...
|
|
3691
|
+
...C(s)
|
|
3632
3692
|
},
|
|
3633
3693
|
children: [
|
|
3634
3694
|
/* @__PURE__ */ d("form", {
|
|
@@ -3640,20 +3700,20 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3640
3700
|
children: [
|
|
3641
3701
|
T ? /* @__PURE__ */ d("label", {
|
|
3642
3702
|
style: {
|
|
3643
|
-
...
|
|
3703
|
+
...J,
|
|
3644
3704
|
display: "grid",
|
|
3645
3705
|
gap: 6
|
|
3646
3706
|
},
|
|
3647
3707
|
children: [a, /* @__PURE__ */ u("input", {
|
|
3648
3708
|
name: "name",
|
|
3649
3709
|
type: "text",
|
|
3650
|
-
style:
|
|
3651
|
-
...
|
|
3710
|
+
style: Y,
|
|
3711
|
+
...X(f)
|
|
3652
3712
|
})]
|
|
3653
3713
|
}) : null,
|
|
3654
3714
|
/* @__PURE__ */ d("label", {
|
|
3655
3715
|
style: {
|
|
3656
|
-
...
|
|
3716
|
+
...J,
|
|
3657
3717
|
display: "grid",
|
|
3658
3718
|
gap: 6
|
|
3659
3719
|
},
|
|
@@ -3661,13 +3721,13 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3661
3721
|
name: "email",
|
|
3662
3722
|
type: "email",
|
|
3663
3723
|
required: !f,
|
|
3664
|
-
style:
|
|
3665
|
-
...
|
|
3724
|
+
style: Y,
|
|
3725
|
+
...X(f)
|
|
3666
3726
|
})]
|
|
3667
3727
|
}),
|
|
3668
3728
|
/* @__PURE__ */ d("label", {
|
|
3669
3729
|
style: {
|
|
3670
|
-
...
|
|
3730
|
+
...J,
|
|
3671
3731
|
display: "grid",
|
|
3672
3732
|
gap: 6
|
|
3673
3733
|
},
|
|
@@ -3675,32 +3735,32 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3675
3735
|
name: "password",
|
|
3676
3736
|
type: "password",
|
|
3677
3737
|
required: !f,
|
|
3678
|
-
style:
|
|
3679
|
-
...
|
|
3738
|
+
style: Y,
|
|
3739
|
+
...X(f)
|
|
3680
3740
|
})]
|
|
3681
3741
|
}),
|
|
3682
3742
|
/* @__PURE__ */ u("button", {
|
|
3683
3743
|
type: f ? "button" : "submit",
|
|
3684
|
-
disabled:
|
|
3744
|
+
disabled: S || void 0,
|
|
3685
3745
|
style: {
|
|
3686
|
-
...
|
|
3746
|
+
...K,
|
|
3687
3747
|
border: 0,
|
|
3688
3748
|
padding: "10px 22px",
|
|
3689
3749
|
borderRadius: 8,
|
|
3690
3750
|
fontSize: 15,
|
|
3691
3751
|
fontWeight: 600,
|
|
3692
3752
|
cursor: "pointer",
|
|
3693
|
-
opacity:
|
|
3753
|
+
opacity: S ? .6 : 1
|
|
3694
3754
|
},
|
|
3695
3755
|
children: o || (T ? "Create account" : "Sign in")
|
|
3696
3756
|
}),
|
|
3697
|
-
|
|
3757
|
+
b ? /* @__PURE__ */ u("p", {
|
|
3698
3758
|
style: {
|
|
3699
3759
|
margin: 0,
|
|
3700
3760
|
fontSize: 14,
|
|
3701
3761
|
color: "#dc2626"
|
|
3702
3762
|
},
|
|
3703
|
-
children:
|
|
3763
|
+
children: b
|
|
3704
3764
|
}) : null
|
|
3705
3765
|
]
|
|
3706
3766
|
}),
|
|
@@ -3715,8 +3775,8 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3715
3775
|
]
|
|
3716
3776
|
});
|
|
3717
3777
|
}
|
|
3718
|
-
function
|
|
3719
|
-
let { user: c, status: l, signOut: f } =
|
|
3778
|
+
function rn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3779
|
+
let { user: c, status: l, signOut: f } = $t(), p = a ? s || "user" : l, m = a ? {
|
|
3720
3780
|
name: "Ada Lovelace",
|
|
3721
3781
|
email: "ada@example.com"
|
|
3722
3782
|
} : c;
|
|
@@ -3724,7 +3784,7 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3724
3784
|
ref: i,
|
|
3725
3785
|
style: {
|
|
3726
3786
|
minHeight: 24,
|
|
3727
|
-
...
|
|
3787
|
+
...C(r)
|
|
3728
3788
|
}
|
|
3729
3789
|
}) : p === "user" ? /* @__PURE__ */ d("div", {
|
|
3730
3790
|
ref: i,
|
|
@@ -3732,12 +3792,12 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3732
3792
|
display: "flex",
|
|
3733
3793
|
alignItems: "center",
|
|
3734
3794
|
gap: 10,
|
|
3735
|
-
...
|
|
3795
|
+
...C(r)
|
|
3736
3796
|
},
|
|
3737
3797
|
children: [
|
|
3738
3798
|
/* @__PURE__ */ d("span", {
|
|
3739
3799
|
style: {
|
|
3740
|
-
...
|
|
3800
|
+
...J,
|
|
3741
3801
|
fontWeight: 600
|
|
3742
3802
|
},
|
|
3743
3803
|
children: [
|
|
@@ -3748,7 +3808,7 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3748
3808
|
}),
|
|
3749
3809
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
3750
3810
|
style: {
|
|
3751
|
-
...
|
|
3811
|
+
...J,
|
|
3752
3812
|
opacity: .7
|
|
3753
3813
|
},
|
|
3754
3814
|
children: m.email
|
|
@@ -3757,14 +3817,14 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3757
3817
|
type: "button",
|
|
3758
3818
|
onClick: a ? void 0 : f,
|
|
3759
3819
|
style: {
|
|
3760
|
-
...
|
|
3820
|
+
...K,
|
|
3761
3821
|
border: 0,
|
|
3762
3822
|
padding: "8px 16px",
|
|
3763
3823
|
borderRadius: 8,
|
|
3764
3824
|
fontSize: 14,
|
|
3765
3825
|
cursor: a ? "default" : "pointer"
|
|
3766
3826
|
},
|
|
3767
|
-
...
|
|
3827
|
+
...X(a),
|
|
3768
3828
|
children: t
|
|
3769
3829
|
})
|
|
3770
3830
|
]
|
|
@@ -3774,65 +3834,65 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3774
3834
|
display: "flex",
|
|
3775
3835
|
alignItems: "center",
|
|
3776
3836
|
gap: 10,
|
|
3777
|
-
...
|
|
3837
|
+
...C(r)
|
|
3778
3838
|
},
|
|
3779
3839
|
children: o?.signedOut ?? null
|
|
3780
3840
|
});
|
|
3781
3841
|
}
|
|
3782
3842
|
//#endregion
|
|
3783
3843
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3784
|
-
var
|
|
3785
|
-
SiteLoginForm:
|
|
3786
|
-
SiteAccountMenu:
|
|
3844
|
+
var an = [Zt], on = {
|
|
3845
|
+
SiteLoginForm: nn,
|
|
3846
|
+
SiteAccountMenu: rn
|
|
3787
3847
|
};
|
|
3788
|
-
new Set(
|
|
3848
|
+
new Set(an.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3789
3849
|
//#endregion
|
|
3790
3850
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
3791
|
-
var
|
|
3792
|
-
function
|
|
3793
|
-
if (
|
|
3851
|
+
var sn = /* @__PURE__ */ new Map();
|
|
3852
|
+
function cn(e) {
|
|
3853
|
+
if (sn.has(e)) return sn.get(e);
|
|
3794
3854
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
3795
3855
|
/* @vite-ignore */
|
|
3796
3856
|
/* webpackIgnore: true */
|
|
3797
3857
|
t
|
|
3798
3858
|
).finally(() => URL.revokeObjectURL(t));
|
|
3799
|
-
return
|
|
3859
|
+
return sn.set(e, n), n;
|
|
3800
3860
|
}
|
|
3801
|
-
function
|
|
3861
|
+
function ln(e) {
|
|
3802
3862
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
3803
3863
|
return n && typeof n == "object" ? n : {};
|
|
3804
3864
|
}
|
|
3805
3865
|
//#endregion
|
|
3806
3866
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
3807
|
-
async function
|
|
3808
|
-
let n = await
|
|
3867
|
+
async function un(e, t) {
|
|
3868
|
+
let n = await cn(e);
|
|
3809
3869
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
3810
3870
|
}
|
|
3811
|
-
var
|
|
3871
|
+
var dn = {
|
|
3812
3872
|
padding: "10px 12px",
|
|
3813
3873
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
3814
3874
|
borderRadius: 8,
|
|
3815
3875
|
fontSize: 12,
|
|
3816
3876
|
opacity: .6
|
|
3817
3877
|
};
|
|
3818
|
-
function
|
|
3819
|
-
let c = r(
|
|
3878
|
+
function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
3879
|
+
let c = r(H), l = ln(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
3820
3880
|
tenant: c?.tenant ?? "",
|
|
3821
3881
|
apiUrl: c?.apiUrl ?? "/api",
|
|
3822
3882
|
locale: c?.locale ?? "",
|
|
3823
3883
|
settings: c?.settings ?? null
|
|
3824
|
-
},
|
|
3825
|
-
|
|
3826
|
-
let
|
|
3884
|
+
}, h = s(m);
|
|
3885
|
+
h.current = m;
|
|
3886
|
+
let g = JSON.stringify(n ?? {});
|
|
3827
3887
|
return i(() => {
|
|
3828
3888
|
let e = f.current;
|
|
3829
3889
|
if (!l?.code || !e) return;
|
|
3830
3890
|
let n = !0;
|
|
3831
|
-
return
|
|
3891
|
+
return un(l.code, t).then((e) => {
|
|
3832
3892
|
if (!(!n || !e || !f.current)) {
|
|
3833
3893
|
p.current = e;
|
|
3834
3894
|
try {
|
|
3835
|
-
e.mount(f.current, JSON.parse(
|
|
3895
|
+
e.mount(f.current, JSON.parse(g), h.current);
|
|
3836
3896
|
} catch {
|
|
3837
3897
|
p.current = null;
|
|
3838
3898
|
}
|
|
@@ -3849,17 +3909,17 @@ function cn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
3849
3909
|
}, [l?.code, t]), i(() => {
|
|
3850
3910
|
let e = p.current, t = f.current;
|
|
3851
3911
|
if (!(!e || !t)) try {
|
|
3852
|
-
e.update ? e.update(t, JSON.parse(
|
|
3912
|
+
e.update ? e.update(t, JSON.parse(g), h.current) : (e.unmount?.(t), t.innerHTML = "", e.mount(t, JSON.parse(g), h.current));
|
|
3853
3913
|
} catch {}
|
|
3854
|
-
}, [
|
|
3914
|
+
}, [g]), l ? /* @__PURE__ */ u("div", {
|
|
3855
3915
|
ref: o,
|
|
3856
|
-
style:
|
|
3916
|
+
style: C(a),
|
|
3857
3917
|
children: /* @__PURE__ */ u("div", { ref: f })
|
|
3858
3918
|
}) : /* @__PURE__ */ d("div", {
|
|
3859
3919
|
ref: o,
|
|
3860
3920
|
style: {
|
|
3861
|
-
...
|
|
3862
|
-
...
|
|
3921
|
+
...dn,
|
|
3922
|
+
...C(a)
|
|
3863
3923
|
},
|
|
3864
3924
|
children: [
|
|
3865
3925
|
"Plugin “",
|
|
@@ -3870,10 +3930,10 @@ function cn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
3870
3930
|
}
|
|
3871
3931
|
//#endregion
|
|
3872
3932
|
//#region ../ui/src/components/builder/render.jsx
|
|
3873
|
-
var
|
|
3874
|
-
...
|
|
3875
|
-
...
|
|
3876
|
-
PluginBlock:
|
|
3933
|
+
var pn = {
|
|
3934
|
+
...Xt,
|
|
3935
|
+
...on,
|
|
3936
|
+
PluginBlock: fn
|
|
3877
3937
|
};
|
|
3878
3938
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3879
3939
|
let o = n[t];
|
|
@@ -3885,110 +3945,110 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3885
3945
|
let c = new Set(i).add(n);
|
|
3886
3946
|
return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
3887
3947
|
}
|
|
3888
|
-
let l =
|
|
3948
|
+
let l = pn[s];
|
|
3889
3949
|
if (!l) return null;
|
|
3890
3950
|
let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
3891
3951
|
...c,
|
|
3892
3952
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
3893
3953
|
linked: p,
|
|
3894
3954
|
nodeRef: (e) => {
|
|
3895
|
-
e && (e.setAttribute("data-wb", t),
|
|
3955
|
+
e && (e.setAttribute("data-wb", t), D(e, c));
|
|
3896
3956
|
},
|
|
3897
3957
|
children: d.length ? d : void 0
|
|
3898
3958
|
}, t);
|
|
3899
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
3959
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(tn, {
|
|
3900
3960
|
when: c.when,
|
|
3901
3961
|
children: m
|
|
3902
3962
|
}, t) : m;
|
|
3903
3963
|
}
|
|
3904
3964
|
//#endregion
|
|
3905
3965
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3906
|
-
var
|
|
3907
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
3908
|
-
function
|
|
3909
|
-
let
|
|
3966
|
+
var mn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), hn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
3967
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
3968
|
+
function gn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: _ }) {
|
|
3969
|
+
let v = s?.js?.trim();
|
|
3910
3970
|
if (i(() => {
|
|
3911
|
-
if (!
|
|
3971
|
+
if (!v) return;
|
|
3912
3972
|
let e = document.createElement("script");
|
|
3913
|
-
return e.text =
|
|
3914
|
-
}, [
|
|
3915
|
-
let
|
|
3973
|
+
return e.text = v, document.body.appendChild(e), () => e.remove();
|
|
3974
|
+
}, [v]), !e?.ROOT) return null;
|
|
3975
|
+
let b = {
|
|
3916
3976
|
lang: p || void 0,
|
|
3917
|
-
dir:
|
|
3918
|
-
},
|
|
3977
|
+
dir: ue(m, p)
|
|
3978
|
+
}, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", S = {
|
|
3919
3979
|
minHeight: "100%",
|
|
3920
3980
|
display: "flex",
|
|
3921
3981
|
flexDirection: "column"
|
|
3922
|
-
},
|
|
3982
|
+
}, C = $("ROOT", e, n), w = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = s?.css?.trim(), O = B(t), k = [O.font, O.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !z[e]), A = [.../* @__PURE__ */ new Set([...y(e, n), ...k])].map((e) => /* @__PURE__ */ u("link", {
|
|
3923
3983
|
rel: "stylesheet",
|
|
3924
3984
|
precedence: "default",
|
|
3925
|
-
href:
|
|
3926
|
-
}, e)),
|
|
3927
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
3985
|
+
href: g(e)
|
|
3986
|
+
}, e)), j = hn(O);
|
|
3987
|
+
return r === "auto" ? /* @__PURE__ */ u(H.Provider, {
|
|
3928
3988
|
value: {
|
|
3929
3989
|
tenant: c || "",
|
|
3930
3990
|
apiUrl: l || "/api",
|
|
3931
3991
|
locale: p || "",
|
|
3932
3992
|
settings: h ?? null
|
|
3933
3993
|
},
|
|
3934
|
-
children: /* @__PURE__ */ u(
|
|
3935
|
-
initialUser:
|
|
3936
|
-
children: /* @__PURE__ */ u(
|
|
3994
|
+
children: /* @__PURE__ */ u(en, {
|
|
3995
|
+
initialUser: _,
|
|
3996
|
+
children: /* @__PURE__ */ u(U.Provider, {
|
|
3937
3997
|
value: f ?? null,
|
|
3938
|
-
children: /* @__PURE__ */ u(
|
|
3939
|
-
value:
|
|
3998
|
+
children: /* @__PURE__ */ u(me.Provider, {
|
|
3999
|
+
value: w,
|
|
3940
4000
|
children: /* @__PURE__ */ d("div", {
|
|
3941
|
-
...
|
|
4001
|
+
...b,
|
|
3942
4002
|
className: "webim-page",
|
|
3943
4003
|
style: {
|
|
3944
|
-
...
|
|
3945
|
-
...
|
|
4004
|
+
...S,
|
|
4005
|
+
...ne(t),
|
|
3946
4006
|
...a
|
|
3947
4007
|
},
|
|
3948
4008
|
children: [
|
|
3949
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
3950
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3951
|
-
/* @__PURE__ */ u("style", { children:
|
|
3952
|
-
|
|
3953
|
-
/* @__PURE__ */ u("style", { children:
|
|
3954
|
-
C && /* @__PURE__ */ u("style", { children: C }),
|
|
3955
|
-
w && /* @__PURE__ */ u("style", { children: w }),
|
|
4009
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${mn(V(O.light))} }
|
|
4010
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${mn(V(O.dark))} } }` }),
|
|
4011
|
+
/* @__PURE__ */ u("style", { children: j }),
|
|
4012
|
+
A,
|
|
4013
|
+
/* @__PURE__ */ u("style", { children: x }),
|
|
3956
4014
|
T && /* @__PURE__ */ u("style", { children: T }),
|
|
3957
|
-
|
|
4015
|
+
E && /* @__PURE__ */ u("style", { children: E }),
|
|
4016
|
+
D && /* @__PURE__ */ u("style", { children: D }),
|
|
4017
|
+
C
|
|
3958
4018
|
]
|
|
3959
4019
|
})
|
|
3960
4020
|
})
|
|
3961
4021
|
})
|
|
3962
4022
|
})
|
|
3963
|
-
}) : /* @__PURE__ */ u(
|
|
4023
|
+
}) : /* @__PURE__ */ u(H.Provider, {
|
|
3964
4024
|
value: {
|
|
3965
4025
|
tenant: c || "",
|
|
3966
4026
|
apiUrl: l || "/api",
|
|
3967
4027
|
locale: p || "",
|
|
3968
4028
|
settings: h ?? null
|
|
3969
4029
|
},
|
|
3970
|
-
children: /* @__PURE__ */ u(
|
|
3971
|
-
initialUser:
|
|
3972
|
-
children: /* @__PURE__ */ u(
|
|
4030
|
+
children: /* @__PURE__ */ u(en, {
|
|
4031
|
+
initialUser: _,
|
|
4032
|
+
children: /* @__PURE__ */ u(U.Provider, {
|
|
3973
4033
|
value: f ?? null,
|
|
3974
|
-
children: /* @__PURE__ */ u(
|
|
3975
|
-
value:
|
|
4034
|
+
children: /* @__PURE__ */ u(me.Provider, {
|
|
4035
|
+
value: w,
|
|
3976
4036
|
children: /* @__PURE__ */ d("div", {
|
|
3977
|
-
...
|
|
4037
|
+
...b,
|
|
3978
4038
|
className: "webim-page",
|
|
3979
4039
|
style: {
|
|
3980
|
-
...
|
|
3981
|
-
...
|
|
4040
|
+
...S,
|
|
4041
|
+
...re(t, r),
|
|
3982
4042
|
...a
|
|
3983
4043
|
},
|
|
3984
4044
|
children: [
|
|
3985
|
-
|
|
3986
|
-
/* @__PURE__ */ u("style", { children:
|
|
3987
|
-
/* @__PURE__ */ u("style", { children:
|
|
3988
|
-
C && /* @__PURE__ */ u("style", { children: C }),
|
|
3989
|
-
w && /* @__PURE__ */ u("style", { children: w }),
|
|
4045
|
+
A,
|
|
4046
|
+
/* @__PURE__ */ u("style", { children: j }),
|
|
4047
|
+
/* @__PURE__ */ u("style", { children: x }),
|
|
3990
4048
|
T && /* @__PURE__ */ u("style", { children: T }),
|
|
3991
|
-
|
|
4049
|
+
E && /* @__PURE__ */ u("style", { children: E }),
|
|
4050
|
+
D && /* @__PURE__ */ u("style", { children: D }),
|
|
4051
|
+
C
|
|
3992
4052
|
]
|
|
3993
4053
|
})
|
|
3994
4054
|
})
|
|
@@ -3998,8 +4058,8 @@ function fn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3998
4058
|
}
|
|
3999
4059
|
//#endregion
|
|
4000
4060
|
//#region src/WebimContent.jsx
|
|
4001
|
-
function
|
|
4002
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
4061
|
+
function _n({ bundle: e, mode: t = "auto", style: n }) {
|
|
4062
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(gn, {
|
|
4003
4063
|
blocks: e.blocks,
|
|
4004
4064
|
theme: e.theme,
|
|
4005
4065
|
components: e.components,
|
|
@@ -4016,7 +4076,7 @@ function pn({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
4016
4076
|
}
|
|
4017
4077
|
//#endregion
|
|
4018
4078
|
//#region src/WebimPage.jsx
|
|
4019
|
-
function
|
|
4079
|
+
function vn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
4020
4080
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
4021
4081
|
onLoad: m,
|
|
4022
4082
|
onError: h
|
|
@@ -4026,7 +4086,7 @@ function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
4026
4086
|
onError: h
|
|
4027
4087
|
}, i(() => {
|
|
4028
4088
|
let i = !0;
|
|
4029
|
-
return _({ status: "loading" }),
|
|
4089
|
+
return _({ status: "loading" }), se({
|
|
4030
4090
|
apiUrl: e,
|
|
4031
4091
|
tenant: t,
|
|
4032
4092
|
slug: n,
|
|
@@ -4053,11 +4113,11 @@ function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
4053
4113
|
r,
|
|
4054
4114
|
a,
|
|
4055
4115
|
o
|
|
4056
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
4116
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(_n, {
|
|
4057
4117
|
bundle: g.bundle,
|
|
4058
4118
|
mode: l,
|
|
4059
4119
|
style: d
|
|
4060
4120
|
});
|
|
4061
4121
|
}
|
|
4062
4122
|
//#endregion
|
|
4063
|
-
export {
|
|
4123
|
+
export { gn as PageRenderer, _n as WebimContent, vn as WebimPage, se as fetchPage, Ne as renderRichContent, ie as resolveTheme };
|