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