@levo-so/insights 0.1.76 → 0.1.78

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.
@@ -0,0 +1,110 @@
1
+ const B = () => new Promise((f, u) => {
2
+ let r = "Unknown";
3
+ function t(e) {
4
+ f({
5
+ isPrivate: e,
6
+ browserName: r
7
+ });
8
+ }
9
+ function d() {
10
+ const e = navigator.userAgent;
11
+ return e.match(/Chrome/) ? navigator.brave !== void 0 ? "Brave" : e.match(/Edg/) ? "Edge" : e.match(/OPR/) ? "Opera" : "Chrome" : "Chromium";
12
+ }
13
+ function i(e) {
14
+ return e === eval.toString().length;
15
+ }
16
+ function m() {
17
+ const e = navigator.vendor;
18
+ return e !== void 0 && e.indexOf("Apple") === 0 && i(37);
19
+ }
20
+ function l() {
21
+ const e = navigator.vendor;
22
+ return e !== void 0 && e.indexOf("Google") === 0 && i(33);
23
+ }
24
+ function v() {
25
+ return document.documentElement !== void 0 && document.documentElement.style.MozAppearance !== void 0 && i(37);
26
+ }
27
+ function g() {
28
+ return navigator.msSaveBlob !== void 0 && i(39);
29
+ }
30
+ function w() {
31
+ const e = String(Math.random());
32
+ try {
33
+ const n = window.indexedDB.open(e, 1);
34
+ n.onupgradeneeded = (o) => {
35
+ const a = o.target?.result;
36
+ try {
37
+ a.createObjectStore("test", {
38
+ autoIncrement: !0
39
+ }).put(new Blob()), t(!1);
40
+ } catch (s) {
41
+ let c = s;
42
+ if (s instanceof Error && (c = s.message ?? s), typeof c != "string")
43
+ return t(!1);
44
+ const I = /BlobURLs are not yet supported/.test(c);
45
+ return t(I);
46
+ } finally {
47
+ a.close(), window.indexedDB.deleteDatabase(e);
48
+ }
49
+ };
50
+ } catch {
51
+ return t(!1);
52
+ }
53
+ }
54
+ function p() {
55
+ const e = window.openDatabase, n = window.localStorage;
56
+ try {
57
+ e(null, null, null, null);
58
+ } catch {
59
+ return t(!0);
60
+ }
61
+ try {
62
+ n.setItem("test", "1"), n.removeItem("test");
63
+ } catch {
64
+ return t(!0);
65
+ }
66
+ return t(!1);
67
+ }
68
+ function h() {
69
+ navigator.maxTouchPoints !== void 0 ? w() : p();
70
+ }
71
+ function y() {
72
+ const e = window;
73
+ return e.performance !== void 0 && e.performance.memory !== void 0 && e.performance.memory.jsHeapSizeLimit !== void 0 ? performance.memory.jsHeapSizeLimit : 1073741824;
74
+ }
75
+ function S() {
76
+ navigator.webkitTemporaryStorage.queryUsageAndQuota(
77
+ (e, n) => {
78
+ const o = Math.round(n / 1048576), a = Math.round(y() / (1024 * 1024)) * 2;
79
+ t(o < a);
80
+ },
81
+ (e) => {
82
+ u(new Error(`detectIncognito somehow failed to query storage quota: ${e.message}`));
83
+ }
84
+ );
85
+ }
86
+ function b() {
87
+ const e = window.webkitRequestFileSystem;
88
+ e(0, 1, () => {
89
+ t(!1);
90
+ }, () => {
91
+ t(!0);
92
+ });
93
+ }
94
+ function x() {
95
+ self.Promise !== void 0 && self.Promise.allSettled !== void 0 ? S() : b();
96
+ }
97
+ function E() {
98
+ t(navigator.serviceWorker === void 0);
99
+ }
100
+ function P() {
101
+ t(window.indexedDB === void 0);
102
+ }
103
+ function T() {
104
+ m() ? (r = "Safari", h()) : l() ? (r = d(), x()) : v() ? (r = "Firefox", E()) : g() ? (r = "Internet Explorer", P()) : u(new Error("detectIncognito cannot determine the browser"));
105
+ }
106
+ T();
107
+ });
108
+ export {
109
+ B as default
110
+ };
@@ -0,0 +1,18 @@
1
+ const l = async (n, o) => {
2
+ let t = null;
3
+ try {
4
+ const e = new AbortController();
5
+ return t = setTimeout(() => e.abort(), o), (await fetch(n, {
6
+ method: "GET",
7
+ signal: e.signal,
8
+ credentials: "omit"
9
+ })).ok;
10
+ } catch {
11
+ return !1;
12
+ } finally {
13
+ t && clearTimeout(t);
14
+ }
15
+ };
16
+ export {
17
+ l as pingEndpoint
18
+ };
@@ -0,0 +1,13 @@
1
+ let C = [];
2
+ const E = (t, s, e) => {
3
+ const _ = C[C.length - 1];
4
+ if (_ && Math.abs(t - _.x) + Math.abs(s - _.y) < 30 && e - _.timestamp < 1e3) {
5
+ if (C.push({ x: t, y: s, timestamp: e }), C.length >= 3)
6
+ return !0;
7
+ } else
8
+ C = [{ x: t, y: s, timestamp: e }];
9
+ return !1;
10
+ };
11
+ export {
12
+ E as isRageClick
13
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levo-so/insights",
3
- "version": "0.1.76",
3
+ "version": "0.1.78",
4
4
  "author": "Levo Engineering <devs@theinternetfolks.com>",
5
5
  "description": "Levo analytics",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  "nanostores": "0.11.4"
22
22
  },
23
23
  "peerDependencies": {
24
- "@levo-so/core": "0.1.76"
24
+ "@levo-so/core": "0.1.78"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@playwright/test": "1.58.2",
@@ -29,6 +29,7 @@
29
29
  "typescript": "5.9.3",
30
30
  "vite": "7.2.4",
31
31
  "vite-plugin-dts": "4.1.0",
32
+ "vite-plugin-externalize-deps": "0.10.0",
32
33
  "@levo/ts-config": "0.0.0"
33
34
  },
34
35
  "main": "./dist/index.js",