@exige/web-scanner-sdk 0.2.40 → 0.2.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { H as e, J as t, K as n, L as r, R as i, T as a, W as o, X as s, a as c, f as l, j as u, o as d, p as f, q as p, r as m, w as ee, y as h, z as te } from "./driver-license-BV2-PjpZ.js";
3
- import { createContext as g, useCallback as _, useContext as ne, useEffect as v, useLayoutEffect as re, useMemo as ie, useRef as y, useState as b } from "react";
4
- import { Fragment as ae, jsx as x, jsxs as S } from "react/jsx-runtime";
2
+ import { A as e, C as t, G as n, I as r, J as i, K as a, L as o, R as s, U as c, V as l, a as u, d, f, h as p, r as m, v as h, w as ee } from "./driver-license-D9y7PQn4.js";
3
+ import { createContext as g, useCallback as _, useContext as te, useEffect as v, useLayoutEffect as ne, useMemo as re, useRef as y, useState as b } from "react";
4
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
5
5
  //#region src/sdk/display-quad.ts
6
- function C(e) {
6
+ function w(e) {
7
7
  return [
8
8
  e.topLeft,
9
9
  e.topRight,
@@ -11,7 +11,7 @@ function C(e) {
11
11
  e.bottomLeft
12
12
  ];
13
13
  }
14
- function w(e) {
14
+ function T(e) {
15
15
  let [t, n, r, i] = e;
16
16
  return {
17
17
  topLeft: t,
@@ -38,10 +38,10 @@ function w(e) {
38
38
  }
39
39
  };
40
40
  }
41
- function T(e) {
42
- return w(C(e).map((e) => ({ ...e })));
41
+ function ie(e) {
42
+ return T(w(e).map((e) => ({ ...e })));
43
43
  }
44
- var oe = class {
44
+ var ae = class {
45
45
  current;
46
46
  target;
47
47
  response;
@@ -50,11 +50,11 @@ var oe = class {
50
50
  this.response = e.response ?? 14, this.snapDistance = e.snapDistance ?? .1;
51
51
  }
52
52
  setTarget(e, t, n) {
53
- let r = Math.max(1, Math.hypot(t, n)), i = !this.current || C(e).some((e, t) => {
54
- let n = C(this.current)[t];
53
+ let r = Math.max(1, Math.hypot(t, n)), i = !this.current || w(e).some((e, t) => {
54
+ let n = w(this.current)[t];
55
55
  return Math.hypot(e.x - n.x, e.y - n.y) / r > this.snapDistance;
56
56
  });
57
- return this.target = T(e), i && (this.current = T(e)), {
57
+ return this.target = ie(e), i && (this.current = ie(e)), {
58
58
  quad: this.current,
59
59
  snapped: i
60
60
  };
@@ -62,8 +62,8 @@ var oe = class {
62
62
  step(e) {
63
63
  if (!this.current || !this.target) return this.current;
64
64
  let t = 1 - Math.exp(-this.response * Math.max(0, e) / 1e3);
65
- return this.current = w(C(this.current).map((e, n) => {
66
- let r = C(this.target)[n];
65
+ return this.current = T(w(this.current).map((e, n) => {
66
+ let r = w(this.target)[n];
67
67
  return {
68
68
  x: e.x + (r.x - e.x) * t,
69
69
  y: e.y + (r.y - e.y) * t
@@ -76,22 +76,13 @@ var oe = class {
76
76
  getCurrent() {
77
77
  return this.current;
78
78
  }
79
- }, se = g(null);
79
+ }, oe = g(null);
80
80
  //#endregion
81
81
  //#region src/react/context.tsx
82
- function ce(e) {
82
+ function se(e) {
83
83
  e?.startsWith("blob:") && URL.revokeObjectURL(e);
84
84
  }
85
- function le() {
86
- return new Promise((e) => {
87
- if (typeof requestAnimationFrame == "function") {
88
- requestAnimationFrame(() => requestAnimationFrame(() => e()));
89
- return;
90
- }
91
- setTimeout(e, 0);
92
- });
93
- }
94
- function ue(e) {
85
+ function ce(e) {
95
86
  try {
96
87
  let t = e.toDataURL("image/jpeg", .92);
97
88
  return t.startsWith("data:image/") ? t : void 0;
@@ -99,314 +90,322 @@ function ue(e) {
99
90
  return;
100
91
  }
101
92
  }
102
- function de(e, t) {
93
+ function le(e, t) {
103
94
  if (typeof e == "function") return e(t);
104
95
  }
105
- function fe({ open: m, useCase: h = "document", autoCapture: g = "defaultOn", captureMode: ne = "auto", torch: ae = "defaultOff", onCapture: S, onDriverLicense: C, onCancel: w, onError: T, onSettings: fe, onFinderStatus: pe, modelUrl: E, ortWasmPaths: D, detectionIntervalMs: me, apiRef: he, children: ge }) {
106
- let O = p(ne), k = y(void 0), A = y(void 0), j = y(void 0), M = y(void 0), N = y({}), P = y(new oe()), F = y(!1), _e = y(!1), I = y({
107
- onCapture: S,
96
+ function ue({ open: r, useCase: m = "document", autoCapture: h = "defaultOn", captureMode: g = "auto", torch: te = "defaultOff", onCapture: x, onDriverLicense: C, onCancel: w, onError: T, onSettings: ie, onFinderStatus: ue, modelUrl: E, ortWasmPaths: D, detectionIntervalMs: O, apiRef: k, children: de }) {
97
+ let A = n(g), j = y(void 0), M = y(void 0), N = y(void 0), P = y(void 0), F = y({}), I = y(new ae()), L = y(!1), fe = y(!1), R = y({
98
+ onCapture: x,
108
99
  onDriverLicense: C,
109
100
  onCancel: w,
110
101
  onError: T,
111
- onSettings: fe,
112
- onFinderStatus: pe,
113
- useCase: h
114
- }), ve = y(void 0), ye = y(void 0), L = y(async () => void 0), R = y(!1), be = y(void 0), xe = y(void 0), Se = _((e) => {
115
- let t = xe.current;
116
- xe.current = void 0, t?.reject(e ?? new DOMException("The license flip was cancelled.", "AbortError"));
117
- }, []), Ce = _(() => {
118
- let e = xe.current;
119
- e && (xe.current = void 0, e.resolve());
120
- }, []), we = _(() => (Se(), new Promise((e, t) => {
121
- xe.current = {
102
+ onSettings: ie,
103
+ onFinderStatus: ue,
104
+ useCase: m
105
+ }), pe = y(void 0), z = y(void 0), me = y(async () => void 0), B = y(!1), he = y(void 0), V = y(void 0), H = _((e) => {
106
+ let t = V.current;
107
+ V.current = void 0, t?.reject(e ?? new DOMException("The license flip was cancelled.", "AbortError"));
108
+ }, []), ge = _(() => {
109
+ let e = V.current;
110
+ e && (V.current = void 0, e.resolve());
111
+ }, []), _e = _(() => (H(), new Promise((e, t) => {
112
+ V.current = {
122
113
  resolve: e,
123
114
  reject: t
124
115
  };
125
- })), [Se]), Te = y(null), [z, Ee] = b(null), [De, B] = b(O && m ? "capturing" : O ? "ready" : "starting"), [V, H] = b(), [Oe, U] = b(), [ke, W] = b(), [Ae, je] = b({
116
+ })), [H]), ve = y(null), [U, ye] = b(null), [be, W] = b(A && r ? "capturing" : A ? "ready" : "starting"), [G, K] = b(), [xe, q] = b(), [Se, Ce] = b(), [we, Te] = b(), J = y(!1), [Ee, De] = b({
126
117
  width: 1,
127
118
  height: 1
128
- }), [Me, Ne] = b(), [Pe, G] = b(), [Fe, K] = b(""), [Ie, Le] = b(0), [Re, q] = b(), [ze, J] = b(), [Be, Ve] = b("idle"), [He, Ue] = b(), We = y(void 0), [Ge, Ke] = b("front"), Y = y("front"), [qe, Je] = b(!1), [Ye, Xe] = b({
119
+ }), [Oe, ke] = b(), [Ae, je] = b(), [Me, Y] = b(""), [Ne, Pe] = b(0), [Fe, X] = b(), [Ie, Le] = b(), [Re, ze] = b("idle"), [Be, Ve] = b(), He = y(void 0), [Ue, We] = b("front"), Ge = y("front"), [Ke, qe] = b(!1), [Je, Ye] = b({
129
120
  downloading: !1,
130
121
  loaded: 0,
131
122
  total: null
132
- }), X = _(() => {
133
- ce(We.current), We.current = void 0, Ue(void 0);
134
- }, []), Z = _((e, t) => {
135
- let n = ue(e);
136
- ce(We.current), We.current = n, Ue(n), t?.pause();
137
- }, []), Q = _(async (e, t) => {
138
- t && (W({
123
+ }), Z = _(() => {
124
+ se(He.current), He.current = void 0, Ve(void 0);
125
+ }, []), Xe = _((e, t) => {
126
+ let n = ce(e);
127
+ se(He.current), He.current = n, Ve(n), t?.pause();
128
+ }, []), Q = _(() => {
129
+ J.current = !1, Ce(void 0), Te(void 0);
130
+ }, []), Ze = _((e, t) => {
131
+ t && !J.current && (J.current = !0, Ce({
139
132
  width: e.width,
140
133
  height: e.height
141
- }), U(t), await le(), await new Promise((e) => {
142
- window.setTimeout(e, 280);
143
- }));
144
- }, []);
145
- re(() => {
146
- I.current = {
147
- onCapture: S,
134
+ }), Te(t));
135
+ }, []), Qe = _(async (e, t, n) => {
136
+ t && q(t), Ze(e, n), (t || n) && await new Promise((e) => {
137
+ window.setTimeout(e, p);
138
+ });
139
+ }, [Ze]);
140
+ ne(() => {
141
+ R.current = {
142
+ onCapture: x,
148
143
  onDriverLicense: C,
149
144
  onCancel: w,
150
145
  onError: T,
151
- onSettings: fe,
152
- onFinderStatus: pe,
153
- useCase: h
146
+ onSettings: ie,
147
+ onFinderStatus: ue,
148
+ useCase: m
154
149
  };
155
150
  }, [
156
- S,
151
+ x,
157
152
  C,
158
153
  w,
159
154
  T,
160
- fe,
161
- pe,
162
- h
163
- ]), v(() => s(Xe), []), v(() => {
164
- if (!m || h !== "drivers-license") {
165
- Se(), ye.current = void 0, ve.current = void 0, R.current = !1, Y.current = "front", Ke("front"), Je(!1);
155
+ ie,
156
+ ue,
157
+ m
158
+ ]), v(() => i(Ye), []), v(() => {
159
+ if (!r || m !== "drivers-license") {
160
+ H(), z.current = void 0, pe.current = void 0, B.current = !1, Ge.current = "front", We("front"), qe(!1);
166
161
  return;
167
162
  }
168
- let e = c({ scan: {
163
+ let e = u({ scan: {
169
164
  modelUrl: E,
170
165
  ortWasmPaths: D
171
166
  } });
172
- return ye.current = e, e.then((e) => {
173
- ve.current = e;
167
+ return z.current = e, e.then((e) => {
168
+ pe.current = e;
174
169
  }), () => {
175
- Se(), e.then((e) => e.cancel()), ve.current &&= void 0, ye.current = void 0;
170
+ H(), e.then((e) => e.cancel()), pe.current &&= void 0, z.current = void 0;
176
171
  };
177
172
  }, [
173
+ r,
178
174
  m,
179
- h,
180
175
  E,
181
176
  D,
182
- Se
177
+ H
183
178
  ]);
184
- let Ze = _((e) => {
185
- Ee(e);
179
+ let $e = _((e) => {
180
+ ye(e);
186
181
  }, []);
187
182
  v(() => {
188
- if (!m || !z) return;
183
+ if (!r || !U) return;
189
184
  let e = () => {
190
- let e = z.getBoundingClientRect();
191
- je({
185
+ let e = U.getBoundingClientRect();
186
+ De({
192
187
  width: e.width,
193
188
  height: e.height
194
189
  });
195
190
  };
196
191
  if (e(), typeof ResizeObserver > "u") return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
197
192
  let t = new ResizeObserver(e);
198
- return t.observe(z), () => t.disconnect();
199
- }, [m, z]), v(() => {
200
- if (!m) return;
193
+ return t.observe(U), () => t.disconnect();
194
+ }, [r, U]), v(() => {
195
+ if (!r) return;
201
196
  let e = window.setInterval(() => {
202
- let e = k.current?.getDiagnostics();
203
- e && q(e);
197
+ let e = j.current?.getDiagnostics();
198
+ e && X(e);
204
199
  }, 500);
205
200
  return () => window.clearInterval(e);
206
- }, [m, Ie]), v(() => {
207
- if (!m) return;
201
+ }, [r, Ne]), v(() => {
202
+ if (!r) return;
208
203
  let e = 0, t = performance.now(), n = (r) => {
209
- let i = P.current.step(r - t);
210
- t = r, i && U(i), e = requestAnimationFrame(n);
204
+ let i = I.current.step(r - t);
205
+ t = r, i && q(i), e = requestAnimationFrame(n);
211
206
  };
212
207
  return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
213
- }, [m]), v(() => {
214
- if (!m || O || !z) return;
215
- let e = !1, i = new AbortController();
216
- be.current = i;
217
- let o = () => {
218
- i.abort(), be.current === i && (be.current = void 0), A.current?.stop(), A.current = void 0, k.current?.stop(), k.current = void 0, M.current = void 0, j.current = void 0, N.current = {}, X();
208
+ }, [r]), v(() => {
209
+ if (!r || A || !U) return;
210
+ let e = !1, t = new AbortController();
211
+ he.current = t;
212
+ let n = () => {
213
+ t.abort(), he.current === t && (he.current = void 0), M.current?.stop(), M.current = void 0, j.current?.stop(), j.current = void 0, P.current = void 0, N.current = void 0, F.current = {}, Z();
219
214
  };
220
215
  return (async () => {
221
- o(), i = new AbortController(), be.current = i, F.current = !1, B("starting"), K(""), H(void 0), G(void 0), J(void 0), Ve("idle"), X();
216
+ n(), t = new AbortController(), he.current = t, L.current = !1, W("starting"), Y(""), K(void 0), je(void 0), Le(void 0), ze("idle"), Z();
222
217
  try {
223
- let o = await t(z, { torch: ae });
218
+ let n = await a(U, { torch: te });
224
219
  if (e) {
225
- o.stop();
226
- return;
227
- }
228
- k.current = o;
229
- let s = o.getSettings();
230
- if (Ne(s), I.current.onSettings?.(s), console.info("[ScannerProvider] camera settings", s), I.current.useCase === "drivers-license" && Y.current === "back") {
231
- H(void 0), U(void 0), W(void 0), P.current.clear(), B("ready"), (async () => {
232
- try {
233
- let t = 0, a = await d(async () => {
234
- t += 1;
235
- let e = r();
236
- if (t % 4 == 0 && n(e, "ImageCapture" in globalThis)) try {
237
- let e = await o.capturePhoto();
238
- if (e.frame && e.luminance > 10) return e.frame;
239
- } catch {}
240
- try {
241
- return await o.captureLiveFrame(l);
242
- } catch {
243
- return;
244
- }
245
- }, {
246
- intervalMs: me ?? 140,
247
- signal: i.signal
248
- });
249
- if (e || i.signal.aborted || R.current || (R.current = !0, Z(a.frame, z), G("live-mirror"), B("captured"), await Q(a.frame, a.quad), e || i.signal.aborted)) return;
250
- await L.current({
251
- frame: a.frame,
252
- reason: "auto",
253
- method: "live-mirror",
254
- settings: o.getSettings()
255
- });
256
- } catch (t) {
257
- if (e || i.signal.aborted || t instanceof DOMException && t.name === "AbortError") return;
258
- let n = t instanceof Error ? t : /* @__PURE__ */ Error("Could not read the barcode.");
259
- F.current = !0, K(n.message), B("error"), I.current.onError?.(n);
260
- }
261
- })();
220
+ n.stop();
262
221
  return;
263
222
  }
264
- A.current = await a({
265
- source: z,
266
- autoCapture: g,
267
- intervalMs: me,
223
+ j.current = n;
224
+ let r = n.getSettings();
225
+ ke(r), R.current.onSettings?.(r), console.info("[ScannerProvider] camera settings", r);
226
+ let i = R.current.useCase === "drivers-license" && Ge.current === "back";
227
+ M.current = await ee({
228
+ source: U,
229
+ autoCapture: h,
230
+ intervalMs: O,
268
231
  detection: {
269
232
  modelUrl: E,
270
233
  ortWasmPaths: D
271
234
  },
235
+ ...i ? { holdStillReady: () => J.current } : {},
272
236
  onStatus: (e) => {
273
- if (j.current = e, H(e), I.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
274
- let t = P.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
275
- U(t.quad);
276
- } else P.current.clear(), U(void 0);
277
- e.state !== "captured" && !F.current && B("ready");
237
+ if (N.current = e, K(e), R.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
238
+ let t = I.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
239
+ q(t.quad);
240
+ } else I.current.clear(), q(void 0), i && Q();
241
+ e.state !== "captured" && !L.current && W("ready");
278
242
  },
279
243
  captureFrame: async () => {
280
- B("capturing"), N.current = {
281
- quad: P.current.getCurrent(),
282
- sourceWidth: j.current?.sourceWidth,
283
- sourceHeight: j.current?.sourceHeight
244
+ W("capturing"), F.current = {
245
+ quad: I.current.getCurrent(),
246
+ sourceWidth: N.current?.sourceWidth,
247
+ sourceHeight: N.current?.sourceHeight
284
248
  };
285
- let e = await o.capturePhoto();
286
- if (M.current = e, G(e.method), J(e.diagnostics), q(e.diagnostics), e.luminance <= 10) throw Error(`The captured frame was blank (luminance ${e.luminance.toFixed(1)} via ${e.method}). Keep the scanner visible while capturing and retake.`);
287
- return Z(e.frame, z), B("captured"), e.frame;
249
+ let e = await n.capturePhoto();
250
+ if (P.current = e, je(e.method), Le(e.diagnostics), X(e.diagnostics), e.luminance <= 10) throw Error(`The captured frame was blank (luminance ${e.luminance.toFixed(1)} via ${e.method}). Keep the scanner visible while capturing and retake.`);
251
+ if (Xe(e.frame, U), W("captured"), i) {
252
+ let t = await f(e.frame);
253
+ Ze(e.frame, t?.quad);
254
+ }
255
+ return e.frame;
288
256
  },
289
257
  onCaptureError: (e) => {
290
- F.current = !0, B("error"), K(e.message);
291
- let t = k.current?.getDiagnostics();
292
- t && q(t), I.current.onError?.(e);
258
+ L.current = !0, W("error"), Y(e.message);
259
+ let t = j.current?.getDiagnostics();
260
+ t && X(t), R.current.onError?.(e);
293
261
  },
294
262
  onCapture: async (e) => {
295
- let t = M.current;
263
+ let t = P.current;
296
264
  await new Promise((e) => window.setTimeout(e, 140));
297
- let n = {
265
+ let r = {
298
266
  ...e,
299
267
  method: t?.method ?? "video-frame",
300
- settings: t?.settings ?? o.getSettings(),
268
+ settings: t?.settings ?? n.getSettings(),
301
269
  fallbackReason: t?.fallbackReason,
302
270
  luminance: t?.luminance,
303
271
  diagnostics: t?.diagnostics,
304
- displayedQuad: N.current.quad,
305
- displaySourceWidth: N.current.sourceWidth,
306
- displaySourceHeight: N.current.sourceHeight
272
+ displayedQuad: F.current.quad,
273
+ displaySourceWidth: F.current.sourceWidth,
274
+ displaySourceHeight: F.current.sourceHeight
307
275
  };
308
- if (I.current.useCase === "drivers-license") {
309
- await L.current(n);
276
+ if (R.current.useCase === "drivers-license") {
277
+ i && (B.current = !0), await me.current(r);
310
278
  return;
311
279
  }
312
- await de(I.current.onCapture, n);
280
+ await le(R.current.onCapture, r);
313
281
  }
314
- });
282
+ }), i && (async () => {
283
+ for (; !e && !t.signal.aborted && !B.current && !J.current;) {
284
+ try {
285
+ let r = await n.captureLiveFrame(d);
286
+ if (!r) {
287
+ await new Promise((e) => {
288
+ window.setTimeout(e, O ?? 140);
289
+ });
290
+ continue;
291
+ }
292
+ let i = await f(r);
293
+ if (e || t.signal.aborted) return;
294
+ i?.quad && Ze(r, i.quad);
295
+ } catch {}
296
+ await new Promise((e) => {
297
+ window.setTimeout(e, O ?? 140);
298
+ });
299
+ }
300
+ })();
315
301
  } catch (t) {
316
302
  if (e) return;
317
- o();
318
- let n = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
319
- K(n.message), B("error"), I.current.onError?.(n);
303
+ n();
304
+ let r = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
305
+ Y(r.message), W("error"), R.current.onError?.(r);
320
306
  }
321
307
  })(), () => {
322
- e = !0, o();
308
+ e = !0, n();
323
309
  };
324
310
  }, [
325
- m,
326
- z,
327
- O,
328
- g,
329
- ae,
311
+ r,
312
+ U,
313
+ A,
314
+ h,
315
+ te,
330
316
  E,
331
317
  D,
332
- me,
333
- Ie,
334
- X,
318
+ O,
319
+ Ne,
335
320
  Z,
336
- Q
321
+ Xe,
322
+ Q,
323
+ Ze
337
324
  ]);
338
- let Qe = {
339
- open: m,
340
- phase: De,
341
- autoCapture: g,
342
- captureMode: ne,
343
- usingSystemCamera: O,
344
- finderStatus: V,
345
- displayQuad: Oe,
346
- barcodeOverlay: ke,
347
- previewSize: Ae,
348
- settings: Me,
349
- captureMethod: Pe,
350
- error: Fe,
351
- diagnostics: Re,
352
- shutterDiagnostics: ze,
353
- copyState: Be,
354
- guidanceHint: V ? ee(V.guidance, V.lighting) : void 0,
355
- detectorStatus: h === "drivers-license" && Ge === "back" && !O ? "zxing" : V?.modelStatus === "failed" ? `ML failed${V.modelError ? `: ${V.modelError}` : ""}` : V?.detector === "ml" ? `ML ${V.modelProvider ?? ""}`.trim() : "ML loading",
356
- modelDownload: Ye,
357
- frozenPreviewUrl: He,
358
- useCase: h,
359
- licenseSide: h === "drivers-license" ? Ge : void 0,
360
- licenseBusy: h === "drivers-license" ? qe : void 0
325
+ let et = G ? t(G.guidance, G.lighting) : void 0, tt = m === "drivers-license" && Ue === "back" && !A, nt = {
326
+ open: r,
327
+ phase: be,
328
+ autoCapture: h,
329
+ captureMode: g,
330
+ usingSystemCamera: A,
331
+ finderStatus: G,
332
+ displayQuad: xe,
333
+ barcodeOverlay: Se,
334
+ barcodeQuad: we,
335
+ previewSize: Ee,
336
+ settings: Oe,
337
+ captureMethod: Ae,
338
+ error: Me,
339
+ diagnostics: Fe,
340
+ shutterDiagnostics: Ie,
341
+ copyState: Re,
342
+ guidanceHint: et,
343
+ detectorStatus: G?.modelStatus === "failed" ? `ML failed${G.modelError ? `: ${G.modelError}` : ""}` : [G?.detector === "ml" ? `ML ${G.modelProvider ?? ""}`.trim() : "ML loading", tt ? "zxing" : void 0].filter(Boolean).join(" · "),
344
+ modelDownload: Je,
345
+ frozenPreviewUrl: Be,
346
+ useCase: m,
347
+ licenseSide: m === "drivers-license" ? Ue : void 0,
348
+ licenseBusy: m === "drivers-license" ? Ke : void 0
361
349
  };
362
350
  v(() => {
363
- Te.current = Qe;
351
+ ve.current = nt;
364
352
  });
365
- let $e = _(() => {
366
- I.current.onCancel();
353
+ let rt = _(() => {
354
+ R.current.onCancel();
367
355
  }, []), $ = _(async () => {
368
- if (!_e.current) {
369
- _e.current = !0, F.current = !1, K(""), U(void 0), W(void 0), P.current.clear(), B("capturing");
356
+ if (!fe.current) {
357
+ fe.current = !0, L.current = !1, Y(""), q(void 0), Q(), I.current.clear(), W("capturing");
370
358
  try {
371
- let t = await o();
372
- Z(t);
359
+ let t = await c();
360
+ Xe(t);
373
361
  let n = {
374
362
  width: t.width,
375
363
  height: t.height
376
364
  };
377
- Ne(n), I.current.onSettings?.(n), G("system-camera");
365
+ ke(n), R.current.onSettings?.(n), je("system-camera");
378
366
  let r;
379
367
  try {
380
- let n = t.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, t.width, t.height).data;
381
- n && (r = e(n));
368
+ let e = t.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, t.width, t.height).data;
369
+ e && (r = l(e));
382
370
  } catch {
383
371
  r = void 0;
384
372
  }
385
- if (I.current.useCase === "drivers-license" && Y.current === "back") {
386
- U(void 0), W(void 0), P.current.clear(), N.current = {}, B("captured");
387
- let e = await f(t);
388
- await Q(t, e?.quad), await L.current({
373
+ if (R.current.useCase === "drivers-license" && Ge.current === "back") {
374
+ I.current.clear(), F.current = {};
375
+ let [i, a] = await Promise.all([e(t, {
376
+ modelUrl: E,
377
+ ortWasmPaths: D
378
+ }), f(t)]), o = i.status === "success" ? i.quad : void 0;
379
+ o && (F.current = {
380
+ quad: o,
381
+ sourceWidth: i.sourceWidth,
382
+ sourceHeight: i.sourceHeight
383
+ }), W("captured"), await Qe(t, o, a?.quad), await me.current({
389
384
  frame: t,
385
+ detection: o ? i : void 0,
390
386
  reason: "manual",
391
387
  method: "system-camera",
392
388
  settings: n,
393
- luminance: r
389
+ luminance: r,
390
+ displayedQuad: o,
391
+ displaySourceWidth: i.sourceWidth,
392
+ displaySourceHeight: i.sourceHeight
394
393
  });
395
394
  return;
396
395
  }
397
- let i = await u(t, {
396
+ let i = await e(t, {
398
397
  modelUrl: E,
399
398
  ortWasmPaths: D
400
399
  });
401
400
  if (i.status !== "success" || !i.corners || !i.quad) {
402
- F.current = !0, B("error"), K(i.message), I.current.onError?.(Error(i.message));
401
+ L.current = !0, W("error"), Y(i.message), R.current.onError?.(Error(i.message));
403
402
  return;
404
403
  }
405
- N.current = {
404
+ F.current = {
406
405
  quad: i.quad,
407
406
  sourceWidth: i.sourceWidth,
408
407
  sourceHeight: i.sourceHeight
409
- }, i.quad && U(i.quad), B("captured");
408
+ }, i.quad && q(i.quad), W("captured");
410
409
  let a = {
411
410
  frame: t,
412
411
  detection: i,
@@ -418,162 +417,138 @@ function fe({ open: m, useCase: h = "document", autoCapture: g = "defaultOn", ca
418
417
  displaySourceWidth: i.sourceWidth,
419
418
  displaySourceHeight: i.sourceHeight
420
419
  };
421
- if (I.current.useCase === "drivers-license") {
422
- await L.current(a);
420
+ if (R.current.useCase === "drivers-license") {
421
+ await me.current(a);
423
422
  return;
424
423
  }
425
- await de(I.current.onCapture, a);
424
+ await le(R.current.onCapture, a);
426
425
  } catch (e) {
427
426
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not take a photo.");
428
427
  if (t.message === "No photo was selected.") {
429
- if (We.current) {
430
- B("error");
428
+ if (He.current) {
429
+ W("error");
431
430
  return;
432
431
  }
433
- I.current.onCancel();
432
+ R.current.onCancel();
434
433
  return;
435
434
  }
436
- F.current = !0, K(t.message), B("error"), I.current.onError?.(t);
435
+ L.current = !0, Y(t.message), W("error"), R.current.onError?.(t);
437
436
  } finally {
438
- _e.current = !1;
437
+ fe.current = !1;
439
438
  }
440
439
  }
441
440
  }, [
442
- Z,
441
+ Q,
442
+ Xe,
443
443
  E,
444
444
  D,
445
- Q
446
- ]), et = _(async (e) => {
447
- let t = await ye.current;
445
+ Qe
446
+ ]), it = _(async (e) => {
447
+ let t = await z.current;
448
448
  if (t) {
449
- Je(!0);
449
+ qe(!0);
450
450
  try {
451
451
  let n = await t.submitStill(e.frame, e.detection);
452
452
  if (n.kind === "need-back") {
453
- A.current?.stop(), A.current = void 0, Y.current = "front", R.current = !1, Ke("flip"), F.current = !1, K(""), H(void 0), U(void 0), W(void 0), P.current.clear(), B("ready"), Je(!1);
453
+ M.current?.stop(), M.current = void 0, Ge.current = "front", B.current = !1, We("flip"), L.current = !1, Y(""), K(void 0), q(void 0), Q(), I.current.clear(), W("ready"), qe(!1);
454
454
  try {
455
- await we();
455
+ await _e();
456
456
  } catch {
457
457
  return;
458
458
  }
459
- if (Y.current = "back", Ke("back"), X(), O) {
460
- B("ready");
459
+ if (Ge.current = "back", We("back"), Z(), A) {
460
+ W("ready");
461
461
  return;
462
462
  }
463
- z?.paused && z.play(), B("starting"), Le((e) => e + 1);
463
+ U?.paused && U.play(), W("starting"), Pe((e) => e + 1);
464
464
  return;
465
465
  }
466
466
  if (n.kind === "retry") {
467
- F.current = !0, K(n.message), B("error");
467
+ L.current = !0, Y(n.message), W("error");
468
468
  return;
469
469
  }
470
- await de(I.current.onDriverLicense, n.result);
470
+ await le(R.current.onDriverLicense, n.result);
471
471
  } catch (e) {
472
472
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Driver’s license scan failed.");
473
- F.current = !0, K(t.message), B("error"), I.current.onError?.(t);
473
+ L.current = !0, Y(t.message), W("error"), R.current.onError?.(t);
474
474
  } finally {
475
- Je(!1);
475
+ qe(!1);
476
476
  }
477
477
  }
478
478
  }, [
479
- X,
480
- z,
481
- O,
482
- we
479
+ Q,
480
+ Z,
481
+ U,
482
+ A,
483
+ _e
483
484
  ]);
484
- re(() => {
485
- L.current = et;
486
- }, [et]);
487
- let tt = _(async () => {
488
- if (O) {
485
+ ne(() => {
486
+ me.current = it;
487
+ }, [it]);
488
+ let at = _(async () => {
489
+ if (A) {
489
490
  await $();
490
491
  return;
491
492
  }
492
- let e = k.current;
493
- if (e && I.current.useCase === "drivers-license" && Y.current === "back") {
494
- try {
495
- let t = await e.capturePhoto(), n = await f(t.frame);
496
- if (!n?.text || R.current) return;
497
- R.current = !0, be.current?.abort(), M.current = t, G(t.method), J(t.diagnostics), q(t.diagnostics), Z(t.frame, z), B("captured"), await Q(t.frame, n.quad), await L.current({
498
- frame: t.frame,
499
- reason: "manual",
500
- method: t.method,
501
- settings: t.settings,
502
- fallbackReason: t.fallbackReason,
503
- luminance: t.luminance,
504
- diagnostics: t.diagnostics
505
- });
506
- } catch (e) {
507
- let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
508
- F.current = !0, K(t.message);
509
- let n = k.current?.getDiagnostics();
510
- n && q(n), M.current?.diagnostics && J(M.current.diagnostics), B("error"), I.current.onError?.(t);
511
- }
512
- return;
513
- }
514
493
  try {
515
- await A.current?.capture();
494
+ await M.current?.capture();
516
495
  } catch (e) {
517
496
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
518
- F.current = !0, K(t.message);
519
- let n = k.current?.getDiagnostics();
520
- n && q(n), M.current?.diagnostics && J(M.current.diagnostics), B("error"), I.current.onError?.(t);
497
+ L.current = !0, Y(t.message);
498
+ let n = j.current?.getDiagnostics();
499
+ n && X(n), P.current?.diagnostics && Le(P.current.diagnostics), W("error"), R.current.onError?.(t);
521
500
  }
522
- }, [
523
- $,
524
- Z,
525
- z,
526
- Q,
527
- O
528
- ]), nt = y($);
529
- nt.current = $;
530
- let rt = y(!1);
531
- re(() => {
532
- if (!m || !O) {
533
- rt.current = !1;
501
+ }, [$, A]), ot = y($);
502
+ ot.current = $;
503
+ let st = y(!1);
504
+ ne(() => {
505
+ if (!r || !A) {
506
+ st.current = !1;
534
507
  return;
535
508
  }
536
- if (!rt.current) {
537
- if (rt.current = !0, F.current = !1, K(""), H(void 0), G(void 0), J(void 0), Ve("idle"), U(void 0), W(void 0), P.current.clear(), X(), !te()) {
538
- B("ready");
509
+ if (!st.current) {
510
+ if (st.current = !0, L.current = !1, Y(""), K(void 0), je(void 0), Le(void 0), ze("idle"), q(void 0), Q(), I.current.clear(), Z(), !s()) {
511
+ W("ready");
539
512
  return;
540
513
  }
541
- nt.current();
514
+ ot.current();
542
515
  }
543
516
  }, [
544
- m,
545
- O,
546
- X
517
+ r,
518
+ A,
519
+ Z,
520
+ Q
547
521
  ]);
548
- let it = _(() => {
549
- if (F.current = !1, R.current = !1, K(""), J(void 0), Ve("idle"), H(void 0), U(void 0), W(void 0), P.current.clear(), O) {
522
+ let ct = _(() => {
523
+ if (L.current = !1, B.current = !1, Y(""), Le(void 0), ze("idle"), K(void 0), q(void 0), Q(), I.current.clear(), A) {
550
524
  $();
551
525
  return;
552
526
  }
553
- if (X(), h === "drivers-license") {
554
- B("starting"), Le((e) => e + 1);
527
+ if (Z(), m === "drivers-license") {
528
+ W("starting"), Pe((e) => e + 1);
555
529
  return;
556
530
  }
557
- let e = k.current;
558
- z?.paused && z.play(), B(e ? "ready" : "starting"), e || Le((e) => e + 1);
531
+ let e = j.current;
532
+ U?.paused && U.play(), W(e ? "ready" : "starting"), e || Pe((e) => e + 1);
559
533
  }, [
560
534
  $,
561
- X,
562
- z,
563
- h,
564
- O
565
- ]), at = _(async (e) => {
566
- let t = k.current;
567
- t && (await t.setTorch(e), q(t.getDiagnostics()));
568
- }, []), ot = _((e) => {
569
- A.current?.setAutoCapture(e);
570
- }, []), st = _(async () => {
571
- let e = Te.current, t = k.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = i({
535
+ Q,
536
+ Z,
537
+ U,
538
+ m,
539
+ A
540
+ ]), lt = _(async (e) => {
541
+ let t = j.current;
542
+ t && (await t.setTorch(e), X(t.getDiagnostics()));
543
+ }, []), ut = _((e) => {
544
+ M.current?.setAutoCapture(e);
545
+ }, []), dt = _(async () => {
546
+ let e = ve.current, t = j.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = o({
572
547
  error: e.error || void 0,
573
548
  captureMethod: e.captureMethod,
574
- luminance: M.current?.luminance,
575
- fallbackReason: M.current?.fallbackReason,
576
- shutter: e.shutterDiagnostics ?? M.current?.diagnostics,
549
+ luminance: P.current?.luminance,
550
+ fallbackReason: P.current?.fallbackReason,
551
+ shutter: e.shutterDiagnostics ?? P.current?.diagnostics,
577
552
  live: t,
578
553
  finder: n ? {
579
554
  state: n.state,
@@ -598,57 +573,57 @@ function fe({ open: m, useCase: h = "document", autoCapture: g = "defaultOn", ca
598
573
  let t = document.execCommand("copy");
599
574
  if (e.remove(), !t) throw Error("Clipboard copy is unavailable.");
600
575
  }
601
- Ve("copied");
576
+ ze("copied");
602
577
  } catch {
603
- Ve("failed");
578
+ ze("failed");
604
579
  }
605
- }, []), ct = _(() => Te.current, []), lt = ie(() => ({
606
- capture: tt,
607
- cancel: $e,
608
- retry: it,
609
- continueLicenseFlip: Ce,
610
- setTorch: at,
611
- setAutoCapture: ot,
612
- copyReport: st,
613
- getState: ct
580
+ }, []), ft = _(() => ve.current, []), pt = re(() => ({
581
+ capture: at,
582
+ cancel: rt,
583
+ retry: ct,
584
+ continueLicenseFlip: ge,
585
+ setTorch: lt,
586
+ setAutoCapture: ut,
587
+ copyReport: dt,
588
+ getState: ft
614
589
  }), [
615
- tt,
616
- $e,
617
- it,
618
- Ce,
619
590
  at,
620
- ot,
621
- st,
622
- ct
591
+ rt,
592
+ ct,
593
+ ge,
594
+ lt,
595
+ ut,
596
+ dt,
597
+ ft
623
598
  ]);
624
599
  v(() => {
625
- if (he) return he.current = lt, () => {
626
- he.current = null;
600
+ if (k) return k.current = pt, () => {
601
+ k.current = null;
627
602
  };
628
- }, [lt, he]);
629
- let ut = {
630
- ...Qe,
631
- ...lt,
632
- bindPreview: Ze
603
+ }, [pt, k]);
604
+ let mt = {
605
+ ...nt,
606
+ ...pt,
607
+ bindPreview: $e
633
608
  };
634
- return /* @__PURE__ */ x(se.Provider, {
635
- value: ut,
636
- children: ge
609
+ return /* @__PURE__ */ S(oe.Provider, {
610
+ value: mt,
611
+ children: de
637
612
  });
638
613
  }
639
614
  //#endregion
640
615
  //#region src/react/hooks.ts
641
- function pe() {
616
+ function E() {
642
617
  return y(null);
643
618
  }
644
- function E() {
645
- let e = ne(se);
619
+ function D() {
620
+ let e = te(oe);
646
621
  if (!e) throw Error("useScanner must be used within ScannerProvider.");
647
622
  return e;
648
623
  }
649
624
  //#endregion
650
625
  //#region src/live-overlay-geometry.ts
651
- function D(e, t, n, r, i) {
626
+ function O(e, t, n, r, i) {
652
627
  let a = Math.max(1, e), o = Math.max(1, t), s = Math.max(1, n), c = Math.max(1, r), l = s / a, u = c / o, d = i === "cover" ? Math.max(l, u) : Math.min(l, u), f = (s - a * d) / 2, p = (c - o * d) / 2;
653
628
  if (i === "contain") return {
654
629
  viewBox: `0 0 ${a} ${o}`,
@@ -657,9 +632,9 @@ function D(e, t, n, r, i) {
657
632
  offsetX: f,
658
633
  offsetY: p
659
634
  };
660
- let m = s / d, ee = c / d;
635
+ let m = s / d, h = c / d;
661
636
  return {
662
- viewBox: `${-f / d} ${-p / d} ${m} ${ee}`,
637
+ viewBox: `${-f / d} ${-p / d} ${m} ${h}`,
663
638
  preserveAspectRatio: "none",
664
639
  scale: d,
665
640
  offsetX: f,
@@ -668,10 +643,10 @@ function D(e, t, n, r, i) {
668
643
  }
669
644
  //#endregion
670
645
  //#region src/components/ModelDownloadRing.tsx
671
- function me({ snapshot: e }) {
646
+ function k({ snapshot: e }) {
672
647
  if (!e.downloading) return null;
673
648
  let t = e.total && e.total > 0 ? Math.min(1, e.loaded / e.total) : null, n = t === null ? null : Math.round(t * 100), r = 2 * Math.PI * 28;
674
- return /* @__PURE__ */ S("div", {
649
+ return /* @__PURE__ */ C("div", {
675
650
  className: `model-download-ring${t === null ? " is-indeterminate" : ""}`,
676
651
  role: "progressbar",
677
652
  "aria-label": "Model download",
@@ -680,15 +655,15 @@ function me({ snapshot: e }) {
680
655
  "aria-valuenow": n ?? void 0,
681
656
  "data-loaded": e.loaded,
682
657
  "data-total": e.total ?? "",
683
- children: [/* @__PURE__ */ S("svg", {
658
+ children: [/* @__PURE__ */ C("svg", {
684
659
  viewBox: "0 0 72 72",
685
660
  "aria-hidden": "true",
686
- children: [/* @__PURE__ */ x("circle", {
661
+ children: [/* @__PURE__ */ S("circle", {
687
662
  className: "track",
688
663
  cx: "36",
689
664
  cy: "36",
690
665
  r: 28
691
- }), /* @__PURE__ */ x("circle", {
666
+ }), /* @__PURE__ */ S("circle", {
692
667
  className: "value",
693
668
  cx: "36",
694
669
  cy: "36",
@@ -696,20 +671,20 @@ function me({ snapshot: e }) {
696
671
  strokeDasharray: t === null ? void 0 : `${r} ${r}`,
697
672
  strokeDashoffset: t === null ? void 0 : r * (1 - t)
698
673
  })]
699
- }), n === null ? /* @__PURE__ */ x("strong", {
674
+ }), n === null ? /* @__PURE__ */ S("strong", {
700
675
  className: "model-download-ring__pending",
701
676
  children: "…"
702
- }) : /* @__PURE__ */ S("strong", { children: [n, "%"] })]
677
+ }) : /* @__PURE__ */ C("strong", { children: [n, "%"] })]
703
678
  });
704
679
  }
705
680
  //#endregion
706
681
  //#region src/react/guidance.ts
707
- function he(e) {
682
+ function de(e) {
708
683
  if (!(e.usingSystemCamera || e.licenseBusy) && e.phase !== "error" && !e.licenseFlipCue) return e.phase === "starting" ? e.licenseHeadline : e.phase === "capturing" ? "Capturing full resolution…" : e.phase === "captured" ? "Document captured" : e.holdStillSeconds && e.holdStillSeconds > 0 ? h(e.holdStillSeconds) : e.guidanceHint && e.guidanceReason && e.guidanceReason !== "place-document" ? e.guidanceHint : e.licenseHeadline ?? e.guidanceHint ?? "Place the document in the frame";
709
684
  }
710
685
  //#endregion
711
686
  //#region src/react/parts.tsx
712
- var ge = {
687
+ var A = {
713
688
  primaryColorHex: "--scanner-overlay-primary",
714
689
  seekingColorHex: "--scanner-overlay-seeking",
715
690
  detectingColorHex: "--scanner-overlay-detecting",
@@ -717,46 +692,46 @@ var ge = {
717
692
  readyColorHex: "--scanner-overlay-ready",
718
693
  capturedColorHex: "--scanner-overlay-captured"
719
694
  };
720
- function O(e) {
695
+ function j(e) {
721
696
  if (!e) return;
722
697
  let t = {};
723
- for (let [n, r] of Object.entries(ge)) {
698
+ for (let [n, r] of Object.entries(A)) {
724
699
  let i = e[n]?.trim();
725
700
  i && (t[r] = i);
726
701
  }
727
702
  return Object.keys(t).length > 0 ? t : void 0;
728
703
  }
729
- function k({ theme: e, style: t, title: n, children: r }) {
730
- let i = E();
704
+ function M({ theme: e, style: t, title: n, children: r }) {
705
+ let i = D();
731
706
  if (!i.open) return null;
732
- let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o = O(e), s = o ? {
707
+ let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o = j(e), s = o ? {
733
708
  ...t,
734
709
  ...o
735
710
  } : t;
736
- return /* @__PURE__ */ S("div", {
711
+ return /* @__PURE__ */ C("div", {
737
712
  className: `scanner-camera-overlay ${i.phase === "captured" || i.finderStatus?.state === "captured" ? "is-captured" : ""} ${i.usingSystemCamera ? "is-system-camera" : ""}`.trim(),
738
713
  style: s,
739
714
  role: "dialog",
740
715
  "aria-modal": "true",
741
716
  "aria-label": a,
742
- children: [r, /* @__PURE__ */ x(I, {})]
717
+ children: [r, /* @__PURE__ */ S(z, {})]
743
718
  });
744
719
  }
745
- function A() {
746
- let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = E(), r = y(null), i = _((t) => {
720
+ function N() {
721
+ let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = D(), r = y(null), i = _((t) => {
747
722
  r.current = t, e(t);
748
723
  }, [e]);
749
724
  return v(() => {
750
725
  t && r.current?.pause();
751
- }, [t]), n ? t ? /* @__PURE__ */ x("img", {
726
+ }, [t]), n ? t ? /* @__PURE__ */ S("img", {
752
727
  src: t,
753
728
  className: "scanner-camera-overlay__video scanner-camera-overlay__still",
754
729
  alt: "",
755
730
  "aria-label": "Captured document"
756
- }) : /* @__PURE__ */ x("div", {
731
+ }) : /* @__PURE__ */ S("div", {
757
732
  className: "scanner-camera-overlay__video",
758
733
  "aria-hidden": "true"
759
- }) : /* @__PURE__ */ S(ae, { children: [/* @__PURE__ */ x("video", {
734
+ }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("video", {
760
735
  ref: i,
761
736
  className: "scanner-camera-overlay__video",
762
737
  muted: !0,
@@ -765,36 +740,52 @@ function A() {
765
740
  style: { objectFit: "cover" },
766
741
  "aria-hidden": !!t,
767
742
  "aria-label": "Rear camera preview"
768
- }), t ? /* @__PURE__ */ x("img", {
743
+ }), t ? /* @__PURE__ */ S("img", {
769
744
  src: t,
770
745
  className: "scanner-camera-overlay__video scanner-camera-overlay__still",
771
746
  alt: "",
772
747
  "aria-label": "Captured document"
773
748
  }) : null] });
774
749
  }
775
- function j() {
776
- let { finderStatus: e, displayQuad: t, previewSize: n, barcodeOverlay: r } = E(), i = e?.sourceWidth ?? r?.width, a = e?.sourceHeight ?? r?.height;
777
- if (!t || !i || !a) return null;
778
- let o = D(i, a, n.width, n.height, "cover"), s = r ? "ready" : e?.state;
779
- return /* @__PURE__ */ x("svg", {
780
- className: `scanner-camera-overlay__quad ${s ?? ""}`.trim(),
750
+ function P({ quad: e, sourceWidth: t, sourceHeight: n, previewSize: r, state: i, label: a }) {
751
+ let o = O(t, n, r.width, r.height, "cover");
752
+ return /* @__PURE__ */ S("svg", {
753
+ className: `scanner-camera-overlay__quad ${i ?? ""}`.trim(),
781
754
  viewBox: o.viewBox,
782
755
  preserveAspectRatio: o.preserveAspectRatio,
783
- "aria-label": r ? "PDF417 barcode boundary" : `${e?.state ?? "document"} document boundary`,
784
- children: /* @__PURE__ */ x("polygon", { points: `${t.topLeft.x},${t.topLeft.y} ${t.topRight.x},${t.topRight.y} ${t.bottomRight.x},${t.bottomRight.y} ${t.bottomLeft.x},${t.bottomLeft.y}` })
756
+ "aria-label": a,
757
+ children: /* @__PURE__ */ S("polygon", { points: `${e.topLeft.x},${e.topLeft.y} ${e.topRight.x},${e.topRight.y} ${e.bottomRight.x},${e.bottomRight.y} ${e.bottomLeft.x},${e.bottomLeft.y}` })
785
758
  });
786
759
  }
787
- function M({ title: e }) {
788
- let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } = E(), s = i === "drivers-license" ? m(a ?? "front", r) : void 0, c = e ?? s?.title ?? "Scan a document";
789
- return /* @__PURE__ */ S("div", {
760
+ function F() {
761
+ let { finderStatus: e, displayQuad: t, previewSize: n, barcodeOverlay: r, barcodeQuad: i } = D(), a = e?.sourceWidth ?? (t && r ? r.width : void 0), o = e?.sourceHeight ?? (t && r ? r.height : void 0), s = !!e?.holdStillSeconds || e?.state === "ready" || !(!t && !i || e), c = s ? "ready" : e?.state;
762
+ return /* @__PURE__ */ C(x, { children: [t && a && o ? /* @__PURE__ */ S(P, {
763
+ quad: t,
764
+ sourceWidth: a,
765
+ sourceHeight: o,
766
+ previewSize: n,
767
+ state: c,
768
+ label: `${e?.state ?? "document"} document boundary`
769
+ }) : null, i && r ? /* @__PURE__ */ S(P, {
770
+ quad: i,
771
+ sourceWidth: r.width,
772
+ sourceHeight: r.height,
773
+ previewSize: n,
774
+ state: s || e?.state === "ready" ? "ready" : e?.state ?? "ready",
775
+ label: "PDF417 barcode boundary"
776
+ }) : null] });
777
+ }
778
+ function I({ title: e }) {
779
+ let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } = D(), s = i === "drivers-license" ? m(a ?? "front", r) : void 0, c = e ?? s?.title ?? "Scan a document";
780
+ return /* @__PURE__ */ C("div", {
790
781
  className: "scanner-camera-overlay__topbar",
791
- children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("strong", { children: c }), /* @__PURE__ */ S("span", {
782
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("strong", { children: c }), /* @__PURE__ */ C("span", {
792
783
  "aria-live": "polite",
793
784
  children: [
794
785
  o && (a === "back" ? "Reading the barcode…" : "Reading the front…"),
795
786
  !o && s && a === "flip" && "Turn the license over",
796
787
  !o && s && t === "error" && (a === "back" ? "Could not read the back" : "Could not read the front"),
797
- !o && !s && r && /* @__PURE__ */ S(ae, { children: [
788
+ !o && !s && r && /* @__PURE__ */ C(x, { children: [
798
789
  t === "starting" && "Preparing the system camera…",
799
790
  t === "ready" && "Take a photo. There is no live document guide.",
800
791
  t === "capturing" && "Looking for a document…",
@@ -803,7 +794,7 @@ function M({ title: e }) {
803
794
  ] }),
804
795
  !o && !s && !r && t === "error" && "Camera unavailable"
805
796
  ]
806
- })] }), /* @__PURE__ */ x("button", {
797
+ })] }), /* @__PURE__ */ S("button", {
807
798
  type: "button",
808
799
  onClick: n,
809
800
  "aria-label": "Close camera",
@@ -811,110 +802,108 @@ function M({ title: e }) {
811
802
  })]
812
803
  });
813
804
  }
814
- function N() {
815
- let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d, continueLicenseFlip: f } = E(), p = l === "drivers-license" ? m(u ?? "front", s) : void 0;
816
- return u === "flip" && p ? /* @__PURE__ */ x("div", {
805
+ function L() {
806
+ let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d, continueLicenseFlip: f } = D(), p = l === "drivers-license" ? m(u ?? "front", s) : void 0;
807
+ return u === "flip" && p ? /* @__PURE__ */ S("div", {
817
808
  className: "scanner-camera-overlay__flip",
818
809
  role: "dialog",
819
810
  "aria-modal": "true",
820
811
  "aria-labelledby": "scanner-license-flip-title",
821
812
  "aria-describedby": "scanner-license-flip-detail",
822
- children: /* @__PURE__ */ S("div", {
813
+ children: /* @__PURE__ */ C("div", {
823
814
  className: "scanner-camera-overlay__message",
824
815
  children: [
825
- /* @__PURE__ */ x("strong", {
816
+ /* @__PURE__ */ S("strong", {
826
817
  id: "scanner-license-flip-title",
827
818
  children: p.headline
828
819
  }),
829
- /* @__PURE__ */ x("p", {
820
+ /* @__PURE__ */ S("p", {
830
821
  id: "scanner-license-flip-detail",
831
822
  children: p.detail
832
823
  }),
833
- /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x("button", {
824
+ /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S("button", {
834
825
  type: "button",
835
826
  onClick: f,
836
827
  children: "Continue"
837
828
  }) })
838
829
  ]
839
830
  })
840
- }) : e === "error" ? /* @__PURE__ */ S("div", {
831
+ }) : e === "error" ? /* @__PURE__ */ C("div", {
841
832
  className: "scanner-camera-overlay__message",
842
833
  role: "alert",
843
834
  children: [
844
- /* @__PURE__ */ x("strong", { children: p ? u === "back" ? "Could not read the back" : "Could not read the front" : s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
845
- /* @__PURE__ */ x("p", { children: t }),
846
- /* @__PURE__ */ S("div", { children: [
847
- /* @__PURE__ */ x("button", {
835
+ /* @__PURE__ */ S("strong", { children: p ? u === "back" ? "Could not read the back" : "Could not read the front" : s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
836
+ /* @__PURE__ */ S("p", { children: t }),
837
+ /* @__PURE__ */ C("div", { children: [
838
+ /* @__PURE__ */ S("button", {
848
839
  type: "button",
849
840
  onClick: i,
850
841
  children: "Try again"
851
842
  }),
852
- /* @__PURE__ */ x("button", {
843
+ /* @__PURE__ */ S("button", {
853
844
  type: "button",
854
845
  onClick: () => void a(),
855
846
  children: r === "copied" ? "Copied" : r === "failed" ? "Copy failed" : "Copy report"
856
847
  }),
857
- /* @__PURE__ */ x("button", {
848
+ /* @__PURE__ */ S("button", {
858
849
  type: "button",
859
850
  onClick: o,
860
851
  children: "Cancel"
861
852
  })
862
853
  ] })
863
854
  ]
864
- }) : d ? /* @__PURE__ */ S("div", {
855
+ }) : d ? /* @__PURE__ */ C("div", {
865
856
  className: "scanner-camera-overlay__message",
866
857
  "aria-live": "polite",
867
858
  children: [
868
- /* @__PURE__ */ x("span", { className: "scanner-camera-overlay__spinner" }),
869
- /* @__PURE__ */ x("strong", { children: u === "back" ? "Reading the barcode" : "Reading the front" }),
870
- /* @__PURE__ */ x("p", { children: u === "back" ? "Decoding the AAMVA PDF417 on the back." : "Finding the card and reading the front with OCR." })
859
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
860
+ /* @__PURE__ */ S("strong", { children: u === "back" ? "Reading the barcode" : "Reading the front" }),
861
+ /* @__PURE__ */ S("p", { children: u === "back" ? "Decoding the AAMVA PDF417 on the back." : "Finding the card and reading the front with OCR." })
871
862
  ]
872
- }) : s && e === "capturing" && !c ? /* @__PURE__ */ S("div", {
863
+ }) : s && e === "capturing" && !c ? /* @__PURE__ */ C("div", {
873
864
  className: "scanner-camera-overlay__message",
874
865
  "aria-live": "polite",
875
866
  children: [
876
- /* @__PURE__ */ x("span", { className: "scanner-camera-overlay__spinner" }),
877
- /* @__PURE__ */ x("strong", { children: p ? p.headline : "Opening the system camera" }),
878
- /* @__PURE__ */ x("p", { children: p ? p.detail : "There is no live document guide. We find the page after you take the photo." })
867
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
868
+ /* @__PURE__ */ S("strong", { children: p ? p.headline : "Opening the system camera" }),
869
+ /* @__PURE__ */ S("p", { children: p ? p.detail : "There is no live document guide. We find the page after you take the photo." })
879
870
  ]
880
- }) : s && e === "ready" && !c ? /* @__PURE__ */ S("div", {
871
+ }) : s && e === "ready" && !c ? /* @__PURE__ */ C("div", {
881
872
  className: "scanner-camera-overlay__message",
882
873
  "aria-live": "polite",
883
- children: [/* @__PURE__ */ x("strong", { children: p ? p.headline : "System camera" }), /* @__PURE__ */ x("p", { children: p ? p.detail : "Tap the shutter to open the Camera app. There is no live document guide." })]
884
- }) : e === "starting" && !s ? /* @__PURE__ */ S("div", {
874
+ children: [/* @__PURE__ */ S("strong", { children: p ? p.headline : "System camera" }), /* @__PURE__ */ S("p", { children: p ? p.detail : "Tap the shutter to open the Camera app. There is no live document guide." })]
875
+ }) : e === "starting" && !s ? /* @__PURE__ */ C("div", {
885
876
  className: "scanner-camera-overlay__message",
886
877
  "aria-live": "polite",
887
878
  children: [
888
- /* @__PURE__ */ x("span", { className: "scanner-camera-overlay__spinner" }),
889
- /* @__PURE__ */ x("strong", { children: "Requesting the highest practical resolution" }),
890
- /* @__PURE__ */ x("p", { children: "Allow camera access to continue." })
879
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
880
+ /* @__PURE__ */ S("strong", { children: "Requesting the highest practical resolution" }),
881
+ /* @__PURE__ */ S("p", { children: "Allow camera access to continue." })
891
882
  ]
892
883
  }) : null;
893
884
  }
894
- function P() {
895
- let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } = E(), c = n?.width, l = n?.height, u = o === "drivers-license" ? ` · ${s === "back" ? "back" : s === "flip" ? "flip" : "front"}` : "";
896
- if (r) return /* @__PURE__ */ x("div", {
885
+ function fe() {
886
+ let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } = D(), c = n?.width, l = n?.height, u = o === "drivers-license" ? ` · ${s === "back" ? "back" : s === "flip" ? "flip" : "front"}` : "";
887
+ return r ? /* @__PURE__ */ S("div", {
897
888
  className: "scanner-camera-overlay__status",
898
889
  "aria-live": "polite",
899
- children: /* @__PURE__ */ S("div", {
890
+ children: /* @__PURE__ */ C("div", {
900
891
  className: "scanner-camera-overlay__status-line",
901
892
  children: [
902
- /* @__PURE__ */ x("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
893
+ /* @__PURE__ */ S("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
903
894
  i === "system-camera" ? "system camera" : "system camera · waiting",
904
895
  u,
905
896
  c && l ? ` · ${c}×${l}` : ""
906
897
  ]
907
898
  })
908
- });
909
- let d = o === "drivers-license" && s === "back", f = d && !e ? "reading" : e?.state ?? "detecting";
910
- return /* @__PURE__ */ x("div", {
899
+ }) : /* @__PURE__ */ S("div", {
911
900
  className: "scanner-camera-overlay__status",
912
901
  "aria-live": "polite",
913
- children: /* @__PURE__ */ S("div", {
902
+ children: /* @__PURE__ */ C("div", {
914
903
  className: "scanner-camera-overlay__status-line",
915
904
  children: [
916
- /* @__PURE__ */ x("span", { className: d && !e ? "detecting" : e?.state ?? "detecting" }),
917
- f,
905
+ /* @__PURE__ */ S("span", { className: e?.state ?? "detecting" }),
906
+ e?.state ?? "detecting",
918
907
  u,
919
908
  e ? ` · ${Math.round(e.confidence * 100)}% · ${e.stableFrames}/${e.requiredStableFrames}` : "",
920
909
  ` · ${t}`,
@@ -924,25 +913,25 @@ function P() {
924
913
  })
925
914
  });
926
915
  }
927
- function F() {
928
- let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: i, copyReport: a } = E(), o = e?.engine ?? r();
929
- return /* @__PURE__ */ S("dl", {
916
+ function R() {
917
+ let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: i, copyReport: a } = D(), o = e?.engine ?? r();
918
+ return /* @__PURE__ */ C("dl", {
930
919
  className: "scanner-camera-overlay__diagnostics",
931
920
  "aria-label": "Camera diagnostics",
932
921
  children: [
933
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "engine" }), /* @__PURE__ */ S("dd", { children: [
922
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "engine" }), /* @__PURE__ */ C("dd", { children: [
934
923
  o.engine,
935
924
  "/",
936
925
  o.browser,
937
926
  o.iosWebKit ? " ios" : ""
938
927
  ] })] }),
939
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "video" }), /* @__PURE__ */ x("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
940
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "track" }), /* @__PURE__ */ x("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
941
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "torch" }), /* @__PURE__ */ x("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
942
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "luma" }), /* @__PURE__ */ x("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
943
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "path" }), /* @__PURE__ */ x("dd", { children: n ?? "video-frame / live-mirror" })] }),
944
- t ? /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "shutter" }), /* @__PURE__ */ x("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
945
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("dt", { children: "share" }), /* @__PURE__ */ x("dd", { children: /* @__PURE__ */ x("button", {
928
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "video" }), /* @__PURE__ */ S("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
929
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "track" }), /* @__PURE__ */ S("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
930
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "torch" }), /* @__PURE__ */ S("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
931
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "luma" }), /* @__PURE__ */ S("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
932
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "path" }), /* @__PURE__ */ S("dd", { children: n ?? "video-frame / live-mirror" })] }),
933
+ t ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "shutter" }), /* @__PURE__ */ S("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
934
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "share" }), /* @__PURE__ */ S("dd", { children: /* @__PURE__ */ S("button", {
946
935
  type: "button",
947
936
  className: "scanner-camera-overlay__copy",
948
937
  onClick: () => void a(),
@@ -951,51 +940,51 @@ function F() {
951
940
  ]
952
941
  });
953
942
  }
954
- function _e() {
955
- let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: ee } = E(), h = a?.width, te = a?.height, g = p !== "flip" && (u ? t === "ready" : e !== "only"), _ = f === "drivers-license" ? m(p ?? "front", u) : void 0, ne = he({
943
+ function pe() {
944
+ let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: h } = D(), ee = a?.width, g = a?.height, _ = p !== "flip" && (u ? t === "ready" : e !== "only"), te = f === "drivers-license" ? m(p ?? "front", u) : void 0, v = de({
956
945
  usingSystemCamera: u,
957
946
  phase: t,
958
947
  licenseBusy: d,
959
948
  holdStillSeconds: n?.holdStillSeconds,
960
- guidanceHint: ee,
949
+ guidanceHint: h,
961
950
  guidanceReason: n?.guidance.reason,
962
- licenseHeadline: _?.headline,
951
+ licenseHeadline: te?.headline,
963
952
  licenseFlipCue: p === "flip"
964
- }), v = !!n?.holdStillSeconds;
965
- return /* @__PURE__ */ S("div", {
953
+ }), ne = !!n?.holdStillSeconds;
954
+ return /* @__PURE__ */ C("div", {
966
955
  className: "scanner-camera-overlay__controls",
967
956
  children: [
968
- /* @__PURE__ */ x("button", {
957
+ /* @__PURE__ */ S("button", {
969
958
  type: "button",
970
959
  className: "scanner-camera-overlay__cancel",
971
960
  onClick: o,
972
961
  children: "Cancel"
973
962
  }),
974
- /* @__PURE__ */ S("div", {
963
+ /* @__PURE__ */ C("div", {
975
964
  className: "scanner-camera-overlay__capture",
976
965
  children: [
977
- ne && /* @__PURE__ */ x("p", {
978
- className: `scanner-camera-overlay__guidance${v ? " is-ready" : ""}`,
966
+ v && /* @__PURE__ */ S("p", {
967
+ className: `scanner-camera-overlay__guidance${ne ? " is-ready" : ""}`,
979
968
  "aria-live": "polite",
980
- children: ne
969
+ children: v
981
970
  }),
982
- g && /* @__PURE__ */ x("button", {
971
+ _ && /* @__PURE__ */ S("button", {
983
972
  type: "button",
984
973
  className: "scanner-camera-overlay__shutter",
985
974
  onClick: () => void s(),
986
975
  disabled: t !== "ready" || !!d,
987
976
  "aria-label": u ? "Take a photo with the system camera" : "Capture full-resolution photo",
988
- children: /* @__PURE__ */ x("span", {})
977
+ children: /* @__PURE__ */ S("span", {})
989
978
  }),
990
- !u && /* @__PURE__ */ S("div", {
979
+ !u && /* @__PURE__ */ C("div", {
991
980
  className: "scanner-camera-overlay__toggles",
992
- children: [n?.autoCapture.visible && /* @__PURE__ */ S("label", { children: [/* @__PURE__ */ x("input", {
981
+ children: [n?.autoCapture.visible && /* @__PURE__ */ C("label", { children: [/* @__PURE__ */ S("input", {
993
982
  type: "checkbox",
994
983
  checked: n.autoCapture.checked,
995
984
  onChange: (e) => c(e.target.checked)
996
- }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ S("label", {
985
+ }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ C("label", {
997
986
  title: r.torch.automatic ? "Torch is controlled automatically from scene brightness" : void 0,
998
- children: [/* @__PURE__ */ x("input", {
987
+ children: [/* @__PURE__ */ S("input", {
999
988
  type: "checkbox",
1000
989
  checked: r.torch.on,
1001
990
  disabled: !r.torch.mutable,
@@ -1005,18 +994,18 @@ function _e() {
1005
994
  })
1006
995
  ]
1007
996
  }),
1008
- /* @__PURE__ */ S("div", {
997
+ /* @__PURE__ */ C("div", {
1009
998
  className: "scanner-camera-overlay__quality",
1010
- children: [/* @__PURE__ */ x("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ x("strong", { children: h && te ? `${h} × ${te}` : u ? "Tap to photograph" : "Measuring…" })]
999
+ children: [/* @__PURE__ */ S("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ S("strong", { children: ee && g ? `${ee} × ${g}` : u ? "Tap to photograph" : "Measuring…" })]
1011
1000
  })
1012
1001
  ]
1013
1002
  });
1014
1003
  }
1015
- function I({ snapshot: e }) {
1016
- let { modelDownload: t } = E();
1017
- return /* @__PURE__ */ x(me, { snapshot: e ?? t });
1004
+ function z({ snapshot: e }) {
1005
+ let { modelDownload: t } = D();
1006
+ return /* @__PURE__ */ S(k, { snapshot: e ?? t });
1018
1007
  }
1019
1008
  //#endregion
1020
- export { _e as ScannerControls, F as ScannerDiagnostics, k as ScannerFrame, I as ScannerModelDownload, N as ScannerNotice, A as ScannerPreview, fe as ScannerProvider, j as ScannerQuad, P as ScannerStatus, M as ScannerTopBar, E as useScanner, pe as useScannerRef };
1009
+ export { pe as ScannerControls, R as ScannerDiagnostics, M as ScannerFrame, z as ScannerModelDownload, L as ScannerNotice, N as ScannerPreview, ue as ScannerProvider, F as ScannerQuad, fe as ScannerStatus, I as ScannerTopBar, D as useScanner, E as useScannerRef };
1021
1010
 
1022
1011
  //# sourceMappingURL=react.js.map