webim-adapter 0.6.0 → 0.8.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/README.md +5 -5
- package/build/webim-adapter.js +983 -544
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +994 -557
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Fragment as e, createContext as t, useContext as n, useEffect as r,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
3
3
|
//#region ../ui/src/components/builder/styles.js
|
|
4
|
-
var
|
|
4
|
+
var d = /* @__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(".")), f = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, p = [
|
|
5
5
|
"borderWidth",
|
|
6
6
|
"borderStyle",
|
|
7
7
|
"borderColor",
|
|
8
8
|
"borderRadius",
|
|
9
9
|
"gap"
|
|
10
10
|
];
|
|
11
|
-
function
|
|
11
|
+
function m(e) {
|
|
12
12
|
let t = {};
|
|
13
|
-
for (let n of
|
|
13
|
+
for (let n of p) {
|
|
14
14
|
let r = e?.[n];
|
|
15
|
-
r != null && r !== "" && (t[n] =
|
|
15
|
+
r != null && r !== "" && (t[n] = d.has(n) ? f(r) : r);
|
|
16
16
|
}
|
|
17
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
17
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || p.includes(n) || (t[n] = d.has(n) ? f(r) : r);
|
|
18
18
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
19
19
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
20
|
-
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor:
|
|
20
|
+
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
21
21
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
22
|
-
let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
22
|
+
let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
23
23
|
[
|
|
24
24
|
s,
|
|
25
25
|
c,
|
|
26
26
|
l,
|
|
27
|
-
|
|
28
|
-
].some((e) => e !== void 0) && m.push(`${
|
|
29
|
-
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${
|
|
27
|
+
u
|
|
28
|
+
].some((e) => e !== void 0) && m.push(`${f(s ?? 0)} ${f(c ?? 0)} ${f(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
|
|
29
|
+
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
|
|
30
30
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
31
31
|
let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
|
|
32
|
-
(v !== void 0 || y !== void 0) && w.push(`translate(${
|
|
33
|
-
let T = (e) => `${e.inset ? "inset " : ""}${
|
|
32
|
+
(v !== void 0 || y !== void 0) && w.push(`translate(${f(v ?? 0)}, ${f(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
|
|
33
|
+
let T = (e) => `${e.inset ? "inset " : ""}${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${f(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
34
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
35
35
|
let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
|
|
36
36
|
[
|
|
@@ -48,76 +48,76 @@ function p(e) {
|
|
|
48
48
|
color: j,
|
|
49
49
|
inset: M
|
|
50
50
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let P = (e) => e.type === "blur" ? `blur(${
|
|
51
|
+
let P = (e) => e.type === "blur" ? `blur(${f(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(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: ee, filterGrayscale: R, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
|
|
52
52
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
53
|
let B = F(I);
|
|
54
|
-
|
|
54
|
+
ee !== void 0 && B.push(`blur(${f(ee)})`), R !== void 0 && B.push(`grayscale(${R}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
|
|
55
55
|
let re = F(L);
|
|
56
56
|
re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
|
-
let { textStrokeWidth:
|
|
58
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
59
|
-
let { clipText:
|
|
60
|
-
delete t.clipText,
|
|
61
|
-
let { transitions:
|
|
57
|
+
let { textStrokeWidth: ie, textStrokeColor: ae } = t;
|
|
58
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${f(ie ?? 1)} ${ae || "currentColor"}`);
|
|
59
|
+
let { clipText: oe } = t;
|
|
60
|
+
delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
+
let { transitions: V, transitionDuration: H, transitionEasing: U, transitionProperty: se } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
63
|
+
let G = (Array.isArray(V) ? V : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (H !== void 0 && G.push(`${se || "all"} ${W(H)} ${U || "ease"}`), G.length && (t.transition = G.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
65
|
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
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
68
68
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
69
|
+
let { overlayColor: K, overlayOpacity: ce } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, K) {
|
|
71
|
+
let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
72
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
73
|
}
|
|
74
74
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
75
|
+
let { backgroundLayers: q } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
77
|
+
let J = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
|
|
78
|
+
if (J.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
|
-
for (let t of
|
|
80
|
+
for (let t of J) 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
81
|
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
82
|
else {
|
|
83
83
|
if (!t.src) continue;
|
|
84
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
84
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${f(t.w ?? "auto")} ${f(t.h ?? "auto")}` : t.size || "cover"), r.push(`${f(t.posX ?? 0)} ${f(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
85
85
|
}
|
|
86
86
|
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
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var h = {
|
|
91
91
|
hover: ":hover",
|
|
92
92
|
pressed: ":active",
|
|
93
93
|
focused: ":focus"
|
|
94
|
-
},
|
|
94
|
+
}, g = /* @__PURE__ */ new Set([
|
|
95
95
|
"style",
|
|
96
96
|
"class",
|
|
97
97
|
"id",
|
|
98
98
|
"data-wb",
|
|
99
99
|
"data-wb-class",
|
|
100
100
|
"data-slot"
|
|
101
|
-
]),
|
|
102
|
-
function
|
|
101
|
+
]), _ = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !g.has(e.toLowerCase());
|
|
102
|
+
function v(e, t, n = []) {
|
|
103
103
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
104
104
|
for (let t of n) e.removeAttribute(t);
|
|
105
105
|
let r = [];
|
|
106
106
|
for (let n of t.attributes ?? []) {
|
|
107
107
|
let t = String(n?.name ?? "").trim();
|
|
108
|
-
|
|
108
|
+
_(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
|
|
109
109
|
}
|
|
110
110
|
return r;
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
114
|
-
let i = Object.entries(
|
|
112
|
+
var y = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
113
|
+
function b(e, t, n, r = !1) {
|
|
114
|
+
let i = Object.entries(m(t)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
|
|
115
115
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return Object.entries(
|
|
117
|
+
function x(e, t, n) {
|
|
118
|
+
return Object.entries(h).map(([r, i]) => b(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
119
119
|
}
|
|
120
|
-
var
|
|
120
|
+
var S = [
|
|
121
121
|
{
|
|
122
122
|
key: "tablet",
|
|
123
123
|
max: 991
|
|
@@ -130,17 +130,17 @@ var x = [
|
|
|
130
130
|
key: "mobile",
|
|
131
131
|
max: 478
|
|
132
132
|
}
|
|
133
|
-
],
|
|
134
|
-
function
|
|
135
|
-
return
|
|
136
|
-
let i = t?.[n] ?
|
|
133
|
+
], C = (e) => Object.entries(m(e)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
|
|
134
|
+
function w(e, t) {
|
|
135
|
+
return S.map(({ key: n, max: r }) => {
|
|
136
|
+
let i = t?.[n] ? C(t[n]) : "";
|
|
137
137
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
138
138
|
}).filter(Boolean).join("\n");
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function T(e, t) {
|
|
141
141
|
let n = [], r = (e) => {
|
|
142
142
|
for (let [t, r] of Object.entries(e || {})) {
|
|
143
|
-
let e =
|
|
143
|
+
let e = w(t, r.props);
|
|
144
144
|
e && n.push(e);
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -148,10 +148,10 @@ function w(e, t) {
|
|
|
148
148
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
149
149
|
return n.join("\n");
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function E(e, t) {
|
|
152
152
|
let n = [], r = (e) => {
|
|
153
153
|
for (let [t, r] of Object.entries(e || {})) {
|
|
154
|
-
let e =
|
|
154
|
+
let e = x(t, r.props);
|
|
155
155
|
e && n.push(e);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
@@ -159,7 +159,7 @@ function T(e, t) {
|
|
|
159
159
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
160
160
|
return n.join("\n");
|
|
161
161
|
}
|
|
162
|
-
var
|
|
162
|
+
var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
|
|
163
163
|
light: {
|
|
164
164
|
background: "#ffffff",
|
|
165
165
|
text: "#111827",
|
|
@@ -196,23 +196,23 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
196
196
|
contrastText: "#052e2b"
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, k = {
|
|
200
200
|
font: "system",
|
|
201
201
|
headingFont: "inherit",
|
|
202
|
-
light:
|
|
203
|
-
dark:
|
|
204
|
-
},
|
|
202
|
+
light: O.light,
|
|
203
|
+
dark: O.dark
|
|
204
|
+
}, A = {
|
|
205
205
|
system: {
|
|
206
206
|
label: "System",
|
|
207
|
-
value:
|
|
207
|
+
value: D
|
|
208
208
|
},
|
|
209
209
|
inter: {
|
|
210
210
|
label: "Inter",
|
|
211
|
-
value: `"Inter", ${
|
|
211
|
+
value: `"Inter", ${D}`
|
|
212
212
|
},
|
|
213
213
|
outfit: {
|
|
214
214
|
label: "Outfit",
|
|
215
|
-
value: `"Outfit", ${
|
|
215
|
+
value: `"Outfit", ${D}`
|
|
216
216
|
},
|
|
217
217
|
serif: {
|
|
218
218
|
label: "Serif",
|
|
@@ -222,7 +222,7 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
222
222
|
label: "Mono",
|
|
223
223
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
|
|
226
226
|
let n = Object.assign({}, e, ...t);
|
|
227
227
|
return n.primary = {
|
|
228
228
|
...e.primary,
|
|
@@ -238,16 +238,16 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
238
238
|
}), {})
|
|
239
239
|
}, n;
|
|
240
240
|
};
|
|
241
|
-
function
|
|
241
|
+
function N(e) {
|
|
242
242
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
243
243
|
return {
|
|
244
|
-
font: r ??
|
|
245
|
-
headingFont: i ??
|
|
246
|
-
light:
|
|
247
|
-
dark:
|
|
244
|
+
font: r ?? k.font,
|
|
245
|
+
headingFont: i ?? k.headingFont,
|
|
246
|
+
light: M(O.light, a, t),
|
|
247
|
+
dark: M(O.dark, n)
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function P(e) {
|
|
251
251
|
return {
|
|
252
252
|
"--page-bg": e.background,
|
|
253
253
|
"--page-text": e.text,
|
|
@@ -263,28 +263,28 @@ function N(e) {
|
|
|
263
263
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
let t =
|
|
266
|
+
function F(e) {
|
|
267
|
+
let t = N(e);
|
|
268
268
|
return {
|
|
269
269
|
backgroundColor: "var(--page-bg)",
|
|
270
270
|
color: "var(--page-text)",
|
|
271
|
-
fontFamily:
|
|
272
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
271
|
+
fontFamily: j(t.font, D),
|
|
272
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
let n =
|
|
275
|
+
function I(e, t = "light") {
|
|
276
|
+
let n = N(e);
|
|
277
277
|
return {
|
|
278
|
-
...
|
|
279
|
-
...
|
|
278
|
+
...F(e),
|
|
279
|
+
...P(n[t] ?? n.light)
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function L(e, t) {
|
|
283
283
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/bundle.js
|
|
287
|
-
function
|
|
287
|
+
function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
288
288
|
let a = {
|
|
289
289
|
...t?.global ?? {},
|
|
290
290
|
...t?.tenant ?? {}
|
|
@@ -294,7 +294,7 @@ function L({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
294
294
|
title: e.title,
|
|
295
295
|
slug: e.slug,
|
|
296
296
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
297
|
-
theme:
|
|
297
|
+
theme: L(o, a.builder_themes?.themes),
|
|
298
298
|
components: a.builder_components?.components ?? {},
|
|
299
299
|
custom: o.custom,
|
|
300
300
|
seo: o.seo,
|
|
@@ -312,21 +312,24 @@ var R = async (e) => {
|
|
|
312
312
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
313
313
|
return t?.payload ?? t;
|
|
314
314
|
};
|
|
315
|
-
async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i,
|
|
315
|
+
async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
|
|
316
316
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
317
317
|
if (!n) throw Error("fetchPage: slug is required");
|
|
318
|
-
let
|
|
319
|
-
|
|
320
|
-
|
|
318
|
+
let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
|
|
319
|
+
...t ? { "x-tenant": t } : {},
|
|
320
|
+
...a ? { authorization: `Bearer ${a}` } : {}
|
|
321
|
+
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(R), s(`${c}/settings/public`, { headers: l }).then(R)]), f = ee({
|
|
322
|
+
page: u,
|
|
323
|
+
settings: d,
|
|
321
324
|
tenant: t,
|
|
322
|
-
apiUrl:
|
|
325
|
+
apiUrl: c,
|
|
323
326
|
locale: r
|
|
324
|
-
}),
|
|
325
|
-
if (
|
|
326
|
-
let e = (e) => e.startsWith("api:") ? `${
|
|
327
|
-
|
|
327
|
+
}), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
328
|
+
if (p.length) {
|
|
329
|
+
let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(R).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
|
|
330
|
+
f.datasets = Object.fromEntries(t);
|
|
328
331
|
}
|
|
329
|
-
return
|
|
332
|
+
return f;
|
|
330
333
|
}
|
|
331
334
|
new Map([
|
|
332
335
|
{
|
|
@@ -434,14 +437,14 @@ new Map([
|
|
|
434
437
|
fallback: "sans-serif"
|
|
435
438
|
}
|
|
436
439
|
].map((e) => [e.family, e]));
|
|
437
|
-
function
|
|
440
|
+
function te(e) {
|
|
438
441
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
439
442
|
}
|
|
440
|
-
var
|
|
443
|
+
var ne = (e) => te([e]), B = (e) => {
|
|
441
444
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
442
445
|
return t ? t[1] : null;
|
|
443
446
|
};
|
|
444
|
-
function
|
|
447
|
+
function re(e, t) {
|
|
445
448
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
446
449
|
for (let t of Object.values(e || {})) for (let e of [
|
|
447
450
|
"style",
|
|
@@ -449,7 +452,7 @@ function B(e, t) {
|
|
|
449
452
|
"pressed",
|
|
450
453
|
"focused"
|
|
451
454
|
]) {
|
|
452
|
-
let r =
|
|
455
|
+
let r = B(t.props?.[e]?.fontFamily);
|
|
453
456
|
r && n.add(r);
|
|
454
457
|
}
|
|
455
458
|
};
|
|
@@ -459,7 +462,7 @@ function B(e, t) {
|
|
|
459
462
|
}
|
|
460
463
|
//#endregion
|
|
461
464
|
//#region ../ui/src/components/builder/locale.js
|
|
462
|
-
var
|
|
465
|
+
var ie = /* @__PURE__ */ new Set([
|
|
463
466
|
"ar",
|
|
464
467
|
"he",
|
|
465
468
|
"fa",
|
|
@@ -470,14 +473,15 @@ var re = /* @__PURE__ */ new Set([
|
|
|
470
473
|
"yi",
|
|
471
474
|
"dv",
|
|
472
475
|
"ckb"
|
|
473
|
-
]),
|
|
476
|
+
]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, V = t({
|
|
474
477
|
tenant: "",
|
|
475
|
-
apiUrl: "/api"
|
|
476
|
-
|
|
477
|
-
|
|
478
|
+
apiUrl: "/api",
|
|
479
|
+
locale: ""
|
|
480
|
+
}), H = t(null), U = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
481
|
+
function W(e, t) {
|
|
478
482
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
479
483
|
}
|
|
480
|
-
var
|
|
484
|
+
var G = (e) => {
|
|
481
485
|
let t = [];
|
|
482
486
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
483
487
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -488,12 +492,12 @@ var oe = (e) => {
|
|
|
488
492
|
return t;
|
|
489
493
|
};
|
|
490
494
|
function K(e) {
|
|
491
|
-
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : 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(" ") : "").filter(Boolean).join(" ") : "";
|
|
495
|
+
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 ?? "") : 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(" ") : "";
|
|
492
496
|
}
|
|
493
|
-
function
|
|
494
|
-
let n = t?.data ?? {}, r =
|
|
497
|
+
function ce(e, t) {
|
|
498
|
+
let n = t?.data ?? {}, r = G(n);
|
|
495
499
|
if (!r.length) return e;
|
|
496
|
-
let i = RegExp(`:(${r.map(
|
|
500
|
+
let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(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;
|
|
497
501
|
return a(e);
|
|
498
502
|
}
|
|
499
503
|
var q = {
|
|
@@ -507,16 +511,16 @@ var q = {
|
|
|
507
511
|
cursor: "pointer",
|
|
508
512
|
backgroundColor: "var(--page-accent, #111827)",
|
|
509
513
|
color: "var(--page-accent-text, #ffffff)"
|
|
510
|
-
},
|
|
514
|
+
}, le = {
|
|
511
515
|
flexGrow: 1,
|
|
512
516
|
display: "flex",
|
|
513
517
|
flexDirection: "column",
|
|
514
518
|
position: "relative"
|
|
515
|
-
},
|
|
519
|
+
}, ue = {
|
|
516
520
|
display: "flex",
|
|
517
521
|
flexDirection: "column"
|
|
518
522
|
};
|
|
519
|
-
function
|
|
523
|
+
function de({ style: e }) {
|
|
520
524
|
let t = e?.backgroundVideo;
|
|
521
525
|
if (!t) return null;
|
|
522
526
|
let n = {
|
|
@@ -527,7 +531,7 @@ function ue({ style: e }) {
|
|
|
527
531
|
zIndex: -1,
|
|
528
532
|
pointerEvents: "none"
|
|
529
533
|
}, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
|
|
530
|
-
return /* @__PURE__ */
|
|
534
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
|
|
531
535
|
src: t,
|
|
532
536
|
autoPlay: !0,
|
|
533
537
|
muted: !0,
|
|
@@ -537,73 +541,73 @@ function ue({ style: e }) {
|
|
|
537
541
|
...n,
|
|
538
542
|
objectFit: "cover"
|
|
539
543
|
}
|
|
540
|
-
}), r && /* @__PURE__ */
|
|
544
|
+
}), r && /* @__PURE__ */ l("div", { style: {
|
|
541
545
|
...n,
|
|
542
546
|
background: r
|
|
543
547
|
} })] });
|
|
544
548
|
}
|
|
545
|
-
var
|
|
549
|
+
var fe = (e, t) => e?.backgroundVideo ? {
|
|
546
550
|
position: "relative",
|
|
547
551
|
...t,
|
|
548
|
-
...
|
|
552
|
+
...m(e)
|
|
549
553
|
} : {
|
|
550
554
|
...t,
|
|
551
|
-
...
|
|
555
|
+
...m(e)
|
|
552
556
|
};
|
|
553
|
-
function
|
|
554
|
-
return /* @__PURE__ */
|
|
557
|
+
function pe({ style: e, nodeRef: t, children: n }) {
|
|
558
|
+
return /* @__PURE__ */ u("div", {
|
|
555
559
|
ref: t,
|
|
556
560
|
style: {
|
|
557
|
-
...
|
|
558
|
-
...
|
|
561
|
+
...le,
|
|
562
|
+
...m(e)
|
|
559
563
|
},
|
|
560
|
-
children: [/* @__PURE__ */
|
|
564
|
+
children: [/* @__PURE__ */ l(de, { style: e }), n]
|
|
561
565
|
});
|
|
562
566
|
}
|
|
563
|
-
function
|
|
564
|
-
return /* @__PURE__ */
|
|
567
|
+
function me({ style: e, nodeRef: t, children: n }) {
|
|
568
|
+
return /* @__PURE__ */ u("section", {
|
|
565
569
|
ref: t,
|
|
566
|
-
style:
|
|
567
|
-
children: [/* @__PURE__ */
|
|
570
|
+
style: fe(e, ue),
|
|
571
|
+
children: [/* @__PURE__ */ l(de, { style: e }), n]
|
|
568
572
|
});
|
|
569
573
|
}
|
|
570
|
-
function
|
|
574
|
+
function he({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
571
575
|
let i = t ? {
|
|
572
576
|
position: "relative",
|
|
573
577
|
minHeight: 240
|
|
574
578
|
} : null;
|
|
575
|
-
return /* @__PURE__ */
|
|
579
|
+
return /* @__PURE__ */ u("div", {
|
|
576
580
|
ref: n,
|
|
577
581
|
style: i ? {
|
|
578
582
|
...i,
|
|
579
|
-
...
|
|
580
|
-
} :
|
|
581
|
-
children: [/* @__PURE__ */
|
|
583
|
+
...fe(e)
|
|
584
|
+
} : fe(e),
|
|
585
|
+
children: [/* @__PURE__ */ l(de, { style: e }), r]
|
|
582
586
|
});
|
|
583
587
|
}
|
|
584
|
-
function
|
|
585
|
-
return /* @__PURE__ */
|
|
588
|
+
function ge({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
589
|
+
return /* @__PURE__ */ l(n, {
|
|
586
590
|
ref: a,
|
|
587
591
|
style: {
|
|
588
592
|
...q,
|
|
589
|
-
...
|
|
593
|
+
...m(r)
|
|
590
594
|
},
|
|
591
595
|
children: X(t, e, i)
|
|
592
596
|
});
|
|
593
597
|
}
|
|
594
|
-
var
|
|
595
|
-
fontFamily:
|
|
598
|
+
var _e = {
|
|
599
|
+
fontFamily: A.mono.value,
|
|
596
600
|
background: "rgba(148, 163, 184, 0.18)",
|
|
597
601
|
padding: "1px 5px",
|
|
598
602
|
borderRadius: 4,
|
|
599
603
|
fontSize: "0.9em"
|
|
600
604
|
};
|
|
601
|
-
function
|
|
605
|
+
function ve(e, t = [], n, r) {
|
|
602
606
|
let i = e;
|
|
603
|
-
return t.includes("sup") ? i = /* @__PURE__ */
|
|
604
|
-
style:
|
|
607
|
+
return t.includes("sup") ? i = /* @__PURE__ */ l("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ l("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ l("code", {
|
|
608
|
+
style: _e,
|
|
605
609
|
children: i
|
|
606
|
-
})), t.includes("strike") && (i = /* @__PURE__ */
|
|
610
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ l("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ l("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ l("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ l("strong", { children: i })), n && (i = /* @__PURE__ */ l("a", {
|
|
607
611
|
href: n,
|
|
608
612
|
target: r || void 0,
|
|
609
613
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
@@ -613,34 +617,34 @@ function _e(e, t = [], n, r) {
|
|
|
613
617
|
}
|
|
614
618
|
function X(t, n, r) {
|
|
615
619
|
return t?.length ? t.map((t, n) => {
|
|
616
|
-
if (t.slot) return /* @__PURE__ */
|
|
617
|
-
if (t.parts) return /* @__PURE__ */
|
|
620
|
+
if (t.slot) return /* @__PURE__ */ l(e, { children: r?.[t.slot] ?? null }, n);
|
|
621
|
+
if (t.parts) return /* @__PURE__ */ l(e, { children: X(t.parts, "", r) }, n);
|
|
618
622
|
let i = t.text;
|
|
619
|
-
return t.sup ? i = /* @__PURE__ */
|
|
620
|
-
style:
|
|
623
|
+
return t.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ l("sub", { children: i })), t.code && (i = /* @__PURE__ */ l("code", {
|
|
624
|
+
style: _e,
|
|
621
625
|
children: i
|
|
622
|
-
})), t.strike && (i = /* @__PURE__ */
|
|
626
|
+
})), t.strike && (i = /* @__PURE__ */ l("s", { children: i })), t.underline && (i = /* @__PURE__ */ l("u", { children: i })), t.italic && (i = /* @__PURE__ */ l("em", { children: i })), t.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ l("span", {
|
|
623
627
|
style: {
|
|
624
628
|
...t.color && { color: t.color },
|
|
625
629
|
...t.background && { backgroundColor: t.background }
|
|
626
630
|
},
|
|
627
631
|
children: i
|
|
628
|
-
})), t.href && (i = /* @__PURE__ */
|
|
632
|
+
})), t.href && (i = /* @__PURE__ */ l("a", {
|
|
629
633
|
href: t.href,
|
|
630
634
|
target: t.target || void 0,
|
|
631
635
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
632
636
|
style: { color: t.color ?? "inherit" },
|
|
633
637
|
children: i
|
|
634
|
-
})), /* @__PURE__ */
|
|
638
|
+
})), /* @__PURE__ */ l(e, { children: i }, n);
|
|
635
639
|
}) : n;
|
|
636
640
|
}
|
|
637
|
-
function
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
style:
|
|
640
|
-
children: e?.length ? X(e, t) :
|
|
641
|
+
function ye({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
642
|
+
return /* @__PURE__ */ l("span", {
|
|
643
|
+
style: m(a),
|
|
644
|
+
children: e?.length ? X(e, t) : ve(t, n, r, i)
|
|
641
645
|
});
|
|
642
646
|
}
|
|
643
|
-
var
|
|
647
|
+
var be = {
|
|
644
648
|
h1: 40,
|
|
645
649
|
h2: 32,
|
|
646
650
|
h3: 26,
|
|
@@ -648,7 +652,7 @@ var ye = {
|
|
|
648
652
|
h5: 19,
|
|
649
653
|
h6: 16
|
|
650
654
|
};
|
|
651
|
-
function
|
|
655
|
+
function xe({ align: e = "center", width: t, wrap: n } = {}) {
|
|
652
656
|
let r = t ? `${t}%` : void 0;
|
|
653
657
|
if (e === "full") return { width: "100%" };
|
|
654
658
|
let i = e === "left" || e === "right";
|
|
@@ -682,7 +686,7 @@ function be({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
682
686
|
marginRight: "auto"
|
|
683
687
|
};
|
|
684
688
|
}
|
|
685
|
-
function
|
|
689
|
+
function Se(e = [], t, n) {
|
|
686
690
|
let r = n ?? ((e, n) => X(e, n, t));
|
|
687
691
|
return e.map((t, n) => {
|
|
688
692
|
let i = {
|
|
@@ -691,7 +695,7 @@ function xe(e = [], t, n) {
|
|
|
691
695
|
};
|
|
692
696
|
if (t.type === "image") {
|
|
693
697
|
if (!t.src) return null;
|
|
694
|
-
let e = /* @__PURE__ */
|
|
698
|
+
let e = /* @__PURE__ */ l("img", {
|
|
695
699
|
src: t.src,
|
|
696
700
|
alt: t.alt || "",
|
|
697
701
|
style: {
|
|
@@ -700,20 +704,20 @@ function xe(e = [], t, n) {
|
|
|
700
704
|
borderRadius: 6
|
|
701
705
|
}
|
|
702
706
|
});
|
|
703
|
-
return /* @__PURE__ */
|
|
707
|
+
return /* @__PURE__ */ u("figure", {
|
|
704
708
|
style: {
|
|
705
709
|
marginLeft: 0,
|
|
706
710
|
marginRight: 0,
|
|
707
711
|
...i,
|
|
708
|
-
...
|
|
712
|
+
...xe(t)
|
|
709
713
|
},
|
|
710
|
-
children: [t.href ? /* @__PURE__ */
|
|
714
|
+
children: [t.href ? /* @__PURE__ */ l("a", {
|
|
711
715
|
href: t.href,
|
|
712
716
|
target: t.target || void 0,
|
|
713
717
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
714
718
|
style: { display: "block" },
|
|
715
719
|
children: e
|
|
716
|
-
}) : e, t.caption && /* @__PURE__ */
|
|
720
|
+
}) : e, t.caption && /* @__PURE__ */ l("figcaption", {
|
|
717
721
|
style: {
|
|
718
722
|
fontSize: 13,
|
|
719
723
|
opacity: .65,
|
|
@@ -724,16 +728,16 @@ function xe(e = [], t, n) {
|
|
|
724
728
|
})]
|
|
725
729
|
}, n);
|
|
726
730
|
}
|
|
727
|
-
if (t.type === "video") return
|
|
731
|
+
if (t.type === "video") return Ne(t.url) ? /* @__PURE__ */ l("div", {
|
|
728
732
|
style: {
|
|
729
733
|
...i,
|
|
730
|
-
...
|
|
734
|
+
...xe({
|
|
731
735
|
align: t.align,
|
|
732
736
|
wrap: t.wrap,
|
|
733
737
|
width: t.width ?? 100
|
|
734
738
|
})
|
|
735
739
|
},
|
|
736
|
-
children: /* @__PURE__ */
|
|
740
|
+
children: /* @__PURE__ */ l(Pe, {
|
|
737
741
|
url: t.url,
|
|
738
742
|
autoplay: t.autoplay,
|
|
739
743
|
muted: t.muted,
|
|
@@ -742,43 +746,43 @@ function xe(e = [], t, n) {
|
|
|
742
746
|
start: t.start
|
|
743
747
|
})
|
|
744
748
|
}, n) : null;
|
|
745
|
-
if (t.type === "divider") return /* @__PURE__ */
|
|
749
|
+
if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
|
|
746
750
|
...i,
|
|
747
751
|
border: 0,
|
|
748
752
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
749
753
|
} }, n);
|
|
750
754
|
if (t.type === "ul" || t.type === "ol") {
|
|
751
755
|
let e = t.type;
|
|
752
|
-
return /* @__PURE__ */
|
|
756
|
+
return /* @__PURE__ */ l(e, {
|
|
753
757
|
style: {
|
|
754
758
|
...i,
|
|
755
759
|
paddingLeft: 24
|
|
756
760
|
},
|
|
757
|
-
children: (t.items ?? []).map((e, t) => /* @__PURE__ */
|
|
761
|
+
children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
|
|
758
762
|
style: { marginBottom: 4 },
|
|
759
763
|
children: r(e.parts, e.text)
|
|
760
764
|
}, t))
|
|
761
765
|
}, n);
|
|
762
766
|
}
|
|
763
|
-
if (t.type === "quote") return /* @__PURE__ */
|
|
767
|
+
if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
|
|
764
768
|
style: {
|
|
765
|
-
...
|
|
769
|
+
...we,
|
|
766
770
|
...i
|
|
767
771
|
},
|
|
768
772
|
children: r(t.parts, t.text)
|
|
769
773
|
}, n);
|
|
770
|
-
if (
|
|
774
|
+
if (be[t.type]) {
|
|
771
775
|
let e = t.type;
|
|
772
|
-
return /* @__PURE__ */
|
|
776
|
+
return /* @__PURE__ */ l(e, {
|
|
773
777
|
style: {
|
|
774
778
|
...q,
|
|
775
|
-
fontSize:
|
|
779
|
+
fontSize: be[t.type],
|
|
776
780
|
...i
|
|
777
781
|
},
|
|
778
782
|
children: r(t.parts, t.text)
|
|
779
783
|
}, n);
|
|
780
784
|
}
|
|
781
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ l("p", {
|
|
782
786
|
style: {
|
|
783
787
|
...J,
|
|
784
788
|
...i
|
|
@@ -787,101 +791,101 @@ function xe(e = [], t, n) {
|
|
|
787
791
|
}, n);
|
|
788
792
|
});
|
|
789
793
|
}
|
|
790
|
-
function
|
|
791
|
-
return /* @__PURE__ */
|
|
794
|
+
function Ce({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
795
|
+
return /* @__PURE__ */ l("div", {
|
|
792
796
|
ref: r,
|
|
793
797
|
style: {
|
|
794
798
|
display: "flow-root",
|
|
795
|
-
...
|
|
799
|
+
...m(t)
|
|
796
800
|
},
|
|
797
|
-
children:
|
|
801
|
+
children: Se(e, n)
|
|
798
802
|
});
|
|
799
803
|
}
|
|
800
|
-
var
|
|
804
|
+
var we = {
|
|
801
805
|
margin: 0,
|
|
802
806
|
padding: "8px 0 8px 20px",
|
|
803
807
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
804
808
|
};
|
|
805
|
-
function
|
|
806
|
-
return /* @__PURE__ */
|
|
809
|
+
function Te({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
810
|
+
return /* @__PURE__ */ l("blockquote", {
|
|
807
811
|
ref: i,
|
|
808
812
|
style: {
|
|
809
|
-
...
|
|
810
|
-
...
|
|
813
|
+
...we,
|
|
814
|
+
...m(n)
|
|
811
815
|
},
|
|
812
816
|
children: X(t, e, r)
|
|
813
817
|
});
|
|
814
818
|
}
|
|
815
|
-
function
|
|
816
|
-
return /* @__PURE__ */
|
|
819
|
+
function Ee({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
820
|
+
return /* @__PURE__ */ l(e ? "ol" : "ul", {
|
|
817
821
|
ref: r,
|
|
818
822
|
style: {
|
|
819
823
|
margin: 0,
|
|
820
824
|
paddingLeft: 24,
|
|
821
|
-
...
|
|
825
|
+
...m(n)
|
|
822
826
|
},
|
|
823
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
827
|
+
children: t.map((e, t) => /* @__PURE__ */ l("li", {
|
|
824
828
|
style: { marginBottom: 4 },
|
|
825
829
|
children: X(e.parts, e.text)
|
|
826
830
|
}, t))
|
|
827
831
|
});
|
|
828
832
|
}
|
|
829
|
-
function
|
|
830
|
-
return /* @__PURE__ */
|
|
833
|
+
function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
834
|
+
return /* @__PURE__ */ l("p", {
|
|
831
835
|
ref: i,
|
|
832
836
|
style: {
|
|
833
837
|
...J,
|
|
834
|
-
...
|
|
838
|
+
...m(n)
|
|
835
839
|
},
|
|
836
840
|
children: X(t, e, r)
|
|
837
841
|
});
|
|
838
842
|
}
|
|
839
|
-
var
|
|
843
|
+
var Oe = {
|
|
840
844
|
color: "var(--page-accent, inherit)",
|
|
841
845
|
textDecoration: "underline",
|
|
842
846
|
textUnderlineOffset: 3,
|
|
843
847
|
cursor: "pointer"
|
|
844
848
|
};
|
|
845
|
-
function
|
|
846
|
-
return /* @__PURE__ */
|
|
849
|
+
function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
850
|
+
return /* @__PURE__ */ l("a", {
|
|
847
851
|
ref: o,
|
|
848
852
|
href: n || "#",
|
|
849
853
|
target: r || void 0,
|
|
850
854
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
851
855
|
style: {
|
|
852
|
-
...
|
|
853
|
-
...
|
|
856
|
+
...Oe,
|
|
857
|
+
...m(i)
|
|
854
858
|
},
|
|
855
859
|
children: X(t, e, a)
|
|
856
860
|
});
|
|
857
861
|
}
|
|
858
|
-
function
|
|
859
|
-
return /* @__PURE__ */
|
|
862
|
+
function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
863
|
+
return /* @__PURE__ */ l("a", {
|
|
860
864
|
ref: o,
|
|
861
865
|
href: n || "#",
|
|
862
866
|
target: r || void 0,
|
|
863
867
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
864
868
|
style: {
|
|
865
869
|
...Y,
|
|
866
|
-
...
|
|
870
|
+
...m(i)
|
|
867
871
|
},
|
|
868
872
|
children: X(t, e, a)
|
|
869
873
|
});
|
|
870
874
|
}
|
|
871
|
-
function
|
|
872
|
-
return e ? /* @__PURE__ */
|
|
875
|
+
function je({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
876
|
+
return e ? /* @__PURE__ */ l("img", {
|
|
873
877
|
ref: r,
|
|
874
878
|
src: e,
|
|
875
879
|
alt: t || "",
|
|
876
880
|
style: {
|
|
877
881
|
display: "block",
|
|
878
882
|
maxWidth: "100%",
|
|
879
|
-
...
|
|
883
|
+
...m(n)
|
|
880
884
|
}
|
|
881
885
|
}) : null;
|
|
882
886
|
}
|
|
883
|
-
function
|
|
884
|
-
return e ? /* @__PURE__ */
|
|
887
|
+
function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
888
|
+
return e ? /* @__PURE__ */ l("video", {
|
|
885
889
|
ref: s,
|
|
886
890
|
src: e,
|
|
887
891
|
poster: t || void 0,
|
|
@@ -894,25 +898,25 @@ function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
894
898
|
display: "block",
|
|
895
899
|
width: "100%",
|
|
896
900
|
maxWidth: "100%",
|
|
897
|
-
...
|
|
901
|
+
...m(o)
|
|
898
902
|
}
|
|
899
903
|
}) : null;
|
|
900
904
|
}
|
|
901
|
-
var
|
|
902
|
-
function
|
|
903
|
-
let
|
|
904
|
-
if (!
|
|
905
|
+
var Ne = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
906
|
+
function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
907
|
+
let c = Ne(e);
|
|
908
|
+
if (!c) return null;
|
|
905
909
|
let u = new URLSearchParams({ rel: "0" });
|
|
906
|
-
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist",
|
|
910
|
+
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", c)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ l("div", {
|
|
907
911
|
ref: s,
|
|
908
912
|
style: {
|
|
909
913
|
position: "relative",
|
|
910
914
|
width: "100%",
|
|
911
915
|
paddingTop: "56.25%",
|
|
912
|
-
...
|
|
916
|
+
...m(o)
|
|
913
917
|
},
|
|
914
|
-
children: /* @__PURE__ */
|
|
915
|
-
src: `https://www.youtube-nocookie.com/embed/${
|
|
918
|
+
children: /* @__PURE__ */ l("iframe", {
|
|
919
|
+
src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
|
|
916
920
|
title: "YouTube video",
|
|
917
921
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
918
922
|
allowFullScreen: !0,
|
|
@@ -926,8 +930,8 @@ function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
926
930
|
})
|
|
927
931
|
});
|
|
928
932
|
}
|
|
929
|
-
function
|
|
930
|
-
return e ? /* @__PURE__ */
|
|
933
|
+
function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
934
|
+
return e ? /* @__PURE__ */ l("iframe", {
|
|
931
935
|
ref: i,
|
|
932
936
|
src: e,
|
|
933
937
|
title: t || "Embedded frame",
|
|
@@ -938,12 +942,12 @@ function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
938
942
|
width: "100%",
|
|
939
943
|
height: 300,
|
|
940
944
|
border: 0,
|
|
941
|
-
...
|
|
945
|
+
...m(r)
|
|
942
946
|
}
|
|
943
947
|
}) : null;
|
|
944
948
|
}
|
|
945
|
-
function
|
|
946
|
-
let [a,
|
|
949
|
+
function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
950
|
+
let [a, o] = s(null);
|
|
947
951
|
return r(() => {
|
|
948
952
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
949
953
|
let t = document.createElement("script");
|
|
@@ -954,15 +958,15 @@ function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
|
954
958
|
a,
|
|
955
959
|
e,
|
|
956
960
|
t
|
|
957
|
-
]), /* @__PURE__ */
|
|
961
|
+
]), /* @__PURE__ */ l("div", {
|
|
958
962
|
ref: (e) => {
|
|
959
|
-
|
|
963
|
+
o(e), i && i(e);
|
|
960
964
|
},
|
|
961
|
-
style:
|
|
965
|
+
style: m(n)
|
|
962
966
|
});
|
|
963
967
|
}
|
|
964
|
-
function
|
|
965
|
-
return /* @__PURE__ */
|
|
968
|
+
function Le({ height: e, nodeRef: t }) {
|
|
969
|
+
return /* @__PURE__ */ l("div", {
|
|
966
970
|
ref: t,
|
|
967
971
|
style: {
|
|
968
972
|
height: e || 32,
|
|
@@ -971,18 +975,18 @@ function Ie({ height: e, nodeRef: t }) {
|
|
|
971
975
|
}
|
|
972
976
|
});
|
|
973
977
|
}
|
|
974
|
-
function
|
|
975
|
-
return /* @__PURE__ */
|
|
978
|
+
function Re({ style: e, nodeRef: t }) {
|
|
979
|
+
return /* @__PURE__ */ l("div", {
|
|
976
980
|
ref: t,
|
|
977
981
|
style: {
|
|
978
982
|
height: 1,
|
|
979
983
|
alignSelf: "stretch",
|
|
980
984
|
flexShrink: 0,
|
|
981
|
-
...
|
|
985
|
+
...m(e)
|
|
982
986
|
}
|
|
983
987
|
});
|
|
984
988
|
}
|
|
985
|
-
var
|
|
989
|
+
var ze = {
|
|
986
990
|
position: "absolute",
|
|
987
991
|
top: "50%",
|
|
988
992
|
transform: "translateY(-50%)",
|
|
@@ -999,7 +1003,7 @@ var Re = {
|
|
|
999
1003
|
alignItems: "center",
|
|
1000
1004
|
justifyContent: "center",
|
|
1001
1005
|
padding: 0
|
|
1002
|
-
},
|
|
1006
|
+
}, Be = {
|
|
1003
1007
|
bottom: {
|
|
1004
1008
|
inset: "auto 0 0 0",
|
|
1005
1009
|
padding: "40px 24px 20px",
|
|
@@ -1018,9 +1022,9 @@ var Re = {
|
|
|
1018
1022
|
padding: 24,
|
|
1019
1023
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1020
1024
|
}
|
|
1021
|
-
},
|
|
1022
|
-
function
|
|
1023
|
-
let [
|
|
1025
|
+
}, Ve = 48;
|
|
1026
|
+
function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
|
|
1027
|
+
let [p, h] = s(0), [g, _] = s(!1), [v, y] = s(null), b = e ? Math.min(p, e - 1) : 0;
|
|
1024
1028
|
if (r(() => {
|
|
1025
1029
|
if (!n || g || v || e < 2) return;
|
|
1026
1030
|
let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
|
|
@@ -1035,13 +1039,13 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1035
1039
|
let x = (t) => h((t + e) % e), S = () => {
|
|
1036
1040
|
if (!v) return;
|
|
1037
1041
|
let { dx: e } = v;
|
|
1038
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
1042
|
+
y(null), e < -48 ? x(b + 1) : e > Ve && x(b - 1);
|
|
1039
1043
|
};
|
|
1040
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ u("div", {
|
|
1041
1045
|
ref: f,
|
|
1042
1046
|
onMouseEnter: () => _(!0),
|
|
1043
1047
|
onMouseLeave: () => _(!1),
|
|
1044
|
-
onPointerDown:
|
|
1048
|
+
onPointerDown: o && e > 1 ? (e) => {
|
|
1045
1049
|
e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
|
|
1046
1050
|
startX: e.clientX,
|
|
1047
1051
|
dx: 0
|
|
@@ -1060,16 +1064,16 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1060
1064
|
touchAction: "pan-y",
|
|
1061
1065
|
userSelect: v ? "none" : void 0,
|
|
1062
1066
|
cursor: v ? "grabbing" : void 0,
|
|
1063
|
-
...
|
|
1067
|
+
...m(d)
|
|
1064
1068
|
},
|
|
1065
|
-
children: [/* @__PURE__ */
|
|
1069
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1066
1070
|
style: {
|
|
1067
1071
|
display: "flex",
|
|
1068
1072
|
height: a,
|
|
1069
1073
|
transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
|
|
1070
1074
|
transition: v ? "none" : "transform 450ms ease"
|
|
1071
1075
|
},
|
|
1072
|
-
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */
|
|
1076
|
+
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
|
|
1073
1077
|
style: {
|
|
1074
1078
|
position: "relative",
|
|
1075
1079
|
width: "100%",
|
|
@@ -1078,28 +1082,28 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1078
1082
|
},
|
|
1079
1083
|
children: t(n)
|
|
1080
1084
|
}, n))
|
|
1081
|
-
}), e > 1 && /* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1085
|
+
}), e > 1 && /* @__PURE__ */ u(c, { children: [
|
|
1086
|
+
/* @__PURE__ */ l("button", {
|
|
1083
1087
|
type: "button",
|
|
1084
1088
|
"aria-label": "Previous slide",
|
|
1085
1089
|
style: {
|
|
1086
|
-
...
|
|
1090
|
+
...ze,
|
|
1087
1091
|
left: 12
|
|
1088
1092
|
},
|
|
1089
1093
|
onClick: () => x(b - 1),
|
|
1090
1094
|
children: "‹"
|
|
1091
1095
|
}),
|
|
1092
|
-
/* @__PURE__ */
|
|
1096
|
+
/* @__PURE__ */ l("button", {
|
|
1093
1097
|
type: "button",
|
|
1094
1098
|
"aria-label": "Next slide",
|
|
1095
1099
|
style: {
|
|
1096
|
-
...
|
|
1100
|
+
...ze,
|
|
1097
1101
|
right: 12
|
|
1098
1102
|
},
|
|
1099
1103
|
onClick: () => x(b + 1),
|
|
1100
1104
|
children: "›"
|
|
1101
1105
|
}),
|
|
1102
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ l("div", {
|
|
1103
1107
|
style: {
|
|
1104
1108
|
position: "absolute",
|
|
1105
1109
|
bottom: 10,
|
|
@@ -1109,7 +1113,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1109
1113
|
justifyContent: "center",
|
|
1110
1114
|
gap: 6
|
|
1111
1115
|
},
|
|
1112
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
1116
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
|
|
1113
1117
|
type: "button",
|
|
1114
1118
|
"aria-label": `Go to slide ${t + 1}`,
|
|
1115
1119
|
onClick: () => x(t),
|
|
@@ -1127,7 +1131,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1127
1131
|
] })]
|
|
1128
1132
|
});
|
|
1129
1133
|
}
|
|
1130
|
-
var
|
|
1134
|
+
var Ue = (e, t) => ({
|
|
1131
1135
|
position: "absolute",
|
|
1132
1136
|
inset: 0,
|
|
1133
1137
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1135,26 +1139,26 @@ var He = (e, t) => ({
|
|
|
1135
1139
|
backgroundSize: "cover",
|
|
1136
1140
|
backgroundPosition: "center"
|
|
1137
1141
|
});
|
|
1138
|
-
function
|
|
1139
|
-
return e.length ? /* @__PURE__ */
|
|
1142
|
+
function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1143
|
+
return e.length ? /* @__PURE__ */ l(He, {
|
|
1140
1144
|
...r,
|
|
1141
1145
|
count: e.length,
|
|
1142
1146
|
renderSlide: (r) => {
|
|
1143
1147
|
let i = e[r];
|
|
1144
|
-
return /* @__PURE__ */
|
|
1148
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
|
|
1145
1149
|
style: {
|
|
1146
1150
|
position: "absolute",
|
|
1147
1151
|
color: "#fff",
|
|
1148
1152
|
textAlign: n,
|
|
1149
|
-
...
|
|
1153
|
+
...Be[t] ?? Be.bottom
|
|
1150
1154
|
},
|
|
1151
|
-
children: [i.title && /* @__PURE__ */
|
|
1155
|
+
children: [i.title && /* @__PURE__ */ l("div", {
|
|
1152
1156
|
style: {
|
|
1153
1157
|
fontSize: 22,
|
|
1154
1158
|
fontWeight: 700
|
|
1155
1159
|
},
|
|
1156
1160
|
children: i.title
|
|
1157
|
-
}), i.text && /* @__PURE__ */
|
|
1161
|
+
}), i.text && /* @__PURE__ */ l("div", {
|
|
1158
1162
|
style: {
|
|
1159
1163
|
fontSize: 14,
|
|
1160
1164
|
opacity: .9,
|
|
@@ -1166,13 +1170,13 @@ function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1166
1170
|
}
|
|
1167
1171
|
}) : null;
|
|
1168
1172
|
}
|
|
1169
|
-
function
|
|
1170
|
-
return e.length ? /* @__PURE__ */
|
|
1173
|
+
function Ge({ slides: e = [], linked: t, ...n }) {
|
|
1174
|
+
return e.length ? /* @__PURE__ */ l(He, {
|
|
1171
1175
|
...n,
|
|
1172
1176
|
count: e.length,
|
|
1173
1177
|
renderSlide: (n) => {
|
|
1174
1178
|
let r = e[n];
|
|
1175
|
-
return /* @__PURE__ */
|
|
1179
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(r.image, r.color) }), /* @__PURE__ */ l("div", {
|
|
1176
1180
|
style: {
|
|
1177
1181
|
position: "absolute",
|
|
1178
1182
|
inset: 0,
|
|
@@ -1189,28 +1193,28 @@ var Z = {
|
|
|
1189
1193
|
textDecoration: "none",
|
|
1190
1194
|
fontSize: 14,
|
|
1191
1195
|
opacity: .85
|
|
1192
|
-
},
|
|
1196
|
+
}, Ke = {
|
|
1193
1197
|
background: "var(--page-bg, #ffffff)",
|
|
1194
1198
|
color: "var(--page-text, #111827)",
|
|
1195
1199
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1196
1200
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1197
1201
|
zIndex: 60
|
|
1198
1202
|
};
|
|
1199
|
-
function
|
|
1200
|
-
let [f,
|
|
1203
|
+
function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
|
|
1204
|
+
let [f, p] = s(null), [h, g] = s(!1), [_, v] = s(!1), [y, b] = s(null);
|
|
1201
1205
|
r(() => {
|
|
1202
1206
|
if (!f) return;
|
|
1203
1207
|
let e = new ResizeObserver(() => g(f.offsetWidth < d));
|
|
1204
1208
|
return e.observe(f), () => e.disconnect();
|
|
1205
1209
|
}, [f, d]);
|
|
1206
|
-
let x =
|
|
1210
|
+
let x = c === "hamburger" || c === "auto" && h, S = (e, t) => /* @__PURE__ */ u("a", {
|
|
1207
1211
|
href: e.href || "#",
|
|
1208
1212
|
style: {
|
|
1209
1213
|
...Z,
|
|
1210
1214
|
display: "block",
|
|
1211
1215
|
...t
|
|
1212
1216
|
},
|
|
1213
|
-
children: [e.label, e.desc && /* @__PURE__ */
|
|
1217
|
+
children: [e.label, e.desc && /* @__PURE__ */ l("span", {
|
|
1214
1218
|
style: {
|
|
1215
1219
|
display: "block",
|
|
1216
1220
|
fontSize: 12,
|
|
@@ -1220,9 +1224,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1220
1224
|
children: e.desc
|
|
1221
1225
|
})]
|
|
1222
1226
|
}, e.key);
|
|
1223
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ u("nav", {
|
|
1224
1228
|
ref: (e) => {
|
|
1225
|
-
|
|
1229
|
+
p(e), o && o(e);
|
|
1226
1230
|
},
|
|
1227
1231
|
style: {
|
|
1228
1232
|
display: "flex",
|
|
@@ -1232,10 +1236,10 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1232
1236
|
padding: "14px 24px",
|
|
1233
1237
|
width: "100%",
|
|
1234
1238
|
position: "relative",
|
|
1235
|
-
...
|
|
1239
|
+
...m(a)
|
|
1236
1240
|
},
|
|
1237
1241
|
children: [
|
|
1238
|
-
n && /* @__PURE__ */
|
|
1242
|
+
n && /* @__PURE__ */ l("img", {
|
|
1239
1243
|
src: n,
|
|
1240
1244
|
alt: t || "Logo",
|
|
1241
1245
|
style: {
|
|
@@ -1243,7 +1247,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1243
1247
|
display: "block"
|
|
1244
1248
|
}
|
|
1245
1249
|
}),
|
|
1246
|
-
t && /* @__PURE__ */
|
|
1250
|
+
t && /* @__PURE__ */ l("div", {
|
|
1247
1251
|
style: {
|
|
1248
1252
|
fontWeight: 700,
|
|
1249
1253
|
fontSize: 18,
|
|
@@ -1251,8 +1255,8 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1251
1255
|
},
|
|
1252
1256
|
children: t
|
|
1253
1257
|
}),
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
x ? /* @__PURE__ */
|
|
1258
|
+
/* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
|
|
1259
|
+
x ? /* @__PURE__ */ l("button", {
|
|
1256
1260
|
type: "button",
|
|
1257
1261
|
"aria-label": _ ? "Close menu" : "Open menu",
|
|
1258
1262
|
onClick: () => v(!_),
|
|
@@ -1266,7 +1270,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1266
1270
|
padding: 4
|
|
1267
1271
|
},
|
|
1268
1272
|
children: _ ? "✕" : "☰"
|
|
1269
|
-
}) : /* @__PURE__ */
|
|
1273
|
+
}) : /* @__PURE__ */ l("div", {
|
|
1270
1274
|
style: {
|
|
1271
1275
|
display: "flex",
|
|
1272
1276
|
gap: 20,
|
|
@@ -1275,20 +1279,20 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1275
1279
|
},
|
|
1276
1280
|
children: i.map((e) => {
|
|
1277
1281
|
let t = e.children ?? [];
|
|
1278
|
-
if (!t.length) return /* @__PURE__ */
|
|
1282
|
+
if (!t.length) return /* @__PURE__ */ l("a", {
|
|
1279
1283
|
href: e.href || "#",
|
|
1280
1284
|
style: Z,
|
|
1281
1285
|
children: e.label
|
|
1282
1286
|
}, e.key);
|
|
1283
1287
|
let n = e.type === "mega";
|
|
1284
|
-
return /* @__PURE__ */
|
|
1288
|
+
return /* @__PURE__ */ u("span", {
|
|
1285
1289
|
style: {
|
|
1286
1290
|
position: n ? "static" : "relative",
|
|
1287
1291
|
display: "inline-flex"
|
|
1288
1292
|
},
|
|
1289
1293
|
onMouseEnter: () => b(e.key),
|
|
1290
1294
|
onMouseLeave: () => b(null),
|
|
1291
|
-
children: [/* @__PURE__ */
|
|
1295
|
+
children: [/* @__PURE__ */ u("a", {
|
|
1292
1296
|
href: e.href || "#",
|
|
1293
1297
|
style: {
|
|
1294
1298
|
...Z,
|
|
@@ -1297,7 +1301,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1297
1301
|
children: [
|
|
1298
1302
|
e.label,
|
|
1299
1303
|
" ",
|
|
1300
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ l("span", {
|
|
1301
1305
|
style: {
|
|
1302
1306
|
fontSize: 9,
|
|
1303
1307
|
opacity: .6
|
|
@@ -1305,9 +1309,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1305
1309
|
children: "▼"
|
|
1306
1310
|
})
|
|
1307
1311
|
]
|
|
1308
|
-
}), y === e.key && (n ? /* @__PURE__ */
|
|
1312
|
+
}), y === e.key && (n ? /* @__PURE__ */ l("div", {
|
|
1309
1313
|
style: {
|
|
1310
|
-
...
|
|
1314
|
+
...Ke,
|
|
1311
1315
|
position: "absolute",
|
|
1312
1316
|
left: 0,
|
|
1313
1317
|
right: 0,
|
|
@@ -1321,9 +1325,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1321
1325
|
padding: "6px 8px",
|
|
1322
1326
|
borderRadius: 6
|
|
1323
1327
|
}))
|
|
1324
|
-
}) : /* @__PURE__ */
|
|
1328
|
+
}) : /* @__PURE__ */ l("div", {
|
|
1325
1329
|
style: {
|
|
1326
|
-
...
|
|
1330
|
+
...Ke,
|
|
1327
1331
|
position: "absolute",
|
|
1328
1332
|
top: "100%",
|
|
1329
1333
|
left: 0,
|
|
@@ -1341,7 +1345,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1341
1345
|
}, e.key);
|
|
1342
1346
|
})
|
|
1343
1347
|
}),
|
|
1344
|
-
x && _ && /* @__PURE__ */
|
|
1348
|
+
x && _ && /* @__PURE__ */ l("div", {
|
|
1345
1349
|
style: {
|
|
1346
1350
|
flexBasis: "100%",
|
|
1347
1351
|
width: "100%",
|
|
@@ -1349,7 +1353,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1349
1353
|
flexDirection: "column",
|
|
1350
1354
|
paddingTop: 10
|
|
1351
1355
|
},
|
|
1352
|
-
children: i.map((t) => /* @__PURE__ */
|
|
1356
|
+
children: i.map((t) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l("a", {
|
|
1353
1357
|
href: t.href || "#",
|
|
1354
1358
|
style: {
|
|
1355
1359
|
...Z,
|
|
@@ -1363,21 +1367,21 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
|
|
|
1363
1367
|
]
|
|
1364
1368
|
});
|
|
1365
1369
|
}
|
|
1366
|
-
function
|
|
1367
|
-
let [i, a] =
|
|
1368
|
-
return e.length ? /* @__PURE__ */
|
|
1370
|
+
function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1371
|
+
let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1372
|
+
return e.length ? /* @__PURE__ */ u("div", {
|
|
1369
1373
|
ref: r,
|
|
1370
1374
|
style: {
|
|
1371
1375
|
width: "100%",
|
|
1372
|
-
...
|
|
1376
|
+
...m(n)
|
|
1373
1377
|
},
|
|
1374
|
-
children: [/* @__PURE__ */
|
|
1378
|
+
children: [/* @__PURE__ */ l("div", {
|
|
1375
1379
|
style: {
|
|
1376
1380
|
display: "flex",
|
|
1377
1381
|
gap: 4,
|
|
1378
1382
|
borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
|
|
1379
1383
|
},
|
|
1380
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1384
|
+
children: e.map((e, t) => /* @__PURE__ */ l("button", {
|
|
1381
1385
|
type: "button",
|
|
1382
1386
|
onClick: () => a(t),
|
|
1383
1387
|
style: {
|
|
@@ -1388,41 +1392,41 @@ function qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1388
1392
|
fontFamily: "inherit",
|
|
1389
1393
|
color: "inherit",
|
|
1390
1394
|
cursor: "pointer",
|
|
1391
|
-
opacity: t ===
|
|
1392
|
-
fontWeight: t ===
|
|
1393
|
-
boxShadow: t ===
|
|
1395
|
+
opacity: t === o ? 1 : .6,
|
|
1396
|
+
fontWeight: t === o ? 600 : 500,
|
|
1397
|
+
boxShadow: t === o ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
|
|
1394
1398
|
},
|
|
1395
1399
|
children: e.label || `Tab ${t + 1}`
|
|
1396
1400
|
}, e.key))
|
|
1397
|
-
}), e.map((e, n) => /* @__PURE__ */
|
|
1401
|
+
}), e.map((e, n) => /* @__PURE__ */ l("div", {
|
|
1398
1402
|
style: {
|
|
1399
|
-
display: n ===
|
|
1403
|
+
display: n === o ? "flex" : "none",
|
|
1400
1404
|
flexDirection: "column"
|
|
1401
1405
|
},
|
|
1402
1406
|
children: t?.[e.key] ?? null
|
|
1403
1407
|
}, e.key))]
|
|
1404
1408
|
}) : null;
|
|
1405
1409
|
}
|
|
1406
|
-
function
|
|
1407
|
-
let [a,
|
|
1410
|
+
function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1411
|
+
let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
|
|
1408
1412
|
if (!e.length) return null;
|
|
1409
|
-
let
|
|
1413
|
+
let c = (e) => o((t) => {
|
|
1410
1414
|
let r = new Set(n ? t : []);
|
|
1411
1415
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
1412
1416
|
});
|
|
1413
|
-
return /* @__PURE__ */
|
|
1417
|
+
return /* @__PURE__ */ l("div", {
|
|
1414
1418
|
ref: i,
|
|
1415
1419
|
style: {
|
|
1416
1420
|
width: "100%",
|
|
1417
|
-
...
|
|
1421
|
+
...m(r)
|
|
1418
1422
|
},
|
|
1419
1423
|
children: e.map((n, r) => {
|
|
1420
1424
|
let i = a.has(n.key);
|
|
1421
|
-
return /* @__PURE__ */
|
|
1425
|
+
return /* @__PURE__ */ u("div", {
|
|
1422
1426
|
style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
|
|
1423
|
-
children: [/* @__PURE__ */
|
|
1427
|
+
children: [/* @__PURE__ */ u("button", {
|
|
1424
1428
|
type: "button",
|
|
1425
|
-
onClick: () =>
|
|
1429
|
+
onClick: () => c(n.key),
|
|
1426
1430
|
style: {
|
|
1427
1431
|
width: "100%",
|
|
1428
1432
|
display: "flex",
|
|
@@ -1439,7 +1443,7 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1439
1443
|
textAlign: "left",
|
|
1440
1444
|
cursor: "pointer"
|
|
1441
1445
|
},
|
|
1442
|
-
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */
|
|
1446
|
+
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
|
|
1443
1447
|
"aria-hidden": !0,
|
|
1444
1448
|
style: {
|
|
1445
1449
|
fontSize: 12,
|
|
@@ -1449,7 +1453,7 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1449
1453
|
},
|
|
1450
1454
|
children: "▼"
|
|
1451
1455
|
})]
|
|
1452
|
-
}), /* @__PURE__ */
|
|
1456
|
+
}), /* @__PURE__ */ l("div", {
|
|
1453
1457
|
style: {
|
|
1454
1458
|
display: i ? "flex" : "none",
|
|
1455
1459
|
flexDirection: "column"
|
|
@@ -1460,11 +1464,11 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1460
1464
|
})
|
|
1461
1465
|
});
|
|
1462
1466
|
}
|
|
1463
|
-
var
|
|
1467
|
+
var Xe = {
|
|
1464
1468
|
display: "flex",
|
|
1465
1469
|
flexDirection: "column",
|
|
1466
1470
|
gap: "12px"
|
|
1467
|
-
},
|
|
1471
|
+
}, Ze = {
|
|
1468
1472
|
fontSize: "14px",
|
|
1469
1473
|
fontWeight: 500,
|
|
1470
1474
|
color: "var(--page-text, #111827)"
|
|
@@ -1478,18 +1482,18 @@ var Ye = {
|
|
|
1478
1482
|
boxSizing: "border-box",
|
|
1479
1483
|
backgroundColor: "#ffffff",
|
|
1480
1484
|
color: "#111827"
|
|
1481
|
-
},
|
|
1485
|
+
}, Qe = {
|
|
1482
1486
|
display: "flex",
|
|
1483
1487
|
alignItems: "center",
|
|
1484
1488
|
gap: "8px",
|
|
1485
1489
|
fontSize: "14px",
|
|
1486
1490
|
color: "var(--page-text, #111827)"
|
|
1487
|
-
},
|
|
1491
|
+
}, $e = (e) => e ? {
|
|
1488
1492
|
readOnly: !0,
|
|
1489
1493
|
tabIndex: -1,
|
|
1490
1494
|
onMouseDown: (e) => e.preventDefault()
|
|
1491
1495
|
} : {};
|
|
1492
|
-
function
|
|
1496
|
+
function et(e, t) {
|
|
1493
1497
|
if (!e) return !0;
|
|
1494
1498
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1495
1499
|
switch (e.op) {
|
|
@@ -1503,11 +1507,11 @@ function $e(e, t) {
|
|
|
1503
1507
|
default: return !1;
|
|
1504
1508
|
}
|
|
1505
1509
|
}
|
|
1506
|
-
var
|
|
1510
|
+
var tt = {
|
|
1507
1511
|
display: "flex",
|
|
1508
1512
|
flexDirection: "column",
|
|
1509
1513
|
gap: 6
|
|
1510
|
-
},
|
|
1514
|
+
}, nt = {
|
|
1511
1515
|
font: "inherit",
|
|
1512
1516
|
fontSize: 15,
|
|
1513
1517
|
padding: "10px 12px",
|
|
@@ -1518,23 +1522,29 @@ var et = {
|
|
|
1518
1522
|
width: "100%",
|
|
1519
1523
|
boxSizing: "border-box"
|
|
1520
1524
|
};
|
|
1521
|
-
function
|
|
1522
|
-
let
|
|
1525
|
+
function rt(e, t) {
|
|
1526
|
+
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1527
|
+
if (!e?.parentField) return n;
|
|
1528
|
+
let r = t?.[e.parentField];
|
|
1529
|
+
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1530
|
+
}
|
|
1531
|
+
function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1532
|
+
let a = /* @__PURE__ */ u("span", {
|
|
1523
1533
|
style: {
|
|
1524
|
-
...
|
|
1534
|
+
...Ze,
|
|
1525
1535
|
fontSize: 14
|
|
1526
1536
|
},
|
|
1527
1537
|
children: [e.label, e.required ? " *" : ""]
|
|
1528
|
-
}),
|
|
1538
|
+
}), o = {
|
|
1529
1539
|
name: e.name,
|
|
1530
1540
|
required: e.required || void 0,
|
|
1531
1541
|
placeholder: e.placeholder || void 0,
|
|
1532
1542
|
disabled: r || void 0,
|
|
1533
|
-
style:
|
|
1543
|
+
style: nt,
|
|
1534
1544
|
value: t ?? "",
|
|
1535
1545
|
onChange: (t) => n(e.name, t.target.value)
|
|
1536
1546
|
};
|
|
1537
|
-
return e.type === "display" ? /* @__PURE__ */
|
|
1547
|
+
return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
|
|
1538
1548
|
style: {
|
|
1539
1549
|
margin: 0,
|
|
1540
1550
|
color: e.color || "inherit",
|
|
@@ -1551,7 +1561,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1551
1561
|
lineHeight: 1.35
|
|
1552
1562
|
},
|
|
1553
1563
|
children: e.label
|
|
1554
|
-
}) : e.type === "image" ? e.src ? /* @__PURE__ */
|
|
1564
|
+
}) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
|
|
1555
1565
|
src: e.src,
|
|
1556
1566
|
alt: e.label ?? "",
|
|
1557
1567
|
style: {
|
|
@@ -1559,10 +1569,10 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1559
1569
|
borderRadius: 8,
|
|
1560
1570
|
display: "block"
|
|
1561
1571
|
}
|
|
1562
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */
|
|
1572
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Pe, {
|
|
1563
1573
|
url: e.src,
|
|
1564
1574
|
style: { width: "100%" }
|
|
1565
|
-
}) : /* @__PURE__ */
|
|
1575
|
+
}) : /* @__PURE__ */ l("video", {
|
|
1566
1576
|
src: e.src,
|
|
1567
1577
|
controls: !0,
|
|
1568
1578
|
style: {
|
|
@@ -1570,27 +1580,28 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1570
1580
|
borderRadius: 8,
|
|
1571
1581
|
display: "block"
|
|
1572
1582
|
}
|
|
1573
|
-
}) : null : /* @__PURE__ */
|
|
1574
|
-
style:
|
|
1583
|
+
}) : null : /* @__PURE__ */ u("label", {
|
|
1584
|
+
style: tt,
|
|
1575
1585
|
children: [
|
|
1576
|
-
|
|
1577
|
-
e.type === "textarea" || e.multiline ? /* @__PURE__ */
|
|
1578
|
-
...
|
|
1586
|
+
a,
|
|
1587
|
+
e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
|
|
1588
|
+
...o,
|
|
1579
1589
|
rows: 4,
|
|
1580
1590
|
style: {
|
|
1581
|
-
...
|
|
1591
|
+
...nt,
|
|
1582
1592
|
resize: "vertical"
|
|
1583
1593
|
}
|
|
1584
|
-
}) : e.type === "select" ? /* @__PURE__ */
|
|
1585
|
-
...
|
|
1586
|
-
|
|
1594
|
+
}) : e.type === "select" ? /* @__PURE__ */ u("select", {
|
|
1595
|
+
...o,
|
|
1596
|
+
disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
|
|
1597
|
+
children: [/* @__PURE__ */ l("option", {
|
|
1587
1598
|
value: "",
|
|
1588
1599
|
children: e.placeholder || "—"
|
|
1589
|
-
}), (e
|
|
1600
|
+
}), rt(e, i).map((e, t) => /* @__PURE__ */ l("option", {
|
|
1590
1601
|
value: typeof e == "string" ? e : e.value,
|
|
1591
1602
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1592
1603
|
}, t))]
|
|
1593
|
-
}) : e.type === "checkbox" ? /* @__PURE__ */
|
|
1604
|
+
}) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
|
|
1594
1605
|
type: "checkbox",
|
|
1595
1606
|
name: e.name,
|
|
1596
1607
|
required: e.required || void 0,
|
|
@@ -1601,7 +1612,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1601
1612
|
width: 18,
|
|
1602
1613
|
height: 18
|
|
1603
1614
|
}
|
|
1604
|
-
}) : e.type === "upload" ? /* @__PURE__ */
|
|
1615
|
+
}) : e.type === "upload" ? /* @__PURE__ */ l("input", {
|
|
1605
1616
|
type: "file",
|
|
1606
1617
|
name: e.name,
|
|
1607
1618
|
accept: e.accept || void 0,
|
|
@@ -1612,8 +1623,8 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1612
1623
|
font: "inherit",
|
|
1613
1624
|
fontSize: 14
|
|
1614
1625
|
}
|
|
1615
|
-
}) : /* @__PURE__ */
|
|
1616
|
-
...
|
|
1626
|
+
}) : /* @__PURE__ */ l("input", {
|
|
1627
|
+
...o,
|
|
1617
1628
|
type: {
|
|
1618
1629
|
email: "email",
|
|
1619
1630
|
number: "number",
|
|
@@ -1623,7 +1634,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1623
1634
|
link: "url"
|
|
1624
1635
|
}[e.type] ?? "text"
|
|
1625
1636
|
}),
|
|
1626
|
-
e.help && /* @__PURE__ */
|
|
1637
|
+
e.help && /* @__PURE__ */ l("span", {
|
|
1627
1638
|
style: {
|
|
1628
1639
|
fontSize: 12,
|
|
1629
1640
|
opacity: .65
|
|
@@ -1633,8 +1644,8 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
|
|
|
1633
1644
|
]
|
|
1634
1645
|
});
|
|
1635
1646
|
}
|
|
1636
|
-
function
|
|
1637
|
-
let { tenant: b, apiUrl: x } = n(
|
|
1647
|
+
function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
|
|
1648
|
+
let { tenant: b, apiUrl: x } = n(V), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = g ? y || "form" : S;
|
|
1638
1649
|
r(() => {
|
|
1639
1650
|
if (!f || !d) return;
|
|
1640
1651
|
let e = !0;
|
|
@@ -1655,25 +1666,29 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1655
1666
|
section: e,
|
|
1656
1667
|
fields: []
|
|
1657
1668
|
}) : j[j.length - 1].fields.push(e);
|
|
1658
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1669
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
|
|
1659
1670
|
...e,
|
|
1660
|
-
fields: e.fields.filter((e) =>
|
|
1671
|
+
fields: e.fields.filter((e) => et(e.condition, E))
|
|
1661
1672
|
})), 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) => {
|
|
1662
1673
|
let t = E[e.name];
|
|
1663
1674
|
return e.required && (t == null || t === "" || t === !1);
|
|
1664
|
-
}),
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1675
|
+
}), ee = F >= N.length - 1, R = (e, t) => D((n) => {
|
|
1676
|
+
let r = {
|
|
1677
|
+
...n,
|
|
1678
|
+
[e]: t
|
|
1679
|
+
};
|
|
1680
|
+
for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
|
|
1681
|
+
return r;
|
|
1682
|
+
});
|
|
1683
|
+
return /* @__PURE__ */ u("div", {
|
|
1669
1684
|
ref: h,
|
|
1670
|
-
style:
|
|
1685
|
+
style: m(e),
|
|
1671
1686
|
children: [
|
|
1672
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ l("form", {
|
|
1673
1688
|
action: t || void 0,
|
|
1674
1689
|
method: i || "post",
|
|
1675
1690
|
name: a || void 0,
|
|
1676
|
-
encType:
|
|
1691
|
+
encType: o || void 0,
|
|
1677
1692
|
onSubmit: async (e) => {
|
|
1678
1693
|
if (e.preventDefault(), !g) {
|
|
1679
1694
|
if (d) {
|
|
@@ -1711,16 +1726,16 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1711
1726
|
}
|
|
1712
1727
|
},
|
|
1713
1728
|
style: {
|
|
1714
|
-
...
|
|
1729
|
+
...Xe,
|
|
1715
1730
|
display: A === "success" ? "none" : "flex"
|
|
1716
1731
|
},
|
|
1717
|
-
children: f && d ? /* @__PURE__ */
|
|
1718
|
-
P && /* @__PURE__ */
|
|
1732
|
+
children: f && d ? /* @__PURE__ */ u(c, { children: [
|
|
1733
|
+
P && /* @__PURE__ */ l(_t, {
|
|
1719
1734
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1720
1735
|
active: F + 1,
|
|
1721
1736
|
style: { marginBottom: 8 }
|
|
1722
1737
|
}),
|
|
1723
|
-
P && N[F]?.section?.help && /* @__PURE__ */
|
|
1738
|
+
P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
|
|
1724
1739
|
style: {
|
|
1725
1740
|
margin: 0,
|
|
1726
1741
|
fontSize: 14,
|
|
@@ -1728,20 +1743,21 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1728
1743
|
},
|
|
1729
1744
|
children: N[F].section.help
|
|
1730
1745
|
}),
|
|
1731
|
-
I.map((e) => /* @__PURE__ */
|
|
1746
|
+
I.map((e) => /* @__PURE__ */ l(it, {
|
|
1732
1747
|
field: e,
|
|
1733
1748
|
value: E[e.name],
|
|
1734
|
-
|
|
1749
|
+
values: E,
|
|
1750
|
+
onChange: R,
|
|
1735
1751
|
inert: g
|
|
1736
1752
|
}, e.name)),
|
|
1737
|
-
/* @__PURE__ */
|
|
1753
|
+
/* @__PURE__ */ u("div", {
|
|
1738
1754
|
style: {
|
|
1739
1755
|
display: "flex",
|
|
1740
1756
|
gap: 10,
|
|
1741
1757
|
alignItems: "center",
|
|
1742
1758
|
marginTop: 4
|
|
1743
1759
|
},
|
|
1744
|
-
children: [P && F > 0 && /* @__PURE__ */
|
|
1760
|
+
children: [P && F > 0 && /* @__PURE__ */ l("button", {
|
|
1745
1761
|
type: "button",
|
|
1746
1762
|
disabled: g || void 0,
|
|
1747
1763
|
onClick: () => k(F - 1),
|
|
@@ -1754,7 +1770,7 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1754
1770
|
cursor: "pointer"
|
|
1755
1771
|
},
|
|
1756
1772
|
children: "Back"
|
|
1757
|
-
}), P && !
|
|
1773
|
+
}), P && !ee ? /* @__PURE__ */ l("button", {
|
|
1758
1774
|
type: "button",
|
|
1759
1775
|
disabled: g || L.length > 0,
|
|
1760
1776
|
onClick: () => k(F + 1),
|
|
@@ -1769,7 +1785,7 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1769
1785
|
opacity: L.length ? .5 : 1
|
|
1770
1786
|
},
|
|
1771
1787
|
children: "Next"
|
|
1772
|
-
}) : /* @__PURE__ */
|
|
1788
|
+
}) : /* @__PURE__ */ l("button", {
|
|
1773
1789
|
type: "submit",
|
|
1774
1790
|
disabled: g || void 0,
|
|
1775
1791
|
style: {
|
|
@@ -1781,16 +1797,16 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1781
1797
|
fontWeight: 600,
|
|
1782
1798
|
cursor: "pointer"
|
|
1783
1799
|
},
|
|
1784
|
-
children:
|
|
1800
|
+
children: p || "Submit"
|
|
1785
1801
|
})]
|
|
1786
1802
|
})
|
|
1787
1803
|
] }) : _
|
|
1788
1804
|
}),
|
|
1789
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ l("div", {
|
|
1790
1806
|
style: { display: A === "success" ? "block" : "none" },
|
|
1791
1807
|
children: v?.success ?? null
|
|
1792
1808
|
}),
|
|
1793
|
-
/* @__PURE__ */
|
|
1809
|
+
/* @__PURE__ */ l("div", {
|
|
1794
1810
|
style: {
|
|
1795
1811
|
display: A === "error" ? "block" : "none",
|
|
1796
1812
|
marginTop: 12
|
|
@@ -1800,18 +1816,18 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
|
|
|
1800
1816
|
]
|
|
1801
1817
|
});
|
|
1802
1818
|
}
|
|
1803
|
-
function
|
|
1804
|
-
return /* @__PURE__ */
|
|
1819
|
+
function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1820
|
+
return /* @__PURE__ */ l("label", {
|
|
1805
1821
|
ref: r,
|
|
1806
1822
|
style: {
|
|
1807
|
-
...
|
|
1808
|
-
...
|
|
1823
|
+
...Ze,
|
|
1824
|
+
...m(n)
|
|
1809
1825
|
},
|
|
1810
1826
|
children: X(t, e, i)
|
|
1811
1827
|
});
|
|
1812
1828
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return /* @__PURE__ */
|
|
1829
|
+
function st({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1830
|
+
return /* @__PURE__ */ l("input", {
|
|
1815
1831
|
ref: a,
|
|
1816
1832
|
type: e,
|
|
1817
1833
|
name: t || void 0,
|
|
@@ -1819,13 +1835,13 @@ function at({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1819
1835
|
required: !o && !!r,
|
|
1820
1836
|
style: {
|
|
1821
1837
|
...Q,
|
|
1822
|
-
...
|
|
1838
|
+
...m(i)
|
|
1823
1839
|
},
|
|
1824
|
-
|
|
1840
|
+
...$e(o)
|
|
1825
1841
|
});
|
|
1826
1842
|
}
|
|
1827
|
-
function
|
|
1828
|
-
return /* @__PURE__ */
|
|
1843
|
+
function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1844
|
+
return /* @__PURE__ */ l("textarea", {
|
|
1829
1845
|
ref: a,
|
|
1830
1846
|
name: e || void 0,
|
|
1831
1847
|
placeholder: t,
|
|
@@ -1834,19 +1850,19 @@ function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1834
1850
|
style: {
|
|
1835
1851
|
...Q,
|
|
1836
1852
|
resize: "vertical",
|
|
1837
|
-
...
|
|
1853
|
+
...m(i)
|
|
1838
1854
|
},
|
|
1839
|
-
|
|
1855
|
+
...$e(o)
|
|
1840
1856
|
});
|
|
1841
1857
|
}
|
|
1842
|
-
function
|
|
1843
|
-
return /* @__PURE__ */
|
|
1858
|
+
function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1859
|
+
return /* @__PURE__ */ u("label", {
|
|
1844
1860
|
ref: o,
|
|
1845
1861
|
style: {
|
|
1846
|
-
...
|
|
1847
|
-
...
|
|
1862
|
+
...Qe,
|
|
1863
|
+
...m(a)
|
|
1848
1864
|
},
|
|
1849
|
-
children: [/* @__PURE__ */
|
|
1865
|
+
children: [/* @__PURE__ */ l("input", {
|
|
1850
1866
|
type: e,
|
|
1851
1867
|
name: n || void 0,
|
|
1852
1868
|
value: r || void 0,
|
|
@@ -1860,8 +1876,8 @@ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1860
1876
|
}), t]
|
|
1861
1877
|
});
|
|
1862
1878
|
}
|
|
1863
|
-
function
|
|
1864
|
-
return /* @__PURE__ */
|
|
1879
|
+
function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1880
|
+
return /* @__PURE__ */ u("select", {
|
|
1865
1881
|
ref: a,
|
|
1866
1882
|
name: e || void 0,
|
|
1867
1883
|
required: !o && !!r,
|
|
@@ -1871,52 +1887,52 @@ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1871
1887
|
style: {
|
|
1872
1888
|
...Q,
|
|
1873
1889
|
appearance: "auto",
|
|
1874
|
-
...
|
|
1890
|
+
...m(i)
|
|
1875
1891
|
},
|
|
1876
|
-
children: [t !== "" && /* @__PURE__ */
|
|
1892
|
+
children: [t !== "" && /* @__PURE__ */ l("option", {
|
|
1877
1893
|
value: "",
|
|
1878
1894
|
disabled: !0,
|
|
1879
1895
|
children: t ?? "Select…"
|
|
1880
|
-
}), n.map((e, t) => /* @__PURE__ */
|
|
1896
|
+
}), n.map((e, t) => /* @__PURE__ */ l("option", {
|
|
1881
1897
|
value: e,
|
|
1882
1898
|
children: e
|
|
1883
1899
|
}, t))]
|
|
1884
1900
|
});
|
|
1885
1901
|
}
|
|
1886
|
-
function
|
|
1887
|
-
let [
|
|
1888
|
-
return /* @__PURE__ */
|
|
1902
|
+
function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1903
|
+
let [c, d] = s(null);
|
|
1904
|
+
return /* @__PURE__ */ u("label", {
|
|
1889
1905
|
ref: a,
|
|
1890
1906
|
style: {
|
|
1891
1907
|
...Q,
|
|
1892
1908
|
display: "flex",
|
|
1893
1909
|
alignItems: "center",
|
|
1894
1910
|
gap: "8px",
|
|
1895
|
-
cursor:
|
|
1911
|
+
cursor: o ? "default" : "pointer",
|
|
1896
1912
|
borderStyle: "dashed",
|
|
1897
|
-
color:
|
|
1898
|
-
...
|
|
1913
|
+
color: c ? "#111827" : "#6b7280",
|
|
1914
|
+
...m(i)
|
|
1899
1915
|
},
|
|
1900
1916
|
children: [
|
|
1901
|
-
/* @__PURE__ */
|
|
1917
|
+
/* @__PURE__ */ l("input", {
|
|
1902
1918
|
type: "file",
|
|
1903
1919
|
name: e || void 0,
|
|
1904
1920
|
accept: t || void 0,
|
|
1905
|
-
required: !
|
|
1906
|
-
disabled: !!
|
|
1921
|
+
required: !o && !!n,
|
|
1922
|
+
disabled: !!o,
|
|
1907
1923
|
onChange: (e) => d(e.target.files?.[0]?.name ?? null),
|
|
1908
1924
|
style: { display: "none" }
|
|
1909
1925
|
}),
|
|
1910
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ l("span", {
|
|
1911
1927
|
"aria-hidden": !0,
|
|
1912
1928
|
children: "📎"
|
|
1913
1929
|
}),
|
|
1914
|
-
|
|
1930
|
+
c ?? r
|
|
1915
1931
|
]
|
|
1916
1932
|
});
|
|
1917
1933
|
}
|
|
1918
|
-
function
|
|
1919
|
-
return /* @__PURE__ */
|
|
1934
|
+
function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1935
|
+
return /* @__PURE__ */ l("button", {
|
|
1920
1936
|
ref: n,
|
|
1921
1937
|
type: r ? "button" : "submit",
|
|
1922
1938
|
style: {
|
|
@@ -1930,72 +1946,76 @@ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1930
1946
|
fontWeight: 600,
|
|
1931
1947
|
lineHeight: 1.4,
|
|
1932
1948
|
fontFamily: "inherit",
|
|
1933
|
-
...
|
|
1949
|
+
...m(t)
|
|
1934
1950
|
},
|
|
1935
1951
|
children: e
|
|
1936
1952
|
});
|
|
1937
1953
|
}
|
|
1938
|
-
function
|
|
1954
|
+
function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1939
1955
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1940
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ l("div", {
|
|
1941
1957
|
ref: r,
|
|
1942
1958
|
style: {
|
|
1943
1959
|
display: "grid",
|
|
1944
1960
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
1945
1961
|
gap: 16,
|
|
1946
1962
|
width: "100%",
|
|
1947
|
-
...
|
|
1963
|
+
...m(n)
|
|
1948
1964
|
},
|
|
1949
|
-
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */
|
|
1965
|
+
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
|
|
1950
1966
|
style: { minWidth: 0 },
|
|
1951
1967
|
children: i?.[`cell-${t}`] ?? null
|
|
1952
1968
|
}, t))
|
|
1953
1969
|
});
|
|
1954
1970
|
}
|
|
1955
|
-
function
|
|
1956
|
-
let { tenant: _, apiUrl: v } = n(
|
|
1971
|
+
function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: h, nodeRef: g }) {
|
|
1972
|
+
let { tenant: _, apiUrl: v, locale: y } = n(V), b = n(U), x = n(H)?.[e], [S, C] = s(null);
|
|
1957
1973
|
if (r(() => {
|
|
1958
|
-
if (!e ||
|
|
1959
|
-
let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
|
|
1960
|
-
return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) =>
|
|
1974
|
+
if (!e || x) return;
|
|
1975
|
+
let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
|
|
1976
|
+
return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
|
|
1977
|
+
let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
1978
|
+
return t && C(n.filter((e) => e && typeof e == "object"));
|
|
1979
|
+
}).catch(() => t && C([])), () => {
|
|
1961
1980
|
t = !1;
|
|
1962
1981
|
};
|
|
1963
1982
|
}, [
|
|
1964
1983
|
e,
|
|
1965
1984
|
_,
|
|
1966
1985
|
v,
|
|
1967
|
-
|
|
1986
|
+
y,
|
|
1987
|
+
x
|
|
1968
1988
|
]), !e) return null;
|
|
1969
|
-
let
|
|
1989
|
+
let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = i === "list" ? {
|
|
1970
1990
|
display: "flex",
|
|
1971
1991
|
flexDirection: "column",
|
|
1972
1992
|
gap: 20
|
|
1973
1993
|
} : {
|
|
1974
1994
|
display: "grid",
|
|
1975
|
-
gridTemplateColumns: `repeat(${
|
|
1995
|
+
gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
|
|
1976
1996
|
gap: 24
|
|
1977
1997
|
};
|
|
1978
|
-
return f &&
|
|
1998
|
+
return f && p && b?.render ? /* @__PURE__ */ l("div", {
|
|
1979
1999
|
ref: g,
|
|
1980
2000
|
style: {
|
|
1981
2001
|
width: "100%",
|
|
1982
|
-
...
|
|
1983
|
-
...
|
|
2002
|
+
...E,
|
|
2003
|
+
...m(h)
|
|
1984
2004
|
},
|
|
1985
|
-
children:
|
|
2005
|
+
children: w.map((e) => /* @__PURE__ */ l("div", {
|
|
1986
2006
|
style: { minWidth: 0 },
|
|
1987
|
-
children:
|
|
2007
|
+
children: b.render(p, (t) => ce(t, e))
|
|
1988
2008
|
}, e.id ?? e?.data?.slug))
|
|
1989
|
-
}) : /* @__PURE__ */
|
|
2009
|
+
}) : /* @__PURE__ */ l("div", {
|
|
1990
2010
|
ref: g,
|
|
1991
2011
|
style: {
|
|
1992
2012
|
width: "100%",
|
|
1993
|
-
...
|
|
1994
|
-
...
|
|
2013
|
+
...E,
|
|
2014
|
+
...m(h)
|
|
1995
2015
|
},
|
|
1996
|
-
children:
|
|
1997
|
-
let t =
|
|
1998
|
-
return /* @__PURE__ */
|
|
2016
|
+
children: w.map((e) => {
|
|
2017
|
+
let t = o ? W(e?.data, o) : null, n = c ? K(W(e?.data, c)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, s = a || r == null ? null : K(r), f = i === "list";
|
|
2018
|
+
return /* @__PURE__ */ u("div", {
|
|
1999
2019
|
style: {
|
|
2000
2020
|
display: "flex",
|
|
2001
2021
|
flexDirection: f ? "row" : "column",
|
|
@@ -2003,7 +2023,7 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2003
2023
|
alignItems: f ? "center" : "stretch",
|
|
2004
2024
|
minWidth: 0
|
|
2005
2025
|
},
|
|
2006
|
-
children: [t && /* @__PURE__ */
|
|
2026
|
+
children: [t && /* @__PURE__ */ l("img", {
|
|
2007
2027
|
src: t,
|
|
2008
2028
|
alt: n ?? "",
|
|
2009
2029
|
style: {
|
|
@@ -2014,10 +2034,10 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2014
2034
|
flexShrink: 0,
|
|
2015
2035
|
display: "block"
|
|
2016
2036
|
}
|
|
2017
|
-
}), /* @__PURE__ */
|
|
2037
|
+
}), /* @__PURE__ */ u("div", {
|
|
2018
2038
|
style: { minWidth: 0 },
|
|
2019
2039
|
children: [
|
|
2020
|
-
n && /* @__PURE__ */
|
|
2040
|
+
n && /* @__PURE__ */ l("h3", {
|
|
2021
2041
|
style: {
|
|
2022
2042
|
margin: 0,
|
|
2023
2043
|
fontSize: 18,
|
|
@@ -2025,23 +2045,23 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2025
2045
|
},
|
|
2026
2046
|
children: n
|
|
2027
2047
|
}),
|
|
2028
|
-
|
|
2048
|
+
s && /* @__PURE__ */ l("p", {
|
|
2029
2049
|
style: {
|
|
2030
2050
|
margin: "6px 0 0",
|
|
2031
2051
|
fontSize: 14,
|
|
2032
2052
|
lineHeight: 1.55,
|
|
2033
2053
|
opacity: .75
|
|
2034
2054
|
},
|
|
2035
|
-
children:
|
|
2055
|
+
children: s
|
|
2036
2056
|
}),
|
|
2037
|
-
a && /* @__PURE__ */
|
|
2057
|
+
a && /* @__PURE__ */ l("div", {
|
|
2038
2058
|
style: {
|
|
2039
2059
|
marginTop: 6,
|
|
2040
2060
|
fontSize: 14,
|
|
2041
2061
|
lineHeight: 1.55,
|
|
2042
2062
|
opacity: .85
|
|
2043
2063
|
},
|
|
2044
|
-
children:
|
|
2064
|
+
children: Se(a)
|
|
2045
2065
|
})
|
|
2046
2066
|
]
|
|
2047
2067
|
})]
|
|
@@ -2049,12 +2069,12 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2049
2069
|
})
|
|
2050
2070
|
});
|
|
2051
2071
|
}
|
|
2052
|
-
function
|
|
2053
|
-
return e.length ? /* @__PURE__ */
|
|
2072
|
+
function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2073
|
+
return e.length ? /* @__PURE__ */ l("nav", {
|
|
2054
2074
|
ref: r,
|
|
2055
2075
|
"aria-label": "Breadcrumb",
|
|
2056
|
-
style: { ...
|
|
2057
|
-
children: /* @__PURE__ */
|
|
2076
|
+
style: { ...m(n) },
|
|
2077
|
+
children: /* @__PURE__ */ l("ol", {
|
|
2058
2078
|
style: {
|
|
2059
2079
|
display: "flex",
|
|
2060
2080
|
flexWrap: "wrap",
|
|
@@ -2067,25 +2087,25 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2067
2087
|
},
|
|
2068
2088
|
children: e.map((n, r) => {
|
|
2069
2089
|
let i = r === e.length - 1;
|
|
2070
|
-
return /* @__PURE__ */
|
|
2090
|
+
return /* @__PURE__ */ u("li", {
|
|
2071
2091
|
style: {
|
|
2072
2092
|
display: "flex",
|
|
2073
2093
|
alignItems: "center",
|
|
2074
2094
|
gap: 8,
|
|
2075
2095
|
minWidth: 0
|
|
2076
2096
|
},
|
|
2077
|
-
children: [r > 0 && /* @__PURE__ */
|
|
2097
|
+
children: [r > 0 && /* @__PURE__ */ l("span", {
|
|
2078
2098
|
style: { opacity: .4 },
|
|
2079
2099
|
"aria-hidden": !0,
|
|
2080
2100
|
children: t
|
|
2081
|
-
}), i || !n.href ? /* @__PURE__ */
|
|
2101
|
+
}), i || !n.href ? /* @__PURE__ */ l("span", {
|
|
2082
2102
|
style: {
|
|
2083
2103
|
fontWeight: i ? 600 : 400,
|
|
2084
2104
|
opacity: i ? 1 : .7
|
|
2085
2105
|
},
|
|
2086
2106
|
"aria-current": i ? "page" : void 0,
|
|
2087
2107
|
children: n.label
|
|
2088
|
-
}) : /* @__PURE__ */
|
|
2108
|
+
}) : /* @__PURE__ */ l("a", {
|
|
2089
2109
|
href: n.href,
|
|
2090
2110
|
style: {
|
|
2091
2111
|
color: "inherit",
|
|
@@ -2099,8 +2119,8 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2099
2119
|
})
|
|
2100
2120
|
}) : null;
|
|
2101
2121
|
}
|
|
2102
|
-
function
|
|
2103
|
-
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o),
|
|
2122
|
+
function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
2123
|
+
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
|
|
2104
2124
|
display: "inline-flex",
|
|
2105
2125
|
alignItems: "center",
|
|
2106
2126
|
justifyContent: "center",
|
|
@@ -2114,7 +2134,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2114
2134
|
background: e ? "var(--page-accent, #111827)" : "transparent",
|
|
2115
2135
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2116
2136
|
});
|
|
2117
|
-
return /* @__PURE__ */
|
|
2137
|
+
return /* @__PURE__ */ u("nav", {
|
|
2118
2138
|
ref: a,
|
|
2119
2139
|
"aria-label": "Pagination",
|
|
2120
2140
|
style: {
|
|
@@ -2122,11 +2142,11 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2122
2142
|
flexWrap: "wrap",
|
|
2123
2143
|
gap: 8,
|
|
2124
2144
|
alignItems: "center",
|
|
2125
|
-
...
|
|
2145
|
+
...m(i)
|
|
2126
2146
|
},
|
|
2127
2147
|
children: [
|
|
2128
|
-
n && /* @__PURE__ */
|
|
2129
|
-
href: s > 1 ?
|
|
2148
|
+
n && /* @__PURE__ */ l("a", {
|
|
2149
|
+
href: s > 1 ? c(s - 1) : "#",
|
|
2130
2150
|
"aria-label": "Previous",
|
|
2131
2151
|
style: {
|
|
2132
2152
|
...d(!1),
|
|
@@ -2134,14 +2154,14 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2134
2154
|
},
|
|
2135
2155
|
children: "‹"
|
|
2136
2156
|
}),
|
|
2137
|
-
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */
|
|
2138
|
-
href:
|
|
2157
|
+
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
|
|
2158
|
+
href: c(e),
|
|
2139
2159
|
"aria-current": e === s ? "page" : void 0,
|
|
2140
2160
|
style: d(e === s),
|
|
2141
2161
|
children: e
|
|
2142
2162
|
}, e)),
|
|
2143
|
-
n && /* @__PURE__ */
|
|
2144
|
-
href: s < o ?
|
|
2163
|
+
n && /* @__PURE__ */ l("a", {
|
|
2164
|
+
href: s < o ? c(s + 1) : "#",
|
|
2145
2165
|
"aria-label": "Next",
|
|
2146
2166
|
style: {
|
|
2147
2167
|
...d(!1),
|
|
@@ -2152,7 +2172,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2152
2172
|
]
|
|
2153
2173
|
});
|
|
2154
2174
|
}
|
|
2155
|
-
function
|
|
2175
|
+
function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2156
2176
|
if (!t.length) return null;
|
|
2157
2177
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
2158
2178
|
width: 32,
|
|
@@ -2169,7 +2189,7 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2169
2189
|
border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
|
|
2170
2190
|
opacity: e === "todo" ? .6 : 1,
|
|
2171
2191
|
boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
|
|
2172
|
-
}),
|
|
2192
|
+
}), c = (e) => ({
|
|
2173
2193
|
flexGrow: 1,
|
|
2174
2194
|
alignSelf: "center",
|
|
2175
2195
|
background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
|
|
@@ -2183,21 +2203,21 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2183
2203
|
minWidth: 24
|
|
2184
2204
|
}
|
|
2185
2205
|
});
|
|
2186
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ l("div", {
|
|
2187
2207
|
ref: a,
|
|
2188
2208
|
style: {
|
|
2189
2209
|
display: "flex",
|
|
2190
2210
|
flexDirection: r ? "column" : "row",
|
|
2191
2211
|
alignItems: r ? "stretch" : "flex-start",
|
|
2192
2212
|
gap: r ? 4 : 8,
|
|
2193
|
-
...
|
|
2213
|
+
...m(i)
|
|
2194
2214
|
},
|
|
2195
2215
|
children: t.map((t, n) => {
|
|
2196
2216
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
2197
|
-
return /* @__PURE__ */
|
|
2198
|
-
style:
|
|
2217
|
+
return /* @__PURE__ */ u(e, { children: [n > 0 && /* @__PURE__ */ l("div", {
|
|
2218
|
+
style: c(i <= o),
|
|
2199
2219
|
"aria-hidden": !0
|
|
2200
|
-
}), /* @__PURE__ */
|
|
2220
|
+
}), /* @__PURE__ */ u("div", {
|
|
2201
2221
|
style: {
|
|
2202
2222
|
display: "flex",
|
|
2203
2223
|
flexDirection: r ? "row" : "column",
|
|
@@ -2206,19 +2226,19 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2206
2226
|
minWidth: 0,
|
|
2207
2227
|
textAlign: r ? "left" : "center"
|
|
2208
2228
|
},
|
|
2209
|
-
children: [/* @__PURE__ */
|
|
2229
|
+
children: [/* @__PURE__ */ l("div", {
|
|
2210
2230
|
style: s(a),
|
|
2211
2231
|
children: a === "done" ? "✓" : i
|
|
2212
|
-
}), /* @__PURE__ */
|
|
2232
|
+
}), /* @__PURE__ */ u("div", {
|
|
2213
2233
|
style: { minWidth: 0 },
|
|
2214
|
-
children: [/* @__PURE__ */
|
|
2234
|
+
children: [/* @__PURE__ */ l("div", {
|
|
2215
2235
|
style: {
|
|
2216
2236
|
fontSize: 13,
|
|
2217
2237
|
fontWeight: a === "active" ? 700 : 500,
|
|
2218
2238
|
opacity: a === "todo" ? .6 : 1
|
|
2219
2239
|
},
|
|
2220
2240
|
children: t.label
|
|
2221
|
-
}), t.description && /* @__PURE__ */
|
|
2241
|
+
}), t.description && /* @__PURE__ */ l("div", {
|
|
2222
2242
|
style: {
|
|
2223
2243
|
fontSize: 12,
|
|
2224
2244
|
opacity: .6
|
|
@@ -2230,8 +2250,422 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2230
2250
|
})
|
|
2231
2251
|
});
|
|
2232
2252
|
}
|
|
2233
|
-
|
|
2234
|
-
|
|
2253
|
+
var vt = {
|
|
2254
|
+
small: {
|
|
2255
|
+
w: 132,
|
|
2256
|
+
h: 46,
|
|
2257
|
+
name: 11.5,
|
|
2258
|
+
title: 10,
|
|
2259
|
+
avatar: 28
|
|
2260
|
+
},
|
|
2261
|
+
medium: {
|
|
2262
|
+
w: 168,
|
|
2263
|
+
h: 56,
|
|
2264
|
+
name: 13,
|
|
2265
|
+
title: 11,
|
|
2266
|
+
avatar: 36
|
|
2267
|
+
},
|
|
2268
|
+
large: {
|
|
2269
|
+
w: 210,
|
|
2270
|
+
h: 70,
|
|
2271
|
+
name: 15.5,
|
|
2272
|
+
title: 12.5,
|
|
2273
|
+
avatar: 46
|
|
2274
|
+
}
|
|
2275
|
+
}, yt = (e) => vt[e] ?? vt.medium;
|
|
2276
|
+
vt.medium.w, vt.medium.h;
|
|
2277
|
+
function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2278
|
+
let r = yt(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 = [];
|
|
2279
|
+
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);
|
|
2280
|
+
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2281
|
+
if (t.has(e.id)) return 0;
|
|
2282
|
+
t.add(e.id);
|
|
2283
|
+
let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
|
|
2284
|
+
return d.set(e.id, r), r;
|
|
2285
|
+
};
|
|
2286
|
+
u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
|
|
2287
|
+
let p = [], m = [], h = 0, g = (e, t, s, c) => {
|
|
2288
|
+
if (c.has(e.id)) return;
|
|
2289
|
+
c.add(e.id);
|
|
2290
|
+
let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
|
|
2291
|
+
p.push({
|
|
2292
|
+
node: e,
|
|
2293
|
+
x: _,
|
|
2294
|
+
y: v
|
|
2295
|
+
}), h = Math.max(h, f + (n ? r.w : r.h));
|
|
2296
|
+
let y = t;
|
|
2297
|
+
for (let t of l.get(e.id) ?? []) {
|
|
2298
|
+
let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
|
|
2299
|
+
m.push(n ? {
|
|
2300
|
+
from: {
|
|
2301
|
+
x: f + r.w,
|
|
2302
|
+
y: u + r.h / 2
|
|
2303
|
+
},
|
|
2304
|
+
to: {
|
|
2305
|
+
x: l,
|
|
2306
|
+
y: e
|
|
2307
|
+
}
|
|
2308
|
+
} : {
|
|
2309
|
+
from: {
|
|
2310
|
+
x: u + r.w / 2,
|
|
2311
|
+
y: f + r.h
|
|
2312
|
+
},
|
|
2313
|
+
to: {
|
|
2314
|
+
x: e,
|
|
2315
|
+
y: l
|
|
2316
|
+
}
|
|
2317
|
+
}), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
|
|
2318
|
+
}
|
|
2319
|
+
}, _ = 0, v = /* @__PURE__ */ new Set();
|
|
2320
|
+
for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
|
|
2321
|
+
let y = Math.max(_ - a, i);
|
|
2322
|
+
return {
|
|
2323
|
+
boxes: p,
|
|
2324
|
+
links: m,
|
|
2325
|
+
width: n ? Math.max(h, r.w) : y,
|
|
2326
|
+
height: n ? y : Math.max(h, r.h),
|
|
2327
|
+
horizontal: n
|
|
2328
|
+
};
|
|
2329
|
+
}
|
|
2330
|
+
var xt = (e, t) => {
|
|
2331
|
+
let n = String(e ?? "");
|
|
2332
|
+
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2333
|
+
}, St = (e) => {
|
|
2334
|
+
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2335
|
+
if (!t) return "#ffffff";
|
|
2336
|
+
let n = t[1];
|
|
2337
|
+
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2338
|
+
let r = parseInt(n, 16);
|
|
2339
|
+
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2340
|
+
}, Ct = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2341
|
+
function wt(e, t = {}) {
|
|
2342
|
+
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 ? "" : K(e);
|
|
2343
|
+
return n.map((e) => {
|
|
2344
|
+
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
2345
|
+
return {
|
|
2346
|
+
id: e.id,
|
|
2347
|
+
name: i(n[t.nameField || "name"]) || i(n.name) || "Untitled",
|
|
2348
|
+
title: t.titleField ? i(n[t.titleField]) : "",
|
|
2349
|
+
photo: t.photoField && r(n[t.photoField]) || "",
|
|
2350
|
+
parent: t.parentField ? o : null,
|
|
2351
|
+
cv: t.cvField ? i(n[t.cvField]) : "",
|
|
2352
|
+
href: t.hrefField ? i(n[t.hrefField]) : ""
|
|
2353
|
+
};
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
var Tt = {
|
|
2357
|
+
size: 36,
|
|
2358
|
+
pad: 10
|
|
2359
|
+
};
|
|
2360
|
+
function Et({ node: e, onClose: t }) {
|
|
2361
|
+
return r(() => {
|
|
2362
|
+
let e = (e) => e.key === "Escape" && t();
|
|
2363
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2364
|
+
}, [t]), /* @__PURE__ */ l("div", {
|
|
2365
|
+
onClick: t,
|
|
2366
|
+
role: "dialog",
|
|
2367
|
+
"aria-modal": "true",
|
|
2368
|
+
"aria-label": e.name,
|
|
2369
|
+
style: {
|
|
2370
|
+
position: "fixed",
|
|
2371
|
+
inset: 0,
|
|
2372
|
+
zIndex: 1e3,
|
|
2373
|
+
background: "rgba(15, 23, 42, 0.55)",
|
|
2374
|
+
display: "flex",
|
|
2375
|
+
alignItems: "center",
|
|
2376
|
+
justifyContent: "center",
|
|
2377
|
+
padding: 16
|
|
2378
|
+
},
|
|
2379
|
+
children: /* @__PURE__ */ u("div", {
|
|
2380
|
+
onClick: (e) => e.stopPropagation(),
|
|
2381
|
+
style: {
|
|
2382
|
+
background: "var(--page-bg, #ffffff)",
|
|
2383
|
+
color: "var(--page-text, #111827)",
|
|
2384
|
+
borderRadius: 14,
|
|
2385
|
+
maxWidth: 420,
|
|
2386
|
+
width: "100%",
|
|
2387
|
+
maxHeight: "80vh",
|
|
2388
|
+
overflowY: "auto",
|
|
2389
|
+
padding: 24,
|
|
2390
|
+
position: "relative",
|
|
2391
|
+
boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
|
|
2392
|
+
},
|
|
2393
|
+
children: [
|
|
2394
|
+
/* @__PURE__ */ l("button", {
|
|
2395
|
+
type: "button",
|
|
2396
|
+
"aria-label": "Close",
|
|
2397
|
+
onClick: t,
|
|
2398
|
+
style: {
|
|
2399
|
+
position: "absolute",
|
|
2400
|
+
top: 10,
|
|
2401
|
+
right: 10,
|
|
2402
|
+
width: 30,
|
|
2403
|
+
height: 30,
|
|
2404
|
+
border: 0,
|
|
2405
|
+
borderRadius: 8,
|
|
2406
|
+
background: "transparent",
|
|
2407
|
+
color: "inherit",
|
|
2408
|
+
fontSize: 18,
|
|
2409
|
+
lineHeight: 1,
|
|
2410
|
+
cursor: "pointer",
|
|
2411
|
+
opacity: .6
|
|
2412
|
+
},
|
|
2413
|
+
children: "×"
|
|
2414
|
+
}),
|
|
2415
|
+
/* @__PURE__ */ u("div", {
|
|
2416
|
+
style: {
|
|
2417
|
+
display: "flex",
|
|
2418
|
+
alignItems: "center",
|
|
2419
|
+
gap: 14,
|
|
2420
|
+
marginBottom: e.cv ? 14 : 0
|
|
2421
|
+
},
|
|
2422
|
+
children: [e.photo && /* @__PURE__ */ l("img", {
|
|
2423
|
+
src: e.photo,
|
|
2424
|
+
alt: "",
|
|
2425
|
+
style: {
|
|
2426
|
+
width: 72,
|
|
2427
|
+
height: 72,
|
|
2428
|
+
borderRadius: "50%",
|
|
2429
|
+
objectFit: "cover",
|
|
2430
|
+
flexShrink: 0
|
|
2431
|
+
}
|
|
2432
|
+
}), /* @__PURE__ */ u("div", {
|
|
2433
|
+
style: { minWidth: 0 },
|
|
2434
|
+
children: [/* @__PURE__ */ l("div", {
|
|
2435
|
+
style: {
|
|
2436
|
+
fontSize: 18,
|
|
2437
|
+
fontWeight: 700
|
|
2438
|
+
},
|
|
2439
|
+
children: e.name
|
|
2440
|
+
}), e.title && /* @__PURE__ */ l("div", {
|
|
2441
|
+
style: {
|
|
2442
|
+
fontSize: 13,
|
|
2443
|
+
opacity: .65
|
|
2444
|
+
},
|
|
2445
|
+
children: e.title
|
|
2446
|
+
})]
|
|
2447
|
+
})]
|
|
2448
|
+
}),
|
|
2449
|
+
e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
|
|
2450
|
+
style: {
|
|
2451
|
+
fontSize: 14,
|
|
2452
|
+
lineHeight: 1.6,
|
|
2453
|
+
margin: "0 0 10px"
|
|
2454
|
+
},
|
|
2455
|
+
children: e
|
|
2456
|
+
}, t)),
|
|
2457
|
+
e.href && /* @__PURE__ */ l("a", {
|
|
2458
|
+
href: e.href,
|
|
2459
|
+
target: "_blank",
|
|
2460
|
+
rel: "noopener noreferrer",
|
|
2461
|
+
style: {
|
|
2462
|
+
display: "inline-block",
|
|
2463
|
+
marginTop: 6,
|
|
2464
|
+
padding: "8px 14px",
|
|
2465
|
+
borderRadius: 8,
|
|
2466
|
+
fontSize: 13,
|
|
2467
|
+
fontWeight: 600,
|
|
2468
|
+
textDecoration: "none",
|
|
2469
|
+
background: "var(--page-accent, #4f46e5)",
|
|
2470
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
2471
|
+
},
|
|
2472
|
+
children: "Open profile ↗"
|
|
2473
|
+
})
|
|
2474
|
+
]
|
|
2475
|
+
})
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: h, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
|
|
2479
|
+
let x = i(), [S, C] = s(null), { tenant: w, apiUrl: T } = n(V), E = n(H)?.[t], [D, O] = s(null);
|
|
2480
|
+
r(() => {
|
|
2481
|
+
if (!t || E) return;
|
|
2482
|
+
let e = !0;
|
|
2483
|
+
return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
|
|
2484
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
2485
|
+
e && O(n);
|
|
2486
|
+
}).catch(() => e && O([])), () => {
|
|
2487
|
+
e = !1;
|
|
2488
|
+
};
|
|
2489
|
+
}, [
|
|
2490
|
+
t,
|
|
2491
|
+
w,
|
|
2492
|
+
T,
|
|
2493
|
+
E
|
|
2494
|
+
]);
|
|
2495
|
+
let k = t ? wt(E ?? D ?? [], {
|
|
2496
|
+
nameField: a,
|
|
2497
|
+
titleField: o,
|
|
2498
|
+
photoField: d,
|
|
2499
|
+
parentField: f,
|
|
2500
|
+
cvField: p,
|
|
2501
|
+
hrefField: h
|
|
2502
|
+
}) : e, A = yt(g), { boxes: j, links: M, width: N, height: P } = bt(k, {
|
|
2503
|
+
size: g,
|
|
2504
|
+
horizontal: _
|
|
2505
|
+
});
|
|
2506
|
+
if (!j.length) return !b && t ? /* @__PURE__ */ u("div", {
|
|
2507
|
+
ref: y,
|
|
2508
|
+
style: {
|
|
2509
|
+
padding: 18,
|
|
2510
|
+
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
2511
|
+
borderRadius: 10,
|
|
2512
|
+
fontSize: 13,
|
|
2513
|
+
opacity: .7,
|
|
2514
|
+
textAlign: "center",
|
|
2515
|
+
...m(v)
|
|
2516
|
+
},
|
|
2517
|
+
children: [
|
|
2518
|
+
"Org Chart — no published entries in “",
|
|
2519
|
+
t,
|
|
2520
|
+
"” yet"
|
|
2521
|
+
]
|
|
2522
|
+
}) : null;
|
|
2523
|
+
let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
2524
|
+
return /* @__PURE__ */ u("div", {
|
|
2525
|
+
ref: y,
|
|
2526
|
+
style: {
|
|
2527
|
+
maxWidth: "100%",
|
|
2528
|
+
overflowX: "auto",
|
|
2529
|
+
...m(v)
|
|
2530
|
+
},
|
|
2531
|
+
children: [/* @__PURE__ */ u("svg", {
|
|
2532
|
+
viewBox: `0 0 ${N} ${P}`,
|
|
2533
|
+
role: "img",
|
|
2534
|
+
"aria-label": "Organization chart",
|
|
2535
|
+
style: {
|
|
2536
|
+
display: "block",
|
|
2537
|
+
width: "100%",
|
|
2538
|
+
maxWidth: N,
|
|
2539
|
+
height: "auto",
|
|
2540
|
+
margin: "0 auto"
|
|
2541
|
+
},
|
|
2542
|
+
children: [M.map((e, t) => /* @__PURE__ */ l("path", {
|
|
2543
|
+
d: _ ? `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}`,
|
|
2544
|
+
fill: "none",
|
|
2545
|
+
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2546
|
+
strokeWidth: "1.5"
|
|
2547
|
+
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2548
|
+
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 ? St(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? St(e.color2) : s, f = b && (Ct(e) || e.href), p = () => Ct(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tt.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);
|
|
2549
|
+
return /* @__PURE__ */ u("g", {
|
|
2550
|
+
onClick: f ? p : void 0,
|
|
2551
|
+
style: f ? { cursor: "pointer" } : void 0,
|
|
2552
|
+
role: f ? "button" : void 0,
|
|
2553
|
+
"aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
2554
|
+
children: [
|
|
2555
|
+
i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
|
|
2556
|
+
id: `${x}-${e.id}-grad`,
|
|
2557
|
+
x1: "0",
|
|
2558
|
+
y1: "0",
|
|
2559
|
+
x2: "0",
|
|
2560
|
+
y2: "1",
|
|
2561
|
+
children: [/* @__PURE__ */ l("stop", {
|
|
2562
|
+
offset: "0%",
|
|
2563
|
+
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
2564
|
+
}), /* @__PURE__ */ l("stop", {
|
|
2565
|
+
offset: "100%",
|
|
2566
|
+
stopColor: e.color2
|
|
2567
|
+
})]
|
|
2568
|
+
}), /* @__PURE__ */ l("rect", {
|
|
2569
|
+
x: t,
|
|
2570
|
+
y: n,
|
|
2571
|
+
width: A.w,
|
|
2572
|
+
height: A.h,
|
|
2573
|
+
rx: "10",
|
|
2574
|
+
fill: `url(#${x}-${e.id}-grad)`
|
|
2575
|
+
})] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
|
|
2576
|
+
id: `${x}-${e.id}-box`,
|
|
2577
|
+
children: /* @__PURE__ */ l("rect", {
|
|
2578
|
+
x: t,
|
|
2579
|
+
y: n,
|
|
2580
|
+
width: A.w,
|
|
2581
|
+
height: A.h,
|
|
2582
|
+
rx: "10"
|
|
2583
|
+
})
|
|
2584
|
+
}), /* @__PURE__ */ u("g", {
|
|
2585
|
+
clipPath: `url(#${x}-${e.id}-box)`,
|
|
2586
|
+
children: [/* @__PURE__ */ l("rect", {
|
|
2587
|
+
x: t,
|
|
2588
|
+
y: n,
|
|
2589
|
+
width: A.w,
|
|
2590
|
+
height: _,
|
|
2591
|
+
fill: o
|
|
2592
|
+
}), /* @__PURE__ */ l("rect", {
|
|
2593
|
+
x: t,
|
|
2594
|
+
y: n + _,
|
|
2595
|
+
width: A.w,
|
|
2596
|
+
height: A.h - _,
|
|
2597
|
+
fill: e.color2
|
|
2598
|
+
})]
|
|
2599
|
+
})] }) : /* @__PURE__ */ l("rect", {
|
|
2600
|
+
x: t,
|
|
2601
|
+
y: n,
|
|
2602
|
+
width: A.w,
|
|
2603
|
+
height: A.h,
|
|
2604
|
+
rx: "10",
|
|
2605
|
+
fill: o,
|
|
2606
|
+
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
2607
|
+
strokeWidth: a ? 0 : 1.5
|
|
2608
|
+
}),
|
|
2609
|
+
e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
|
|
2610
|
+
id: `${x}-${e.id}`,
|
|
2611
|
+
children: /* @__PURE__ */ l("circle", {
|
|
2612
|
+
cx: t + Tt.pad + A.avatar / 2,
|
|
2613
|
+
cy: n + A.h / 2,
|
|
2614
|
+
r: A.avatar / 2
|
|
2615
|
+
})
|
|
2616
|
+
}), /* @__PURE__ */ l("image", {
|
|
2617
|
+
href: e.photo,
|
|
2618
|
+
x: t + Tt.pad,
|
|
2619
|
+
y: n + (A.h - A.avatar) / 2,
|
|
2620
|
+
width: A.avatar,
|
|
2621
|
+
height: A.avatar,
|
|
2622
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
2623
|
+
clipPath: `url(#${x}-${e.id})`
|
|
2624
|
+
})] }),
|
|
2625
|
+
i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
|
|
2626
|
+
x: m,
|
|
2627
|
+
y: n + _ / 2 + A.title * .35,
|
|
2628
|
+
textAnchor: h,
|
|
2629
|
+
fontSize: A.title,
|
|
2630
|
+
fontWeight: "600",
|
|
2631
|
+
fill: s,
|
|
2632
|
+
children: xt(e.title, g + 4)
|
|
2633
|
+
}), e.name && /* @__PURE__ */ l("text", {
|
|
2634
|
+
x: m,
|
|
2635
|
+
y: n + _ + _ / 2 + A.name * .35,
|
|
2636
|
+
textAnchor: h,
|
|
2637
|
+
fontSize: A.name,
|
|
2638
|
+
fontWeight: "600",
|
|
2639
|
+
fill: d,
|
|
2640
|
+
children: xt(e.name, g)
|
|
2641
|
+
})] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
|
|
2642
|
+
x: m,
|
|
2643
|
+
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
2644
|
+
textAnchor: h,
|
|
2645
|
+
fontSize: A.name,
|
|
2646
|
+
fontWeight: "600",
|
|
2647
|
+
fill: s,
|
|
2648
|
+
children: xt(v[0], g)
|
|
2649
|
+
}), v[1] && /* @__PURE__ */ l("text", {
|
|
2650
|
+
x: m,
|
|
2651
|
+
y: n + A.h * .73,
|
|
2652
|
+
textAnchor: h,
|
|
2653
|
+
fontSize: A.title,
|
|
2654
|
+
opacity: "0.7",
|
|
2655
|
+
fill: s,
|
|
2656
|
+
children: xt(v[1], g + 4)
|
|
2657
|
+
})] })
|
|
2658
|
+
]
|
|
2659
|
+
}, e.id);
|
|
2660
|
+
})]
|
|
2661
|
+
}), S && /* @__PURE__ */ l(Et, {
|
|
2662
|
+
node: S,
|
|
2663
|
+
onClose: () => C(null)
|
|
2664
|
+
})]
|
|
2665
|
+
});
|
|
2666
|
+
}
|
|
2667
|
+
function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
|
|
2668
|
+
let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = s(null);
|
|
2235
2669
|
if (r(() => {
|
|
2236
2670
|
if (!i || _) return;
|
|
2237
2671
|
let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
|
|
@@ -2244,22 +2678,22 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
|
|
|
2244
2678
|
g,
|
|
2245
2679
|
_
|
|
2246
2680
|
]), !e.length) return null;
|
|
2247
|
-
let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(
|
|
2248
|
-
return /* @__PURE__ */
|
|
2249
|
-
ref:
|
|
2681
|
+
let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(W(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = c ? { border: C } : { borderBottom: C };
|
|
2682
|
+
return /* @__PURE__ */ l("div", {
|
|
2683
|
+
ref: p,
|
|
2250
2684
|
style: {
|
|
2251
2685
|
width: "100%",
|
|
2252
2686
|
overflowX: "auto",
|
|
2253
|
-
...
|
|
2687
|
+
...m(f)
|
|
2254
2688
|
},
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2689
|
+
children: /* @__PURE__ */ u("table", {
|
|
2256
2690
|
style: {
|
|
2257
2691
|
width: "100%",
|
|
2258
2692
|
borderCollapse: "collapse",
|
|
2259
2693
|
fontSize: 14,
|
|
2260
|
-
...
|
|
2694
|
+
...c ? { border: C } : {}
|
|
2261
2695
|
},
|
|
2262
|
-
children: [/* @__PURE__ */
|
|
2696
|
+
children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
|
|
2263
2697
|
style: {
|
|
2264
2698
|
textAlign: "left",
|
|
2265
2699
|
fontWeight: 600,
|
|
@@ -2268,9 +2702,9 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
|
|
|
2268
2702
|
...w
|
|
2269
2703
|
},
|
|
2270
2704
|
children: e.label ?? e
|
|
2271
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2272
|
-
style:
|
|
2273
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2705
|
+
}, t)) }) }), /* @__PURE__ */ l("tbody", { children: x.map((t, n) => /* @__PURE__ */ l("tr", {
|
|
2706
|
+
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2707
|
+
children: e.map((e, n) => /* @__PURE__ */ l("td", {
|
|
2274
2708
|
style: {
|
|
2275
2709
|
padding: S,
|
|
2276
2710
|
...w
|
|
@@ -2281,82 +2715,83 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
|
|
|
2281
2715
|
})
|
|
2282
2716
|
});
|
|
2283
2717
|
}
|
|
2284
|
-
var
|
|
2285
|
-
PageRoot:
|
|
2286
|
-
Section:
|
|
2287
|
-
Container:
|
|
2288
|
-
Heading:
|
|
2289
|
-
TextBlock:
|
|
2290
|
-
ButtonBlock:
|
|
2291
|
-
ImageBlock:
|
|
2292
|
-
Spacer:
|
|
2293
|
-
Divider:
|
|
2294
|
-
SliderBlock:
|
|
2295
|
-
CanvasSlider:
|
|
2296
|
-
TabsBlock:
|
|
2297
|
-
QuickStack:
|
|
2298
|
-
CollectionList:
|
|
2299
|
-
BreadcrumbsBlock:
|
|
2300
|
-
PaginationBlock:
|
|
2301
|
-
StepperBlock:
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2718
|
+
var kt = {
|
|
2719
|
+
PageRoot: pe,
|
|
2720
|
+
Section: me,
|
|
2721
|
+
Container: he,
|
|
2722
|
+
Heading: ge,
|
|
2723
|
+
TextBlock: De,
|
|
2724
|
+
ButtonBlock: Ae,
|
|
2725
|
+
ImageBlock: je,
|
|
2726
|
+
Spacer: Le,
|
|
2727
|
+
Divider: Re,
|
|
2728
|
+
SliderBlock: We,
|
|
2729
|
+
CanvasSlider: Ge,
|
|
2730
|
+
TabsBlock: Je,
|
|
2731
|
+
QuickStack: pt,
|
|
2732
|
+
CollectionList: mt,
|
|
2733
|
+
BreadcrumbsBlock: ht,
|
|
2734
|
+
PaginationBlock: gt,
|
|
2735
|
+
StepperBlock: _t,
|
|
2736
|
+
OrgChartBlock: Dt,
|
|
2737
|
+
TableBlock: Ot,
|
|
2738
|
+
AccordionBlock: Ye,
|
|
2739
|
+
NavbarBlock: qe,
|
|
2740
|
+
ListBlock: Ee,
|
|
2741
|
+
TextSpan: ye,
|
|
2742
|
+
QuoteBlock: Te,
|
|
2743
|
+
TextLink: ke,
|
|
2744
|
+
RichTextBlock: Ce,
|
|
2745
|
+
RichContentBlock: Ce,
|
|
2746
|
+
VideoBlock: Me,
|
|
2747
|
+
YouTubeBlock: Pe,
|
|
2748
|
+
IframeBlock: Fe,
|
|
2749
|
+
EmbedBlock: Ie,
|
|
2750
|
+
FormBlock: at,
|
|
2751
|
+
FormLabel: ot,
|
|
2752
|
+
FormInput: st,
|
|
2753
|
+
FormTextarea: ct,
|
|
2754
|
+
FormCheckbox: (e) => /* @__PURE__ */ l(lt, {
|
|
2320
2755
|
kind: "checkbox",
|
|
2321
2756
|
...e
|
|
2322
2757
|
}),
|
|
2323
|
-
FormRadio: (e) => /* @__PURE__ */
|
|
2758
|
+
FormRadio: (e) => /* @__PURE__ */ l(lt, {
|
|
2324
2759
|
kind: "radio",
|
|
2325
2760
|
...e
|
|
2326
2761
|
}),
|
|
2327
|
-
FormSelect:
|
|
2328
|
-
FormFile:
|
|
2329
|
-
FormSubmit:
|
|
2762
|
+
FormSelect: ut,
|
|
2763
|
+
FormFile: dt,
|
|
2764
|
+
FormSubmit: ft
|
|
2330
2765
|
};
|
|
2331
2766
|
//#endregion
|
|
2332
2767
|
//#region ../ui/src/components/builder/render.jsx
|
|
2333
2768
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2334
2769
|
let o = n[t];
|
|
2335
2770
|
if (!o || o.hidden) return null;
|
|
2336
|
-
let s = o.type?.resolvedName,
|
|
2771
|
+
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
2337
2772
|
if (s === "ComponentInstance") {
|
|
2338
2773
|
let n = o.props?.componentId, s = r?.[n];
|
|
2339
2774
|
if (!s?.template || i.has(n)) return null;
|
|
2340
|
-
let
|
|
2341
|
-
return /* @__PURE__ */
|
|
2775
|
+
let c = new Set(i).add(n);
|
|
2776
|
+
return /* @__PURE__ */ l(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
2342
2777
|
}
|
|
2343
|
-
let u =
|
|
2778
|
+
let u = kt[s];
|
|
2344
2779
|
if (!u) return null;
|
|
2345
2780
|
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;
|
|
2346
|
-
return /* @__PURE__ */
|
|
2347
|
-
...
|
|
2781
|
+
return /* @__PURE__ */ l(u, {
|
|
2782
|
+
...c,
|
|
2348
2783
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
2349
2784
|
linked: p,
|
|
2350
2785
|
nodeRef: (e) => {
|
|
2351
|
-
e && (e.setAttribute("data-wb", t),
|
|
2786
|
+
e && (e.setAttribute("data-wb", t), v(e, c));
|
|
2352
2787
|
},
|
|
2353
2788
|
children: d.length ? d : void 0
|
|
2354
2789
|
}, t);
|
|
2355
2790
|
}
|
|
2356
2791
|
//#endregion
|
|
2357
2792
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
2358
|
-
var
|
|
2359
|
-
function
|
|
2793
|
+
var At = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
2794
|
+
function jt({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, custom: s, tenant: c, apiUrl: d, datasets: f, locale: p, direction: m }) {
|
|
2360
2795
|
let h = s?.js?.trim();
|
|
2361
2796
|
if (r(() => {
|
|
2362
2797
|
if (!h) return;
|
|
@@ -2365,68 +2800,70 @@ function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
|
|
|
2365
2800
|
}, [h]), !e?.ROOT) return null;
|
|
2366
2801
|
let g = {
|
|
2367
2802
|
lang: p || void 0,
|
|
2368
|
-
dir:
|
|
2803
|
+
dir: oe(m, p)
|
|
2369
2804
|
}, _ = {
|
|
2370
2805
|
minHeight: "100%",
|
|
2371
2806
|
display: "flex",
|
|
2372
2807
|
flexDirection: "column"
|
|
2373
|
-
}, v = $("ROOT", e, n), y =
|
|
2808
|
+
}, v = $("ROOT", e, n), y = a(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = E(e, n), x = T(e, n), S = s?.css?.trim(), C = re(e, n).map((e) => /* @__PURE__ */ l("link", {
|
|
2374
2809
|
rel: "stylesheet",
|
|
2375
2810
|
precedence: "default",
|
|
2376
|
-
href:
|
|
2811
|
+
href: ne(e)
|
|
2377
2812
|
}, e));
|
|
2378
|
-
if (
|
|
2813
|
+
if (i !== "auto") return /* @__PURE__ */ l(V.Provider, {
|
|
2379
2814
|
value: {
|
|
2380
|
-
tenant:
|
|
2381
|
-
apiUrl: d || "/api"
|
|
2815
|
+
tenant: c || "",
|
|
2816
|
+
apiUrl: d || "/api",
|
|
2817
|
+
locale: p || ""
|
|
2382
2818
|
},
|
|
2383
|
-
children: /* @__PURE__ */
|
|
2819
|
+
children: /* @__PURE__ */ l(H.Provider, {
|
|
2384
2820
|
value: f ?? null,
|
|
2385
|
-
children: /* @__PURE__ */
|
|
2821
|
+
children: /* @__PURE__ */ l(U.Provider, {
|
|
2386
2822
|
value: y,
|
|
2387
|
-
children: /* @__PURE__ */
|
|
2823
|
+
children: /* @__PURE__ */ u("div", {
|
|
2388
2824
|
...g,
|
|
2389
2825
|
style: {
|
|
2390
2826
|
..._,
|
|
2391
|
-
...
|
|
2827
|
+
...I(t, i),
|
|
2392
2828
|
...o
|
|
2393
2829
|
},
|
|
2394
2830
|
children: [
|
|
2395
2831
|
C,
|
|
2396
|
-
b && /* @__PURE__ */
|
|
2397
|
-
x && /* @__PURE__ */
|
|
2398
|
-
S && /* @__PURE__ */
|
|
2832
|
+
b && /* @__PURE__ */ l("style", { children: b }),
|
|
2833
|
+
x && /* @__PURE__ */ l("style", { children: x }),
|
|
2834
|
+
S && /* @__PURE__ */ l("style", { children: S }),
|
|
2399
2835
|
v
|
|
2400
2836
|
]
|
|
2401
2837
|
})
|
|
2402
2838
|
})
|
|
2403
2839
|
})
|
|
2404
2840
|
});
|
|
2405
|
-
let
|
|
2406
|
-
return /* @__PURE__ */
|
|
2841
|
+
let w = N(t);
|
|
2842
|
+
return /* @__PURE__ */ l(V.Provider, {
|
|
2407
2843
|
value: {
|
|
2408
|
-
tenant:
|
|
2409
|
-
apiUrl: d || "/api"
|
|
2844
|
+
tenant: c || "",
|
|
2845
|
+
apiUrl: d || "/api",
|
|
2846
|
+
locale: p || ""
|
|
2410
2847
|
},
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2848
|
+
children: /* @__PURE__ */ l(H.Provider, {
|
|
2412
2849
|
value: f ?? null,
|
|
2413
|
-
children: /* @__PURE__ */
|
|
2850
|
+
children: /* @__PURE__ */ l(U.Provider, {
|
|
2414
2851
|
value: y,
|
|
2415
|
-
children: /* @__PURE__ */
|
|
2852
|
+
children: /* @__PURE__ */ u("div", {
|
|
2416
2853
|
...g,
|
|
2417
2854
|
className: "webim-page",
|
|
2418
2855
|
style: {
|
|
2419
2856
|
..._,
|
|
2420
|
-
...
|
|
2857
|
+
...F(t),
|
|
2421
2858
|
...o
|
|
2422
2859
|
},
|
|
2423
2860
|
children: [
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
2861
|
+
/* @__PURE__ */ l("style", { children: `.webim-page { ${At(P(w.light))} }
|
|
2862
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${At(P(w.dark))} } }` }),
|
|
2426
2863
|
C,
|
|
2427
|
-
b && /* @__PURE__ */
|
|
2428
|
-
x && /* @__PURE__ */
|
|
2429
|
-
S && /* @__PURE__ */
|
|
2864
|
+
b && /* @__PURE__ */ l("style", { children: b }),
|
|
2865
|
+
x && /* @__PURE__ */ l("style", { children: x }),
|
|
2866
|
+
S && /* @__PURE__ */ l("style", { children: S }),
|
|
2430
2867
|
v
|
|
2431
2868
|
]
|
|
2432
2869
|
})
|
|
@@ -2436,8 +2873,8 @@ function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
|
|
|
2436
2873
|
}
|
|
2437
2874
|
//#endregion
|
|
2438
2875
|
//#region src/WebimContent.jsx
|
|
2439
|
-
function
|
|
2440
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */
|
|
2876
|
+
function Mt({ bundle: e, mode: t = "auto", style: n }) {
|
|
2877
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ l(jt, {
|
|
2441
2878
|
blocks: e.blocks,
|
|
2442
2879
|
theme: e.theme,
|
|
2443
2880
|
components: e.components,
|
|
@@ -2453,32 +2890,33 @@ function bt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
2453
2890
|
}
|
|
2454
2891
|
//#endregion
|
|
2455
2892
|
//#region src/WebimPage.jsx
|
|
2456
|
-
function
|
|
2457
|
-
let [
|
|
2458
|
-
onLoad:
|
|
2459
|
-
onError:
|
|
2893
|
+
function Nt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: a, token: c, mode: u = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
2894
|
+
let [g, _] = s({ status: "loading" }), v = o({
|
|
2895
|
+
onLoad: m,
|
|
2896
|
+
onError: h
|
|
2460
2897
|
});
|
|
2461
|
-
return
|
|
2462
|
-
onLoad:
|
|
2463
|
-
onError:
|
|
2898
|
+
return v.current = {
|
|
2899
|
+
onLoad: m,
|
|
2900
|
+
onError: h
|
|
2464
2901
|
}, r(() => {
|
|
2465
2902
|
let r = !0;
|
|
2466
|
-
return
|
|
2903
|
+
return _({ status: "loading" }), z({
|
|
2467
2904
|
apiUrl: e,
|
|
2468
2905
|
tenant: t,
|
|
2469
2906
|
slug: n,
|
|
2470
2907
|
locale: i,
|
|
2471
|
-
preview:
|
|
2908
|
+
preview: a,
|
|
2909
|
+
token: c
|
|
2472
2910
|
}).then((e) => {
|
|
2473
|
-
r && (
|
|
2911
|
+
r && (_({
|
|
2474
2912
|
status: "ready",
|
|
2475
2913
|
bundle: e
|
|
2476
|
-
}),
|
|
2914
|
+
}), v.current.onLoad?.(e));
|
|
2477
2915
|
}).catch((e) => {
|
|
2478
|
-
r && (
|
|
2916
|
+
r && (_({
|
|
2479
2917
|
status: "error",
|
|
2480
2918
|
error: e
|
|
2481
|
-
}),
|
|
2919
|
+
}), v.current.onError?.(e));
|
|
2482
2920
|
}), () => {
|
|
2483
2921
|
r = !1;
|
|
2484
2922
|
};
|
|
@@ -2487,12 +2925,13 @@ function xt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "a
|
|
|
2487
2925
|
t,
|
|
2488
2926
|
n,
|
|
2489
2927
|
i,
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2928
|
+
a,
|
|
2929
|
+
c
|
|
2930
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ l(Mt, {
|
|
2931
|
+
bundle: g.bundle,
|
|
2932
|
+
mode: u,
|
|
2933
|
+
style: d
|
|
2495
2934
|
});
|
|
2496
2935
|
}
|
|
2497
2936
|
//#endregion
|
|
2498
|
-
export {
|
|
2937
|
+
export { jt as PageRenderer, Mt as WebimContent, Nt as WebimPage, z as fetchPage, Se as renderRichContent, L as resolveTheme };
|