webim-adapter 0.29.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +1671 -740
- package/build/webim-embed.js +13 -11
- package/build/webim-ssr.js +1648 -719
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -162,108 +162,199 @@ function y(e, t) {
|
|
|
162
162
|
return [...n].sort();
|
|
163
163
|
}
|
|
164
164
|
//#endregion
|
|
165
|
+
//#region ../ui/src/components/builder/animations.js
|
|
166
|
+
var b = [
|
|
167
|
+
"linear",
|
|
168
|
+
"ease",
|
|
169
|
+
"ease-in",
|
|
170
|
+
"ease-out",
|
|
171
|
+
"ease-in-out"
|
|
172
|
+
], x = (e) => {
|
|
173
|
+
let t = String(e ?? "").trim();
|
|
174
|
+
if (!t) return null;
|
|
175
|
+
let n = Number(t);
|
|
176
|
+
return Number.isFinite(n) ? n : null;
|
|
177
|
+
};
|
|
178
|
+
function S(e) {
|
|
179
|
+
let t = [], n = [], r = x(e?.opacity), i = x(e?.x), a = x(e?.y), o = x(e?.scale), s = x(e?.rotate), c = x(e?.blur);
|
|
180
|
+
return r !== null && t.push(`opacity: ${r}`), i !== null && n.push(`translateX(${i}px)`), a !== null && n.push(`translateY(${a}px)`), o !== null && n.push(`scale(${o})`), s !== null && n.push(`rotate(${s}deg)`), n.length && t.push(`transform: ${n.join(" ")}`), c !== null && t.push(`filter: blur(${c}px)`), t.join("; ");
|
|
181
|
+
}
|
|
182
|
+
var C = (e) => `wb-anim-${String(e).replace(/[^\w-]/g, "")}`, w = (e) => `--wb-anim-${String(e).replace(/[^\w-]/g, "")}`;
|
|
183
|
+
function T(e, t) {
|
|
184
|
+
if (!e || !Array.isArray(t)) return;
|
|
185
|
+
let n = window.getComputedStyle(e), r = t.map((e) => n.getPropertyValue(w(e)).trim()).filter(Boolean);
|
|
186
|
+
r.length && (e.style.animation = "none", e.offsetWidth, e.style.animation = r.join(", "));
|
|
187
|
+
}
|
|
188
|
+
function E(e) {
|
|
189
|
+
return Array.isArray(e) ? e.map((e) => {
|
|
190
|
+
let t = String(e?.id ?? "").replace(/[^\w-]/g, "");
|
|
191
|
+
if (!t) return "";
|
|
192
|
+
let n = C(t), r = S(e.from), i = S(e.to);
|
|
193
|
+
if (!r && !i) return "";
|
|
194
|
+
let a = Math.max(0, x(e.duration) ?? 400), o = Math.max(0, x(e.delay) ?? 0), s = `${n} ${a}ms ${b.includes(e.easing) ? e.easing : "ease-out"} ${o}ms ${e.loop ? "infinite" : "1"} both`;
|
|
195
|
+
return [
|
|
196
|
+
`@keyframes ${n} { from { ${r} } to { ${i} } }`,
|
|
197
|
+
`:root { ${w(t)}: ${s}; }`,
|
|
198
|
+
`.${n} { animation: ${s}; }`
|
|
199
|
+
].join("\n");
|
|
200
|
+
}).filter(Boolean).join("\n") : "";
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
165
203
|
//#region ../ui/src/components/builder/styles.js
|
|
166
|
-
var
|
|
204
|
+
var D = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), O = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, k = [
|
|
167
205
|
"borderWidth",
|
|
168
206
|
"borderStyle",
|
|
169
207
|
"borderColor",
|
|
170
208
|
"borderRadius",
|
|
171
209
|
"gap"
|
|
172
210
|
];
|
|
173
|
-
function
|
|
211
|
+
function A(e) {
|
|
174
212
|
let t = {};
|
|
175
|
-
for (let n of
|
|
213
|
+
for (let n of k) {
|
|
176
214
|
let r = e?.[n];
|
|
177
|
-
r != null && r !== "" && (t[n] =
|
|
215
|
+
r != null && r !== "" && (t[n] = D.has(n) ? O(r) : r);
|
|
178
216
|
}
|
|
179
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
217
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || k.includes(n) || (t[n] = D.has(n) ? O(r) : r);
|
|
180
218
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
181
219
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
182
220
|
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
183
221
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
184
|
-
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
222
|
+
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${O(e.x ?? 0)} ${O(e.y ?? 0)} ${O(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
185
223
|
[
|
|
186
224
|
s,
|
|
187
225
|
c,
|
|
188
226
|
l,
|
|
189
227
|
u
|
|
190
|
-
].some((e) => e !== void 0) && d.push(`${
|
|
191
|
-
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${
|
|
228
|
+
].some((e) => e !== void 0) && d.push(`${O(s ?? 0)} ${O(c ?? 0)} ${O(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
|
|
229
|
+
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${O(e.x ?? 0)}, ${O(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: b } = t;
|
|
192
230
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
193
|
-
let
|
|
194
|
-
(h !== void 0 || g !== void 0) &&
|
|
195
|
-
let
|
|
231
|
+
let x = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
|
|
232
|
+
(h !== void 0 || g !== void 0) && x.push(`translate(${O(h ?? 0)}, ${O(g ?? 0)})`), _ !== void 0 && x.push(`scale(${_})`), v !== void 0 && x.push(`rotate(${f(v)})`), (y !== void 0 || b !== void 0) && x.push(`skew(${f(y ?? 0)}, ${f(b ?? 0)})`), x.length && (t.transform = x.join(" "));
|
|
233
|
+
let S = (e) => `${e.inset ? "inset " : ""}${O(e.x ?? 0)} ${O(e.y ?? 0)} ${O(e.blur ?? 0)} ${O(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: C, boxShadowX: w, boxShadowY: T, boxShadowBlur: E, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
|
|
196
234
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
197
|
-
let N = (Array.isArray(
|
|
235
|
+
let N = (Array.isArray(C) ? C : []).filter((e) => e && e.on !== !1).map(S);
|
|
198
236
|
[
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
237
|
+
w,
|
|
238
|
+
T,
|
|
239
|
+
E,
|
|
202
240
|
A,
|
|
203
241
|
j,
|
|
204
242
|
M
|
|
205
|
-
].some((e) => e !== void 0) && N.push(
|
|
206
|
-
x:
|
|
207
|
-
y:
|
|
208
|
-
blur:
|
|
243
|
+
].some((e) => e !== void 0) && N.push(S({
|
|
244
|
+
x: w,
|
|
245
|
+
y: T,
|
|
246
|
+
blur: E,
|
|
209
247
|
spread: A,
|
|
210
248
|
color: j,
|
|
211
249
|
inset: M
|
|
212
250
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
213
|
-
let P = (e) => e.type === "blur" ? `blur(${
|
|
251
|
+
let P = (e) => e.type === "blur" ? `blur(${O(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: ee, filterContrast: B, filterSaturate: V } = t;
|
|
214
252
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
let
|
|
218
|
-
|
|
219
|
-
let { textStrokeWidth:
|
|
220
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
221
|
-
let { clipText:
|
|
222
|
-
delete t.clipText,
|
|
223
|
-
let { transitions:
|
|
253
|
+
let H = F(I);
|
|
254
|
+
R !== void 0 && H.push(`blur(${O(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), ee !== void 0 && H.push(`brightness(${ee}%)`), B !== void 0 && H.push(`contrast(${B}%)`), V !== void 0 && H.push(`saturate(${V}%)`), H.length && (t.filter = H.join(" "));
|
|
255
|
+
let te = F(L);
|
|
256
|
+
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
+
let { textStrokeWidth: ne, textStrokeColor: re } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || re !== void 0) && (t.WebkitTextStroke = `${O(ne ?? 1)} ${re || "currentColor"}`);
|
|
259
|
+
let { clipText: ie } = t;
|
|
260
|
+
delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: ae, transitionDuration: oe, transitionEasing: U, transitionProperty: W } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
224
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
225
|
-
let
|
|
226
|
-
if (
|
|
263
|
+
let G = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (oe !== void 0 && G.push(`${W || "all"} ${se(oe)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
227
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
228
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
229
267
|
}
|
|
230
268
|
delete t.backgroundVideo;
|
|
231
|
-
let { overlayColor:
|
|
232
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
233
|
-
let e = `color-mix(in srgb, ${
|
|
269
|
+
let { overlayColor: ce, overlayOpacity: le } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, ce) {
|
|
271
|
+
let e = `color-mix(in srgb, ${ce} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
234
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
235
273
|
}
|
|
236
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
237
|
-
let { backgroundLayers:
|
|
275
|
+
let { backgroundLayers: ue } = t;
|
|
238
276
|
delete t.backgroundLayers;
|
|
239
|
-
let
|
|
240
|
-
if (
|
|
277
|
+
let K = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (K.length) {
|
|
241
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
242
|
-
for (let t of
|
|
280
|
+
for (let t of K) 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");
|
|
243
281
|
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");
|
|
244
282
|
else {
|
|
245
283
|
if (!t.src) continue;
|
|
246
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
284
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${O(t.w ?? "auto")} ${O(t.h ?? "auto")}` : t.size || "cover"), r.push(`${O(t.posX ?? 0)} ${O(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
247
285
|
}
|
|
248
286
|
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(", "));
|
|
249
287
|
}
|
|
250
288
|
return t;
|
|
251
289
|
}
|
|
252
|
-
var
|
|
290
|
+
var j = {
|
|
253
291
|
hover: ":hover",
|
|
254
292
|
pressed: ":active",
|
|
255
293
|
focused: ":focus"
|
|
256
|
-
},
|
|
294
|
+
}, M = /* @__PURE__ */ new Set([
|
|
257
295
|
"style",
|
|
258
296
|
"class",
|
|
259
297
|
"id",
|
|
260
298
|
"data-wb",
|
|
261
299
|
"data-wb-class",
|
|
262
300
|
"data-slot"
|
|
263
|
-
]),
|
|
264
|
-
|
|
301
|
+
]), N = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !M.has(e.toLowerCase()), P = (e) => [...new Set(String(e ?? "").split(/\s+/).map((e) => e.replace(/^\./, "")).filter((e) => /^-?[_a-zA-Z][\w-]*$/.test(e)))], F = [
|
|
302
|
+
"click",
|
|
303
|
+
"dblclick",
|
|
304
|
+
"mouseenter",
|
|
305
|
+
"mouseleave",
|
|
306
|
+
"mousemove",
|
|
307
|
+
"focus",
|
|
308
|
+
"blur",
|
|
309
|
+
"input",
|
|
310
|
+
"change",
|
|
311
|
+
"submit",
|
|
312
|
+
"keydown",
|
|
313
|
+
"inview"
|
|
314
|
+
], I = ["load", "pagescroll"], L = [...F, ...I], R = /^[A-Za-z_$][\w$]*$/;
|
|
315
|
+
function z(e, t) {
|
|
316
|
+
let n = String(t ?? "").trim();
|
|
317
|
+
if (!n) return [e];
|
|
318
|
+
let r = e.closest?.(".webim-page") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
|
|
319
|
+
for (let e of i) try {
|
|
320
|
+
let t = Array.from(r.querySelectorAll(e));
|
|
321
|
+
if (t.length) return t;
|
|
322
|
+
} catch {
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
function ee(e, t) {
|
|
328
|
+
for (let t of e.__webimEvents ?? []) t();
|
|
329
|
+
let n = [];
|
|
330
|
+
for (let r of t ?? []) {
|
|
331
|
+
let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
|
|
332
|
+
if (!L.includes(t) || (i ? !a.length : !R.test(o))) continue;
|
|
333
|
+
let s = (t) => {
|
|
334
|
+
if (i) {
|
|
335
|
+
for (let t of z(e, r?.target)) T(t, a);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
let n = window[o];
|
|
339
|
+
typeof n == "function" && n.call(e, t);
|
|
340
|
+
};
|
|
341
|
+
if (t === "inview") {
|
|
342
|
+
if (typeof IntersectionObserver > "u") continue;
|
|
343
|
+
let t = new IntersectionObserver((e) => {
|
|
344
|
+
for (let n of e) n.isIntersecting && (t.disconnect(), s(n));
|
|
345
|
+
});
|
|
346
|
+
t.observe(e), n.push(() => t.disconnect());
|
|
347
|
+
} else if (t === "load") if (document.readyState === "complete") {
|
|
348
|
+
let e = setTimeout(s, 0);
|
|
349
|
+
n.push(() => clearTimeout(e));
|
|
350
|
+
} else window.addEventListener("load", s, { once: !0 }), n.push(() => window.removeEventListener("load", s));
|
|
351
|
+
else t === "pagescroll" ? (window.addEventListener("scroll", s, { passive: !0 }), n.push(() => window.removeEventListener("scroll", s))) : (e.addEventListener(t, s), n.push(() => e.removeEventListener(t, s)));
|
|
352
|
+
}
|
|
353
|
+
e.__webimEvents = n;
|
|
354
|
+
}
|
|
355
|
+
function B(e, t, n = []) {
|
|
265
356
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
266
|
-
let r =
|
|
357
|
+
let r = P(t.classNames), i = P(e.getAttribute("data-wb-class"));
|
|
267
358
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
268
359
|
for (let t of r) e.classList.add(t);
|
|
269
360
|
r.length ? e.setAttribute("data-wb-class", r.join(" ")) : e.removeAttribute("data-wb-class");
|
|
@@ -271,19 +362,19 @@ function O(e, t, n = []) {
|
|
|
271
362
|
let a = [];
|
|
272
363
|
for (let n of t.attributes ?? []) {
|
|
273
364
|
let t = String(n?.name ?? "").trim();
|
|
274
|
-
|
|
365
|
+
N(t) && (e.setAttribute(t, n.value ?? ""), a.push(t));
|
|
275
366
|
}
|
|
276
367
|
return a;
|
|
277
368
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
let i = Object.entries(
|
|
369
|
+
var V = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
370
|
+
function H(e, t, n, r = !1) {
|
|
371
|
+
let i = Object.entries(A(t)).map(([e, t]) => `${V(e)}: ${t} !important;`).join(" ");
|
|
281
372
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
282
373
|
}
|
|
283
|
-
function
|
|
284
|
-
return Object.entries(
|
|
374
|
+
function te(e, t, n) {
|
|
375
|
+
return Object.entries(j).map(([r, i]) => H(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
285
376
|
}
|
|
286
|
-
var
|
|
377
|
+
var ne = [
|
|
287
378
|
{
|
|
288
379
|
key: "tablet",
|
|
289
380
|
max: 991
|
|
@@ -296,17 +387,17 @@ var M = [
|
|
|
296
387
|
key: "mobile",
|
|
297
388
|
max: 478
|
|
298
389
|
}
|
|
299
|
-
],
|
|
300
|
-
function
|
|
301
|
-
return
|
|
302
|
-
let i = t?.[n] ?
|
|
390
|
+
], re = (e) => Object.entries(A(e)).map(([e, t]) => `${V(e)}: ${t} !important;`).join(" ");
|
|
391
|
+
function ie(e, t) {
|
|
392
|
+
return ne.map(({ key: n, max: r }) => {
|
|
393
|
+
let i = t?.[n] ? re(t[n]) : "";
|
|
303
394
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
304
395
|
}).filter(Boolean).join("\n");
|
|
305
396
|
}
|
|
306
|
-
function
|
|
397
|
+
function ae(e, t) {
|
|
307
398
|
let n = [], r = (e) => {
|
|
308
399
|
for (let [t, r] of Object.entries(e || {})) {
|
|
309
|
-
let e =
|
|
400
|
+
let e = ie(t, r.props);
|
|
310
401
|
e && n.push(e);
|
|
311
402
|
}
|
|
312
403
|
};
|
|
@@ -314,10 +405,10 @@ function F(e, t) {
|
|
|
314
405
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
315
406
|
return n.join("\n");
|
|
316
407
|
}
|
|
317
|
-
function
|
|
408
|
+
function oe(e, t) {
|
|
318
409
|
let n = [], r = (e) => {
|
|
319
410
|
for (let [t, r] of Object.entries(e || {})) {
|
|
320
|
-
let e =
|
|
411
|
+
let e = te(t, r.props);
|
|
321
412
|
e && n.push(e);
|
|
322
413
|
}
|
|
323
414
|
};
|
|
@@ -325,7 +416,7 @@ function ee(e, t) {
|
|
|
325
416
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
326
417
|
return n.join("\n");
|
|
327
418
|
}
|
|
328
|
-
var
|
|
419
|
+
var U = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", W = {
|
|
329
420
|
light: {
|
|
330
421
|
background: "#f2f2f2",
|
|
331
422
|
surface: "#f2f2f2",
|
|
@@ -366,23 +457,23 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
366
457
|
contrastText: "#052e2b"
|
|
367
458
|
}
|
|
368
459
|
}
|
|
369
|
-
},
|
|
460
|
+
}, se = {
|
|
370
461
|
font: "system",
|
|
371
462
|
headingFont: "inherit",
|
|
372
|
-
light:
|
|
373
|
-
dark:
|
|
374
|
-
},
|
|
463
|
+
light: W.light,
|
|
464
|
+
dark: W.dark
|
|
465
|
+
}, G = {
|
|
375
466
|
system: {
|
|
376
467
|
label: "System",
|
|
377
|
-
value:
|
|
468
|
+
value: U
|
|
378
469
|
},
|
|
379
470
|
inter: {
|
|
380
471
|
label: "Inter",
|
|
381
|
-
value: `"Inter", ${
|
|
472
|
+
value: `"Inter", ${U}`
|
|
382
473
|
},
|
|
383
474
|
outfit: {
|
|
384
475
|
label: "Outfit",
|
|
385
|
-
value: `"Outfit", ${
|
|
476
|
+
value: `"Outfit", ${U}`
|
|
386
477
|
},
|
|
387
478
|
serif: {
|
|
388
479
|
label: "Serif",
|
|
@@ -392,7 +483,7 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
392
483
|
label: "Mono",
|
|
393
484
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
394
485
|
}
|
|
395
|
-
},
|
|
486
|
+
}, ce = (e, t) => G[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
|
|
396
487
|
let n = Object.assign({}, e, ...t);
|
|
397
488
|
return n.primary = {
|
|
398
489
|
...e.primary,
|
|
@@ -408,20 +499,20 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
408
499
|
}), {})
|
|
409
500
|
}, n;
|
|
410
501
|
};
|
|
411
|
-
function
|
|
502
|
+
function ue(e) {
|
|
412
503
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
413
504
|
return {
|
|
414
|
-
font: r ??
|
|
415
|
-
headingFont: i ??
|
|
416
|
-
light:
|
|
417
|
-
dark:
|
|
505
|
+
font: r ?? se.font,
|
|
506
|
+
headingFont: i ?? se.headingFont,
|
|
507
|
+
light: le(W.light, a, t),
|
|
508
|
+
dark: le(W.dark, n)
|
|
418
509
|
};
|
|
419
510
|
}
|
|
420
|
-
function
|
|
511
|
+
function K(e) {
|
|
421
512
|
return {
|
|
422
513
|
"--page-bg": e.background,
|
|
423
514
|
"--page-surface": e.surface ?? e.background,
|
|
424
|
-
"--page-border": e.border ??
|
|
515
|
+
"--page-border": e.border ?? W.light.border,
|
|
425
516
|
"--page-text": e.text,
|
|
426
517
|
"--page-accent": e.accent,
|
|
427
518
|
"--page-accent-text": e.accentText,
|
|
@@ -435,31 +526,31 @@ function V(e) {
|
|
|
435
526
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
436
527
|
};
|
|
437
528
|
}
|
|
438
|
-
function
|
|
439
|
-
let t =
|
|
529
|
+
function de(e) {
|
|
530
|
+
let t = ue(e);
|
|
440
531
|
return {
|
|
441
532
|
backgroundColor: "var(--page-bg)",
|
|
442
533
|
color: "var(--page-text)",
|
|
443
|
-
fontFamily:
|
|
444
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
534
|
+
fontFamily: ce(t.font, U),
|
|
535
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit")
|
|
445
536
|
};
|
|
446
537
|
}
|
|
447
|
-
function
|
|
448
|
-
let n =
|
|
538
|
+
function fe(e, t = "light") {
|
|
539
|
+
let n = ue(e);
|
|
449
540
|
return {
|
|
450
|
-
...
|
|
451
|
-
...
|
|
541
|
+
...de(e),
|
|
542
|
+
...K(n[t] ?? n.light)
|
|
452
543
|
};
|
|
453
544
|
}
|
|
454
|
-
function
|
|
545
|
+
function pe(e, t) {
|
|
455
546
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
456
547
|
}
|
|
457
|
-
function
|
|
548
|
+
function me(e, t) {
|
|
458
549
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
459
550
|
}
|
|
460
551
|
//#endregion
|
|
461
552
|
//#region src/bundle.js
|
|
462
|
-
function
|
|
553
|
+
function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
463
554
|
let a = {
|
|
464
555
|
...t?.global ?? {},
|
|
465
556
|
...t?.tenant ?? {}
|
|
@@ -469,9 +560,10 @@ function se({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
469
560
|
title: e.title,
|
|
470
561
|
slug: e.slug,
|
|
471
562
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
472
|
-
theme:
|
|
563
|
+
theme: pe(o, a.builder_themes?.themes),
|
|
473
564
|
components: a.builder_components?.components ?? {},
|
|
474
565
|
custom: o.custom,
|
|
566
|
+
animations: o.animations,
|
|
475
567
|
seo: o.seo,
|
|
476
568
|
direction: o.direction,
|
|
477
569
|
scheme: o.scheme,
|
|
@@ -484,26 +576,31 @@ function se({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
484
576
|
}
|
|
485
577
|
//#endregion
|
|
486
578
|
//#region src/fetchPage.js
|
|
487
|
-
var
|
|
579
|
+
var ge = async (e) => {
|
|
488
580
|
let t = await e.json().catch(() => null);
|
|
489
581
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
490
582
|
return t?.payload ?? t;
|
|
491
583
|
};
|
|
492
|
-
async function
|
|
584
|
+
async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
493
585
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
494
586
|
if (!n) throw Error("fetchPage: slug is required");
|
|
495
587
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
496
588
|
...t ? { "x-tenant": t } : {},
|
|
497
589
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
498
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
590
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ge), c(`${l}/settings/public`, { headers: u }).then(ge)]), p = he({
|
|
499
591
|
page: d,
|
|
500
592
|
settings: f,
|
|
501
593
|
tenant: t,
|
|
502
594
|
apiUrl: l,
|
|
503
595
|
locale: r
|
|
504
|
-
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection :
|
|
596
|
+
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
|
|
597
|
+
"TableBlock",
|
|
598
|
+
"OrgChartBlock",
|
|
599
|
+
"NavbarBlock",
|
|
600
|
+
"CalendarBlock"
|
|
601
|
+
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
505
602
|
if (m.length) {
|
|
506
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
603
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(ge).then((e) => {
|
|
507
604
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
508
605
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
509
606
|
}).catch(() => [[t, []]])));
|
|
@@ -517,7 +614,7 @@ async function le({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
517
614
|
}
|
|
518
615
|
//#endregion
|
|
519
616
|
//#region ../ui/src/components/builder/locale.js
|
|
520
|
-
var
|
|
617
|
+
var ve = /* @__PURE__ */ new Set([
|
|
521
618
|
"ar",
|
|
522
619
|
"he",
|
|
523
620
|
"fa",
|
|
@@ -528,34 +625,34 @@ var ue = /* @__PURE__ */ new Set([
|
|
|
528
625
|
"yi",
|
|
529
626
|
"dv",
|
|
530
627
|
"ckb"
|
|
531
|
-
]),
|
|
628
|
+
]), ye = (e) => ve.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", be = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ye(t) : void 0, q = t({
|
|
532
629
|
tenant: "",
|
|
533
630
|
apiUrl: "/api",
|
|
534
631
|
locale: "",
|
|
535
632
|
settings: null
|
|
536
|
-
}),
|
|
633
|
+
}), J = t(null), xe = (e) => {
|
|
537
634
|
let t = Number(e?.__page);
|
|
538
635
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
539
636
|
if (typeof window > "u") return 1;
|
|
540
637
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
541
638
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
542
|
-
},
|
|
639
|
+
}, Se = () => {
|
|
543
640
|
if (typeof window > "u") return {};
|
|
544
641
|
let e = {};
|
|
545
642
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
546
643
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
547
644
|
}), e;
|
|
548
|
-
},
|
|
645
|
+
}, Ce = (e) => {
|
|
549
646
|
let t = {
|
|
550
647
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
551
|
-
...
|
|
648
|
+
...Se()
|
|
552
649
|
};
|
|
553
650
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
554
|
-
},
|
|
555
|
-
function
|
|
651
|
+
}, we = t(null), Te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
652
|
+
function Ee(e, t) {
|
|
556
653
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
557
654
|
}
|
|
558
|
-
var
|
|
655
|
+
var De = (e) => {
|
|
559
656
|
let t = [];
|
|
560
657
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
561
658
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -565,36 +662,36 @@ var _e = (e) => {
|
|
|
565
662
|
}
|
|
566
663
|
return t;
|
|
567
664
|
};
|
|
568
|
-
function
|
|
665
|
+
function Y(e) {
|
|
569
666
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
570
667
|
}
|
|
571
|
-
function
|
|
572
|
-
let n = t?.data ?? {}, r =
|
|
668
|
+
function Oe(e, t) {
|
|
669
|
+
let n = t?.data ?? {}, r = De(n);
|
|
573
670
|
if (!r.length) return e;
|
|
574
|
-
let i = RegExp(`:(${r.map(
|
|
671
|
+
let i = RegExp(`:(${r.map(Te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Y(Ee(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
575
672
|
return a(e);
|
|
576
673
|
}
|
|
577
|
-
var
|
|
674
|
+
var ke = {
|
|
578
675
|
margin: 0,
|
|
579
676
|
fontWeight: 700,
|
|
580
677
|
lineHeight: 1.2,
|
|
581
678
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
582
|
-
},
|
|
679
|
+
}, Ae = { margin: 0 }, X = {
|
|
583
680
|
display: "inline-block",
|
|
584
681
|
textDecoration: "none",
|
|
585
682
|
cursor: "pointer",
|
|
586
683
|
backgroundColor: "var(--page-accent, #111827)",
|
|
587
684
|
color: "var(--page-accent-text, #ffffff)"
|
|
588
|
-
},
|
|
685
|
+
}, je = {
|
|
589
686
|
flexGrow: 1,
|
|
590
687
|
display: "flex",
|
|
591
688
|
flexDirection: "column",
|
|
592
689
|
position: "relative"
|
|
593
|
-
},
|
|
690
|
+
}, Me = {
|
|
594
691
|
display: "flex",
|
|
595
692
|
flexDirection: "column"
|
|
596
693
|
};
|
|
597
|
-
function
|
|
694
|
+
function Ne({ style: e }) {
|
|
598
695
|
let t = e?.backgroundVideo;
|
|
599
696
|
if (!t) return null;
|
|
600
697
|
let n = {
|
|
@@ -620,32 +717,32 @@ function Ce({ style: e }) {
|
|
|
620
717
|
background: r
|
|
621
718
|
} })] });
|
|
622
719
|
}
|
|
623
|
-
var
|
|
720
|
+
var Pe = (e, t) => e?.backgroundVideo ? {
|
|
624
721
|
position: "relative",
|
|
625
722
|
...t,
|
|
626
|
-
...
|
|
723
|
+
...A(e)
|
|
627
724
|
} : {
|
|
628
725
|
...t,
|
|
629
|
-
...
|
|
726
|
+
...A(e)
|
|
630
727
|
};
|
|
631
|
-
function
|
|
728
|
+
function Fe({ style: e, nodeRef: t, children: n }) {
|
|
632
729
|
return /* @__PURE__ */ d("div", {
|
|
633
730
|
ref: t,
|
|
634
731
|
style: {
|
|
635
|
-
...
|
|
636
|
-
...
|
|
732
|
+
...je,
|
|
733
|
+
...A(e)
|
|
637
734
|
},
|
|
638
|
-
children: [/* @__PURE__ */ u(
|
|
735
|
+
children: [/* @__PURE__ */ u(Ne, { style: e }), n]
|
|
639
736
|
});
|
|
640
737
|
}
|
|
641
|
-
function
|
|
738
|
+
function Ie({ style: e, nodeRef: t, children: n }) {
|
|
642
739
|
return /* @__PURE__ */ d("section", {
|
|
643
740
|
ref: t,
|
|
644
|
-
style:
|
|
645
|
-
children: [/* @__PURE__ */ u(
|
|
741
|
+
style: Pe(e, Me),
|
|
742
|
+
children: [/* @__PURE__ */ u(Ne, { style: e }), n]
|
|
646
743
|
});
|
|
647
744
|
}
|
|
648
|
-
function
|
|
745
|
+
function Le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
649
746
|
let i = t ? {
|
|
650
747
|
position: "relative",
|
|
651
748
|
minHeight: 240
|
|
@@ -654,32 +751,32 @@ function De({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
654
751
|
ref: n,
|
|
655
752
|
style: i ? {
|
|
656
753
|
...i,
|
|
657
|
-
...
|
|
658
|
-
} :
|
|
659
|
-
children: [/* @__PURE__ */ u(
|
|
754
|
+
...Pe(e)
|
|
755
|
+
} : Pe(e),
|
|
756
|
+
children: [/* @__PURE__ */ u(Ne, { style: e }), r]
|
|
660
757
|
});
|
|
661
758
|
}
|
|
662
|
-
function
|
|
759
|
+
function Re({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
663
760
|
return /* @__PURE__ */ u(n, {
|
|
664
761
|
ref: a,
|
|
665
762
|
style: {
|
|
666
|
-
...
|
|
667
|
-
...
|
|
763
|
+
...ke,
|
|
764
|
+
...A(r)
|
|
668
765
|
},
|
|
669
|
-
children:
|
|
766
|
+
children: Z(t, e, i)
|
|
670
767
|
});
|
|
671
768
|
}
|
|
672
|
-
var
|
|
673
|
-
fontFamily:
|
|
769
|
+
var ze = {
|
|
770
|
+
fontFamily: G.mono.value,
|
|
674
771
|
background: "rgba(148, 163, 184, 0.18)",
|
|
675
772
|
padding: "1px 5px",
|
|
676
773
|
borderRadius: 4,
|
|
677
774
|
fontSize: "0.9em"
|
|
678
775
|
};
|
|
679
|
-
function
|
|
776
|
+
function Be(e, t = [], n, r) {
|
|
680
777
|
let i = e;
|
|
681
778
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
682
|
-
style:
|
|
779
|
+
style: ze,
|
|
683
780
|
children: i
|
|
684
781
|
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
|
|
685
782
|
href: n,
|
|
@@ -689,13 +786,13 @@ function Ae(e, t = [], n, r) {
|
|
|
689
786
|
children: i
|
|
690
787
|
})), i;
|
|
691
788
|
}
|
|
692
|
-
function
|
|
789
|
+
function Z(t, n, r) {
|
|
693
790
|
return t?.length ? t.map((t, n) => {
|
|
694
791
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
695
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
792
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Z(t.parts, "", r) }, n);
|
|
696
793
|
let i = t.text;
|
|
697
794
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
698
|
-
style:
|
|
795
|
+
style: ze,
|
|
699
796
|
children: i
|
|
700
797
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
701
798
|
style: {
|
|
@@ -712,13 +809,13 @@ function J(t, n, r) {
|
|
|
712
809
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
713
810
|
}) : n;
|
|
714
811
|
}
|
|
715
|
-
function
|
|
812
|
+
function Ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
716
813
|
return /* @__PURE__ */ u("span", {
|
|
717
|
-
style:
|
|
718
|
-
children: e?.length ?
|
|
814
|
+
style: A(a),
|
|
815
|
+
children: e?.length ? Z(e, t) : Be(t, n, r, i)
|
|
719
816
|
});
|
|
720
817
|
}
|
|
721
|
-
var
|
|
818
|
+
var He = {
|
|
722
819
|
h1: 40,
|
|
723
820
|
h2: 32,
|
|
724
821
|
h3: 26,
|
|
@@ -726,7 +823,7 @@ var Me = {
|
|
|
726
823
|
h5: 19,
|
|
727
824
|
h6: 16
|
|
728
825
|
};
|
|
729
|
-
function
|
|
826
|
+
function Ue({ align: e = "center", width: t, wrap: n } = {}) {
|
|
730
827
|
let r = t ? `${t}%` : void 0;
|
|
731
828
|
if (e === "full") return { width: "100%" };
|
|
732
829
|
let i = e === "left" || e === "right";
|
|
@@ -760,8 +857,8 @@ function Ne({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
760
857
|
marginRight: "auto"
|
|
761
858
|
};
|
|
762
859
|
}
|
|
763
|
-
function
|
|
764
|
-
let r = n ?? ((e, n) =>
|
|
860
|
+
function We(e = [], t, n) {
|
|
861
|
+
let r = n ?? ((e, n) => Z(e, n, t));
|
|
765
862
|
return e.map((t, n) => {
|
|
766
863
|
let i = {
|
|
767
864
|
marginTop: 0,
|
|
@@ -783,7 +880,7 @@ function Pe(e = [], t, n) {
|
|
|
783
880
|
marginLeft: 0,
|
|
784
881
|
marginRight: 0,
|
|
785
882
|
...i,
|
|
786
|
-
...
|
|
883
|
+
...Ue(t)
|
|
787
884
|
},
|
|
788
885
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
789
886
|
href: t.href,
|
|
@@ -802,16 +899,16 @@ function Pe(e = [], t, n) {
|
|
|
802
899
|
})]
|
|
803
900
|
}, n);
|
|
804
901
|
}
|
|
805
|
-
if (t.type === "video") return
|
|
902
|
+
if (t.type === "video") return tt(t.url) ? /* @__PURE__ */ u("div", {
|
|
806
903
|
style: {
|
|
807
904
|
...i,
|
|
808
|
-
...
|
|
905
|
+
...Ue({
|
|
809
906
|
align: t.align,
|
|
810
907
|
wrap: t.wrap,
|
|
811
908
|
width: t.width ?? 100
|
|
812
909
|
})
|
|
813
910
|
},
|
|
814
|
-
children: /* @__PURE__ */ u(
|
|
911
|
+
children: /* @__PURE__ */ u(nt, {
|
|
815
912
|
url: t.url,
|
|
816
913
|
autoplay: t.autoplay,
|
|
817
914
|
muted: t.muted,
|
|
@@ -873,17 +970,17 @@ function Pe(e = [], t, n) {
|
|
|
873
970
|
}
|
|
874
971
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
875
972
|
style: {
|
|
876
|
-
...
|
|
973
|
+
...Ke,
|
|
877
974
|
...i
|
|
878
975
|
},
|
|
879
976
|
children: r(t.parts, t.text)
|
|
880
977
|
}, n);
|
|
881
|
-
if (
|
|
978
|
+
if (He[t.type]) {
|
|
882
979
|
let e = t.type;
|
|
883
980
|
return /* @__PURE__ */ u(e, {
|
|
884
981
|
style: {
|
|
885
|
-
...
|
|
886
|
-
fontSize:
|
|
982
|
+
...ke,
|
|
983
|
+
fontSize: He[t.type],
|
|
887
984
|
...i
|
|
888
985
|
},
|
|
889
986
|
children: r(t.parts, t.text)
|
|
@@ -891,95 +988,95 @@ function Pe(e = [], t, n) {
|
|
|
891
988
|
}
|
|
892
989
|
return /* @__PURE__ */ u("p", {
|
|
893
990
|
style: {
|
|
894
|
-
...
|
|
991
|
+
...Ae,
|
|
895
992
|
...i
|
|
896
993
|
},
|
|
897
994
|
children: r(t.parts, t.text)
|
|
898
995
|
}, n);
|
|
899
996
|
});
|
|
900
997
|
}
|
|
901
|
-
function
|
|
998
|
+
function Ge({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
902
999
|
return /* @__PURE__ */ u("div", {
|
|
903
1000
|
ref: r,
|
|
904
1001
|
style: {
|
|
905
1002
|
display: "flow-root",
|
|
906
|
-
...
|
|
1003
|
+
...A(t)
|
|
907
1004
|
},
|
|
908
|
-
children:
|
|
1005
|
+
children: We(e, n)
|
|
909
1006
|
});
|
|
910
1007
|
}
|
|
911
|
-
var
|
|
1008
|
+
var Ke = {
|
|
912
1009
|
margin: 0,
|
|
913
1010
|
padding: "8px 0 8px 20px",
|
|
914
1011
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
915
1012
|
};
|
|
916
|
-
function
|
|
1013
|
+
function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
917
1014
|
return /* @__PURE__ */ u("blockquote", {
|
|
918
1015
|
ref: i,
|
|
919
1016
|
style: {
|
|
920
|
-
...
|
|
921
|
-
...
|
|
1017
|
+
...Ke,
|
|
1018
|
+
...A(n)
|
|
922
1019
|
},
|
|
923
|
-
children:
|
|
1020
|
+
children: Z(t, e, r)
|
|
924
1021
|
});
|
|
925
1022
|
}
|
|
926
|
-
function
|
|
1023
|
+
function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
927
1024
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
928
1025
|
ref: r,
|
|
929
1026
|
style: {
|
|
930
1027
|
margin: 0,
|
|
931
1028
|
paddingLeft: 24,
|
|
932
|
-
...
|
|
1029
|
+
...A(n)
|
|
933
1030
|
},
|
|
934
1031
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
935
1032
|
style: { marginBottom: 4 },
|
|
936
|
-
children:
|
|
1033
|
+
children: Z(e.parts, e.text)
|
|
937
1034
|
}, t))
|
|
938
1035
|
});
|
|
939
1036
|
}
|
|
940
|
-
function
|
|
1037
|
+
function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
941
1038
|
return /* @__PURE__ */ u("p", {
|
|
942
1039
|
ref: i,
|
|
943
1040
|
style: {
|
|
944
|
-
...
|
|
945
|
-
...
|
|
1041
|
+
...Ae,
|
|
1042
|
+
...A(n)
|
|
946
1043
|
},
|
|
947
|
-
children:
|
|
1044
|
+
children: Z(t, e, r)
|
|
948
1045
|
});
|
|
949
1046
|
}
|
|
950
|
-
var
|
|
1047
|
+
var Xe = {
|
|
951
1048
|
color: "var(--page-accent, inherit)",
|
|
952
1049
|
textDecoration: "underline",
|
|
953
1050
|
textUnderlineOffset: 3,
|
|
954
1051
|
cursor: "pointer"
|
|
955
1052
|
};
|
|
956
|
-
function
|
|
1053
|
+
function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
957
1054
|
return /* @__PURE__ */ u("a", {
|
|
958
1055
|
ref: o,
|
|
959
1056
|
href: n || "#",
|
|
960
1057
|
target: r || void 0,
|
|
961
1058
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
962
1059
|
style: {
|
|
963
|
-
...
|
|
964
|
-
...
|
|
1060
|
+
...Xe,
|
|
1061
|
+
...A(i)
|
|
965
1062
|
},
|
|
966
|
-
children:
|
|
1063
|
+
children: Z(t, e, a)
|
|
967
1064
|
});
|
|
968
1065
|
}
|
|
969
|
-
function
|
|
1066
|
+
function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
970
1067
|
return /* @__PURE__ */ u("a", {
|
|
971
1068
|
ref: o,
|
|
972
1069
|
href: n || "#",
|
|
973
1070
|
target: r || void 0,
|
|
974
1071
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
975
1072
|
style: {
|
|
976
|
-
...
|
|
977
|
-
...
|
|
1073
|
+
...X,
|
|
1074
|
+
...A(i)
|
|
978
1075
|
},
|
|
979
|
-
children:
|
|
1076
|
+
children: Z(t, e, a)
|
|
980
1077
|
});
|
|
981
1078
|
}
|
|
982
|
-
function
|
|
1079
|
+
function $e({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
983
1080
|
return e ? /* @__PURE__ */ u("img", {
|
|
984
1081
|
ref: r,
|
|
985
1082
|
src: e,
|
|
@@ -987,11 +1084,11 @@ function Ue({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
987
1084
|
style: {
|
|
988
1085
|
display: "block",
|
|
989
1086
|
maxWidth: "100%",
|
|
990
|
-
...
|
|
1087
|
+
...A(n)
|
|
991
1088
|
}
|
|
992
1089
|
}) : null;
|
|
993
1090
|
}
|
|
994
|
-
function
|
|
1091
|
+
function et({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
995
1092
|
return e ? /* @__PURE__ */ u("video", {
|
|
996
1093
|
ref: s,
|
|
997
1094
|
src: e,
|
|
@@ -1005,13 +1102,13 @@ function We({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1005
1102
|
display: "block",
|
|
1006
1103
|
width: "100%",
|
|
1007
1104
|
maxWidth: "100%",
|
|
1008
|
-
...
|
|
1105
|
+
...A(o)
|
|
1009
1106
|
}
|
|
1010
1107
|
}) : null;
|
|
1011
1108
|
}
|
|
1012
|
-
var
|
|
1013
|
-
function
|
|
1014
|
-
let c =
|
|
1109
|
+
var tt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1110
|
+
function nt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1111
|
+
let c = tt(e);
|
|
1015
1112
|
if (!c) return null;
|
|
1016
1113
|
let l = new URLSearchParams({ rel: "0" });
|
|
1017
1114
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
@@ -1020,7 +1117,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1020
1117
|
position: "relative",
|
|
1021
1118
|
width: "100%",
|
|
1022
1119
|
paddingTop: "56.25%",
|
|
1023
|
-
...
|
|
1120
|
+
...A(o)
|
|
1024
1121
|
},
|
|
1025
1122
|
children: /* @__PURE__ */ u("iframe", {
|
|
1026
1123
|
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
@@ -1037,7 +1134,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1037
1134
|
})
|
|
1038
1135
|
});
|
|
1039
1136
|
}
|
|
1040
|
-
function
|
|
1137
|
+
function rt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1041
1138
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
1042
1139
|
ref: i,
|
|
1043
1140
|
src: e,
|
|
@@ -1049,11 +1146,11 @@ function qe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1049
1146
|
width: "100%",
|
|
1050
1147
|
height: 300,
|
|
1051
1148
|
border: 0,
|
|
1052
|
-
...
|
|
1149
|
+
...A(r)
|
|
1053
1150
|
}
|
|
1054
1151
|
}) : null;
|
|
1055
1152
|
}
|
|
1056
|
-
function
|
|
1153
|
+
function it({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1057
1154
|
let [a, o] = c(null);
|
|
1058
1155
|
return i(() => {
|
|
1059
1156
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -1069,10 +1166,10 @@ function Je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1069
1166
|
ref: (e) => {
|
|
1070
1167
|
o(e), r && r(e);
|
|
1071
1168
|
},
|
|
1072
|
-
style:
|
|
1169
|
+
style: A(n)
|
|
1073
1170
|
});
|
|
1074
1171
|
}
|
|
1075
|
-
function
|
|
1172
|
+
function at({ height: e, nodeRef: t }) {
|
|
1076
1173
|
return /* @__PURE__ */ u("div", {
|
|
1077
1174
|
ref: t,
|
|
1078
1175
|
style: {
|
|
@@ -1082,18 +1179,18 @@ function Ye({ height: e, nodeRef: t }) {
|
|
|
1082
1179
|
}
|
|
1083
1180
|
});
|
|
1084
1181
|
}
|
|
1085
|
-
function
|
|
1182
|
+
function ot({ style: e, nodeRef: t }) {
|
|
1086
1183
|
return /* @__PURE__ */ u("div", {
|
|
1087
1184
|
ref: t,
|
|
1088
1185
|
style: {
|
|
1089
1186
|
height: 1,
|
|
1090
1187
|
alignSelf: "stretch",
|
|
1091
1188
|
flexShrink: 0,
|
|
1092
|
-
...
|
|
1189
|
+
...A(e)
|
|
1093
1190
|
}
|
|
1094
1191
|
});
|
|
1095
1192
|
}
|
|
1096
|
-
var
|
|
1193
|
+
var st = {
|
|
1097
1194
|
position: "absolute",
|
|
1098
1195
|
top: "50%",
|
|
1099
1196
|
transform: "translateY(-50%)",
|
|
@@ -1110,7 +1207,7 @@ var Ze = {
|
|
|
1110
1207
|
alignItems: "center",
|
|
1111
1208
|
justifyContent: "center",
|
|
1112
1209
|
padding: 0
|
|
1113
|
-
},
|
|
1210
|
+
}, ct = {
|
|
1114
1211
|
bottom: {
|
|
1115
1212
|
inset: "auto 0 0 0",
|
|
1116
1213
|
padding: "40px 24px 20px",
|
|
@@ -1129,8 +1226,8 @@ var Ze = {
|
|
|
1129
1226
|
padding: 24,
|
|
1130
1227
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1131
1228
|
}
|
|
1132
|
-
},
|
|
1133
|
-
function
|
|
1229
|
+
}, lt = 48;
|
|
1230
|
+
function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1134
1231
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1135
1232
|
if (i(() => {
|
|
1136
1233
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1146,7 +1243,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1146
1243
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1147
1244
|
if (!_) return;
|
|
1148
1245
|
let { dx: e } = _;
|
|
1149
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1246
|
+
v(null), e < -48 ? b(y + 1) : e > lt && b(y - 1);
|
|
1150
1247
|
};
|
|
1151
1248
|
return /* @__PURE__ */ d("div", {
|
|
1152
1249
|
ref: f,
|
|
@@ -1171,7 +1268,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1171
1268
|
touchAction: "pan-y",
|
|
1172
1269
|
userSelect: _ ? "none" : void 0,
|
|
1173
1270
|
cursor: _ ? "grabbing" : void 0,
|
|
1174
|
-
...
|
|
1271
|
+
...A(s)
|
|
1175
1272
|
},
|
|
1176
1273
|
children: [/* @__PURE__ */ u("div", {
|
|
1177
1274
|
style: {
|
|
@@ -1194,7 +1291,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1194
1291
|
type: "button",
|
|
1195
1292
|
"aria-label": "Previous slide",
|
|
1196
1293
|
style: {
|
|
1197
|
-
...
|
|
1294
|
+
...st,
|
|
1198
1295
|
left: 12
|
|
1199
1296
|
},
|
|
1200
1297
|
onClick: () => b(y - 1),
|
|
@@ -1204,7 +1301,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1204
1301
|
type: "button",
|
|
1205
1302
|
"aria-label": "Next slide",
|
|
1206
1303
|
style: {
|
|
1207
|
-
...
|
|
1304
|
+
...st,
|
|
1208
1305
|
right: 12
|
|
1209
1306
|
},
|
|
1210
1307
|
onClick: () => b(y + 1),
|
|
@@ -1238,7 +1335,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1238
1335
|
] })]
|
|
1239
1336
|
});
|
|
1240
1337
|
}
|
|
1241
|
-
var
|
|
1338
|
+
var dt = (e, t) => ({
|
|
1242
1339
|
position: "absolute",
|
|
1243
1340
|
inset: 0,
|
|
1244
1341
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1246,18 +1343,18 @@ var tt = (e, t) => ({
|
|
|
1246
1343
|
backgroundSize: "cover",
|
|
1247
1344
|
backgroundPosition: "center"
|
|
1248
1345
|
});
|
|
1249
|
-
function
|
|
1250
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1346
|
+
function ft({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1347
|
+
return e.length ? /* @__PURE__ */ u(ut, {
|
|
1251
1348
|
...r,
|
|
1252
1349
|
count: e.length,
|
|
1253
1350
|
renderSlide: (r) => {
|
|
1254
1351
|
let i = e[r];
|
|
1255
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1352
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1256
1353
|
style: {
|
|
1257
1354
|
position: "absolute",
|
|
1258
1355
|
color: "#fff",
|
|
1259
1356
|
textAlign: n,
|
|
1260
|
-
...
|
|
1357
|
+
...ct[t] ?? ct.bottom
|
|
1261
1358
|
},
|
|
1262
1359
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1263
1360
|
style: {
|
|
@@ -1277,13 +1374,13 @@ function nt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1277
1374
|
}
|
|
1278
1375
|
}) : null;
|
|
1279
1376
|
}
|
|
1280
|
-
function
|
|
1281
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1377
|
+
function pt({ slides: e = [], linked: t, ...n }) {
|
|
1378
|
+
return e.length ? /* @__PURE__ */ u(ut, {
|
|
1282
1379
|
...n,
|
|
1283
1380
|
count: e.length,
|
|
1284
1381
|
renderSlide: (n) => {
|
|
1285
1382
|
let r = e[n];
|
|
1286
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1383
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1287
1384
|
style: {
|
|
1288
1385
|
position: "absolute",
|
|
1289
1386
|
inset: 0,
|
|
@@ -1295,7 +1392,7 @@ function rt({ slides: e = [], linked: t, ...n }) {
|
|
|
1295
1392
|
}
|
|
1296
1393
|
}) : null;
|
|
1297
1394
|
}
|
|
1298
|
-
function
|
|
1395
|
+
function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
|
|
1299
1396
|
let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), h = f ? (e) => e.preventDefault() : void 0, [g, _] = c(null), v = a && !f && g !== null && p[g];
|
|
1300
1397
|
i(() => {
|
|
1301
1398
|
if (!v) return;
|
|
@@ -1320,7 +1417,7 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1320
1417
|
columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
|
|
1321
1418
|
columnGap: m,
|
|
1322
1419
|
width: "100%",
|
|
1323
|
-
...
|
|
1420
|
+
...A(o)
|
|
1324
1421
|
},
|
|
1325
1422
|
children: [
|
|
1326
1423
|
p.map((e, t) => {
|
|
@@ -1494,45 +1591,136 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1494
1591
|
]
|
|
1495
1592
|
});
|
|
1496
1593
|
}
|
|
1497
|
-
var
|
|
1594
|
+
var ht = {
|
|
1498
1595
|
color: "inherit",
|
|
1499
1596
|
textDecoration: "none",
|
|
1500
1597
|
fontSize: 14,
|
|
1501
1598
|
opacity: .85
|
|
1502
|
-
},
|
|
1599
|
+
}, gt = {
|
|
1503
1600
|
background: "var(--page-surface, #f2f2f2)",
|
|
1504
1601
|
color: "var(--page-text, #111827)",
|
|
1505
1602
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1506
1603
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1507
1604
|
zIndex: 60
|
|
1508
1605
|
};
|
|
1509
|
-
function
|
|
1510
|
-
let
|
|
1606
|
+
function _t(e, t = {}, n = "dropdown") {
|
|
1607
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Y(e), o = r.map((e) => {
|
|
1608
|
+
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1609
|
+
return {
|
|
1610
|
+
key: e.id,
|
|
1611
|
+
parent: (r && typeof r == "object" ? r.id : r) || null,
|
|
1612
|
+
label: a(n[t.labelField || "name"]) || a(n.name) || "Untitled",
|
|
1613
|
+
href: t.hrefField ? a(n[t.hrefField]) : "",
|
|
1614
|
+
image: t.imageField && i(n[t.imageField]) || "",
|
|
1615
|
+
desc: t.descField ? a(n[t.descField]) : ""
|
|
1616
|
+
};
|
|
1617
|
+
}), s = new Map(o.map((e) => [e.key, e])), c = (e) => {
|
|
1618
|
+
let t = /* @__PURE__ */ new Set(), n = e;
|
|
1619
|
+
for (; n.parent && s.has(n.parent) && !t.has(n.key);) t.add(n.key), n = s.get(n.parent);
|
|
1620
|
+
return n;
|
|
1621
|
+
}, l = [], u = /* @__PURE__ */ new Map();
|
|
1622
|
+
for (let e of o) {
|
|
1623
|
+
if (c(e) !== e) continue;
|
|
1624
|
+
let t = {
|
|
1625
|
+
key: e.key,
|
|
1626
|
+
label: e.label,
|
|
1627
|
+
href: e.href,
|
|
1628
|
+
image: e.image,
|
|
1629
|
+
children: []
|
|
1630
|
+
};
|
|
1631
|
+
u.set(e.key, t), l.push(t);
|
|
1632
|
+
}
|
|
1633
|
+
for (let e of o) {
|
|
1634
|
+
let t = c(e);
|
|
1635
|
+
t !== e && u.get(t.key)?.children.push({
|
|
1636
|
+
key: e.key,
|
|
1637
|
+
label: e.label,
|
|
1638
|
+
href: e.href,
|
|
1639
|
+
image: e.image,
|
|
1640
|
+
desc: e.desc
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
return l.map((e) => ({
|
|
1644
|
+
...e,
|
|
1645
|
+
type: e.children.length ? n : "link"
|
|
1646
|
+
}));
|
|
1647
|
+
}
|
|
1648
|
+
function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
1649
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(q), P = r(J)?.[g], [F, I] = c(null);
|
|
1511
1650
|
i(() => {
|
|
1512
|
-
if (!
|
|
1513
|
-
let e =
|
|
1514
|
-
return
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1651
|
+
if (!g || P) return;
|
|
1652
|
+
let e = !0;
|
|
1653
|
+
return fetch(`${N}/dynamic/${encodeURIComponent(g)}`, { headers: M ? { "x-tenant": M } : {} }).then((e) => e.json()).then((t) => {
|
|
1654
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
1655
|
+
e && I(n);
|
|
1656
|
+
}).catch(() => e && I([])), () => {
|
|
1657
|
+
e = !1;
|
|
1658
|
+
};
|
|
1659
|
+
}, [
|
|
1660
|
+
g,
|
|
1661
|
+
M,
|
|
1662
|
+
N,
|
|
1663
|
+
P
|
|
1664
|
+
]), i(() => {
|
|
1665
|
+
if (!C) return;
|
|
1666
|
+
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1667
|
+
return e.observe(C), () => e.disconnect();
|
|
1668
|
+
}, [C, h]);
|
|
1669
|
+
let L = g ? _t(P ?? F ?? [], {
|
|
1670
|
+
labelField: _,
|
|
1671
|
+
hrefField: v,
|
|
1672
|
+
imageField: y,
|
|
1673
|
+
descField: b,
|
|
1674
|
+
parentField: x
|
|
1675
|
+
}, S) : s, R = m === "hamburger" || m === "auto" && T, z = (e, t, n = !1) => {
|
|
1676
|
+
let r = e.image ? /* @__PURE__ */ u("img", {
|
|
1677
|
+
src: e.image,
|
|
1678
|
+
alt: "",
|
|
1679
|
+
style: n ? {
|
|
1680
|
+
width: "100%",
|
|
1681
|
+
aspectRatio: "16 / 9",
|
|
1682
|
+
objectFit: "cover",
|
|
1683
|
+
borderRadius: 6,
|
|
1684
|
+
display: "block",
|
|
1685
|
+
marginBottom: 8
|
|
1686
|
+
} : {
|
|
1687
|
+
width: 22,
|
|
1688
|
+
height: 22,
|
|
1689
|
+
objectFit: "cover",
|
|
1690
|
+
borderRadius: 4,
|
|
1525
1691
|
display: "block",
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1692
|
+
flexShrink: 0
|
|
1693
|
+
}
|
|
1694
|
+
}) : null;
|
|
1695
|
+
return /* @__PURE__ */ d("a", {
|
|
1696
|
+
href: e.href || "#",
|
|
1697
|
+
style: {
|
|
1698
|
+
...ht,
|
|
1699
|
+
display: n ? "block" : "flex",
|
|
1700
|
+
alignItems: n ? void 0 : "center",
|
|
1701
|
+
gap: n ? void 0 : 10,
|
|
1702
|
+
...t
|
|
1529
1703
|
},
|
|
1530
|
-
children:
|
|
1531
|
-
|
|
1532
|
-
|
|
1704
|
+
children: [r, /* @__PURE__ */ d("span", {
|
|
1705
|
+
style: {
|
|
1706
|
+
display: "block",
|
|
1707
|
+
minWidth: 0
|
|
1708
|
+
},
|
|
1709
|
+
children: [e.label, e.desc && /* @__PURE__ */ u("span", {
|
|
1710
|
+
style: {
|
|
1711
|
+
display: "block",
|
|
1712
|
+
fontSize: 12,
|
|
1713
|
+
opacity: .6,
|
|
1714
|
+
marginTop: 2
|
|
1715
|
+
},
|
|
1716
|
+
children: e.desc
|
|
1717
|
+
})]
|
|
1718
|
+
})]
|
|
1719
|
+
}, e.key);
|
|
1720
|
+
};
|
|
1533
1721
|
return /* @__PURE__ */ d("nav", {
|
|
1534
1722
|
ref: (e) => {
|
|
1535
|
-
|
|
1723
|
+
w(e), p && p(e);
|
|
1536
1724
|
},
|
|
1537
1725
|
style: {
|
|
1538
1726
|
display: "flex",
|
|
@@ -1542,7 +1730,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1542
1730
|
padding: "14px 24px",
|
|
1543
1731
|
width: "100%",
|
|
1544
1732
|
position: "relative",
|
|
1545
|
-
...
|
|
1733
|
+
...A(f)
|
|
1546
1734
|
},
|
|
1547
1735
|
children: [
|
|
1548
1736
|
(n || t) && (() => {
|
|
@@ -1560,29 +1748,29 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1560
1748
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
1561
1749
|
},
|
|
1562
1750
|
children: t
|
|
1563
|
-
})] }),
|
|
1751
|
+
})] }), r = {
|
|
1564
1752
|
display: "flex",
|
|
1565
1753
|
alignItems: "center",
|
|
1566
1754
|
gap: 10,
|
|
1567
1755
|
color: "inherit",
|
|
1568
1756
|
textDecoration: "none"
|
|
1569
1757
|
};
|
|
1570
|
-
return
|
|
1571
|
-
href:
|
|
1572
|
-
target:
|
|
1573
|
-
rel:
|
|
1574
|
-
style:
|
|
1758
|
+
return a ? /* @__PURE__ */ u("a", {
|
|
1759
|
+
href: a,
|
|
1760
|
+
target: o || void 0,
|
|
1761
|
+
rel: o === "_blank" ? "noopener noreferrer" : void 0,
|
|
1762
|
+
style: r,
|
|
1575
1763
|
children: e
|
|
1576
1764
|
}) : /* @__PURE__ */ u("div", {
|
|
1577
|
-
style:
|
|
1765
|
+
style: r,
|
|
1578
1766
|
children: e
|
|
1579
1767
|
});
|
|
1580
1768
|
})(),
|
|
1581
1769
|
/* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
|
|
1582
|
-
|
|
1770
|
+
R ? /* @__PURE__ */ u("button", {
|
|
1583
1771
|
type: "button",
|
|
1584
|
-
"aria-label":
|
|
1585
|
-
onClick: () =>
|
|
1772
|
+
"aria-label": D ? "Close menu" : "Open menu",
|
|
1773
|
+
onClick: () => O(!D),
|
|
1586
1774
|
style: {
|
|
1587
1775
|
background: "transparent",
|
|
1588
1776
|
border: 0,
|
|
@@ -1592,7 +1780,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1592
1780
|
lineHeight: 1,
|
|
1593
1781
|
padding: 4
|
|
1594
1782
|
},
|
|
1595
|
-
children:
|
|
1783
|
+
children: D ? "✕" : "☰"
|
|
1596
1784
|
}) : /* @__PURE__ */ u("div", {
|
|
1597
1785
|
style: {
|
|
1598
1786
|
display: "flex",
|
|
@@ -1600,11 +1788,11 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1600
1788
|
alignItems: "center",
|
|
1601
1789
|
flexWrap: "wrap"
|
|
1602
1790
|
},
|
|
1603
|
-
children:
|
|
1791
|
+
children: L.map((e) => {
|
|
1604
1792
|
let t = e.children ?? [];
|
|
1605
1793
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1606
1794
|
href: e.href || "#",
|
|
1607
|
-
style:
|
|
1795
|
+
style: ht,
|
|
1608
1796
|
children: e.label
|
|
1609
1797
|
}, e.key);
|
|
1610
1798
|
let n = e.type === "mega";
|
|
@@ -1613,12 +1801,12 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1613
1801
|
position: n ? "static" : "relative",
|
|
1614
1802
|
display: "inline-flex"
|
|
1615
1803
|
},
|
|
1616
|
-
onMouseEnter: () =>
|
|
1617
|
-
onMouseLeave: () =>
|
|
1804
|
+
onMouseEnter: () => j(e.key),
|
|
1805
|
+
onMouseLeave: () => j(null),
|
|
1618
1806
|
children: [/* @__PURE__ */ d("a", {
|
|
1619
1807
|
href: e.href || "#",
|
|
1620
1808
|
style: {
|
|
1621
|
-
...
|
|
1809
|
+
...ht,
|
|
1622
1810
|
cursor: "pointer"
|
|
1623
1811
|
},
|
|
1624
1812
|
children: [
|
|
@@ -1632,9 +1820,9 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1632
1820
|
children: "▼"
|
|
1633
1821
|
})
|
|
1634
1822
|
]
|
|
1635
|
-
}),
|
|
1823
|
+
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
1636
1824
|
style: {
|
|
1637
|
-
...
|
|
1825
|
+
...gt,
|
|
1638
1826
|
position: "absolute",
|
|
1639
1827
|
left: 0,
|
|
1640
1828
|
right: 0,
|
|
@@ -1644,13 +1832,13 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1644
1832
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1645
1833
|
gap: 16
|
|
1646
1834
|
},
|
|
1647
|
-
children: t.map((e) =>
|
|
1648
|
-
padding:
|
|
1649
|
-
borderRadius:
|
|
1650
|
-
}))
|
|
1835
|
+
children: t.map((e) => z(e, {
|
|
1836
|
+
padding: 8,
|
|
1837
|
+
borderRadius: 8
|
|
1838
|
+
}, !0))
|
|
1651
1839
|
}) : /* @__PURE__ */ u("div", {
|
|
1652
1840
|
style: {
|
|
1653
|
-
...
|
|
1841
|
+
...gt,
|
|
1654
1842
|
position: "absolute",
|
|
1655
1843
|
top: "100%",
|
|
1656
1844
|
left: 0,
|
|
@@ -1660,7 +1848,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1660
1848
|
display: "flex",
|
|
1661
1849
|
flexDirection: "column"
|
|
1662
1850
|
},
|
|
1663
|
-
children: t.map((e) =>
|
|
1851
|
+
children: t.map((e) => z(e, {
|
|
1664
1852
|
padding: "8px 12px",
|
|
1665
1853
|
borderRadius: 6
|
|
1666
1854
|
}))
|
|
@@ -1668,7 +1856,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1668
1856
|
}, e.key);
|
|
1669
1857
|
})
|
|
1670
1858
|
}),
|
|
1671
|
-
|
|
1859
|
+
R && D && /* @__PURE__ */ u("div", {
|
|
1672
1860
|
style: {
|
|
1673
1861
|
flexBasis: "100%",
|
|
1674
1862
|
width: "100%",
|
|
@@ -1676,27 +1864,27 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1676
1864
|
flexDirection: "column",
|
|
1677
1865
|
paddingTop: 10
|
|
1678
1866
|
},
|
|
1679
|
-
children:
|
|
1867
|
+
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1680
1868
|
href: t.href || "#",
|
|
1681
1869
|
style: {
|
|
1682
|
-
...
|
|
1870
|
+
...ht,
|
|
1683
1871
|
padding: "10px 4px",
|
|
1684
1872
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1685
1873
|
opacity: 1
|
|
1686
1874
|
},
|
|
1687
1875
|
children: t.label
|
|
1688
|
-
}), (t.children ?? []).map((e) =>
|
|
1876
|
+
}), (t.children ?? []).map((e) => z(e, { padding: "8px 4px 8px 22px" }))] }, t.key))
|
|
1689
1877
|
})
|
|
1690
1878
|
]
|
|
1691
1879
|
});
|
|
1692
1880
|
}
|
|
1693
|
-
function
|
|
1881
|
+
function yt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1694
1882
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1695
1883
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
1696
1884
|
ref: r,
|
|
1697
1885
|
style: {
|
|
1698
1886
|
width: "100%",
|
|
1699
|
-
...
|
|
1887
|
+
...A(n)
|
|
1700
1888
|
},
|
|
1701
1889
|
children: [/* @__PURE__ */ u("div", {
|
|
1702
1890
|
style: {
|
|
@@ -1730,7 +1918,7 @@ function ct({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1730
1918
|
}, e.key))]
|
|
1731
1919
|
}) : null;
|
|
1732
1920
|
}
|
|
1733
|
-
function
|
|
1921
|
+
function bt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1734
1922
|
let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
1735
1923
|
if (!e.length) return null;
|
|
1736
1924
|
let s = (e) => o((t) => {
|
|
@@ -1741,7 +1929,7 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1741
1929
|
ref: i,
|
|
1742
1930
|
style: {
|
|
1743
1931
|
width: "100%",
|
|
1744
|
-
...
|
|
1932
|
+
...A(r)
|
|
1745
1933
|
},
|
|
1746
1934
|
children: e.map((n, r) => {
|
|
1747
1935
|
let i = a.has(n.key);
|
|
@@ -1787,15 +1975,15 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1787
1975
|
})
|
|
1788
1976
|
});
|
|
1789
1977
|
}
|
|
1790
|
-
var
|
|
1978
|
+
var xt = {
|
|
1791
1979
|
display: "flex",
|
|
1792
1980
|
flexDirection: "column",
|
|
1793
1981
|
gap: "12px"
|
|
1794
|
-
},
|
|
1982
|
+
}, St = {
|
|
1795
1983
|
fontSize: "14px",
|
|
1796
1984
|
fontWeight: 500,
|
|
1797
1985
|
color: "var(--page-text, #111827)"
|
|
1798
|
-
},
|
|
1986
|
+
}, Q = {
|
|
1799
1987
|
padding: "10px 12px",
|
|
1800
1988
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
1801
1989
|
borderRadius: "6px",
|
|
@@ -1805,18 +1993,18 @@ var ut = {
|
|
|
1805
1993
|
boxSizing: "border-box",
|
|
1806
1994
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
1807
1995
|
color: "var(--page-text, #111827)"
|
|
1808
|
-
},
|
|
1996
|
+
}, Ct = {
|
|
1809
1997
|
display: "flex",
|
|
1810
1998
|
alignItems: "center",
|
|
1811
1999
|
gap: "8px",
|
|
1812
2000
|
fontSize: "14px",
|
|
1813
2001
|
color: "var(--page-text, #111827)"
|
|
1814
|
-
},
|
|
2002
|
+
}, $ = (e) => e ? {
|
|
1815
2003
|
readOnly: !0,
|
|
1816
2004
|
tabIndex: -1,
|
|
1817
2005
|
onMouseDown: (e) => e.preventDefault()
|
|
1818
2006
|
} : {};
|
|
1819
|
-
function
|
|
2007
|
+
function wt(e, t) {
|
|
1820
2008
|
if (!e) return !0;
|
|
1821
2009
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1822
2010
|
switch (e.op) {
|
|
@@ -1830,11 +2018,11 @@ function ft(e, t) {
|
|
|
1830
2018
|
default: return !1;
|
|
1831
2019
|
}
|
|
1832
2020
|
}
|
|
1833
|
-
var
|
|
2021
|
+
var Tt = {
|
|
1834
2022
|
display: "flex",
|
|
1835
2023
|
flexDirection: "column",
|
|
1836
2024
|
gap: 6
|
|
1837
|
-
},
|
|
2025
|
+
}, Et = {
|
|
1838
2026
|
font: "inherit",
|
|
1839
2027
|
fontSize: 15,
|
|
1840
2028
|
padding: "10px 12px",
|
|
@@ -1845,16 +2033,16 @@ var pt = {
|
|
|
1845
2033
|
width: "100%",
|
|
1846
2034
|
boxSizing: "border-box"
|
|
1847
2035
|
};
|
|
1848
|
-
function
|
|
2036
|
+
function Dt(e, t) {
|
|
1849
2037
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1850
2038
|
if (!e?.parentField) return n;
|
|
1851
2039
|
let r = t?.[e.parentField];
|
|
1852
2040
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1853
2041
|
}
|
|
1854
|
-
function
|
|
2042
|
+
function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1855
2043
|
let a = /* @__PURE__ */ d("span", {
|
|
1856
2044
|
style: {
|
|
1857
|
-
...
|
|
2045
|
+
...St,
|
|
1858
2046
|
fontSize: 14
|
|
1859
2047
|
},
|
|
1860
2048
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1863,7 +2051,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1863
2051
|
required: e.required || void 0,
|
|
1864
2052
|
placeholder: e.placeholder || void 0,
|
|
1865
2053
|
disabled: r || void 0,
|
|
1866
|
-
style:
|
|
2054
|
+
style: Et,
|
|
1867
2055
|
value: t ?? "",
|
|
1868
2056
|
onChange: (t) => n(e.name, t.target.value)
|
|
1869
2057
|
};
|
|
@@ -1892,7 +2080,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1892
2080
|
borderRadius: 8,
|
|
1893
2081
|
display: "block"
|
|
1894
2082
|
}
|
|
1895
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2083
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
|
|
1896
2084
|
url: e.src,
|
|
1897
2085
|
style: { width: "100%" }
|
|
1898
2086
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -1904,14 +2092,14 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1904
2092
|
display: "block"
|
|
1905
2093
|
}
|
|
1906
2094
|
}) : null : /* @__PURE__ */ d("label", {
|
|
1907
|
-
style:
|
|
2095
|
+
style: Tt,
|
|
1908
2096
|
children: [
|
|
1909
2097
|
a,
|
|
1910
2098
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
1911
2099
|
...o,
|
|
1912
2100
|
rows: 4,
|
|
1913
2101
|
style: {
|
|
1914
|
-
...
|
|
2102
|
+
...Et,
|
|
1915
2103
|
resize: "vertical"
|
|
1916
2104
|
}
|
|
1917
2105
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -1920,7 +2108,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1920
2108
|
children: [/* @__PURE__ */ u("option", {
|
|
1921
2109
|
value: "",
|
|
1922
2110
|
children: e.placeholder || "—"
|
|
1923
|
-
}),
|
|
2111
|
+
}), Dt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
1924
2112
|
value: typeof e == "string" ? e : e.value,
|
|
1925
2113
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1926
2114
|
}, t))]
|
|
@@ -1967,12 +2155,12 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1967
2155
|
]
|
|
1968
2156
|
});
|
|
1969
2157
|
}
|
|
1970
|
-
function
|
|
1971
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2158
|
+
function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2159
|
+
let { tenant: y, apiUrl: b } = r(q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
1972
2160
|
i(() => {
|
|
1973
2161
|
if (!f || !s) return;
|
|
1974
2162
|
let e = !0;
|
|
1975
|
-
return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e &&
|
|
2163
|
+
return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && w(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && w(null)), () => {
|
|
1976
2164
|
e = !1;
|
|
1977
2165
|
};
|
|
1978
2166
|
}, [
|
|
@@ -1985,27 +2173,27 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1985
2173
|
section: null,
|
|
1986
2174
|
fields: []
|
|
1987
2175
|
}];
|
|
1988
|
-
for (let e of Array.isArray(
|
|
2176
|
+
for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ? j.push({
|
|
1989
2177
|
section: e,
|
|
1990
2178
|
fields: []
|
|
1991
2179
|
}) : j[j.length - 1].fields.push(e);
|
|
1992
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2180
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || wt(e.section.condition, T)).map((e) => ({
|
|
1993
2181
|
...e,
|
|
1994
|
-
fields: e.fields.filter((e) =>
|
|
1995
|
-
})), P = M.length > 1, F = Math.min(
|
|
1996
|
-
let t =
|
|
2182
|
+
fields: e.fields.filter((e) => wt(e.condition, T))
|
|
2183
|
+
})), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2184
|
+
let t = T[e.name];
|
|
1997
2185
|
return e.required && (t == null || t === "" || t === !1);
|
|
1998
|
-
}),
|
|
2186
|
+
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
1999
2187
|
let r = {
|
|
2000
2188
|
...n,
|
|
2001
2189
|
[e]: t
|
|
2002
2190
|
};
|
|
2003
|
-
for (let t of Array.isArray(
|
|
2191
|
+
for (let t of Array.isArray(C?.fields) ? C.fields : []) t?.parentField === e && delete r[t.name];
|
|
2004
2192
|
return r;
|
|
2005
2193
|
});
|
|
2006
2194
|
return /* @__PURE__ */ d("div", {
|
|
2007
2195
|
ref: m,
|
|
2008
|
-
style:
|
|
2196
|
+
style: A(e),
|
|
2009
2197
|
children: [
|
|
2010
2198
|
/* @__PURE__ */ u("form", {
|
|
2011
2199
|
action: t || void 0,
|
|
@@ -2016,7 +2204,7 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2016
2204
|
if (e.preventDefault(), !h) {
|
|
2017
2205
|
if (s) {
|
|
2018
2206
|
let t = {};
|
|
2019
|
-
if (f) for (let [e, n] of Object.entries(
|
|
2207
|
+
if (f) for (let [e, n] of Object.entries(T)) n != null && n !== "" && (t[e] = n);
|
|
2020
2208
|
else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
2021
2209
|
try {
|
|
2022
2210
|
let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
|
|
@@ -2049,11 +2237,11 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2049
2237
|
}
|
|
2050
2238
|
},
|
|
2051
2239
|
style: {
|
|
2052
|
-
...
|
|
2053
|
-
display:
|
|
2240
|
+
...xt,
|
|
2241
|
+
display: k === "success" ? "none" : "flex"
|
|
2054
2242
|
},
|
|
2055
2243
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2056
|
-
P && /* @__PURE__ */ u(
|
|
2244
|
+
P && /* @__PURE__ */ u(rn, {
|
|
2057
2245
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2058
2246
|
active: F + 1,
|
|
2059
2247
|
style: { marginBottom: 8 }
|
|
@@ -2066,11 +2254,11 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2066
2254
|
},
|
|
2067
2255
|
children: N[F].section.help
|
|
2068
2256
|
}),
|
|
2069
|
-
|
|
2257
|
+
I.map((e) => /* @__PURE__ */ u(Ot, {
|
|
2070
2258
|
field: e,
|
|
2071
|
-
value:
|
|
2072
|
-
values:
|
|
2073
|
-
onChange:
|
|
2259
|
+
value: T[e.name],
|
|
2260
|
+
values: T,
|
|
2261
|
+
onChange: z,
|
|
2074
2262
|
inert: h
|
|
2075
2263
|
}, e.name)),
|
|
2076
2264
|
/* @__PURE__ */ d("div", {
|
|
@@ -2083,9 +2271,9 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2083
2271
|
children: [P && F > 0 && /* @__PURE__ */ u("button", {
|
|
2084
2272
|
type: "button",
|
|
2085
2273
|
disabled: h || void 0,
|
|
2086
|
-
onClick: () =>
|
|
2274
|
+
onClick: () => O(F - 1),
|
|
2087
2275
|
style: {
|
|
2088
|
-
...
|
|
2276
|
+
...X,
|
|
2089
2277
|
background: "transparent",
|
|
2090
2278
|
color: "inherit",
|
|
2091
2279
|
border: 0,
|
|
@@ -2093,26 +2281,26 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2093
2281
|
cursor: "pointer"
|
|
2094
2282
|
},
|
|
2095
2283
|
children: "Back"
|
|
2096
|
-
}), P && !
|
|
2284
|
+
}), P && !R ? /* @__PURE__ */ u("button", {
|
|
2097
2285
|
type: "button",
|
|
2098
|
-
disabled: h ||
|
|
2099
|
-
onClick: () =>
|
|
2286
|
+
disabled: h || L.length > 0,
|
|
2287
|
+
onClick: () => O(F + 1),
|
|
2100
2288
|
style: {
|
|
2101
|
-
...
|
|
2289
|
+
...X,
|
|
2102
2290
|
border: 0,
|
|
2103
2291
|
padding: "10px 22px",
|
|
2104
2292
|
borderRadius: 8,
|
|
2105
2293
|
fontSize: 15,
|
|
2106
2294
|
fontWeight: 600,
|
|
2107
2295
|
cursor: "pointer",
|
|
2108
|
-
opacity:
|
|
2296
|
+
opacity: L.length ? .5 : 1
|
|
2109
2297
|
},
|
|
2110
2298
|
children: "Next"
|
|
2111
2299
|
}) : /* @__PURE__ */ u("button", {
|
|
2112
2300
|
type: "submit",
|
|
2113
2301
|
disabled: h || void 0,
|
|
2114
2302
|
style: {
|
|
2115
|
-
...
|
|
2303
|
+
...X,
|
|
2116
2304
|
border: 0,
|
|
2117
2305
|
padding: "10px 22px",
|
|
2118
2306
|
borderRadius: 8,
|
|
@@ -2126,12 +2314,12 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2126
2314
|
] }) : g
|
|
2127
2315
|
}),
|
|
2128
2316
|
/* @__PURE__ */ u("div", {
|
|
2129
|
-
style: { display:
|
|
2317
|
+
style: { display: k === "success" ? "block" : "none" },
|
|
2130
2318
|
children: _?.success ?? null
|
|
2131
2319
|
}),
|
|
2132
2320
|
/* @__PURE__ */ u("div", {
|
|
2133
2321
|
style: {
|
|
2134
|
-
display:
|
|
2322
|
+
display: k === "error" ? "block" : "none",
|
|
2135
2323
|
marginTop: 12
|
|
2136
2324
|
},
|
|
2137
2325
|
children: _?.error ?? null
|
|
@@ -2139,10 +2327,10 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2139
2327
|
]
|
|
2140
2328
|
});
|
|
2141
2329
|
}
|
|
2142
|
-
var
|
|
2330
|
+
var At = null, jt = null, Mt = (e) => {
|
|
2143
2331
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2144
|
-
if (
|
|
2145
|
-
if (
|
|
2332
|
+
if (At && jt === t) return At;
|
|
2333
|
+
if (At && typeof window < "u") {
|
|
2146
2334
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2147
2335
|
delete window[e];
|
|
2148
2336
|
} catch {
|
|
@@ -2150,22 +2338,22 @@ var Q = null, vt = null, yt = (e) => {
|
|
|
2150
2338
|
}
|
|
2151
2339
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2152
2340
|
}
|
|
2153
|
-
return
|
|
2341
|
+
return jt = t, At = new Promise((e) => {
|
|
2154
2342
|
if (typeof window > "u") return;
|
|
2155
2343
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2156
2344
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2157
2345
|
let n = document.createElement("script");
|
|
2158
2346
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2159
|
-
}),
|
|
2347
|
+
}), At;
|
|
2160
2348
|
};
|
|
2161
|
-
function
|
|
2162
|
-
let p = r(
|
|
2349
|
+
function Nt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2350
|
+
let p = r(q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2163
2351
|
if (_.current = f, i(() => {
|
|
2164
2352
|
if (l || !h || !g.current) return;
|
|
2165
2353
|
let e = !0, r = (t) => {
|
|
2166
2354
|
e && typeof _.current == "function" && _.current(t);
|
|
2167
2355
|
};
|
|
2168
|
-
return
|
|
2356
|
+
return Mt(a).then((i) => {
|
|
2169
2357
|
if (!(!e || !g.current || !i?.render)) {
|
|
2170
2358
|
g.current.innerHTML = "", r("");
|
|
2171
2359
|
try {
|
|
@@ -2192,7 +2380,7 @@ function bt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2192
2380
|
let e = t === "dark";
|
|
2193
2381
|
return /* @__PURE__ */ d("div", {
|
|
2194
2382
|
ref: c,
|
|
2195
|
-
style:
|
|
2383
|
+
style: A(o),
|
|
2196
2384
|
children: [/* @__PURE__ */ d("div", {
|
|
2197
2385
|
style: {
|
|
2198
2386
|
width: n === "compact" ? 164 : 302,
|
|
@@ -2243,21 +2431,21 @@ function bt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2243
2431
|
}
|
|
2244
2432
|
return h ? /* @__PURE__ */ u("div", {
|
|
2245
2433
|
ref: c,
|
|
2246
|
-
style:
|
|
2434
|
+
style: A(o),
|
|
2247
2435
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2248
2436
|
}) : null;
|
|
2249
2437
|
}
|
|
2250
|
-
function
|
|
2438
|
+
function Pt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2251
2439
|
return /* @__PURE__ */ u("label", {
|
|
2252
2440
|
ref: r,
|
|
2253
2441
|
style: {
|
|
2254
|
-
...
|
|
2255
|
-
...
|
|
2442
|
+
...St,
|
|
2443
|
+
...A(n)
|
|
2256
2444
|
},
|
|
2257
|
-
children:
|
|
2445
|
+
children: Z(t, e, i)
|
|
2258
2446
|
});
|
|
2259
2447
|
}
|
|
2260
|
-
function
|
|
2448
|
+
function Ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2261
2449
|
return /* @__PURE__ */ u("input", {
|
|
2262
2450
|
ref: a,
|
|
2263
2451
|
type: e,
|
|
@@ -2265,13 +2453,13 @@ function St({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2265
2453
|
placeholder: n,
|
|
2266
2454
|
required: !o && !!r,
|
|
2267
2455
|
style: {
|
|
2268
|
-
...
|
|
2269
|
-
...
|
|
2456
|
+
...Q,
|
|
2457
|
+
...A(i)
|
|
2270
2458
|
},
|
|
2271
|
-
|
|
2459
|
+
...$(o)
|
|
2272
2460
|
});
|
|
2273
2461
|
}
|
|
2274
|
-
function
|
|
2462
|
+
function It({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2275
2463
|
return /* @__PURE__ */ u("textarea", {
|
|
2276
2464
|
ref: a,
|
|
2277
2465
|
name: e || void 0,
|
|
@@ -2279,19 +2467,19 @@ function Ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2279
2467
|
rows: n,
|
|
2280
2468
|
required: !o && !!r,
|
|
2281
2469
|
style: {
|
|
2282
|
-
...
|
|
2470
|
+
...Q,
|
|
2283
2471
|
resize: "vertical",
|
|
2284
|
-
...
|
|
2472
|
+
...A(i)
|
|
2285
2473
|
},
|
|
2286
|
-
|
|
2474
|
+
...$(o)
|
|
2287
2475
|
});
|
|
2288
2476
|
}
|
|
2289
|
-
function
|
|
2477
|
+
function Lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2290
2478
|
return /* @__PURE__ */ d("label", {
|
|
2291
2479
|
ref: o,
|
|
2292
2480
|
style: {
|
|
2293
|
-
...
|
|
2294
|
-
...
|
|
2481
|
+
...Ct,
|
|
2482
|
+
...A(a)
|
|
2295
2483
|
},
|
|
2296
2484
|
children: [/* @__PURE__ */ u("input", {
|
|
2297
2485
|
type: e,
|
|
@@ -2307,7 +2495,7 @@ function wt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2307
2495
|
}), t]
|
|
2308
2496
|
});
|
|
2309
2497
|
}
|
|
2310
|
-
function
|
|
2498
|
+
function Rt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2311
2499
|
return /* @__PURE__ */ d("select", {
|
|
2312
2500
|
ref: a,
|
|
2313
2501
|
name: e || void 0,
|
|
@@ -2316,9 +2504,9 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2316
2504
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2317
2505
|
tabIndex: o ? -1 : void 0,
|
|
2318
2506
|
style: {
|
|
2319
|
-
...
|
|
2507
|
+
...Q,
|
|
2320
2508
|
appearance: "auto",
|
|
2321
|
-
...
|
|
2509
|
+
...A(i)
|
|
2322
2510
|
},
|
|
2323
2511
|
children: [t !== "" && /* @__PURE__ */ u("option", {
|
|
2324
2512
|
value: "",
|
|
@@ -2330,19 +2518,19 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2330
2518
|
}, t))]
|
|
2331
2519
|
});
|
|
2332
2520
|
}
|
|
2333
|
-
function
|
|
2521
|
+
function zt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2334
2522
|
let [s, l] = c(null);
|
|
2335
2523
|
return /* @__PURE__ */ d("label", {
|
|
2336
2524
|
ref: a,
|
|
2337
2525
|
style: {
|
|
2338
|
-
...
|
|
2526
|
+
...Q,
|
|
2339
2527
|
display: "flex",
|
|
2340
2528
|
alignItems: "center",
|
|
2341
2529
|
gap: "8px",
|
|
2342
2530
|
cursor: o ? "default" : "pointer",
|
|
2343
2531
|
borderStyle: "dashed",
|
|
2344
2532
|
color: s ? "#111827" : "#6b7280",
|
|
2345
|
-
...
|
|
2533
|
+
...A(i)
|
|
2346
2534
|
},
|
|
2347
2535
|
children: [
|
|
2348
2536
|
/* @__PURE__ */ u("input", {
|
|
@@ -2362,12 +2550,12 @@ function Et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2362
2550
|
]
|
|
2363
2551
|
});
|
|
2364
2552
|
}
|
|
2365
|
-
function
|
|
2553
|
+
function Bt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2366
2554
|
return /* @__PURE__ */ u("button", {
|
|
2367
2555
|
ref: n,
|
|
2368
2556
|
type: r ? "button" : "submit",
|
|
2369
2557
|
style: {
|
|
2370
|
-
...
|
|
2558
|
+
...X,
|
|
2371
2559
|
border: 0,
|
|
2372
2560
|
cursor: "pointer",
|
|
2373
2561
|
alignSelf: "flex-start",
|
|
@@ -2377,12 +2565,12 @@ function Dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2377
2565
|
fontWeight: 600,
|
|
2378
2566
|
lineHeight: 1.4,
|
|
2379
2567
|
fontFamily: "inherit",
|
|
2380
|
-
...
|
|
2568
|
+
...A(t)
|
|
2381
2569
|
},
|
|
2382
2570
|
children: e
|
|
2383
2571
|
});
|
|
2384
2572
|
}
|
|
2385
|
-
function
|
|
2573
|
+
function Vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2386
2574
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2387
2575
|
return /* @__PURE__ */ u("div", {
|
|
2388
2576
|
ref: r,
|
|
@@ -2391,7 +2579,7 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2391
2579
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
2392
2580
|
gap: 16,
|
|
2393
2581
|
width: "100%",
|
|
2394
|
-
...
|
|
2582
|
+
...A(n)
|
|
2395
2583
|
},
|
|
2396
2584
|
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
|
|
2397
2585
|
style: { minWidth: 0 },
|
|
@@ -2399,22 +2587,22 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2399
2587
|
}, t))
|
|
2400
2588
|
});
|
|
2401
2589
|
}
|
|
2402
|
-
function
|
|
2403
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
2590
|
+
function Ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2591
|
+
let { tenant: v, apiUrl: y, locale: b } = r(q), x = r(we), S = r(J), [, C] = c(0);
|
|
2404
2592
|
i(() => {
|
|
2405
2593
|
if (typeof window > "u") return;
|
|
2406
|
-
let e = () =>
|
|
2594
|
+
let e = () => C((e) => e + 1);
|
|
2407
2595
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
2408
2596
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2409
2597
|
};
|
|
2410
2598
|
}, []);
|
|
2411
|
-
let
|
|
2599
|
+
let w = Ce(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
|
|
2412
2600
|
if (i(() => {
|
|
2413
|
-
if (!e ||
|
|
2601
|
+
if (!e || D) return;
|
|
2414
2602
|
let n = !0, r = new URLSearchParams();
|
|
2415
|
-
if (b && r.set("locale", b),
|
|
2603
|
+
if (b && r.set("locale", b), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
|
|
2416
2604
|
let e = Math.max(1, Number(t) || 6);
|
|
2417
|
-
r.set("offset", String((
|
|
2605
|
+
r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
|
|
2418
2606
|
}
|
|
2419
2607
|
let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2420
2608
|
return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
|
|
@@ -2428,14 +2616,14 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2428
2616
|
v,
|
|
2429
2617
|
y,
|
|
2430
2618
|
b,
|
|
2431
|
-
|
|
2619
|
+
D,
|
|
2432
2620
|
m,
|
|
2433
|
-
|
|
2621
|
+
O,
|
|
2434
2622
|
t,
|
|
2435
|
-
|
|
2436
|
-
|
|
2623
|
+
E,
|
|
2624
|
+
T
|
|
2437
2625
|
]), !e) return null;
|
|
2438
|
-
let M = Math.max(1, Number(t) || 6), N = m ?
|
|
2626
|
+
let M = Math.max(1, Number(t) || 6), N = m ? D || e.startsWith("api:") ? (D ?? k ?? []).slice((O - 1) * M, O * M) : (k ?? []).slice(0, M) : (D ?? k ?? []).slice(0, M), P = Math.min(Math.max(Number(a) || 3, 1), 6), F = n === "list" ? {
|
|
2439
2627
|
display: "flex",
|
|
2440
2628
|
flexDirection: "column",
|
|
2441
2629
|
gap: 20
|
|
@@ -2449,21 +2637,21 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2449
2637
|
style: {
|
|
2450
2638
|
width: "100%",
|
|
2451
2639
|
...F,
|
|
2452
|
-
...
|
|
2640
|
+
...A(g)
|
|
2453
2641
|
},
|
|
2454
2642
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
2455
2643
|
style: { minWidth: 0 },
|
|
2456
|
-
children: x.render(p, (t) =>
|
|
2644
|
+
children: x.render(p, (t) => Oe(t, e))
|
|
2457
2645
|
}, e.id ?? e?.data?.slug))
|
|
2458
2646
|
}) : /* @__PURE__ */ u("div", {
|
|
2459
2647
|
ref: _,
|
|
2460
2648
|
style: {
|
|
2461
2649
|
width: "100%",
|
|
2462
2650
|
...F,
|
|
2463
|
-
...
|
|
2651
|
+
...A(g)
|
|
2464
2652
|
},
|
|
2465
2653
|
children: N.map((e) => {
|
|
2466
|
-
let t = o ?
|
|
2654
|
+
let t = o ? Ee(e?.data, o) : null, r = s ? Y(Ee(e?.data, s)) : null, i = l ? Ee(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Y(i), f = n === "list";
|
|
2467
2655
|
return /* @__PURE__ */ d("div", {
|
|
2468
2656
|
style: {
|
|
2469
2657
|
display: "flex",
|
|
@@ -2510,7 +2698,7 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2510
2698
|
lineHeight: 1.55,
|
|
2511
2699
|
opacity: .85
|
|
2512
2700
|
},
|
|
2513
|
-
children:
|
|
2701
|
+
children: We(a)
|
|
2514
2702
|
})
|
|
2515
2703
|
]
|
|
2516
2704
|
})]
|
|
@@ -2518,8 +2706,8 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2518
2706
|
})
|
|
2519
2707
|
});
|
|
2520
2708
|
}
|
|
2521
|
-
function
|
|
2522
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
2709
|
+
function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
2710
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
|
|
2523
2711
|
height: 34,
|
|
2524
2712
|
padding: "0 12px",
|
|
2525
2713
|
borderRadius: 8,
|
|
@@ -2561,13 +2749,13 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2561
2749
|
alignItems: "center",
|
|
2562
2750
|
gap: 8,
|
|
2563
2751
|
width: "100%",
|
|
2564
|
-
...
|
|
2752
|
+
...A(n)
|
|
2565
2753
|
},
|
|
2566
2754
|
children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
2567
2755
|
name: `f_${e.name}`,
|
|
2568
2756
|
defaultValue: o[e.name] ?? "",
|
|
2569
2757
|
style: s,
|
|
2570
|
-
|
|
2758
|
+
...$(i),
|
|
2571
2759
|
children: [/* @__PURE__ */ u("option", {
|
|
2572
2760
|
value: "",
|
|
2573
2761
|
children: e.label || e.name
|
|
@@ -2582,7 +2770,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2582
2770
|
name: `f_${e.name}`,
|
|
2583
2771
|
defaultValue: o[e.name] ?? "",
|
|
2584
2772
|
style: s,
|
|
2585
|
-
|
|
2773
|
+
...$(i),
|
|
2586
2774
|
children: [
|
|
2587
2775
|
/* @__PURE__ */ u("option", {
|
|
2588
2776
|
value: "",
|
|
@@ -2603,7 +2791,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2603
2791
|
defaultValue: o[e.name] ?? "",
|
|
2604
2792
|
placeholder: e.label || e.name,
|
|
2605
2793
|
style: s,
|
|
2606
|
-
|
|
2794
|
+
...$(i)
|
|
2607
2795
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
2608
2796
|
type: "submit",
|
|
2609
2797
|
style: {
|
|
@@ -2616,16 +2804,16 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2616
2804
|
fontWeight: 600,
|
|
2617
2805
|
cursor: i ? "default" : "pointer"
|
|
2618
2806
|
},
|
|
2619
|
-
|
|
2807
|
+
...$(i),
|
|
2620
2808
|
children: t
|
|
2621
2809
|
})]
|
|
2622
2810
|
});
|
|
2623
2811
|
}
|
|
2624
|
-
function
|
|
2812
|
+
function Wt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2625
2813
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
2626
2814
|
ref: r,
|
|
2627
2815
|
"aria-label": "Breadcrumb",
|
|
2628
|
-
style: { ...
|
|
2816
|
+
style: { ...A(n) },
|
|
2629
2817
|
children: /* @__PURE__ */ u("ol", {
|
|
2630
2818
|
style: {
|
|
2631
2819
|
display: "flex",
|
|
@@ -2671,8 +2859,8 @@ function jt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2671
2859
|
})
|
|
2672
2860
|
}) : null;
|
|
2673
2861
|
}
|
|
2674
|
-
function
|
|
2675
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
2862
|
+
function Gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
|
|
2863
|
+
let { tenant: g, apiUrl: _ } = r(q), v = r(J), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2676
2864
|
i(() => {
|
|
2677
2865
|
if (!o || Number.isFinite(x)) return;
|
|
2678
2866
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2689,9 +2877,9 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2689
2877
|
_,
|
|
2690
2878
|
x
|
|
2691
2879
|
]);
|
|
2692
|
-
let S = Math.max(1, Number(s) || 6),
|
|
2693
|
-
if (o &&
|
|
2694
|
-
let
|
|
2880
|
+
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
2881
|
+
if (o && C === null || o && f && !(C > 0)) return null;
|
|
2882
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
2695
2883
|
if (o) {
|
|
2696
2884
|
if (typeof window < "u") {
|
|
2697
2885
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2700,7 +2888,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2700
2888
|
return `?page=${e}`;
|
|
2701
2889
|
}
|
|
2702
2890
|
return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
|
|
2703
|
-
},
|
|
2891
|
+
}, D = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", O = p ? (e) => e.preventDefault() : void 0, k = (e) => ({
|
|
2704
2892
|
display: "inline-flex",
|
|
2705
2893
|
alignItems: "center",
|
|
2706
2894
|
justifyContent: "center",
|
|
@@ -2722,49 +2910,49 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2722
2910
|
flexWrap: "wrap",
|
|
2723
2911
|
gap: 8,
|
|
2724
2912
|
alignItems: "center",
|
|
2725
|
-
justifyContent:
|
|
2726
|
-
...
|
|
2913
|
+
justifyContent: D,
|
|
2914
|
+
...A(m)
|
|
2727
2915
|
},
|
|
2728
2916
|
children: [
|
|
2729
2917
|
n && /* @__PURE__ */ u("a", {
|
|
2730
|
-
href:
|
|
2731
|
-
onClick:
|
|
2918
|
+
href: T > 1 ? E(T - 1) : "#",
|
|
2919
|
+
onClick: O,
|
|
2732
2920
|
"aria-label": "Previous",
|
|
2733
2921
|
style: {
|
|
2734
|
-
...
|
|
2735
|
-
opacity:
|
|
2922
|
+
...k(!1),
|
|
2923
|
+
opacity: T > 1 ? 1 : .4
|
|
2736
2924
|
},
|
|
2737
2925
|
children: "‹"
|
|
2738
2926
|
}),
|
|
2739
|
-
Array.from({ length:
|
|
2740
|
-
href:
|
|
2741
|
-
onClick:
|
|
2742
|
-
"aria-current": e ===
|
|
2743
|
-
style:
|
|
2927
|
+
Array.from({ length: w }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
|
|
2928
|
+
href: E(e),
|
|
2929
|
+
onClick: O,
|
|
2930
|
+
"aria-current": e === T ? "page" : void 0,
|
|
2931
|
+
style: k(e === T),
|
|
2744
2932
|
children: e
|
|
2745
2933
|
}, e)),
|
|
2746
2934
|
n && /* @__PURE__ */ u("a", {
|
|
2747
|
-
href:
|
|
2748
|
-
onClick:
|
|
2935
|
+
href: T < w ? E(T + 1) : "#",
|
|
2936
|
+
onClick: O,
|
|
2749
2937
|
"aria-label": "Next",
|
|
2750
2938
|
style: {
|
|
2751
|
-
...
|
|
2752
|
-
opacity:
|
|
2939
|
+
...k(!1),
|
|
2940
|
+
opacity: T < w ? 1 : .4
|
|
2753
2941
|
},
|
|
2754
2942
|
children: "›"
|
|
2755
2943
|
})
|
|
2756
2944
|
]
|
|
2757
2945
|
});
|
|
2758
2946
|
}
|
|
2759
|
-
var
|
|
2947
|
+
var Kt = "webim.page_mode", qt = () => {
|
|
2760
2948
|
if (typeof window > "u") return "auto";
|
|
2761
2949
|
try {
|
|
2762
|
-
let e = window.localStorage.getItem(
|
|
2950
|
+
let e = window.localStorage.getItem(Kt);
|
|
2763
2951
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2764
2952
|
} catch {
|
|
2765
2953
|
return "auto";
|
|
2766
2954
|
}
|
|
2767
|
-
},
|
|
2955
|
+
}, Jt = (e) => {
|
|
2768
2956
|
let t = {
|
|
2769
2957
|
width: 16,
|
|
2770
2958
|
height: 16,
|
|
@@ -2796,13 +2984,13 @@ var Nt = "webim.page_mode", Pt = () => {
|
|
|
2796
2984
|
rx: "2"
|
|
2797
2985
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
2798
2986
|
});
|
|
2799
|
-
},
|
|
2987
|
+
}, Yt = {
|
|
2800
2988
|
light: "Light theme",
|
|
2801
2989
|
dark: "Dark theme",
|
|
2802
2990
|
auto: "Follow the device theme"
|
|
2803
2991
|
};
|
|
2804
|
-
function
|
|
2805
|
-
let [o, l] = c(a ? "auto" :
|
|
2992
|
+
function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
2993
|
+
let [o, l] = c(a ? "auto" : qt), d = s(null), f = (e) => {
|
|
2806
2994
|
d.current = e, typeof r == "function" && r(e);
|
|
2807
2995
|
};
|
|
2808
2996
|
i(() => {
|
|
@@ -2810,7 +2998,7 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
2810
2998
|
let e = d.current?.closest?.(".webim-page");
|
|
2811
2999
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
2812
3000
|
try {
|
|
2813
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3001
|
+
o === "auto" ? window.localStorage.removeItem(Kt) : window.localStorage.setItem(Kt, o);
|
|
2814
3002
|
} catch {}
|
|
2815
3003
|
}, [o, a]);
|
|
2816
3004
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -2841,12 +3029,12 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
2841
3029
|
padding: 3,
|
|
2842
3030
|
borderRadius: 999,
|
|
2843
3031
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2844
|
-
...
|
|
3032
|
+
...A(n)
|
|
2845
3033
|
},
|
|
2846
3034
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
2847
3035
|
type: "button",
|
|
2848
|
-
title:
|
|
2849
|
-
"aria-label":
|
|
3036
|
+
title: Yt[e],
|
|
3037
|
+
"aria-label": Yt[e],
|
|
2850
3038
|
"aria-pressed": e === m,
|
|
2851
3039
|
onClick: a ? void 0 : () => l(e),
|
|
2852
3040
|
style: {
|
|
@@ -2857,27 +3045,27 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
2857
3045
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
2858
3046
|
opacity: e === m ? 1 : .7
|
|
2859
3047
|
},
|
|
2860
|
-
children:
|
|
3048
|
+
children: Jt(e)
|
|
2861
3049
|
}, e))
|
|
2862
3050
|
});
|
|
2863
3051
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
2864
3052
|
return /* @__PURE__ */ u("button", {
|
|
2865
3053
|
ref: f,
|
|
2866
3054
|
type: "button",
|
|
2867
|
-
title:
|
|
2868
|
-
"aria-label": `Theme: ${
|
|
3055
|
+
title: Yt[m],
|
|
3056
|
+
"aria-label": `Theme: ${Yt[m]} — switch to ${Yt[g]}`,
|
|
2869
3057
|
onClick: a ? void 0 : () => l(g),
|
|
2870
3058
|
style: {
|
|
2871
3059
|
...h,
|
|
2872
3060
|
width: 36,
|
|
2873
3061
|
height: 36,
|
|
2874
3062
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
2875
|
-
...
|
|
3063
|
+
...A(n)
|
|
2876
3064
|
},
|
|
2877
|
-
children:
|
|
3065
|
+
children: Jt(m)
|
|
2878
3066
|
});
|
|
2879
3067
|
}
|
|
2880
|
-
function
|
|
3068
|
+
function Zt(e) {
|
|
2881
3069
|
let t = e?.parentElement;
|
|
2882
3070
|
for (; t && t !== document.body;) {
|
|
2883
3071
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -2886,7 +3074,7 @@ function Lt(e) {
|
|
|
2886
3074
|
}
|
|
2887
3075
|
return window;
|
|
2888
3076
|
}
|
|
2889
|
-
var
|
|
3077
|
+
var Qt = (e) => e === window ? window.scrollY : e.scrollTop, $t = {
|
|
2890
3078
|
"bottom-right": (e) => ({
|
|
2891
3079
|
right: e,
|
|
2892
3080
|
bottom: e
|
|
@@ -2901,7 +3089,7 @@ var Rt = (e) => e === window ? window.scrollY : e.scrollTop, zt = {
|
|
|
2901
3089
|
transform: "translateX(-50%)"
|
|
2902
3090
|
})
|
|
2903
3091
|
};
|
|
2904
|
-
function
|
|
3092
|
+
function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
2905
3093
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
2906
3094
|
b(e), typeof p == "function" && p(e);
|
|
2907
3095
|
};
|
|
@@ -2912,8 +3100,8 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2912
3100
|
}
|
|
2913
3101
|
if (!y) return;
|
|
2914
3102
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
2915
|
-
let t =
|
|
2916
|
-
v(n ||
|
|
3103
|
+
let t = Zt(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3104
|
+
v(n || Qt(t) > e);
|
|
2917
3105
|
};
|
|
2918
3106
|
return t(), document.addEventListener("scroll", t, {
|
|
2919
3107
|
capture: !0,
|
|
@@ -2927,7 +3115,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2927
3115
|
]);
|
|
2928
3116
|
let S = () => {
|
|
2929
3117
|
if (m) return;
|
|
2930
|
-
let e =
|
|
3118
|
+
let e = Zt(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
2931
3119
|
e === window ? window.scrollTo({
|
|
2932
3120
|
top: 0,
|
|
2933
3121
|
behavior: n
|
|
@@ -2935,26 +3123,26 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2935
3123
|
top: 0,
|
|
2936
3124
|
behavior: n
|
|
2937
3125
|
});
|
|
2938
|
-
},
|
|
3126
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = $t[n] ? n : "bottom-right", D = h ? {
|
|
2939
3127
|
position: "fixed",
|
|
2940
3128
|
zIndex: 5,
|
|
2941
|
-
bottom: (h.bottom ?? 0) +
|
|
2942
|
-
...
|
|
2943
|
-
...
|
|
2944
|
-
...
|
|
3129
|
+
bottom: (h.bottom ?? 0) + C,
|
|
3130
|
+
...E === "bottom-left" ? { left: (h.left ?? 0) + C } : null,
|
|
3131
|
+
...E === "bottom-right" ? { right: (h.right ?? 0) + C } : null,
|
|
3132
|
+
...E === "bottom-center" ? {
|
|
2945
3133
|
left: (h.left ?? 0) + (h.width ?? 0) / 2,
|
|
2946
3134
|
transform: "translateX(-50%)"
|
|
2947
3135
|
} : null
|
|
2948
3136
|
} : {
|
|
2949
3137
|
position: "fixed",
|
|
2950
3138
|
zIndex: 2147482e3,
|
|
2951
|
-
|
|
3139
|
+
...$t[E](C)
|
|
2952
3140
|
};
|
|
2953
3141
|
return /* @__PURE__ */ d("button", {
|
|
2954
3142
|
ref: x,
|
|
2955
3143
|
type: "button",
|
|
2956
|
-
title:
|
|
2957
|
-
"aria-label":
|
|
3144
|
+
title: T,
|
|
3145
|
+
"aria-label": T,
|
|
2958
3146
|
"aria-hidden": !_,
|
|
2959
3147
|
tabIndex: _ ? 0 : -1,
|
|
2960
3148
|
onClick: S,
|
|
@@ -2962,14 +3150,14 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2962
3150
|
display: "inline-flex",
|
|
2963
3151
|
alignItems: "center",
|
|
2964
3152
|
justifyContent: "center",
|
|
2965
|
-
gap:
|
|
3153
|
+
gap: w ? 8 : 0,
|
|
2966
3154
|
appearance: "none",
|
|
2967
3155
|
font: "inherit",
|
|
2968
3156
|
fontSize: 14,
|
|
2969
3157
|
fontWeight: 600,
|
|
2970
|
-
width:
|
|
3158
|
+
width: w ? "auto" : 44,
|
|
2971
3159
|
height: 44,
|
|
2972
|
-
padding:
|
|
3160
|
+
padding: w ? "0 18px" : 0,
|
|
2973
3161
|
borderRadius: 999,
|
|
2974
3162
|
border: "1px solid transparent",
|
|
2975
3163
|
background: s || "var(--page-accent, #111827)",
|
|
@@ -2979,9 +3167,9 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2979
3167
|
opacity: +!!_,
|
|
2980
3168
|
pointerEvents: _ ? "auto" : "none",
|
|
2981
3169
|
transition: "opacity 160ms ease, transform 160ms ease",
|
|
2982
|
-
...
|
|
2983
|
-
...
|
|
2984
|
-
...
|
|
3170
|
+
...D,
|
|
3171
|
+
...A(f),
|
|
3172
|
+
...D.transform ? { transform: D.transform } : null
|
|
2985
3173
|
},
|
|
2986
3174
|
children: [/* @__PURE__ */ u("svg", {
|
|
2987
3175
|
width: "18",
|
|
@@ -2996,10 +3184,10 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
2996
3184
|
strokeLinecap: "round",
|
|
2997
3185
|
strokeLinejoin: "round"
|
|
2998
3186
|
})
|
|
2999
|
-
}),
|
|
3187
|
+
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3000
3188
|
});
|
|
3001
3189
|
}
|
|
3002
|
-
var
|
|
3190
|
+
var tn = {
|
|
3003
3191
|
facebook: {
|
|
3004
3192
|
label: "Facebook",
|
|
3005
3193
|
color: "#1877f2",
|
|
@@ -3066,8 +3254,8 @@ var Vt = {
|
|
|
3066
3254
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
3067
3255
|
}
|
|
3068
3256
|
};
|
|
3069
|
-
function
|
|
3070
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3257
|
+
function nn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3258
|
+
let l = Array.isArray(e) ? e.filter((e) => e && tn[e.network]) : [];
|
|
3071
3259
|
if (!l.length) return null;
|
|
3072
3260
|
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3073
3261
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3077,10 +3265,10 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3077
3265
|
flexWrap: "wrap",
|
|
3078
3266
|
alignItems: "center",
|
|
3079
3267
|
gap: p,
|
|
3080
|
-
...
|
|
3268
|
+
...A(o)
|
|
3081
3269
|
},
|
|
3082
3270
|
children: l.map((e, r) => {
|
|
3083
|
-
let i =
|
|
3271
|
+
let i = tn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
3084
3272
|
return /* @__PURE__ */ u("a", {
|
|
3085
3273
|
href: e.url || "#",
|
|
3086
3274
|
onClick: h,
|
|
@@ -3114,7 +3302,7 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3114
3302
|
})
|
|
3115
3303
|
});
|
|
3116
3304
|
}
|
|
3117
|
-
function
|
|
3305
|
+
function rn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3118
3306
|
if (!t.length) return null;
|
|
3119
3307
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3120
3308
|
width: 32,
|
|
@@ -3152,7 +3340,7 @@ function Ut({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3152
3340
|
flexDirection: r ? "column" : "row",
|
|
3153
3341
|
alignItems: r ? "stretch" : "flex-start",
|
|
3154
3342
|
gap: r ? 4 : 8,
|
|
3155
|
-
...
|
|
3343
|
+
...A(i)
|
|
3156
3344
|
},
|
|
3157
3345
|
children: t.map((t, n) => {
|
|
3158
3346
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
@@ -3192,7 +3380,7 @@ function Ut({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3192
3380
|
})
|
|
3193
3381
|
});
|
|
3194
3382
|
}
|
|
3195
|
-
var
|
|
3383
|
+
var an = {
|
|
3196
3384
|
small: {
|
|
3197
3385
|
w: 132,
|
|
3198
3386
|
h: 46,
|
|
@@ -3214,10 +3402,10 @@ var Wt = {
|
|
|
3214
3402
|
title: 12.5,
|
|
3215
3403
|
avatar: 46
|
|
3216
3404
|
}
|
|
3217
|
-
},
|
|
3218
|
-
|
|
3219
|
-
function
|
|
3220
|
-
let r =
|
|
3405
|
+
}, on = (e) => an[e] ?? an.medium;
|
|
3406
|
+
an.medium.w, an.medium.h;
|
|
3407
|
+
function sn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3408
|
+
let r = on(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 = [];
|
|
3221
3409
|
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);
|
|
3222
3410
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3223
3411
|
if (t.has(e.id)) return 0;
|
|
@@ -3269,19 +3457,19 @@ function Kt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3269
3457
|
horizontal: n
|
|
3270
3458
|
};
|
|
3271
3459
|
}
|
|
3272
|
-
var
|
|
3460
|
+
var cn = (e, t) => {
|
|
3273
3461
|
let n = String(e ?? "");
|
|
3274
3462
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3275
|
-
},
|
|
3463
|
+
}, ln = (e) => {
|
|
3276
3464
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3277
3465
|
if (!t) return "#ffffff";
|
|
3278
3466
|
let n = t[1];
|
|
3279
3467
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3280
3468
|
let r = parseInt(n, 16);
|
|
3281
3469
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3282
|
-
},
|
|
3283
|
-
function
|
|
3284
|
-
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 ? "" :
|
|
3470
|
+
}, un = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3471
|
+
function dn(e, t = {}) {
|
|
3472
|
+
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 ? "" : Y(e);
|
|
3285
3473
|
return n.map((e) => {
|
|
3286
3474
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3287
3475
|
return {
|
|
@@ -3295,11 +3483,11 @@ function Xt(e, t = {}) {
|
|
|
3295
3483
|
};
|
|
3296
3484
|
});
|
|
3297
3485
|
}
|
|
3298
|
-
var
|
|
3486
|
+
var fn = {
|
|
3299
3487
|
size: 36,
|
|
3300
3488
|
pad: 10
|
|
3301
3489
|
};
|
|
3302
|
-
function
|
|
3490
|
+
function pn({ node: e, onClose: t }) {
|
|
3303
3491
|
return i(() => {
|
|
3304
3492
|
let e = (e) => e.key === "Escape" && t();
|
|
3305
3493
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3420,31 +3608,31 @@ function Qt({ node: e, onClose: t }) {
|
|
|
3420
3608
|
})
|
|
3421
3609
|
});
|
|
3422
3610
|
}
|
|
3423
|
-
function
|
|
3424
|
-
let b = a(), [x, S] = c(null), { tenant:
|
|
3611
|
+
function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3612
|
+
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(q), T = r(J)?.[t], [E, D] = c(null);
|
|
3425
3613
|
i(() => {
|
|
3426
|
-
if (!t ||
|
|
3614
|
+
if (!t || T) return;
|
|
3427
3615
|
let e = !0;
|
|
3428
|
-
return fetch(`${
|
|
3616
|
+
return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
|
|
3429
3617
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3430
|
-
e &&
|
|
3431
|
-
}).catch(() => e &&
|
|
3618
|
+
e && D(n);
|
|
3619
|
+
}).catch(() => e && D([])), () => {
|
|
3432
3620
|
e = !1;
|
|
3433
3621
|
};
|
|
3434
3622
|
}, [
|
|
3435
3623
|
t,
|
|
3624
|
+
C,
|
|
3436
3625
|
w,
|
|
3437
|
-
T
|
|
3438
|
-
E
|
|
3626
|
+
T
|
|
3439
3627
|
]);
|
|
3440
|
-
let
|
|
3628
|
+
let O = t ? dn(T ?? E ?? [], {
|
|
3441
3629
|
nameField: n,
|
|
3442
3630
|
titleField: o,
|
|
3443
3631
|
photoField: s,
|
|
3444
3632
|
parentField: f,
|
|
3445
3633
|
cvField: p,
|
|
3446
3634
|
hrefField: m
|
|
3447
|
-
}) : e,
|
|
3635
|
+
}) : e, k = on(h), { boxes: j, links: M, width: N, height: P } = sn(O, {
|
|
3448
3636
|
size: h,
|
|
3449
3637
|
horizontal: g
|
|
3450
3638
|
});
|
|
@@ -3457,7 +3645,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3457
3645
|
fontSize: 13,
|
|
3458
3646
|
opacity: .7,
|
|
3459
3647
|
textAlign: "center",
|
|
3460
|
-
...
|
|
3648
|
+
...A(_)
|
|
3461
3649
|
},
|
|
3462
3650
|
children: [
|
|
3463
3651
|
"Org Chart — no published entries in “",
|
|
@@ -3471,7 +3659,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3471
3659
|
style: {
|
|
3472
3660
|
maxWidth: "100%",
|
|
3473
3661
|
overflowX: "auto",
|
|
3474
|
-
...
|
|
3662
|
+
...A(_)
|
|
3475
3663
|
},
|
|
3476
3664
|
children: [/* @__PURE__ */ d("svg", {
|
|
3477
3665
|
viewBox: `0 0 ${N} ${P}`,
|
|
@@ -3490,7 +3678,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3490
3678
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3491
3679
|
strokeWidth: "1.5"
|
|
3492
3680
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
3493
|
-
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 ?
|
|
3681
|
+
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 ? ln(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? ln(e.color2) : s, f = y && (un(e) || e.href), p = () => un(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + fn.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3494
3682
|
return /* @__PURE__ */ d("g", {
|
|
3495
3683
|
onClick: f ? p : void 0,
|
|
3496
3684
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -3513,8 +3701,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3513
3701
|
}), /* @__PURE__ */ u("rect", {
|
|
3514
3702
|
x: t,
|
|
3515
3703
|
y: n,
|
|
3516
|
-
width:
|
|
3517
|
-
height:
|
|
3704
|
+
width: k.w,
|
|
3705
|
+
height: k.h,
|
|
3518
3706
|
rx: "10",
|
|
3519
3707
|
fill: `url(#${b}-${e.id}-grad)`
|
|
3520
3708
|
})] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
@@ -3522,8 +3710,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3522
3710
|
children: /* @__PURE__ */ u("rect", {
|
|
3523
3711
|
x: t,
|
|
3524
3712
|
y: n,
|
|
3525
|
-
width:
|
|
3526
|
-
height:
|
|
3713
|
+
width: k.w,
|
|
3714
|
+
height: k.h,
|
|
3527
3715
|
rx: "10"
|
|
3528
3716
|
})
|
|
3529
3717
|
}), /* @__PURE__ */ d("g", {
|
|
@@ -3531,21 +3719,21 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3531
3719
|
children: [/* @__PURE__ */ u("rect", {
|
|
3532
3720
|
x: t,
|
|
3533
3721
|
y: n,
|
|
3534
|
-
width:
|
|
3722
|
+
width: k.w,
|
|
3535
3723
|
height: _,
|
|
3536
3724
|
fill: o
|
|
3537
3725
|
}), /* @__PURE__ */ u("rect", {
|
|
3538
3726
|
x: t,
|
|
3539
3727
|
y: n + _,
|
|
3540
|
-
width:
|
|
3541
|
-
height:
|
|
3728
|
+
width: k.w,
|
|
3729
|
+
height: k.h - _,
|
|
3542
3730
|
fill: e.color2
|
|
3543
3731
|
})]
|
|
3544
3732
|
})] }) : /* @__PURE__ */ u("rect", {
|
|
3545
3733
|
x: t,
|
|
3546
3734
|
y: n,
|
|
3547
|
-
width:
|
|
3548
|
-
height:
|
|
3735
|
+
width: k.w,
|
|
3736
|
+
height: k.h,
|
|
3549
3737
|
rx: "10",
|
|
3550
3738
|
fill: o,
|
|
3551
3739
|
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
@@ -3554,63 +3742,63 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3554
3742
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
3555
3743
|
id: `${b}-${e.id}`,
|
|
3556
3744
|
children: /* @__PURE__ */ u("circle", {
|
|
3557
|
-
cx: t +
|
|
3558
|
-
cy: n +
|
|
3559
|
-
r:
|
|
3745
|
+
cx: t + fn.pad + k.avatar / 2,
|
|
3746
|
+
cy: n + k.h / 2,
|
|
3747
|
+
r: k.avatar / 2
|
|
3560
3748
|
})
|
|
3561
3749
|
}), /* @__PURE__ */ u("image", {
|
|
3562
3750
|
href: e.photo,
|
|
3563
|
-
x: t +
|
|
3564
|
-
y: n + (
|
|
3565
|
-
width:
|
|
3566
|
-
height:
|
|
3751
|
+
x: t + fn.pad,
|
|
3752
|
+
y: n + (k.h - k.avatar) / 2,
|
|
3753
|
+
width: k.avatar,
|
|
3754
|
+
height: k.avatar,
|
|
3567
3755
|
preserveAspectRatio: "xMidYMid slice",
|
|
3568
3756
|
clipPath: `url(#${b}-${e.id})`
|
|
3569
3757
|
})] }),
|
|
3570
3758
|
i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
|
|
3571
3759
|
x: m,
|
|
3572
|
-
y: n + _ / 2 +
|
|
3760
|
+
y: n + _ / 2 + k.title * .35,
|
|
3573
3761
|
textAnchor: h,
|
|
3574
|
-
fontSize:
|
|
3762
|
+
fontSize: k.title,
|
|
3575
3763
|
fontWeight: "600",
|
|
3576
3764
|
fill: s,
|
|
3577
|
-
children:
|
|
3765
|
+
children: cn(e.title, g + 4)
|
|
3578
3766
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
3579
3767
|
x: m,
|
|
3580
|
-
y: n + _ + _ / 2 +
|
|
3768
|
+
y: n + _ + _ / 2 + k.name * .35,
|
|
3581
3769
|
textAnchor: h,
|
|
3582
|
-
fontSize:
|
|
3770
|
+
fontSize: k.name,
|
|
3583
3771
|
fontWeight: "600",
|
|
3584
3772
|
fill: c,
|
|
3585
|
-
children:
|
|
3773
|
+
children: cn(e.name, g)
|
|
3586
3774
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
3587
3775
|
x: m,
|
|
3588
|
-
y: n + (v[1] ?
|
|
3776
|
+
y: n + (v[1] ? k.h * .43 : k.h * .57),
|
|
3589
3777
|
textAnchor: h,
|
|
3590
|
-
fontSize:
|
|
3778
|
+
fontSize: k.name,
|
|
3591
3779
|
fontWeight: "600",
|
|
3592
3780
|
fill: s,
|
|
3593
|
-
children:
|
|
3781
|
+
children: cn(v[0], g)
|
|
3594
3782
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
3595
3783
|
x: m,
|
|
3596
|
-
y: n +
|
|
3784
|
+
y: n + k.h * .73,
|
|
3597
3785
|
textAnchor: h,
|
|
3598
|
-
fontSize:
|
|
3786
|
+
fontSize: k.title,
|
|
3599
3787
|
opacity: "0.7",
|
|
3600
3788
|
fill: s,
|
|
3601
|
-
children:
|
|
3789
|
+
children: cn(v[1], g + 4)
|
|
3602
3790
|
})] })
|
|
3603
3791
|
]
|
|
3604
3792
|
}, e.id);
|
|
3605
3793
|
})]
|
|
3606
|
-
}), x && /* @__PURE__ */ u(
|
|
3794
|
+
}), x && /* @__PURE__ */ u(pn, {
|
|
3607
3795
|
node: x,
|
|
3608
3796
|
onClose: () => S(null)
|
|
3609
3797
|
})]
|
|
3610
3798
|
});
|
|
3611
3799
|
}
|
|
3612
|
-
function
|
|
3613
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3800
|
+
function hn({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: h }) {
|
|
3801
|
+
let { tenant: g, apiUrl: _ } = r(q), v = r(J), y = v?.[n], b = f ? xe(v) : 1, [x, S] = c(null);
|
|
3614
3802
|
if (i(() => {
|
|
3615
3803
|
if (!n || y) return;
|
|
3616
3804
|
let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${r}`;
|
|
@@ -3629,45 +3817,45 @@ function en({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
3629
3817
|
b,
|
|
3630
3818
|
a
|
|
3631
3819
|
]), !e.length) return null;
|
|
3632
|
-
let
|
|
3820
|
+
let C = Math.max(1, Number(a) || 10), w = n ? f ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * C, b * C) : (x ?? []).slice(0, C) : (y ?? x ?? []).slice(0, C) : null, T = w ? w.map((t) => e.map((e) => Y(Ee(t?.data, e.field)))) : t, E = !!n && !(n && !y && x === null) && T.length === 0, D = l ? "6px 10px" : "10px 14px", O = "1px solid rgba(148, 163, 184, 0.35)", k = s ? { border: O } : { borderBottom: O };
|
|
3633
3821
|
return /* @__PURE__ */ u("div", {
|
|
3634
3822
|
ref: h,
|
|
3635
3823
|
style: {
|
|
3636
3824
|
width: "100%",
|
|
3637
3825
|
overflowX: "auto",
|
|
3638
|
-
...
|
|
3826
|
+
...A(m)
|
|
3639
3827
|
},
|
|
3640
3828
|
children: /* @__PURE__ */ d("table", {
|
|
3641
3829
|
style: {
|
|
3642
3830
|
width: "100%",
|
|
3643
3831
|
borderCollapse: "collapse",
|
|
3644
3832
|
fontSize: 14,
|
|
3645
|
-
...s ? { border:
|
|
3833
|
+
...s ? { border: O } : {}
|
|
3646
3834
|
},
|
|
3647
3835
|
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
|
|
3648
3836
|
style: {
|
|
3649
3837
|
textAlign: "left",
|
|
3650
3838
|
fontWeight: 600,
|
|
3651
|
-
padding:
|
|
3839
|
+
padding: D,
|
|
3652
3840
|
background: "rgba(148, 163, 184, 0.12)",
|
|
3653
|
-
...
|
|
3841
|
+
...k
|
|
3654
3842
|
},
|
|
3655
3843
|
children: e.label ?? e
|
|
3656
|
-
}, t)) }) }), /* @__PURE__ */ d("tbody", { children: [
|
|
3844
|
+
}, t)) }) }), /* @__PURE__ */ d("tbody", { children: [E && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
3657
3845
|
colSpan: e.length,
|
|
3658
3846
|
style: {
|
|
3659
|
-
padding:
|
|
3847
|
+
padding: D,
|
|
3660
3848
|
textAlign: "center",
|
|
3661
3849
|
opacity: .6,
|
|
3662
|
-
...
|
|
3850
|
+
...k
|
|
3663
3851
|
},
|
|
3664
3852
|
children: p || "No data yet"
|
|
3665
|
-
}) }),
|
|
3853
|
+
}) }), T.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
3666
3854
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
3667
3855
|
children: e.map((e, n) => /* @__PURE__ */ u("td", {
|
|
3668
3856
|
style: {
|
|
3669
|
-
padding:
|
|
3670
|
-
...
|
|
3857
|
+
padding: D,
|
|
3858
|
+
...k
|
|
3671
3859
|
},
|
|
3672
3860
|
children: t?.[n] ?? ""
|
|
3673
3861
|
}, n))
|
|
@@ -3675,129 +3863,647 @@ function en({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
3675
3863
|
})
|
|
3676
3864
|
});
|
|
3677
3865
|
}
|
|
3678
|
-
var
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3866
|
+
var gn = {
|
|
3867
|
+
small: {
|
|
3868
|
+
cell: 62,
|
|
3869
|
+
font: 10.5,
|
|
3870
|
+
head: 11,
|
|
3871
|
+
title: 15,
|
|
3872
|
+
pad: 4,
|
|
3873
|
+
gap: 2
|
|
3874
|
+
},
|
|
3875
|
+
medium: {
|
|
3876
|
+
cell: 92,
|
|
3877
|
+
font: 12,
|
|
3878
|
+
head: 12,
|
|
3879
|
+
title: 18,
|
|
3880
|
+
pad: 6,
|
|
3881
|
+
gap: 3
|
|
3882
|
+
},
|
|
3883
|
+
large: {
|
|
3884
|
+
cell: 124,
|
|
3885
|
+
font: 13,
|
|
3886
|
+
head: 13,
|
|
3887
|
+
title: 22,
|
|
3888
|
+
pad: 8,
|
|
3889
|
+
gap: 4
|
|
3890
|
+
}
|
|
3891
|
+
}, _n = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, vn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), yn = 366;
|
|
3892
|
+
function bn(e, t = {}) {
|
|
3893
|
+
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 ? "" : Y(e), a = (e) => {
|
|
3894
|
+
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
3895
|
+
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
3896
|
+
};
|
|
3897
|
+
return n.map((e) => {
|
|
3898
|
+
let n = e.data ?? {}, o = a(n[t.startField]);
|
|
3899
|
+
return o ? {
|
|
3900
|
+
key: e.id,
|
|
3901
|
+
title: i(n[t.titleField || "name"]) || i(n.name) || "Untitled",
|
|
3902
|
+
start: o,
|
|
3903
|
+
end: a(n[t.endField]),
|
|
3904
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3905
|
+
color: t.colorField ? i(r(n[t.colorField])) : ""
|
|
3906
|
+
} : null;
|
|
3907
|
+
}).filter(Boolean);
|
|
3908
|
+
}
|
|
3909
|
+
function xn(e) {
|
|
3910
|
+
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
3911
|
+
let n = e?.start ? new Date(e.start) : null;
|
|
3912
|
+
if (!n || Number.isNaN(n.getTime())) return null;
|
|
3913
|
+
let r = e?.end ? new Date(e.end) : null;
|
|
3914
|
+
return {
|
|
3915
|
+
key: e.key ?? `event-${t}`,
|
|
3916
|
+
title: e.title ?? "",
|
|
3917
|
+
start: n,
|
|
3918
|
+
end: r && !Number.isNaN(r.getTime()) ? r : null,
|
|
3919
|
+
href: e.href ?? "",
|
|
3920
|
+
color: e.color ?? ""
|
|
3921
|
+
};
|
|
3922
|
+
}).filter(Boolean);
|
|
3923
|
+
}
|
|
3924
|
+
function Sn(e) {
|
|
3925
|
+
let t = /* @__PURE__ */ new Map();
|
|
3926
|
+
for (let n of e) {
|
|
3927
|
+
let e = vn(n.start), r = n.end ? vn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), yn);
|
|
3928
|
+
for (let r = 0; r <= i; r += 1) {
|
|
3929
|
+
let i = _n(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
3930
|
+
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
3934
|
+
return t;
|
|
3935
|
+
}
|
|
3936
|
+
function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
3937
|
+
let { tenant: T, apiUrl: E, locale: D } = r(q), O = r(J)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
3938
|
+
let e = /* @__PURE__ */ new Date();
|
|
3939
|
+
return {
|
|
3940
|
+
year: e.getFullYear(),
|
|
3941
|
+
month: e.getMonth()
|
|
3942
|
+
};
|
|
3943
|
+
});
|
|
3944
|
+
i(() => {
|
|
3945
|
+
if (!t || O) return;
|
|
3946
|
+
let e = !0;
|
|
3947
|
+
return fetch(`${E}/dynamic/${encodeURIComponent(t)}`, { headers: T ? { "x-tenant": T } : {} }).then((e) => e.json()).then((t) => {
|
|
3948
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3949
|
+
e && j(n);
|
|
3950
|
+
}).catch(() => e && j([])), () => {
|
|
3951
|
+
e = !1;
|
|
3952
|
+
};
|
|
3953
|
+
}, [
|
|
3954
|
+
t,
|
|
3955
|
+
T,
|
|
3956
|
+
E,
|
|
3957
|
+
O
|
|
3958
|
+
]);
|
|
3959
|
+
let P = gn[m] ?? gn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? bn(O ?? k ?? [], {
|
|
3960
|
+
titleField: n,
|
|
3961
|
+
startField: a,
|
|
3962
|
+
endField: o,
|
|
3963
|
+
hrefField: s,
|
|
3964
|
+
colorField: f
|
|
3965
|
+
}) : xn(e), ee = Sn(z), B = D || void 0, V = (e, t) => {
|
|
3966
|
+
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
3967
|
+
width: 6,
|
|
3968
|
+
height: 6,
|
|
3969
|
+
borderRadius: "50%",
|
|
3970
|
+
background: e.color || R,
|
|
3971
|
+
flexShrink: 0,
|
|
3972
|
+
opacity: e.color ? 1 : .85
|
|
3973
|
+
} }), /* @__PURE__ */ u("span", {
|
|
3974
|
+
style: {
|
|
3975
|
+
overflow: "hidden",
|
|
3976
|
+
textOverflow: "ellipsis",
|
|
3977
|
+
whiteSpace: "nowrap"
|
|
3978
|
+
},
|
|
3979
|
+
children: e.title
|
|
3980
|
+
})] }), r = {
|
|
3981
|
+
display: "flex",
|
|
3982
|
+
alignItems: "center",
|
|
3983
|
+
gap: 5,
|
|
3984
|
+
background: e.color ? `color-mix(in srgb, ${e.color} 18%, transparent)` : L,
|
|
3985
|
+
color: e.color ? "inherit" : R,
|
|
3986
|
+
borderRadius: 4,
|
|
3987
|
+
padding: "2px 5px",
|
|
3988
|
+
fontSize: P.font,
|
|
3989
|
+
lineHeight: 1.35,
|
|
3990
|
+
textDecoration: "none",
|
|
3991
|
+
...t
|
|
3992
|
+
};
|
|
3993
|
+
return e.href && w ? /* @__PURE__ */ u("a", {
|
|
3994
|
+
href: e.href,
|
|
3995
|
+
style: r,
|
|
3996
|
+
title: e.title,
|
|
3997
|
+
children: n
|
|
3998
|
+
}, e.key) : /* @__PURE__ */ u("div", {
|
|
3999
|
+
style: r,
|
|
4000
|
+
title: e.title,
|
|
4001
|
+
children: n
|
|
4002
|
+
}, e.key);
|
|
4003
|
+
}, H = new Intl.DateTimeFormat(B, {
|
|
4004
|
+
month: "long",
|
|
4005
|
+
year: "numeric"
|
|
4006
|
+
}).format(new Date(M.year, M.month, 1)), te = (e) => N((t) => {
|
|
4007
|
+
let n = new Date(t.year, t.month + e, 1);
|
|
4008
|
+
return {
|
|
4009
|
+
year: n.getFullYear(),
|
|
4010
|
+
month: n.getMonth()
|
|
4011
|
+
};
|
|
4012
|
+
}), ne = (e, t) => /* @__PURE__ */ u("button", {
|
|
4013
|
+
type: "button",
|
|
4014
|
+
"aria-label": e,
|
|
4015
|
+
onClick: () => te(t),
|
|
4016
|
+
style: {
|
|
4017
|
+
background: "transparent",
|
|
4018
|
+
border: `1px solid ${I}`,
|
|
4019
|
+
borderRadius: 6,
|
|
4020
|
+
color: "inherit",
|
|
4021
|
+
cursor: "pointer",
|
|
4022
|
+
fontSize: P.head,
|
|
4023
|
+
lineHeight: 1,
|
|
4024
|
+
padding: "4px 8px"
|
|
4025
|
+
},
|
|
4026
|
+
children: t < 0 ? "‹" : "›"
|
|
4027
|
+
}), re = /* @__PURE__ */ d("div", {
|
|
4028
|
+
style: {
|
|
4029
|
+
display: "flex",
|
|
4030
|
+
alignItems: "center",
|
|
4031
|
+
gap: 8,
|
|
4032
|
+
marginBottom: P.pad + 2
|
|
4033
|
+
},
|
|
4034
|
+
children: [
|
|
4035
|
+
/* @__PURE__ */ u("div", {
|
|
4036
|
+
style: {
|
|
4037
|
+
fontSize: P.title,
|
|
4038
|
+
fontWeight: 700,
|
|
4039
|
+
flexGrow: 1,
|
|
4040
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
4041
|
+
},
|
|
4042
|
+
children: H
|
|
4043
|
+
}),
|
|
4044
|
+
ne("Previous month", -1),
|
|
4045
|
+
ne("Next month", 1)
|
|
4046
|
+
]
|
|
4047
|
+
});
|
|
4048
|
+
if (p === "list") {
|
|
4049
|
+
let e = z.filter((e) => e.start.getFullYear() === M.year && e.start.getMonth() === M.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(B, {
|
|
4050
|
+
day: "numeric",
|
|
4051
|
+
month: "short",
|
|
4052
|
+
hour: "2-digit",
|
|
4053
|
+
minute: "2-digit"
|
|
4054
|
+
});
|
|
4055
|
+
return /* @__PURE__ */ d("div", {
|
|
4056
|
+
ref: C,
|
|
4057
|
+
style: {
|
|
4058
|
+
width: "100%",
|
|
4059
|
+
...A(S)
|
|
4060
|
+
},
|
|
4061
|
+
children: [re, e.length ? /* @__PURE__ */ u("div", {
|
|
4062
|
+
style: {
|
|
4063
|
+
display: "flex",
|
|
4064
|
+
flexDirection: "column",
|
|
4065
|
+
gap: P.gap + 2
|
|
4066
|
+
},
|
|
4067
|
+
children: e.map((e) => /* @__PURE__ */ d("div", {
|
|
4068
|
+
style: {
|
|
4069
|
+
display: "flex",
|
|
4070
|
+
alignItems: "center",
|
|
4071
|
+
gap: 10,
|
|
4072
|
+
borderBottom: `1px solid ${I}`,
|
|
4073
|
+
paddingBottom: P.gap + 2
|
|
4074
|
+
},
|
|
4075
|
+
children: [/* @__PURE__ */ u("span", {
|
|
4076
|
+
style: {
|
|
4077
|
+
fontSize: P.font,
|
|
4078
|
+
opacity: .7,
|
|
4079
|
+
minWidth: 96
|
|
4080
|
+
},
|
|
4081
|
+
children: t.format(e.start)
|
|
4082
|
+
}), V(e, {
|
|
4083
|
+
flexGrow: 1,
|
|
4084
|
+
minWidth: 0
|
|
4085
|
+
})]
|
|
4086
|
+
}, e.key))
|
|
4087
|
+
}) : /* @__PURE__ */ u("div", {
|
|
4088
|
+
style: {
|
|
4089
|
+
fontSize: P.font,
|
|
4090
|
+
opacity: .6,
|
|
4091
|
+
padding: P.pad * 2
|
|
4092
|
+
},
|
|
4093
|
+
children: x
|
|
4094
|
+
})]
|
|
4095
|
+
});
|
|
4096
|
+
}
|
|
4097
|
+
let ie = new Date(M.year, M.month, 1), ae = y === "sunday" ? 0 : 1, oe = (ie.getDay() - ae + 7) % 7, U = new Date(M.year, M.month + 1, 0).getDate(), W = Math.ceil((oe + U) / 7), se = _n(/* @__PURE__ */ new Date()), G = new Intl.DateTimeFormat(B, { weekday: "short" }), ce = [];
|
|
4098
|
+
for (let e = 0; e < W * 7; e += 1) {
|
|
4099
|
+
let t = e - oe + 1, n = t >= 1 && t <= U, r = _n(new Date(M.year, M.month, t)), i = n ? ee.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === se;
|
|
4100
|
+
ce.push(/* @__PURE__ */ d("div", {
|
|
4101
|
+
style: {
|
|
4102
|
+
minHeight: P.cell,
|
|
4103
|
+
borderTop: `1px solid ${I}`,
|
|
4104
|
+
borderLeft: `1px solid ${I}`,
|
|
4105
|
+
padding: P.pad,
|
|
4106
|
+
display: "flex",
|
|
4107
|
+
flexDirection: "column",
|
|
4108
|
+
gap: P.gap,
|
|
4109
|
+
opacity: n ? 1 : .35,
|
|
4110
|
+
minWidth: 0
|
|
4111
|
+
},
|
|
4112
|
+
children: [
|
|
4113
|
+
/* @__PURE__ */ u("span", {
|
|
4114
|
+
style: {
|
|
4115
|
+
fontSize: P.font,
|
|
4116
|
+
fontWeight: o ? 700 : 400,
|
|
4117
|
+
alignSelf: "flex-start",
|
|
4118
|
+
borderRadius: "999px",
|
|
4119
|
+
padding: o ? "1px 6px" : 0,
|
|
4120
|
+
background: o ? F : "transparent",
|
|
4121
|
+
color: o ? R : "inherit"
|
|
4122
|
+
},
|
|
4123
|
+
children: n ? t : new Date(M.year, M.month, t).getDate()
|
|
4124
|
+
}),
|
|
4125
|
+
a.map((e) => V(e)),
|
|
4126
|
+
i.length > a.length && /* @__PURE__ */ u("span", {
|
|
4127
|
+
style: {
|
|
4128
|
+
fontSize: P.font,
|
|
4129
|
+
opacity: .6
|
|
4130
|
+
},
|
|
4131
|
+
children: `+${i.length - a.length}`
|
|
4132
|
+
})
|
|
4133
|
+
]
|
|
4134
|
+
}, e));
|
|
4135
|
+
}
|
|
4136
|
+
return /* @__PURE__ */ d("div", {
|
|
4137
|
+
ref: C,
|
|
4138
|
+
style: {
|
|
4139
|
+
width: "100%",
|
|
4140
|
+
...A(S)
|
|
4141
|
+
},
|
|
4142
|
+
children: [
|
|
4143
|
+
re,
|
|
4144
|
+
/* @__PURE__ */ d("div", {
|
|
4145
|
+
style: {
|
|
4146
|
+
display: "grid",
|
|
4147
|
+
gridTemplateColumns: "repeat(7, minmax(0, 1fr))"
|
|
4148
|
+
},
|
|
4149
|
+
children: [Array.from({ length: 7 }, (e, t) => /* @__PURE__ */ u("div", {
|
|
4150
|
+
style: {
|
|
4151
|
+
fontSize: P.head,
|
|
4152
|
+
fontWeight: 600,
|
|
4153
|
+
opacity: .7,
|
|
4154
|
+
textAlign: "center",
|
|
4155
|
+
padding: `0 0 ${P.pad}px`
|
|
4156
|
+
},
|
|
4157
|
+
children: G.format(new Date(2024, 0, 7 + ae + t))
|
|
4158
|
+
}, `head-${t}`)), ce]
|
|
4159
|
+
}),
|
|
4160
|
+
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4161
|
+
]
|
|
4162
|
+
});
|
|
4163
|
+
}
|
|
4164
|
+
var wn = {
|
|
4165
|
+
small: 380,
|
|
4166
|
+
medium: 560,
|
|
4167
|
+
large: 820,
|
|
4168
|
+
full: "100%"
|
|
4169
|
+
};
|
|
4170
|
+
function Tn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4171
|
+
let [C, w] = c(!1), T = s(null);
|
|
4172
|
+
i(() => {
|
|
4173
|
+
if (S || !e) return;
|
|
4174
|
+
let t = (t) => {
|
|
4175
|
+
t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`) && (t.preventDefault(), w(!0));
|
|
4176
|
+
};
|
|
4177
|
+
return document.addEventListener("click", t), () => document.removeEventListener("click", t);
|
|
4178
|
+
}, [S, e]), i(() => {
|
|
4179
|
+
if (S || r !== "load") return;
|
|
4180
|
+
let e = setTimeout(() => w(!0), Math.max(0, Number(a) || 0) * 1e3);
|
|
4181
|
+
return () => clearTimeout(e);
|
|
4182
|
+
}, [
|
|
4183
|
+
S,
|
|
4184
|
+
r,
|
|
4185
|
+
a
|
|
4186
|
+
]), i(() => {
|
|
4187
|
+
if (S || !C) return;
|
|
4188
|
+
let e = (e) => e.key === "Escape" && w(!1);
|
|
4189
|
+
document.addEventListener("keydown", e);
|
|
4190
|
+
let t = document.body.style.overflow;
|
|
4191
|
+
return document.body.style.overflow = "hidden", T.current?.focus?.(), () => {
|
|
4192
|
+
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4193
|
+
};
|
|
4194
|
+
}, [S, C]);
|
|
4195
|
+
let E = wn[o] ?? wn.medium, D = (e) => {
|
|
4196
|
+
let t = {
|
|
4197
|
+
padding: "9px 16px",
|
|
4198
|
+
borderRadius: 6,
|
|
4199
|
+
cursor: "pointer",
|
|
4200
|
+
fontSize: 14,
|
|
4201
|
+
fontFamily: "inherit",
|
|
4202
|
+
textDecoration: "none",
|
|
4203
|
+
display: "inline-block",
|
|
4204
|
+
...{
|
|
4205
|
+
primary: {
|
|
4206
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4207
|
+
color: "var(--page-accent-text, #ffffff)",
|
|
4208
|
+
border: "1px solid transparent"
|
|
4209
|
+
},
|
|
4210
|
+
outline: {
|
|
4211
|
+
background: "transparent",
|
|
4212
|
+
color: "inherit",
|
|
4213
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4214
|
+
},
|
|
4215
|
+
text: {
|
|
4216
|
+
background: "transparent",
|
|
4217
|
+
color: "inherit",
|
|
4218
|
+
border: "1px solid transparent"
|
|
4219
|
+
},
|
|
4220
|
+
danger: {
|
|
4221
|
+
background: "#dc2626",
|
|
4222
|
+
color: "#ffffff",
|
|
4223
|
+
border: "1px solid transparent"
|
|
4224
|
+
}
|
|
4225
|
+
}[e.variant ?? "primary"] ?? {}
|
|
4226
|
+
};
|
|
4227
|
+
return e.href && !S ? /* @__PURE__ */ u("a", {
|
|
4228
|
+
href: e.href,
|
|
4229
|
+
target: e.target || void 0,
|
|
4230
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
4231
|
+
style: t,
|
|
4232
|
+
children: e.label
|
|
4233
|
+
}, e.key) : /* @__PURE__ */ u("button", {
|
|
4234
|
+
type: "button",
|
|
4235
|
+
onClick: () => !S && w(!1),
|
|
4236
|
+
style: t,
|
|
4237
|
+
children: e.label
|
|
4238
|
+
}, e.key);
|
|
4239
|
+
}, O = Array.isArray(h) ? h : [], k = O.filter((e) => e.side === "left"), j = O.filter((e) => e.side !== "left"), M = g === !0 ? D({
|
|
4240
|
+
key: "__close",
|
|
4241
|
+
label: _ || "Close",
|
|
4242
|
+
variant: "outline"
|
|
4243
|
+
}) : null, N = k.length || j.length || M ? /* @__PURE__ */ d("div", {
|
|
4244
|
+
style: {
|
|
4245
|
+
display: "flex",
|
|
4246
|
+
alignItems: "center",
|
|
4247
|
+
gap: 8,
|
|
4248
|
+
padding: "14px 20px",
|
|
4249
|
+
borderTop: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4250
|
+
justifyContent: k.length ? "space-between" : v === "left" ? "flex-start" : v === "center" ? "center" : "flex-end"
|
|
4251
|
+
},
|
|
4252
|
+
children: [k.length > 0 && /* @__PURE__ */ u("div", {
|
|
4253
|
+
style: {
|
|
4254
|
+
display: "flex",
|
|
4255
|
+
gap: 8
|
|
4256
|
+
},
|
|
4257
|
+
children: k.map(D)
|
|
4258
|
+
}), /* @__PURE__ */ d("div", {
|
|
4259
|
+
style: {
|
|
4260
|
+
display: "flex",
|
|
4261
|
+
gap: 8
|
|
4262
|
+
},
|
|
4263
|
+
children: [M, j.map(D)]
|
|
4264
|
+
})]
|
|
4265
|
+
}) : null, P = /* @__PURE__ */ d("div", {
|
|
4266
|
+
ref: T,
|
|
4267
|
+
role: "dialog",
|
|
4268
|
+
"aria-modal": S ? void 0 : "true",
|
|
4269
|
+
"aria-label": l || void 0,
|
|
4270
|
+
tabIndex: -1,
|
|
4271
|
+
onClick: (e) => e.stopPropagation(),
|
|
4272
|
+
style: {
|
|
4273
|
+
width: typeof E == "number" ? `min(${E}px, 100%)` : E,
|
|
4274
|
+
maxHeight: S ? void 0 : "85vh",
|
|
4275
|
+
overflowY: S ? void 0 : "auto",
|
|
4276
|
+
borderRadius: 12,
|
|
4277
|
+
background: "var(--page-surface, #ffffff)",
|
|
4278
|
+
color: "var(--page-text, #111827)",
|
|
4279
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
4280
|
+
boxShadow: S ? "none" : "0 24px 64px rgba(15, 23, 42, 0.35)",
|
|
4281
|
+
outline: "none",
|
|
4282
|
+
...A(b)
|
|
4283
|
+
},
|
|
4284
|
+
children: [
|
|
4285
|
+
(l || f !== !1) && /* @__PURE__ */ d("div", {
|
|
4286
|
+
style: {
|
|
4287
|
+
display: "flex",
|
|
4288
|
+
alignItems: "center",
|
|
4289
|
+
gap: 12,
|
|
4290
|
+
padding: "16px 20px",
|
|
4291
|
+
borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4292
|
+
},
|
|
4293
|
+
children: [/* @__PURE__ */ u("span", {
|
|
4294
|
+
style: {
|
|
4295
|
+
fontWeight: 700,
|
|
4296
|
+
fontSize: 17,
|
|
4297
|
+
flexGrow: 1,
|
|
4298
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
4299
|
+
},
|
|
4300
|
+
children: l
|
|
4301
|
+
}), f !== !1 && /* @__PURE__ */ u("button", {
|
|
4302
|
+
type: "button",
|
|
4303
|
+
"aria-label": "Close",
|
|
4304
|
+
onClick: () => !S && w(!1),
|
|
4305
|
+
style: {
|
|
4306
|
+
background: "transparent",
|
|
4307
|
+
border: 0,
|
|
4308
|
+
color: "inherit",
|
|
4309
|
+
cursor: "pointer",
|
|
4310
|
+
fontSize: 20,
|
|
4311
|
+
lineHeight: 1,
|
|
4312
|
+
padding: 2,
|
|
4313
|
+
opacity: .7
|
|
4314
|
+
},
|
|
4315
|
+
children: "✕"
|
|
4316
|
+
})]
|
|
4317
|
+
}),
|
|
4318
|
+
/* @__PURE__ */ u("div", {
|
|
4319
|
+
style: { padding: 20 },
|
|
4320
|
+
children: y?.content
|
|
4321
|
+
}),
|
|
4322
|
+
N
|
|
4323
|
+
]
|
|
4324
|
+
});
|
|
4325
|
+
return /* @__PURE__ */ d("div", {
|
|
4326
|
+
ref: x,
|
|
4327
|
+
id: e || void 0,
|
|
4328
|
+
style: S ? void 0 : { display: "contents" },
|
|
4329
|
+
children: [t === "button" && /* @__PURE__ */ u("button", {
|
|
4330
|
+
type: "button",
|
|
4331
|
+
onClick: () => !S && w(!0),
|
|
4332
|
+
style: {
|
|
4333
|
+
padding: "10px 18px",
|
|
4334
|
+
border: 0,
|
|
4335
|
+
borderRadius: 6,
|
|
4336
|
+
cursor: "pointer",
|
|
4337
|
+
fontSize: 15,
|
|
4338
|
+
fontFamily: "inherit",
|
|
4339
|
+
background: "var(--page-accent, #4f46e5)",
|
|
4340
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
4341
|
+
},
|
|
4342
|
+
children: n
|
|
4343
|
+
}), S ? /* @__PURE__ */ u("div", {
|
|
4344
|
+
style: { marginTop: t === "button" ? 12 : 0 },
|
|
4345
|
+
children: P
|
|
4346
|
+
}) : C && /* @__PURE__ */ u("div", {
|
|
4347
|
+
onClick: p === !1 ? void 0 : () => w(!1),
|
|
4348
|
+
style: {
|
|
4349
|
+
position: "fixed",
|
|
4350
|
+
inset: 0,
|
|
4351
|
+
zIndex: 2147483e3,
|
|
4352
|
+
display: "flex",
|
|
4353
|
+
alignItems: m === "top" ? "flex-start" : "center",
|
|
4354
|
+
justifyContent: "center",
|
|
4355
|
+
padding: 20,
|
|
4356
|
+
paddingTop: m === "top" ? "8vh" : 20,
|
|
4357
|
+
background: "rgba(15, 23, 42, 0.55)",
|
|
4358
|
+
backdropFilter: "blur(2px)"
|
|
4359
|
+
},
|
|
4360
|
+
children: P
|
|
4361
|
+
})]
|
|
4362
|
+
});
|
|
4363
|
+
}
|
|
4364
|
+
var En = {
|
|
4365
|
+
PageRoot: Fe,
|
|
4366
|
+
CalendarBlock: Cn,
|
|
4367
|
+
DialogBlock: Tn,
|
|
4368
|
+
Section: Ie,
|
|
4369
|
+
Container: Le,
|
|
4370
|
+
Heading: Re,
|
|
4371
|
+
TextBlock: Ye,
|
|
4372
|
+
ButtonBlock: Qe,
|
|
4373
|
+
ImageBlock: $e,
|
|
4374
|
+
Spacer: at,
|
|
4375
|
+
Divider: ot,
|
|
4376
|
+
SliderBlock: ft,
|
|
4377
|
+
CanvasSlider: pt,
|
|
4378
|
+
TabsBlock: yt,
|
|
4379
|
+
QuickStack: Vt,
|
|
4380
|
+
CollectionList: Ht,
|
|
4381
|
+
CollectionSearch: Ut,
|
|
4382
|
+
BreadcrumbsBlock: Wt,
|
|
4383
|
+
PaginationBlock: Gt,
|
|
4384
|
+
StepperBlock: rn,
|
|
4385
|
+
SocialLinksBlock: nn,
|
|
4386
|
+
ThemeModeBlock: Xt,
|
|
4387
|
+
ScrollTopBlock: en,
|
|
4388
|
+
OrgChartBlock: mn,
|
|
4389
|
+
TableBlock: hn,
|
|
4390
|
+
MasonryBlock: mt,
|
|
4391
|
+
AccordionBlock: bt,
|
|
4392
|
+
NavbarBlock: vt,
|
|
4393
|
+
ListBlock: Je,
|
|
4394
|
+
TextSpan: Ve,
|
|
4395
|
+
QuoteBlock: qe,
|
|
4396
|
+
TextLink: Ze,
|
|
4397
|
+
RichTextBlock: Ge,
|
|
4398
|
+
RichContentBlock: Ge,
|
|
4399
|
+
VideoBlock: et,
|
|
4400
|
+
YouTubeBlock: nt,
|
|
4401
|
+
IframeBlock: rt,
|
|
4402
|
+
EmbedBlock: it,
|
|
4403
|
+
FormBlock: kt,
|
|
4404
|
+
FormLabel: Pt,
|
|
4405
|
+
FormInput: Ft,
|
|
4406
|
+
FormTextarea: It,
|
|
4407
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Lt, {
|
|
3720
4408
|
kind: "checkbox",
|
|
3721
4409
|
...e
|
|
3722
4410
|
}),
|
|
3723
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
4411
|
+
FormRadio: (e) => /* @__PURE__ */ u(Lt, {
|
|
3724
4412
|
kind: "radio",
|
|
3725
4413
|
...e
|
|
3726
4414
|
}),
|
|
3727
|
-
FormSelect:
|
|
3728
|
-
FormFile:
|
|
3729
|
-
FormRecaptcha:
|
|
3730
|
-
FormSubmit:
|
|
3731
|
-
},
|
|
4415
|
+
FormSelect: Rt,
|
|
4416
|
+
FormFile: zt,
|
|
4417
|
+
FormRecaptcha: Nt,
|
|
4418
|
+
FormSubmit: Bt
|
|
4419
|
+
}, Dn = {
|
|
3732
4420
|
id: "auth",
|
|
3733
4421
|
label: "Accounts",
|
|
3734
4422
|
category: "Apps",
|
|
3735
4423
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
3736
4424
|
ssr: "shell",
|
|
3737
4425
|
settings: ["site.authRedirect"]
|
|
3738
|
-
},
|
|
4426
|
+
}, On = t({
|
|
3739
4427
|
user: null,
|
|
3740
4428
|
status: "idle",
|
|
3741
4429
|
ensure: () => {},
|
|
3742
4430
|
refresh: () => {},
|
|
3743
4431
|
signOut: () => {}
|
|
3744
|
-
}),
|
|
3745
|
-
let e = r(
|
|
4432
|
+
}), kn = () => {
|
|
4433
|
+
let e = r(On);
|
|
3746
4434
|
return i(() => {
|
|
3747
4435
|
e.ensure();
|
|
3748
4436
|
}, [e]), e;
|
|
3749
4437
|
};
|
|
3750
|
-
function
|
|
3751
|
-
let
|
|
4438
|
+
function An({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
4439
|
+
let f = r(q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", [h, g] = c(t ?? null), [_, v] = c(t ? "user" : a ? "guest" : "idle"), y = s(!1), b = n((e, t) => fetch(`${p}${e}`, {
|
|
3752
4440
|
...t,
|
|
3753
4441
|
credentials: "include",
|
|
3754
4442
|
headers: {
|
|
3755
4443
|
"content-type": "application/json",
|
|
3756
|
-
...
|
|
4444
|
+
...m ? { "x-tenant": m } : {},
|
|
3757
4445
|
...t?.headers
|
|
3758
4446
|
}
|
|
3759
|
-
}), [
|
|
4447
|
+
}), [p, m]), x = n(() => a ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
|
|
3760
4448
|
let t = e?.payload ?? null;
|
|
3761
|
-
return
|
|
3762
|
-
}).catch(() => (
|
|
3763
|
-
|
|
3764
|
-
}), [
|
|
3765
|
-
|
|
4449
|
+
return g(t), v(t ? "user" : "guest"), t;
|
|
4450
|
+
}).catch(() => (g(null), v("guest"), null)), [b, a]), S = n(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
4451
|
+
g(null), v("guest");
|
|
4452
|
+
}), [b]), C = n(() => {
|
|
4453
|
+
y.current || a || t || (y.current = !0, v("loading"), x());
|
|
3766
4454
|
}, [
|
|
3767
|
-
|
|
4455
|
+
a,
|
|
3768
4456
|
t,
|
|
3769
|
-
b
|
|
3770
|
-
]), C = o(() => ({
|
|
3771
|
-
user: m,
|
|
3772
|
-
status: g,
|
|
3773
|
-
ensure: S,
|
|
3774
|
-
refresh: b,
|
|
3775
|
-
signOut: x
|
|
3776
|
-
}), [
|
|
3777
|
-
m,
|
|
3778
|
-
g,
|
|
3779
|
-
S,
|
|
3780
|
-
b,
|
|
3781
4457
|
x
|
|
4458
|
+
]), w = o(() => ({
|
|
4459
|
+
user: h,
|
|
4460
|
+
status: _,
|
|
4461
|
+
ensure: C,
|
|
4462
|
+
refresh: x,
|
|
4463
|
+
signOut: S
|
|
4464
|
+
}), [
|
|
4465
|
+
h,
|
|
4466
|
+
_,
|
|
4467
|
+
C,
|
|
4468
|
+
x,
|
|
4469
|
+
S
|
|
3782
4470
|
]);
|
|
3783
|
-
return
|
|
3784
|
-
|
|
4471
|
+
return i(() => {
|
|
4472
|
+
a || typeof window > "u" || (window.webim = {
|
|
4473
|
+
...window.webim,
|
|
4474
|
+
user: h,
|
|
4475
|
+
status: _,
|
|
4476
|
+
requireUser: () => y.current || t ? Promise.resolve(h) : x(),
|
|
4477
|
+
signOut: S
|
|
4478
|
+
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
4479
|
+
user: h,
|
|
4480
|
+
status: _
|
|
4481
|
+
} })));
|
|
4482
|
+
}, [
|
|
4483
|
+
a,
|
|
4484
|
+
h,
|
|
4485
|
+
_,
|
|
4486
|
+
t,
|
|
4487
|
+
x,
|
|
4488
|
+
S
|
|
4489
|
+
]), /* @__PURE__ */ u(On.Provider, {
|
|
4490
|
+
value: w,
|
|
3785
4491
|
children: e
|
|
3786
4492
|
});
|
|
3787
4493
|
}
|
|
3788
|
-
function
|
|
3789
|
-
let { status: n } =
|
|
4494
|
+
function jn({ when: e, children: t }) {
|
|
4495
|
+
let { status: n } = kn();
|
|
3790
4496
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
3791
4497
|
}
|
|
3792
4498
|
//#endregion
|
|
3793
4499
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
3794
|
-
function
|
|
3795
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
4500
|
+
function Mn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
4501
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
3796
4502
|
if (e.preventDefault(), f) return;
|
|
3797
4503
|
let n = new FormData(e.currentTarget);
|
|
3798
|
-
|
|
4504
|
+
C(!0), x("");
|
|
3799
4505
|
try {
|
|
3800
|
-
let e = await fetch(`${g || "/api"}/site/${
|
|
4506
|
+
let e = await fetch(`${g || "/api"}/site/${w ? "register" : "login"}`, {
|
|
3801
4507
|
method: "post",
|
|
3802
4508
|
headers: {
|
|
3803
4509
|
"content-type": "application/json",
|
|
@@ -3807,19 +4513,19 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3807
4513
|
body: JSON.stringify({
|
|
3808
4514
|
email: n.get("email"),
|
|
3809
4515
|
password: n.get("password"),
|
|
3810
|
-
...
|
|
4516
|
+
...w ? { name: n.get("name") || "" } : {}
|
|
3811
4517
|
})
|
|
3812
4518
|
}), r = await e.json().catch(() => null);
|
|
3813
4519
|
if (!e.ok || r?.success === !1) {
|
|
3814
|
-
x(r?.error?.message || "Sign-in failed"), y("error"),
|
|
4520
|
+
x(r?.error?.message || "Sign-in failed"), y("error"), C(!1);
|
|
3815
4521
|
return;
|
|
3816
4522
|
}
|
|
3817
4523
|
if (y("success"), typeof window < "u") {
|
|
3818
|
-
let e =
|
|
4524
|
+
let e = E(t) || E(new URLSearchParams(window.location.search).get("next")) || E(_?.["site.authRedirect"]) || E(_?.["apps.auth.redirect"]) || "/";
|
|
3819
4525
|
window.location.assign(e);
|
|
3820
4526
|
}
|
|
3821
4527
|
} catch {
|
|
3822
|
-
x("Sign-in failed"), y("error"),
|
|
4528
|
+
x("Sign-in failed"), y("error"), C(!1);
|
|
3823
4529
|
}
|
|
3824
4530
|
};
|
|
3825
4531
|
return /* @__PURE__ */ d("div", {
|
|
@@ -3828,32 +4534,32 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3828
4534
|
display: "grid",
|
|
3829
4535
|
gap: 12,
|
|
3830
4536
|
maxWidth: 360,
|
|
3831
|
-
...
|
|
4537
|
+
...A(s)
|
|
3832
4538
|
},
|
|
3833
4539
|
children: [
|
|
3834
4540
|
/* @__PURE__ */ d("form", {
|
|
3835
|
-
onSubmit:
|
|
4541
|
+
onSubmit: D,
|
|
3836
4542
|
style: {
|
|
3837
|
-
display:
|
|
4543
|
+
display: T === "form" ? "grid" : "none",
|
|
3838
4544
|
gap: 10
|
|
3839
4545
|
},
|
|
3840
4546
|
children: [
|
|
3841
|
-
|
|
4547
|
+
w ? /* @__PURE__ */ d("label", {
|
|
3842
4548
|
style: {
|
|
3843
|
-
...
|
|
4549
|
+
...St,
|
|
3844
4550
|
display: "grid",
|
|
3845
4551
|
gap: 6
|
|
3846
4552
|
},
|
|
3847
4553
|
children: [a, /* @__PURE__ */ u("input", {
|
|
3848
4554
|
name: "name",
|
|
3849
4555
|
type: "text",
|
|
3850
|
-
style:
|
|
3851
|
-
|
|
4556
|
+
style: Q,
|
|
4557
|
+
...$(f)
|
|
3852
4558
|
})]
|
|
3853
4559
|
}) : null,
|
|
3854
4560
|
/* @__PURE__ */ d("label", {
|
|
3855
4561
|
style: {
|
|
3856
|
-
...
|
|
4562
|
+
...St,
|
|
3857
4563
|
display: "grid",
|
|
3858
4564
|
gap: 6
|
|
3859
4565
|
},
|
|
@@ -3861,13 +4567,13 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3861
4567
|
name: "email",
|
|
3862
4568
|
type: "email",
|
|
3863
4569
|
required: !f,
|
|
3864
|
-
style:
|
|
3865
|
-
|
|
4570
|
+
style: Q,
|
|
4571
|
+
...$(f)
|
|
3866
4572
|
})]
|
|
3867
4573
|
}),
|
|
3868
4574
|
/* @__PURE__ */ d("label", {
|
|
3869
4575
|
style: {
|
|
3870
|
-
...
|
|
4576
|
+
...St,
|
|
3871
4577
|
display: "grid",
|
|
3872
4578
|
gap: 6
|
|
3873
4579
|
},
|
|
@@ -3875,15 +4581,15 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3875
4581
|
name: "password",
|
|
3876
4582
|
type: "password",
|
|
3877
4583
|
required: !f,
|
|
3878
|
-
style:
|
|
3879
|
-
|
|
4584
|
+
style: Q,
|
|
4585
|
+
...$(f)
|
|
3880
4586
|
})]
|
|
3881
4587
|
}),
|
|
3882
4588
|
/* @__PURE__ */ u("button", {
|
|
3883
4589
|
type: f ? "button" : "submit",
|
|
3884
4590
|
disabled: S || void 0,
|
|
3885
4591
|
style: {
|
|
3886
|
-
...
|
|
4592
|
+
...X,
|
|
3887
4593
|
border: 0,
|
|
3888
4594
|
padding: "10px 22px",
|
|
3889
4595
|
borderRadius: 8,
|
|
@@ -3892,7 +4598,7 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3892
4598
|
cursor: "pointer",
|
|
3893
4599
|
opacity: S ? .6 : 1
|
|
3894
4600
|
},
|
|
3895
|
-
children: o || (
|
|
4601
|
+
children: o || (w ? "Create account" : "Sign in")
|
|
3896
4602
|
}),
|
|
3897
4603
|
b ? /* @__PURE__ */ u("p", {
|
|
3898
4604
|
style: {
|
|
@@ -3905,18 +4611,18 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3905
4611
|
]
|
|
3906
4612
|
}),
|
|
3907
4613
|
/* @__PURE__ */ u("div", {
|
|
3908
|
-
style: { display:
|
|
4614
|
+
style: { display: T === "success" ? "block" : "none" },
|
|
3909
4615
|
children: p?.success ?? null
|
|
3910
4616
|
}),
|
|
3911
4617
|
/* @__PURE__ */ u("div", {
|
|
3912
|
-
style: { display:
|
|
4618
|
+
style: { display: T === "error" ? "block" : "none" },
|
|
3913
4619
|
children: p?.error ?? null
|
|
3914
4620
|
})
|
|
3915
4621
|
]
|
|
3916
4622
|
});
|
|
3917
4623
|
}
|
|
3918
|
-
function
|
|
3919
|
-
let { user: c, status: l, signOut: f } =
|
|
4624
|
+
function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
4625
|
+
let { user: c, status: l, signOut: f } = kn(), p = a ? s || "user" : l, m = a ? {
|
|
3920
4626
|
name: "Ada Lovelace",
|
|
3921
4627
|
email: "ada@example.com"
|
|
3922
4628
|
} : c;
|
|
@@ -3924,7 +4630,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3924
4630
|
ref: i,
|
|
3925
4631
|
style: {
|
|
3926
4632
|
minHeight: 24,
|
|
3927
|
-
...
|
|
4633
|
+
...A(r)
|
|
3928
4634
|
}
|
|
3929
4635
|
}) : p === "user" ? /* @__PURE__ */ d("div", {
|
|
3930
4636
|
ref: i,
|
|
@@ -3932,12 +4638,12 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3932
4638
|
display: "flex",
|
|
3933
4639
|
alignItems: "center",
|
|
3934
4640
|
gap: 10,
|
|
3935
|
-
...
|
|
4641
|
+
...A(r)
|
|
3936
4642
|
},
|
|
3937
4643
|
children: [
|
|
3938
4644
|
/* @__PURE__ */ d("span", {
|
|
3939
4645
|
style: {
|
|
3940
|
-
...
|
|
4646
|
+
...St,
|
|
3941
4647
|
fontWeight: 600
|
|
3942
4648
|
},
|
|
3943
4649
|
children: [
|
|
@@ -3948,7 +4654,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3948
4654
|
}),
|
|
3949
4655
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
3950
4656
|
style: {
|
|
3951
|
-
...
|
|
4657
|
+
...St,
|
|
3952
4658
|
opacity: .7
|
|
3953
4659
|
},
|
|
3954
4660
|
children: m.email
|
|
@@ -3957,14 +4663,14 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3957
4663
|
type: "button",
|
|
3958
4664
|
onClick: a ? void 0 : f,
|
|
3959
4665
|
style: {
|
|
3960
|
-
...
|
|
4666
|
+
...X,
|
|
3961
4667
|
border: 0,
|
|
3962
4668
|
padding: "8px 16px",
|
|
3963
4669
|
borderRadius: 8,
|
|
3964
4670
|
fontSize: 14,
|
|
3965
4671
|
cursor: a ? "default" : "pointer"
|
|
3966
4672
|
},
|
|
3967
|
-
|
|
4673
|
+
...$(a),
|
|
3968
4674
|
children: t
|
|
3969
4675
|
})
|
|
3970
4676
|
]
|
|
@@ -3974,47 +4680,47 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3974
4680
|
display: "flex",
|
|
3975
4681
|
alignItems: "center",
|
|
3976
4682
|
gap: 10,
|
|
3977
|
-
...
|
|
4683
|
+
...A(r)
|
|
3978
4684
|
},
|
|
3979
4685
|
children: o?.signedOut ?? null
|
|
3980
4686
|
});
|
|
3981
4687
|
}
|
|
3982
4688
|
//#endregion
|
|
3983
4689
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
3984
|
-
var
|
|
4690
|
+
var Pn = {
|
|
3985
4691
|
id: "consent",
|
|
3986
4692
|
label: "Cookie consent",
|
|
3987
4693
|
category: "Apps",
|
|
3988
4694
|
keys: ["CookieConsent"],
|
|
3989
4695
|
ssr: "shell",
|
|
3990
4696
|
settings: []
|
|
3991
|
-
},
|
|
3992
|
-
function
|
|
4697
|
+
}, Fn = "webim.cookie_consent";
|
|
4698
|
+
function In() {
|
|
3993
4699
|
try {
|
|
3994
|
-
let e = window.localStorage.getItem(
|
|
4700
|
+
let e = window.localStorage.getItem(Fn), t = e ? JSON.parse(e) : null;
|
|
3995
4701
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
3996
4702
|
} catch {
|
|
3997
4703
|
return "";
|
|
3998
4704
|
}
|
|
3999
4705
|
}
|
|
4000
|
-
function
|
|
4706
|
+
function Ln(e) {
|
|
4001
4707
|
try {
|
|
4002
4708
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
4003
4709
|
} catch {}
|
|
4004
4710
|
}
|
|
4005
|
-
function
|
|
4711
|
+
function Rn(e) {
|
|
4006
4712
|
try {
|
|
4007
|
-
window.localStorage.setItem(
|
|
4713
|
+
window.localStorage.setItem(Fn, JSON.stringify({
|
|
4008
4714
|
choice: e,
|
|
4009
4715
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4010
4716
|
}));
|
|
4011
4717
|
} catch {}
|
|
4012
|
-
|
|
4718
|
+
Ln(e);
|
|
4013
4719
|
try {
|
|
4014
4720
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
4015
4721
|
} catch {}
|
|
4016
4722
|
}
|
|
4017
|
-
var
|
|
4723
|
+
var zn = {
|
|
4018
4724
|
bottom: {
|
|
4019
4725
|
left: 0,
|
|
4020
4726
|
right: 0,
|
|
@@ -4036,21 +4742,21 @@ var hn = {
|
|
|
4036
4742
|
maxWidth: 400
|
|
4037
4743
|
}
|
|
4038
4744
|
};
|
|
4039
|
-
function
|
|
4745
|
+
function Bn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
4040
4746
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
4041
4747
|
y(e), typeof m == "function" && m(e);
|
|
4042
4748
|
};
|
|
4043
4749
|
if (i(() => {
|
|
4044
4750
|
if (h) return;
|
|
4045
|
-
let e =
|
|
4751
|
+
let e = In();
|
|
4046
4752
|
if (e) {
|
|
4047
4753
|
let t = v?.closest?.(".webim-page");
|
|
4048
4754
|
t && t.setAttribute("data-webim-consent", e);
|
|
4049
4755
|
} else _(!0);
|
|
4050
4756
|
}, [h, v]), !g) return null;
|
|
4051
4757
|
let x = (e) => () => {
|
|
4052
|
-
h || (
|
|
4053
|
-
}, S =
|
|
4758
|
+
h || (Rn(e, v), _(!1));
|
|
4759
|
+
}, S = zn[s] ?? zn.bottom, C = {
|
|
4054
4760
|
appearance: "none",
|
|
4055
4761
|
font: "inherit",
|
|
4056
4762
|
fontSize: 14,
|
|
@@ -4082,7 +4788,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4082
4788
|
boxShadow: "0 8px 30px rgba(15, 23, 42, 0.18)",
|
|
4083
4789
|
fontSize: 14,
|
|
4084
4790
|
lineHeight: 1.5,
|
|
4085
|
-
...
|
|
4791
|
+
...A(p)
|
|
4086
4792
|
},
|
|
4087
4793
|
children: [/* @__PURE__ */ d("div", {
|
|
4088
4794
|
style: {
|
|
@@ -4108,7 +4814,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4108
4814
|
type: "button",
|
|
4109
4815
|
onClick: x("declined"),
|
|
4110
4816
|
style: {
|
|
4111
|
-
...
|
|
4817
|
+
...C,
|
|
4112
4818
|
background: "transparent",
|
|
4113
4819
|
color: "inherit",
|
|
4114
4820
|
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.6))"
|
|
@@ -4118,7 +4824,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4118
4824
|
type: "button",
|
|
4119
4825
|
onClick: x("accepted"),
|
|
4120
4826
|
style: {
|
|
4121
|
-
...
|
|
4827
|
+
...C,
|
|
4122
4828
|
background: "var(--page-accent, #111827)",
|
|
4123
4829
|
color: "var(--page-accent-text, #ffffff)",
|
|
4124
4830
|
border: "1px solid transparent"
|
|
@@ -4130,31 +4836,251 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4130
4836
|
}
|
|
4131
4837
|
//#endregion
|
|
4132
4838
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
4133
|
-
var
|
|
4839
|
+
var Vn = {
|
|
4134
4840
|
id: "language",
|
|
4135
4841
|
label: "Language",
|
|
4136
4842
|
category: "Apps",
|
|
4137
4843
|
keys: ["SiteLanguagePicker"],
|
|
4138
4844
|
ssr: "prefetch",
|
|
4139
4845
|
settings: ["locales"]
|
|
4140
|
-
}
|
|
4846
|
+
}, Hn = {
|
|
4847
|
+
id: "search",
|
|
4848
|
+
label: "Search",
|
|
4849
|
+
category: "Apps",
|
|
4850
|
+
keys: ["SiteSearch"],
|
|
4851
|
+
ssr: "prefetch",
|
|
4852
|
+
settings: []
|
|
4853
|
+
}, Un = 50, Wn = 2e3;
|
|
4854
|
+
function Gn() {
|
|
4855
|
+
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
4856
|
+
}
|
|
4857
|
+
function Kn(e, t) {
|
|
4858
|
+
let n = e?.data ?? {}, r = [];
|
|
4859
|
+
for (let e of Object.values(n)) {
|
|
4860
|
+
let t = e == null ? "" : Y(e);
|
|
4861
|
+
if (t && r.push(t), r.join(" ").length > Wn) break;
|
|
4862
|
+
}
|
|
4863
|
+
return r.join(" ").slice(0, Wn).toLocaleLowerCase(t || void 0);
|
|
4864
|
+
}
|
|
4865
|
+
function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
4866
|
+
let { tenant: b, apiUrl: x, locale: S } = r(q), [C, w] = c(() => Gn()), [T, E] = c(() => Gn()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
4867
|
+
i(() => {
|
|
4868
|
+
let e = () => {
|
|
4869
|
+
let e = Gn();
|
|
4870
|
+
w(e), E(e);
|
|
4871
|
+
};
|
|
4872
|
+
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
4873
|
+
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
4874
|
+
};
|
|
4875
|
+
}, []), i(() => {
|
|
4876
|
+
if (!a) return;
|
|
4877
|
+
let e = setTimeout(() => {
|
|
4878
|
+
w(T), T.trim() && j(!0);
|
|
4879
|
+
}, 200);
|
|
4880
|
+
return () => clearTimeout(e);
|
|
4881
|
+
}, [a, T]), i(() => {
|
|
4882
|
+
if (!N) return;
|
|
4883
|
+
let e = (e) => {
|
|
4884
|
+
M.current && !M.current.contains(e.target) && j(!1);
|
|
4885
|
+
}, t = (e) => e.key === "Escape" && j(!1);
|
|
4886
|
+
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
4887
|
+
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
4888
|
+
};
|
|
4889
|
+
}, [N]), i(() => {
|
|
4890
|
+
let e = !0, t = b ? { "x-tenant": b } : {}, n = (e) => fetch(`${x}${e}`, { headers: t }).then((e) => e.json()).then((e) => e?.payload).catch(() => null), r = [l ? n("/site/pages").then((e) => ({
|
|
4891
|
+
kind: "page",
|
|
4892
|
+
rows: Array.isArray(e) ? e : []
|
|
4893
|
+
})) : null, ...(Array.isArray(f) ? f : []).filter(Boolean).map((e) => n(`/dynamic/${encodeURIComponent(e)}?all=1${S ? `&locale=${encodeURIComponent(S)}` : ""}`).then((t) => ({
|
|
4894
|
+
kind: "entry",
|
|
4895
|
+
slug: e,
|
|
4896
|
+
rows: Array.isArray(t) ? t : Array.isArray(t?.data) ? t.data : []
|
|
4897
|
+
})))].filter(Boolean);
|
|
4898
|
+
return Promise.all(r).then((t) => e && O(t)), () => {
|
|
4899
|
+
e = !1;
|
|
4900
|
+
};
|
|
4901
|
+
}, [
|
|
4902
|
+
x,
|
|
4903
|
+
b,
|
|
4904
|
+
S,
|
|
4905
|
+
l,
|
|
4906
|
+
JSON.stringify(f)
|
|
4907
|
+
]);
|
|
4908
|
+
let P = C.trim().toLocaleLowerCase(S || void 0), F = [];
|
|
4909
|
+
if (P && D) for (let e of D) if (e.kind === "page") for (let t of e.rows) {
|
|
4910
|
+
if (t?.access && t.access !== "public") continue;
|
|
4911
|
+
let e = String(t?.title ?? "");
|
|
4912
|
+
`${e} ${t?.slug ?? ""}`.toLocaleLowerCase(S || void 0).includes(P) && F.push({
|
|
4913
|
+
key: `page:${t.slug}`,
|
|
4914
|
+
title: e || t.slug,
|
|
4915
|
+
url: `/${t.slug}`,
|
|
4916
|
+
kind: "page"
|
|
4917
|
+
});
|
|
4918
|
+
}
|
|
4919
|
+
else for (let t of e.rows) {
|
|
4920
|
+
if (!Kn(t, S).includes(P)) continue;
|
|
4921
|
+
let n = t?.data ?? {}, r = Y(n.name) || "Untitled", i = Y(n.slug);
|
|
4922
|
+
F.push({
|
|
4923
|
+
key: `entry:${t.id}`,
|
|
4924
|
+
title: r,
|
|
4925
|
+
url: i ? `/${e.slug}/${i}` : `/${e.slug}`,
|
|
4926
|
+
kind: "entry"
|
|
4927
|
+
});
|
|
4928
|
+
}
|
|
4929
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Un)), L = (e) => {
|
|
4930
|
+
if (v) {
|
|
4931
|
+
e.preventDefault(), w(T), j(!0);
|
|
4932
|
+
return;
|
|
4933
|
+
}
|
|
4934
|
+
if (typeof window > "u" || !window.history?.pushState) return;
|
|
4935
|
+
e.preventDefault();
|
|
4936
|
+
let t = new URLSearchParams(window.location.search);
|
|
4937
|
+
T.trim() ? t.set("q", T.trim()) : t.delete("q"), t.delete("page");
|
|
4938
|
+
let n = t.toString();
|
|
4939
|
+
window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange")), j(!0);
|
|
4940
|
+
}, R = y && !P ? [{
|
|
4941
|
+
key: "sample-1",
|
|
4942
|
+
title: "About us",
|
|
4943
|
+
url: "/about",
|
|
4944
|
+
kind: "page"
|
|
4945
|
+
}, {
|
|
4946
|
+
key: "sample-2",
|
|
4947
|
+
title: "Spring collection",
|
|
4948
|
+
url: "/blog/spring",
|
|
4949
|
+
kind: "entry"
|
|
4950
|
+
}] : null, z = R ?? I, ee = !R && P && D && !I.length, B = !N || k && (z.length > 0 || ee), V = z.length > 0 && /* @__PURE__ */ u("ul", {
|
|
4951
|
+
style: {
|
|
4952
|
+
listStyle: "none",
|
|
4953
|
+
margin: 0,
|
|
4954
|
+
padding: 0,
|
|
4955
|
+
display: "flex",
|
|
4956
|
+
flexDirection: "column",
|
|
4957
|
+
gap: 2
|
|
4958
|
+
},
|
|
4959
|
+
children: z.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("a", {
|
|
4960
|
+
href: v ? void 0 : e.url,
|
|
4961
|
+
style: {
|
|
4962
|
+
display: "block",
|
|
4963
|
+
padding: "10px 12px",
|
|
4964
|
+
borderRadius: 6,
|
|
4965
|
+
color: "inherit",
|
|
4966
|
+
textDecoration: "none",
|
|
4967
|
+
border: N ? 0 : "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
|
|
4968
|
+
},
|
|
4969
|
+
children: [/* @__PURE__ */ u("span", {
|
|
4970
|
+
style: {
|
|
4971
|
+
display: "block",
|
|
4972
|
+
fontWeight: 600
|
|
4973
|
+
},
|
|
4974
|
+
children: e.title
|
|
4975
|
+
}), /* @__PURE__ */ u("span", {
|
|
4976
|
+
style: {
|
|
4977
|
+
display: "block",
|
|
4978
|
+
fontSize: 12,
|
|
4979
|
+
opacity: .6
|
|
4980
|
+
},
|
|
4981
|
+
children: e.url
|
|
4982
|
+
})]
|
|
4983
|
+
}) }, e.key))
|
|
4984
|
+
});
|
|
4985
|
+
return /* @__PURE__ */ u("div", {
|
|
4986
|
+
ref: _,
|
|
4987
|
+
style: {
|
|
4988
|
+
width: "100%",
|
|
4989
|
+
...A(g)
|
|
4990
|
+
},
|
|
4991
|
+
children: /* @__PURE__ */ d("div", {
|
|
4992
|
+
ref: M,
|
|
4993
|
+
style: { position: "relative" },
|
|
4994
|
+
children: [
|
|
4995
|
+
/* @__PURE__ */ d("form", {
|
|
4996
|
+
method: "get",
|
|
4997
|
+
onSubmit: L,
|
|
4998
|
+
style: {
|
|
4999
|
+
display: "flex",
|
|
5000
|
+
gap: 8,
|
|
5001
|
+
alignItems: "center"
|
|
5002
|
+
},
|
|
5003
|
+
children: [/* @__PURE__ */ u("input", {
|
|
5004
|
+
type: "search",
|
|
5005
|
+
name: "q",
|
|
5006
|
+
value: T,
|
|
5007
|
+
placeholder: e,
|
|
5008
|
+
onChange: (e) => E(e.target.value),
|
|
5009
|
+
onFocus: () => P && j(!0),
|
|
5010
|
+
style: {
|
|
5011
|
+
...Q,
|
|
5012
|
+
flexGrow: 1,
|
|
5013
|
+
minWidth: 0
|
|
5014
|
+
}
|
|
5015
|
+
}), n !== !1 && /* @__PURE__ */ u("button", {
|
|
5016
|
+
type: "submit",
|
|
5017
|
+
style: {
|
|
5018
|
+
padding: "10px 16px",
|
|
5019
|
+
border: 0,
|
|
5020
|
+
borderRadius: 6,
|
|
5021
|
+
cursor: "pointer",
|
|
5022
|
+
fontSize: 14,
|
|
5023
|
+
fontFamily: "inherit",
|
|
5024
|
+
background: "var(--page-accent, #4f46e5)",
|
|
5025
|
+
color: "var(--page-accent-text, #ffffff)"
|
|
5026
|
+
},
|
|
5027
|
+
children: t
|
|
5028
|
+
})]
|
|
5029
|
+
}),
|
|
5030
|
+
h && /* @__PURE__ */ u("div", {
|
|
5031
|
+
style: {
|
|
5032
|
+
fontSize: 13,
|
|
5033
|
+
opacity: .65,
|
|
5034
|
+
marginTop: 6
|
|
5035
|
+
},
|
|
5036
|
+
children: h
|
|
5037
|
+
}),
|
|
5038
|
+
B && /* @__PURE__ */ d("div", {
|
|
5039
|
+
style: N ? {
|
|
5040
|
+
position: "absolute",
|
|
5041
|
+
top: "100%",
|
|
5042
|
+
left: 0,
|
|
5043
|
+
right: 0,
|
|
5044
|
+
zIndex: 30,
|
|
5045
|
+
marginTop: 6,
|
|
5046
|
+
padding: 6,
|
|
5047
|
+
maxHeight: 320,
|
|
5048
|
+
overflowY: "auto",
|
|
5049
|
+
borderRadius: 8,
|
|
5050
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
|
|
5051
|
+
background: "var(--page-surface, #f2f2f2)",
|
|
5052
|
+
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5053
|
+
} : { marginTop: 14 },
|
|
5054
|
+
children: [V, ee && /* @__PURE__ */ u("div", {
|
|
5055
|
+
style: {
|
|
5056
|
+
fontSize: 14,
|
|
5057
|
+
opacity: .65,
|
|
5058
|
+
padding: N ? "10px 12px" : 0
|
|
5059
|
+
},
|
|
5060
|
+
children: m
|
|
5061
|
+
})]
|
|
5062
|
+
})
|
|
5063
|
+
]
|
|
5064
|
+
})
|
|
5065
|
+
});
|
|
5066
|
+
}
|
|
4141
5067
|
//#endregion
|
|
4142
5068
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
4143
|
-
function
|
|
5069
|
+
function Jn(e) {
|
|
4144
5070
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
4145
5071
|
return [...new Set(n.map((e) => e.trim()))];
|
|
4146
5072
|
}
|
|
4147
|
-
var
|
|
4148
|
-
function
|
|
5073
|
+
var Yn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5074
|
+
function Xn(e, t) {
|
|
4149
5075
|
let n = String(e ?? "").toUpperCase();
|
|
4150
5076
|
if (t === "code") return n;
|
|
4151
5077
|
let r = "";
|
|
4152
5078
|
try {
|
|
4153
|
-
r =
|
|
5079
|
+
r = Yn(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
4154
5080
|
} catch {}
|
|
4155
5081
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
4156
5082
|
}
|
|
4157
|
-
function
|
|
5083
|
+
function Zn(e, t) {
|
|
4158
5084
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
4159
5085
|
if (typeof window > "u") return n || "?";
|
|
4160
5086
|
try {
|
|
@@ -4164,12 +5090,12 @@ function xn(e, t) {
|
|
|
4164
5090
|
return n || "/";
|
|
4165
5091
|
}
|
|
4166
5092
|
}
|
|
4167
|
-
function
|
|
4168
|
-
let c = r(
|
|
5093
|
+
function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
5094
|
+
let c = r(q), l = Jn(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
4169
5095
|
display: "inline-flex",
|
|
4170
5096
|
alignItems: "center",
|
|
4171
5097
|
gap: 8,
|
|
4172
|
-
...
|
|
5098
|
+
...A(a)
|
|
4173
5099
|
};
|
|
4174
5100
|
if (l.length < 2) return s ? /* @__PURE__ */ u("div", {
|
|
4175
5101
|
ref: o,
|
|
@@ -4200,7 +5126,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
4200
5126
|
style: { opacity: .4 },
|
|
4201
5127
|
children: n ?? "·"
|
|
4202
5128
|
}), /* @__PURE__ */ u("a", {
|
|
4203
|
-
href:
|
|
5129
|
+
href: Zn(e, e === f),
|
|
4204
5130
|
hrefLang: e,
|
|
4205
5131
|
"aria-current": e === p ? "true" : void 0,
|
|
4206
5132
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -4210,7 +5136,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
4210
5136
|
textDecoration: "none",
|
|
4211
5137
|
cursor: s ? "default" : "pointer"
|
|
4212
5138
|
},
|
|
4213
|
-
children:
|
|
5139
|
+
children: Xn(e, t)
|
|
4214
5140
|
})]
|
|
4215
5141
|
}, e))]
|
|
4216
5142
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -4221,7 +5147,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
4221
5147
|
value: p,
|
|
4222
5148
|
onChange: s ? void 0 : (e) => {
|
|
4223
5149
|
let t = e.target.value;
|
|
4224
|
-
window.location.assign(
|
|
5150
|
+
window.location.assign(Zn(t, t === f));
|
|
4225
5151
|
},
|
|
4226
5152
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
4227
5153
|
style: {
|
|
@@ -4235,55 +5161,57 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
4235
5161
|
},
|
|
4236
5162
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
4237
5163
|
value: e,
|
|
4238
|
-
children:
|
|
5164
|
+
children: Xn(e, t)
|
|
4239
5165
|
}, e))
|
|
4240
5166
|
})]
|
|
4241
5167
|
});
|
|
4242
5168
|
}
|
|
4243
5169
|
//#endregion
|
|
4244
5170
|
//#region ../ui/src/components/builder/apps/index.js
|
|
4245
|
-
var
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
5171
|
+
var $n = [
|
|
5172
|
+
Dn,
|
|
5173
|
+
Vn,
|
|
5174
|
+
Pn,
|
|
5175
|
+
Hn
|
|
5176
|
+
], er = {
|
|
5177
|
+
SiteLoginForm: Mn,
|
|
5178
|
+
SiteAccountMenu: Nn,
|
|
5179
|
+
SiteLanguagePicker: Qn,
|
|
5180
|
+
CookieConsent: Bn,
|
|
5181
|
+
SiteSearch: qn
|
|
4254
5182
|
};
|
|
4255
|
-
new Set(
|
|
5183
|
+
new Set($n.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
4256
5184
|
//#endregion
|
|
4257
5185
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
4258
|
-
var
|
|
4259
|
-
function
|
|
4260
|
-
if (
|
|
5186
|
+
var tr = /* @__PURE__ */ new Map();
|
|
5187
|
+
function nr(e) {
|
|
5188
|
+
if (tr.has(e)) return tr.get(e);
|
|
4261
5189
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
4262
5190
|
/* @vite-ignore */
|
|
4263
5191
|
/* webpackIgnore: true */
|
|
4264
5192
|
t
|
|
4265
5193
|
).finally(() => URL.revokeObjectURL(t));
|
|
4266
|
-
return
|
|
5194
|
+
return tr.set(e, n), n;
|
|
4267
5195
|
}
|
|
4268
|
-
function
|
|
5196
|
+
function rr(e) {
|
|
4269
5197
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
4270
5198
|
return n && typeof n == "object" ? n : {};
|
|
4271
5199
|
}
|
|
4272
5200
|
//#endregion
|
|
4273
5201
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
4274
|
-
async function
|
|
4275
|
-
let n = await
|
|
5202
|
+
async function ir(e, t) {
|
|
5203
|
+
let n = await nr(e);
|
|
4276
5204
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
4277
5205
|
}
|
|
4278
|
-
var
|
|
5206
|
+
var ar = {
|
|
4279
5207
|
padding: "10px 12px",
|
|
4280
5208
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
4281
5209
|
borderRadius: 8,
|
|
4282
5210
|
fontSize: 12,
|
|
4283
5211
|
opacity: .6
|
|
4284
5212
|
};
|
|
4285
|
-
function
|
|
4286
|
-
let c = r(
|
|
5213
|
+
function or({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
5214
|
+
let c = r(q), l = rr(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
4287
5215
|
tenant: c?.tenant ?? "",
|
|
4288
5216
|
apiUrl: c?.apiUrl ?? "/api",
|
|
4289
5217
|
locale: c?.locale ?? "",
|
|
@@ -4295,7 +5223,7 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
4295
5223
|
let e = f.current;
|
|
4296
5224
|
if (!l?.code || !e) return;
|
|
4297
5225
|
let n = !0;
|
|
4298
|
-
return
|
|
5226
|
+
return ir(l.code, t).then((e) => {
|
|
4299
5227
|
if (!(!n || !e || !f.current)) {
|
|
4300
5228
|
p.current = e;
|
|
4301
5229
|
try {
|
|
@@ -4320,13 +5248,13 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
4320
5248
|
} catch {}
|
|
4321
5249
|
}, [g]), l ? /* @__PURE__ */ u("div", {
|
|
4322
5250
|
ref: o,
|
|
4323
|
-
style:
|
|
5251
|
+
style: A(a),
|
|
4324
5252
|
children: /* @__PURE__ */ u("div", { ref: f })
|
|
4325
5253
|
}) : /* @__PURE__ */ d("div", {
|
|
4326
5254
|
ref: o,
|
|
4327
5255
|
style: {
|
|
4328
|
-
...
|
|
4329
|
-
...
|
|
5256
|
+
...ar,
|
|
5257
|
+
...A(a)
|
|
4330
5258
|
},
|
|
4331
5259
|
children: [
|
|
4332
5260
|
"Plugin “",
|
|
@@ -4337,12 +5265,12 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
4337
5265
|
}
|
|
4338
5266
|
//#endregion
|
|
4339
5267
|
//#region ../ui/src/components/builder/render.jsx
|
|
4340
|
-
var
|
|
4341
|
-
...
|
|
4342
|
-
...
|
|
4343
|
-
PluginBlock:
|
|
5268
|
+
var sr = {
|
|
5269
|
+
...En,
|
|
5270
|
+
...er,
|
|
5271
|
+
PluginBlock: or
|
|
4344
5272
|
};
|
|
4345
|
-
function
|
|
5273
|
+
function cr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
4346
5274
|
let o = n[t];
|
|
4347
5275
|
if (!o || o.hidden) return null;
|
|
4348
5276
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -4350,112 +5278,114 @@ function Mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
4350
5278
|
let n = o.props?.componentId, s = r?.[n];
|
|
4351
5279
|
if (!s?.template || i.has(n)) return null;
|
|
4352
5280
|
let c = new Set(i).add(n);
|
|
4353
|
-
return /* @__PURE__ */ u(e, { children:
|
|
5281
|
+
return /* @__PURE__ */ u(e, { children: cr(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
4354
5282
|
}
|
|
4355
|
-
let l =
|
|
5283
|
+
let l = sr[s];
|
|
4356
5284
|
if (!l) return null;
|
|
4357
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
5285
|
+
let d = (o.nodes ?? []).map((e) => cr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, cr(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
4358
5286
|
...c,
|
|
4359
5287
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
4360
5288
|
linked: p,
|
|
4361
5289
|
nodeRef: (e) => {
|
|
4362
|
-
e && (e.setAttribute("data-wb", t),
|
|
5290
|
+
e && (e.setAttribute("data-wb", t), B(e, c), ee(e, c.events));
|
|
4363
5291
|
},
|
|
4364
5292
|
children: d.length ? d : void 0
|
|
4365
5293
|
}, t);
|
|
4366
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
5294
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(jn, {
|
|
4367
5295
|
when: c.when,
|
|
4368
5296
|
children: m
|
|
4369
5297
|
}, t) : m;
|
|
4370
5298
|
}
|
|
4371
5299
|
//#endregion
|
|
4372
5300
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
4373
|
-
var
|
|
4374
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
4375
|
-
function
|
|
4376
|
-
let
|
|
5301
|
+
var lr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ur = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(K(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5302
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(K(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5303
|
+
function dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
5304
|
+
let b = s?.js?.trim();
|
|
4377
5305
|
if (i(() => {
|
|
4378
|
-
if (!
|
|
5306
|
+
if (!b) return;
|
|
4379
5307
|
let e = document.createElement("script");
|
|
4380
|
-
return e.text =
|
|
4381
|
-
}, [
|
|
4382
|
-
let
|
|
4383
|
-
lang:
|
|
4384
|
-
dir:
|
|
4385
|
-
},
|
|
5308
|
+
return e.text = b, document.body.appendChild(e), () => e.remove();
|
|
5309
|
+
}, [b]), !e?.ROOT) return null;
|
|
5310
|
+
let x = {
|
|
5311
|
+
lang: m || void 0,
|
|
5312
|
+
dir: be(h, m)
|
|
5313
|
+
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
4386
5314
|
minHeight: "100%",
|
|
4387
5315
|
display: "flex",
|
|
4388
5316
|
flexDirection: "column"
|
|
4389
|
-
},
|
|
5317
|
+
}, w = cr("ROOT", e, n), T = o(() => ({ render: (t, r) => cr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = oe(e, n), O = ae(e, n), k = s?.css?.trim(), A = E(c), j = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !G[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
4390
5318
|
rel: "stylesheet",
|
|
4391
5319
|
precedence: "default",
|
|
4392
5320
|
href: g(e)
|
|
4393
|
-
}, e)),
|
|
4394
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
5321
|
+
}, e)), P = ur(j);
|
|
5322
|
+
return r === "auto" ? /* @__PURE__ */ u(q.Provider, {
|
|
4395
5323
|
value: {
|
|
4396
|
-
tenant:
|
|
4397
|
-
apiUrl:
|
|
4398
|
-
locale:
|
|
4399
|
-
settings:
|
|
5324
|
+
tenant: l || "",
|
|
5325
|
+
apiUrl: f || "/api",
|
|
5326
|
+
locale: m || "",
|
|
5327
|
+
settings: _ ?? null
|
|
4400
5328
|
},
|
|
4401
|
-
children: /* @__PURE__ */ u(
|
|
4402
|
-
initialUser:
|
|
4403
|
-
children: /* @__PURE__ */ u(
|
|
4404
|
-
value:
|
|
4405
|
-
children: /* @__PURE__ */ u(
|
|
4406
|
-
value:
|
|
5329
|
+
children: /* @__PURE__ */ u(An, {
|
|
5330
|
+
initialUser: v,
|
|
5331
|
+
children: /* @__PURE__ */ u(J.Provider, {
|
|
5332
|
+
value: p ?? null,
|
|
5333
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
5334
|
+
value: T,
|
|
4407
5335
|
children: /* @__PURE__ */ d("div", {
|
|
4408
|
-
...
|
|
5336
|
+
...x,
|
|
4409
5337
|
className: "webim-page",
|
|
4410
5338
|
style: {
|
|
4411
|
-
...
|
|
4412
|
-
...
|
|
5339
|
+
...C,
|
|
5340
|
+
...de(t),
|
|
4413
5341
|
...a
|
|
4414
5342
|
},
|
|
4415
5343
|
children: [
|
|
4416
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
4417
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
4418
|
-
/* @__PURE__ */ u("style", { children:
|
|
4419
|
-
|
|
4420
|
-
/* @__PURE__ */ u("style", { children:
|
|
4421
|
-
T && /* @__PURE__ */ u("style", { children: T }),
|
|
4422
|
-
E && /* @__PURE__ */ u("style", { children: E }),
|
|
5344
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${lr(K(j.light))} }
|
|
5345
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${lr(K(j.dark))} } }` }),
|
|
5346
|
+
/* @__PURE__ */ u("style", { children: P }),
|
|
5347
|
+
N,
|
|
5348
|
+
/* @__PURE__ */ u("style", { children: S }),
|
|
4423
5349
|
D && /* @__PURE__ */ u("style", { children: D }),
|
|
4424
|
-
|
|
5350
|
+
O && /* @__PURE__ */ u("style", { children: O }),
|
|
5351
|
+
k && /* @__PURE__ */ u("style", { children: k }),
|
|
5352
|
+
w
|
|
4425
5353
|
]
|
|
4426
5354
|
})
|
|
4427
5355
|
})
|
|
4428
5356
|
})
|
|
4429
5357
|
})
|
|
4430
|
-
}) : /* @__PURE__ */ u(
|
|
5358
|
+
}) : /* @__PURE__ */ u(q.Provider, {
|
|
4431
5359
|
value: {
|
|
4432
|
-
tenant:
|
|
4433
|
-
apiUrl:
|
|
4434
|
-
locale:
|
|
4435
|
-
settings:
|
|
5360
|
+
tenant: l || "",
|
|
5361
|
+
apiUrl: f || "/api",
|
|
5362
|
+
locale: m || "",
|
|
5363
|
+
settings: _ ?? null
|
|
4436
5364
|
},
|
|
4437
|
-
children: /* @__PURE__ */ u(
|
|
4438
|
-
initialUser:
|
|
4439
|
-
children: /* @__PURE__ */ u(
|
|
4440
|
-
value:
|
|
4441
|
-
children: /* @__PURE__ */ u(
|
|
4442
|
-
value:
|
|
5365
|
+
children: /* @__PURE__ */ u(An, {
|
|
5366
|
+
initialUser: v,
|
|
5367
|
+
children: /* @__PURE__ */ u(J.Provider, {
|
|
5368
|
+
value: p ?? null,
|
|
5369
|
+
children: /* @__PURE__ */ u(we.Provider, {
|
|
5370
|
+
value: T,
|
|
4443
5371
|
children: /* @__PURE__ */ d("div", {
|
|
4444
|
-
...
|
|
5372
|
+
...x,
|
|
4445
5373
|
className: "webim-page",
|
|
4446
5374
|
style: {
|
|
4447
|
-
...
|
|
4448
|
-
...
|
|
5375
|
+
...C,
|
|
5376
|
+
...fe(t, r),
|
|
4449
5377
|
...a
|
|
4450
5378
|
},
|
|
4451
5379
|
children: [
|
|
4452
|
-
|
|
4453
|
-
/* @__PURE__ */ u("style", { children:
|
|
4454
|
-
/* @__PURE__ */ u("style", { children:
|
|
4455
|
-
T && /* @__PURE__ */ u("style", { children: T }),
|
|
4456
|
-
E && /* @__PURE__ */ u("style", { children: E }),
|
|
5380
|
+
N,
|
|
5381
|
+
/* @__PURE__ */ u("style", { children: P }),
|
|
5382
|
+
/* @__PURE__ */ u("style", { children: S }),
|
|
4457
5383
|
D && /* @__PURE__ */ u("style", { children: D }),
|
|
4458
|
-
|
|
5384
|
+
O && /* @__PURE__ */ u("style", { children: O }),
|
|
5385
|
+
A && /* @__PURE__ */ u("style", { children: A }),
|
|
5386
|
+
A && /* @__PURE__ */ u("style", { children: A }),
|
|
5387
|
+
k && /* @__PURE__ */ u("style", { children: k }),
|
|
5388
|
+
w
|
|
4459
5389
|
]
|
|
4460
5390
|
})
|
|
4461
5391
|
})
|
|
@@ -4465,25 +5395,26 @@ function Fn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
4465
5395
|
}
|
|
4466
5396
|
//#endregion
|
|
4467
5397
|
//#region src/WebimContent.jsx
|
|
4468
|
-
function
|
|
4469
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
5398
|
+
function fr({ bundle: e, mode: t = "auto", style: n }) {
|
|
5399
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(dr, {
|
|
4470
5400
|
blocks: e.blocks,
|
|
4471
5401
|
theme: e.theme,
|
|
4472
5402
|
components: e.components,
|
|
4473
5403
|
custom: e.custom,
|
|
5404
|
+
animations: e.animations,
|
|
4474
5405
|
tenant: e.tenant,
|
|
4475
5406
|
apiUrl: e.apiUrl,
|
|
4476
5407
|
datasets: e.datasets,
|
|
4477
5408
|
locale: e.locale,
|
|
4478
5409
|
direction: e.direction,
|
|
4479
5410
|
settings: e.settings,
|
|
4480
|
-
mode:
|
|
5411
|
+
mode: me(t, e.scheme),
|
|
4481
5412
|
style: n
|
|
4482
5413
|
}) : null;
|
|
4483
5414
|
}
|
|
4484
5415
|
//#endregion
|
|
4485
5416
|
//#region src/WebimPage.jsx
|
|
4486
|
-
function
|
|
5417
|
+
function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
4487
5418
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
4488
5419
|
onLoad: m,
|
|
4489
5420
|
onError: h
|
|
@@ -4493,7 +5424,7 @@ function Ln({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
4493
5424
|
onError: h
|
|
4494
5425
|
}, i(() => {
|
|
4495
5426
|
let i = !0;
|
|
4496
|
-
return _({ status: "loading" }),
|
|
5427
|
+
return _({ status: "loading" }), _e({
|
|
4497
5428
|
apiUrl: e,
|
|
4498
5429
|
tenant: t,
|
|
4499
5430
|
slug: n,
|
|
@@ -4520,11 +5451,11 @@ function Ln({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
4520
5451
|
r,
|
|
4521
5452
|
a,
|
|
4522
5453
|
o
|
|
4523
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
5454
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(fr, {
|
|
4524
5455
|
bundle: g.bundle,
|
|
4525
5456
|
mode: l,
|
|
4526
5457
|
style: d
|
|
4527
5458
|
});
|
|
4528
5459
|
}
|
|
4529
5460
|
//#endregion
|
|
4530
|
-
export {
|
|
5461
|
+
export { dr as PageRenderer, fr as WebimContent, pr as WebimPage, _e as fetchPage, We as renderRichContent, pe as resolveTheme };
|