@levo-so/react 0.1.60 → 0.1.62

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