@levo-so/site-runtime 0.3.7 → 0.3.9
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/CollectionField-C-6a1ud4.js +270 -0
- package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
- package/DateTimeWidget-LfaosVVW.js +255 -0
- package/{Dialog-DVB4WpBS.js → Dialog-dT7y641z.js} +43 -43
- package/{KBChatWidget-Cnq0DCOQ.js → KBChatWidget-CuAtGhHT.js} +240 -239
- package/{LevoProvider-nmIbMlsk.js → LevoProvider-Bsjkcwc8.js} +8 -8
- package/PhoneWidget-D-CcDuie.js +99 -0
- package/{Popover-C7zZHBIc.js → Popover-BTdlOQP_.js} +20 -20
- package/{PopupBody-DZVwDLkg-yrot8Uqb.js → PopupBody-BI-MJqmd-C0qNyN7V.js} +299 -182
- package/PopupRenderer-D66Gx63H-C6RnOnl2.js +388 -0
- package/{RichTextWidget-BOrVIR2j.js → RichTextWidget-BFWVevY7.js} +140 -140
- package/ThemeProvider-DutrjSTF.js +116 -0
- package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
- package/{VerifyButton-CA1GtEZJ.js → VerifyButton-BUT70lgz.js} +65 -65
- package/{dist-Cb6sb7nO.js → dist-Rjs__H25.js} +14 -14
- package/dist-orLT2eNz.js +3663 -0
- package/index.d.ts +1071 -3
- package/index.js +1365 -733
- package/inlineBaseTheme-BB9e6h5f.js +9 -0
- package/{inlineCollectionTheme-DYYMrmcE.js → inlineCollectionTheme-CWcMCUti.js} +1 -1
- package/{kbChat-DIb4AS7E.js → kbChat-L55effMi.js} +28 -28
- package/{nodeAlignment-D70kOcui.js → nodeAlignment-COvc-rIj.js} +1 -1
- package/package.json +37 -27
- package/popups.js +1 -1
- package/{react-6kO0cqgr.js → react-B9yvlbH0.js} +1 -1
- package/routes-CyKmkoRM.js +316 -0
- package/start.d.ts +38 -0
- package/start.js +19 -0
- package/styles.css +1 -1
- package/{generateRadiusScale-54mE9ikx.js → themeVars.cssm-ByhhC2Jm.js} +17 -17
- package/usePopupRedirect-CAAdcpaW-D9XoiVhG.js +82 -0
- package/CollectionField-C59pmeQw.js +0 -270
- package/DateTimeWidget-Cctsvcrs.js +0 -255
- package/PhoneWidget-J3VTMWJH.js +0 -99
- package/PopupRenderer-BjW1jg70-Biwj2bIc.js +0 -387
- package/ThemeProvider-BQmIB5tr.js +0 -116
- package/dist-C8gLeklT.js +0 -3559
- package/inlineBaseTheme-B6E9zzyp.js +0 -9
- package/usePopupRedirect-BThP_YPW-DoixMAB9.js +0 -80
- /package/{createThemeExtension-DhGk81nV.js → createThemeExtension-4AUn51iJ.js} +0 -0
- /package/{es-CztjLuNy.js → es-Bj3CsMJz.js} +0 -0
- /package/{pillChrome-BAu5AfCT.js → pillChrome-uieiq_SK.js} +0 -0
- /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
- /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-CaRzrwtu.js} +0 -0
- /package/{theme.cssm-mkQwezuj.js → theme.cssm-DUzmx76l.js} +0 -0
package/PhoneWidget-J3VTMWJH.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as e } from "./VerifyButton-CA1GtEZJ.js";
|
|
3
|
-
import { r as t, t as n } from "./CollectionField-C59pmeQw.js";
|
|
4
|
-
import { t as r } from "./CollectionInput-B1qV4QEH.js";
|
|
5
|
-
import { useState as i } from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import s, { isSupportedCountry as c } from "react-phone-number-input";
|
|
8
|
-
import { useController as ee } from "react-hook-form";
|
|
9
|
-
import { c as te } from "react/compiler-runtime";
|
|
10
|
-
import { IconPencil as ne } from "@tabler/icons-react";
|
|
11
|
-
//#region ../../libraries/react-collection/dist/widgets/phoneWidget/PhoneWidget.cssm.js
|
|
12
|
-
var re = "_89f1hw0", l = "_89f1hw1", u = "_89f1hw2", ie = "_89f1hw4", d = (d) => {
|
|
13
|
-
let f = te(51), { field: p, settings: ae } = d, { key: m, label: h, helper_text: g, readonly: _, options: v } = p, y = m === void 0 ? "" : m, b = h === void 0 ? "" : h, x = g === void 0 ? "" : g, S = _ === void 0 ? !1 : _, C = y, w = !!v?.verification && !!ae?.enableVerification, [T, E] = i(null), [D, oe] = i(!1), O;
|
|
14
|
-
f[0] !== D || f[1] !== w || f[2] !== T ? (O = (e) => D ? !0 : w && (!T || T !== e) ? "Phone verification required" : !0, f[0] = D, f[1] = w, f[2] = T, f[3] = O) : O = f[3];
|
|
15
|
-
let k;
|
|
16
|
-
f[4] !== p || f[5] !== O ? (k = t(p, O), f[4] = p, f[5] = O, f[6] = k) : k = f[6];
|
|
17
|
-
let A = k, j;
|
|
18
|
-
f[7] !== C || f[8] !== A ? (j = {
|
|
19
|
-
name: C,
|
|
20
|
-
rules: A
|
|
21
|
-
}, f[7] = C, f[8] = A, f[9] = j) : j = f[9];
|
|
22
|
-
let { field: M, fieldState: se } = ee(j), N, P, F, I;
|
|
23
|
-
f[10] === M ? (N = f[11], P = f[12], F = f[13], I = f[14]) : ({value: I, onBlur: N, onChange: P, ...F} = M, f[10] = M, f[11] = N, f[12] = P, f[13] = F, f[14] = I);
|
|
24
|
-
let { error: ce } = se, L = !!p?.required, R = ce?.message, z = !!T && !!I && T === I, B;
|
|
25
|
-
f[15] === v?.country ? B = f[16] : (B = () => {
|
|
26
|
-
let e = v?.country;
|
|
27
|
-
if (e && typeof e == "string") {
|
|
28
|
-
let t = e?.toUpperCase();
|
|
29
|
-
if (c(t)) return t;
|
|
30
|
-
}
|
|
31
|
-
return "IN";
|
|
32
|
-
}, f[15] = v?.country, f[16] = B);
|
|
33
|
-
let V = B, H;
|
|
34
|
-
f[17] === P ? H = f[18] : (H = (e) => {
|
|
35
|
-
E(e), P(e);
|
|
36
|
-
}, f[17] = P, f[18] = H);
|
|
37
|
-
let U = H, W = I ?? "", G;
|
|
38
|
-
f[19] === V ? G = f[20] : (G = V(), f[19] = V, f[20] = G);
|
|
39
|
-
let K;
|
|
40
|
-
f[21] === P ? K = f[22] : (K = (e) => {
|
|
41
|
-
P?.(e ?? "");
|
|
42
|
-
}, f[21] = P, f[22] = K);
|
|
43
|
-
let q;
|
|
44
|
-
f[23] === N ? q = f[24] : (q = () => {
|
|
45
|
-
N?.();
|
|
46
|
-
}, f[23] = N, f[24] = q);
|
|
47
|
-
let J = S || z, Y;
|
|
48
|
-
f[25] === z ? Y = f[26] : (Y = z ? /* @__PURE__ */ a("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
onClick: () => E(null),
|
|
51
|
-
className: ie,
|
|
52
|
-
title: "Change phone number",
|
|
53
|
-
children: /* @__PURE__ */ a(ne, { size: 14 })
|
|
54
|
-
}) : null, f[25] = z, f[26] = Y);
|
|
55
|
-
let X;
|
|
56
|
-
f[27] !== F || f[28] !== W || f[29] !== G || f[30] !== K || f[31] !== q || f[32] !== J || f[33] !== Y ? (X = /* @__PURE__ */ a("div", {
|
|
57
|
-
className: u,
|
|
58
|
-
children: /* @__PURE__ */ a(s, {
|
|
59
|
-
value: W,
|
|
60
|
-
international: !0,
|
|
61
|
-
inputComponent: r,
|
|
62
|
-
defaultCountry: G,
|
|
63
|
-
onChange: K,
|
|
64
|
-
onBlur: q,
|
|
65
|
-
className: re,
|
|
66
|
-
readOnly: J,
|
|
67
|
-
rightIcon: Y,
|
|
68
|
-
...F
|
|
69
|
-
})
|
|
70
|
-
}), f[27] = F, f[28] = W, f[29] = G, f[30] = K, f[31] = q, f[32] = J, f[33] = Y, f[34] = X) : X = f[34];
|
|
71
|
-
let Z;
|
|
72
|
-
f[35] !== U || f[36] !== z || f[37] !== w || f[38] !== I ? (Z = w && /* @__PURE__ */ a("div", {
|
|
73
|
-
className: "_89f1hw3",
|
|
74
|
-
children: /* @__PURE__ */ a(e, {
|
|
75
|
-
value: I,
|
|
76
|
-
type: "phone",
|
|
77
|
-
isVerified: z,
|
|
78
|
-
onVerifySuccess: U,
|
|
79
|
-
onStateChange: oe
|
|
80
|
-
})
|
|
81
|
-
}), f[35] = U, f[36] = z, f[37] = w, f[38] = I, f[39] = Z) : Z = f[39];
|
|
82
|
-
let Q;
|
|
83
|
-
f[40] !== X || f[41] !== Z ? (Q = /* @__PURE__ */ o("div", {
|
|
84
|
-
className: l,
|
|
85
|
-
children: [X, Z]
|
|
86
|
-
}), f[40] = X, f[41] = Z, f[42] = Q) : Q = f[42];
|
|
87
|
-
let $;
|
|
88
|
-
return f[43] !== R || f[44] !== x || f[45] !== L || f[46] !== b || f[47] !== C || f[48] !== S || f[49] !== Q ? ($ = /* @__PURE__ */ a(n, {
|
|
89
|
-
error: R,
|
|
90
|
-
helperText: x,
|
|
91
|
-
readOnly: S,
|
|
92
|
-
label: b,
|
|
93
|
-
htmlFor: C,
|
|
94
|
-
isRequired: L,
|
|
95
|
-
children: Q
|
|
96
|
-
}), f[43] = R, f[44] = x, f[45] = L, f[46] = b, f[47] = C, f[48] = S, f[49] = Q, f[50] = $) : $ = f[50], $;
|
|
97
|
-
};
|
|
98
|
-
//#endregion
|
|
99
|
-
export { d as PhoneWidget, d as default };
|
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./LevoProvider-nmIbMlsk.js";
|
|
2
|
-
import { n as t } from "./ThemeProvider-BQmIB5tr.js";
|
|
3
|
-
import { t as n } from "./theme.cssm-mkQwezuj.js";
|
|
4
|
-
import { a as r, c as i, l as a, o, s, u as c } from "./Dialog-DVB4WpBS.js";
|
|
5
|
-
import { d as l, f as u, l as d, n as f, o as p } from "./popupState-JmpeKzgM-qhNTV79U.js";
|
|
6
|
-
import { n as m, r as h, t as g } from "./react-6kO0cqgr.js";
|
|
7
|
-
import { _, c as ee, d as v, f as y, g as b, h as x, m as S, n as C, o as w, p as T, s as E, t as te, u as D } from "./usePopupRedirect-BThP_YPW-DoixMAB9.js";
|
|
8
|
-
import { t as O } from "./rteTheme.cssm-xg0gJ28J.js";
|
|
9
|
-
import { Suspense as k, lazy as A, useEffect as j, useRef as M } from "react";
|
|
10
|
-
import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
|
-
import { c as I } from "react/compiler-runtime";
|
|
12
|
-
import L from "clsx";
|
|
13
|
-
import { IconX as R } from "@tabler/icons-react";
|
|
14
|
-
import { $activity as z, $isIdentityContextReady as ne, $pageLifecycle as B, $scrollBehavior as V, $session as re, getTabCount as ie } from "@levo-so/insights/stores";
|
|
15
|
-
//#region ../../libraries/levocn/dist/theme/utils/googleFonts.js
|
|
16
|
-
var H = "wght@300;400;500;600;700;900", U = (e) => !!e && e !== "inherit" && !e.includes(",") && !e.includes("var("), W = (...e) => {
|
|
17
|
-
let t = Array.from(new Set(e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(U)));
|
|
18
|
-
return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.map((e) => `family=${e.replace(/ /g, "+")}:${H}`).join("&")}&display=swap`;
|
|
19
|
-
}, G = (e) => {
|
|
20
|
-
if (document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
|
|
21
|
-
let t = document.createElement("link");
|
|
22
|
-
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
23
|
-
}, K = (e) => {
|
|
24
|
-
let t = `family=${e.replace(/ /g, "+")}:`;
|
|
25
|
-
return Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"fonts.googleapis.com\"]")).some((e) => e.href.includes(t));
|
|
26
|
-
}, q = (...e) => {
|
|
27
|
-
let t = I(5), n = e, r;
|
|
28
|
-
t[0] === n ? r = t[1] : (r = n.filter(J).map(Y).join("|"), t[0] = n, t[1] = r);
|
|
29
|
-
let i = r, a, o;
|
|
30
|
-
t[2] === i ? (a = t[3], o = t[4]) : (a = () => {
|
|
31
|
-
let e = W(...(i ? i.split("|") : []).filter(ae));
|
|
32
|
-
if (!e) return;
|
|
33
|
-
G("https://fonts.googleapis.com"), G("https://fonts.gstatic.com");
|
|
34
|
-
let t = document.createElement("link");
|
|
35
|
-
t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", t.setAttribute("data-levo-fonts", e), document.head.appendChild(t);
|
|
36
|
-
}, o = [i], t[2] = i, t[3] = a, t[4] = o), j(a, o);
|
|
37
|
-
};
|
|
38
|
-
function J(e) {
|
|
39
|
-
return typeof e == "string" && e.trim() !== "";
|
|
40
|
-
}
|
|
41
|
-
function Y(e) {
|
|
42
|
-
return e.trim();
|
|
43
|
-
}
|
|
44
|
-
function ae(e) {
|
|
45
|
-
return !K(e);
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region ../../libraries/popups/dist/PopupDialog-ofRpHB1v.js
|
|
49
|
-
var oe = (e) => (e ?? "16:9").replace(":", " / "), se = (e) => {
|
|
50
|
-
if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
|
|
51
|
-
}, ce = (e) => {
|
|
52
|
-
let t = I(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = b(n), s = !!o && !r, c;
|
|
53
|
-
t[0] !== a.coverImage || t[1] !== a.coverImageFocus || t[2] !== n ? (c = a.coverImage && /* @__PURE__ */ P("img", {
|
|
54
|
-
src: a.coverImage.location,
|
|
55
|
-
srcSet: se(n),
|
|
56
|
-
alt: "",
|
|
57
|
-
className: "_1gklkndl",
|
|
58
|
-
style: a.coverImageFocus ? { objectPosition: a.coverImageFocus.replace("-", " ") } : void 0
|
|
59
|
-
}), t[0] = a.coverImage, t[1] = a.coverImageFocus, t[2] = n, t[3] = c) : c = t[3];
|
|
60
|
-
let l = c, u;
|
|
61
|
-
t[4] === a.coverImageRatio ? u = t[5] : (u = oe(a.coverImageRatio), t[4] = a.coverImageRatio, t[5] = u);
|
|
62
|
-
let d;
|
|
63
|
-
t[6] === u ? d = t[7] : (d = { aspectRatio: u }, t[6] = u, t[7] = d);
|
|
64
|
-
let f = d, p;
|
|
65
|
-
t[8] !== a.action || t[9] !== a.coverImage || t[10] !== s || t[11] !== l || t[12] !== f || t[13] !== o ? (p = a.coverImage && (s ? /* @__PURE__ */ P("button", {
|
|
66
|
-
type: "button",
|
|
67
|
-
className: L("_1gklkndj", "_1gklkndk"),
|
|
68
|
-
style: f,
|
|
69
|
-
onClick: o ?? void 0,
|
|
70
|
-
"aria-label": a.action?.type === "redirect" ? a.action.label : void 0,
|
|
71
|
-
children: l
|
|
72
|
-
}) : /* @__PURE__ */ P("div", {
|
|
73
|
-
className: "_1gklkndj",
|
|
74
|
-
style: f,
|
|
75
|
-
children: l
|
|
76
|
-
})), t[8] = a.action, t[9] = a.coverImage, t[10] = s, t[11] = l, t[12] = f, t[13] = o, t[14] = p) : p = t[14];
|
|
77
|
-
let m;
|
|
78
|
-
return t[15] !== i || t[16] !== p ? (m = /* @__PURE__ */ F("div", {
|
|
79
|
-
className: y,
|
|
80
|
-
children: [p, i]
|
|
81
|
-
}), t[15] = i, t[16] = p, t[17] = m) : m = t[17], m;
|
|
82
|
-
}, le = (e) => {
|
|
83
|
-
let r = I(19), i, a, o, s, c;
|
|
84
|
-
r[0] === e ? (i = r[1], a = r[2], o = r[3], s = r[4], c = r[5]) : ({children: i, popupTheme: a, siteTheme: s, style: c, ...o} = e, r[0] = e, r[1] = i, r[2] = a, r[3] = o, r[4] = s, r[5] = c);
|
|
85
|
-
let l;
|
|
86
|
-
r[6] !== a || r[7] !== s ? (l = a ?? (s ? h(s) : null), r[6] = a, r[7] = s, r[8] = l) : l = r[8];
|
|
87
|
-
let u = l;
|
|
88
|
-
q(u?.fonts?.heading, u?.fonts?.body);
|
|
89
|
-
let d;
|
|
90
|
-
r[9] === Symbol.for("react.memo_cache_sentinel") ? (d = L(n, O), r[9] = d) : d = r[9];
|
|
91
|
-
let f;
|
|
92
|
-
r[10] === u ? f = r[11] : (f = m(u), r[10] = u, r[11] = f);
|
|
93
|
-
let p;
|
|
94
|
-
r[12] !== c || r[13] !== f ? (p = {
|
|
95
|
-
...f,
|
|
96
|
-
...c
|
|
97
|
-
}, r[12] = c, r[13] = f, r[14] = p) : p = r[14];
|
|
98
|
-
let g;
|
|
99
|
-
return r[15] !== i || r[16] !== o || r[17] !== p ? (g = /* @__PURE__ */ P(t, {
|
|
100
|
-
className: d,
|
|
101
|
-
cssReset: !0,
|
|
102
|
-
style: p,
|
|
103
|
-
...o,
|
|
104
|
-
children: i
|
|
105
|
-
}), r[15] = i, r[16] = o, r[17] = p, r[18] = g) : g = r[18], g;
|
|
106
|
-
}, X = A(() => import("./PopupBody-DZVwDLkg-yrot8Uqb.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), ue = (e) => {
|
|
107
|
-
let t = I(7), { size: n } = e, r = n ?? "medium", i;
|
|
108
|
-
t[0] === r ? i = t[1] : (i = v({ size: r }), t[0] = r, t[1] = i);
|
|
109
|
-
let a, o, s;
|
|
110
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ P("div", { className: S }), o = /* @__PURE__ */ P("div", { className: w }), s = /* @__PURE__ */ P("div", { className: C }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
|
|
111
|
-
let c;
|
|
112
|
-
return t[5] === i ? c = t[6] : (c = /* @__PURE__ */ F("div", {
|
|
113
|
-
className: i,
|
|
114
|
-
children: [
|
|
115
|
-
a,
|
|
116
|
-
o,
|
|
117
|
-
s
|
|
118
|
-
]
|
|
119
|
-
}), t[5] = i, t[6] = c), c;
|
|
120
|
-
}, Z = () => {
|
|
121
|
-
let e = I(10), { popup: t } = x(), n;
|
|
122
|
-
e[0] === t.content.size ? n = e[1] : (n = /* @__PURE__ */ P(ue, { size: t.content.size }), e[0] = t.content.size, e[1] = n);
|
|
123
|
-
let r;
|
|
124
|
-
e[2] === t ? r = e[3] : (r = /* @__PURE__ */ P(X, { popup: t }), e[2] = t, e[3] = r);
|
|
125
|
-
let i;
|
|
126
|
-
e[4] !== n || e[5] !== r ? (i = /* @__PURE__ */ P(k, {
|
|
127
|
-
fallback: n,
|
|
128
|
-
children: r
|
|
129
|
-
}), e[4] = n, e[5] = r, e[6] = i) : i = e[6];
|
|
130
|
-
let a;
|
|
131
|
-
return e[7] !== t || e[8] !== i ? (a = /* @__PURE__ */ P(ce, {
|
|
132
|
-
popup: t,
|
|
133
|
-
children: i
|
|
134
|
-
}), e[7] = t, e[8] = i, e[9] = a) : a = e[9], a;
|
|
135
|
-
}, de = (e) => e.content.position || "top-right", fe = (e) => {
|
|
136
|
-
switch (e) {
|
|
137
|
-
case "close-press": return "close_button";
|
|
138
|
-
case "outside-press": return "outside_click";
|
|
139
|
-
case "escape-key": return "escape_key";
|
|
140
|
-
default: return "programmatic";
|
|
141
|
-
}
|
|
142
|
-
}, pe = () => {
|
|
143
|
-
let e = I(32), { popup: t, callbacks: n } = x(), { placement: d, id: f } = t, p = g(l).active_popup_id === f, m = M(!1), h, _;
|
|
144
|
-
e[0] !== n || e[1] !== p || e[2] !== t ? (h = () => {
|
|
145
|
-
p && !m.current && (m.current = !0, n?.onPopupOpen?.(t, { trigger_type: u() })), p || (m.current = !1);
|
|
146
|
-
}, _ = [
|
|
147
|
-
p,
|
|
148
|
-
t,
|
|
149
|
-
n
|
|
150
|
-
], e[0] = n, e[1] = p, e[2] = t, e[3] = h, e[4] = _) : (h = e[3], _ = e[4]), j(h, _);
|
|
151
|
-
let v = te(), y, b, S, C, w, E, O, k;
|
|
152
|
-
if (e[5] !== v || e[6] !== p || e[7] !== d || e[8] !== t) {
|
|
153
|
-
let n = de(t), l = d === "popup", u = d === "slide_in";
|
|
154
|
-
b = o, w = p, e[17] === v ? E = e[18] : (E = (e, t) => !e && v(fe(t?.reason)), e[17] = v, e[18] = E), O = l, k = !l, y = i, e[19] === l ? S = e[20] : (S = l && /* @__PURE__ */ P(a, {}), e[19] = l, e[20] = S), C = l ? /* @__PURE__ */ P(c, {
|
|
155
|
-
className: ee,
|
|
156
|
-
children: /* @__PURE__ */ F(s.Popup, {
|
|
157
|
-
className: D({ placement: d }),
|
|
158
|
-
children: [/* @__PURE__ */ P(r, {
|
|
159
|
-
variant: "ghost",
|
|
160
|
-
size: "icon-xs",
|
|
161
|
-
className: T,
|
|
162
|
-
"aria-label": "Close popup",
|
|
163
|
-
children: /* @__PURE__ */ P(R, { size: 16 })
|
|
164
|
-
}), /* @__PURE__ */ P(Z, {})]
|
|
165
|
-
})
|
|
166
|
-
}) : /* @__PURE__ */ F(s.Popup, {
|
|
167
|
-
className: L(D({
|
|
168
|
-
placement: d,
|
|
169
|
-
position: n
|
|
170
|
-
}), u && "_1gklkndd"),
|
|
171
|
-
children: [/* @__PURE__ */ P(r, {
|
|
172
|
-
variant: "ghost",
|
|
173
|
-
size: "icon-xs",
|
|
174
|
-
className: T,
|
|
175
|
-
"aria-label": "Close popup",
|
|
176
|
-
children: /* @__PURE__ */ P(R, { size: 16 })
|
|
177
|
-
}), /* @__PURE__ */ P(Z, {})]
|
|
178
|
-
}), e[5] = v, e[6] = p, e[7] = d, e[8] = t, e[9] = y, e[10] = b, e[11] = S, e[12] = C, e[13] = w, e[14] = E, e[15] = O, e[16] = k;
|
|
179
|
-
} else y = e[9], b = e[10], S = e[11], C = e[12], w = e[13], E = e[14], O = e[15], k = e[16];
|
|
180
|
-
let A;
|
|
181
|
-
e[21] !== y || e[22] !== S || e[23] !== C ? (A = /* @__PURE__ */ F(y, { children: [S, C] }), e[21] = y, e[22] = S, e[23] = C, e[24] = A) : A = e[24];
|
|
182
|
-
let N;
|
|
183
|
-
return e[25] !== b || e[26] !== w || e[27] !== E || e[28] !== O || e[29] !== k || e[30] !== A ? (N = /* @__PURE__ */ P(b, {
|
|
184
|
-
open: w,
|
|
185
|
-
onOpenChange: E,
|
|
186
|
-
modal: O,
|
|
187
|
-
disablePointerDismissal: k,
|
|
188
|
-
children: A
|
|
189
|
-
}), e[25] = b, e[26] = w, e[27] = E, e[28] = O, e[29] = k, e[30] = A, e[31] = N) : N = e[31], N;
|
|
190
|
-
}, me = 3e4, he = 5e3, ge = 5e3, _e = 100, ve = .5, ye = 5, be = (e) => {
|
|
191
|
-
if (typeof document > "u") return () => {};
|
|
192
|
-
let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= me, s = () => {
|
|
193
|
-
t || (t = !0, c(), e());
|
|
194
|
-
}, c = () => {
|
|
195
|
-
a &&= (clearTimeout(a), null);
|
|
196
|
-
}, l = () => {
|
|
197
|
-
if (r.length < 2) return 0;
|
|
198
|
-
let e = r[0], t = r[r.length - 1], n = t.t - e.t;
|
|
199
|
-
return n === 0 ? 0 : (e.y - t.y) / n;
|
|
200
|
-
}, u = () => r.reduce((e, t) => t.y > e ? t.y : e, 0), d = (e) => {
|
|
201
|
-
r.push({
|
|
202
|
-
y: e.clientY,
|
|
203
|
-
t: Date.now()
|
|
204
|
-
}), r.length > ye && r.shift();
|
|
205
|
-
}, f = (e) => {
|
|
206
|
-
t || !o() || e.clientY > 0 || u() < _e || Date.now() - i < ge || l() < ve || (c(), a = setTimeout(s, he));
|
|
207
|
-
}, p = () => {
|
|
208
|
-
c();
|
|
209
|
-
}, m = () => {
|
|
210
|
-
i = Date.now();
|
|
211
|
-
}, h = B.listen((e) => {
|
|
212
|
-
o() && (e === "hidden" || e === "frozen") && s();
|
|
213
|
-
});
|
|
214
|
-
return document.addEventListener("mousemove", d, { passive: !0 }), document.addEventListener("mouseleave", f), document.addEventListener("mouseenter", p), window.addEventListener("scroll", m, { passive: !0 }), () => {
|
|
215
|
-
c(), document.removeEventListener("mousemove", d), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseenter", p), window.removeEventListener("scroll", m), h();
|
|
216
|
-
};
|
|
217
|
-
}, xe = (e, t) => {
|
|
218
|
-
if (!e) return null;
|
|
219
|
-
let n = setTimeout(() => f(t, { trigger_type: "time_on_page" }), e);
|
|
220
|
-
return () => clearTimeout(n);
|
|
221
|
-
}, Se = (e, t) => {
|
|
222
|
-
if (e === void 0) return null;
|
|
223
|
-
let n = !1;
|
|
224
|
-
return V.listen((r) => {
|
|
225
|
-
n || r.depth >= e && (n = !0, f(t, { trigger_type: "scroll_depth" }));
|
|
226
|
-
});
|
|
227
|
-
}, Ce = (e) => {
|
|
228
|
-
let t = !1;
|
|
229
|
-
return z.listen((n) => {
|
|
230
|
-
t || n.status === "idle" && (t = !0, f(e, { trigger_type: "inactivity" }));
|
|
231
|
-
});
|
|
232
|
-
}, we = (e, t) => {
|
|
233
|
-
let n = I(11), r = t === void 0 ? !0 : t, { triggers: i, id: a } = e, o = g(ne), s;
|
|
234
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], n[0] = s) : s = n[0];
|
|
235
|
-
let c = M(s), l;
|
|
236
|
-
n[1] !== r || n[2] !== o || n[3] !== e || n[4] !== i ? (l = () => {
|
|
237
|
-
if (!r || !o || !i) return;
|
|
238
|
-
let t = [];
|
|
239
|
-
if (i.time_on_page.enabled) {
|
|
240
|
-
let n = xe(i.time_on_page.delay_ms, e);
|
|
241
|
-
n && t.push(n);
|
|
242
|
-
}
|
|
243
|
-
if (i.scroll_depth.enabled) {
|
|
244
|
-
let n = Se(i.scroll_depth.percent, e);
|
|
245
|
-
n && t.push(n);
|
|
246
|
-
}
|
|
247
|
-
return i.exit_intent.enabled && t.push(be(() => f(e, { trigger_type: "exit_intent" }))), i.inactivity.enabled && t.push(Ce(e)), c.current = t, () => {
|
|
248
|
-
t.forEach(Te), c.current = [];
|
|
249
|
-
};
|
|
250
|
-
}, n[1] = r, n[2] = o, n[3] = e, n[4] = i, n[5] = l) : l = n[5];
|
|
251
|
-
let u;
|
|
252
|
-
n[6] !== r || n[7] !== o || n[8] !== a || n[9] !== i ? (u = [
|
|
253
|
-
r,
|
|
254
|
-
o,
|
|
255
|
-
a,
|
|
256
|
-
i
|
|
257
|
-
], n[6] = r, n[7] = o, n[8] = a, n[9] = i, n[10] = u) : u = n[10], j(l, u);
|
|
258
|
-
};
|
|
259
|
-
function Te(e) {
|
|
260
|
-
return e();
|
|
261
|
-
}
|
|
262
|
-
var Q = (e, t) => {
|
|
263
|
-
switch (e.match_type) {
|
|
264
|
-
case "is_all_pages": return !0;
|
|
265
|
-
case "is": return e.page_id ? t.pageId === e.page_id ? e.value == null || e.value === t.path : !1 : e.value != null && e.value === t.path;
|
|
266
|
-
case "contains": return e.value != null && t.path.includes(e.value);
|
|
267
|
-
case "begins_with": return e.value != null && t.path.startsWith(e.value);
|
|
268
|
-
default: return !1;
|
|
269
|
-
}
|
|
270
|
-
}, $ = (e, t) => {
|
|
271
|
-
switch (e.match_type) {
|
|
272
|
-
case "exact": return t === e.value;
|
|
273
|
-
case "contains": return t.includes(e.value);
|
|
274
|
-
case "domain": try {
|
|
275
|
-
let n = new URL(t).hostname, r = e.value.toLowerCase();
|
|
276
|
-
return n === r || n.endsWith(`.${r}`);
|
|
277
|
-
} catch {
|
|
278
|
-
return !1;
|
|
279
|
-
}
|
|
280
|
-
default: return !1;
|
|
281
|
-
}
|
|
282
|
-
}, Ee = (e, t, n) => {
|
|
283
|
-
let r = e.pages?.exclude ?? [];
|
|
284
|
-
if (r.length > 0 && r.some((e) => Q(e, t))) return !1;
|
|
285
|
-
let i = e.pages?.include ?? [];
|
|
286
|
-
if (i.length > 0 && !i.some((e) => Q(e, t))) return !1;
|
|
287
|
-
let a = e.referrer?.include ?? [];
|
|
288
|
-
if (a.length > 0 && (!n || !a.some((e) => $(e, n)))) return !1;
|
|
289
|
-
let o = e.referrer?.exclude ?? [];
|
|
290
|
-
return !(o.length > 0 && n && o.some((e) => $(e, n)));
|
|
291
|
-
}, De = (e) => {
|
|
292
|
-
let t = I(4), { pageId: n } = e, { popup: r } = x(), i;
|
|
293
|
-
bb0: {
|
|
294
|
-
if (!r.target) {
|
|
295
|
-
i = !0;
|
|
296
|
-
break bb0;
|
|
297
|
-
}
|
|
298
|
-
if (typeof window > "u") {
|
|
299
|
-
i = !1;
|
|
300
|
-
break bb0;
|
|
301
|
-
}
|
|
302
|
-
let e;
|
|
303
|
-
if (t[0] !== n || t[1] !== r.target) {
|
|
304
|
-
let i = re.get().identity?.referrer?.raw || document.referrer || null, a = new URL(window.location.href, window.location.origin);
|
|
305
|
-
e = Ee(r.target, {
|
|
306
|
-
pageId: n,
|
|
307
|
-
path: a.pathname
|
|
308
|
-
}, i), t[0] = n, t[1] = r.target, t[2] = e;
|
|
309
|
-
} else e = t[2];
|
|
310
|
-
i = e;
|
|
311
|
-
}
|
|
312
|
-
let a = i;
|
|
313
|
-
if (we(r, a), !a) return null;
|
|
314
|
-
let o;
|
|
315
|
-
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ P(pe, {}), t[3] = o) : o = t[3], o;
|
|
316
|
-
}, Oe = () => {
|
|
317
|
-
let e = V.get(), t = z.get();
|
|
318
|
-
return {
|
|
319
|
-
trigger_scroll_depth: e.depth,
|
|
320
|
-
trigger_scroll_speed: e.speedCategory,
|
|
321
|
-
trigger_scroll_direction: e.direction,
|
|
322
|
-
trigger_activity_status: t.status,
|
|
323
|
-
trigger_activity_seconds: t.seconds,
|
|
324
|
-
trigger_tab_count: ie()
|
|
325
|
-
};
|
|
326
|
-
}, ke = (t) => {
|
|
327
|
-
let n = I(16), { popups: r, pageId: i } = t, a = e(), o, s;
|
|
328
|
-
n[0] === r ? (o = n[1], s = n[2]) : (o = () => {
|
|
329
|
-
p(r), d(!1);
|
|
330
|
-
}, s = [r], n[0] = r, n[1] = o, n[2] = s), j(o, s);
|
|
331
|
-
let c;
|
|
332
|
-
n[3] === a ? c = n[4] : (c = (e, t) => {
|
|
333
|
-
!a || typeof a.track != "function" || a?.track(e, t);
|
|
334
|
-
}, n[3] = a, n[4] = c);
|
|
335
|
-
let l = c, u = Ae, f;
|
|
336
|
-
n[5] === l ? f = n[6] : (f = {
|
|
337
|
-
onPopupOpen: (e, t) => {
|
|
338
|
-
l("popup.view", {
|
|
339
|
-
...u(e),
|
|
340
|
-
trigger_type: t.trigger_type,
|
|
341
|
-
language: e.language,
|
|
342
|
-
...Oe()
|
|
343
|
-
});
|
|
344
|
-
},
|
|
345
|
-
onPopupClose: (e, t) => {
|
|
346
|
-
l("popup.close", {
|
|
347
|
-
...u(e),
|
|
348
|
-
trigger_type: t.trigger_type,
|
|
349
|
-
dismiss_reason: t.dismiss_reason,
|
|
350
|
-
time_shown_ms: t.time_shown_ms
|
|
351
|
-
});
|
|
352
|
-
},
|
|
353
|
-
onAction: (e, t) => {
|
|
354
|
-
l("popup.action", {
|
|
355
|
-
...u(e),
|
|
356
|
-
...t
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
}, n[5] = l, n[6] = f);
|
|
360
|
-
let m = f, h;
|
|
361
|
-
if (n[7] !== m || n[8] !== i || n[9] !== r) {
|
|
362
|
-
let e;
|
|
363
|
-
n[11] !== m || n[12] !== i ? (e = (e) => /* @__PURE__ */ P(le, {
|
|
364
|
-
popupTheme: e.theme,
|
|
365
|
-
siteTheme: e.site?.theme,
|
|
366
|
-
children: /* @__PURE__ */ P(E, {
|
|
367
|
-
popup: e,
|
|
368
|
-
callbacks: m,
|
|
369
|
-
children: /* @__PURE__ */ P(De, { pageId: i })
|
|
370
|
-
})
|
|
371
|
-
}, e.id), n[11] = m, n[12] = i, n[13] = e) : e = n[13], h = r.map(e), n[7] = m, n[8] = i, n[9] = r, n[10] = h;
|
|
372
|
-
} else h = n[10];
|
|
373
|
-
let g;
|
|
374
|
-
return n[14] === h ? g = n[15] : (g = /* @__PURE__ */ P(N, { children: h }), n[14] = h, n[15] = g), g;
|
|
375
|
-
};
|
|
376
|
-
function Ae(e) {
|
|
377
|
-
return {
|
|
378
|
-
resource: "builder.popup",
|
|
379
|
-
identifier: e.id,
|
|
380
|
-
popup_title: e.title,
|
|
381
|
-
placement: e.placement,
|
|
382
|
-
popup_action_kind: e.content.action?.type || "none"
|
|
383
|
-
};
|
|
384
|
-
}
|
|
385
|
-
var je = /* @__PURE__ */ _({ PopupRenderer: () => ke });
|
|
386
|
-
//#endregion
|
|
387
|
-
export { je as t };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { createContext as e, useContext as t, useEffect as n, useMemo as r, useRef as i } from "react";
|
|
2
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { c as o } from "react/compiler-runtime";
|
|
4
|
-
import s from "clsx";
|
|
5
|
-
import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
|
-
//#region ../../libraries/levocn/dist/styles/reset.cssm.js
|
|
7
|
-
var l = "_1er5g5a0", u = c({
|
|
8
|
-
defaultClassName: "_1a7d0ek1 _1a7d0ek0",
|
|
9
|
-
variantClassNames: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "_1a7d0ek2",
|
|
12
|
-
outline: "_1a7d0ek3",
|
|
13
|
-
secondary: "_1a7d0ek4",
|
|
14
|
-
ghost: "_1a7d0ek5",
|
|
15
|
-
destructive: "_1a7d0ek6",
|
|
16
|
-
link: "_1a7d0ek7"
|
|
17
|
-
},
|
|
18
|
-
size: {
|
|
19
|
-
default: "_1a7d0ek8",
|
|
20
|
-
xs: "_1a7d0ek9",
|
|
21
|
-
sm: "_1a7d0eka",
|
|
22
|
-
lg: "_1a7d0ekb",
|
|
23
|
-
icon: "_1a7d0ekc",
|
|
24
|
-
"icon-xs": "_1a7d0ekd",
|
|
25
|
-
"icon-sm": "_1a7d0eke",
|
|
26
|
-
"icon-lg": "_1a7d0ekf"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: "default",
|
|
31
|
-
size: "default"
|
|
32
|
-
},
|
|
33
|
-
compoundVariants: []
|
|
34
|
-
}), d = (e) => {
|
|
35
|
-
let t = o(14), n, r, i, c, l;
|
|
36
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], c = t[4], l = t[5]) : ({className: n, variant: l, size: i, type: c, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = c, t[5] = l);
|
|
37
|
-
let d = c === void 0 ? "button" : c, f;
|
|
38
|
-
t[6] !== n || t[7] !== i || t[8] !== l ? (f = s(u({
|
|
39
|
-
variant: l,
|
|
40
|
-
size: i
|
|
41
|
-
}), n), t[6] = n, t[7] = i, t[8] = l, t[9] = f) : f = t[9];
|
|
42
|
-
let p;
|
|
43
|
-
return t[10] !== r || t[11] !== f || t[12] !== d ? (p = /* @__PURE__ */ a("button", {
|
|
44
|
-
"data-slot": "button",
|
|
45
|
-
type: d,
|
|
46
|
-
className: f,
|
|
47
|
-
...r
|
|
48
|
-
}), t[10] = r, t[11] = f, t[12] = d, t[13] = p) : p = t[13], p;
|
|
49
|
-
}, f = /* @__PURE__ */ new Set(), p = {}, m = e(null), h = () => {
|
|
50
|
-
let e = o(1), n = t(m);
|
|
51
|
-
if (!n) {
|
|
52
|
-
let t;
|
|
53
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
|
|
54
|
-
portalRef: { current: null },
|
|
55
|
-
classes: f,
|
|
56
|
-
overrides: p
|
|
57
|
-
}, e[0] = t) : t = e[0], t;
|
|
58
|
-
}
|
|
59
|
-
return n;
|
|
60
|
-
}, g = ({ children: e, cssReset: o, className: c, style: u, portalToThemeRoot: d, ...h }) => {
|
|
61
|
-
let g = t(m), _ = i(null), v = !g && o !== !1 ? l : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = r(() => {
|
|
62
|
-
let e = c ? c.split(/\s+/).filter(Boolean) : [], t = new Set(y);
|
|
63
|
-
for (let n of e) t.add(n);
|
|
64
|
-
return {
|
|
65
|
-
portalRef: _,
|
|
66
|
-
classes: t,
|
|
67
|
-
overrides: {
|
|
68
|
-
...b,
|
|
69
|
-
...u
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}, [
|
|
73
|
-
y,
|
|
74
|
-
c,
|
|
75
|
-
b,
|
|
76
|
-
u
|
|
77
|
-
]);
|
|
78
|
-
n(() => {
|
|
79
|
-
if (d) return;
|
|
80
|
-
let e = document.createElement("div");
|
|
81
|
-
return document.body.appendChild(e), _.current = e, () => {
|
|
82
|
-
document.body.removeChild(e), _.current = null;
|
|
83
|
-
};
|
|
84
|
-
}, [d]), n(() => {
|
|
85
|
-
if (d) return;
|
|
86
|
-
let e = _.current;
|
|
87
|
-
if (!e) return;
|
|
88
|
-
e.className = s(v, ...x.classes), e.style.cssText = "";
|
|
89
|
-
let t = {
|
|
90
|
-
display: "contents",
|
|
91
|
-
...x.overrides
|
|
92
|
-
};
|
|
93
|
-
for (let [n, r] of Object.entries(t)) r != null && e.style.setProperty(n, String(r));
|
|
94
|
-
}, [
|
|
95
|
-
x.classes,
|
|
96
|
-
x.overrides,
|
|
97
|
-
v,
|
|
98
|
-
d
|
|
99
|
-
]);
|
|
100
|
-
let S = s(v, ...c ? c.split(/\s+/).filter((e) => e && !y.has(e)) : []);
|
|
101
|
-
return /* @__PURE__ */ a(m.Provider, {
|
|
102
|
-
value: x,
|
|
103
|
-
children: /* @__PURE__ */ a("div", {
|
|
104
|
-
...d ? { ref: _ } : {},
|
|
105
|
-
...S ? { className: S } : {},
|
|
106
|
-
style: {
|
|
107
|
-
display: "contents",
|
|
108
|
-
...u
|
|
109
|
-
},
|
|
110
|
-
...h,
|
|
111
|
-
children: e
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
//#endregion
|
|
116
|
-
export { u as i, g as n, d as r, h as t };
|