@dwield/device-biometrics-sdk 1.2.2 → 1.3.1
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/README.md +335 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +3 -3
- package/dist/index.global.js +2 -2
- package/dist/index.global.js.map +3 -3
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
# 🌐 Dwield Device Intelligence & Behavioural Biometrics SDK
|
|
2
|
+
### Next-gen Device Intelligence · Behavioural Biometrics · Fraud Prevention
|
|
3
|
+
|
|
4
|
+
The **Dwield SDK** provides high-accuracy **device fingerprinting**, **behavioural biometrics**, and **combined identity intelligence**—all in a lightweight JavaScript package designed for modern web applications.
|
|
5
|
+
|
|
6
|
+
Whether you're building **fraud detection**, **bot defense**, **risk scoring**, or **continuous authentication**, Dwield gives you deep visibility into user behaviour & device environments with minimal integration effort.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## ✨ Key Capabilities
|
|
11
|
+
|
|
12
|
+
### 🖥️ Device Intelligence
|
|
13
|
+
Detect spoofing, automation, emulators, privacy modes, and high-risk environments.
|
|
14
|
+
|
|
15
|
+
Includes:
|
|
16
|
+
- Browser & OS attributes
|
|
17
|
+
- Canvas, audio & WebGL fingerprinting
|
|
18
|
+
- Incognito detection
|
|
19
|
+
- Plugin, fonts & storage capabilities
|
|
20
|
+
- Device sensors (orientation, motion, battery)
|
|
21
|
+
- Bot detection signals
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
### 🎯 Behavioural Biometrics
|
|
26
|
+
Understand how a user behaves—not just what they input.
|
|
27
|
+
|
|
28
|
+
Captures:
|
|
29
|
+
- Keystroke rhythm & timing
|
|
30
|
+
- Mouse movement velocity & acceleration
|
|
31
|
+
- Movement patterns & micro-behaviours
|
|
32
|
+
- Human vs bot interaction signals
|
|
33
|
+
|
|
34
|
+
Privacy-preserving (no raw keystrokes recorded).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### 🔗 Combined Device Fingerprint
|
|
39
|
+
Merge **device signals + behavioural signals** into a single high-confidence identity token.
|
|
40
|
+
|
|
41
|
+
Ideal for:
|
|
42
|
+
- Login risk scoring
|
|
43
|
+
- Fraud detection
|
|
44
|
+
- Payment protection
|
|
45
|
+
- Session integrity
|
|
46
|
+
- Zero-trust systems
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## ⚡ Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install @dwield/device-biometrics-sdk
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
yarn add @dwield/device-biometrics-sdk
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 🚀 Quick Start
|
|
65
|
+
|
|
66
|
+
Dwield provides **three product tiers**, each accessible via a different initializer.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
# 1️⃣ Device Intelligence SDK
|
|
71
|
+
|
|
72
|
+
### Initialize
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import { initDeviceInfo } from "@dwield/device-biometrics-sdk";
|
|
76
|
+
|
|
77
|
+
const client = await initDeviceInfo({
|
|
78
|
+
apiKey: "YOUR_API_KEY",
|
|
79
|
+
verbose: true,
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Get Device Fingerprint
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const device = await client.getDeviceData();
|
|
87
|
+
console.log("Device Fingerprint:", device);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
# 2️⃣ Behavioural Biometrics SDK
|
|
93
|
+
|
|
94
|
+
### Start Tracking
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
import { initBiometrics } from "@dwield/device-biometrics-sdk";
|
|
98
|
+
|
|
99
|
+
const client = await initBiometrics({ apiKey: "YOUR_API_KEY" });
|
|
100
|
+
|
|
101
|
+
client.initKeyStrokeDynamics();
|
|
102
|
+
client.initMouseDynamics();
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Read Behavioural Metrics
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
const keystrokes = client.fetchKeyStrockDynamicsData();
|
|
109
|
+
const mouse = client.fetchMouseDynamicsData();
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Stop Tracking
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
client.stopKeyStrokeDynamics();
|
|
116
|
+
client.stopMouseDynamics();
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
# 3️⃣ Combined Fingerprinting SDK
|
|
122
|
+
### *(Device Info + Behavioural Biometrics)*
|
|
123
|
+
|
|
124
|
+
```js
|
|
125
|
+
import { initDeviceInfoWithBiometrics } from "@dwield/device-biometrics-sdk";
|
|
126
|
+
|
|
127
|
+
const client = await initDeviceInfoWithBiometrics({
|
|
128
|
+
apiKey: "YOUR_API_KEY"
|
|
129
|
+
});
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Start tracking:
|
|
133
|
+
|
|
134
|
+
```js
|
|
135
|
+
client.initKeyStrokeDynamics();
|
|
136
|
+
client.initMouseDynamics();
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Fetch full fingerprint:
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
const fingerprint = await client.getDeviceInfoWithBiometrics();
|
|
143
|
+
console.log("Full Fingerprint:", fingerprint);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Stop:
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
client.stopKeyStrokeDynamics();
|
|
150
|
+
client.stopMouseDynamics();
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
# ⚛️ React Integration (Recommended)
|
|
156
|
+
|
|
157
|
+
```jsx
|
|
158
|
+
import { useEffect, useRef, useState } from "react";
|
|
159
|
+
import { initDeviceInfoWithBiometrics } from "@dwield/device-biometrics-sdk";
|
|
160
|
+
|
|
161
|
+
export default function FingerprintForm() {
|
|
162
|
+
const sdkRef = useRef(null);
|
|
163
|
+
const [result, setResult] = useState(null);
|
|
164
|
+
|
|
165
|
+
useEffect(() => {
|
|
166
|
+
const init = async () => {
|
|
167
|
+
const client = await initDeviceInfoWithBiometrics({
|
|
168
|
+
apiKey: "YOUR_API_KEY",
|
|
169
|
+
verbose: true
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
client.initKeyStrokeDynamics();
|
|
173
|
+
client.initMouseDynamics();
|
|
174
|
+
|
|
175
|
+
sdkRef.current = client;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
init();
|
|
179
|
+
|
|
180
|
+
return () => {
|
|
181
|
+
if (sdkRef.current) {
|
|
182
|
+
sdkRef.current.stopKeyStrokeDynamics();
|
|
183
|
+
sdkRef.current.stopMouseDynamics();
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}, []);
|
|
187
|
+
|
|
188
|
+
const handleSubmit = async () => {
|
|
189
|
+
const fp = await sdkRef.current.getDeviceInfoWithBiometrics();
|
|
190
|
+
setResult(fp);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<>
|
|
195
|
+
<button onClick={handleSubmit}>Submit with Fingerprint</button>
|
|
196
|
+
{result && <pre>{JSON.stringify(result, null, 2)}</pre>}
|
|
197
|
+
</>
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
# 🌍 Vanilla JavaScript Example
|
|
205
|
+
|
|
206
|
+
```html
|
|
207
|
+
<script type="module">
|
|
208
|
+
import { initDeviceInfo } from "https://cdn.skypack.dev/@dwield/device-biometrics-sdk";
|
|
209
|
+
|
|
210
|
+
(async () => {
|
|
211
|
+
const client = await initDeviceInfo({ apiKey: "YOUR_API_KEY" });
|
|
212
|
+
const data = await client.getDeviceData();
|
|
213
|
+
console.log("Device Info:", data);
|
|
214
|
+
})();
|
|
215
|
+
</script>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
# 📊 Sample Combined Fingerprint
|
|
221
|
+
|
|
222
|
+
```json
|
|
223
|
+
{
|
|
224
|
+
"behavioural": {
|
|
225
|
+
"keystroke": { ... },
|
|
226
|
+
"mouse": { ... }
|
|
227
|
+
},
|
|
228
|
+
"device": {
|
|
229
|
+
"browserInfo": { ... },
|
|
230
|
+
"webglInfo": { ... },
|
|
231
|
+
"fonts_available": [ ... ],
|
|
232
|
+
"batteryInfo": { ... }
|
|
233
|
+
},
|
|
234
|
+
"timestamp": "2025-01-01T10:05:32.911Z"
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
# 📚 API Reference
|
|
241
|
+
|
|
242
|
+
### `initDeviceInfo(config) → DeviceInfoSDK`
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
interface DeviceInfoSDK {
|
|
246
|
+
product: "device_id";
|
|
247
|
+
getDeviceData(): Promise<any>;
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
### `initBiometrics(config) → BiometricsSDK`
|
|
254
|
+
|
|
255
|
+
```ts
|
|
256
|
+
interface BiometricsSDK {
|
|
257
|
+
initKeyStrokeDynamics(): void;
|
|
258
|
+
stopKeyStrokeDynamics(): void;
|
|
259
|
+
initMouseDynamics(): void;
|
|
260
|
+
stopMouseDynamics(): void;
|
|
261
|
+
fetchKeyStrockDynamicsData(): any;
|
|
262
|
+
fetchMouseDynamicsData(): any;
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
### `initDeviceInfoWithBiometrics(config) → CombinedSDK`
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
interface CombinedSDK {
|
|
272
|
+
initKeyStrokeDynamics(): void;
|
|
273
|
+
stopKeyStrokeDynamics(): void;
|
|
274
|
+
initMouseDynamics(): void;
|
|
275
|
+
stopMouseDynamics(): void;
|
|
276
|
+
fetchKeyStrockDynamicsData(): any;
|
|
277
|
+
fetchMouseDynamicsData(): any;
|
|
278
|
+
getDeviceData(): Promise<any>;
|
|
279
|
+
getDeviceInfoWithBiometrics(): Promise<any>;
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
# 🔐 Security & Privacy
|
|
286
|
+
|
|
287
|
+
Dwield SDK is built with privacy in mind:
|
|
288
|
+
|
|
289
|
+
- No raw keystrokes recorded
|
|
290
|
+
- No PII captured
|
|
291
|
+
- Behavioural signals are anonymized
|
|
292
|
+
- Fully compliant with GDPR when used with proper consent
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
# 🧠 TypeScript Support
|
|
297
|
+
|
|
298
|
+
Rich TypeScript definitions included:
|
|
299
|
+
|
|
300
|
+
- Strong typing
|
|
301
|
+
- IntelliSense
|
|
302
|
+
- Autocomplete for all SDK clients
|
|
303
|
+
|
|
304
|
+
Enable using:
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
"types": "./types/index.d.ts"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
# 🏢 Enterprise Features (Optional Add-ons)
|
|
313
|
+
|
|
314
|
+
- License key validation
|
|
315
|
+
- Server-side risk scoring engine
|
|
316
|
+
- Device correlation
|
|
317
|
+
- Session intelligence
|
|
318
|
+
- Real-time fraud rules
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
# 📞 Support
|
|
323
|
+
|
|
324
|
+
For enterprise licensing, help, or integration:
|
|
325
|
+
|
|
326
|
+
📧 support@dwield.com
|
|
327
|
+
🌍 https://dwield.com (placeholder)
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
# 📄 License
|
|
332
|
+
|
|
333
|
+
Proprietary — Dwield Technologies.
|
|
334
|
+
Contact us for commercial usage and redistribution permissions.
|
|
335
|
+
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
/*!
|
|
3
3
|
* DWIELD-SDK v1.0.0
|
|
4
|
-
* (c)
|
|
4
|
+
* (c) 2026 Dwield
|
|
5
5
|
* Proprietary License - Unauthorized distribution prohibited
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
var K=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var n in t)K(e,n,{get:t[n],enumerable:!0})},se=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of oe(t))!ae.call(e,s)&&s!==n&&K(e,s,{get:()=>t[s],enumerable:!(i=ie(t,s))||i.enumerable});return e};var ce=e=>se(K({},"__esModule",{value:!0}),e);var Ne={};R(Ne,{BehaviouralBiometrics:()=>G,DeviceId:()=>z,initBiometrics:()=>Ee,initDeviceInfo:()=>Le,initDeviceInfoWithBiometrics:()=>Re,version:()=>E});module.exports=ce(Ne);var G={};R(G,{fetchKeyStrockDynamicsData:()=>q,fetchMouseDynamicsData:()=>U,initKeyStrokeDynamics:()=>N,initMouseDynamics:()=>H,stopKeyStrokeDynamics:()=>F,stopMouseDynamics:()=>W});var I=(()=>{let e=[],t=[],n=[],i=!1,s=[],o=0,r=()=>new Date().getTime(),f=(c,m,h)=>{let y=/^[A-Z]$/.test(c),d=/^[a-z]$/.test(c),S=/^[~!@#$%^&*()_+|}{":?>,<]$/.test(c);return y||S&&v()||d&&v()?"uppercase":d?"lowercase":[8,9,46].includes(m)?"control":"others"},v=()=>{let c=t[t.length-1];return c?.keyCode===16&&c?.multipleKey},x=(c,m,h,y)=>{let d=r();h==="kd"&&(n.push(d),o=d,m===16&&(i=!0,s.push(d)));let S=f(c,m,i);if(h==="ku"){let C=o||n[n.length-1],T=d-C,_=d-s[0],M={dwellTime:m===16?_:T,category:S,multipleKey:i||v(),pressTime:m===16?s[0]:C,releaseTime:d};m===16&&(i=!1,s=[]),e.push(M),t.push({...M,keyCode:m}),o=0}},a=(c,m)=>{let h=c.key,y=c.keyCode;x(h,y,m,c.shiftKey)},D=c=>a(c,"kd"),g=c=>a(c,"ku");return{startTrackingKeystrokeDynamics:()=>{window.addEventListener("keydown",D),window.addEventListener("keyup",g)},getTrackedData:()=>({keystrokes:e}),stopTrackingKeystrokeDynamics:()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",g),e=[],n=[],i=!1,s=[],o=0}}})();var B=(()=>{let e=[],t=[],n=null,i=null,s=()=>new Date().getTime(),o=(u,l,c,m)=>{let h=m-l,y=c-u,d=Math.atan2(h,y)*(180/Math.PI);return d<0&&(d+=360),360-d},r=u=>["q1","q2","q3","q4","q5","q6","q7","q8"][Math.floor(u/45)],f=(u,l,c,m)=>Math.sqrt((c-u)**2+(m-l)**2),v=(u,l)=>{let c=e[e.length-1],m=c?c.time:0,h=s(),y=c?h-m:0,d=0,S=0;m&&(d=o(c.mouseX,c.mouseY,u,l),S=f(c.mouseX,c.mouseY,u,l));let C=o(window.innerWidth/2,window.innerHeight/2,u,l),T=r(C);e.push({mouseX:u,mouseY:l,time:h,time_difference:y,theta_relative:d,quadrant:T,theta_origin:C,distance_moved:S})},x=u=>{let l=u.pageX,c=u.pageY;clearTimeout(i),i=setTimeout(()=>{n&&v(l,c),n={mouseX:l,mouseY:c}},300)},a=u=>{let l=u.pageX,c=u.pageY,m=s();u.type==="mousedown"?t.push({X:l,Y:c,mouseDown_time:m}):u.type==="mouseup"&&t.push({X:l,Y:c,mouseUp_time:m,timeDiff:m-t[t.length-1].mouseDown_time})};return{startTrackingMouseDynamics:()=>{window.addEventListener("mousemove",x),window.addEventListener("mousedown",a),window.addEventListener("mouseup",a)},getTrackedData:()=>({rawData:e,mouseClicksData:t}),stopTrackingMouseDynamics:()=>{e=[],t=[],n=null,i=null}}})();var N=()=>{I.startTrackingKeystrokeDynamics()},F=()=>{I.stopTrackingKeystrokeDynamics()},H=()=>{B.startTrackingMouseDynamics()},W=()=>{B.stopTrackingMouseDynamics()},U=()=>B.getTrackedData(),q=()=>I.getTrackedData();var z={};R(z,{getDeviceData:()=>V,getOSName:()=>k});var fe=function(){return new Promise(function(e,t){let n="Unknown";function i(d){e({isPrivate:d,browserName:n})}function s(){let d=navigator.userAgent;return d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium"}function o(d){return d===eval.toString().length}function r(){let d=navigator.vendor;return d!==void 0&&d.indexOf("Apple")===0&&o(37)}function f(){let d=navigator.vendor;return d!==void 0&&d.indexOf("Google")===0&&o(33)}function v(){return document.documentElement!==void 0&&document.documentElement.style.MozAppearance!==void 0&&o(37)}function x(){return navigator.msSaveBlob!==void 0&&o(39)}function a(){let d=String(Math.random());try{let S=window.indexedDB.open(d,1);S.onupgradeneeded=function(C){let T=C.target?.result;try{T.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(_){let M=_;if(_ instanceof Error&&(M=_.message??_),typeof M!="string")return i(!1);let re=/BlobURLs are not yet supported/.test(M);return i(re)}finally{T.close(),window.indexedDB.deleteDatabase(d)}}}catch{return i(!1)}}function D(){let d=window.openDatabase,S=window.localStorage;try{d(null,null,null,null)}catch{return i(!0)}try{S.setItem("test","1"),S.removeItem("test")}catch{return i(!0)}return i(!1)}function g(){navigator.maxTouchPoints!==void 0?a():D()}function p(){let d=window;return d.performance!==void 0&&d.performance.memory!==void 0&&d.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function u(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(d,S){let C=Math.round(S/1048576),T=Math.round(p()/(1024*1024))*2;i(C<T)},function(d){t(new Error("detectIncognito somehow failed to query storage quota: "+d.message))})}function l(){let d=window.webkitRequestFileSystem;d(0,1,function(){i(!1)},function(){i(!0)})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?u():l()}function m(){i(navigator.serviceWorker===void 0)}function h(){i(window.indexedDB===void 0)}function y(){r()?(n="Safari",g()):f()?(n=s(),c()):v()?(n="Firefox",m()):x()?(n="Internet Explorer",h()):t(new Error("detectIncognito cannot determine the browser"))}y()})},X=async()=>{try{return(await fe()).isPrivate}catch{return}};function de(){let e=navigator.userAgent.toLowerCase(),t=navigator.oscpu,n=navigator.platform.toLowerCase();var i=k();if(("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&i!=="Windows"&&i!=="Windows Phone"&&i!=="Android"&&i!=="iOS"&&i!=="Other"&&e.indexOf("cros")===-1)return!0;if(typeof t<"u"){if(t=t.toLowerCase(),t.indexOf("win")>=0&&i!=="Windows"&&i!=="Windows Phone")return!0;if(t.indexOf("linux")>=0&&i!=="Linux"&&i!=="Android")return!0;if(t.indexOf("mac")>=0&&i!=="Mac"&&i!=="iOS")return!0;if((t.indexOf("win")===-1&&t.indexOf("linux")===-1&&t.indexOf("mac")===-1)!=(i==="Other"))return!0}if(n.indexOf("win")>=0&&i!=="Windows"&&i!=="Windows Phone")return!0;if((n.indexOf("linux")>=0||n.indexOf("android")>=0||n.indexOf("pike")>=0)&&i!=="Linux"&&i!=="Android")return!0;if((n.indexOf("mac")>=0||n.indexOf("ipad")>=0||n.indexOf("ipod")>=0||n.indexOf("iphone")>=0)&&i!=="Mac"&&i!=="iOS")return!0;if(n.indexOf("arm")>=0&&i==="Windows Phone")return!1;if(n.indexOf("pike")>=0&&e.indexOf("opera mini")>=0)return!1;var o=n.indexOf("win")<0&&n.indexOf("linux")<0&&n.indexOf("mac")<0&&n.indexOf("iphone")<0&&n.indexOf("ipad")<0&&n.indexOf("ipod")<0;return o!==(i==="Other")?!0:typeof navigator.plugins>"u"&&i!=="Windows"&&i!=="Windows Phone"}function ue(){var e=navigator.userAgent.toLowerCase(),t=navigator.productSub,n;if(e.indexOf("edge/")>=0||e.indexOf("iemobile/")>=0)return!1;if(e.indexOf("opera mini")>=0)return!1;if(e.indexOf("firefox/")>=0?n="Firefox":e.indexOf("opera/")>=0||e.indexOf(" opr/")>=0?n="Opera":e.indexOf("chrome/")>=0?n="Chrome":e.indexOf("safari/")>=0?e.indexOf("android 1.")>=0||e.indexOf("android 2.")>=0||e.indexOf("android 3.")>=0||e.indexOf("android 4.")>=0?n="AOSP":n="Safari":e.indexOf("trident/")>=0?n="Internet Explorer":n="Other",(n==="Chrome"||n==="Safari"||n==="Opera")&&t!=="20030107")return!0;var i=eval.toString().length;if(i===37&&n!=="Safari"&&n!=="Firefox"&&n!=="Other")return!0;if(i===39&&n!=="Internet Explorer"&&n!=="Other")return!0;if(i===33&&n!=="Chrome"&&n!=="AOSP"&&n!=="Opera"&&n!=="Other")return!0;var s;try{throw"a"}catch(o){try{o.toSource(),s=!0}catch{s=!1}}return s&&n!=="Firefox"&&n!=="Other"}function le(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight}function me(){if(typeof navigator.languages<"u")try{var e=navigator.languages[0].substr(0,2);if(e!==navigator.language.substr(0,2))return!0}catch{return!0}return!1}function $(){return{has_lied_os:de(),has_lied_browser:ue(),has_lied_resolution:le(),has_lied_languages:me()}}var Q=()=>{var e=document.body.appendChild(document.createElement("canvas")),t=e.getContext("2d");e.height=200,e.width=500;var n="This is a random text to generate canvas ID :) 123@";t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17),t.globalCompositeOperation="multiply",t.fillStyle="rgb(255,0,255)",t.beginPath(),t.arc(50,50,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(0,255,255)",t.beginPath(),t.arc(100,50,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(255,255,0)",t.beginPath(),t.arc(75,100,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(255,0,255)",t.arc(75,75,75,0,Math.PI*2,!0),t.arc(75,75,25,0,Math.PI*2,!0),t.fill("evenodd");var i=function(){for(var o=1,r,f=[],v=[];++o<18;)for(r=o*o;r<312;r+=o)f[r]=1;function x(g,p){return Math.pow(g,1/p)%1*4294967296|0}for(o=1,r=0;o<313;)f[++o]||(v[r]=x(o,2),f[r++]=x(o,3));function a(g,p){return g>>>p|g<<32-p}function D(g){for(var p=v.slice(o=0),u=unescape(encodeURI(g)),l=[],c=u.length,m=[],h,y,d;o<c;)m[o>>2]|=(u.charCodeAt(o)&255)<<8*(3-o++%4);for(c*=8,m[c>>5]|=128<<24-c%32,m[d=c+64>>5|15]=c,o=0;o<d;o+=16){for(h=p.slice(r=0,8);r<64;h[4]+=y)r<16?l[r]=m[r+o]:l[r]=(a(y=l[r-2],17)^a(y,19)^y>>>10)+(l[r-7]|0)+(a(y=l[r-15],7)^a(y,18)^y>>>3)+(l[r-16]|0),h.unshift((y=(h.pop()+(a(g=h[4],6)^a(g,11)^a(g,25))+((g&h[5]^~g&h[6])+f[r])|0)+(l[r++]|0))+(a(c=h[0],2)^a(c,13)^a(c,22))+(c&h[1]^h[1]&h[2]^h[2]&c));for(r=8;r--;)p[r]=h[r]+p[r]}for(u="";r<63;)u+=(p[++r>>3]>>4*(7-r%8)&15).toString(16);return u}return D}();let s=i(e.toDataURL());return document.body.removeChild(e),s};function O(e,t){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535],t=[t[0]>>>16,t[0]&65535,t[1]>>>16,t[1]&65535];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function A(e,t){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535],t=[t[0]>>>16,t[0]&65535,t[1]>>>16,t[1]&65535];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function P(e,t){return t%=64,t===32?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function b(e,t){return t%=64,t===0?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function w(e,t){return[e[0]^t[0],e[1]^t[1]]}function J(e){return e=w(e,[0,e[0]>>>1]),e=A(e,[4283543511,3981806797]),e=w(e,[0,e[0]>>>1]),e=A(e,[3301882366,444984403]),e=w(e,[0,e[0]>>>1]),e}function L(e,t){e=e||"",t=t||0;for(var n=e.length%16,i=e.length-n,s=[0,t],o=[0,t],r=[0,0],f=[0,0],v=[2277735313,289559509],x=[1291169091,658871167],a=0;a<i;a=a+16)r=[e.charCodeAt(a+4)&255|(e.charCodeAt(a+5)&255)<<8|(e.charCodeAt(a+6)&255)<<16|(e.charCodeAt(a+7)&255)<<24,e.charCodeAt(a)&255|(e.charCodeAt(a+1)&255)<<8|(e.charCodeAt(a+2)&255)<<16|(e.charCodeAt(a+3)&255)<<24],f=[e.charCodeAt(a+12)&255|(e.charCodeAt(a+13)&255)<<8|(e.charCodeAt(a+14)&255)<<16|(e.charCodeAt(a+15)&255)<<24,e.charCodeAt(a+8)&255|(e.charCodeAt(a+9)&255)<<8|(e.charCodeAt(a+10)&255)<<16|(e.charCodeAt(a+11)&255)<<24],r=A(r,v),r=P(r,31),r=A(r,x),s=w(s,r),s=P(s,27),s=O(s,o),s=O(A(s,[0,5]),[0,1390208809]),f=A(f,x),f=P(f,33),f=A(f,v),o=w(o,f),o=P(o,31),o=O(o,s),o=O(A(o,[0,5]),[0,944331445]);switch(r=[0,0],f=[0,0],n){case 15:f=w(f,b([0,e.charCodeAt(a+14)],48));case 14:f=w(f,b([0,e.charCodeAt(a+13)],40));case 13:f=w(f,b([0,e.charCodeAt(a+12)],32));case 12:f=w(f,b([0,e.charCodeAt(a+11)],24));case 11:f=w(f,b([0,e.charCodeAt(a+10)],16));case 10:f=w(f,b([0,e.charCodeAt(a+9)],8));case 9:f=w(f,[0,e.charCodeAt(a+8)]),f=A(f,x),f=P(f,33),f=A(f,v),o=w(o,f);case 8:r=w(r,b([0,e.charCodeAt(a+7)],56));case 7:r=w(r,b([0,e.charCodeAt(a+6)],48));case 6:r=w(r,b([0,e.charCodeAt(a+5)],40));case 5:r=w(r,b([0,e.charCodeAt(a+4)],32));case 4:r=w(r,b([0,e.charCodeAt(a+3)],24));case 3:r=w(r,b([0,e.charCodeAt(a+2)],16));case 2:r=w(r,b([0,e.charCodeAt(a+1)],8));case 1:r=w(r,[0,e.charCodeAt(a)]),r=A(r,v),r=P(r,31),r=A(r,x),s=w(s,r)}return s=w(s,[0,e.length]),o=w(o,[0,e.length]),s=O(s,o),o=O(o,s),s=J(s),o=J(o),s=O(s,o),o=O(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}var Z=()=>{var e,t,n=256,i=128;e=document.body.appendChild(document.createElement("canvas")),e.width=n,e.height=i,t=e.getContext("webgl2")||e.getContext("experimental-webgl2")||e.getContext("webgl")||e.getContext("experimental-webgl")||e.getContext("moz-webgl");let s={};try{if(t){var o=t.getExtension("WEBGL_debug_renderer_info");if(o){var r=t.getParameter(o.UNMASKED_VENDOR_WEBGL),f=t.getParameter(o.UNMASKED_RENDERER_WEBGL);s.webglVendor=r,s.webglRenderer=f}}var v="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",x="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a);var D=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);t.bufferData(t.ARRAY_BUFFER,D,t.STATIC_DRAW),a.itemSize=3,a.numItems=3;var g=t.createProgram(),p=t.createShader(t.VERTEX_SHADER);t.shaderSource(p,v),t.compileShader(p);var u=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(u,x),t.compileShader(u),t.attachShader(g,p),t.attachShader(g,u),t.linkProgram(g),t.useProgram(g),g.vertexPosAttrib=t.getAttribLocation(g,"attrVertex"),g.offsetUniform=t.getUniformLocation(g,"uniformOffset"),t.enableVertexAttribArray(g.vertexPosArray),t.vertexAttribPointer(g.vertexPosAttrib,a.itemSize,t.FLOAT,!1,0,0),t.uniform2f(g.offsetUniform,1,1),t.drawArrays(t.TRIANGLE_STRIP,0,a.numItems),document.body.removeChild(e)}catch{}var l="",c=new Uint8Array(n*i*4);t.readPixels(0,0,n,i,t.RGBA,t.UNSIGNED_BYTE,c),l=JSON.stringify(c).replace(/,?"[0-9]+":/g,"");let m=L(l,69);return s.webglId=m,s};var j=()=>({isWebdriver:navigator.webdriver});var ee=function(){var e=null,t=null,n=null,i=null,s=null,o=null;function r(u,l=!1){o=u;try{f(),n.connect(i),i.connect(e.destination),n.start(0),e.startRendering(),e.oncomplete=g}catch(c){if(l)throw c}}function f(){v(),t=e.currentTime,x(),a()}function v(){var u=window.OfflineAudioContext||window.webkitOfflineAudioContext;e=new u(1,44100,44100)}function x(){n=e.createOscillator(),n.type="triangle",n.frequency.setValueAtTime(1e4,t)}function a(){i=e.createDynamicsCompressor(),D("threshold",-50),D("knee",40),D("ratio",12),D("reduction",-20),D("attack",0),D("release",.25)}function D(u,l){i[u]!==void 0&&typeof i[u].setValueAtTime=="function"&&i[u].setValueAtTime(l,e.currentTime)}function g(u){p(u),i.disconnect()}function p(u){for(var l=null,c=4500;5e3>c;c++){var m=u.renderedBuffer.getChannelData(0)[c];l+=Math.abs(m)}if(s=l.toString(),typeof o=="function")return o(s)}return{run:r}}();var ge=async()=>{let e=await he(),t=ve(),n=$(),i=ye(),s=De(),o=Se(),r=await Ce(),f=Ae(),v=Te(),x=Oe(),a=_e(),D=Me(),g=Q(),p=Pe(),u=Z(),l=await Be(),c=j(),m=await ke();return{browserInfo:e,batteryInfo:m,windowInfo:t,hasLiedParamters:n,adBlock:i,dateOffsetTimezone:s,osDetails:o,localIPAddress:r,audioDetails:f,deviceOrientation:v,deviceMotion:x,deviceLight:a,proximityEvent:D,canvasId:g,audioFingerPrintFrequency:p,webglInfo:u,botInfo:c,fonts_available:l}};async function he(){return{browser_userAgent:navigator.userAgent,browser_appName:navigator.appName,browser_appCodeName:navigator.appCodeName,browser_appVersion:navigator.appVersion,browser_platform:navigator.platform,browser_product:navigator.product,browser_productSub:navigator.productSub,browser_vendor:navigator.vendor,browser_vendorSub:navigator.vendorSub,browser_buildID:navigator.buildID,browser_oscpu:navigator.oscpu,browser_language:navigator.language,browser_hardwareConcurrency:navigator.hardwareConcurrency,browser_doNotTrack:navigator.doNotTrack==="unspecified"?-1:navigator.doNotTrack,browser_connection:navigator.connection,browser_maxTouchPoints:navigator.maxTouchPoints,browser_plugins:we(),browser_permissions:navigator.permissions,is_incognito:await X()}}function we(){return Array.from(navigator.plugins).map(e=>({name:e.name,description:e.description,filename:e.filename}))}function ve(){return{window_colorDepth:window.screen.colorDepth,window_width:window.screen.width,window_height:window.screen.height,window_availWidth:window.screen.availWidth,window_availHeight:window.screen.availHeight,window_devicePixelRatio:window.devicePixelRatio,window_cookieEnabled:window.navigator.cookieEnabled,window_sessionStorage:pe(),window_localStorage:xe(),window_indexedDB:!!window.indexedDB,window_openDatabase:!!window.openDatabase}}function pe(){let e;try{e=!!window.sessionStorage}catch{e=!1}finally{return e}}function xe(){let e;try{e=!!window.localStorage}catch{e=!1}finally{return e}}function ye(){var e=document.createElement("div");e.innerHTML=" ",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=document.getElementsByClassName("adsbox")[0].offsetHeight===0,document.body.removeChild(e)}catch{t=!1}return t}function De(){return new Date().getTimezoneOffset()}function k(){let e=navigator.userAgent.toLowerCase(),t;return e.indexOf("windows phone")>=0?t="Windows Phone":e.indexOf("windows")>=0||e.indexOf("win16")>=0||e.indexOf("win32")>=0||e.indexOf("win64")>=0||e.indexOf("win95")>=0||e.indexOf("win98")>=0||e.indexOf("winnt")>=0||e.indexOf("wow64")>=0?t="Windows":e.indexOf("android")>=0?t="Android":e.indexOf("linux")>=0||e.indexOf("cros")>=0||e.indexOf("x11")>=0?t="Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0||e.indexOf("crios")>=0||e.indexOf("fxios")>=0?t="iOS":e.indexOf("macintosh")>=0||e.indexOf("mac_powerpc)")>=0?t="Mac":t="Other",t}function Se(){return{osName:k(),osVersion:navigator.userAgent}}async function be(){return await(await fetch("https://api.ipify.org?format=json")).json()}async function Ce(){let e=await be();return{local_ip_address:e&&e.ip}}function Ae(){let e=new(window.AudioContext||window.webkitAudioContext);if(e)return{sampleRate:e.sampleRate,destination:{maxChannelCount:e.destination.maxChannelCount,channelCount:e.destination.channelCount,channelCountMode:e.destination.channelCountMode,channelInterpretation:e.destination.channelInterpretation},currentTime:e.currentTime,state:e.state,baseLatency:e.baseLatency}}function Te(){if(window.DeviceOrientationEvent)return window.addEventListener("deviceorientation",function(e){return{rotateDegrees:e.alpha,leftToRight:e.gamma,frontToBack:e.beta}},!0)}function Oe(){return window.addEventListener("devicemotion",function(e){return{x:e.accelerationIncludingGravity.x,y:e.accelerationIncludingGravity.y,z:e.accelerationIncludingGravity.z}},!0)}function _e(){let e;return window.addEventListener("devicelight",function(t){e=t.value}),e}function Me(){let e;return window.addEventListener("userproximity",function(t){e=t.near}),e}function Pe(){let e=Ie();return L(e,69)}function Ie(){ee.run(function(e){return e})}async function Be(){try{let e=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort()),t=new Set;return await(async()=>{await document.fonts.ready;for(let n of e.values())document.fonts.check(`12px "${n}"`)&&t.add(n)})(),[...t.values()]}catch{return[]}}async function ke(){try{let e=await navigator.getBattery();return e?{charging:e.charging?"Charging":"Not Charging",level:e.level*100,chargingTime:e.chargingTime,dischargingTime:e.dischargingTime}:void 0}catch{return{}}}var V=async()=>await ge();var E="1.2.2";function Y(e){if(!e||typeof e!="string"||e!=="dwield-sdk-secret")throw new Error("Invalid API Key provided. Please provide a valid API Key to initialize the SDK.")}function te({apiKey:e}){return{product:"device_id",version:E,apiKey:e,async getDeviceData(){return await V()}}}function Le(e={}){let{apiKey:t,verbose:n}=e;return Y(t),n&&console.log("[BB-SDK] Device Info SDK initialized"),te({apiKey:t})}function ne({apiKey:e}){return{product:"biometrics",version:E,apiKey:e,initKeyStrokeDynamics:N,stopKeyStrokeDynamics:F,initMouseDynamics:H,stopMouseDynamics:W,fetchMouseDynamicsData:U,fetchKeyStrockDynamicsData:q}}function Ee(e={}){let{apiKey:t,verbose:n}=e;return Y(t),n&&console.log("[BB-SDK] Biometrics SDK initialized"),ne({apiKey:t})}function Ke({apiKey:e}){let t=ne({apiKey:e}),n=te({apiKey:e});return{product:"device_id_with_biometrics",version:E,apiKey:e,initKeyStrokeDynamics:t.initKeyStrokeDynamics,stopKeyStrokeDynamics:t.stopKeyStrokeDynamics,initMouseDynamics:t.initMouseDynamics,stopMouseDynamics:t.stopMouseDynamics,fetchMouseDynamicsData:t.fetchMouseDynamicsData,fetchKeyStrockDynamicsData:t.fetchKeyStrockDynamicsData,getDeviceData:n.getDeviceData,async getDeviceInfoWithBiometrics(){let i={keystroke:t.fetchKeyStrockDynamicsData(),mouse:t.fetchMouseDynamicsData()},s=await n.getDeviceData();return{behavioural:i,device:s,timestamp:new Date().toISOString()}}}}function Re(e={}){let{apiKey:t,verbose:n}=e;return Y(t),n&&console.log("[BB-SDK] Device Info + Biometrics SDK initialized"),Ke({apiKey:t})}
|
|
8
|
+
var K=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ae=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var n in t)K(e,n,{get:t[n],enumerable:!0})},se=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of oe(t))!ae.call(e,s)&&s!==n&&K(e,s,{get:()=>t[s],enumerable:!(i=ie(t,s))||i.enumerable});return e};var ce=e=>se(K({},"__esModule",{value:!0}),e);var Fe={};R(Fe,{BehaviouralBiometrics:()=>q,DeviceId:()=>z,initBiometrics:()=>Ke,initDeviceInfo:()=>Ee,initDeviceInfoWithBiometrics:()=>Ne,version:()=>E});module.exports=ce(Fe);var q={};R(q,{fetchKeyStrockDynamicsData:()=>V,fetchMouseDynamicsData:()=>U,initKeyStrokeDynamics:()=>N,initMouseDynamics:()=>H,stopKeyStrokeDynamics:()=>F,stopMouseDynamics:()=>W});var I=(()=>{let e=[],t=[],n=[],i=!1,s=[],o=0,r=()=>new Date().getTime(),f=(c,m,h)=>{let y=/^[A-Z]$/.test(c),d=/^[a-z]$/.test(c),S=/^[~!@#$%^&*()_+|}{":?>,<]$/.test(c);return y||S&&v()||d&&v()?"uppercase":d?"lowercase":[8,9,46].includes(m)?"control":"others"},v=()=>{let c=t[t.length-1];return c?.keyCode===16&&c?.multipleKey},x=(c,m,h,y)=>{let d=r();h==="kd"&&(n.push(d),o=d,m===16&&(i=!0,s.push(d)));let S=f(c,m,i);if(h==="ku"){let C=o||n[n.length-1],T=d-C,_=d-s[0],M={dwellTime:m===16?_:T,category:S,multipleKey:i||v(),pressTime:m===16?s[0]:C,releaseTime:d};m===16&&(i=!1,s=[]),e.push(M),t.push({...M,keyCode:m}),o=0}},a=(c,m)=>{let h=c.key,y=c.keyCode;x(h,y,m,c.shiftKey)},D=c=>a(c,"kd"),g=c=>a(c,"ku");return{startTrackingKeystrokeDynamics:()=>{window.addEventListener("keydown",D),window.addEventListener("keyup",g)},getTrackedData:()=>({keystrokes:e}),stopTrackingKeystrokeDynamics:()=>{window.removeEventListener("keydown",D),window.removeEventListener("keyup",g),e=[],n=[],i=!1,s=[],o=0}}})();var B=(()=>{let e=[],t=[],n=null,i=null,s=()=>new Date().getTime(),o=(u,l,c,m)=>{let h=m-l,y=c-u,d=Math.atan2(h,y)*(180/Math.PI);return d<0&&(d+=360),360-d},r=u=>["q1","q2","q3","q4","q5","q6","q7","q8"][Math.floor(u/45)],f=(u,l,c,m)=>Math.sqrt((c-u)**2+(m-l)**2),v=(u,l)=>{let c=e[e.length-1],m=c?c.time:0,h=s(),y=c?h-m:0,d=0,S=0;m&&(d=o(c.mouseX,c.mouseY,u,l),S=f(c.mouseX,c.mouseY,u,l));let C=o(window.innerWidth/2,window.innerHeight/2,u,l),T=r(C);e.push({mouseX:u,mouseY:l,time:h,time_difference:y,theta_relative:d,quadrant:T,theta_origin:C,distance_moved:S})},x=u=>{let l=u.pageX,c=u.pageY;clearTimeout(i),i=setTimeout(()=>{n&&v(l,c),n={mouseX:l,mouseY:c}},300)},a=u=>{let l=u.pageX,c=u.pageY,m=s();u.type==="mousedown"?t.push({X:l,Y:c,mouseDown_time:m}):u.type==="mouseup"&&t.push({X:l,Y:c,mouseUp_time:m,timeDiff:m-t[t.length-1].mouseDown_time})};return{startTrackingMouseDynamics:()=>{window.addEventListener("mousemove",x),window.addEventListener("mousedown",a),window.addEventListener("mouseup",a)},getTrackedData:()=>({rawData:e,mouseClicksData:t}),stopTrackingMouseDynamics:()=>{e=[],t=[],n=null,i=null}}})();var N=()=>{I.startTrackingKeystrokeDynamics()},F=()=>{I.stopTrackingKeystrokeDynamics()},H=()=>{B.startTrackingMouseDynamics()},W=()=>{B.stopTrackingMouseDynamics()},U=()=>B.getTrackedData(),V=()=>I.getTrackedData();var z={};R(z,{getDeviceData:()=>G,getOSName:()=>k});var fe=function(){return new Promise(function(e,t){let n="Unknown";function i(d){e({isPrivate:d,browserName:n})}function s(){let d=navigator.userAgent;return d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium"}function o(d){return d===eval.toString().length}function r(){let d=navigator.vendor;return d!==void 0&&d.indexOf("Apple")===0&&o(37)}function f(){let d=navigator.vendor;return d!==void 0&&d.indexOf("Google")===0&&o(33)}function v(){return document.documentElement!==void 0&&document.documentElement.style.MozAppearance!==void 0&&o(37)}function x(){return navigator.msSaveBlob!==void 0&&o(39)}function a(){let d=String(Math.random());try{let S=window.indexedDB.open(d,1);S.onupgradeneeded=function(C){let T=C.target?.result;try{T.createObjectStore("test",{autoIncrement:!0}).put(new Blob),i(!1)}catch(_){let M=_;if(_ instanceof Error&&(M=_.message??_),typeof M!="string")return i(!1);let re=/BlobURLs are not yet supported/.test(M);return i(re)}finally{T.close(),window.indexedDB.deleteDatabase(d)}}}catch{return i(!1)}}function D(){let d=window.openDatabase,S=window.localStorage;try{d(null,null,null,null)}catch{return i(!0)}try{S.setItem("test","1"),S.removeItem("test")}catch{return i(!0)}return i(!1)}function g(){navigator.maxTouchPoints!==void 0?a():D()}function p(){let d=window;return d.performance!==void 0&&d.performance.memory!==void 0&&d.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824}function u(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(d,S){let C=Math.round(S/1048576),T=Math.round(p()/(1024*1024))*2;i(C<T)},function(d){t(new Error("detectIncognito somehow failed to query storage quota: "+d.message))})}function l(){let d=window.webkitRequestFileSystem;d(0,1,function(){i(!1)},function(){i(!0)})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?u():l()}function m(){i(navigator.serviceWorker===void 0)}function h(){i(window.indexedDB===void 0)}function y(){r()?(n="Safari",g()):f()?(n=s(),c()):v()?(n="Firefox",m()):x()?(n="Internet Explorer",h()):t(new Error("detectIncognito cannot determine the browser"))}y()})},X=async()=>{try{return(await fe()).isPrivate}catch{return}};function de(){let e=navigator.userAgent.toLowerCase(),t=navigator.oscpu,n=navigator.platform.toLowerCase();var i=k();if(("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0)&&i!=="Windows"&&i!=="Windows Phone"&&i!=="Android"&&i!=="iOS"&&i!=="Other"&&e.indexOf("cros")===-1)return!0;if(typeof t<"u"){if(t=t.toLowerCase(),t.indexOf("win")>=0&&i!=="Windows"&&i!=="Windows Phone")return!0;if(t.indexOf("linux")>=0&&i!=="Linux"&&i!=="Android")return!0;if(t.indexOf("mac")>=0&&i!=="Mac"&&i!=="iOS")return!0;if((t.indexOf("win")===-1&&t.indexOf("linux")===-1&&t.indexOf("mac")===-1)!=(i==="Other"))return!0}if(n.indexOf("win")>=0&&i!=="Windows"&&i!=="Windows Phone")return!0;if((n.indexOf("linux")>=0||n.indexOf("android")>=0||n.indexOf("pike")>=0)&&i!=="Linux"&&i!=="Android")return!0;if((n.indexOf("mac")>=0||n.indexOf("ipad")>=0||n.indexOf("ipod")>=0||n.indexOf("iphone")>=0)&&i!=="Mac"&&i!=="iOS")return!0;if(n.indexOf("arm")>=0&&i==="Windows Phone")return!1;if(n.indexOf("pike")>=0&&e.indexOf("opera mini")>=0)return!1;var o=n.indexOf("win")<0&&n.indexOf("linux")<0&&n.indexOf("mac")<0&&n.indexOf("iphone")<0&&n.indexOf("ipad")<0&&n.indexOf("ipod")<0;return o!==(i==="Other")?!0:typeof navigator.plugins>"u"&&i!=="Windows"&&i!=="Windows Phone"}function ue(){var e=navigator.userAgent.toLowerCase(),t=navigator.productSub,n;if(e.indexOf("edge/")>=0||e.indexOf("iemobile/")>=0)return!1;if(e.indexOf("opera mini")>=0)return!1;if(e.indexOf("firefox/")>=0?n="Firefox":e.indexOf("opera/")>=0||e.indexOf(" opr/")>=0?n="Opera":e.indexOf("chrome/")>=0?n="Chrome":e.indexOf("safari/")>=0?e.indexOf("android 1.")>=0||e.indexOf("android 2.")>=0||e.indexOf("android 3.")>=0||e.indexOf("android 4.")>=0?n="AOSP":n="Safari":e.indexOf("trident/")>=0?n="Internet Explorer":n="Other",(n==="Chrome"||n==="Safari"||n==="Opera")&&t!=="20030107")return!0;var i=eval.toString().length;if(i===37&&n!=="Safari"&&n!=="Firefox"&&n!=="Other")return!0;if(i===39&&n!=="Internet Explorer"&&n!=="Other")return!0;if(i===33&&n!=="Chrome"&&n!=="AOSP"&&n!=="Opera"&&n!=="Other")return!0;var s;try{throw"a"}catch(o){try{o.toSource(),s=!0}catch{s=!1}}return s&&n!=="Firefox"&&n!=="Other"}function le(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight}function me(){if(typeof navigator.languages<"u")try{var e=navigator.languages[0].substr(0,2);if(e!==navigator.language.substr(0,2))return!0}catch{return!0}return!1}function $(){return{has_lied_os:de(),has_lied_browser:ue(),has_lied_resolution:le(),has_lied_languages:me()}}var J=()=>{var e=document.body.appendChild(document.createElement("canvas")),t=e.getContext("2d");e.height=200,e.width=500;var n="This is a random text to generate canvas ID :) 123@";t.textBaseline="top",t.font="14px 'Arial'",t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText(n,4,17),t.globalCompositeOperation="multiply",t.fillStyle="rgb(255,0,255)",t.beginPath(),t.arc(50,50,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(0,255,255)",t.beginPath(),t.arc(100,50,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(255,255,0)",t.beginPath(),t.arc(75,100,50,0,Math.PI*2,!0),t.closePath(),t.fill(),t.fillStyle="rgb(255,0,255)",t.arc(75,75,75,0,Math.PI*2,!0),t.arc(75,75,25,0,Math.PI*2,!0),t.fill("evenodd");var i=function(){for(var o=1,r,f=[],v=[];++o<18;)for(r=o*o;r<312;r+=o)f[r]=1;function x(g,p){return Math.pow(g,1/p)%1*4294967296|0}for(o=1,r=0;o<313;)f[++o]||(v[r]=x(o,2),f[r++]=x(o,3));function a(g,p){return g>>>p|g<<32-p}function D(g){for(var p=v.slice(o=0),u=unescape(encodeURI(g)),l=[],c=u.length,m=[],h,y,d;o<c;)m[o>>2]|=(u.charCodeAt(o)&255)<<8*(3-o++%4);for(c*=8,m[c>>5]|=128<<24-c%32,m[d=c+64>>5|15]=c,o=0;o<d;o+=16){for(h=p.slice(r=0,8);r<64;h[4]+=y)r<16?l[r]=m[r+o]:l[r]=(a(y=l[r-2],17)^a(y,19)^y>>>10)+(l[r-7]|0)+(a(y=l[r-15],7)^a(y,18)^y>>>3)+(l[r-16]|0),h.unshift((y=(h.pop()+(a(g=h[4],6)^a(g,11)^a(g,25))+((g&h[5]^~g&h[6])+f[r])|0)+(l[r++]|0))+(a(c=h[0],2)^a(c,13)^a(c,22))+(c&h[1]^h[1]&h[2]^h[2]&c));for(r=8;r--;)p[r]=h[r]+p[r]}for(u="";r<63;)u+=(p[++r>>3]>>4*(7-r%8)&15).toString(16);return u}return D}();let s=i(e.toDataURL());return document.body.removeChild(e),s};function O(e,t){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535],t=[t[0]>>>16,t[0]&65535,t[1]>>>16,t[1]&65535];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function A(e,t){e=[e[0]>>>16,e[0]&65535,e[1]>>>16,e[1]&65535],t=[t[0]>>>16,t[0]&65535,t[1]>>>16,t[1]&65535];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function P(e,t){return t%=64,t===32?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function b(e,t){return t%=64,t===0?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function w(e,t){return[e[0]^t[0],e[1]^t[1]]}function Q(e){return e=w(e,[0,e[0]>>>1]),e=A(e,[4283543511,3981806797]),e=w(e,[0,e[0]>>>1]),e=A(e,[3301882366,444984403]),e=w(e,[0,e[0]>>>1]),e}function L(e,t){e=e||"",t=t||0;for(var n=e.length%16,i=e.length-n,s=[0,t],o=[0,t],r=[0,0],f=[0,0],v=[2277735313,289559509],x=[1291169091,658871167],a=0;a<i;a=a+16)r=[e.charCodeAt(a+4)&255|(e.charCodeAt(a+5)&255)<<8|(e.charCodeAt(a+6)&255)<<16|(e.charCodeAt(a+7)&255)<<24,e.charCodeAt(a)&255|(e.charCodeAt(a+1)&255)<<8|(e.charCodeAt(a+2)&255)<<16|(e.charCodeAt(a+3)&255)<<24],f=[e.charCodeAt(a+12)&255|(e.charCodeAt(a+13)&255)<<8|(e.charCodeAt(a+14)&255)<<16|(e.charCodeAt(a+15)&255)<<24,e.charCodeAt(a+8)&255|(e.charCodeAt(a+9)&255)<<8|(e.charCodeAt(a+10)&255)<<16|(e.charCodeAt(a+11)&255)<<24],r=A(r,v),r=P(r,31),r=A(r,x),s=w(s,r),s=P(s,27),s=O(s,o),s=O(A(s,[0,5]),[0,1390208809]),f=A(f,x),f=P(f,33),f=A(f,v),o=w(o,f),o=P(o,31),o=O(o,s),o=O(A(o,[0,5]),[0,944331445]);switch(r=[0,0],f=[0,0],n){case 15:f=w(f,b([0,e.charCodeAt(a+14)],48));case 14:f=w(f,b([0,e.charCodeAt(a+13)],40));case 13:f=w(f,b([0,e.charCodeAt(a+12)],32));case 12:f=w(f,b([0,e.charCodeAt(a+11)],24));case 11:f=w(f,b([0,e.charCodeAt(a+10)],16));case 10:f=w(f,b([0,e.charCodeAt(a+9)],8));case 9:f=w(f,[0,e.charCodeAt(a+8)]),f=A(f,x),f=P(f,33),f=A(f,v),o=w(o,f);case 8:r=w(r,b([0,e.charCodeAt(a+7)],56));case 7:r=w(r,b([0,e.charCodeAt(a+6)],48));case 6:r=w(r,b([0,e.charCodeAt(a+5)],40));case 5:r=w(r,b([0,e.charCodeAt(a+4)],32));case 4:r=w(r,b([0,e.charCodeAt(a+3)],24));case 3:r=w(r,b([0,e.charCodeAt(a+2)],16));case 2:r=w(r,b([0,e.charCodeAt(a+1)],8));case 1:r=w(r,[0,e.charCodeAt(a)]),r=A(r,v),r=P(r,31),r=A(r,x),s=w(s,r)}return s=w(s,[0,e.length]),o=w(o,[0,e.length]),s=O(s,o),o=O(o,s),s=Q(s),o=Q(o),s=O(s,o),o=O(o,s),("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}var Z=()=>{var e,t,n=256,i=128;e=document.body.appendChild(document.createElement("canvas")),e.width=n,e.height=i,t=e.getContext("webgl2")||e.getContext("experimental-webgl2")||e.getContext("webgl")||e.getContext("experimental-webgl")||e.getContext("moz-webgl");let s={};try{if(t){var o=t.getExtension("WEBGL_debug_renderer_info");if(o){var r=t.getParameter(o.UNMASKED_VENDOR_WEBGL),f=t.getParameter(o.UNMASKED_RENDERER_WEBGL);s.webglVendor=r,s.webglRenderer=f}}var v="attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}",x="precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}",a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a);var D=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.7321,0]);t.bufferData(t.ARRAY_BUFFER,D,t.STATIC_DRAW),a.itemSize=3,a.numItems=3;var g=t.createProgram(),p=t.createShader(t.VERTEX_SHADER);t.shaderSource(p,v),t.compileShader(p);var u=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(u,x),t.compileShader(u),t.attachShader(g,p),t.attachShader(g,u),t.linkProgram(g),t.useProgram(g),g.vertexPosAttrib=t.getAttribLocation(g,"attrVertex"),g.offsetUniform=t.getUniformLocation(g,"uniformOffset"),t.enableVertexAttribArray(g.vertexPosArray),t.vertexAttribPointer(g.vertexPosAttrib,a.itemSize,t.FLOAT,!1,0,0),t.uniform2f(g.offsetUniform,1,1),t.drawArrays(t.TRIANGLE_STRIP,0,a.numItems),document.body.removeChild(e)}catch{}var l="",c=new Uint8Array(n*i*4);t.readPixels(0,0,n,i,t.RGBA,t.UNSIGNED_BYTE,c),l=JSON.stringify(c).replace(/,?"[0-9]+":/g,"");let m=L(l,69);return s.webglId=m,s};var j=()=>({isWebdriver:navigator.webdriver});var ee=function(){var e=null,t=null,n=null,i=null,s=null,o=null;function r(u,l=!1){o=u;try{f(),n.connect(i),i.connect(e.destination),n.start(0),e.startRendering(),e.oncomplete=g}catch(c){if(l)throw c}}function f(){v(),t=e.currentTime,x(),a()}function v(){var u=window.OfflineAudioContext||window.webkitOfflineAudioContext;e=new u(1,44100,44100)}function x(){n=e.createOscillator(),n.type="triangle",n.frequency.setValueAtTime(1e4,t)}function a(){i=e.createDynamicsCompressor(),D("threshold",-50),D("knee",40),D("ratio",12),D("reduction",-20),D("attack",0),D("release",.25)}function D(u,l){i[u]!==void 0&&typeof i[u].setValueAtTime=="function"&&i[u].setValueAtTime(l,e.currentTime)}function g(u){p(u),i.disconnect()}function p(u){for(var l=null,c=4500;5e3>c;c++){var m=u.renderedBuffer.getChannelData(0)[c];l+=Math.abs(m)}if(s=l.toString(),typeof o=="function")return o(s)}return{run:r}}();var ge=async()=>{let e=await he(),t=ve(),n=$(),i=ye(),s=De(),o=Se(),r=await Ce(),f=Ae(),v=Te(),x=Oe(),a=_e(),D=Me(),g=J(),p=Pe(),u=Z(),l=await Be(),c=j(),m=await ke();return{browserInfo:e,batteryInfo:m,windowInfo:t,hasLiedParamters:n,adBlock:i,dateOffsetTimezone:s,osDetails:o,localIPAddress:r,audioDetails:f,deviceOrientation:v,deviceMotion:x,deviceLight:a,proximityEvent:D,canvasId:g,audioFingerPrintFrequency:p,webglInfo:u,botInfo:c,fonts_available:l}};async function he(){return{browser_userAgent:navigator.userAgent,browser_appName:navigator.appName,browser_appCodeName:navigator.appCodeName,browser_appVersion:navigator.appVersion,browser_platform:navigator.platform,browser_product:navigator.product,browser_productSub:navigator.productSub,browser_vendor:navigator.vendor,browser_vendorSub:navigator.vendorSub,browser_buildID:navigator.buildID,browser_oscpu:navigator.oscpu,browser_language:navigator.language,browser_hardwareConcurrency:navigator.hardwareConcurrency,browser_doNotTrack:navigator.doNotTrack==="unspecified"?-1:navigator.doNotTrack,browser_connection:navigator.connection,browser_maxTouchPoints:navigator.maxTouchPoints,browser_plugins:we(),browser_permissions:navigator.permissions,is_incognito:await X()}}function we(){return Array.from(navigator.plugins).map(e=>({name:e.name,description:e.description,filename:e.filename}))}function ve(){return{window_colorDepth:window.screen.colorDepth,window_width:window.screen.width,window_height:window.screen.height,window_availWidth:window.screen.availWidth,window_availHeight:window.screen.availHeight,window_devicePixelRatio:window.devicePixelRatio,window_cookieEnabled:window.navigator.cookieEnabled,window_sessionStorage:pe(),window_localStorage:xe(),window_indexedDB:!!window.indexedDB,window_openDatabase:!!window.openDatabase}}function pe(){let e;try{e=!!window.sessionStorage}catch{e=!1}finally{return e}}function xe(){let e;try{e=!!window.localStorage}catch{e=!1}finally{return e}}function ye(){var e=document.createElement("div");e.innerHTML=" ",e.className="adsbox";var t=!1;try{document.body.appendChild(e),t=document.getElementsByClassName("adsbox")[0].offsetHeight===0,document.body.removeChild(e)}catch{t=!1}return t}function De(){return new Date().getTimezoneOffset()}function k(){let e=navigator.userAgent.toLowerCase(),t;return e.indexOf("windows phone")>=0?t="Windows Phone":e.indexOf("windows")>=0||e.indexOf("win16")>=0||e.indexOf("win32")>=0||e.indexOf("win64")>=0||e.indexOf("win95")>=0||e.indexOf("win98")>=0||e.indexOf("winnt")>=0||e.indexOf("wow64")>=0?t="Windows":e.indexOf("android")>=0?t="Android":e.indexOf("linux")>=0||e.indexOf("cros")>=0||e.indexOf("x11")>=0?t="Linux":e.indexOf("iphone")>=0||e.indexOf("ipad")>=0||e.indexOf("ipod")>=0||e.indexOf("crios")>=0||e.indexOf("fxios")>=0?t="iOS":e.indexOf("macintosh")>=0||e.indexOf("mac_powerpc)")>=0?t="Mac":t="Other",t}function Se(){return{osName:k(),osVersion:navigator.userAgent}}async function be(){return await(await fetch("https://api.ipify.org?format=json")).json()}async function Ce(){let e=await be();return{local_ip_address:e&&e.ip}}function Ae(){let e=new(window.AudioContext||window.webkitAudioContext);if(e)return{sampleRate:e.sampleRate,destination:{maxChannelCount:e.destination.maxChannelCount,channelCount:e.destination.channelCount,channelCountMode:e.destination.channelCountMode,channelInterpretation:e.destination.channelInterpretation},currentTime:e.currentTime,state:e.state,baseLatency:e.baseLatency}}function Te(){if(window.DeviceOrientationEvent)return window.addEventListener("deviceorientation",function(e){return{rotateDegrees:e.alpha,leftToRight:e.gamma,frontToBack:e.beta}},!0)}function Oe(){return window.addEventListener("devicemotion",function(e){return{x:e.accelerationIncludingGravity.x,y:e.accelerationIncludingGravity.y,z:e.accelerationIncludingGravity.z}},!0)}function _e(){let e;return window.addEventListener("devicelight",function(t){e=t.value}),e}function Me(){let e;return window.addEventListener("userproximity",function(t){e=t.near}),e}function Pe(){let e=Ie();return L(e,69)}function Ie(){ee.run(function(e){return e})}async function Be(){try{let e=new Set(["Arial","Arial Black","Bahnschrift","Calibri","Cambria","Cambria Math","Candara","Comic Sans MS","Consolas","Constantia","Corbel","Courier New","Ebrima","Franklin Gothic Medium","Gabriola","Gadugi","Georgia","HoloLens MDL2 Assets","Impact","Ink Free","Javanese Text","Leelawadee UI","Lucida Console","Lucida Sans Unicode","Malgun Gothic","Marlett","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Sans Serif","Microsoft Tai Le","Microsoft YaHei","Microsoft Yi Baiti","MingLiU-ExtB","Mongolian Baiti","MS Gothic","MV Boli","Myanmar Text","Nirmala UI","Palatino Linotype","Segoe MDL2 Assets","Segoe Print","Segoe Script","Segoe UI","Segoe UI Historic","Segoe UI Emoji","Segoe UI Symbol","SimSun","Sitka","Sylfaen","Symbol","Tahoma","Times New Roman","Trebuchet MS","Verdana","Webdings","Wingdings","Yu Gothic","American Typewriter","Andale Mono","Arial","Arial Black","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Avenir","Avenir Next","Avenir Next Condensed","Baskerville","Big Caslon","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bradley Hand","Brush Script MT","Chalkboard","Chalkboard SE","Chalkduster","Charter","Cochin","Comic Sans MS","Copperplate","Courier","Courier New","Didot","DIN Alternate","DIN Condensed","Futura","Geneva","Georgia","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Impact","Lucida Grande","Luminari","Marker Felt","Menlo","Microsoft Sans Serif","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Tahoma","Times","Times New Roman","Trattatello","Trebuchet MS","Verdana","Zapfino"].sort()),t=new Set;return await(async()=>{await document.fonts.ready;for(let n of e.values())document.fonts.check(`12px "${n}"`)&&t.add(n)})(),[...t.values()]}catch{return[]}}async function ke(){try{let e=await navigator.getBattery();return e?{charging:e.charging?"Charging":"Not Charging",level:e.level*100,chargingTime:e.chargingTime,dischargingTime:e.dischargingTime}:void 0}catch{return{}}}var G=async()=>await ge();var E="1.3.1",Le="https://testweb.dwield.ai:8762/getSDK/isTokenValid";async function Y(e){if(!e||typeof e!="string")throw new Error("Invalid API Key provided. Please provide a valid API Key to initialize the SDK.");try{let t=await fetch(Le,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jwtToken:e})});if(!t.ok)throw new Error(`Server error: ${t.status}`);let n=await t.json();if(n.isValid!=="true"&&n.isValid!==!0)throw new Error("Invalid API Key. Unauthorized access.")}catch(t){throw new Error(`API Key validation failed: ${t.message}`)}}function te({apiKey:e}){return{product:"device_id",version:E,apiKey:e,async getDeviceData(){return await G()}}}async function Ee(e={}){let{apiKey:t,verbose:n}=e;return await Y(t),n&&console.log("[BB-SDK] Device Info SDK initialized"),te({apiKey:t})}function ne({apiKey:e}){return{product:"biometrics",version:E,apiKey:e,initKeyStrokeDynamics:N,stopKeyStrokeDynamics:F,initMouseDynamics:H,stopMouseDynamics:W,fetchMouseDynamicsData:U,fetchKeyStrockDynamicsData:V}}async function Ke(e={}){let{apiKey:t,verbose:n}=e;return await Y(t),n&&console.log("[BB-SDK] Biometrics SDK initialized"),ne({apiKey:t})}function Re({apiKey:e}){let t=ne({apiKey:e}),n=te({apiKey:e});return{product:"device_id_with_biometrics",version:E,apiKey:e,initKeyStrokeDynamics:t.initKeyStrokeDynamics,stopKeyStrokeDynamics:t.stopKeyStrokeDynamics,initMouseDynamics:t.initMouseDynamics,stopMouseDynamics:t.stopMouseDynamics,fetchMouseDynamicsData:t.fetchMouseDynamicsData,fetchKeyStrockDynamicsData:t.fetchKeyStrockDynamicsData,getDeviceData:n.getDeviceData,async getDeviceInfoWithBiometrics(){let i={keystroke:t.fetchKeyStrockDynamicsData(),mouse:t.fetchMouseDynamicsData()},s=await n.getDeviceData();return{behavioural:i,device:s,timestamp:new Date().toISOString()}}}}async function Ne(e={}){let{apiKey:t,verbose:n}=e;return await Y(t),n&&console.log("[BB-SDK] Device Info + Biometrics SDK initialized"),Re({apiKey:t})}
|
|
9
9
|
//# sourceMappingURL=index.cjs.js.map
|