@microblink/blinkid-core 7.1.0 → 7.2.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.
@@ -3,279 +3,380 @@
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- const j = Symbol("Comlink.proxy"), q = Symbol("Comlink.endpoint"), N = Symbol("Comlink.releaseProxy"), I = Symbol("Comlink.finalizer"), T = Symbol("Comlink.thrown"), U = (e) => typeof e == "object" && e !== null || typeof e == "function", G = {
7
- canHandle: (e) => U(e) && e[j],
8
- serialize(e) {
9
- const { port1: r, port2: t } = new MessageChannel();
10
- return V(e, r), [t, [t]];
6
+ const proxyMarker = Symbol("Comlink.proxy");
7
+ const createEndpoint = Symbol("Comlink.endpoint");
8
+ const releaseProxy = Symbol("Comlink.releaseProxy");
9
+ const finalizer = Symbol("Comlink.finalizer");
10
+ const throwMarker = Symbol("Comlink.thrown");
11
+ const isObject = (val) => typeof val === "object" && val !== null || typeof val === "function";
12
+ const proxyTransferHandler = {
13
+ canHandle: (val) => isObject(val) && val[proxyMarker],
14
+ serialize(obj) {
15
+ const { port1, port2 } = new MessageChannel();
16
+ expose(obj, port1);
17
+ return [port2, [port2]];
11
18
  },
12
- deserialize(e) {
13
- return e.start(), B(e);
19
+ deserialize(port) {
20
+ port.start();
21
+ return wrap(port);
14
22
  }
15
- }, J = {
16
- canHandle: (e) => U(e) && T in e,
17
- serialize({ value: e }) {
18
- let r;
19
- return e instanceof Error ? r = {
20
- isError: !0,
21
- value: {
22
- message: e.message,
23
- name: e.name,
24
- stack: e.stack
25
- }
26
- } : r = { isError: !1, value: e }, [r, []];
23
+ };
24
+ const throwTransferHandler = {
25
+ canHandle: (value) => isObject(value) && throwMarker in value,
26
+ serialize({ value }) {
27
+ let serialized;
28
+ if (value instanceof Error) {
29
+ serialized = {
30
+ isError: true,
31
+ value: {
32
+ message: value.message,
33
+ name: value.name,
34
+ stack: value.stack
35
+ }
36
+ };
37
+ } else {
38
+ serialized = { isError: false, value };
39
+ }
40
+ return [serialized, []];
27
41
  },
28
- deserialize(e) {
29
- throw e.isError ? Object.assign(new Error(e.value.message), e.value) : e.value;
42
+ deserialize(serialized) {
43
+ if (serialized.isError) {
44
+ throw Object.assign(new Error(serialized.value.message), serialized.value);
45
+ }
46
+ throw serialized.value;
30
47
  }
31
- }, z = /* @__PURE__ */ new Map([
32
- ["proxy", G],
33
- ["throw", J]
48
+ };
49
+ const transferHandlers = /* @__PURE__ */ new Map([
50
+ ["proxy", proxyTransferHandler],
51
+ ["throw", throwTransferHandler]
34
52
  ]);
35
- function K(e, r) {
36
- for (const t of e)
37
- if (r === t || t === "*" || t instanceof RegExp && t.test(r))
38
- return !0;
39
- return !1;
53
+ function isAllowedOrigin(allowedOrigins, origin) {
54
+ for (const allowedOrigin of allowedOrigins) {
55
+ if (origin === allowedOrigin || allowedOrigin === "*") {
56
+ return true;
57
+ }
58
+ if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {
59
+ return true;
60
+ }
61
+ }
62
+ return false;
40
63
  }
41
- function V(e, r = globalThis, t = ["*"]) {
42
- r.addEventListener("message", function n(o) {
43
- if (!o || !o.data)
64
+ function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {
65
+ ep.addEventListener("message", function callback(ev) {
66
+ if (!ev || !ev.data) {
44
67
  return;
45
- if (!K(t, o.origin)) {
46
- console.warn(`Invalid origin '${o.origin}' for comlink proxy`);
68
+ }
69
+ if (!isAllowedOrigin(allowedOrigins, ev.origin)) {
70
+ console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);
47
71
  return;
48
72
  }
49
- const { id: a, type: i, path: s } = Object.assign({ path: [] }, o.data), c = (o.data.argumentList || []).map(w);
50
- let u;
73
+ const { id, type: type2, path } = Object.assign({ path: [] }, ev.data);
74
+ const argumentList = (ev.data.argumentList || []).map(fromWireValue);
75
+ let returnValue;
51
76
  try {
52
- const l = s.slice(0, -1).reduce((f, E) => f[E], e), d = s.reduce((f, E) => f[E], e);
53
- switch (i) {
77
+ const parent = path.slice(0, -1).reduce((obj2, prop) => obj2[prop], obj);
78
+ const rawValue = path.reduce((obj2, prop) => obj2[prop], obj);
79
+ switch (type2) {
54
80
  case "GET":
55
- u = d;
81
+ {
82
+ returnValue = rawValue;
83
+ }
56
84
  break;
57
85
  case "SET":
58
- l[s.slice(-1)[0]] = w(o.data.value), u = !0;
86
+ {
87
+ parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);
88
+ returnValue = true;
89
+ }
59
90
  break;
60
91
  case "APPLY":
61
- u = d.apply(l, c);
92
+ {
93
+ returnValue = rawValue.apply(parent, argumentList);
94
+ }
62
95
  break;
63
96
  case "CONSTRUCT":
64
97
  {
65
- const f = new d(...c);
66
- u = D(f);
98
+ const value = new rawValue(...argumentList);
99
+ returnValue = proxy(value);
67
100
  }
68
101
  break;
69
102
  case "ENDPOINT":
70
103
  {
71
- const { port1: f, port2: E } = new MessageChannel();
72
- V(e, E), u = ee(f, [f]);
104
+ const { port1, port2 } = new MessageChannel();
105
+ expose(obj, port2);
106
+ returnValue = transfer(port1, [port1]);
73
107
  }
74
108
  break;
75
109
  case "RELEASE":
76
- u = void 0;
110
+ {
111
+ returnValue = void 0;
112
+ }
77
113
  break;
78
114
  default:
79
115
  return;
80
116
  }
81
- } catch (l) {
82
- u = { value: l, [T]: 0 };
117
+ } catch (value) {
118
+ returnValue = { value, [throwMarker]: 0 };
83
119
  }
84
- Promise.resolve(u).catch((l) => ({ value: l, [T]: 0 })).then((l) => {
85
- const [d, f] = A(l);
86
- r.postMessage(Object.assign(Object.assign({}, d), { id: a }), f), i === "RELEASE" && (r.removeEventListener("message", n), _(r), I in e && typeof e[I] == "function" && e[I]());
87
- }).catch((l) => {
88
- const [d, f] = A({
120
+ Promise.resolve(returnValue).catch((value) => {
121
+ return { value, [throwMarker]: 0 };
122
+ }).then((returnValue2) => {
123
+ const [wireValue, transferables] = toWireValue(returnValue2);
124
+ ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);
125
+ if (type2 === "RELEASE") {
126
+ ep.removeEventListener("message", callback);
127
+ closeEndPoint(ep);
128
+ if (finalizer in obj && typeof obj[finalizer] === "function") {
129
+ obj[finalizer]();
130
+ }
131
+ }
132
+ }).catch((error) => {
133
+ const [wireValue, transferables] = toWireValue({
89
134
  value: new TypeError("Unserializable return value"),
90
- [T]: 0
135
+ [throwMarker]: 0
91
136
  });
92
- r.postMessage(Object.assign(Object.assign({}, d), { id: a }), f);
137
+ ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);
93
138
  });
94
- }), r.start && r.start();
139
+ });
140
+ if (ep.start) {
141
+ ep.start();
142
+ }
95
143
  }
96
- function Y(e) {
97
- return e.constructor.name === "MessagePort";
144
+ function isMessagePort(endpoint) {
145
+ return endpoint.constructor.name === "MessagePort";
98
146
  }
99
- function _(e) {
100
- Y(e) && e.close();
147
+ function closeEndPoint(endpoint) {
148
+ if (isMessagePort(endpoint))
149
+ endpoint.close();
101
150
  }
102
- function B(e, r) {
103
- const t = /* @__PURE__ */ new Map();
104
- return e.addEventListener("message", function(o) {
105
- const { data: a } = o;
106
- if (!a || !a.id)
151
+ function wrap(ep, target) {
152
+ const pendingListeners = /* @__PURE__ */ new Map();
153
+ ep.addEventListener("message", function handleMessage(ev) {
154
+ const { data } = ev;
155
+ if (!data || !data.id) {
107
156
  return;
108
- const i = t.get(a.id);
109
- if (i)
110
- try {
111
- i(a);
112
- } finally {
113
- t.delete(a.id);
114
- }
115
- }), P(e, t, [], r);
157
+ }
158
+ const resolver = pendingListeners.get(data.id);
159
+ if (!resolver) {
160
+ return;
161
+ }
162
+ try {
163
+ resolver(data);
164
+ } finally {
165
+ pendingListeners.delete(data.id);
166
+ }
167
+ });
168
+ return createProxy(ep, pendingListeners, [], target);
116
169
  }
117
- function v(e) {
118
- if (e)
170
+ function throwIfProxyReleased(isReleased) {
171
+ if (isReleased) {
119
172
  throw new Error("Proxy has been released and is not useable");
173
+ }
120
174
  }
121
- function H(e) {
122
- return S(e, /* @__PURE__ */ new Map(), {
175
+ function releaseEndpoint(ep) {
176
+ return requestResponseMessage(ep, /* @__PURE__ */ new Map(), {
123
177
  type: "RELEASE"
124
178
  }).then(() => {
125
- _(e);
179
+ closeEndPoint(ep);
126
180
  });
127
181
  }
128
- const k = /* @__PURE__ */ new WeakMap(), R = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
129
- const r = (k.get(e) || 0) - 1;
130
- k.set(e, r), r === 0 && H(e);
182
+ const proxyCounter = /* @__PURE__ */ new WeakMap();
183
+ const proxyFinalizers = "FinalizationRegistry" in globalThis && new FinalizationRegistry((ep) => {
184
+ const newCount = (proxyCounter.get(ep) || 0) - 1;
185
+ proxyCounter.set(ep, newCount);
186
+ if (newCount === 0) {
187
+ releaseEndpoint(ep);
188
+ }
131
189
  });
132
- function X(e, r) {
133
- const t = (k.get(r) || 0) + 1;
134
- k.set(r, t), R && R.register(e, r, e);
190
+ function registerProxy(proxy2, ep) {
191
+ const newCount = (proxyCounter.get(ep) || 0) + 1;
192
+ proxyCounter.set(ep, newCount);
193
+ if (proxyFinalizers) {
194
+ proxyFinalizers.register(proxy2, ep, proxy2);
195
+ }
135
196
  }
136
- function Q(e) {
137
- R && R.unregister(e);
197
+ function unregisterProxy(proxy2) {
198
+ if (proxyFinalizers) {
199
+ proxyFinalizers.unregister(proxy2);
200
+ }
138
201
  }
139
- function P(e, r, t = [], n = function() {
202
+ function createProxy(ep, pendingListeners, path = [], target = function() {
140
203
  }) {
141
- let o = !1;
142
- const a = new Proxy(n, {
143
- get(i, s) {
144
- if (v(o), s === N)
204
+ let isProxyReleased = false;
205
+ const proxy2 = new Proxy(target, {
206
+ get(_target, prop) {
207
+ throwIfProxyReleased(isProxyReleased);
208
+ if (prop === releaseProxy) {
145
209
  return () => {
146
- Q(a), H(e), r.clear(), o = !0;
210
+ unregisterProxy(proxy2);
211
+ releaseEndpoint(ep);
212
+ pendingListeners.clear();
213
+ isProxyReleased = true;
147
214
  };
148
- if (s === "then") {
149
- if (t.length === 0)
150
- return { then: () => a };
151
- const c = S(e, r, {
215
+ }
216
+ if (prop === "then") {
217
+ if (path.length === 0) {
218
+ return { then: () => proxy2 };
219
+ }
220
+ const r = requestResponseMessage(ep, pendingListeners, {
152
221
  type: "GET",
153
- path: t.map((u) => u.toString())
154
- }).then(w);
155
- return c.then.bind(c);
222
+ path: path.map((p) => p.toString())
223
+ }).then(fromWireValue);
224
+ return r.then.bind(r);
156
225
  }
157
- return P(e, r, [...t, s]);
226
+ return createProxy(ep, pendingListeners, [...path, prop]);
158
227
  },
159
- set(i, s, c) {
160
- v(o);
161
- const [u, l] = A(c);
162
- return S(e, r, {
228
+ set(_target, prop, rawValue) {
229
+ throwIfProxyReleased(isProxyReleased);
230
+ const [value, transferables] = toWireValue(rawValue);
231
+ return requestResponseMessage(ep, pendingListeners, {
163
232
  type: "SET",
164
- path: [...t, s].map((d) => d.toString()),
165
- value: u
166
- }, l).then(w);
233
+ path: [...path, prop].map((p) => p.toString()),
234
+ value
235
+ }, transferables).then(fromWireValue);
167
236
  },
168
- apply(i, s, c) {
169
- v(o);
170
- const u = t[t.length - 1];
171
- if (u === q)
172
- return S(e, r, {
237
+ apply(_target, _thisArg, rawArgumentList) {
238
+ throwIfProxyReleased(isProxyReleased);
239
+ const last = path[path.length - 1];
240
+ if (last === createEndpoint) {
241
+ return requestResponseMessage(ep, pendingListeners, {
173
242
  type: "ENDPOINT"
174
- }).then(w);
175
- if (u === "bind")
176
- return P(e, r, t.slice(0, -1));
177
- const [l, d] = x(c);
178
- return S(e, r, {
243
+ }).then(fromWireValue);
244
+ }
245
+ if (last === "bind") {
246
+ return createProxy(ep, pendingListeners, path.slice(0, -1));
247
+ }
248
+ const [argumentList, transferables] = processArguments(rawArgumentList);
249
+ return requestResponseMessage(ep, pendingListeners, {
179
250
  type: "APPLY",
180
- path: t.map((f) => f.toString()),
181
- argumentList: l
182
- }, d).then(w);
251
+ path: path.map((p) => p.toString()),
252
+ argumentList
253
+ }, transferables).then(fromWireValue);
183
254
  },
184
- construct(i, s) {
185
- v(o);
186
- const [c, u] = x(s);
187
- return S(e, r, {
255
+ construct(_target, rawArgumentList) {
256
+ throwIfProxyReleased(isProxyReleased);
257
+ const [argumentList, transferables] = processArguments(rawArgumentList);
258
+ return requestResponseMessage(ep, pendingListeners, {
188
259
  type: "CONSTRUCT",
189
- path: t.map((l) => l.toString()),
190
- argumentList: c
191
- }, u).then(w);
260
+ path: path.map((p) => p.toString()),
261
+ argumentList
262
+ }, transferables).then(fromWireValue);
192
263
  }
193
264
  });
194
- return X(a, e), a;
265
+ registerProxy(proxy2, ep);
266
+ return proxy2;
195
267
  }
196
- function Z(e) {
197
- return Array.prototype.concat.apply([], e);
268
+ function myFlat(arr) {
269
+ return Array.prototype.concat.apply([], arr);
198
270
  }
199
- function x(e) {
200
- const r = e.map(A);
201
- return [r.map((t) => t[0]), Z(r.map((t) => t[1]))];
271
+ function processArguments(argumentList) {
272
+ const processed = argumentList.map(toWireValue);
273
+ return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];
202
274
  }
203
- const $ = /* @__PURE__ */ new WeakMap();
204
- function ee(e, r) {
205
- return $.set(e, r), e;
275
+ const transferCache = /* @__PURE__ */ new WeakMap();
276
+ function transfer(obj, transfers) {
277
+ transferCache.set(obj, transfers);
278
+ return obj;
206
279
  }
207
- function D(e) {
208
- return Object.assign(e, { [j]: !0 });
280
+ function proxy(obj) {
281
+ return Object.assign(obj, { [proxyMarker]: true });
209
282
  }
210
- function A(e) {
211
- for (const [r, t] of z)
212
- if (t.canHandle(e)) {
213
- const [n, o] = t.serialize(e);
283
+ function toWireValue(value) {
284
+ for (const [name, handler] of transferHandlers) {
285
+ if (handler.canHandle(value)) {
286
+ const [serializedValue, transferables] = handler.serialize(value);
214
287
  return [
215
288
  {
216
289
  type: "HANDLER",
217
- name: r,
218
- value: n
290
+ name,
291
+ value: serializedValue
219
292
  },
220
- o
293
+ transferables
221
294
  ];
222
295
  }
296
+ }
223
297
  return [
224
298
  {
225
299
  type: "RAW",
226
- value: e
300
+ value
227
301
  },
228
- $.get(e) || []
302
+ transferCache.get(value) || []
229
303
  ];
230
304
  }
231
- function w(e) {
232
- switch (e.type) {
305
+ function fromWireValue(value) {
306
+ switch (value.type) {
233
307
  case "HANDLER":
234
- return z.get(e.name).deserialize(e.value);
308
+ return transferHandlers.get(value.name).deserialize(value.value);
235
309
  case "RAW":
236
- return e.value;
310
+ return value.value;
237
311
  }
238
312
  }
239
- function S(e, r, t, n) {
240
- return new Promise((o) => {
241
- const a = re();
242
- r.set(a, o), e.start && e.start(), e.postMessage(Object.assign({ id: a }, t), n);
313
+ function requestResponseMessage(ep, pendingListeners, msg, transfers) {
314
+ return new Promise((resolve) => {
315
+ const id = generateUUID();
316
+ pendingListeners.set(id, resolve);
317
+ if (ep.start) {
318
+ ep.start();
319
+ }
320
+ ep.postMessage(Object.assign({ id }, msg), transfers);
243
321
  });
244
322
  }
245
- function re() {
323
+ function generateUUID() {
246
324
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
247
325
  }
248
- var te = /* @__PURE__ */ function() {
249
- function e(r, t) {
250
- for (var n = 0; n < t.length; n++) {
251
- var o = t[n];
252
- o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, o.key, o);
326
+ var _createClass = /* @__PURE__ */ function() {
327
+ function defineProperties(target, props) {
328
+ for (var i = 0; i < props.length; i++) {
329
+ var descriptor = props[i];
330
+ descriptor.enumerable = descriptor.enumerable || false;
331
+ descriptor.configurable = true;
332
+ if ("value" in descriptor) descriptor.writable = true;
333
+ Object.defineProperty(target, descriptor.key, descriptor);
253
334
  }
254
335
  }
255
- return function(r, t, n) {
256
- return t && e(r.prototype, t), n && e(r, n), r;
336
+ return function(Constructor, protoProps, staticProps) {
337
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
338
+ if (staticProps) defineProperties(Constructor, staticProps);
339
+ return Constructor;
257
340
  };
258
- }(), ne = oe(["", ""], ["", ""]);
259
- function oe(e, r) {
260
- return Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(r) } }));
341
+ }();
342
+ var _templateObject = _taggedTemplateLiteral(["", ""], ["", ""]);
343
+ function _taggedTemplateLiteral(strings, raw) {
344
+ return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
261
345
  }
262
- function ae(e, r) {
263
- if (!(e instanceof r))
346
+ function _classCallCheck(instance, Constructor) {
347
+ if (!(instance instanceof Constructor)) {
264
348
  throw new TypeError("Cannot call a class as a function");
349
+ }
265
350
  }
266
- var m = function() {
267
- function e() {
268
- for (var r = this, t = arguments.length, n = Array(t), o = 0; o < t; o++)
269
- n[o] = arguments[o];
270
- return ae(this, e), this.tag = function(a) {
271
- for (var i = arguments.length, s = Array(i > 1 ? i - 1 : 0), c = 1; c < i; c++)
272
- s[c - 1] = arguments[c];
273
- return typeof a == "function" ? r.interimTag.bind(r, a) : typeof a == "string" ? r.transformEndResult(a) : (a = a.map(r.transformString.bind(r)), r.transformEndResult(a.reduce(r.processSubstitutions.bind(r, s))));
274
- }, n.length > 0 && Array.isArray(n[0]) && (n = n[0]), this.transformers = n.map(function(a) {
275
- return typeof a == "function" ? a() : a;
276
- }), this.tag;
351
+ var TemplateTag = function() {
352
+ function TemplateTag2() {
353
+ var _this = this;
354
+ for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) {
355
+ transformers[_key] = arguments[_key];
356
+ }
357
+ _classCallCheck(this, TemplateTag2);
358
+ this.tag = function(strings) {
359
+ for (var _len2 = arguments.length, expressions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
360
+ expressions[_key2 - 1] = arguments[_key2];
361
+ }
362
+ if (typeof strings === "function") {
363
+ return _this.interimTag.bind(_this, strings);
364
+ }
365
+ if (typeof strings === "string") {
366
+ return _this.transformEndResult(strings);
367
+ }
368
+ strings = strings.map(_this.transformString.bind(_this));
369
+ return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));
370
+ };
371
+ if (transformers.length > 0 && Array.isArray(transformers[0])) {
372
+ transformers = transformers[0];
373
+ }
374
+ this.transformers = transformers.map(function(transformer) {
375
+ return typeof transformer === "function" ? transformer() : transformer;
376
+ });
377
+ return this.tag;
277
378
  }
278
- return te(e, [{
379
+ _createClass(TemplateTag2, [{
279
380
  key: "interimTag",
280
381
  /**
281
382
  * An intermediary template tag that receives a template tag and passes the result of calling the template with the received
@@ -285,10 +386,11 @@ var m = function() {
285
386
  * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
286
387
  * @return {*} - the final processed value
287
388
  */
288
- value: function(t, n) {
289
- for (var o = arguments.length, a = Array(o > 2 ? o - 2 : 0), i = 2; i < o; i++)
290
- a[i - 2] = arguments[i];
291
- return this.tag(ne, t.apply(void 0, [n].concat(a)));
389
+ value: function interimTag(previousTag, template) {
390
+ for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
391
+ substitutions[_key3 - 2] = arguments[_key3];
392
+ }
393
+ return this.tag(_templateObject, previousTag.apply(void 0, [template].concat(substitutions)));
292
394
  }
293
395
  /**
294
396
  * Performs bulk processing on the tagged template, transforming each substitution and then
@@ -300,9 +402,9 @@ var m = function() {
300
402
  */
301
403
  }, {
302
404
  key: "processSubstitutions",
303
- value: function(t, n, o) {
304
- var a = this.transformSubstitution(t.shift(), n);
305
- return "".concat(n, a, o);
405
+ value: function processSubstitutions(substitutions, resultSoFar, remainingPart) {
406
+ var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar);
407
+ return "".concat(resultSoFar, substitution, remainingPart);
306
408
  }
307
409
  /**
308
410
  * Iterate through each transformer, applying the transformer's `onString` method to the template
@@ -312,11 +414,11 @@ var m = function() {
312
414
  */
313
415
  }, {
314
416
  key: "transformString",
315
- value: function(t) {
316
- var n = function(a, i) {
317
- return i.onString ? i.onString(a) : a;
417
+ value: function transformString(str) {
418
+ var cb = function cb2(res, transform) {
419
+ return transform.onString ? transform.onString(res) : res;
318
420
  };
319
- return this.transformers.reduce(n, t);
421
+ return this.transformers.reduce(cb, str);
320
422
  }
321
423
  /**
322
424
  * When a substitution is encountered, iterates through each transformer and applies the transformer's
@@ -327,11 +429,11 @@ var m = function() {
327
429
  */
328
430
  }, {
329
431
  key: "transformSubstitution",
330
- value: function(t, n) {
331
- var o = function(i, s) {
332
- return s.onSubstitution ? s.onSubstitution(i, n) : i;
432
+ value: function transformSubstitution(substitution, resultSoFar) {
433
+ var cb = function cb2(res, transform) {
434
+ return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res;
333
435
  };
334
- return this.transformers.reduce(o, t);
436
+ return this.transformers.reduce(cb, substitution);
335
437
  }
336
438
  /**
337
439
  * Iterates through each transformer, applying the transformer's `onEndResult` method to the
@@ -341,240 +443,369 @@ var m = function() {
341
443
  */
342
444
  }, {
343
445
  key: "transformEndResult",
344
- value: function(t) {
345
- var n = function(a, i) {
346
- return i.onEndResult ? i.onEndResult(a) : a;
446
+ value: function transformEndResult(endResult) {
447
+ var cb = function cb2(res, transform) {
448
+ return transform.onEndResult ? transform.onEndResult(res) : res;
347
449
  };
348
- return this.transformers.reduce(n, t);
450
+ return this.transformers.reduce(cb, endResult);
349
451
  }
350
- }]), e;
351
- }(), g = function() {
352
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
452
+ }]);
453
+ return TemplateTag2;
454
+ }();
455
+ var trimResultTransformer = function trimResultTransformer2() {
456
+ var side = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
353
457
  return {
354
- onEndResult: function(n) {
355
- if (r === "")
356
- return n.trim();
357
- if (r = r.toLowerCase(), r === "start" || r === "left")
358
- return n.replace(/^\s*/, "");
359
- if (r === "end" || r === "right")
360
- return n.replace(/\s*$/, "");
361
- throw new Error("Side not supported: " + r);
458
+ onEndResult: function onEndResult(endResult) {
459
+ if (side === "") {
460
+ return endResult.trim();
461
+ }
462
+ side = side.toLowerCase();
463
+ if (side === "start" || side === "left") {
464
+ return endResult.replace(/^\s*/, "");
465
+ }
466
+ if (side === "end" || side === "right") {
467
+ return endResult.replace(/\s*$/, "");
468
+ }
469
+ throw new Error("Side not supported: " + side);
362
470
  }
363
471
  };
364
472
  };
365
- function ie(e) {
366
- if (Array.isArray(e)) {
367
- for (var r = 0, t = Array(e.length); r < e.length; r++)
368
- t[r] = e[r];
369
- return t;
370
- } else
371
- return Array.from(e);
473
+ function _toConsumableArray(arr) {
474
+ if (Array.isArray(arr)) {
475
+ for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
476
+ arr2[i] = arr[i];
477
+ }
478
+ return arr2;
479
+ } else {
480
+ return Array.from(arr);
481
+ }
372
482
  }
373
- var p = function() {
374
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
483
+ var stripIndentTransformer = function stripIndentTransformer2() {
484
+ var type2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
375
485
  return {
376
- onEndResult: function(n) {
377
- if (r === "initial") {
378
- var o = n.match(/^[^\S\n]*(?=\S)/gm), a = o && Math.min.apply(Math, ie(o.map(function(s) {
379
- return s.length;
486
+ onEndResult: function onEndResult(endResult) {
487
+ if (type2 === "initial") {
488
+ var match = endResult.match(/^[^\S\n]*(?=\S)/gm);
489
+ var indent = match && Math.min.apply(Math, _toConsumableArray(match.map(function(el) {
490
+ return el.length;
380
491
  })));
381
- if (a) {
382
- var i = new RegExp("^.{" + a + "}", "gm");
383
- return n.replace(i, "");
492
+ if (indent) {
493
+ var regexp = new RegExp("^.{" + indent + "}", "gm");
494
+ return endResult.replace(regexp, "");
384
495
  }
385
- return n;
496
+ return endResult;
497
+ }
498
+ if (type2 === "all") {
499
+ return endResult.replace(/^[^\S\n]+/gm, "");
386
500
  }
387
- if (r === "all")
388
- return n.replace(/^[^\S\n]+/gm, "");
389
- throw new Error("Unknown type: " + r);
501
+ throw new Error("Unknown type: " + type2);
390
502
  }
391
503
  };
392
- }, b = function(r, t) {
504
+ };
505
+ var replaceResultTransformer = function replaceResultTransformer2(replaceWhat, replaceWith) {
393
506
  return {
394
- onEndResult: function(o) {
395
- if (r == null || t == null)
507
+ onEndResult: function onEndResult(endResult) {
508
+ if (replaceWhat == null || replaceWith == null) {
396
509
  throw new Error("replaceResultTransformer requires at least 2 arguments.");
397
- return o.replace(r, t);
510
+ }
511
+ return endResult.replace(replaceWhat, replaceWith);
398
512
  }
399
513
  };
400
- }, y = function(r, t) {
514
+ };
515
+ var replaceSubstitutionTransformer = function replaceSubstitutionTransformer2(replaceWhat, replaceWith) {
401
516
  return {
402
- onSubstitution: function(o, a) {
403
- if (r == null || t == null)
517
+ onSubstitution: function onSubstitution(substitution, resultSoFar) {
518
+ if (replaceWhat == null || replaceWith == null) {
404
519
  throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
405
- return o == null ? o : o.toString().replace(r, t);
520
+ }
521
+ if (substitution == null) {
522
+ return substitution;
523
+ } else {
524
+ return substitution.toString().replace(replaceWhat, replaceWith);
525
+ }
406
526
  }
407
527
  };
408
- }, se = {
528
+ };
529
+ var defaults = {
409
530
  separator: "",
410
531
  conjunction: "",
411
- serial: !1
412
- }, h = function() {
413
- var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : se;
532
+ serial: false
533
+ };
534
+ var inlineArrayTransformer = function inlineArrayTransformer2() {
535
+ var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaults;
414
536
  return {
415
- onSubstitution: function(n, o) {
416
- if (Array.isArray(n)) {
417
- var a = n.length, i = r.separator, s = r.conjunction, c = r.serial, u = o.match(/(\n?[^\S\n]+)$/);
418
- if (u ? n = n.join(i + u[1]) : n = n.join(i + " "), s && a > 1) {
419
- var l = n.lastIndexOf(i);
420
- n = n.slice(0, l) + (c ? i : "") + " " + s + n.slice(l + 1);
537
+ onSubstitution: function onSubstitution(substitution, resultSoFar) {
538
+ if (Array.isArray(substitution)) {
539
+ var arrayLength = substitution.length;
540
+ var separator = opts.separator;
541
+ var conjunction = opts.conjunction;
542
+ var serial = opts.serial;
543
+ var indent = resultSoFar.match(/(\n?[^\S\n]+)$/);
544
+ if (indent) {
545
+ substitution = substitution.join(separator + indent[1]);
546
+ } else {
547
+ substitution = substitution.join(separator + " ");
548
+ }
549
+ if (conjunction && arrayLength > 1) {
550
+ var separatorIndex = substitution.lastIndexOf(separator);
551
+ substitution = substitution.slice(0, separatorIndex) + (serial ? separator : "") + " " + conjunction + substitution.slice(separatorIndex + 1);
421
552
  }
422
553
  }
423
- return n;
554
+ return substitution;
424
555
  }
425
556
  };
426
- }, F = function(r) {
557
+ };
558
+ var splitStringTransformer = function splitStringTransformer2(splitBy) {
427
559
  return {
428
- onSubstitution: function(n, o) {
429
- return typeof n == "string" && n.includes(r) && (n = n.split(r)), n;
560
+ onSubstitution: function onSubstitution(substitution, resultSoFar) {
561
+ {
562
+ if (typeof substitution === "string" && substitution.includes(splitBy)) {
563
+ substitution = substitution.split(splitBy);
564
+ }
565
+ }
566
+ return substitution;
430
567
  }
431
568
  };
432
- }, L = function(r) {
433
- return r != null && !Number.isNaN(r) && typeof r != "boolean";
434
- }, ue = function() {
569
+ };
570
+ var isValidValue = function isValidValue2(x) {
571
+ return x != null && !Number.isNaN(x) && typeof x !== "boolean";
572
+ };
573
+ var removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer2() {
435
574
  return {
436
- onSubstitution: function(t) {
437
- return Array.isArray(t) ? t.filter(L) : L(t) ? t : "";
575
+ onSubstitution: function onSubstitution(substitution) {
576
+ if (Array.isArray(substitution)) {
577
+ return substitution.filter(isValidValue);
578
+ }
579
+ if (isValidValue(substitution)) {
580
+ return substitution;
581
+ }
582
+ return "";
438
583
  }
439
584
  };
440
585
  };
441
- new m(h({ separator: "," }), p, g);
442
- new m(h({ separator: ",", conjunction: "and" }), p, g);
443
- new m(h({ separator: ",", conjunction: "or" }), p, g);
444
- new m(F(`
445
- `), ue, h, p, g);
446
- new m(F(`
447
- `), h, p, g, y(/&/g, "&amp;"), y(/</g, "&lt;"), y(/>/g, "&gt;"), y(/"/g, "&quot;"), y(/'/g, "&#x27;"), y(/`/g, "&#x60;"));
448
- new m(b(/(?:\n(?:\s*))+/g, " "), g);
449
- var ce = new m(b(/(?:\n\s*)/g, ""), g);
450
- new m(h({ separator: "," }), b(/(?:\s+)/g, " "), g);
451
- new m(h({ separator: ",", conjunction: "or" }), b(/(?:\s+)/g, " "), g);
452
- new m(h({ separator: ",", conjunction: "and" }), b(/(?:\s+)/g, " "), g);
453
- new m(h, p, g);
454
- new m(h, b(/(?:\s+)/g, " "), g);
455
- new m(p, g);
456
- var le = new m(p("all"), g);
457
- const O = "application/javascript", fe = (e, r = {}) => {
458
- const t = {
459
- skipSameOrigin: !0,
460
- useBlob: !0,
461
- ...r
586
+ new TemplateTag(inlineArrayTransformer({ separator: "," }), stripIndentTransformer, trimResultTransformer);
587
+ new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "and" }), stripIndentTransformer, trimResultTransformer);
588
+ new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "or" }), stripIndentTransformer, trimResultTransformer);
589
+ new TemplateTag(splitStringTransformer("\n"), removeNonPrintingValuesTransformer, inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);
590
+ new TemplateTag(splitStringTransformer("\n"), inlineArrayTransformer, stripIndentTransformer, trimResultTransformer, replaceSubstitutionTransformer(/&/g, "&amp;"), replaceSubstitutionTransformer(/</g, "&lt;"), replaceSubstitutionTransformer(/>/g, "&gt;"), replaceSubstitutionTransformer(/"/g, "&quot;"), replaceSubstitutionTransformer(/'/g, "&#x27;"), replaceSubstitutionTransformer(/`/g, "&#x60;"));
591
+ new TemplateTag(replaceResultTransformer(/(?:\n(?:\s*))+/g, " "), trimResultTransformer);
592
+ var oneLineTrim = new TemplateTag(replaceResultTransformer(/(?:\n\s*)/g, ""), trimResultTransformer);
593
+ new TemplateTag(inlineArrayTransformer({ separator: "," }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
594
+ new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "or" }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
595
+ new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "and" }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
596
+ new TemplateTag(inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);
597
+ new TemplateTag(inlineArrayTransformer, replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
598
+ new TemplateTag(stripIndentTransformer, trimResultTransformer);
599
+ var stripIndents = new TemplateTag(stripIndentTransformer("all"), trimResultTransformer);
600
+ const type = "application/javascript";
601
+ const getCrossOriginWorkerURL = (originalWorkerUrl, _options = {}) => {
602
+ const options = {
603
+ skipSameOrigin: true,
604
+ useBlob: true,
605
+ ..._options
462
606
  };
463
- if (t.skipSameOrigin && new URL(e).origin === self.location.origin)
464
- return Promise.resolve(e);
465
- let n;
607
+ if (options.skipSameOrigin && new URL(originalWorkerUrl).origin === self.location.origin) {
608
+ return Promise.resolve(originalWorkerUrl);
609
+ }
610
+ let signal;
466
611
  try {
467
- const o = new AbortController();
468
- n = o.signal;
469
- const a = setTimeout(() => {
470
- o.abort();
471
- }, 3e3), i = () => {
472
- clearTimeout(a), o.abort();
612
+ const controller = new AbortController();
613
+ signal = controller.signal;
614
+ const timeout = setTimeout(() => {
615
+ controller.abort();
616
+ }, 3e3);
617
+ const cleanup = () => {
618
+ clearTimeout(timeout);
619
+ controller.abort();
473
620
  };
474
- n.addEventListener("abort", i);
475
- } catch {
621
+ signal.addEventListener("abort", cleanup);
622
+ } catch (error) {
476
623
  }
477
624
  return new Promise(
478
- (o, a) => void fetch(e, {
625
+ (resolve, reject) => void fetch(originalWorkerUrl, {
479
626
  // abort if the worker is not fetched in a reasonable time
480
- signal: n
481
- }).then((i) => i.text()).then((i) => {
482
- const s = new URL(e).href.split("/");
483
- s.pop();
484
- const c = le`
627
+ signal
628
+ }).then((res) => res.text()).then((codeString) => {
629
+ const workerPath = new URL(originalWorkerUrl).href.split("/");
630
+ workerPath.pop();
631
+ const importScriptsFix = stripIndents`
485
632
  const _importScripts = importScripts;
486
- const _fixImports = (url) => new URL(url, '${s.join("/") + "/"}').href;
633
+ const _fixImports = (url) => new URL(url, '${workerPath.join("/") + "/"}').href;
487
634
  importScripts = (...urls) => _importScripts(...urls.map(_fixImports));
488
635
  `;
489
- let u = "";
490
- if (t.useBlob) {
491
- const l = new Blob([c + i], { type: O });
492
- u = URL.createObjectURL(l);
493
- } else
494
- u = `data:${O},` + encodeURIComponent(c + i);
495
- o(u);
636
+ let finalURL = "";
637
+ if (options.useBlob) {
638
+ const blob = new Blob([importScriptsFix + codeString], { type });
639
+ finalURL = URL.createObjectURL(blob);
640
+ } else {
641
+ finalURL = `data:${type},` + encodeURIComponent(importScriptsFix + codeString);
642
+ }
643
+ resolve(finalURL);
496
644
  }).catch(() => {
497
- a(new Error(`Failed to fetch worker from ${e}`));
645
+ reject(new Error(`Failed to fetch worker from ${originalWorkerUrl}`));
498
646
  })
499
647
  );
500
- }, me = async (e = window.location.href) => {
501
- const r = await fe(
502
- new URL("resources/blinkid-worker.js", e).toString()
503
- ), t = await fetch(r, { method: "HEAD" }), n = t.headers.get("content-type"), o = n?.includes("javascript");
504
- if (n?.includes("html"))
648
+ };
649
+ const createProxyWorker = async (resourcesLocation = window.location.href) => {
650
+ const workerUrl = await getCrossOriginWorkerURL(
651
+ new URL("resources/blinkid-worker.js", resourcesLocation).toString()
652
+ );
653
+ const response = await fetch(workerUrl, { method: "HEAD" });
654
+ const contentType = response.headers.get("content-type");
655
+ const isJavascript = contentType?.includes("javascript");
656
+ const isHtml = contentType?.includes("html");
657
+ if (isHtml) {
505
658
  throw new Error(
506
- ce`${r} resolved to a resource with the content type ${n}.
659
+ oneLineTrim`${workerUrl} resolved to a resource with the content type ${contentType}.
507
660
  This is likely an issue with the server configuration redirecting to an index.html file.
508
661
  Check that your resources are properly hosted`
509
662
  );
510
- if (!o)
511
- throw new Error(`Worker file is not a JavaScript file: ${n}`);
512
- if (!t.ok)
663
+ }
664
+ if (!isJavascript) {
665
+ throw new Error(`Worker file is not a JavaScript file: ${contentType}`);
666
+ }
667
+ if (!response.ok) {
513
668
  throw new Error(
514
- `Worker file not found or inaccessible: ${t.status} ${t.statusText}`
669
+ `Worker file not found or inaccessible: ${response.status} ${response.statusText}`
515
670
  );
516
- const i = new Worker(r, {
671
+ }
672
+ const worker = new Worker(workerUrl, {
517
673
  type: "module"
518
674
  });
519
- i.onerror = (c) => {
520
- console.error("Worker error:", c), s[N]();
675
+ worker.onerror = (e) => {
676
+ console.error("Worker error:", e);
677
+ proxyWorker[releaseProxy]();
521
678
  };
522
- const s = B(i);
523
- return s;
679
+ const proxyWorker = wrap(worker);
680
+ return proxyWorker;
524
681
  };
525
- let C = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((r, t) => (t &= 63, t < 36 ? r += t.toString(36) : t < 62 ? r += (t - 26).toString(36).toUpperCase() : t > 62 ? r += "-" : r += "_", r), "");
526
- const M = "blinkid-userid";
527
- function ge() {
528
- if (!de())
529
- return C();
530
- const r = localStorage.getItem(M);
531
- if (r)
532
- return r;
533
- const t = C();
534
- return localStorage.setItem(M, t), t;
682
+ let nanoid = (size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
683
+ byte &= 63;
684
+ if (byte < 36) {
685
+ id += byte.toString(36);
686
+ } else if (byte < 62) {
687
+ id += (byte - 26).toString(36).toUpperCase();
688
+ } else if (byte > 62) {
689
+ id += "-";
690
+ } else {
691
+ id += "_";
692
+ }
693
+ return id;
694
+ }, "");
695
+ const key = "blinkid-userid";
696
+ function getUserId() {
697
+ const hasLocalStorage = testLocalStorage();
698
+ if (!hasLocalStorage) {
699
+ return nanoid();
700
+ }
701
+ const previousId = localStorage.getItem(key);
702
+ if (previousId) {
703
+ return previousId;
704
+ }
705
+ const randomId = nanoid();
706
+ localStorage.setItem(key, randomId);
707
+ return randomId;
535
708
  }
536
- function de() {
709
+ function testLocalStorage() {
537
710
  try {
538
- return localStorage.setItem("test", "test"), localStorage.removeItem("test"), !0;
711
+ localStorage.setItem("test", "test");
712
+ localStorage.removeItem("test");
713
+ return true;
539
714
  } catch {
540
- return !1;
715
+ return false;
541
716
  }
542
717
  }
543
- async function he(e, r) {
544
- const t = await me(e.resourcesLocation);
545
- e.userId || (e.userId = ge()), e.resourcesLocation || (e.resourcesLocation = window.location.href), e.useLightweightBuild === void 0 && (e.useLightweightBuild = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
546
- navigator.userAgent
547
- ));
548
- const n = r ? D(r) : void 0;
718
+ const defaultSessionSettings = {
719
+ inputImageSource: "video",
720
+ scanningMode: "automatic",
721
+ scanningSettings: {
722
+ allowUncertainFrontSideScan: false,
723
+ blurDetectionLevel: "mid",
724
+ glareDetectionLevel: "mid",
725
+ tiltDetectionLevel: "mid",
726
+ skipImagesWithBlur: true,
727
+ skipImagesWithGlare: true,
728
+ skipImagesOccludedByHand: true,
729
+ skipImagesWithInadequateLightingConditions: true,
730
+ combineResultsFromMultipleInputImages: true,
731
+ croppedImageSettings: {
732
+ dotsPerInch: 250,
733
+ extensionFactor: 0,
734
+ returnDocumentImage: false,
735
+ returnFaceImage: false,
736
+ returnSignatureImage: false
737
+ },
738
+ customDocumentAnonymizationSettings: [],
739
+ customDocumentRules: [],
740
+ enableBarcodeScanOnly: false,
741
+ enableCharacterValidation: true,
742
+ inputImageMargin: 0.02,
743
+ maxAllowedMismatchesPerField: 0,
744
+ recognitionModeFilter: {
745
+ enableBarcodeId: true,
746
+ enableFullDocumentRecognition: true,
747
+ enableMrzId: true,
748
+ enableMrzPassport: true,
749
+ enableMrzVisa: true,
750
+ enablePhotoId: true
751
+ },
752
+ returnInputImages: false,
753
+ scanCroppedDocumentImage: false,
754
+ scanPassportDataPageOnly: true,
755
+ scanUnsupportedBack: false,
756
+ anonymizationMode: "full-result"
757
+ }
758
+ };
759
+ async function loadBlinkIdCore(settings, progressCallback) {
760
+ const remoteWorker = await createProxyWorker(settings.resourcesLocation);
761
+ if (!settings.userId) {
762
+ settings.userId = getUserId();
763
+ }
764
+ if (!settings.resourcesLocation) {
765
+ settings.resourcesLocation = window.location.href;
766
+ }
767
+ if (settings.useLightweightBuild === void 0) {
768
+ settings.useLightweightBuild = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
769
+ navigator.userAgent
770
+ );
771
+ }
772
+ const proxyProgressCallback = progressCallback ? proxy(progressCallback) : void 0;
549
773
  try {
550
- return await t.initBlinkId(
551
- e,
552
- n
553
- ), t;
554
- } catch (o) {
774
+ await remoteWorker.initBlinkId(
775
+ settings,
776
+ defaultSessionSettings,
777
+ proxyProgressCallback
778
+ );
779
+ return remoteWorker;
780
+ } catch (error) {
555
781
  throw new Error("Failed to initialize BlinkID", {
556
- cause: o
782
+ cause: error
557
783
  });
558
784
  }
559
785
  }
560
- function pe(e) {
561
- return {
562
- data: e.data,
563
- width: e.width,
564
- height: e.height,
565
- colorSpace: e.colorSpace
786
+ function createCustomImageData(imageData) {
787
+ const customImageData = {
788
+ data: imageData.data,
789
+ width: imageData.width,
790
+ height: imageData.height,
791
+ colorSpace: imageData.colorSpace
566
792
  };
793
+ return customImageData;
794
+ }
795
+ const testSymbol = Symbol();
796
+ globalThis.__BLINKID_CORE__ ||= testSymbol;
797
+ if (globalThis.__BLINKID_CORE__ !== testSymbol) {
798
+ console.warn(
799
+ "Detected multiple instances of @microblink/blinkid-core. This can lead to unexpected behavior."
800
+ );
567
801
  }
568
- const W = Symbol();
569
- globalThis.__BLINKID_CORE__ ||= W;
570
- globalThis.__BLINKID_CORE__ !== W && console.warn(
571
- "Detected multiple instances of @microblink/blinkid-core. This can lead to unexpected behavior."
572
- );
573
802
  export {
574
- pe as createCustomImageData,
575
- me as createProxyWorker,
576
- fe as getCrossOriginWorkerURL,
577
- ge as getUserId,
578
- he as loadBlinkIdCore,
579
- de as testLocalStorage
803
+ createCustomImageData,
804
+ createProxyWorker,
805
+ defaultSessionSettings,
806
+ getCrossOriginWorkerURL,
807
+ getUserId,
808
+ loadBlinkIdCore,
809
+ testLocalStorage
580
810
  };
811
+ //# sourceMappingURL=blinkid-core.js.map