@levo-so/react 0.1.82 → 0.1.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,613 +1,495 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as L, Fragment as J } from "react/jsx-runtime";
3
- import * as w from "react";
4
- import Q, { useContext as D, createContext as Z, useState as y, useEffect as h, useMemo as S, useRef as W, useCallback as j } from "react";
5
- import { BiLoaderAlt as U } from "react-icons/bi";
6
- import { clsx as q } from "clsx";
7
- import { twMerge as _ } from "tailwind-merge";
8
- import { Slot as ee, Dialog as p, Tabs as N, Tooltip as C } from "radix-ui";
9
- import { cva as te } from "class-variance-authority";
10
- import { X as oe } from "lucide-react";
11
- import { Toaster as ne, toast as B } from "sonner";
12
- import { toast as pt } from "sonner";
13
- import { getLevoError as z } from "@levo-so/core";
14
- const I = Z({
15
- client: null,
16
- insights: null
17
- }), Ke = ({ children: e, client: t, insights: o = null }) => /* @__PURE__ */ s(I.Provider, { value: { client: t, insights: o }, children: e }), $ = () => {
18
- const e = D(I);
19
- if (!e.client)
20
- throw new Error(
21
- "useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider."
22
- );
23
- return e.client;
24
- }, M = () => D(I).insights, Ve = ({ id: e, properties: t = {} }) => {
25
- const o = M(), [n, a] = y(!1);
26
- return h(() => {
27
- if (n || typeof o?.track != "function") return;
28
- const r = document.getElementById(e);
29
- if (!r) return;
30
- const c = () => {
31
- n || (o?.track("block.view", {
32
- ...t,
33
- resource: "block",
34
- identifier: e
35
- }), a(!0));
36
- }, i = new IntersectionObserver(
37
- (m) => {
38
- m.forEach((d) => {
39
- d.isIntersecting && (c(), i.disconnect());
40
- });
41
- },
42
- { threshold: 0 }
43
- );
44
- return i.observe(r), () => {
45
- i.disconnect();
46
- };
47
- }, [o, e, t, n]), null;
48
- }, Xe = ({ event: e, properties: t }) => {
49
- const o = M();
50
- return h(() => {
51
- o?.track(e, t);
52
- }, [o, e, t]), null;
53
- }, Ye = ({ id: e }) => {
54
- const t = $(), o = M();
55
- return h(() => {
56
- t && typeof window < "u" && (window.levo_client = t);
57
- }, [t]), h(() => {
58
- o && typeof window < "u" && (window.levo_insights = o);
59
- }, [o]), h(() => {
60
- o && e && o.init({
61
- pageId: e
62
- });
63
- }, [o, e]), null;
64
- }, g = (...e) => _(q(e)), se = te(
65
- "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",
66
- {
67
- variants: {
68
- variant: {
69
- default: "bg-primary text-primary-foreground hover:bg-primary/90",
70
- destructive: "bg-destructive text-white hover:bg-destructive/90",
71
- destructiveOutline: "border border-red-500 bg-transparent text-destructive shadow-sm hover:bg-destructive hover:text-white",
72
- outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
73
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
74
- secondaryOutline: "border border-white border-solid bg-transparent hover:border-input hover:bg-white",
75
- ghost: "hover:bg-accent hover:text-accent-foreground",
76
- link: "text-primary underline-offset-4 hover:underline"
77
- },
78
- size: {
79
- default: "h-10 px-4 py-2",
80
- xs: "h-8 px-3 text-xs",
81
- sm: "h-9 px-3",
82
- lg: "h-11 px-8",
83
- icon: "h-10 w-10",
84
- "icon-small": "h-8 w-8"
85
- },
86
- rounded: {
87
- small: "rounded",
88
- default: "rounded-md",
89
- large: "rounded-lg",
90
- full: "rounded-full"
91
- }
92
- },
93
- defaultVariants: {
94
- variant: "default",
95
- size: "default",
96
- rounded: "default"
97
- }
98
- }
99
- ), re = w.forwardRef(
100
- ({
101
- className: e,
102
- variant: t,
103
- size: o,
104
- rounded: n,
105
- asChild: a = !1,
106
- isLoading: r = !1,
107
- loadingText: c,
108
- disabled: i,
109
- ...m
110
- }, d) => {
111
- const v = a ? ee.Root : "button";
112
- return /* @__PURE__ */ s(
113
- v,
114
- {
115
- className: g(se({ variant: t, size: o, rounded: n, className: e })),
116
- ref: d,
117
- disabled: i || r,
118
- type: "button",
119
- ...m,
120
- children: r ? /* @__PURE__ */ L(J, { children: [
121
- /* @__PURE__ */ s(U, { className: _("h-4 w-4 animate-spin", c ? "mr-2" : "") }),
122
- c
123
- ] }) : m.children
124
- }
125
- );
126
- }
127
- );
128
- re.displayName = "Button";
129
- const ie = p.Root, Je = p.Trigger, ae = p.Portal, Qe = p.Close, F = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
130
- p.Overlay,
131
- {
132
- ref: o,
133
- className: g(
134
- "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",
135
- e
136
- ),
137
- ...t
138
- }
139
- ));
140
- F.displayName = p.Overlay.displayName;
141
- const H = w.forwardRef(({ className: e, children: t, container: o, hideCloseButton: n, overlayStyles: a, ...r }, c) => /* @__PURE__ */ s(ae, { container: o, children: /* @__PURE__ */ s(F, { className: a, children: /* @__PURE__ */ L(
142
- p.Content,
143
- {
144
- ref: c,
145
- className: g(
146
- "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",
147
- e
148
- ),
149
- ...r,
150
- children: [
151
- t,
152
- !n && /* @__PURE__ */ L(
153
- p.Close,
154
- {
155
- type: "button",
156
- 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",
157
- children: [
158
- /* @__PURE__ */ s(oe, { className: "h-4 w-4" }),
159
- /* @__PURE__ */ s("span", { className: "sr-only", children: "Close" })
160
- ]
161
- }
162
- )
163
- ]
164
- }
165
- ) }) }));
166
- H.displayName = p.Content.displayName;
167
- const G = ({ className: e, ...t }) => /* @__PURE__ */ s("div", { className: g("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
168
- G.displayName = "DialogHeader";
169
- const ce = ({ className: e, ...t }) => /* @__PURE__ */ s(
170
- "div",
171
- {
172
- className: g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
173
- ...t
174
- }
175
- );
176
- ce.displayName = "DialogFooter";
177
- const K = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
178
- p.Title,
179
- {
180
- ref: o,
181
- className: g("font-semibold text-lg leading-none tracking-tight", e),
182
- ...t
183
- }
184
- ));
185
- K.displayName = p.Title.displayName;
186
- const V = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
187
- p.Description,
188
- {
189
- ref: o,
190
- className: g("text-muted-foreground text-sm", e),
191
- ...t
192
- }
193
- ));
194
- V.displayName = p.Description.displayName;
195
- const Ze = ({
196
- isOpen: e,
197
- onClose: t,
198
- children: o,
199
- title: n,
200
- description: a = "",
201
- contentClassName: r,
202
- modal: c = !0
203
- }) => /* @__PURE__ */ s(ie, { open: e, onOpenChange: t, modal: c, children: /* @__PURE__ */ L(H, { className: r, children: [
204
- n && /* @__PURE__ */ L(G, { className: "flex-1 font-medium", children: [
205
- /* @__PURE__ */ s(K, { children: n }),
206
- /* @__PURE__ */ s(V, { children: a })
207
- ] }),
208
- /* @__PURE__ */ s("div", { className: "w-full", children: o })
209
- ] }) }), qe = ({ ...e }) => /* @__PURE__ */ s(
210
- ne,
211
- {
212
- closeButton: !0,
213
- richColors: !0,
214
- className: "toaster group",
215
- toastOptions: {
216
- classNames: {
217
- toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
218
- description: "group-[.toast]:text-muted-foreground",
219
- actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
220
- cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
221
- }
222
- },
223
- ...e
224
- }
225
- ), le = (e, t = "Error", o = {}) => {
226
- B.error(t, {
227
- description: e,
228
- duration: 4e3,
229
- position: "bottom-right",
230
- ...o
231
- });
232
- }, et = (e, t = "Success", o = {}) => {
233
- o?.id && B.dismiss(o?.id), B.success(t, {
234
- description: e,
235
- duration: 4e3,
236
- position: "bottom-right",
237
- ...o
238
- });
239
- }, de = ({ className: e }) => /* @__PURE__ */ s(U, { className: g("h-8 w-8 animate-spin font-light", e) }), tt = N.Root, ue = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
240
- N.List,
241
- {
242
- ref: o,
243
- className: g(
244
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
245
- e
246
- ),
247
- ...t
248
- }
249
- ));
250
- ue.displayName = N.List.displayName;
251
- const me = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
252
- N.Trigger,
253
- {
254
- ref: o,
255
- className: g(
256
- "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",
257
- e
258
- ),
259
- "data-levo-studio-interactive": "true",
260
- ...t
261
- }
262
- ));
263
- me.displayName = N.Trigger.displayName;
264
- const pe = w.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ s(
265
- N.Content,
266
- {
267
- ref: o,
268
- className: g(
269
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
270
- e
271
- ),
272
- ...t
273
- }
274
- ));
275
- pe.displayName = N.Content.displayName;
276
- const ot = C.Provider, fe = C.Root, ge = C.Trigger, ve = C.Portal, X = w.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__PURE__ */ s(
277
- C.Content,
278
- {
279
- ref: n,
280
- sideOffset: t,
281
- className: g(
282
- "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",
283
- e
284
- ),
285
- ...o
286
- }
287
- ));
288
- X.displayName = C.Content.displayName;
289
- const nt = ({ children: e, label: t, labelClassName: o, asChild: n = !0, contentProps: a = {}, side: r }) => /* @__PURE__ */ L(fe, { children: [
290
- t && /* @__PURE__ */ s(ve, { children: /* @__PURE__ */ s(X, { side: r, className: o, ...a, children: t }) }),
291
- /* @__PURE__ */ s(ge, { asChild: n, children: e })
292
- ] }), he = [
293
- "pdf",
294
- "txt",
295
- "xml",
296
- "xls",
297
- "xlsx",
298
- "ods",
299
- "odt",
300
- "doc",
301
- "docx",
302
- "csv",
303
- "odp",
304
- "ppt",
305
- "pptx"
306
- ], be = ["svg", "png", "jpg", "jpeg", "gif", "webp", "avif"], we = ["mp4", "ogv", "webm"], xe = ["mp3", "ogg", "opus"], ye = {
307
- "application/xml": [".xml"],
308
- "text/plain": [".txt"],
309
- "application/pdf": [".pdf"],
310
- "application/msword": [".doc"],
311
- "application/vnd.ms-excel": [".xls"],
312
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
313
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
314
- "text/csv": [".csv"]
315
- }, Ne = {
316
- "image/jpeg": [".jpeg", ".jpg"],
317
- "image/jpg": [".jpg"],
318
- "image/png": [".png"],
319
- "image/gif": [".gif"],
320
- "image/svg": [".svg"],
321
- "image/svg+xml": [".svg"],
322
- "image/webp": [".webp"],
323
- "image/avif": [".avif"]
324
- }, Te = {
325
- "video/mp4": [".mp4"],
326
- "video/mpeg": [".mpeg"],
327
- "video/webm": [".webm"]
328
- }, Le = {
329
- "audio/mpeg": [".mp3"],
330
- "audio/ogg": [".oga"],
331
- "audio/opus": [".opus"]
332
- }, k = {
333
- audio: Le,
334
- document: ye,
335
- image: Ne,
336
- video: Te
337
- }, E = {
338
- audio: xe,
339
- document: he,
340
- image: be,
341
- video: we
342
- }, st = [
343
- ...E.audio,
344
- ...E.document,
345
- ...E.image,
346
- ...E.video
347
- ], rt = {
348
- ...k.audio,
349
- ...k.document,
350
- ...k.image,
351
- ...k.video
352
- }, Y = Q.createContext({
353
- urls: null,
354
- title: "",
355
- isLoading: !1,
356
- onSuccess: () => {
357
- },
358
- onError: () => {
359
- }
360
- }), Ce = ({ title: e, onSuccess: t, onError: o, children: n }) => {
361
- const a = $(), r = typeof window < "u" ? window.location.href : "", [c, i] = y(null), [m, d] = y(!1);
362
- h(() => {
363
- a.membership && (d(!0), a.membership?.getOAuthURL().then((l) => {
364
- i(l);
365
- }).catch((l) => {
366
- o({
367
- code: l?.code || "SOMETHING_WENT_WRONG",
368
- message: l?.message || "We could not connect with our service for your sign-in."
369
- });
370
- }).finally(() => {
371
- d(!1);
372
- }));
373
- }, []);
374
- const v = S(
375
- () => ({ title: e, urls: c, isLoading: m, onSuccess: t, onError: o }),
376
- [e, c, t, o, m]
377
- );
378
- return h(() => {
379
- if (c && r) {
380
- const l = {}, T = Object.keys(c);
381
- for (const x of T)
382
- try {
383
- const b = c[x];
384
- if (b) {
385
- const O = new URL(b), R = O.searchParams;
386
- R.set("redirect_uri", r);
387
- const P = a.pageContext;
388
- P && R.set("page_context", JSON.stringify(P)), l[x] = O.toString();
389
- }
390
- } catch {
391
- }
392
- i(l);
393
- }
394
- }, [r]), /* @__PURE__ */ s(Y.Provider, { value: v, children: n });
395
- }, Oe = () => D(Y), Re = ({ url: e, title: t, height: o, width: n }) => {
396
- const a = window.screenX + (window.outerWidth - n) / 2, r = window.screenY + (window.outerHeight - o) / 2.5;
397
- return window.open(
398
- e,
399
- t,
400
- `width=${n},height=${o},left=${a},top=${r}`
401
- );
402
- }, ke = ({
403
- title: e = "",
404
- width: t = 500,
405
- height: o = 500,
406
- url: n,
407
- children: a,
408
- onCode: r,
409
- onClose: c
410
- }) => {
411
- const [i, m] = y(), d = W(void 0), v = () => {
412
- window.clearInterval(d.current);
413
- }, l = () => {
414
- m(
415
- Re({
416
- url: n,
417
- title: e,
418
- width: t,
419
- height: o
420
- })
421
- );
422
- };
423
- return h(() => (i && (d.current = window.setInterval(() => {
424
- try {
425
- const T = i.location.href, x = new URL(T).searchParams, b = x.get("code");
426
- if (!b)
427
- return;
428
- r(b, x), v(), i.close();
429
- } catch {
430
- } finally {
431
- (!i || i.closed) && (c(), v());
432
- }
433
- }, 700)), () => {
434
- i && i.close(), c && c();
435
- }), [i]), /* @__PURE__ */ s(
436
- "div",
437
- {
438
- onClick: () => {
439
- l();
440
- },
441
- children: a
442
- }
443
- );
444
- }, Ee = ({
445
- title: e = "Levo",
446
- url: t,
447
- children: o,
448
- onSuccess: n,
449
- onError: a,
450
- width: r = 500,
451
- height: c = 700
452
- }) => {
453
- const i = j((m, d) => {
454
- m.toLowerCase() === "success" ? n(d) : a(d);
455
- }, []);
456
- return /* @__PURE__ */ s(
457
- ke,
458
- {
459
- title: e,
460
- width: r,
461
- height: c,
462
- onClose: () => {
463
- },
464
- url: t,
465
- onCode: i,
466
- children: o
467
- }
468
- );
469
- }, Pe = ({ children: e, provider: t }) => {
470
- const { title: o, urls: n, isLoading: a, onSuccess: r, onError: c } = Oe(), i = n?.[t];
471
- return i ? /* @__PURE__ */ s(Ee, { title: o, provider: t, url: i, onSuccess: r, onError: c, children: a ? /* @__PURE__ */ s("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ s(de, { className: "h-5 w-5 bg-brand" }) }) : e }) : null;
472
- }, je = ({ url: e, title: t, height: o, width: n }) => {
473
- const a = window.screenX + (window.outerWidth - n) / 2, r = window.screenY + (window.outerHeight - o) / 2.5;
474
- return window.open(
475
- e,
476
- t,
477
- `width=${n},height=${o},left=${a},top=${r}`
478
- );
479
- }, it = ({
480
- title: e = "Levo",
481
- width: t = 500,
482
- height: o = 700,
483
- onSuccess: n
484
- }) => {
485
- const a = $(), [r, c] = y(!1), [i, m] = y(null), [d, v] = y(null), [l, T] = y(), x = W(void 0), b = () => {
486
- window.clearInterval(x.current);
487
- }, O = j((u, f) => {
488
- u.toLowerCase() === "success" ? (v(null), n(f)) : v(f);
489
- }, []);
490
- h(() => {
491
- a.membership && (c(!0), a.membership?.getOAuthURL().then((u) => {
492
- if (u)
493
- return m(u), u;
494
- throw new Error();
495
- }).catch((u) => {
496
- const f = z(u);
497
- a.logger?.error("Failed to get OAuth URL", f.message), v({
498
- code: f?.code || "SOMETHING_WENT_WRONG",
499
- message: f?.message || "We could not connect with our service for your sign-in."
500
- });
501
- }).finally(() => {
502
- c(!1);
503
- }));
504
- }, []), h(() => (l && (x.current = window.setInterval(() => {
505
- try {
506
- const u = l.location.href, f = new URL(u).searchParams, A = f.get("code");
507
- if (!A)
508
- return;
509
- O(A, f), b(), l.close();
510
- } catch {
511
- } finally {
512
- (!l || l.closed) && (b(), v(null));
513
- }
514
- }, 700)), () => {
515
- l && l.close();
516
- }), [l]);
517
- const R = j(
518
- (u) => {
519
- if (u && i !== null) {
520
- const f = i?.[u];
521
- f && (l && l.close(), T(
522
- je({
523
- url: f,
524
- title: e,
525
- width: t,
526
- height: o
527
- })
528
- ));
529
- }
530
- },
531
- [i, l]
532
- );
533
- return {
534
- providers: S(() => i !== null ? Object.keys(i).filter(
535
- (u) => !!i[u]
536
- ) : [], [i]),
537
- isLoading: r,
538
- error: d,
539
- launchPopup: R
540
- };
541
- };
542
- class at {
543
- static Container = Ce;
544
- static Button = Pe;
545
- }
546
- const ct = (e, t = 2) => {
547
- if (e === 0) return "0 B";
548
- const o = 1024, n = t < 0 ? 0 : t, a = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], r = Math.floor(Math.log(e) / Math.log(o));
549
- return `${Number.parseFloat((e / o ** r).toFixed(n))} ${a[r]}`;
550
- }, lt = (e) => {
551
- const t = z(e);
552
- return t?.code === "REQUEST_TIMEOUT" || t?.code === "NETWORK_ERROR" || t?.status === 408 || t?.status === 0 || le(t?.message || "", t?.title || "Error", {
553
- id: `${t?.title || ""}-${t?.message || ""}`
554
- }), t;
555
- }, Be = (e) => e instanceof Date, De = (e) => e == null, Ie = (e) => typeof e == "object", $e = (e) => !De(e) && !Array.isArray(e) && Ie(e) && !Be(e), dt = (e) => $e(e) && !Object.keys(e).length;
556
- export {
557
- re as Button,
558
- ie as Dialog,
559
- Qe as DialogClose,
560
- H as DialogContent,
561
- V as DialogDescription,
562
- ce as DialogFooter,
563
- G as DialogHeader,
564
- F as DialogOverlay,
565
- ae as DialogPortal,
566
- K as DialogTitle,
567
- Je as DialogTrigger,
568
- Ze as DialogWrapper,
569
- Ve as LevoInsightsBlock,
570
- Xe as LevoInsightsComponent,
571
- Ye as LevoInsightsPage,
572
- at as LevoOAuth,
573
- Ke as LevoProvider,
574
- nt as SimpleTooltipWrapper,
575
- de as Spinner,
576
- tt as Tabs,
577
- pe as TabsContent,
578
- ue as TabsList,
579
- me as TabsTrigger,
580
- qe as Toaster,
581
- fe as Tooltip,
582
- X as TooltipContent,
583
- ve as TooltipPortal,
584
- ot as TooltipProvider,
585
- ge as TooltipTrigger,
586
- st as allMediaFileExtensions,
587
- rt as allMediaMimetypes,
588
- xe as audioFileExtensions,
589
- Le as audioMimetype,
590
- se as buttonVariants,
591
- ct as byteToSize,
592
- g as cn,
593
- he as documentFileExtensions,
594
- ye as documentMimetype,
595
- lt as errorHandler,
596
- le as errorToast,
597
- be as imageFileExtensions,
598
- Ne as imageMimetype,
599
- Be as isDateObject,
600
- dt as isEmptyObject,
601
- De as isNullOrUndefined,
602
- $e as isObject,
603
- Ie as isObjectType,
604
- E as mediaExtensionsByKind,
605
- k as mediaMimetypeByKind,
606
- et as successToast,
607
- pt as toast,
608
- $ as useLevo,
609
- M as useLevoInsights,
610
- it as useLevoOAuth,
611
- we as videoFileExtensions,
612
- Te as videoMimetype
613
- };
2
+ import { getLevoError as e } from "@levo-so/core";
3
+ import * as t from "react";
4
+ import n, { createContext as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
5
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
6
+ import { Dialog as p, Slot as m, Tabs as h, Tooltip as g } from "radix-ui";
7
+ import { BiLoaderAlt as _ } from "react-icons/bi";
8
+ import { twMerge as v } from "tailwind-merge";
9
+ import { clsx as y } from "clsx";
10
+ import { cva as b } from "class-variance-authority";
11
+ import { X as x } from "lucide-react";
12
+ import { Toaster as S, toast as C } from "sonner";
13
+ //#region src/providers/LevoProvider.tsx
14
+ var w = r({
15
+ client: null,
16
+ insights: null
17
+ }), ee = ({ children: e, client: t, insights: n = null }) => /* @__PURE__ */ d(w.Provider, {
18
+ value: {
19
+ client: t,
20
+ insights: n
21
+ },
22
+ children: e
23
+ }), T = () => {
24
+ let e = a(w);
25
+ if (!e.client) throw Error("useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider.");
26
+ return e.client;
27
+ }, E = () => a(w).insights, te = ({ id: t, properties: n = {} }) => {
28
+ let { logger: r } = T(), i = E(), a = c(!1), s = c(n);
29
+ return s.current = n, o(() => {
30
+ if (a.current || typeof i?.track != "function") return;
31
+ let n = document.getElementById(t);
32
+ if (!n) return;
33
+ let o = new IntersectionObserver((n) => {
34
+ for (let c of n) if (c.isIntersecting && !a.current) try {
35
+ i.track("block.view", {
36
+ ...s.current,
37
+ resource: "block",
38
+ identifier: t
39
+ }), a.current = !0, o.disconnect();
40
+ } catch (t) {
41
+ r?.error("[LevoAudienceBlock] track failed", e(t));
42
+ }
43
+ }, { threshold: 0 });
44
+ return o.observe(n), () => o.disconnect();
45
+ }, [
46
+ i,
47
+ t,
48
+ r
49
+ ]), null;
50
+ }, ne = ({ event: t, properties: n }) => {
51
+ let { logger: r } = T(), i = E(), a = c(!1), s = c(t);
52
+ s.current = t;
53
+ let l = c(n);
54
+ return l.current = n, o(() => {
55
+ if (!(a.current || !i)) try {
56
+ i.track(s.current, l.current), a.current = !0;
57
+ } catch (t) {
58
+ r?.error("[LevoAudienceComponent] track failed", e(t));
59
+ }
60
+ }, [i, r]), null;
61
+ }, re = ({ id: e }) => {
62
+ let t = T(), n = E();
63
+ return o(() => {
64
+ t && typeof window < "u" && (window.levo_client = t);
65
+ }, [t]), o(() => {
66
+ n && typeof window < "u" && (window.levo_insights = n);
67
+ }, [n]), o(() => {
68
+ n && n.init({ pageId: e });
69
+ }, [n, e]), null;
70
+ }, D = (...e) => v(y(e)), O = b("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", {
71
+ variants: {
72
+ variant: {
73
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
74
+ destructive: "bg-destructive text-white hover:bg-destructive/90",
75
+ destructiveOutline: "border border-red-500 bg-transparent text-destructive shadow-sm hover:bg-destructive hover:text-white",
76
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
77
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
78
+ secondaryOutline: "border border-white border-solid bg-transparent hover:border-input hover:bg-white",
79
+ ghost: "hover:bg-accent hover:text-accent-foreground",
80
+ link: "text-primary underline-offset-4 hover:underline"
81
+ },
82
+ size: {
83
+ default: "h-10 px-4 py-2",
84
+ xs: "h-8 px-3 text-xs",
85
+ sm: "h-9 px-3",
86
+ lg: "h-11 px-8",
87
+ icon: "h-10 w-10",
88
+ "icon-small": "h-8 w-8"
89
+ },
90
+ rounded: {
91
+ small: "rounded",
92
+ default: "rounded-md",
93
+ large: "rounded-lg",
94
+ full: "rounded-full"
95
+ }
96
+ },
97
+ defaultVariants: {
98
+ variant: "default",
99
+ size: "default",
100
+ rounded: "default"
101
+ }
102
+ }), ie = t.forwardRef(({ className: e, variant: t, size: n, rounded: r, asChild: i = !1, isLoading: a = !1, loadingText: o, disabled: s, ...c }, l) => /* @__PURE__ */ d(i ? m.Root : "button", {
103
+ className: D(O({
104
+ variant: t,
105
+ size: n,
106
+ rounded: r,
107
+ className: e
108
+ })),
109
+ ref: l,
110
+ disabled: s || a,
111
+ type: "button",
112
+ ...c,
113
+ children: a ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(_, { className: v("h-4 w-4 animate-spin", o ? "mr-2" : "") }), o] }) : c.children
114
+ }));
115
+ ie.displayName = "Button";
116
+ //#endregion
117
+ //#region src/components/Dialog.tsx
118
+ var ae = p.Root, oe = p.Trigger, k = p.Portal, se = p.Close, A = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(p.Overlay, {
119
+ ref: n,
120
+ className: D("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", e),
121
+ ...t
122
+ }));
123
+ A.displayName = p.Overlay.displayName;
124
+ var j = t.forwardRef(({ className: e, children: t, container: n, hideCloseButton: r, overlayStyles: i, ...a }, o) => /* @__PURE__ */ d(k, {
125
+ container: n,
126
+ children: /* @__PURE__ */ d(A, {
127
+ className: i,
128
+ children: /* @__PURE__ */ f(p.Content, {
129
+ ref: o,
130
+ className: D("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", e),
131
+ ...a,
132
+ children: [t, !r && /* @__PURE__ */ f(p.Close, {
133
+ type: "button",
134
+ 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",
135
+ children: [/* @__PURE__ */ d(x, { className: "h-4 w-4" }), /* @__PURE__ */ d("span", {
136
+ className: "sr-only",
137
+ children: "Close"
138
+ })]
139
+ })]
140
+ })
141
+ })
142
+ }));
143
+ j.displayName = p.Content.displayName;
144
+ var M = ({ className: e, ...t }) => /* @__PURE__ */ d("div", {
145
+ className: D("flex flex-col space-y-1.5 text-center sm:text-left", e),
146
+ ...t
147
+ });
148
+ M.displayName = "DialogHeader";
149
+ var N = ({ className: e, ...t }) => /* @__PURE__ */ d("div", {
150
+ className: D("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
151
+ ...t
152
+ });
153
+ N.displayName = "DialogFooter";
154
+ var P = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(p.Title, {
155
+ ref: n,
156
+ className: D("font-semibold text-lg leading-none tracking-tight", e),
157
+ ...t
158
+ }));
159
+ P.displayName = p.Title.displayName;
160
+ var F = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(p.Description, {
161
+ ref: n,
162
+ className: D("text-muted-foreground text-sm", e),
163
+ ...t
164
+ }));
165
+ F.displayName = p.Description.displayName;
166
+ //#endregion
167
+ //#region src/components/DialogWrapper.tsx
168
+ var ce = ({ isOpen: e, onClose: t, children: n, title: r, description: i = "", contentClassName: a, modal: o = !0 }) => /* @__PURE__ */ d(ae, {
169
+ open: e,
170
+ onOpenChange: t,
171
+ modal: o,
172
+ children: /* @__PURE__ */ f(j, {
173
+ className: a,
174
+ children: [r && /* @__PURE__ */ f(M, {
175
+ className: "flex-1 font-medium",
176
+ children: [/* @__PURE__ */ d(P, { children: r }), /* @__PURE__ */ d(F, { children: i })]
177
+ }), /* @__PURE__ */ d("div", {
178
+ className: "w-full",
179
+ children: n
180
+ })]
181
+ })
182
+ }), le = ({ ...e }) => /* @__PURE__ */ d(S, {
183
+ closeButton: !0,
184
+ richColors: !0,
185
+ className: "toaster group",
186
+ toastOptions: { classNames: {
187
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
188
+ description: "group-[.toast]:text-muted-foreground",
189
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
190
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
191
+ } },
192
+ ...e
193
+ }), I = (e, t = "Error", n = {}) => {
194
+ C.error(t, {
195
+ description: e,
196
+ duration: 4e3,
197
+ position: "bottom-right",
198
+ ...n
199
+ });
200
+ }, ue = (e, t = "Success", n = {}) => {
201
+ n?.id && C.dismiss(n?.id), C.success(t, {
202
+ description: e,
203
+ duration: 4e3,
204
+ position: "bottom-right",
205
+ ...n
206
+ });
207
+ }, L = ({ className: e }) => /* @__PURE__ */ d(_, { className: D("h-8 w-8 animate-spin font-light", e) }), de = h.Root, R = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(h.List, {
208
+ ref: n,
209
+ className: D("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", e),
210
+ ...t
211
+ }));
212
+ R.displayName = h.List.displayName;
213
+ var z = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(h.Trigger, {
214
+ ref: n,
215
+ className: D("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", e),
216
+ "data-levo-studio-interactive": "true",
217
+ ...t
218
+ }));
219
+ z.displayName = h.Trigger.displayName;
220
+ var B = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d(h.Content, {
221
+ ref: n,
222
+ className: D("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", e),
223
+ ...t
224
+ }));
225
+ B.displayName = h.Content.displayName;
226
+ //#endregion
227
+ //#region src/components/Tooltip.tsx
228
+ var fe = g.Provider, V = g.Root, H = g.Trigger, U = g.Portal, W = t.forwardRef(({ className: e, sideOffset: t = 4, ...n }, r) => /* @__PURE__ */ d(g.Content, {
229
+ ref: r,
230
+ sideOffset: t,
231
+ className: D("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", e),
232
+ ...n
233
+ }));
234
+ W.displayName = g.Content.displayName;
235
+ var pe = ({ children: e, label: t, labelClassName: n, asChild: r = !0, contentProps: i = {}, side: a }) => /* @__PURE__ */ f(V, { children: [t && /* @__PURE__ */ d(U, { children: /* @__PURE__ */ d(W, {
236
+ side: a,
237
+ className: n,
238
+ ...i,
239
+ children: t
240
+ }) }), /* @__PURE__ */ d(H, {
241
+ asChild: r,
242
+ children: e
243
+ })] }), G = [
244
+ "pdf",
245
+ "txt",
246
+ "xml",
247
+ "xls",
248
+ "xlsx",
249
+ "ods",
250
+ "odt",
251
+ "doc",
252
+ "docx",
253
+ "csv",
254
+ "odp",
255
+ "ppt",
256
+ "pptx"
257
+ ], K = [
258
+ "svg",
259
+ "png",
260
+ "jpg",
261
+ "jpeg",
262
+ "gif",
263
+ "webp",
264
+ "avif"
265
+ ], q = [
266
+ "mp4",
267
+ "ogv",
268
+ "webm"
269
+ ], J = [
270
+ "mp3",
271
+ "ogg",
272
+ "opus"
273
+ ], Y = {
274
+ "application/xml": [".xml"],
275
+ "text/plain": [".txt"],
276
+ "application/pdf": [".pdf"],
277
+ "application/msword": [".doc"],
278
+ "application/vnd.ms-excel": [".xls"],
279
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
280
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
281
+ "text/csv": [".csv"]
282
+ }, X = {
283
+ "image/jpeg": [".jpeg", ".jpg"],
284
+ "image/jpg": [".jpg"],
285
+ "image/png": [".png"],
286
+ "image/gif": [".gif"],
287
+ "image/svg": [".svg"],
288
+ "image/svg+xml": [".svg"],
289
+ "image/webp": [".webp"],
290
+ "image/avif": [".avif"]
291
+ }, Z = {
292
+ "video/mp4": [".mp4"],
293
+ "video/mpeg": [".mpeg"],
294
+ "video/webm": [".webm"]
295
+ }, me = {
296
+ "audio/mpeg": [".mp3"],
297
+ "audio/ogg": [".oga"],
298
+ "audio/opus": [".opus"]
299
+ }, Q = {
300
+ audio: me,
301
+ document: Y,
302
+ image: X,
303
+ video: Z
304
+ }, $ = {
305
+ audio: J,
306
+ document: G,
307
+ image: K,
308
+ video: q
309
+ }, he = [
310
+ ...$.audio,
311
+ ...$.document,
312
+ ...$.image,
313
+ ...$.video
314
+ ], ge = {
315
+ ...Q.audio,
316
+ ...Q.document,
317
+ ...Q.image,
318
+ ...Q.video
319
+ }, _e = n.createContext({
320
+ urls: null,
321
+ title: "",
322
+ isLoading: !1,
323
+ onSuccess: () => {},
324
+ onError: () => {}
325
+ }), ve = ({ title: e, onSuccess: t, onError: n, children: r }) => {
326
+ let i = T(), a = typeof window < "u" ? window.location.href : "", [c, u] = l(null), [f, p] = l(!1);
327
+ o(() => {
328
+ i.membership && (p(!0), i.membership?.getOAuthURL().then((e) => {
329
+ u(e);
330
+ }).catch((e) => {
331
+ n({
332
+ code: e?.code || "SOMETHING_WENT_WRONG",
333
+ message: e?.message || "We could not connect with our service for your sign-in."
334
+ });
335
+ }).finally(() => {
336
+ p(!1);
337
+ }));
338
+ }, []);
339
+ let m = s(() => ({
340
+ title: e,
341
+ urls: c,
342
+ isLoading: f,
343
+ onSuccess: t,
344
+ onError: n
345
+ }), [
346
+ e,
347
+ c,
348
+ t,
349
+ n,
350
+ f
351
+ ]);
352
+ return o(() => {
353
+ if (c && a) {
354
+ let e = {}, t = Object.keys(c);
355
+ for (let n of t) try {
356
+ let t = c[n];
357
+ if (t) {
358
+ let r = new URL(t), o = r.searchParams;
359
+ o.set("redirect_uri", a);
360
+ let s = i.pageContext;
361
+ s && o.set("page_context", JSON.stringify(s)), e[n] = r.toString();
362
+ }
363
+ } catch {}
364
+ u(e);
365
+ }
366
+ }, [a]), /* @__PURE__ */ d(_e.Provider, {
367
+ value: m,
368
+ children: r
369
+ });
370
+ }, ye = () => a(_e), be = ({ url: e, title: t, height: n, width: r }) => {
371
+ let i = window.screenX + (window.outerWidth - r) / 2, a = window.screenY + (window.outerHeight - n) / 2.5;
372
+ return window.open(e, t, `width=${r},height=${n},left=${i},top=${a}`);
373
+ }, xe = ({ title: e = "", width: t = 500, height: n = 500, url: r, children: i, onCode: a, onClose: s }) => {
374
+ let [u, f] = l(), p = c(void 0), m = () => {
375
+ window.clearInterval(p.current);
376
+ }, h = () => {
377
+ f(be({
378
+ url: r,
379
+ title: e,
380
+ width: t,
381
+ height: n
382
+ }));
383
+ };
384
+ return o(() => (u && (p.current = window.setInterval(() => {
385
+ try {
386
+ let e = u.location.href, t = new URL(e).searchParams, n = t.get("code");
387
+ if (!n) return;
388
+ a(n, t), m(), u.close();
389
+ } catch {} finally {
390
+ (!u || u.closed) && (s(), m());
391
+ }
392
+ }, 700)), () => {
393
+ u && u.close(), s && s();
394
+ }), [u]), /* @__PURE__ */ d("div", {
395
+ onClick: () => {
396
+ h();
397
+ },
398
+ children: i
399
+ });
400
+ }, Se = ({ title: e = "Levo", url: t, children: n, onSuccess: r, onError: a, width: o = 500, height: s = 700 }) => /* @__PURE__ */ d(xe, {
401
+ title: e,
402
+ width: o,
403
+ height: s,
404
+ onClose: () => {},
405
+ url: t,
406
+ onCode: i((e, t) => {
407
+ e.toLowerCase() === "success" ? r(t) : a(t);
408
+ }, []),
409
+ children: n
410
+ }), Ce = ({ children: e, provider: t }) => {
411
+ let { title: n, urls: r, isLoading: i, onSuccess: a, onError: o } = ye(), s = r?.[t];
412
+ return s ? /* @__PURE__ */ d(Se, {
413
+ title: n,
414
+ provider: t,
415
+ url: s,
416
+ onSuccess: a,
417
+ onError: o,
418
+ children: i ? /* @__PURE__ */ d("div", {
419
+ className: "w-full items-center justify-center",
420
+ children: /* @__PURE__ */ d(L, { className: "h-5 w-5 bg-brand" })
421
+ }) : e
422
+ }) : null;
423
+ }, we = ({ url: e, title: t, height: n, width: r }) => {
424
+ let i = window.screenX + (window.outerWidth - r) / 2, a = window.screenY + (window.outerHeight - n) / 2.5;
425
+ return window.open(e, t, `width=${r},height=${n},left=${i},top=${a}`);
426
+ }, Te = ({ title: t = "Levo", width: n = 500, height: r = 700, onSuccess: a }) => {
427
+ let u = T(), [d, f] = l(!1), [p, m] = l(null), [h, g] = l(null), [_, v] = l(), y = c(void 0), b = () => {
428
+ window.clearInterval(y.current);
429
+ }, x = i((e, t) => {
430
+ e.toLowerCase() === "success" ? (g(null), a(t)) : g(t);
431
+ }, []);
432
+ o(() => {
433
+ u.membership && (f(!0), u.membership?.getOAuthURL().then((e) => {
434
+ if (e) return m(e), e;
435
+ throw Error();
436
+ }).catch((t) => {
437
+ let n = e(t);
438
+ u.logger?.error("Failed to get OAuth URL", n.message), g({
439
+ code: n?.code || "SOMETHING_WENT_WRONG",
440
+ message: n?.message || "We could not connect with our service for your sign-in."
441
+ });
442
+ }).finally(() => {
443
+ f(!1);
444
+ }));
445
+ }, []), o(() => (_ && (y.current = window.setInterval(() => {
446
+ try {
447
+ let e = _.location.href, t = new URL(e).searchParams, n = t.get("code");
448
+ if (!n) return;
449
+ x(n, t), b(), _.close();
450
+ } catch {} finally {
451
+ (!_ || _.closed) && (b(), g(null));
452
+ }
453
+ }, 700)), () => {
454
+ _ && _.close();
455
+ }), [_]);
456
+ let S = i((e) => {
457
+ if (e && p !== null) {
458
+ let i = p?.[e];
459
+ i && (_ && _.close(), v(we({
460
+ url: i,
461
+ title: t,
462
+ width: n,
463
+ height: r
464
+ })));
465
+ }
466
+ }, [p, _]);
467
+ return {
468
+ providers: s(() => p === null ? [] : Object.keys(p).filter((e) => !!p[e]), [p]),
469
+ isLoading: d,
470
+ error: h,
471
+ launchPopup: S
472
+ };
473
+ }, Ee = class {
474
+ static Container = ve;
475
+ static Button = Ce;
476
+ }, De = (e, t = 2) => {
477
+ if (e === 0) return "0 B";
478
+ let n = 1024, r = t < 0 ? 0 : t, i = [
479
+ "Bytes",
480
+ "KB",
481
+ "MB",
482
+ "GB",
483
+ "TB",
484
+ "PB",
485
+ "EB",
486
+ "ZB",
487
+ "YB"
488
+ ], a = Math.floor(Math.log(e) / Math.log(n));
489
+ return `${Number.parseFloat((e / n ** a).toFixed(r))} ${i[a]}`;
490
+ }, Oe = (t) => {
491
+ let n = e(t);
492
+ return n?.code === "REQUEST_TIMEOUT" || n?.code === "NETWORK_ERROR" || n?.status === 408 || n?.status === 0 || I(n?.message || "", n?.title || "Error", { id: `${n?.title || ""}-${n?.message || ""}` }), n;
493
+ }, ke = (e) => e instanceof Date, Ae = (e) => e == null, je = (e) => typeof e == "object", Me = (e) => !Ae(e) && !Array.isArray(e) && je(e) && !ke(e), Ne = (e) => Me(e) && !Object.keys(e).length;
494
+ //#endregion
495
+ export { ie as Button, ae as Dialog, se as DialogClose, j as DialogContent, F as DialogDescription, N as DialogFooter, M as DialogHeader, A as DialogOverlay, k as DialogPortal, P as DialogTitle, oe as DialogTrigger, ce as DialogWrapper, te as LevoInsightsBlock, ne as LevoInsightsComponent, re as LevoInsightsPage, Ee as LevoOAuth, ee as LevoProvider, pe as SimpleTooltipWrapper, L as Spinner, de as Tabs, B as TabsContent, R as TabsList, z as TabsTrigger, le as Toaster, V as Tooltip, W as TooltipContent, U as TooltipPortal, fe as TooltipProvider, H as TooltipTrigger, he as allMediaFileExtensions, ge as allMediaMimetypes, J as audioFileExtensions, me as audioMimetype, O as buttonVariants, De as byteToSize, D as cn, G as documentFileExtensions, Y as documentMimetype, Oe as errorHandler, I as errorToast, K as imageFileExtensions, X as imageMimetype, ke as isDateObject, Ne as isEmptyObject, Ae as isNullOrUndefined, Me as isObject, je as isObjectType, $ as mediaExtensionsByKind, Q as mediaMimetypeByKind, ue as successToast, C as toast, T as useLevo, E as useLevoInsights, Te as useLevoOAuth, q as videoFileExtensions, Z as videoMimetype };