@levo-so/react 0.1.65 → 0.1.76
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/dist/audience/components/block.d.ts.map +1 -1
- package/dist/audience/components/component.d.ts.map +1 -1
- package/dist/audience/components/page.d.ts +1 -2
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +524 -1148
- package/package.json +6 -4
- package/dist/audience/hooks/useBounce.d.ts +0 -4
- package/dist/audience/hooks/useBounce.d.ts.map +0 -1
- package/dist/audience/hooks/useCurrentTab.d.ts +0 -3
- package/dist/audience/hooks/useCurrentTab.d.ts.map +0 -1
- package/dist/audience/hooks/useIdentifyAudience.d.ts +0 -7
- package/dist/audience/hooks/useIdentifyAudience.d.ts.map +0 -1
- package/dist/audience/hooks/useOpenTabs.d.ts +0 -3
- package/dist/audience/hooks/useOpenTabs.d.ts.map +0 -1
- package/dist/audience/hooks/useScrollBehavior.d.ts +0 -11
- package/dist/audience/hooks/useScrollBehavior.d.ts.map +0 -1
- package/dist/audience/hooks/useTextSelection.d.ts +0 -3
- package/dist/audience/hooks/useTextSelection.d.ts.map +0 -1
- package/dist/audience/hooks/useTrackClicks.d.ts +0 -3
- package/dist/audience/hooks/useTrackClicks.d.ts.map +0 -1
- package/dist/audience/utils/autocapture.d.ts +0 -23
- package/dist/audience/utils/autocapture.d.ts.map +0 -1
- package/dist/audience/utils/rageclick.d.ts +0 -25
- package/dist/audience/utils/rageclick.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,967 +1,343 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { twMerge as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
_e = 1;
|
|
2
|
+
import * as _ from "react";
|
|
3
|
+
import R, { createContext as Le, useContext as K, useState as P, useEffect as O, useMemo as fe, useRef as me, useCallback as X } from "react";
|
|
4
|
+
import { clsx as De } from "clsx";
|
|
5
|
+
import { twMerge as pe } from "tailwind-merge";
|
|
6
|
+
import { Slot as Ie, Dialog as y, Tabs as k, Tooltip as A } from "radix-ui";
|
|
7
|
+
import { cva as $e } from "class-variance-authority";
|
|
8
|
+
import { X as Me } from "lucide-react";
|
|
9
|
+
import { Toaster as We, toast as q } from "sonner";
|
|
10
|
+
import { toast as nr } from "sonner";
|
|
11
|
+
import { getLevoError as ge } from "@levo-so/core";
|
|
12
|
+
var W = { exports: {} }, D = {};
|
|
13
|
+
var ie;
|
|
14
|
+
function Be() {
|
|
15
|
+
if (ie) return D;
|
|
16
|
+
ie = 1;
|
|
18
17
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
19
|
-
function r(n,
|
|
20
|
-
var
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
for (var
|
|
24
|
-
|
|
25
|
-
} else
|
|
26
|
-
return
|
|
18
|
+
function r(n, s, a) {
|
|
19
|
+
var u = null;
|
|
20
|
+
if (a !== void 0 && (u = "" + a), s.key !== void 0 && (u = "" + s.key), "key" in s) {
|
|
21
|
+
a = {};
|
|
22
|
+
for (var i in s)
|
|
23
|
+
i !== "key" && (a[i] = s[i]);
|
|
24
|
+
} else a = s;
|
|
25
|
+
return s = a.ref, {
|
|
27
26
|
$$typeof: e,
|
|
28
27
|
type: n,
|
|
29
|
-
key:
|
|
30
|
-
ref:
|
|
31
|
-
props:
|
|
28
|
+
key: u,
|
|
29
|
+
ref: s !== void 0 ? s : null,
|
|
30
|
+
props: a
|
|
32
31
|
};
|
|
33
32
|
}
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
-
function e(
|
|
41
|
-
if (
|
|
42
|
-
if (typeof
|
|
43
|
-
return
|
|
44
|
-
if (typeof
|
|
45
|
-
switch (
|
|
46
|
-
case
|
|
33
|
+
return D.Fragment = t, D.jsx = r, D.jsxs = r, D;
|
|
34
|
+
}
|
|
35
|
+
var I = {};
|
|
36
|
+
var ce;
|
|
37
|
+
function Fe() {
|
|
38
|
+
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
39
|
+
function e(o) {
|
|
40
|
+
if (o == null) return null;
|
|
41
|
+
if (typeof o == "function")
|
|
42
|
+
return o.$$typeof === Ce ? null : o.displayName || o.name || null;
|
|
43
|
+
if (typeof o == "string") return o;
|
|
44
|
+
switch (o) {
|
|
45
|
+
case N:
|
|
47
46
|
return "Fragment";
|
|
48
|
-
case
|
|
47
|
+
case b:
|
|
49
48
|
return "Profiler";
|
|
50
|
-
case
|
|
49
|
+
case L:
|
|
51
50
|
return "StrictMode";
|
|
52
|
-
case
|
|
51
|
+
case _e:
|
|
53
52
|
return "Suspense";
|
|
54
|
-
case
|
|
53
|
+
case Ne:
|
|
55
54
|
return "SuspenseList";
|
|
56
|
-
case
|
|
55
|
+
case ke:
|
|
57
56
|
return "Activity";
|
|
58
57
|
}
|
|
59
|
-
if (typeof
|
|
60
|
-
switch (typeof
|
|
58
|
+
if (typeof o == "object")
|
|
59
|
+
switch (typeof o.tag == "number" && console.error(
|
|
61
60
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
62
|
-
),
|
|
63
|
-
case
|
|
61
|
+
), o.$$typeof) {
|
|
62
|
+
case C:
|
|
64
63
|
return "Portal";
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
return (
|
|
69
|
-
case
|
|
70
|
-
var
|
|
71
|
-
return
|
|
72
|
-
case
|
|
73
|
-
return
|
|
74
|
-
case
|
|
75
|
-
|
|
64
|
+
case $:
|
|
65
|
+
return o.displayName || "Context";
|
|
66
|
+
case x:
|
|
67
|
+
return (o._context.displayName || "Context") + ".Consumer";
|
|
68
|
+
case Re:
|
|
69
|
+
var c = o.render;
|
|
70
|
+
return o = o.displayName, o || (o = c.displayName || c.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
71
|
+
case Pe:
|
|
72
|
+
return c = o.displayName || null, c !== null ? c : e(o.type) || "Memo";
|
|
73
|
+
case Y:
|
|
74
|
+
c = o._payload, o = o._init;
|
|
76
75
|
try {
|
|
77
|
-
return e(
|
|
76
|
+
return e(o(c));
|
|
78
77
|
} catch {
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
return null;
|
|
82
81
|
}
|
|
83
|
-
function t(
|
|
84
|
-
return "" +
|
|
82
|
+
function t(o) {
|
|
83
|
+
return "" + o;
|
|
85
84
|
}
|
|
86
|
-
function r(
|
|
85
|
+
function r(o) {
|
|
87
86
|
try {
|
|
88
|
-
t(
|
|
89
|
-
var
|
|
87
|
+
t(o);
|
|
88
|
+
var c = !1;
|
|
90
89
|
} catch {
|
|
91
|
-
|
|
90
|
+
c = !0;
|
|
92
91
|
}
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
var
|
|
96
|
-
return
|
|
97
|
-
|
|
92
|
+
if (c) {
|
|
93
|
+
c = console;
|
|
94
|
+
var f = c.error, p = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
95
|
+
return f.call(
|
|
96
|
+
c,
|
|
98
97
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
99
|
-
|
|
100
|
-
), t(
|
|
98
|
+
p
|
|
99
|
+
), t(o);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
|
-
function n(
|
|
104
|
-
if (
|
|
105
|
-
if (typeof
|
|
102
|
+
function n(o) {
|
|
103
|
+
if (o === N) return "<>";
|
|
104
|
+
if (typeof o == "object" && o !== null && o.$$typeof === Y)
|
|
106
105
|
return "<...>";
|
|
107
106
|
try {
|
|
108
|
-
var
|
|
109
|
-
return
|
|
107
|
+
var c = e(o);
|
|
108
|
+
return c ? "<" + c + ">" : "<...>";
|
|
110
109
|
} catch {
|
|
111
110
|
return "<...>";
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
|
-
function
|
|
115
|
-
var
|
|
116
|
-
return
|
|
113
|
+
function s() {
|
|
114
|
+
var o = G.A;
|
|
115
|
+
return o === null ? null : o.getOwner();
|
|
117
116
|
}
|
|
118
|
-
function
|
|
117
|
+
function a() {
|
|
119
118
|
return Error("react-stack-top-frame");
|
|
120
119
|
}
|
|
121
|
-
function
|
|
122
|
-
if (
|
|
123
|
-
var
|
|
124
|
-
if (
|
|
120
|
+
function u(o) {
|
|
121
|
+
if (te.call(o, "key")) {
|
|
122
|
+
var c = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
123
|
+
if (c && c.isReactWarning) return !1;
|
|
125
124
|
}
|
|
126
|
-
return
|
|
125
|
+
return o.key !== void 0;
|
|
127
126
|
}
|
|
128
|
-
function
|
|
129
|
-
function
|
|
130
|
-
|
|
127
|
+
function i(o, c) {
|
|
128
|
+
function f() {
|
|
129
|
+
re || (re = !0, console.error(
|
|
131
130
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
132
|
-
|
|
131
|
+
c
|
|
133
132
|
));
|
|
134
133
|
}
|
|
135
|
-
|
|
136
|
-
get:
|
|
134
|
+
f.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
135
|
+
get: f,
|
|
137
136
|
configurable: !0
|
|
138
137
|
});
|
|
139
138
|
}
|
|
140
|
-
function
|
|
141
|
-
var
|
|
142
|
-
return
|
|
139
|
+
function m() {
|
|
140
|
+
var o = e(this.type);
|
|
141
|
+
return oe[o] || (oe[o] = !0, console.error(
|
|
143
142
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
144
|
-
)),
|
|
143
|
+
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
145
144
|
}
|
|
146
|
-
function
|
|
147
|
-
var
|
|
148
|
-
return
|
|
149
|
-
$$typeof:
|
|
150
|
-
type:
|
|
151
|
-
key:
|
|
152
|
-
props:
|
|
153
|
-
_owner:
|
|
154
|
-
}, (
|
|
145
|
+
function v(o, c, f, p, M, H) {
|
|
146
|
+
var g = f.ref;
|
|
147
|
+
return o = {
|
|
148
|
+
$$typeof: E,
|
|
149
|
+
type: o,
|
|
150
|
+
key: c,
|
|
151
|
+
props: f,
|
|
152
|
+
_owner: p
|
|
153
|
+
}, (g !== void 0 ? g : null) !== null ? Object.defineProperty(o, "ref", {
|
|
155
154
|
enumerable: !1,
|
|
156
|
-
get:
|
|
157
|
-
}) : Object.defineProperty(
|
|
155
|
+
get: m
|
|
156
|
+
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
158
157
|
configurable: !1,
|
|
159
158
|
enumerable: !1,
|
|
160
159
|
writable: !0,
|
|
161
160
|
value: 0
|
|
162
|
-
}), Object.defineProperty(
|
|
161
|
+
}), Object.defineProperty(o, "_debugInfo", {
|
|
163
162
|
configurable: !1,
|
|
164
163
|
enumerable: !1,
|
|
165
164
|
writable: !0,
|
|
166
165
|
value: null
|
|
167
|
-
}), Object.defineProperty(
|
|
166
|
+
}), Object.defineProperty(o, "_debugStack", {
|
|
168
167
|
configurable: !1,
|
|
169
168
|
enumerable: !1,
|
|
170
169
|
writable: !0,
|
|
171
|
-
value:
|
|
172
|
-
}), Object.defineProperty(
|
|
170
|
+
value: M
|
|
171
|
+
}), Object.defineProperty(o, "_debugTask", {
|
|
173
172
|
configurable: !1,
|
|
174
173
|
enumerable: !1,
|
|
175
174
|
writable: !0,
|
|
176
|
-
value:
|
|
177
|
-
}), Object.freeze && (Object.freeze(
|
|
175
|
+
value: H
|
|
176
|
+
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
178
177
|
}
|
|
179
|
-
function
|
|
180
|
-
var
|
|
181
|
-
if (
|
|
182
|
-
if (
|
|
183
|
-
if (
|
|
184
|
-
for (
|
|
185
|
-
|
|
186
|
-
Object.freeze && Object.freeze(
|
|
178
|
+
function h(o, c, f, p, M, H) {
|
|
179
|
+
var g = c.children;
|
|
180
|
+
if (g !== void 0)
|
|
181
|
+
if (p)
|
|
182
|
+
if (Se(g)) {
|
|
183
|
+
for (p = 0; p < g.length; p++)
|
|
184
|
+
d(g[p]);
|
|
185
|
+
Object.freeze && Object.freeze(g);
|
|
187
186
|
} else
|
|
188
187
|
console.error(
|
|
189
188
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
190
189
|
);
|
|
191
|
-
else
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
var
|
|
195
|
-
return
|
|
190
|
+
else d(g);
|
|
191
|
+
if (te.call(c, "key")) {
|
|
192
|
+
g = e(o);
|
|
193
|
+
var S = Object.keys(c).filter(function(Ae) {
|
|
194
|
+
return Ae !== "key";
|
|
196
195
|
});
|
|
197
|
-
|
|
196
|
+
p = 0 < S.length ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}", ae[g + p] || (S = 0 < S.length ? "{" + S.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
198
197
|
`A props object containing a "key" prop is being spread into JSX:
|
|
199
198
|
let props = %s;
|
|
200
199
|
<%s {...props} />
|
|
201
200
|
React keys must be passed directly to JSX without using spread:
|
|
202
201
|
let props = %s;
|
|
203
202
|
<%s key={someKey} {...props} />`,
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
),
|
|
203
|
+
p,
|
|
204
|
+
g,
|
|
205
|
+
S,
|
|
206
|
+
g
|
|
207
|
+
), ae[g + p] = !0);
|
|
209
208
|
}
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
for (var
|
|
213
|
-
|
|
214
|
-
} else
|
|
215
|
-
return
|
|
216
|
-
|
|
217
|
-
typeof
|
|
218
|
-
),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
209
|
+
if (g = null, f !== void 0 && (r(f), g = "" + f), u(c) && (r(c.key), g = "" + c.key), "key" in c) {
|
|
210
|
+
f = {};
|
|
211
|
+
for (var J in c)
|
|
212
|
+
J !== "key" && (f[J] = c[J]);
|
|
213
|
+
} else f = c;
|
|
214
|
+
return g && i(
|
|
215
|
+
f,
|
|
216
|
+
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
217
|
+
), v(
|
|
218
|
+
o,
|
|
219
|
+
g,
|
|
220
|
+
f,
|
|
221
|
+
s(),
|
|
222
|
+
M,
|
|
223
|
+
H
|
|
225
224
|
);
|
|
226
225
|
}
|
|
227
|
-
function
|
|
228
|
-
|
|
226
|
+
function d(o) {
|
|
227
|
+
T(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Y && (o._payload.status === "fulfilled" ? T(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
229
228
|
}
|
|
230
|
-
function
|
|
231
|
-
return typeof
|
|
229
|
+
function T(o) {
|
|
230
|
+
return typeof o == "object" && o !== null && o.$$typeof === E;
|
|
232
231
|
}
|
|
233
|
-
var
|
|
232
|
+
var w = R, E = Symbol.for("react.transitional.element"), C = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), Re = Symbol.for("react.forward_ref"), _e = Symbol.for("react.suspense"), Ne = Symbol.for("react.suspense_list"), Pe = Symbol.for("react.memo"), Y = Symbol.for("react.lazy"), ke = Symbol.for("react.activity"), Ce = Symbol.for("react.client.reference"), G = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, Se = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
234
233
|
return null;
|
|
235
234
|
};
|
|
236
|
-
|
|
237
|
-
react_stack_bottom_frame: function(
|
|
238
|
-
return
|
|
235
|
+
w = {
|
|
236
|
+
react_stack_bottom_frame: function(o) {
|
|
237
|
+
return o();
|
|
239
238
|
}
|
|
240
239
|
};
|
|
241
|
-
var
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)(),
|
|
245
|
-
|
|
246
|
-
var
|
|
247
|
-
return
|
|
248
|
-
|
|
240
|
+
var re, oe = {}, ne = w.react_stack_bottom_frame.bind(
|
|
241
|
+
w,
|
|
242
|
+
a
|
|
243
|
+
)(), se = V(n(a)), ae = {};
|
|
244
|
+
I.Fragment = N, I.jsx = function(o, c, f) {
|
|
245
|
+
var p = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return h(
|
|
247
|
+
o,
|
|
248
|
+
c,
|
|
249
249
|
f,
|
|
250
|
-
y,
|
|
251
250
|
!1,
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
p ? Error("react-stack-top-frame") : ne,
|
|
252
|
+
p ? V(n(o)) : se
|
|
254
253
|
);
|
|
255
|
-
},
|
|
256
|
-
var
|
|
257
|
-
return
|
|
258
|
-
|
|
254
|
+
}, I.jsxs = function(o, c, f) {
|
|
255
|
+
var p = 1e4 > G.recentlyCreatedOwnerStacks++;
|
|
256
|
+
return h(
|
|
257
|
+
o,
|
|
258
|
+
c,
|
|
259
259
|
f,
|
|
260
|
-
y,
|
|
261
260
|
!0,
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
p ? Error("react-stack-top-frame") : ne,
|
|
262
|
+
p ? V(n(o)) : se
|
|
264
263
|
);
|
|
265
264
|
};
|
|
266
|
-
}()),
|
|
265
|
+
})()), I;
|
|
267
266
|
}
|
|
268
|
-
var
|
|
269
|
-
function
|
|
270
|
-
return
|
|
267
|
+
var le;
|
|
268
|
+
function ze() {
|
|
269
|
+
return le || (le = 1, process.env.NODE_ENV === "production" ? W.exports = Be() : W.exports = Fe()), W.exports;
|
|
271
270
|
}
|
|
272
|
-
var
|
|
273
|
-
const
|
|
271
|
+
var l = ze();
|
|
272
|
+
const Z = Le({
|
|
274
273
|
client: null,
|
|
275
274
|
insights: null
|
|
276
|
-
}),
|
|
277
|
-
const e =
|
|
275
|
+
}), $t = ({ children: e, client: t, insights: r = null }) => /* @__PURE__ */ l.jsx(Z.Provider, { value: { client: t, insights: r }, children: e }), Q = () => {
|
|
276
|
+
const e = K(Z);
|
|
278
277
|
if (!e.client)
|
|
279
278
|
throw new Error(
|
|
280
279
|
"useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider."
|
|
281
280
|
);
|
|
282
281
|
return e.client;
|
|
283
|
-
},
|
|
284
|
-
const r =
|
|
285
|
-
return
|
|
282
|
+
}, ee = () => K(Z).insights, Mt = ({ id: e, properties: t = {} }) => {
|
|
283
|
+
const r = ee(), [n, s] = P(!1);
|
|
284
|
+
return O(() => {
|
|
286
285
|
if (n || typeof r?.track != "function") return;
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
289
|
-
const
|
|
286
|
+
const a = document.getElementById(e);
|
|
287
|
+
if (!a) return;
|
|
288
|
+
const u = () => {
|
|
290
289
|
n || (r?.track("block.view", {
|
|
291
290
|
...t,
|
|
292
291
|
resource: "block",
|
|
293
292
|
identifier: e
|
|
294
|
-
}),
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
})(i)) {
|
|
300
|
-
l();
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const a = new IntersectionObserver(
|
|
304
|
-
(d) => {
|
|
305
|
-
d.forEach((p) => {
|
|
306
|
-
p.isIntersecting && (l(), a.disconnect());
|
|
293
|
+
}), s(!0));
|
|
294
|
+
}, i = new IntersectionObserver(
|
|
295
|
+
(m) => {
|
|
296
|
+
m.forEach((v) => {
|
|
297
|
+
v.isIntersecting && (u(), i.disconnect());
|
|
307
298
|
});
|
|
308
299
|
},
|
|
309
300
|
{ threshold: 0 }
|
|
310
301
|
);
|
|
311
|
-
return
|
|
312
|
-
|
|
302
|
+
return i.observe(a), () => {
|
|
303
|
+
i.disconnect();
|
|
313
304
|
};
|
|
314
305
|
}, [r, e, t, n]), null;
|
|
315
|
-
},
|
|
316
|
-
const r =
|
|
317
|
-
return
|
|
318
|
-
r?.
|
|
306
|
+
}, Wt = ({ event: e, properties: t }) => {
|
|
307
|
+
const r = ee();
|
|
308
|
+
return O(() => {
|
|
309
|
+
r?.track(e, t);
|
|
319
310
|
}, [r, e, t]), null;
|
|
320
|
-
},
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
...l
|
|
330
|
-
});
|
|
331
|
-
} catch (c) {
|
|
332
|
-
t?.error("Failed to send bounce event", U(c));
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
[r, e, t]
|
|
337
|
-
);
|
|
338
|
-
k(() => {
|
|
339
|
-
n.current = !1;
|
|
340
|
-
const l = () => {
|
|
341
|
-
const c = performance.getEntriesByType("navigation")?.[0];
|
|
342
|
-
let a = !1;
|
|
343
|
-
if (c)
|
|
344
|
-
c.type === "navigate" && (a = !0);
|
|
345
|
-
else
|
|
346
|
-
try {
|
|
347
|
-
const d = document.activeElement;
|
|
348
|
-
d?.tagName === "A" && d.href && new URL(d.href).origin !== window.location.origin && (a = !0);
|
|
349
|
-
} catch {
|
|
350
|
-
}
|
|
351
|
-
o({
|
|
352
|
-
is_navigating_away: a,
|
|
353
|
-
navigation_type: c?.type,
|
|
354
|
-
trigger: "beforeunload"
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
return window.addEventListener("beforeunload", l), () => {
|
|
358
|
-
window.removeEventListener("beforeunload", l);
|
|
359
|
-
};
|
|
360
|
-
}, [o]);
|
|
361
|
-
const [i] = it();
|
|
362
|
-
k(() => {
|
|
363
|
-
(i === ke.FROZEN || i === ke.TERMINATED) && o({
|
|
364
|
-
state: i,
|
|
365
|
-
trigger: "lifecycle"
|
|
311
|
+
}, Bt = ({ id: e }) => {
|
|
312
|
+
const t = Q(), r = ee();
|
|
313
|
+
return O(() => {
|
|
314
|
+
t && typeof window < "u" && (window.levo_client = t);
|
|
315
|
+
}, [t]), O(() => {
|
|
316
|
+
r && typeof window < "u" && (window.levo_insights = r);
|
|
317
|
+
}, [r]), O(() => {
|
|
318
|
+
r && e && r.init({
|
|
319
|
+
pageId: e
|
|
366
320
|
});
|
|
367
|
-
}, [
|
|
368
|
-
}, pt = () => {
|
|
369
|
-
const e = $(), [t, r] = N(null);
|
|
370
|
-
return k(() => {
|
|
371
|
-
if (!e) return;
|
|
372
|
-
let n = sessionStorage.getItem(e.storage_keys.current_tab);
|
|
373
|
-
const o = JSON.parse(localStorage.getItem(e.storage_keys.all_tabs) || "[]");
|
|
374
|
-
n && o.includes(n) && (n = null), n || (n = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(e.storage_keys.current_tab, n)), o.includes(n) || (o.push(n), localStorage.setItem(e.storage_keys.all_tabs, JSON.stringify(o))), r(n);
|
|
375
|
-
const i = () => {
|
|
376
|
-
const l = o.filter((c) => c !== n);
|
|
377
|
-
localStorage.setItem(e.storage_keys.all_tabs, JSON.stringify(l));
|
|
378
|
-
};
|
|
379
|
-
return window.addEventListener("beforeunload", i), () => {
|
|
380
|
-
window.removeEventListener("beforeunload", i);
|
|
381
|
-
};
|
|
382
|
-
}, [e]), t;
|
|
383
|
-
}, bt = ({
|
|
384
|
-
id: e,
|
|
385
|
-
properties: t = {},
|
|
386
|
-
href: r
|
|
387
|
-
}) => {
|
|
388
|
-
const n = V(), o = $();
|
|
389
|
-
k(() => {
|
|
390
|
-
(() => {
|
|
391
|
-
o?.insightsUrl && n.workspace && r && (o?.instance ? o.instance.page({
|
|
392
|
-
resource: "page",
|
|
393
|
-
identifier: e
|
|
394
|
-
}) : o?.initiate({
|
|
395
|
-
...t,
|
|
396
|
-
id: e,
|
|
397
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
398
|
-
}));
|
|
399
|
-
})();
|
|
400
|
-
}, [o, n?.workspace, r]);
|
|
401
|
-
}, ht = () => {
|
|
402
|
-
const e = $(), [t, r] = N(0);
|
|
403
|
-
return k(() => {
|
|
404
|
-
if (!e) return;
|
|
405
|
-
const n = Number(localStorage.getItem(e?.storage_keys.open_tabs)) || 0;
|
|
406
|
-
r(n), localStorage.setItem(e?.storage_keys.open_tabs, (n + 1).toString());
|
|
407
|
-
const o = (l) => {
|
|
408
|
-
l.key === e?.storage_keys.open_tabs && r(Number(l.newValue) || 0);
|
|
409
|
-
};
|
|
410
|
-
window.addEventListener("storage", o);
|
|
411
|
-
const i = () => {
|
|
412
|
-
const l = Number(localStorage.getItem(e?.storage_keys.open_tabs)) || 0;
|
|
413
|
-
l > 0 && localStorage.setItem(e?.storage_keys.open_tabs, (l - 1).toString());
|
|
414
|
-
};
|
|
415
|
-
return window.addEventListener("beforeunload", i), () => {
|
|
416
|
-
window.removeEventListener("storage", o), window.removeEventListener("beforeunload", i);
|
|
417
|
-
};
|
|
418
|
-
}, [e]), t;
|
|
321
|
+
}, [r, e]), null;
|
|
419
322
|
};
|
|
420
|
-
|
|
421
|
-
var t = typeof e;
|
|
422
|
-
return e != null && (t == "object" || t == "function");
|
|
423
|
-
}
|
|
424
|
-
var vt = typeof global == "object" && global && global.Object === Object && global, yt = typeof self == "object" && self && self.Object === Object && self, Ae = vt || yt || Function("return this")(), le = function() {
|
|
425
|
-
return Ae.Date.now();
|
|
426
|
-
}, wt = /\s/;
|
|
427
|
-
function xt(e) {
|
|
428
|
-
for (var t = e.length; t-- && wt.test(e.charAt(t)); )
|
|
429
|
-
;
|
|
430
|
-
return t;
|
|
431
|
-
}
|
|
432
|
-
var Tt = /^\s+/;
|
|
433
|
-
function Et(e) {
|
|
434
|
-
return e && e.slice(0, xt(e) + 1).replace(Tt, "");
|
|
435
|
-
}
|
|
436
|
-
var te = Ae.Symbol, Ie = Object.prototype, kt = Ie.hasOwnProperty, _t = Ie.toString, J = te ? te.toStringTag : void 0;
|
|
437
|
-
function St(e) {
|
|
438
|
-
var t = kt.call(e, J), r = e[J];
|
|
439
|
-
try {
|
|
440
|
-
e[J] = void 0;
|
|
441
|
-
var n = !0;
|
|
442
|
-
} catch {
|
|
443
|
-
}
|
|
444
|
-
var o = _t.call(e);
|
|
445
|
-
return n && (t ? e[J] = r : delete e[J]), o;
|
|
446
|
-
}
|
|
447
|
-
var Ot = Object.prototype, Nt = Ot.toString;
|
|
448
|
-
function jt(e) {
|
|
449
|
-
return Nt.call(e);
|
|
450
|
-
}
|
|
451
|
-
var Ct = "[object Null]", Rt = "[object Undefined]", Ne = te ? te.toStringTag : void 0;
|
|
452
|
-
function Lt(e) {
|
|
453
|
-
return e == null ? e === void 0 ? Rt : Ct : Ne && Ne in Object(e) ? St(e) : jt(e);
|
|
454
|
-
}
|
|
455
|
-
function Pt(e) {
|
|
456
|
-
return e != null && typeof e == "object";
|
|
457
|
-
}
|
|
458
|
-
var At = "[object Symbol]";
|
|
459
|
-
function It(e) {
|
|
460
|
-
return typeof e == "symbol" || Pt(e) && Lt(e) == At;
|
|
461
|
-
}
|
|
462
|
-
var je = NaN, Dt = /^[-+]0x[0-9a-f]+$/i, $t = /^0b[01]+$/i, Mt = /^0o[0-7]+$/i, Wt = parseInt;
|
|
463
|
-
function Ce(e) {
|
|
464
|
-
if (typeof e == "number")
|
|
465
|
-
return e;
|
|
466
|
-
if (It(e))
|
|
467
|
-
return je;
|
|
468
|
-
if (fe(e)) {
|
|
469
|
-
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
470
|
-
e = fe(t) ? t + "" : t;
|
|
471
|
-
}
|
|
472
|
-
if (typeof e != "string")
|
|
473
|
-
return e === 0 ? e : +e;
|
|
474
|
-
e = Et(e);
|
|
475
|
-
var r = $t.test(e);
|
|
476
|
-
return r || Mt.test(e) ? Wt(e.slice(2), r ? 2 : 8) : Dt.test(e) ? je : +e;
|
|
477
|
-
}
|
|
478
|
-
var Ft = "Expected a function", Bt = Math.max, Ut = Math.min;
|
|
479
|
-
function Yt(e, t, r) {
|
|
480
|
-
var n, o, i, l, c, a, d = 0, p = !1, u = !1, m = !0;
|
|
481
|
-
if (typeof e != "function")
|
|
482
|
-
throw new TypeError(Ft);
|
|
483
|
-
t = Ce(t) || 0, fe(r) && (p = !!r.leading, u = "maxWait" in r, i = u ? Bt(Ce(r.maxWait) || 0, t) : i, m = "trailing" in r ? !!r.trailing : m);
|
|
484
|
-
function b(v) {
|
|
485
|
-
var L = n, A = o;
|
|
486
|
-
return n = o = void 0, d = v, l = e.apply(A, L), l;
|
|
487
|
-
}
|
|
488
|
-
function h(v) {
|
|
489
|
-
return d = v, c = setTimeout(C, t), p ? b(v) : l;
|
|
490
|
-
}
|
|
491
|
-
function O(v) {
|
|
492
|
-
var L = v - a, A = v - d, F = t - L;
|
|
493
|
-
return u ? Ut(F, i - A) : F;
|
|
494
|
-
}
|
|
495
|
-
function x(v) {
|
|
496
|
-
var L = v - a, A = v - d;
|
|
497
|
-
return a === void 0 || L >= t || L < 0 || u && A >= i;
|
|
498
|
-
}
|
|
499
|
-
function C() {
|
|
500
|
-
var v = le();
|
|
501
|
-
if (x(v))
|
|
502
|
-
return w(v);
|
|
503
|
-
c = setTimeout(C, O(v));
|
|
504
|
-
}
|
|
505
|
-
function w(v) {
|
|
506
|
-
return c = void 0, m && n ? b(v) : (n = o = void 0, l);
|
|
507
|
-
}
|
|
508
|
-
function _() {
|
|
509
|
-
c !== void 0 && clearTimeout(c), d = 0, n = a = o = c = void 0;
|
|
510
|
-
}
|
|
511
|
-
function P() {
|
|
512
|
-
return c === void 0 ? l : w(le());
|
|
513
|
-
}
|
|
514
|
-
function M() {
|
|
515
|
-
var v = le(), L = x(v);
|
|
516
|
-
if (n = arguments, o = this, a = v, L) {
|
|
517
|
-
if (c === void 0)
|
|
518
|
-
return h(a);
|
|
519
|
-
if (u)
|
|
520
|
-
return clearTimeout(c), c = setTimeout(C, t), b(a);
|
|
521
|
-
}
|
|
522
|
-
return c === void 0 && (c = setTimeout(C, t)), l;
|
|
523
|
-
}
|
|
524
|
-
return M.cancel = _, M.flush = P, M;
|
|
525
|
-
}
|
|
526
|
-
const Ht = () => {
|
|
527
|
-
const [e, t] = N(0), [r, n] = N("read"), [o, i] = N("down"), l = H({
|
|
528
|
-
prevMilestone: 0,
|
|
529
|
-
prevScrollY: 0,
|
|
530
|
-
prevTime: Date.now()
|
|
531
|
-
}), c = H({ setDepth: t, setSpeedCategory: n, setDirection: i });
|
|
532
|
-
c.current = { setDepth: t, setSpeedCategory: n, setDirection: i };
|
|
533
|
-
const a = me(
|
|
534
|
-
() => Yt(() => {
|
|
535
|
-
const d = window.scrollY, p = document.documentElement.scrollHeight, u = window.innerHeight, m = p - u;
|
|
536
|
-
if (m <= 0) return;
|
|
537
|
-
const b = Math.round(d / m * 100), h = Math.max(0, Math.min(100, b)), O = Math.floor(h / 5) * 5, { prevMilestone: x, prevScrollY: C, prevTime: w } = l.current, _ = O > x ? "down" : "up";
|
|
538
|
-
if (O === x)
|
|
539
|
-
return;
|
|
540
|
-
const P = Date.now(), M = (P - w) / 1e3, v = Math.abs(d - C), A = (M > 0 ? v / M : 0) > 300 ? "scan" : "read";
|
|
541
|
-
l.current = {
|
|
542
|
-
prevMilestone: O,
|
|
543
|
-
prevScrollY: d,
|
|
544
|
-
prevTime: P
|
|
545
|
-
}, c.current.setDepth(O), c.current.setSpeedCategory(A), c.current.setDirection(_);
|
|
546
|
-
}, 250),
|
|
547
|
-
[]
|
|
548
|
-
);
|
|
549
|
-
return k(() => (window.addEventListener("scroll", a), () => {
|
|
550
|
-
window.removeEventListener("scroll", a), a.cancel();
|
|
551
|
-
}), [a]), { depth: e, speedCategory: r, direction: o };
|
|
552
|
-
}, re = (e) => Object.prototype.toString.call(e) == "[object String]", zt = (e, t) => e.indexOf(t) !== -1, Y = (e) => e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), De = (e) => e === void 0, Vt = (e) => e === null, $e = (e) => De(e) || Vt(e), Me = (e) => !!e && e?.nodeType === 3;
|
|
553
|
-
function Gt(e) {
|
|
554
|
-
return !!e && e?.nodeType === 1;
|
|
555
|
-
}
|
|
556
|
-
function Xt(e, t) {
|
|
557
|
-
return !!e && !!e?.tagName && e?.tagName.toLowerCase() === t.toLowerCase();
|
|
558
|
-
}
|
|
559
|
-
function Jt(e) {
|
|
560
|
-
return e ? Y(e).split(/\s+/) : [];
|
|
561
|
-
}
|
|
562
|
-
function qt(e) {
|
|
563
|
-
let t = "";
|
|
564
|
-
switch (typeof e?.className) {
|
|
565
|
-
case "string":
|
|
566
|
-
t = e?.className;
|
|
567
|
-
break;
|
|
568
|
-
// TODO: when is this ever used?
|
|
569
|
-
case "object":
|
|
570
|
-
t = (e?.className && "baseVal" in e?.className ? (e?.className).baseVal : null) || e?.getAttribute("class") || "";
|
|
571
|
-
break;
|
|
572
|
-
default:
|
|
573
|
-
t = "";
|
|
574
|
-
}
|
|
575
|
-
return Jt(t);
|
|
576
|
-
}
|
|
577
|
-
const S = (e, t = 255) => $e(e) ? "" : Y(e).split(/(\s+)/).filter((r) => he(r)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, t), We = ["span", "strong", "em", "i", "b", "mark", "code", "small", "sub", "sup", "label"], be = (e) => {
|
|
578
|
-
let t = "";
|
|
579
|
-
if (er(e) && e?.childNodes && e?.childNodes.length) {
|
|
580
|
-
for (const r of e?.childNodes)
|
|
581
|
-
Me(r) && r.textContent && (t += S(r.textContent) ?? "");
|
|
582
|
-
if (!Y(t)) {
|
|
583
|
-
const r = e.querySelectorAll(We.join(", "));
|
|
584
|
-
for (const n of r) {
|
|
585
|
-
const o = n.textContent;
|
|
586
|
-
o && (t += `${S(o)} `);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
if (!Y(t) && e instanceof HTMLElement) {
|
|
590
|
-
const r = e.innerText;
|
|
591
|
-
r && (t = S(r.substring(0, 500)));
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
return Y(t);
|
|
595
|
-
}, Kt = (e) => De(e.target) ? e?.srcElement || null : e?.target?.shadowRoot ? e?.composedPath()?.[0] || null : e?.target || null, Zt = (e, t) => {
|
|
596
|
-
if (!window || !e || Xt(e, "html") || !Gt(e))
|
|
597
|
-
return !1;
|
|
598
|
-
const r = window.getComputedStyle(e);
|
|
599
|
-
if (r && r.getPropertyValue("cursor") === "pointer" && t.type === "click")
|
|
600
|
-
return !0;
|
|
601
|
-
switch (e?.tagName.toLowerCase()) {
|
|
602
|
-
case "html":
|
|
603
|
-
return !1;
|
|
604
|
-
case "form":
|
|
605
|
-
return t.type === "submit";
|
|
606
|
-
case "input":
|
|
607
|
-
case "select":
|
|
608
|
-
case "textarea":
|
|
609
|
-
return ["change", "click"].includes(t.type);
|
|
610
|
-
default:
|
|
611
|
-
return t.type === "click";
|
|
612
|
-
}
|
|
613
|
-
}, Qt = /* @__PURE__ */ new Set([
|
|
614
|
-
"password",
|
|
615
|
-
"passwd",
|
|
616
|
-
"pwd",
|
|
617
|
-
"creditcard",
|
|
618
|
-
"cardnumber",
|
|
619
|
-
"ccnum",
|
|
620
|
-
"ccnumber",
|
|
621
|
-
"cvv",
|
|
622
|
-
"cvc",
|
|
623
|
-
"csc",
|
|
624
|
-
"securitycode",
|
|
625
|
-
"ssn",
|
|
626
|
-
"socialsecurity",
|
|
627
|
-
"routingnumber",
|
|
628
|
-
"accountnumber",
|
|
629
|
-
"bankaccount",
|
|
630
|
-
"secretkey",
|
|
631
|
-
"apikey",
|
|
632
|
-
"accesstoken"
|
|
633
|
-
]);
|
|
634
|
-
function er(e) {
|
|
635
|
-
if (zt(qt(e), "ph-include"))
|
|
636
|
-
return !0;
|
|
637
|
-
const t = e.type || "";
|
|
638
|
-
if (re(t))
|
|
639
|
-
switch (t.toLowerCase()) {
|
|
640
|
-
case "hidden":
|
|
641
|
-
return !1;
|
|
642
|
-
case "password":
|
|
643
|
-
return !1;
|
|
644
|
-
}
|
|
645
|
-
const r = e.name || e?.id || "";
|
|
646
|
-
if (re(r)) {
|
|
647
|
-
const n = r.toLowerCase().replace(/[^a-z]/g, "");
|
|
648
|
-
if (Qt.has(n))
|
|
649
|
-
return !1;
|
|
650
|
-
}
|
|
651
|
-
return !0;
|
|
652
|
-
}
|
|
653
|
-
const Fe = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", tr = new RegExp(`^(?:${Fe})$`), rr = new RegExp(Fe), Be = "\\d{3}-?\\d{2}-?\\d{4}", nr = new RegExp(`^(${Be})$`), or = new RegExp(`(${Be})`), he = (e, t = !0) => !($e(e) || re(e) && (e = Y(e), (t ? tr : rr).test((e || "").replace(/[- ]/g, "")) || (t ? nr : or).test(e))), sr = (e) => re(e) ? e.substring(0, 10) === "_ngcontent" || e.substring(0, 7) === "_nghost" : !1, ir = (e) => {
|
|
654
|
-
let t = be(e);
|
|
655
|
-
return t = `${t} ${Ue(e)}`.trim(), he(t) ? t : "";
|
|
656
|
-
};
|
|
657
|
-
function Ue(e) {
|
|
658
|
-
let t = "";
|
|
659
|
-
if (e?.childNodes.length)
|
|
660
|
-
for (const r of e.childNodes) {
|
|
661
|
-
const n = r.tagName?.toLowerCase();
|
|
662
|
-
if (r && n && We.includes(n))
|
|
663
|
-
try {
|
|
664
|
-
const o = be(r);
|
|
665
|
-
t = `${t} ${o}`.trim(), r?.childNodes.length && (t = `${t} ${Ue(r)}`.trim());
|
|
666
|
-
} catch {
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return t;
|
|
670
|
-
}
|
|
671
|
-
const ar = (e) => {
|
|
672
|
-
const t = e.tagName?.toLowerCase(), r = t === "a" || t === "button" ? ir(e) : be(e);
|
|
673
|
-
if (r) return { text: r, source: "text" };
|
|
674
|
-
const n = e.getAttribute("aria-label");
|
|
675
|
-
if (n) return { text: S(n), source: "aria-label" };
|
|
676
|
-
const o = e.getAttribute("title");
|
|
677
|
-
if (o) return { text: S(o), source: "title" };
|
|
678
|
-
const i = e.getAttribute("data-track-label");
|
|
679
|
-
if (i) return { text: S(i), source: "data-track-label" };
|
|
680
|
-
const l = e.querySelector("img[alt], svg[aria-label]");
|
|
681
|
-
if (l) {
|
|
682
|
-
const a = l.getAttribute("alt") || l.getAttribute("aria-label");
|
|
683
|
-
if (a) return { text: S(a), source: "alt" };
|
|
684
|
-
}
|
|
685
|
-
const c = e.getAttribute("placeholder");
|
|
686
|
-
if (c) return { text: S(c), source: "placeholder" };
|
|
687
|
-
if (e instanceof HTMLElement && e.innerText) {
|
|
688
|
-
const a = e.innerText.substring(0, 500);
|
|
689
|
-
if (a.trim())
|
|
690
|
-
return { text: S(a), source: "innerText" };
|
|
691
|
-
}
|
|
692
|
-
return { text: "", source: "none" };
|
|
693
|
-
}, cr = ["input", "textarea", "select"], Ye = (e) => {
|
|
694
|
-
const t = e?.tagName?.toLowerCase(), r = {
|
|
695
|
-
element: t
|
|
696
|
-
}, n = ar(e);
|
|
697
|
-
r.text = n.text, r.text_source = n.source;
|
|
698
|
-
const o = e.getAttribute("aria-label");
|
|
699
|
-
o && (r.aria_label = S(o));
|
|
700
|
-
const i = e.getAttribute("role");
|
|
701
|
-
i && (r.role = i);
|
|
702
|
-
const l = {};
|
|
703
|
-
for (const a of e.attributes)
|
|
704
|
-
(a.name.startsWith("data-track-") || a.name.startsWith("data-analytics-")) && (l[a.name] = S(a.value));
|
|
705
|
-
Object.keys(l).length && (r.tracking_data = l);
|
|
706
|
-
const c = Array.from(e.attributes).reduce(
|
|
707
|
-
(a, d) => {
|
|
708
|
-
if (he(d.value) && !sr(d.name)) {
|
|
709
|
-
if (d.name === "class" || d.name.startsWith("data-track-") || d.name.startsWith("data-analytics-"))
|
|
710
|
-
return a;
|
|
711
|
-
a[d.name] = typeof d?.value == "string" ? S(d.value) : d.value;
|
|
712
|
-
}
|
|
713
|
-
return a;
|
|
714
|
-
},
|
|
715
|
-
{}
|
|
716
|
-
);
|
|
717
|
-
if (r.attributes = c, cr.includes(t) || e?.getAttribute("contenteditable") === "true") {
|
|
718
|
-
let a;
|
|
719
|
-
e.matches('input[type="checkbox"], input[type="radio"]') ? a = e.checked : e.matches("input, select, textarea") && !e.matches('input[type="password"]') && (a = e.value), a !== void 0 && (r.value = typeof a == "string" || a === null ? S(a, 1024) : a);
|
|
720
|
-
let d = "";
|
|
721
|
-
r?.attributes.id && (d = S(
|
|
722
|
-
document.querySelector(`label[for="${r?.attributes.id}"]`)?.textContent?.trim() || ""
|
|
723
|
-
));
|
|
724
|
-
const p = e.closest("label");
|
|
725
|
-
d || (d = S(p?.textContent?.trim() || "")), d && (r.label = d);
|
|
726
|
-
}
|
|
727
|
-
return r;
|
|
728
|
-
}, lr = (e, t) => {
|
|
729
|
-
let r = Kt(e);
|
|
730
|
-
Me(r) && (r = r.parentNode || null);
|
|
731
|
-
const n = ["copy", "cut"].includes(t);
|
|
732
|
-
if (r && (n || Zt(r, e))) {
|
|
733
|
-
const o = Ye(r);
|
|
734
|
-
if (n) {
|
|
735
|
-
const i = S(window?.getSelection()?.toString()), l = e?.type || "clipboard";
|
|
736
|
-
o.copy_text = i ?? "", o.copy_type = l;
|
|
737
|
-
}
|
|
738
|
-
return o;
|
|
739
|
-
}
|
|
740
|
-
return null;
|
|
741
|
-
}, ur = () => {
|
|
742
|
-
const e = $();
|
|
743
|
-
k(() => {
|
|
744
|
-
let t;
|
|
745
|
-
const r = () => {
|
|
746
|
-
clearTimeout(t), t = setTimeout(() => {
|
|
747
|
-
const n = window.getSelection();
|
|
748
|
-
if (n && n?.rangeCount > 0) {
|
|
749
|
-
const o = n?.toString();
|
|
750
|
-
o && e?.track("page.selection", {
|
|
751
|
-
text: S(o)
|
|
752
|
-
});
|
|
753
|
-
}
|
|
754
|
-
}, 1e3);
|
|
755
|
-
};
|
|
756
|
-
return document.addEventListener("selectionchange", r), () => {
|
|
757
|
-
clearTimeout(t), document.removeEventListener("selectionchange", r);
|
|
758
|
-
};
|
|
759
|
-
}, []);
|
|
760
|
-
}, dr = 30, fr = 1e3, gr = 3;
|
|
761
|
-
class mr {
|
|
762
|
-
clicks;
|
|
763
|
-
constructor() {
|
|
764
|
-
this.clicks = [];
|
|
765
|
-
}
|
|
766
|
-
/**
|
|
767
|
-
* Check if the current click is part of a rage click sequence.
|
|
768
|
-
* Returns true for 3+ consecutive clicks within threshold.
|
|
769
|
-
*/
|
|
770
|
-
isRageClick(t, r, n) {
|
|
771
|
-
const o = this.clicks[this.clicks.length - 1];
|
|
772
|
-
if (o && Math.abs(t - o.x) + Math.abs(r - o.y) < dr && n - o.timestamp < fr) {
|
|
773
|
-
if (this.clicks.push({ x: t, y: r, timestamp: n }), this.clicks.length >= gr)
|
|
774
|
-
return !0;
|
|
775
|
-
} else
|
|
776
|
-
this.clicks = [{ x: t, y: r, timestamp: n }];
|
|
777
|
-
return !1;
|
|
778
|
-
}
|
|
779
|
-
/**
|
|
780
|
-
* Reset the click sequence (useful for testing)
|
|
781
|
-
*/
|
|
782
|
-
reset() {
|
|
783
|
-
this.clicks = [];
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
const pr = new mr(), br = (e) => {
|
|
787
|
-
let t = e, r = 0;
|
|
788
|
-
for (; t && r < 10; ) {
|
|
789
|
-
const n = t.getAttribute?.("href");
|
|
790
|
-
if (n)
|
|
791
|
-
return n;
|
|
792
|
-
t = t.parentElement, r++;
|
|
793
|
-
}
|
|
794
|
-
return null;
|
|
795
|
-
}, ue = (e) => {
|
|
796
|
-
const t = e.closest("a[href]"), r = t?.getAttribute("href") || br(e);
|
|
797
|
-
if (!r) return { type: null, href: null };
|
|
798
|
-
if (t?.hasAttribute("download"))
|
|
799
|
-
return { type: "download", href: r };
|
|
800
|
-
if (r.startsWith("tel:")) return { type: "tel", href: r };
|
|
801
|
-
if (r.startsWith("mailto:")) return { type: "mailto", href: r };
|
|
802
|
-
if (r.startsWith("#")) return { type: "anchor", href: r };
|
|
803
|
-
try {
|
|
804
|
-
return {
|
|
805
|
-
type: new URL(r, window.location.origin).origin === window.location.origin ? "internal" : "external",
|
|
806
|
-
href: r
|
|
807
|
-
};
|
|
808
|
-
} catch {
|
|
809
|
-
return { type: "internal", href: r };
|
|
810
|
-
}
|
|
811
|
-
}, hr = () => {
|
|
812
|
-
const e = $(), { workspace: t, logger: r } = V(), n = H(0);
|
|
813
|
-
k(() => {
|
|
814
|
-
let o = null;
|
|
815
|
-
const i = (u, m = !1) => {
|
|
816
|
-
const b = u.target, h = "clientX" in u ? u.clientX : u.changedTouches?.[0]?.clientX ?? 0, O = "clientY" in u ? u.clientY : u.changedTouches?.[0]?.clientY ?? 0;
|
|
817
|
-
let x = {
|
|
818
|
-
hostname: window.location.hostname,
|
|
819
|
-
pathname: window.location.pathname,
|
|
820
|
-
page_title: document.title,
|
|
821
|
-
url: window.location.href,
|
|
822
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
823
|
-
event_type: m ? "dblclick" : "click",
|
|
824
|
-
button_type: "button" in u ? u.button : 0
|
|
825
|
-
};
|
|
826
|
-
return b instanceof HTMLElement && (x.rage_click = pr?.isRageClick(h, O, Date.now()), x = {
|
|
827
|
-
...x,
|
|
828
|
-
...Ye(b)
|
|
829
|
-
}), x;
|
|
830
|
-
}, l = (u, m) => {
|
|
831
|
-
try {
|
|
832
|
-
if (Date.now() - n.current < 300) return;
|
|
833
|
-
const b = i(u);
|
|
834
|
-
if (!e?.insightsUrl || !t) {
|
|
835
|
-
r?.warn("Cannot track navigation click: missing insightsUrl or workspace");
|
|
836
|
-
return;
|
|
837
|
-
}
|
|
838
|
-
e?.track("page.click", {
|
|
839
|
-
...b,
|
|
840
|
-
href: m.href || void 0,
|
|
841
|
-
link_type: m.type,
|
|
842
|
-
is_navigation: !0
|
|
843
|
-
});
|
|
844
|
-
} catch (b) {
|
|
845
|
-
r?.error("Failed to track navigation click", U(b));
|
|
846
|
-
}
|
|
847
|
-
}, c = (u, m = !1) => {
|
|
848
|
-
try {
|
|
849
|
-
if (!(u.target instanceof HTMLElement) || Date.now() - n.current < 300) return;
|
|
850
|
-
const b = i(u, m), h = ue(u.target);
|
|
851
|
-
e?.track("page.click", {
|
|
852
|
-
...b,
|
|
853
|
-
href: h.href || void 0,
|
|
854
|
-
link_type: h.type || void 0
|
|
855
|
-
});
|
|
856
|
-
} catch (b) {
|
|
857
|
-
r?.error("Failed to track click", U(b));
|
|
858
|
-
}
|
|
859
|
-
}, a = (u) => {
|
|
860
|
-
if (!(u.target instanceof HTMLElement)) return;
|
|
861
|
-
const m = ue(u.target);
|
|
862
|
-
if (m.type === "external" || m.type === "download") {
|
|
863
|
-
l(u, m);
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
if (o) {
|
|
867
|
-
clearTimeout(o), o = null;
|
|
868
|
-
return;
|
|
869
|
-
}
|
|
870
|
-
o = setTimeout(() => {
|
|
871
|
-
c(u, !1), o = null;
|
|
872
|
-
}, 250);
|
|
873
|
-
}, d = (u) => {
|
|
874
|
-
o && (clearTimeout(o), o = null), c(u, !0);
|
|
875
|
-
}, p = (u) => {
|
|
876
|
-
try {
|
|
877
|
-
if (!(u.target instanceof HTMLElement)) return;
|
|
878
|
-
n.current = Date.now();
|
|
879
|
-
const m = ue(u.target);
|
|
880
|
-
if (m.type === "external" || m.type === "download") {
|
|
881
|
-
const h = i(u);
|
|
882
|
-
e?.track("page.click", {
|
|
883
|
-
...h,
|
|
884
|
-
href: m.href || void 0,
|
|
885
|
-
link_type: m.type,
|
|
886
|
-
is_navigation: !0,
|
|
887
|
-
is_touch: !0
|
|
888
|
-
});
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
const b = i(u);
|
|
892
|
-
e?.track("page.click", {
|
|
893
|
-
...b,
|
|
894
|
-
href: m.href || void 0,
|
|
895
|
-
link_type: m.type || void 0,
|
|
896
|
-
is_touch: !0
|
|
897
|
-
});
|
|
898
|
-
} catch (m) {
|
|
899
|
-
r?.error("Failed to track touch", U(m));
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
return document.addEventListener("click", a), document.addEventListener("dblclick", d), document.addEventListener("touchend", p, { passive: !0 }), () => {
|
|
903
|
-
document.removeEventListener("click", a), document.removeEventListener("dblclick", d), document.removeEventListener("touchend", p), o && clearTimeout(o);
|
|
904
|
-
};
|
|
905
|
-
}, [e, t, r]);
|
|
906
|
-
}, hn = ({ id: e, properties: t = {} }) => {
|
|
907
|
-
const r = typeof window < "u" ? window.location.href : "", n = V(), o = $();
|
|
908
|
-
k(() => {
|
|
909
|
-
n && typeof window < "u" && (window.levo_client = n);
|
|
910
|
-
}, [n]), k(() => {
|
|
911
|
-
o && typeof window < "u" && (window.levo_insights = o);
|
|
912
|
-
}, []), ht(), pt(), hr();
|
|
913
|
-
const i = Ht();
|
|
914
|
-
return k(() => {
|
|
915
|
-
o?.instance && o?.track("page.scroll", {
|
|
916
|
-
resource: "page",
|
|
917
|
-
identifier: e,
|
|
918
|
-
percent: i.depth,
|
|
919
|
-
speed_category: i.speedCategory
|
|
920
|
-
});
|
|
921
|
-
}, [o, i.depth, i.speedCategory, e]), ur(), bt({
|
|
922
|
-
href: r,
|
|
923
|
-
id: e,
|
|
924
|
-
properties: t
|
|
925
|
-
}), mt({ id: e }), k(() => {
|
|
926
|
-
const l = {
|
|
927
|
-
change: "form.change",
|
|
928
|
-
submit: "form.submit",
|
|
929
|
-
copy: "page.copy",
|
|
930
|
-
cut: "page.copy"
|
|
931
|
-
}, c = (d) => (p) => {
|
|
932
|
-
const u = lr(p, d);
|
|
933
|
-
u && l[d] && o?.track(l[d], u);
|
|
934
|
-
}, a = {
|
|
935
|
-
change: c("change"),
|
|
936
|
-
copy: c("copy"),
|
|
937
|
-
cut: c("cut"),
|
|
938
|
-
submit: c("submit")
|
|
939
|
-
};
|
|
940
|
-
return document.addEventListener("change", a.change), document.addEventListener("copy", a.copy), document.addEventListener("cut", a.cut), document.addEventListener("submit", a.submit), () => {
|
|
941
|
-
document.removeEventListener("change", a.change), document.removeEventListener("copy", a.copy), document.removeEventListener("cut", a.cut), document.removeEventListener("submit", a.submit);
|
|
942
|
-
};
|
|
943
|
-
}, []), (!o?.insightsUrl || !n.workspace || !n.workspace.startsWith("W")) && console.error(
|
|
944
|
-
"[@levo-so/react] The utility could not be initialized, due to missing workspace, or endpoint for insights."
|
|
945
|
-
), null;
|
|
946
|
-
};
|
|
947
|
-
var He = {
|
|
323
|
+
var ve = {
|
|
948
324
|
color: void 0,
|
|
949
325
|
size: void 0,
|
|
950
326
|
className: void 0,
|
|
951
327
|
style: void 0,
|
|
952
328
|
attr: void 0
|
|
953
|
-
},
|
|
954
|
-
function
|
|
329
|
+
}, ue = R.createContext && /* @__PURE__ */ R.createContext(ve), Ue = ["attr", "size", "title"];
|
|
330
|
+
function Ye(e, t) {
|
|
955
331
|
if (e == null) return {};
|
|
956
|
-
var r =
|
|
332
|
+
var r = Ge(e, t), n, s;
|
|
957
333
|
if (Object.getOwnPropertySymbols) {
|
|
958
|
-
var
|
|
959
|
-
for (
|
|
960
|
-
n =
|
|
334
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
335
|
+
for (s = 0; s < a.length; s++)
|
|
336
|
+
n = a[s], !(t.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (r[n] = e[n]);
|
|
961
337
|
}
|
|
962
338
|
return r;
|
|
963
339
|
}
|
|
964
|
-
function
|
|
340
|
+
function Ge(e, t) {
|
|
965
341
|
if (e == null) return {};
|
|
966
342
|
var r = {};
|
|
967
343
|
for (var n in e)
|
|
@@ -971,45 +347,45 @@ function wr(e, t) {
|
|
|
971
347
|
}
|
|
972
348
|
return r;
|
|
973
349
|
}
|
|
974
|
-
function
|
|
975
|
-
return
|
|
350
|
+
function z() {
|
|
351
|
+
return z = Object.assign ? Object.assign.bind() : function(e) {
|
|
976
352
|
for (var t = 1; t < arguments.length; t++) {
|
|
977
353
|
var r = arguments[t];
|
|
978
354
|
for (var n in r)
|
|
979
355
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
980
356
|
}
|
|
981
357
|
return e;
|
|
982
|
-
},
|
|
358
|
+
}, z.apply(this, arguments);
|
|
983
359
|
}
|
|
984
|
-
function
|
|
360
|
+
function de(e, t) {
|
|
985
361
|
var r = Object.keys(e);
|
|
986
362
|
if (Object.getOwnPropertySymbols) {
|
|
987
363
|
var n = Object.getOwnPropertySymbols(e);
|
|
988
|
-
t && (n = n.filter(function(
|
|
989
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
364
|
+
t && (n = n.filter(function(s) {
|
|
365
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
990
366
|
})), r.push.apply(r, n);
|
|
991
367
|
}
|
|
992
368
|
return r;
|
|
993
369
|
}
|
|
994
|
-
function
|
|
370
|
+
function U(e) {
|
|
995
371
|
for (var t = 1; t < arguments.length; t++) {
|
|
996
372
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
997
|
-
t % 2 ?
|
|
998
|
-
|
|
999
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
373
|
+
t % 2 ? de(Object(r), !0).forEach(function(n) {
|
|
374
|
+
Ve(e, n, r[n]);
|
|
375
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : de(Object(r)).forEach(function(n) {
|
|
1000
376
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1001
377
|
});
|
|
1002
378
|
}
|
|
1003
379
|
return e;
|
|
1004
380
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return t =
|
|
381
|
+
function Ve(e, t, r) {
|
|
382
|
+
return t = He(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1007
383
|
}
|
|
1008
|
-
function
|
|
1009
|
-
var t =
|
|
384
|
+
function He(e) {
|
|
385
|
+
var t = Je(e, "string");
|
|
1010
386
|
return typeof t == "symbol" ? t : t + "";
|
|
1011
387
|
}
|
|
1012
|
-
function
|
|
388
|
+
function Je(e, t) {
|
|
1013
389
|
if (typeof e != "object" || !e) return e;
|
|
1014
390
|
var r = e[Symbol.toPrimitive];
|
|
1015
391
|
if (r !== void 0) {
|
|
@@ -1019,43 +395,43 @@ function Er(e, t) {
|
|
|
1019
395
|
}
|
|
1020
396
|
return (t === "string" ? String : Number)(e);
|
|
1021
397
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return e && e.map((t, r) => /* @__PURE__ */
|
|
398
|
+
function be(e) {
|
|
399
|
+
return e && e.map((t, r) => /* @__PURE__ */ R.createElement(t.tag, U({
|
|
1024
400
|
key: r
|
|
1025
|
-
}, t.attr),
|
|
401
|
+
}, t.attr), be(t.child)));
|
|
1026
402
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return (t) => /* @__PURE__ */
|
|
1029
|
-
attr:
|
|
1030
|
-
}, t),
|
|
403
|
+
function Xe(e) {
|
|
404
|
+
return (t) => /* @__PURE__ */ R.createElement(qe, z({
|
|
405
|
+
attr: U({}, e.attr)
|
|
406
|
+
}, t), be(e.child));
|
|
1031
407
|
}
|
|
1032
|
-
function
|
|
408
|
+
function qe(e) {
|
|
1033
409
|
var t = (r) => {
|
|
1034
410
|
var {
|
|
1035
411
|
attr: n,
|
|
1036
|
-
size:
|
|
1037
|
-
title:
|
|
1038
|
-
} = e,
|
|
1039
|
-
return r.className && (
|
|
412
|
+
size: s,
|
|
413
|
+
title: a
|
|
414
|
+
} = e, u = Ye(e, Ue), i = s || r.size || "1em", m;
|
|
415
|
+
return r.className && (m = r.className), e.className && (m = (m ? m + " " : "") + e.className), /* @__PURE__ */ R.createElement("svg", z({
|
|
1040
416
|
stroke: "currentColor",
|
|
1041
417
|
fill: "currentColor",
|
|
1042
418
|
strokeWidth: "0"
|
|
1043
|
-
}, r.attr, n,
|
|
1044
|
-
className:
|
|
1045
|
-
style:
|
|
419
|
+
}, r.attr, n, u, {
|
|
420
|
+
className: m,
|
|
421
|
+
style: U(U({
|
|
1046
422
|
color: e.color || r.color
|
|
1047
423
|
}, r.style), e.style),
|
|
1048
|
-
height:
|
|
1049
|
-
width:
|
|
424
|
+
height: i,
|
|
425
|
+
width: i,
|
|
1050
426
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1051
|
-
}),
|
|
427
|
+
}), a && /* @__PURE__ */ R.createElement("title", null, a), e.children);
|
|
1052
428
|
};
|
|
1053
|
-
return
|
|
429
|
+
return ue !== void 0 ? /* @__PURE__ */ R.createElement(ue.Consumer, null, (r) => t(r)) : t(ve);
|
|
1054
430
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return
|
|
431
|
+
function he(e) {
|
|
432
|
+
return Xe({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
|
|
1057
433
|
}
|
|
1058
|
-
const
|
|
434
|
+
const j = (...e) => pe(De(e)), Ke = $e(
|
|
1059
435
|
"inline-flex items-center justify-center font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1060
436
|
{
|
|
1061
437
|
variants: {
|
|
@@ -1090,118 +466,118 @@ const R = (...e) => Pe(st(e)), Sr = ct(
|
|
|
1090
466
|
rounded: "default"
|
|
1091
467
|
}
|
|
1092
468
|
}
|
|
1093
|
-
),
|
|
469
|
+
), Ze = _.forwardRef(
|
|
1094
470
|
({
|
|
1095
471
|
className: e,
|
|
1096
472
|
variant: t,
|
|
1097
473
|
size: r,
|
|
1098
474
|
rounded: n,
|
|
1099
|
-
asChild:
|
|
1100
|
-
isLoading:
|
|
1101
|
-
loadingText:
|
|
1102
|
-
disabled:
|
|
1103
|
-
...
|
|
1104
|
-
},
|
|
1105
|
-
const
|
|
1106
|
-
return /* @__PURE__ */
|
|
1107
|
-
|
|
475
|
+
asChild: s = !1,
|
|
476
|
+
isLoading: a = !1,
|
|
477
|
+
loadingText: u,
|
|
478
|
+
disabled: i,
|
|
479
|
+
...m
|
|
480
|
+
}, v) => {
|
|
481
|
+
const h = s ? Ie.Root : "button";
|
|
482
|
+
return /* @__PURE__ */ l.jsx(
|
|
483
|
+
h,
|
|
1108
484
|
{
|
|
1109
|
-
className:
|
|
1110
|
-
ref:
|
|
1111
|
-
disabled:
|
|
485
|
+
className: j(Ke({ variant: t, size: r, rounded: n, className: e })),
|
|
486
|
+
ref: v,
|
|
487
|
+
disabled: i || a,
|
|
1112
488
|
type: "button",
|
|
1113
|
-
...
|
|
1114
|
-
children:
|
|
1115
|
-
/* @__PURE__ */
|
|
1116
|
-
|
|
1117
|
-
] }) :
|
|
489
|
+
...m,
|
|
490
|
+
children: a ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
491
|
+
/* @__PURE__ */ l.jsx(he, { className: pe("h-4 w-4 animate-spin", u ? "mr-2" : "") }),
|
|
492
|
+
u
|
|
493
|
+
] }) : m.children
|
|
1118
494
|
}
|
|
1119
495
|
);
|
|
1120
496
|
}
|
|
1121
497
|
);
|
|
1122
|
-
|
|
1123
|
-
const
|
|
1124
|
-
|
|
498
|
+
Ze.displayName = "Button";
|
|
499
|
+
const Qe = y.Root, Ft = y.Trigger, et = y.Portal, zt = y.Close, xe = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
500
|
+
y.Overlay,
|
|
1125
501
|
{
|
|
1126
502
|
ref: r,
|
|
1127
|
-
className:
|
|
503
|
+
className: j(
|
|
1128
504
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 grid max-h-screen place-items-center overflow-y-auto bg-background/80 py-10 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
1129
505
|
e
|
|
1130
506
|
),
|
|
1131
507
|
...t
|
|
1132
508
|
}
|
|
1133
509
|
));
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1136
|
-
|
|
510
|
+
xe.displayName = y.Overlay.displayName;
|
|
511
|
+
const we = _.forwardRef(({ className: e, children: t, container: r, hideCloseButton: n, overlayStyles: s, ...a }, u) => /* @__PURE__ */ l.jsx(et, { container: r, children: /* @__PURE__ */ l.jsx(xe, { className: s, children: /* @__PURE__ */ l.jsxs(
|
|
512
|
+
y.Content,
|
|
1137
513
|
{
|
|
1138
|
-
ref:
|
|
1139
|
-
className:
|
|
514
|
+
ref: u,
|
|
515
|
+
className: j(
|
|
1140
516
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:rounded-lg",
|
|
1141
517
|
e
|
|
1142
518
|
),
|
|
1143
|
-
...
|
|
519
|
+
...a,
|
|
1144
520
|
children: [
|
|
1145
521
|
t,
|
|
1146
|
-
!n && /* @__PURE__ */
|
|
1147
|
-
|
|
522
|
+
!n && /* @__PURE__ */ l.jsxs(
|
|
523
|
+
y.Close,
|
|
1148
524
|
{
|
|
1149
525
|
type: "button",
|
|
1150
526
|
className: "absolute top-4 right-4 rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
1151
527
|
children: [
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ l.jsx(Me, { className: "h-4 w-4" }),
|
|
529
|
+
/* @__PURE__ */ l.jsx("span", { className: "sr-only", children: "Close" })
|
|
1154
530
|
]
|
|
1155
531
|
}
|
|
1156
532
|
)
|
|
1157
533
|
]
|
|
1158
534
|
}
|
|
1159
535
|
) }) }));
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
const
|
|
536
|
+
we.displayName = y.Content.displayName;
|
|
537
|
+
const ye = ({ className: e, ...t }) => /* @__PURE__ */ l.jsx("div", { className: j("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
|
|
538
|
+
ye.displayName = "DialogHeader";
|
|
539
|
+
const tt = ({ className: e, ...t }) => /* @__PURE__ */ l.jsx(
|
|
1164
540
|
"div",
|
|
1165
541
|
{
|
|
1166
|
-
className:
|
|
542
|
+
className: j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
1167
543
|
...t
|
|
1168
544
|
}
|
|
1169
545
|
);
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
|
|
546
|
+
tt.displayName = "DialogFooter";
|
|
547
|
+
const Ee = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
548
|
+
y.Title,
|
|
1173
549
|
{
|
|
1174
550
|
ref: r,
|
|
1175
|
-
className:
|
|
551
|
+
className: j("font-semibold text-lg leading-none tracking-tight", e),
|
|
1176
552
|
...t
|
|
1177
553
|
}
|
|
1178
554
|
));
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1181
|
-
|
|
555
|
+
Ee.displayName = y.Title.displayName;
|
|
556
|
+
const je = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
557
|
+
y.Description,
|
|
1182
558
|
{
|
|
1183
559
|
ref: r,
|
|
1184
|
-
className:
|
|
560
|
+
className: j("text-muted-foreground text-sm", e),
|
|
1185
561
|
...t
|
|
1186
562
|
}
|
|
1187
563
|
));
|
|
1188
|
-
|
|
1189
|
-
const
|
|
564
|
+
je.displayName = y.Description.displayName;
|
|
565
|
+
const Ut = ({
|
|
1190
566
|
isOpen: e,
|
|
1191
567
|
onClose: t,
|
|
1192
568
|
children: r,
|
|
1193
569
|
title: n,
|
|
1194
|
-
description:
|
|
1195
|
-
contentClassName:
|
|
1196
|
-
modal:
|
|
1197
|
-
}) => /* @__PURE__ */
|
|
1198
|
-
n && /* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
/* @__PURE__ */
|
|
570
|
+
description: s = "",
|
|
571
|
+
contentClassName: a,
|
|
572
|
+
modal: u = !0
|
|
573
|
+
}) => /* @__PURE__ */ l.jsx(Qe, { open: e, onOpenChange: t, modal: u, children: /* @__PURE__ */ l.jsxs(we, { className: a, children: [
|
|
574
|
+
n && /* @__PURE__ */ l.jsxs(ye, { className: "flex-1 font-medium", children: [
|
|
575
|
+
/* @__PURE__ */ l.jsx(Ee, { children: n }),
|
|
576
|
+
/* @__PURE__ */ l.jsx(je, { children: s })
|
|
1201
577
|
] }),
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
] }) }),
|
|
1204
|
-
|
|
578
|
+
/* @__PURE__ */ l.jsx("div", { className: "w-full", children: r })
|
|
579
|
+
] }) }), Yt = ({ ...e }) => /* @__PURE__ */ l.jsx(
|
|
580
|
+
We,
|
|
1205
581
|
{
|
|
1206
582
|
closeButton: !0,
|
|
1207
583
|
richColors: !0,
|
|
@@ -1216,37 +592,37 @@ const wn = ({
|
|
|
1216
592
|
},
|
|
1217
593
|
...e
|
|
1218
594
|
}
|
|
1219
|
-
),
|
|
1220
|
-
|
|
595
|
+
), rt = (e, t = "Error", r = {}) => {
|
|
596
|
+
q.error(t, {
|
|
1221
597
|
description: e,
|
|
1222
598
|
duration: 4e3,
|
|
1223
599
|
position: "bottom-right",
|
|
1224
600
|
...r
|
|
1225
601
|
});
|
|
1226
|
-
},
|
|
1227
|
-
r?.id &&
|
|
602
|
+
}, Gt = (e, t = "Success", r = {}) => {
|
|
603
|
+
r?.id && q.dismiss(r?.id), q.success(t, {
|
|
1228
604
|
description: e,
|
|
1229
605
|
duration: 4e3,
|
|
1230
606
|
position: "bottom-right",
|
|
1231
607
|
...r
|
|
1232
608
|
});
|
|
1233
|
-
},
|
|
1234
|
-
|
|
609
|
+
}, ot = ({ className: e }) => /* @__PURE__ */ l.jsx(he, { className: j("h-8 w-8 animate-spin font-light", e) }), Vt = k.Root, nt = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
610
|
+
k.List,
|
|
1235
611
|
{
|
|
1236
612
|
ref: r,
|
|
1237
|
-
className:
|
|
613
|
+
className: j(
|
|
1238
614
|
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
1239
615
|
e
|
|
1240
616
|
),
|
|
1241
617
|
...t
|
|
1242
618
|
}
|
|
1243
619
|
));
|
|
1244
|
-
|
|
1245
|
-
const
|
|
1246
|
-
|
|
620
|
+
nt.displayName = k.List.displayName;
|
|
621
|
+
const st = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
622
|
+
k.Trigger,
|
|
1247
623
|
{
|
|
1248
624
|
ref: r,
|
|
1249
|
-
className:
|
|
625
|
+
className: j(
|
|
1250
626
|
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
1251
627
|
e
|
|
1252
628
|
),
|
|
@@ -1254,36 +630,36 @@ const Ar = D.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
|
1254
630
|
...t
|
|
1255
631
|
}
|
|
1256
632
|
));
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1259
|
-
|
|
633
|
+
st.displayName = k.Trigger.displayName;
|
|
634
|
+
const at = _.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ l.jsx(
|
|
635
|
+
k.Content,
|
|
1260
636
|
{
|
|
1261
637
|
ref: r,
|
|
1262
|
-
className:
|
|
638
|
+
className: j(
|
|
1263
639
|
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1264
640
|
e
|
|
1265
641
|
),
|
|
1266
642
|
...t
|
|
1267
643
|
}
|
|
1268
644
|
));
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1271
|
-
|
|
645
|
+
at.displayName = k.Content.displayName;
|
|
646
|
+
const Ht = A.Provider, it = A.Root, ct = A.Trigger, lt = A.Portal, Oe = _.forwardRef(({ className: e, sideOffset: t = 4, ...r }, n) => /* @__PURE__ */ l.jsx(
|
|
647
|
+
A.Content,
|
|
1272
648
|
{
|
|
1273
649
|
ref: n,
|
|
1274
650
|
sideOffset: t,
|
|
1275
|
-
className:
|
|
651
|
+
className: j(
|
|
1276
652
|
"fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 animate-in overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-popover-foreground text-xs shadow-md data-[state=closed]:animate-out",
|
|
1277
653
|
e
|
|
1278
654
|
),
|
|
1279
655
|
...r
|
|
1280
656
|
}
|
|
1281
657
|
));
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
t && /* @__PURE__ */
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
] }),
|
|
658
|
+
Oe.displayName = A.Content.displayName;
|
|
659
|
+
const Jt = ({ children: e, label: t, labelClassName: r, asChild: n = !0, contentProps: s = {}, side: a }) => /* @__PURE__ */ l.jsxs(it, { children: [
|
|
660
|
+
t && /* @__PURE__ */ l.jsx(lt, { children: /* @__PURE__ */ l.jsx(Oe, { side: a, className: r, ...s, children: t }) }),
|
|
661
|
+
/* @__PURE__ */ l.jsx(ct, { asChild: n, children: e })
|
|
662
|
+
] }), ut = [
|
|
1287
663
|
"pdf",
|
|
1288
664
|
"txt",
|
|
1289
665
|
"xml",
|
|
@@ -1297,7 +673,7 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1297
673
|
"odp",
|
|
1298
674
|
"ppt",
|
|
1299
675
|
"pptx"
|
|
1300
|
-
],
|
|
676
|
+
], dt = ["svg", "png", "jpg", "jpeg", "gif", "webp", "avif"], ft = ["mp4", "ogv", "webm"], mt = ["mp3", "ogg", "opus"], pt = {
|
|
1301
677
|
"application/xml": [".xml"],
|
|
1302
678
|
"text/plain": [".txt"],
|
|
1303
679
|
"application/pdf": [".pdf"],
|
|
@@ -1306,7 +682,7 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1306
682
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
1307
683
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
1308
684
|
"text/csv": [".csv"]
|
|
1309
|
-
},
|
|
685
|
+
}, gt = {
|
|
1310
686
|
"image/jpeg": [".jpeg", ".jpg"],
|
|
1311
687
|
"image/jpg": [".jpg"],
|
|
1312
688
|
"image/png": [".png"],
|
|
@@ -1315,35 +691,35 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1315
691
|
"image/svg+xml": [".svg"],
|
|
1316
692
|
"image/webp": [".webp"],
|
|
1317
693
|
"image/avif": [".avif"]
|
|
1318
|
-
},
|
|
694
|
+
}, vt = {
|
|
1319
695
|
"video/mp4": [".mp4"],
|
|
1320
696
|
"video/mpeg": [".mpeg"],
|
|
1321
697
|
"video/webm": [".webm"]
|
|
1322
|
-
},
|
|
698
|
+
}, bt = {
|
|
1323
699
|
"audio/mpeg": [".mp3"],
|
|
1324
700
|
"audio/ogg": [".oga"],
|
|
1325
701
|
"audio/opus": [".opus"]
|
|
1326
|
-
},
|
|
1327
|
-
audio:
|
|
1328
|
-
document:
|
|
1329
|
-
image:
|
|
1330
|
-
video:
|
|
1331
|
-
},
|
|
1332
|
-
audio:
|
|
1333
|
-
document:
|
|
1334
|
-
image:
|
|
1335
|
-
video:
|
|
1336
|
-
},
|
|
1337
|
-
...
|
|
1338
|
-
...
|
|
1339
|
-
...
|
|
1340
|
-
...
|
|
1341
|
-
],
|
|
1342
|
-
...
|
|
1343
|
-
...
|
|
1344
|
-
...
|
|
1345
|
-
...
|
|
1346
|
-
},
|
|
702
|
+
}, B = {
|
|
703
|
+
audio: bt,
|
|
704
|
+
document: pt,
|
|
705
|
+
image: gt,
|
|
706
|
+
video: vt
|
|
707
|
+
}, F = {
|
|
708
|
+
audio: mt,
|
|
709
|
+
document: ut,
|
|
710
|
+
image: dt,
|
|
711
|
+
video: ft
|
|
712
|
+
}, Xt = [
|
|
713
|
+
...F.audio,
|
|
714
|
+
...F.document,
|
|
715
|
+
...F.image,
|
|
716
|
+
...F.video
|
|
717
|
+
], qt = {
|
|
718
|
+
...B.audio,
|
|
719
|
+
...B.document,
|
|
720
|
+
...B.image,
|
|
721
|
+
...B.video
|
|
722
|
+
}, Te = R.createContext({
|
|
1347
723
|
urls: null,
|
|
1348
724
|
title: "",
|
|
1349
725
|
isLoading: !1,
|
|
@@ -1351,62 +727,62 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1351
727
|
},
|
|
1352
728
|
onError: () => {
|
|
1353
729
|
}
|
|
1354
|
-
}),
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
}).catch((
|
|
730
|
+
}), ht = ({ title: e, onSuccess: t, onError: r, children: n }) => {
|
|
731
|
+
const s = Q(), a = typeof window < "u" ? window.location.href : "", [u, i] = P(null), [m, v] = P(!1);
|
|
732
|
+
O(() => {
|
|
733
|
+
s.membership && (v(!0), s.membership?.getOAuthURL().then((d) => {
|
|
734
|
+
i(d);
|
|
735
|
+
}).catch((d) => {
|
|
1360
736
|
r({
|
|
1361
|
-
code:
|
|
1362
|
-
message:
|
|
737
|
+
code: d?.code || "SOMETHING_WENT_WRONG",
|
|
738
|
+
message: d?.message || "We could not connect with our service for your sign-in."
|
|
1363
739
|
});
|
|
1364
740
|
}).finally(() => {
|
|
1365
|
-
|
|
741
|
+
v(!1);
|
|
1366
742
|
}));
|
|
1367
743
|
}, []);
|
|
1368
|
-
const
|
|
1369
|
-
() => ({ title: e, urls:
|
|
1370
|
-
[e,
|
|
744
|
+
const h = fe(
|
|
745
|
+
() => ({ title: e, urls: u, isLoading: m, onSuccess: t, onError: r }),
|
|
746
|
+
[e, u, t, r, m]
|
|
1371
747
|
);
|
|
1372
|
-
return
|
|
1373
|
-
if (
|
|
1374
|
-
const
|
|
1375
|
-
for (const
|
|
748
|
+
return O(() => {
|
|
749
|
+
if (u && a) {
|
|
750
|
+
const d = {}, T = Object.keys(u);
|
|
751
|
+
for (const w of T)
|
|
1376
752
|
try {
|
|
1377
|
-
const
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1381
|
-
const
|
|
1382
|
-
|
|
753
|
+
const E = u[w];
|
|
754
|
+
if (E) {
|
|
755
|
+
const C = new URL(E), N = C.searchParams;
|
|
756
|
+
N.set("redirect_uri", a);
|
|
757
|
+
const L = s.pageContext;
|
|
758
|
+
L && N.set("page_context", JSON.stringify(L)), d[w] = C.toString();
|
|
1383
759
|
}
|
|
1384
760
|
} catch {
|
|
1385
761
|
}
|
|
1386
|
-
|
|
762
|
+
i(d);
|
|
1387
763
|
}
|
|
1388
|
-
}, [
|
|
1389
|
-
},
|
|
1390
|
-
const
|
|
764
|
+
}, [a]), /* @__PURE__ */ l.jsx(Te.Provider, { value: h, children: n });
|
|
765
|
+
}, xt = () => K(Te), wt = ({ url: e, title: t, height: r, width: n }) => {
|
|
766
|
+
const s = window.screenX + (window.outerWidth - n) / 2, a = window.screenY + (window.outerHeight - r) / 2.5;
|
|
1391
767
|
return window.open(
|
|
1392
768
|
e,
|
|
1393
769
|
t,
|
|
1394
|
-
`width=${n},height=${r},left=${
|
|
770
|
+
`width=${n},height=${r},left=${s},top=${a}`
|
|
1395
771
|
);
|
|
1396
|
-
},
|
|
772
|
+
}, yt = ({
|
|
1397
773
|
title: e = "",
|
|
1398
774
|
width: t = 500,
|
|
1399
775
|
height: r = 500,
|
|
1400
776
|
url: n,
|
|
1401
|
-
children:
|
|
1402
|
-
onCode:
|
|
1403
|
-
onClose:
|
|
777
|
+
children: s,
|
|
778
|
+
onCode: a,
|
|
779
|
+
onClose: u
|
|
1404
780
|
}) => {
|
|
1405
|
-
const [
|
|
1406
|
-
window.clearInterval(
|
|
1407
|
-
},
|
|
1408
|
-
|
|
1409
|
-
|
|
781
|
+
const [i, m] = P(), v = me(void 0), h = () => {
|
|
782
|
+
window.clearInterval(v.current);
|
|
783
|
+
}, d = () => {
|
|
784
|
+
m(
|
|
785
|
+
wt({
|
|
1410
786
|
url: n,
|
|
1411
787
|
title: e,
|
|
1412
788
|
width: t,
|
|
@@ -1414,107 +790,107 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1414
790
|
})
|
|
1415
791
|
);
|
|
1416
792
|
};
|
|
1417
|
-
return
|
|
793
|
+
return O(() => (i && (v.current = window.setInterval(() => {
|
|
1418
794
|
try {
|
|
1419
|
-
const
|
|
1420
|
-
if (!
|
|
795
|
+
const T = i.location.href, w = new URL(T).searchParams, E = w.get("code");
|
|
796
|
+
if (!E)
|
|
1421
797
|
return;
|
|
1422
|
-
|
|
798
|
+
a(E, w), h(), i.close();
|
|
1423
799
|
} catch {
|
|
1424
800
|
} finally {
|
|
1425
|
-
(!
|
|
801
|
+
(!i || i.closed) && (u(), h());
|
|
1426
802
|
}
|
|
1427
803
|
}, 700)), () => {
|
|
1428
|
-
|
|
1429
|
-
}), [
|
|
804
|
+
i && i.close(), u && u();
|
|
805
|
+
}), [i]), /* @__PURE__ */ l.jsx(
|
|
1430
806
|
"div",
|
|
1431
807
|
{
|
|
1432
808
|
onClick: () => {
|
|
1433
|
-
|
|
809
|
+
d();
|
|
1434
810
|
},
|
|
1435
|
-
children:
|
|
811
|
+
children: s
|
|
1436
812
|
}
|
|
1437
813
|
);
|
|
1438
|
-
},
|
|
814
|
+
}, Et = ({
|
|
1439
815
|
title: e = "Levo",
|
|
1440
816
|
url: t,
|
|
1441
817
|
children: r,
|
|
1442
818
|
onSuccess: n,
|
|
1443
|
-
onError:
|
|
1444
|
-
width:
|
|
1445
|
-
height:
|
|
819
|
+
onError: s,
|
|
820
|
+
width: a = 500,
|
|
821
|
+
height: u = 700
|
|
1446
822
|
}) => {
|
|
1447
|
-
const
|
|
1448
|
-
|
|
823
|
+
const i = X((m, v) => {
|
|
824
|
+
m.toLowerCase() === "success" ? n(v) : s(v);
|
|
1449
825
|
}, []);
|
|
1450
|
-
return /* @__PURE__ */
|
|
1451
|
-
|
|
826
|
+
return /* @__PURE__ */ l.jsx(
|
|
827
|
+
yt,
|
|
1452
828
|
{
|
|
1453
829
|
title: e,
|
|
1454
|
-
width:
|
|
1455
|
-
height:
|
|
830
|
+
width: a,
|
|
831
|
+
height: u,
|
|
1456
832
|
onClose: () => {
|
|
1457
833
|
},
|
|
1458
834
|
url: t,
|
|
1459
|
-
onCode:
|
|
835
|
+
onCode: i,
|
|
1460
836
|
children: r
|
|
1461
837
|
}
|
|
1462
838
|
);
|
|
1463
|
-
},
|
|
1464
|
-
const { title: r, urls: n, isLoading:
|
|
1465
|
-
return
|
|
1466
|
-
},
|
|
1467
|
-
const
|
|
839
|
+
}, jt = ({ children: e, provider: t }) => {
|
|
840
|
+
const { title: r, urls: n, isLoading: s, onSuccess: a, onError: u } = xt(), i = n?.[t];
|
|
841
|
+
return i ? /* @__PURE__ */ l.jsx(Et, { title: r, provider: t, url: i, onSuccess: a, onError: u, children: s ? /* @__PURE__ */ l.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ l.jsx(ot, { className: "h-5 w-5 bg-brand" }) }) : e }) : null;
|
|
842
|
+
}, Ot = ({ url: e, title: t, height: r, width: n }) => {
|
|
843
|
+
const s = window.screenX + (window.outerWidth - n) / 2, a = window.screenY + (window.outerHeight - r) / 2.5;
|
|
1468
844
|
return window.open(
|
|
1469
845
|
e,
|
|
1470
846
|
t,
|
|
1471
|
-
`width=${n},height=${r},left=${
|
|
847
|
+
`width=${n},height=${r},left=${s},top=${a}`
|
|
1472
848
|
);
|
|
1473
|
-
},
|
|
849
|
+
}, Kt = ({
|
|
1474
850
|
title: e = "Levo",
|
|
1475
851
|
width: t = 500,
|
|
1476
852
|
height: r = 700,
|
|
1477
853
|
onSuccess: n
|
|
1478
854
|
}) => {
|
|
1479
|
-
const
|
|
1480
|
-
window.clearInterval(
|
|
1481
|
-
},
|
|
1482
|
-
|
|
855
|
+
const s = Q(), [a, u] = P(!1), [i, m] = P(null), [v, h] = P(null), [d, T] = P(), w = me(void 0), E = () => {
|
|
856
|
+
window.clearInterval(w.current);
|
|
857
|
+
}, C = X((b, x) => {
|
|
858
|
+
b.toLowerCase() === "success" ? (h(null), n(x)) : h(x);
|
|
1483
859
|
}, []);
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
if (
|
|
1487
|
-
return
|
|
860
|
+
O(() => {
|
|
861
|
+
s.membership && (u(!0), s.membership?.getOAuthURL().then((b) => {
|
|
862
|
+
if (b)
|
|
863
|
+
return m(b), b;
|
|
1488
864
|
throw new Error();
|
|
1489
|
-
}).catch((
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1492
|
-
code:
|
|
1493
|
-
message:
|
|
865
|
+
}).catch((b) => {
|
|
866
|
+
const x = ge(b);
|
|
867
|
+
s.logger?.error("Failed to get OAuth URL", x.message), h({
|
|
868
|
+
code: x?.code || "SOMETHING_WENT_WRONG",
|
|
869
|
+
message: x?.message || "We could not connect with our service for your sign-in."
|
|
1494
870
|
});
|
|
1495
871
|
}).finally(() => {
|
|
1496
|
-
|
|
872
|
+
u(!1);
|
|
1497
873
|
}));
|
|
1498
|
-
}, []),
|
|
874
|
+
}, []), O(() => (d && (w.current = window.setInterval(() => {
|
|
1499
875
|
try {
|
|
1500
|
-
const
|
|
1501
|
-
if (
|
|
876
|
+
const b = d.location.href, x = new URL(b).searchParams, $ = x.get("code");
|
|
877
|
+
if (!$)
|
|
1502
878
|
return;
|
|
1503
|
-
|
|
879
|
+
C($, x), E(), d.close();
|
|
1504
880
|
} catch {
|
|
1505
881
|
} finally {
|
|
1506
|
-
(!
|
|
882
|
+
(!d || d.closed) && (E(), h(null));
|
|
1507
883
|
}
|
|
1508
884
|
}, 700)), () => {
|
|
1509
|
-
|
|
1510
|
-
}), [
|
|
1511
|
-
const
|
|
1512
|
-
(
|
|
1513
|
-
if (
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
url:
|
|
885
|
+
d && d.close();
|
|
886
|
+
}), [d]);
|
|
887
|
+
const N = X(
|
|
888
|
+
(b) => {
|
|
889
|
+
if (b && i !== null) {
|
|
890
|
+
const x = i?.[b];
|
|
891
|
+
x && (d && d.close(), T(
|
|
892
|
+
Ot({
|
|
893
|
+
url: x,
|
|
1518
894
|
title: e,
|
|
1519
895
|
width: t,
|
|
1520
896
|
height: r
|
|
@@ -1522,86 +898,86 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1522
898
|
));
|
|
1523
899
|
}
|
|
1524
900
|
},
|
|
1525
|
-
[
|
|
901
|
+
[i, d]
|
|
1526
902
|
);
|
|
1527
903
|
return {
|
|
1528
|
-
providers:
|
|
1529
|
-
(
|
|
1530
|
-
) : [], [
|
|
1531
|
-
isLoading:
|
|
1532
|
-
error:
|
|
1533
|
-
launchPopup:
|
|
904
|
+
providers: fe(() => i !== null ? Object.keys(i).filter(
|
|
905
|
+
(b) => !!i[b]
|
|
906
|
+
) : [], [i]),
|
|
907
|
+
isLoading: a,
|
|
908
|
+
error: v,
|
|
909
|
+
launchPopup: N
|
|
1534
910
|
};
|
|
1535
911
|
};
|
|
1536
|
-
class
|
|
1537
|
-
static Container =
|
|
1538
|
-
static Button =
|
|
912
|
+
class Zt {
|
|
913
|
+
static Container = ht;
|
|
914
|
+
static Button = jt;
|
|
1539
915
|
}
|
|
1540
|
-
const
|
|
916
|
+
const Qt = (e, t = 2) => {
|
|
1541
917
|
if (e === 0) return "0 B";
|
|
1542
|
-
const r = 1024, n = t < 0 ? 0 : t,
|
|
1543
|
-
return `${Number.parseFloat((e / r **
|
|
1544
|
-
},
|
|
1545
|
-
const t =
|
|
1546
|
-
return t?.code === "REQUEST_TIMEOUT" || t?.code === "NETWORK_ERROR" || t?.status === 408 || t?.status === 0 ||
|
|
918
|
+
const r = 1024, n = t < 0 ? 0 : t, s = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], a = Math.floor(Math.log(e) / Math.log(r));
|
|
919
|
+
return `${Number.parseFloat((e / r ** a).toFixed(n))} ${s[a]}`;
|
|
920
|
+
}, er = (e) => {
|
|
921
|
+
const t = ge(e);
|
|
922
|
+
return t?.code === "REQUEST_TIMEOUT" || t?.code === "NETWORK_ERROR" || t?.status === 408 || t?.status === 0 || rt(t?.message || "", t?.title || "Error", {
|
|
1547
923
|
id: `${t?.title || ""}-${t?.message || ""}`
|
|
1548
924
|
}), t;
|
|
1549
|
-
},
|
|
925
|
+
}, Tt = (e) => e instanceof Date, Rt = (e) => e == null, _t = (e) => typeof e == "object", Nt = (e) => !Rt(e) && !Array.isArray(e) && _t(e) && !Tt(e), tr = (e) => Nt(e) && !Object.keys(e).length;
|
|
1550
926
|
export {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
927
|
+
Ze as Button,
|
|
928
|
+
Qe as Dialog,
|
|
929
|
+
zt as DialogClose,
|
|
930
|
+
we as DialogContent,
|
|
931
|
+
je as DialogDescription,
|
|
932
|
+
tt as DialogFooter,
|
|
933
|
+
ye as DialogHeader,
|
|
934
|
+
xe as DialogOverlay,
|
|
935
|
+
et as DialogPortal,
|
|
936
|
+
Ee as DialogTitle,
|
|
937
|
+
Ft as DialogTrigger,
|
|
938
|
+
Ut as DialogWrapper,
|
|
939
|
+
Mt as LevoInsightsBlock,
|
|
940
|
+
Wt as LevoInsightsComponent,
|
|
941
|
+
Bt as LevoInsightsPage,
|
|
942
|
+
Zt as LevoOAuth,
|
|
943
|
+
$t as LevoProvider,
|
|
944
|
+
Jt as SimpleTooltipWrapper,
|
|
945
|
+
ot as Spinner,
|
|
946
|
+
Vt as Tabs,
|
|
947
|
+
at as TabsContent,
|
|
948
|
+
nt as TabsList,
|
|
949
|
+
st as TabsTrigger,
|
|
950
|
+
Yt as Toaster,
|
|
951
|
+
it as Tooltip,
|
|
952
|
+
Oe as TooltipContent,
|
|
953
|
+
lt as TooltipPortal,
|
|
954
|
+
Ht as TooltipProvider,
|
|
955
|
+
ct as TooltipTrigger,
|
|
956
|
+
Xt as allMediaFileExtensions,
|
|
957
|
+
qt as allMediaMimetypes,
|
|
958
|
+
mt as audioFileExtensions,
|
|
959
|
+
bt as audioMimetype,
|
|
960
|
+
Ke as buttonVariants,
|
|
961
|
+
Qt as byteToSize,
|
|
962
|
+
j as cn,
|
|
963
|
+
ut as documentFileExtensions,
|
|
964
|
+
pt as documentMimetype,
|
|
965
|
+
er as errorHandler,
|
|
966
|
+
rt as errorToast,
|
|
967
|
+
dt as imageFileExtensions,
|
|
968
|
+
gt as imageMimetype,
|
|
969
|
+
Tt as isDateObject,
|
|
970
|
+
tr as isEmptyObject,
|
|
971
|
+
Rt as isNullOrUndefined,
|
|
972
|
+
Nt as isObject,
|
|
973
|
+
_t as isObjectType,
|
|
974
|
+
F as mediaExtensionsByKind,
|
|
975
|
+
B as mediaMimetypeByKind,
|
|
976
|
+
Gt as successToast,
|
|
977
|
+
nr as toast,
|
|
978
|
+
Q as useLevo,
|
|
979
|
+
ee as useLevoInsights,
|
|
980
|
+
Kt as useLevoOAuth,
|
|
981
|
+
ft as videoFileExtensions,
|
|
982
|
+
vt as videoMimetype
|
|
1607
983
|
};
|