@microblink/blinkid-verify-core 3.20.0-rc.0
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 +71 -0
- package/dist/blinkid-verify-core.js +1229 -0
- package/dist/resources/DO_NOT_MODIFY_THIS_DIRECTORY.md +2 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.data +0 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.js +125 -0
- package/dist/resources/advanced/BlinkIdVerifyModule.wasm +0 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.data +0 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.js +146 -0
- package/dist/resources/advanced-threads/BlinkIdVerifyModule.wasm +0 -0
- package/dist/resources/blinkid-verify-worker.js +924 -0
- package/dist/resources/size-manifest.json +10 -0
- package/package.json +33 -0
- package/types/BlinkIdVerifyCore.d.ts +30 -0
- package/types/BlinkIdVerifyCore.d.ts.map +1 -0
- package/types/generatePayloadForBlinkIdVerifyCloudApi.d.ts +238 -0
- package/types/generatePayloadForBlinkIdVerifyCloudApi.d.ts.map +1 -0
- package/types/index.d.ts +28 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.rollup.d.ts +1537 -0
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var J = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
|
+
};
|
|
5
|
+
var Ee = (e, r, t) => r in e ? be(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
|
|
6
|
+
var v = (e, r, t) => Ee(e, typeof r != "symbol" ? r + "" : r, t), V = (e, r, t) => r.has(e) || J("Cannot " + t);
|
|
7
|
+
var a = (e, r, t) => (V(e, r, "read from private field"), t ? t.call(e) : r.get(e)), P = (e, r, t) => r.has(e) ? J("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), y = (e, r, t, o) => (V(e, r, "write to private field"), o ? o.call(e, t) : r.set(e, t), t), $ = (e, r, t) => (V(e, r, "access private method"), t);
|
|
8
|
+
var Q = (e, r, t, o) => ({
|
|
9
|
+
set _(n) {
|
|
10
|
+
y(e, r, n, t);
|
|
11
|
+
},
|
|
12
|
+
get _() {
|
|
13
|
+
return a(e, r, o);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2019 Google LLC
|
|
19
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
20
|
+
*/
|
|
21
|
+
const se = Symbol("Comlink.proxy"), Pe = Symbol("Comlink.endpoint"), ke = Symbol("Comlink.releaseProxy"), I = Symbol("Comlink.finalizer"), O = Symbol("Comlink.thrown"), oe = (e) => typeof e == "object" && e !== null || typeof e == "function", Se = {
|
|
22
|
+
canHandle: (e) => oe(e) && e[se],
|
|
23
|
+
serialize(e) {
|
|
24
|
+
const { port1: r, port2: t } = new MessageChannel();
|
|
25
|
+
return q(e, r), [t, [t]];
|
|
26
|
+
},
|
|
27
|
+
deserialize(e) {
|
|
28
|
+
return e.start(), Le(e);
|
|
29
|
+
}
|
|
30
|
+
}, Te = {
|
|
31
|
+
canHandle: (e) => oe(e) && O in e,
|
|
32
|
+
serialize({ value: e }) {
|
|
33
|
+
let r;
|
|
34
|
+
return e instanceof Error ? r = {
|
|
35
|
+
isError: !0,
|
|
36
|
+
value: {
|
|
37
|
+
message: e.message,
|
|
38
|
+
name: e.name,
|
|
39
|
+
stack: e.stack
|
|
40
|
+
}
|
|
41
|
+
} : r = { isError: !1, value: e }, [r, []];
|
|
42
|
+
},
|
|
43
|
+
deserialize(e) {
|
|
44
|
+
throw e.isError ? Object.assign(new Error(e.value.message), e.value) : e.value;
|
|
45
|
+
}
|
|
46
|
+
}, ae = /* @__PURE__ */ new Map([
|
|
47
|
+
["proxy", Se],
|
|
48
|
+
["throw", Te]
|
|
49
|
+
]);
|
|
50
|
+
function ve(e, r) {
|
|
51
|
+
for (const t of e)
|
|
52
|
+
if (r === t || t === "*" || t instanceof RegExp && t.test(r))
|
|
53
|
+
return !0;
|
|
54
|
+
return !1;
|
|
55
|
+
}
|
|
56
|
+
function q(e, r = globalThis, t = ["*"]) {
|
|
57
|
+
r.addEventListener("message", function o(n) {
|
|
58
|
+
if (!n || !n.data)
|
|
59
|
+
return;
|
|
60
|
+
if (!ve(t, n.origin)) {
|
|
61
|
+
console.warn(`Invalid origin '${n.origin}' for comlink proxy`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const { id: s, type: u, path: l } = Object.assign({ path: [] }, n.data), i = (n.data.argumentList || []).map(T);
|
|
65
|
+
let c;
|
|
66
|
+
try {
|
|
67
|
+
const d = l.slice(0, -1).reduce((g, p) => g[p], e), m = l.reduce((g, p) => g[p], e);
|
|
68
|
+
switch (u) {
|
|
69
|
+
case "GET":
|
|
70
|
+
c = m;
|
|
71
|
+
break;
|
|
72
|
+
case "SET":
|
|
73
|
+
d[l.slice(-1)[0]] = T(n.data.value), c = !0;
|
|
74
|
+
break;
|
|
75
|
+
case "APPLY":
|
|
76
|
+
c = m.apply(d, i);
|
|
77
|
+
break;
|
|
78
|
+
case "CONSTRUCT":
|
|
79
|
+
{
|
|
80
|
+
const g = new m(...i);
|
|
81
|
+
c = de(g);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
case "ENDPOINT":
|
|
85
|
+
{
|
|
86
|
+
const { port1: g, port2: p } = new MessageChannel();
|
|
87
|
+
q(e, p), c = _(g, [g]);
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case "RELEASE":
|
|
91
|
+
c = void 0;
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
} catch (d) {
|
|
97
|
+
c = { value: d, [O]: 0 };
|
|
98
|
+
}
|
|
99
|
+
Promise.resolve(c).catch((d) => ({ value: d, [O]: 0 })).then((d) => {
|
|
100
|
+
const [m, g] = W(d);
|
|
101
|
+
r.postMessage(Object.assign(Object.assign({}, m), { id: s }), g), u === "RELEASE" && (r.removeEventListener("message", o), ie(r), I in e && typeof e[I] == "function" && e[I]());
|
|
102
|
+
}).catch((d) => {
|
|
103
|
+
const [m, g] = W({
|
|
104
|
+
value: new TypeError("Unserializable return value"),
|
|
105
|
+
[O]: 0
|
|
106
|
+
});
|
|
107
|
+
r.postMessage(Object.assign(Object.assign({}, m), { id: s }), g);
|
|
108
|
+
});
|
|
109
|
+
}), r.start && r.start();
|
|
110
|
+
}
|
|
111
|
+
function Re(e) {
|
|
112
|
+
return e.constructor.name === "MessagePort";
|
|
113
|
+
}
|
|
114
|
+
function ie(e) {
|
|
115
|
+
Re(e) && e.close();
|
|
116
|
+
}
|
|
117
|
+
function Le(e, r) {
|
|
118
|
+
const t = /* @__PURE__ */ new Map();
|
|
119
|
+
return e.addEventListener("message", function(n) {
|
|
120
|
+
const { data: s } = n;
|
|
121
|
+
if (!s || !s.id)
|
|
122
|
+
return;
|
|
123
|
+
const u = t.get(s.id);
|
|
124
|
+
if (u)
|
|
125
|
+
try {
|
|
126
|
+
u(s);
|
|
127
|
+
} finally {
|
|
128
|
+
t.delete(s.id);
|
|
129
|
+
}
|
|
130
|
+
}), j(e, t, [], r);
|
|
131
|
+
}
|
|
132
|
+
function A(e) {
|
|
133
|
+
if (e)
|
|
134
|
+
throw new Error("Proxy has been released and is not useable");
|
|
135
|
+
}
|
|
136
|
+
function ce(e) {
|
|
137
|
+
return R(e, /* @__PURE__ */ new Map(), {
|
|
138
|
+
type: "RELEASE"
|
|
139
|
+
}).then(() => {
|
|
140
|
+
ie(e);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const B = /* @__PURE__ */ new WeakMap(), F = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
144
|
+
const r = (B.get(e) || 0) - 1;
|
|
145
|
+
B.set(e, r), r === 0 && ce(e);
|
|
146
|
+
});
|
|
147
|
+
function xe(e, r) {
|
|
148
|
+
const t = (B.get(r) || 0) + 1;
|
|
149
|
+
B.set(r, t), F && F.register(e, r, e);
|
|
150
|
+
}
|
|
151
|
+
function Ne(e) {
|
|
152
|
+
F && F.unregister(e);
|
|
153
|
+
}
|
|
154
|
+
function j(e, r, t = [], o = function() {
|
|
155
|
+
}) {
|
|
156
|
+
let n = !1;
|
|
157
|
+
const s = new Proxy(o, {
|
|
158
|
+
get(u, l) {
|
|
159
|
+
if (A(n), l === ke)
|
|
160
|
+
return () => {
|
|
161
|
+
Ne(s), ce(e), r.clear(), n = !0;
|
|
162
|
+
};
|
|
163
|
+
if (l === "then") {
|
|
164
|
+
if (t.length === 0)
|
|
165
|
+
return { then: () => s };
|
|
166
|
+
const i = R(e, r, {
|
|
167
|
+
type: "GET",
|
|
168
|
+
path: t.map((c) => c.toString())
|
|
169
|
+
}).then(T);
|
|
170
|
+
return i.then.bind(i);
|
|
171
|
+
}
|
|
172
|
+
return j(e, r, [...t, l]);
|
|
173
|
+
},
|
|
174
|
+
set(u, l, i) {
|
|
175
|
+
A(n);
|
|
176
|
+
const [c, d] = W(i);
|
|
177
|
+
return R(e, r, {
|
|
178
|
+
type: "SET",
|
|
179
|
+
path: [...t, l].map((m) => m.toString()),
|
|
180
|
+
value: c
|
|
181
|
+
}, d).then(T);
|
|
182
|
+
},
|
|
183
|
+
apply(u, l, i) {
|
|
184
|
+
A(n);
|
|
185
|
+
const c = t[t.length - 1];
|
|
186
|
+
if (c === Pe)
|
|
187
|
+
return R(e, r, {
|
|
188
|
+
type: "ENDPOINT"
|
|
189
|
+
}).then(T);
|
|
190
|
+
if (c === "bind")
|
|
191
|
+
return j(e, r, t.slice(0, -1));
|
|
192
|
+
const [d, m] = Z(i);
|
|
193
|
+
return R(e, r, {
|
|
194
|
+
type: "APPLY",
|
|
195
|
+
path: t.map((g) => g.toString()),
|
|
196
|
+
argumentList: d
|
|
197
|
+
}, m).then(T);
|
|
198
|
+
},
|
|
199
|
+
construct(u, l) {
|
|
200
|
+
A(n);
|
|
201
|
+
const [i, c] = Z(l);
|
|
202
|
+
return R(e, r, {
|
|
203
|
+
type: "CONSTRUCT",
|
|
204
|
+
path: t.map((d) => d.toString()),
|
|
205
|
+
argumentList: i
|
|
206
|
+
}, c).then(T);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
return xe(s, e), s;
|
|
210
|
+
}
|
|
211
|
+
function Ue(e) {
|
|
212
|
+
return Array.prototype.concat.apply([], e);
|
|
213
|
+
}
|
|
214
|
+
function Z(e) {
|
|
215
|
+
const r = e.map(W);
|
|
216
|
+
return [r.map((t) => t[0]), Ue(r.map((t) => t[1]))];
|
|
217
|
+
}
|
|
218
|
+
const le = /* @__PURE__ */ new WeakMap();
|
|
219
|
+
function _(e, r) {
|
|
220
|
+
return le.set(e, r), e;
|
|
221
|
+
}
|
|
222
|
+
function de(e) {
|
|
223
|
+
return Object.assign(e, { [se]: !0 });
|
|
224
|
+
}
|
|
225
|
+
function W(e) {
|
|
226
|
+
for (const [r, t] of ae)
|
|
227
|
+
if (t.canHandle(e)) {
|
|
228
|
+
const [o, n] = t.serialize(e);
|
|
229
|
+
return [
|
|
230
|
+
{
|
|
231
|
+
type: "HANDLER",
|
|
232
|
+
name: r,
|
|
233
|
+
value: o
|
|
234
|
+
},
|
|
235
|
+
n
|
|
236
|
+
];
|
|
237
|
+
}
|
|
238
|
+
return [
|
|
239
|
+
{
|
|
240
|
+
type: "RAW",
|
|
241
|
+
value: e
|
|
242
|
+
},
|
|
243
|
+
le.get(e) || []
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
function T(e) {
|
|
247
|
+
switch (e.type) {
|
|
248
|
+
case "HANDLER":
|
|
249
|
+
return ae.get(e.name).deserialize(e.value);
|
|
250
|
+
case "RAW":
|
|
251
|
+
return e.value;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function R(e, r, t, o) {
|
|
255
|
+
return new Promise((n) => {
|
|
256
|
+
const s = Me();
|
|
257
|
+
r.set(s, n), e.start && e.start(), e.postMessage(Object.assign({ id: s }, t), o);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function Me() {
|
|
261
|
+
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
262
|
+
}
|
|
263
|
+
const Ae = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 3, 1, 0, 1, 10, 14, 1, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11])), Ce = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 2, 8, 1, 1, 97, 1, 98, 3, 127, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 5, 1, 1, 97, 3, 1])), Ie = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 7, 1, 5, 0, 208, 112, 26, 11])), Oe = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 12, 1, 10, 0, 67, 0, 0, 0, 0, 252, 0, 26, 11])), Be = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 8, 1, 6, 0, 65, 0, 192, 26, 11])), Fe = async () => WebAssembly.validate(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 10, 1, 8, 0, 65, 0, 253, 15, 253, 98, 11])), We = () => (async (e) => {
|
|
264
|
+
try {
|
|
265
|
+
return typeof MessageChannel < "u" && new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)), WebAssembly.validate(e);
|
|
266
|
+
} catch {
|
|
267
|
+
return !1;
|
|
268
|
+
}
|
|
269
|
+
})(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
|
|
270
|
+
function ze() {
|
|
271
|
+
const e = navigator.userAgent.toLowerCase();
|
|
272
|
+
return e.includes("safari") && !e.includes("chrome");
|
|
273
|
+
}
|
|
274
|
+
async function Ve() {
|
|
275
|
+
if (!await We())
|
|
276
|
+
return !1;
|
|
277
|
+
if (!("importScripts" in self))
|
|
278
|
+
throw Error("Not implemented");
|
|
279
|
+
return ze() ? !1 : "Worker" in self;
|
|
280
|
+
}
|
|
281
|
+
async function $e() {
|
|
282
|
+
const e = [
|
|
283
|
+
Ce(),
|
|
284
|
+
Ie(),
|
|
285
|
+
Ae(),
|
|
286
|
+
Oe(),
|
|
287
|
+
Be()
|
|
288
|
+
];
|
|
289
|
+
if (!(await Promise.all(e)).every(Boolean))
|
|
290
|
+
throw new Error("Browser doesn't meet minimum requirements!");
|
|
291
|
+
return await Fe() ? await Ve() ? "advanced-threads" : "advanced" : "basic";
|
|
292
|
+
}
|
|
293
|
+
const De = { advanced: 5446035, "advanced-threads": 5504391 }, je = { advanced: 14321999, "advanced-threads": 14321999 }, _e = {
|
|
294
|
+
wasm: De,
|
|
295
|
+
data: je
|
|
296
|
+
};
|
|
297
|
+
function C(...e) {
|
|
298
|
+
const r = e.filter((t) => t).join("/").replace(/([^:]\/)\/+/g, "$1");
|
|
299
|
+
try {
|
|
300
|
+
new URL(r, "http://example.com");
|
|
301
|
+
} catch {
|
|
302
|
+
throw new Error(`Invalid URL: ${r}`);
|
|
303
|
+
}
|
|
304
|
+
return r;
|
|
305
|
+
}
|
|
306
|
+
async function ee(e, r) {
|
|
307
|
+
var p;
|
|
308
|
+
const { url: t, fileType: o, variant: n, buildType: s, progressCallback: u } = e, l = await fetch(t);
|
|
309
|
+
if (!u)
|
|
310
|
+
return l.arrayBuffer();
|
|
311
|
+
const i = l.headers.get("Content-Length"), c = i ? parseInt(i, 10) : r({ fileType: o, variant: n, buildType: s });
|
|
312
|
+
if (isNaN(c) || c <= 0)
|
|
313
|
+
throw new Error(`Invalid content length for ${o} file: ${c}`);
|
|
314
|
+
let d = 0;
|
|
315
|
+
const m = new TransformStream({
|
|
316
|
+
transform(E, M) {
|
|
317
|
+
d += E.length;
|
|
318
|
+
const z = Math.min(Math.round(d / c * 100), 100);
|
|
319
|
+
u({
|
|
320
|
+
loaded: d,
|
|
321
|
+
contentLength: c,
|
|
322
|
+
progress: z,
|
|
323
|
+
finished: !1
|
|
324
|
+
}), M.enqueue(E);
|
|
325
|
+
},
|
|
326
|
+
flush() {
|
|
327
|
+
u({
|
|
328
|
+
loaded: d,
|
|
329
|
+
contentLength: c,
|
|
330
|
+
progress: 100,
|
|
331
|
+
finished: !0
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
return new Response((p = l.body) == null ? void 0 : p.pipeThrough(m), l).arrayBuffer();
|
|
336
|
+
}
|
|
337
|
+
const re = "application/javascript", qe = (e, r = {}) => {
|
|
338
|
+
const t = {
|
|
339
|
+
skipSameOrigin: !0,
|
|
340
|
+
useBlob: !0,
|
|
341
|
+
...r
|
|
342
|
+
};
|
|
343
|
+
return t.skipSameOrigin && new URL(e).origin === self.location.origin ? Promise.resolve(e) : new Promise((o, n) => void fetch(e).then((s) => s.text()).then((s) => {
|
|
344
|
+
new URL(e).href.split("/").pop();
|
|
345
|
+
let l = "";
|
|
346
|
+
if (t.useBlob) {
|
|
347
|
+
const i = new Blob([s], { type: re });
|
|
348
|
+
l = URL.createObjectURL(i);
|
|
349
|
+
} else
|
|
350
|
+
l = `data:${re},` + encodeURIComponent(s);
|
|
351
|
+
o(l);
|
|
352
|
+
}).catch(n));
|
|
353
|
+
};
|
|
354
|
+
function He(e, r) {
|
|
355
|
+
const t = r[e.fileType][e.variant];
|
|
356
|
+
if (typeof t == "number")
|
|
357
|
+
return t;
|
|
358
|
+
if (e.buildType === void 0)
|
|
359
|
+
throw new Error("buildType is required when size manifest entry is build-aware");
|
|
360
|
+
return t[e.buildType];
|
|
361
|
+
}
|
|
362
|
+
function Ge() {
|
|
363
|
+
const e = self.navigator.userAgent.toLowerCase();
|
|
364
|
+
return /iphone|ipad|ipod/.test(e);
|
|
365
|
+
}
|
|
366
|
+
function Ye(e) {
|
|
367
|
+
return {
|
|
368
|
+
licenseId: e.licenseId,
|
|
369
|
+
licensee: e.licensee,
|
|
370
|
+
applicationIds: e.applicationIds,
|
|
371
|
+
packageName: e.packageName,
|
|
372
|
+
platform: "Browser",
|
|
373
|
+
sdkName: e.sdkName,
|
|
374
|
+
sdkVersion: e.sdkVersion
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
async function te(e, r = "https://baltazar.microblink.com/api/v2/status/check") {
|
|
378
|
+
if (!r || typeof r != "string")
|
|
379
|
+
throw new Error("Invalid baltazarUrl: must be a non-empty string");
|
|
380
|
+
try {
|
|
381
|
+
new URL(r);
|
|
382
|
+
} catch {
|
|
383
|
+
throw new Error(`Invalid baltazarUrl format: ${r}`);
|
|
384
|
+
}
|
|
385
|
+
try {
|
|
386
|
+
const t = await fetch(r, {
|
|
387
|
+
method: "POST",
|
|
388
|
+
headers: {
|
|
389
|
+
"Content-Type": "application/json"
|
|
390
|
+
},
|
|
391
|
+
cache: "no-cache",
|
|
392
|
+
body: JSON.stringify(Ye(e))
|
|
393
|
+
});
|
|
394
|
+
if (!t.ok)
|
|
395
|
+
throw new Error(`Server returned error: ${t.status} ${t.statusText}`);
|
|
396
|
+
return await t.text();
|
|
397
|
+
} catch (t) {
|
|
398
|
+
throw console.error("Server permission request failed:", t), t;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function ne(e) {
|
|
402
|
+
return Math.ceil(e * 1024 * 1024 / 64 / 1024);
|
|
403
|
+
}
|
|
404
|
+
class D extends Error {
|
|
405
|
+
constructor(t, o, n) {
|
|
406
|
+
super(`Proxy URL validation failed for "${n}": ${o}`);
|
|
407
|
+
v(this, "code");
|
|
408
|
+
v(this, "url");
|
|
409
|
+
this.code = t, this.url = n, this.name = "ProxyUrlValidationError";
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
function Ke(e) {
|
|
413
|
+
const r = e.unlockResult === "requires-server-permission", { allowPingProxy: t, allowBaltazarProxy: o, hasPing: n } = e;
|
|
414
|
+
if (!t && !o)
|
|
415
|
+
throw new Error("Microblink proxy URL is set but your license doesn't permit proxy usage. Check your license.");
|
|
416
|
+
if (!r && !n)
|
|
417
|
+
throw new Error("Microblink proxy URL is set but your license doesn't permit proxy usage. Check your license.");
|
|
418
|
+
if (!r && n && o && !t || r && !n && !o && t)
|
|
419
|
+
throw new Error("Microblink proxy URL is set but your license doesn't permit proxy usage. Check your license.");
|
|
420
|
+
}
|
|
421
|
+
function Xe(e) {
|
|
422
|
+
let r;
|
|
423
|
+
try {
|
|
424
|
+
r = new URL(e);
|
|
425
|
+
} catch {
|
|
426
|
+
throw new D("INVALID_PROXY_URL", `Failed to create URL instance for provided Microblink proxy URL "${e}". Expected format: https://your-proxy.com or https://your-proxy.com/`, e);
|
|
427
|
+
}
|
|
428
|
+
if (r.protocol !== "https:")
|
|
429
|
+
throw new D("HTTPS_REQUIRED", `Proxy URL validation failed for "${e}": HTTPS protocol must be used. Expected format: https://your-proxy.com or https://your-proxy.com/`, e);
|
|
430
|
+
const t = r.origin;
|
|
431
|
+
try {
|
|
432
|
+
const o = new URL(`${r.pathname}${r.pathname.endsWith("/") ? "" : "/"}api/v2/status/check`, t).toString();
|
|
433
|
+
return {
|
|
434
|
+
ping: t + r.pathname.replace(/\/$/, ""),
|
|
435
|
+
baltazar: o
|
|
436
|
+
};
|
|
437
|
+
} catch {
|
|
438
|
+
throw new D("INVALID_PROXY_URL", "Failed to build baltazar service URL", e);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
class Je extends Error {
|
|
442
|
+
constructor(t) {
|
|
443
|
+
super(t);
|
|
444
|
+
v(this, "code", "SERVER_PERMISSION_ERROR");
|
|
445
|
+
this.name = "ServerPermissionError";
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
class Qe extends Error {
|
|
449
|
+
constructor(t) {
|
|
450
|
+
super(t);
|
|
451
|
+
v(this, "code", "LICENSE_ERROR");
|
|
452
|
+
this.name = "LicenseError";
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function Ze({ workerScope: e, getSessionNumber: r, onError: t }) {
|
|
456
|
+
const o = e ?? self, n = r ?? (() => 0);
|
|
457
|
+
let s = !1;
|
|
458
|
+
const u = (c, d) => {
|
|
459
|
+
if (!s) {
|
|
460
|
+
s = !0;
|
|
461
|
+
try {
|
|
462
|
+
t({
|
|
463
|
+
origin: c,
|
|
464
|
+
error: d,
|
|
465
|
+
sessionNumber: n()
|
|
466
|
+
});
|
|
467
|
+
} finally {
|
|
468
|
+
s = !1;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}, l = (c) => {
|
|
472
|
+
const d = c;
|
|
473
|
+
u("worker.onerror", d.error ?? d.message ?? "Unknown worker error");
|
|
474
|
+
}, i = (c) => {
|
|
475
|
+
u("worker.unhandledrejection", c.reason ?? "Unhandled worker rejection");
|
|
476
|
+
};
|
|
477
|
+
return o.addEventListener("error", l), o.addEventListener("unhandledrejection", i), () => {
|
|
478
|
+
o.removeEventListener("error", l), o.removeEventListener("unhandledrejection", i);
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
const ue = "FrameTransferError", er = (e, r) => {
|
|
482
|
+
const t = r instanceof Error && r.message ? `: ${r.message}` : "", o = new Error(
|
|
483
|
+
`${e}${t}`,
|
|
484
|
+
r instanceof Error ? { cause: r } : void 0
|
|
485
|
+
);
|
|
486
|
+
return o.name = ue, o;
|
|
487
|
+
};
|
|
488
|
+
var h, b, N, U, w, k, L, S, x, he, fe;
|
|
489
|
+
class rr {
|
|
490
|
+
constructor() {
|
|
491
|
+
P(this, x);
|
|
492
|
+
/**
|
|
493
|
+
* The Wasm module.
|
|
494
|
+
*/
|
|
495
|
+
P(this, h);
|
|
496
|
+
/**
|
|
497
|
+
* Active scanning session created by this worker.
|
|
498
|
+
*/
|
|
499
|
+
P(this, b);
|
|
500
|
+
/**
|
|
501
|
+
* The progress status callback.
|
|
502
|
+
*/
|
|
503
|
+
v(this, "progressStatusCallback");
|
|
504
|
+
/**
|
|
505
|
+
* Whether the demo overlay is shown.
|
|
506
|
+
*/
|
|
507
|
+
P(this, N, !0);
|
|
508
|
+
/**
|
|
509
|
+
* Whether the production overlay is shown.
|
|
510
|
+
*/
|
|
511
|
+
P(this, U, !0);
|
|
512
|
+
/**
|
|
513
|
+
* The current session number.
|
|
514
|
+
*/
|
|
515
|
+
P(this, w, 0);
|
|
516
|
+
/**
|
|
517
|
+
* Sanitized proxy URLs for Microblink services.
|
|
518
|
+
*/
|
|
519
|
+
P(this, k);
|
|
520
|
+
P(this, L);
|
|
521
|
+
P(this, S);
|
|
522
|
+
y(this, S, Ze({
|
|
523
|
+
getSessionNumber: () => a(this, w),
|
|
524
|
+
onError: ({ error: r, sessionNumber: t }) => {
|
|
525
|
+
a(this, h) && (this.reportPinglet({
|
|
526
|
+
schemaName: "ping.error",
|
|
527
|
+
schemaVersion: "1.0.0",
|
|
528
|
+
sessionNumber: t,
|
|
529
|
+
data: {
|
|
530
|
+
errorType: "Crash",
|
|
531
|
+
errorMessage: r instanceof Error ? r.message : String(r),
|
|
532
|
+
stackTrace: r instanceof Error ? r.stack : void 0
|
|
533
|
+
}
|
|
534
|
+
}), this.sendPinglets());
|
|
535
|
+
}
|
|
536
|
+
}));
|
|
537
|
+
}
|
|
538
|
+
reportPinglet({ data: r, schemaName: t, schemaVersion: o, sessionNumber: n }) {
|
|
539
|
+
if (!a(this, h))
|
|
540
|
+
throw new Error("Cannot report pinglet: Wasm module not loaded");
|
|
541
|
+
try {
|
|
542
|
+
a(this, h).queuePinglet(
|
|
543
|
+
JSON.stringify(r),
|
|
544
|
+
t,
|
|
545
|
+
o,
|
|
546
|
+
n
|
|
547
|
+
// we know sesion number is provided because we're using proxy function
|
|
548
|
+
);
|
|
549
|
+
} catch (s) {
|
|
550
|
+
console.warn("Failed to queue pinglet:", s, {
|
|
551
|
+
data: r,
|
|
552
|
+
schemaName: t,
|
|
553
|
+
schemaVersion: o,
|
|
554
|
+
sessionNumber: n
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
sendPinglets() {
|
|
559
|
+
if (!a(this, h))
|
|
560
|
+
throw new Error("Cannot send pinglets: Wasm module not loaded");
|
|
561
|
+
try {
|
|
562
|
+
a(this, h).sendPinglets();
|
|
563
|
+
} catch (r) {
|
|
564
|
+
console.warn("Failed to send pinglets:", r);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* This method initializes everything.
|
|
569
|
+
*/
|
|
570
|
+
async initBlinkIdVerify(r, t) {
|
|
571
|
+
var u, l;
|
|
572
|
+
const o = new URL(
|
|
573
|
+
"resources/",
|
|
574
|
+
r.resourcesLocation
|
|
575
|
+
).toString();
|
|
576
|
+
this.progressStatusCallback = t, y(this, L, r.userId);
|
|
577
|
+
const n = r.wasmVariant ?? await $e();
|
|
578
|
+
if (await $(this, x, he).call(this, {
|
|
579
|
+
resourceUrl: o,
|
|
580
|
+
wasmVariant: n,
|
|
581
|
+
initialMemory: r.initialMemory
|
|
582
|
+
}), !a(this, h))
|
|
583
|
+
throw new Error("Wasm module not loaded");
|
|
584
|
+
const s = a(this, h).initializeWithLicenseKey(
|
|
585
|
+
r.licenseKey,
|
|
586
|
+
r.userId,
|
|
587
|
+
!1
|
|
588
|
+
);
|
|
589
|
+
if (this.reportPinglet({
|
|
590
|
+
schemaName: "ping.sdk.init.start",
|
|
591
|
+
schemaVersion: "1.1.0",
|
|
592
|
+
sessionNumber: 0,
|
|
593
|
+
data: {
|
|
594
|
+
packageName: self.location.hostname,
|
|
595
|
+
platform: "Emscripten",
|
|
596
|
+
platformDetails: n,
|
|
597
|
+
product: "DocumentVerification",
|
|
598
|
+
userId: a(this, L)
|
|
599
|
+
}
|
|
600
|
+
}), s.licenseError)
|
|
601
|
+
throw new Qe(
|
|
602
|
+
"License unlock error: " + s.licenseError
|
|
603
|
+
);
|
|
604
|
+
if (r.microblinkProxyUrl && (Ke(s), y(this, k, Xe(r.microblinkProxyUrl)), s.allowPingProxy && s.hasPing && (a(this, h).setPingProxyUrl(a(this, k).ping), console.debug(`Using ping proxy URL: ${a(this, k).ping}`))), s.unlockResult === "requires-server-permission") {
|
|
605
|
+
const c = ((u = a(this, k)) == null ? void 0 : u.baltazar) && s.allowBaltazarProxy ? (l = a(this, k)) == null ? void 0 : l.baltazar : void 0;
|
|
606
|
+
c && console.debug(`Using Baltazar proxy URL: ${c}`);
|
|
607
|
+
const d = c ? await te(s, c) : await te(s), m = a(this, h).submitServerPermission(
|
|
608
|
+
d
|
|
609
|
+
);
|
|
610
|
+
if (m != null && m.error)
|
|
611
|
+
throw new Je(
|
|
612
|
+
"Server unlock error: " + m.error
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
try {
|
|
616
|
+
console.debug(
|
|
617
|
+
`BlinkId Verify ${s.sdkVersion} unlocked`
|
|
618
|
+
), y(this, N, s.showDemoOverlay), y(this, U, s.showProductionOverlay), a(this, h).initializeSdk(r.userId);
|
|
619
|
+
} catch (i) {
|
|
620
|
+
throw console.warn("Failed to initialize BlinkID SDK:", i), this.reportPinglet({
|
|
621
|
+
schemaName: "ping.error",
|
|
622
|
+
schemaVersion: "1.0.0",
|
|
623
|
+
sessionNumber: 0,
|
|
624
|
+
data: {
|
|
625
|
+
errorType: "Crash",
|
|
626
|
+
errorMessage: i instanceof Error ? i.message : String(i),
|
|
627
|
+
stackTrace: i instanceof Error ? i.stack : void 0
|
|
628
|
+
}
|
|
629
|
+
}), this.sendPinglets(), i;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* This method creates a BlinkIdVerify scanning session.
|
|
634
|
+
*
|
|
635
|
+
* @param sessionSettings - The options for the session.
|
|
636
|
+
* @returns The session.
|
|
637
|
+
*/
|
|
638
|
+
createScanningSession(r) {
|
|
639
|
+
if (!a(this, h))
|
|
640
|
+
throw new Error("Wasm module not loaded");
|
|
641
|
+
try {
|
|
642
|
+
const t = a(this, h).createScanningSession(r, a(this, L));
|
|
643
|
+
return Q(this, w)._++, this.sendPinglets(), $(this, x, fe).call(this, t, r);
|
|
644
|
+
} catch (t) {
|
|
645
|
+
throw this.reportPinglet({
|
|
646
|
+
schemaName: "ping.error",
|
|
647
|
+
schemaVersion: "1.0.0",
|
|
648
|
+
sessionNumber: a(this, w),
|
|
649
|
+
data: {
|
|
650
|
+
errorType: "Crash",
|
|
651
|
+
errorMessage: t instanceof Error ? t.message : String(t),
|
|
652
|
+
stackTrace: t instanceof Error ? t.stack : void 0
|
|
653
|
+
}
|
|
654
|
+
}), this.sendPinglets(), t;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* This method is called when the worker is terminated.
|
|
659
|
+
*/
|
|
660
|
+
[I]() {
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Terminates the workers and the Wasm runtime.
|
|
664
|
+
*/
|
|
665
|
+
async terminate() {
|
|
666
|
+
var o, n;
|
|
667
|
+
if (self.setTimeout(() => self.close, 5e3), a(this, b))
|
|
668
|
+
try {
|
|
669
|
+
a(this, b).isDeleted() || (console.debug("Deleting BlinkId session during terminate"), a(this, b).delete());
|
|
670
|
+
} catch (s) {
|
|
671
|
+
if (console.warn(
|
|
672
|
+
"Failed to delete BlinkId session during terminate:",
|
|
673
|
+
s
|
|
674
|
+
), !a(this, h))
|
|
675
|
+
return;
|
|
676
|
+
this.reportPinglet({
|
|
677
|
+
schemaName: "ping.error",
|
|
678
|
+
schemaVersion: "1.0.0",
|
|
679
|
+
sessionNumber: a(this, w),
|
|
680
|
+
data: {
|
|
681
|
+
errorType: "NonFatal",
|
|
682
|
+
errorMessage: s instanceof Error ? s.message : String(s),
|
|
683
|
+
stackTrace: s instanceof Error ? s.stack : void 0
|
|
684
|
+
}
|
|
685
|
+
}), this.sendPinglets();
|
|
686
|
+
} finally {
|
|
687
|
+
y(this, b, void 0);
|
|
688
|
+
}
|
|
689
|
+
if (!a(this, h)) {
|
|
690
|
+
(o = a(this, S)) == null || o.call(this), y(this, S, void 0), console.warn(
|
|
691
|
+
"No Wasm module loaded during worker termination. Skipping cleanup."
|
|
692
|
+
), self.close();
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
a(this, h).terminateSdk(), await new Promise((s) => setTimeout(s, 0)), this.sendPinglets();
|
|
696
|
+
const t = Date.now();
|
|
697
|
+
for (; a(this, h).arePingRequestsInProgress() && Date.now() - t < 5e3; )
|
|
698
|
+
await new Promise((s) => setTimeout(s, 100));
|
|
699
|
+
y(this, h, void 0), (n = a(this, S)) == null || n.call(this), y(this, S, void 0), console.debug("BlinkIdVerifyWorker terminated 🔴"), self.close();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
h = new WeakMap(), b = new WeakMap(), N = new WeakMap(), U = new WeakMap(), w = new WeakMap(), k = new WeakMap(), L = new WeakMap(), S = new WeakMap(), x = new WeakSet(), he = async function({ resourceUrl: r, wasmVariant: t, initialMemory: o }) {
|
|
703
|
+
if (a(this, h)) {
|
|
704
|
+
console.log("Wasm already loaded");
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const n = "BlinkIdVerifyModule", s = C(r, t), u = C(s, `${n}.js`), l = C(s, `${n}.wasm`), i = C(s, `${n}.data`), c = await qe(u), m = (await import(
|
|
708
|
+
/* @vite-ignore */
|
|
709
|
+
c
|
|
710
|
+
)).default;
|
|
711
|
+
o || (o = Ge() ? 700 : 200);
|
|
712
|
+
const g = new WebAssembly.Memory({
|
|
713
|
+
initial: ne(o),
|
|
714
|
+
maximum: ne(2048),
|
|
715
|
+
shared: t === "advanced-threads"
|
|
716
|
+
});
|
|
717
|
+
let p, E, M = 0;
|
|
718
|
+
const z = 32, H = () => {
|
|
719
|
+
if (!this.progressStatusCallback || !p || !E)
|
|
720
|
+
return;
|
|
721
|
+
const f = p.finished && E.finished, Y = p.loaded + E.loaded, K = p.contentLength + E.contentLength, we = f ? 100 : Math.min(Math.round(Y / K * 100), 100), X = performance.now();
|
|
722
|
+
X - M < z || (M = X, this.progressStatusCallback({
|
|
723
|
+
loaded: Y,
|
|
724
|
+
contentLength: K,
|
|
725
|
+
progress: we,
|
|
726
|
+
finished: f
|
|
727
|
+
}));
|
|
728
|
+
}, me = (f) => {
|
|
729
|
+
p = f, H();
|
|
730
|
+
}, ge = (f) => {
|
|
731
|
+
E = f, H();
|
|
732
|
+
}, G = (f) => He(f, _e), [pe, ye] = await Promise.all([
|
|
733
|
+
ee(
|
|
734
|
+
{
|
|
735
|
+
url: l,
|
|
736
|
+
fileType: "wasm",
|
|
737
|
+
variant: t,
|
|
738
|
+
progressCallback: me
|
|
739
|
+
},
|
|
740
|
+
G
|
|
741
|
+
),
|
|
742
|
+
ee(
|
|
743
|
+
{
|
|
744
|
+
url: i,
|
|
745
|
+
fileType: "data",
|
|
746
|
+
variant: t,
|
|
747
|
+
progressCallback: ge
|
|
748
|
+
},
|
|
749
|
+
G
|
|
750
|
+
)
|
|
751
|
+
]);
|
|
752
|
+
if (this.progressStatusCallback && p && E) {
|
|
753
|
+
const f = p.contentLength + E.contentLength;
|
|
754
|
+
this.progressStatusCallback({
|
|
755
|
+
loaded: f,
|
|
756
|
+
contentLength: f,
|
|
757
|
+
progress: 100,
|
|
758
|
+
finished: !0
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
if (y(this, h, await m({
|
|
762
|
+
locateFile: (f) => `${s}/${t}/${f}`,
|
|
763
|
+
onAbort: (f) => {
|
|
764
|
+
a(this, h) && (this.reportPinglet({
|
|
765
|
+
schemaName: "ping.error",
|
|
766
|
+
schemaVersion: "1.0.0",
|
|
767
|
+
sessionNumber: a(this, w),
|
|
768
|
+
data: {
|
|
769
|
+
errorType: "Crash",
|
|
770
|
+
errorMessage: f instanceof Error ? f.message : String(f),
|
|
771
|
+
stackTrace: f instanceof Error ? f.stack : void 0
|
|
772
|
+
}
|
|
773
|
+
}), this.sendPinglets());
|
|
774
|
+
},
|
|
775
|
+
printErr: (f) => {
|
|
776
|
+
if (console.error(f), /\babort(ed)?\b/i.test(f)) {
|
|
777
|
+
if (!a(this, h))
|
|
778
|
+
return;
|
|
779
|
+
this.reportPinglet({
|
|
780
|
+
schemaName: "ping.error",
|
|
781
|
+
schemaVersion: "1.0.0",
|
|
782
|
+
sessionNumber: a(this, w),
|
|
783
|
+
data: {
|
|
784
|
+
errorType: "Crash",
|
|
785
|
+
errorMessage: String(f),
|
|
786
|
+
stackTrace: void 0
|
|
787
|
+
}
|
|
788
|
+
}), this.sendPinglets();
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
// pthreads build breaks without this:
|
|
792
|
+
// "Failed to execute 'createObjectURL' on 'URL': Overload resolution failed."
|
|
793
|
+
mainScriptUrlOrBlob: c,
|
|
794
|
+
wasmBinary: pe,
|
|
795
|
+
getPreloadedPackage() {
|
|
796
|
+
return ye;
|
|
797
|
+
},
|
|
798
|
+
wasmMemory: g,
|
|
799
|
+
noExitRuntime: !0
|
|
800
|
+
})), !a(this, h))
|
|
801
|
+
throw new Error("Failed to load Wasm module");
|
|
802
|
+
}, /**
|
|
803
|
+
* This method creates a proxy session.
|
|
804
|
+
*
|
|
805
|
+
* @param session - The session.
|
|
806
|
+
* @param sessionSettings - The session settings.
|
|
807
|
+
* @returns The proxy session.
|
|
808
|
+
*/
|
|
809
|
+
fe = function(r, t) {
|
|
810
|
+
return y(this, b, r), de({
|
|
811
|
+
getResult: () => {
|
|
812
|
+
try {
|
|
813
|
+
const n = r.getResult(), s = (d) => !d || !d.orientation ? void 0 : {
|
|
814
|
+
jpegBytes: new Uint8Array(d.jpegBytes),
|
|
815
|
+
orientation: d.orientation
|
|
816
|
+
}, u = s(n.frontFrame), l = s(n.backFrame), i = s(n.barcodeFrame), c = _(
|
|
817
|
+
{
|
|
818
|
+
frontFrame: u,
|
|
819
|
+
backFrame: l,
|
|
820
|
+
barcodeFrame: i
|
|
821
|
+
},
|
|
822
|
+
[
|
|
823
|
+
u == null ? void 0 : u.jpegBytes.buffer,
|
|
824
|
+
l == null ? void 0 : l.jpegBytes.buffer,
|
|
825
|
+
i == null ? void 0 : i.jpegBytes.buffer
|
|
826
|
+
].filter(Boolean)
|
|
827
|
+
);
|
|
828
|
+
return n.delete(), c;
|
|
829
|
+
} catch (n) {
|
|
830
|
+
throw a(this, h) && (this.reportPinglet({
|
|
831
|
+
schemaName: "ping.error",
|
|
832
|
+
schemaVersion: "1.0.0",
|
|
833
|
+
sessionNumber: a(this, w),
|
|
834
|
+
data: {
|
|
835
|
+
errorType: "NonFatal",
|
|
836
|
+
errorMessage: n instanceof Error ? n.message : String(n),
|
|
837
|
+
stackTrace: n instanceof Error ? n.stack : void 0
|
|
838
|
+
}
|
|
839
|
+
}), this.sendPinglets()), n;
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
process: (n) => {
|
|
843
|
+
try {
|
|
844
|
+
const s = r.process(n);
|
|
845
|
+
let u;
|
|
846
|
+
try {
|
|
847
|
+
u = _(
|
|
848
|
+
{
|
|
849
|
+
...s,
|
|
850
|
+
arrayBuffer: n.data.buffer
|
|
851
|
+
},
|
|
852
|
+
[n.data.buffer]
|
|
853
|
+
);
|
|
854
|
+
} catch (l) {
|
|
855
|
+
const i = er(
|
|
856
|
+
"Failed to transfer frame from worker",
|
|
857
|
+
l
|
|
858
|
+
);
|
|
859
|
+
throw a(this, h) && (this.reportPinglet({
|
|
860
|
+
schemaName: "ping.error",
|
|
861
|
+
schemaVersion: "1.0.0",
|
|
862
|
+
sessionNumber: a(this, w),
|
|
863
|
+
data: {
|
|
864
|
+
errorType: "Crash",
|
|
865
|
+
errorMessage: i.message,
|
|
866
|
+
stackTrace: i.stack
|
|
867
|
+
}
|
|
868
|
+
}), this.sendPinglets()), i;
|
|
869
|
+
}
|
|
870
|
+
return u;
|
|
871
|
+
} catch (s) {
|
|
872
|
+
throw s instanceof Error && s.name === ue || !a(this, h) || (this.reportPinglet({
|
|
873
|
+
schemaName: "ping.error",
|
|
874
|
+
schemaVersion: "1.0.0",
|
|
875
|
+
sessionNumber: a(this, w),
|
|
876
|
+
data: {
|
|
877
|
+
errorType: "NonFatal",
|
|
878
|
+
errorMessage: s instanceof Error ? s.message : String(s),
|
|
879
|
+
stackTrace: s instanceof Error ? s.stack : void 0
|
|
880
|
+
}
|
|
881
|
+
}), this.sendPinglets()), s;
|
|
882
|
+
}
|
|
883
|
+
},
|
|
884
|
+
ping: (n) => {
|
|
885
|
+
this.reportPinglet({
|
|
886
|
+
...n,
|
|
887
|
+
sessionNumber: n.sessionNumber ?? a(this, w)
|
|
888
|
+
});
|
|
889
|
+
},
|
|
890
|
+
sendPinglets: () => this.sendPinglets(),
|
|
891
|
+
getSettings: () => r.getSettings(),
|
|
892
|
+
getSessionId: () => r.getSessionId(),
|
|
893
|
+
reset: () => {
|
|
894
|
+
try {
|
|
895
|
+
r.reset();
|
|
896
|
+
} catch (n) {
|
|
897
|
+
throw this.reportPinglet({
|
|
898
|
+
schemaName: "ping.error",
|
|
899
|
+
schemaVersion: "1.0.0",
|
|
900
|
+
sessionNumber: a(this, w),
|
|
901
|
+
data: {
|
|
902
|
+
errorType: "NonFatal",
|
|
903
|
+
errorMessage: n instanceof Error ? n.message : String(n),
|
|
904
|
+
stackTrace: n instanceof Error ? n.stack : void 0
|
|
905
|
+
}
|
|
906
|
+
}), this.sendPinglets(), n;
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
delete: () => {
|
|
910
|
+
r.isDeleted() || r.delete(), a(this, b) === r && y(this, b, void 0);
|
|
911
|
+
},
|
|
912
|
+
deleteLater: () => {
|
|
913
|
+
r.isDeleted() || r.deleteLater(), a(this, b) === r && y(this, b, void 0);
|
|
914
|
+
},
|
|
915
|
+
isDeleted: () => r.isDeleted(),
|
|
916
|
+
isAliasOf: (n) => r.isAliasOf(n),
|
|
917
|
+
showDemoOverlay: () => a(this, N),
|
|
918
|
+
showProductionOverlay: () => a(this, U),
|
|
919
|
+
clone: () => r.clone(),
|
|
920
|
+
allowBarcodeStep: () => r.allowBarcodeStep()
|
|
921
|
+
});
|
|
922
|
+
};
|
|
923
|
+
const tr = new rr();
|
|
924
|
+
q(tr);
|