@sekyro/elements 0.1.0-rc.2 → 0.1.0-rc.21
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/CHANGELOG.md +176 -0
- package/README.md +8 -9
- package/custom-elements.json +2 -2
- package/dist/cdn/chunks/barcode-detect-C5IOXMKI-ZOZ2WOWU.js +1 -0
- package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
- package/dist/cdn/chunks/capture-session-doc-HZJLTWTY-XAP4ZT6R.js +1 -0
- package/dist/cdn/chunks/challenge-frame-YBTLAQ5G-NN763UU5.js +1 -0
- package/dist/cdn/chunks/chunk-4QUL7TEF.js +1 -0
- package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-5JSOPXYS.js} +1 -1
- package/dist/cdn/chunks/chunk-67YJZR73.js +1 -0
- package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
- package/dist/cdn/chunks/chunk-AUH3O7Y7.js +1 -0
- package/dist/cdn/chunks/{chunk-WQW232LA.js → chunk-B2KJUHRZ.js} +1 -1
- package/dist/cdn/chunks/chunk-CUFOLAZN.js +25 -0
- package/dist/cdn/chunks/chunk-F4Q2Q4OC.js +1 -0
- package/dist/cdn/chunks/chunk-HHII35OF.js +1 -0
- package/dist/cdn/chunks/chunk-IBCFJKIO.js +3 -0
- package/dist/cdn/chunks/{chunk-Y27EXTAY.js → chunk-IWZRAEUN.js} +1 -1
- package/dist/cdn/chunks/chunk-KPGPSJ64.js +1 -0
- package/dist/cdn/chunks/chunk-LSBUNQZU.js +1 -0
- package/dist/cdn/chunks/{chunk-KQQ6BZAH.js → chunk-MLNUIPVU.js} +1 -1
- package/dist/cdn/chunks/chunk-NU2VUYVN.js +1 -0
- package/dist/cdn/chunks/{chunk-NQHMZQZA.js → chunk-NUIGLBFF.js} +1 -1
- package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
- package/dist/cdn/chunks/{chunk-Y7VOIKUK.js → chunk-POVLMWGM.js} +1 -1
- package/dist/cdn/chunks/chunk-QAZ7TATZ.js +1 -0
- package/dist/cdn/chunks/{chunk-M2F5OJOZ.js → chunk-QE347ZEI.js} +1 -1
- package/dist/cdn/chunks/chunk-QESNTWNP.js +33 -0
- package/dist/cdn/chunks/{chunk-JAIRD73U.js → chunk-QFCNXANK.js} +1 -1
- package/dist/cdn/chunks/chunk-SIBJ56BG.js +1 -0
- package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
- package/dist/cdn/chunks/chunk-VJKFYIPK.js +1 -0
- package/dist/cdn/chunks/chunk-WICQIC37.js +1 -0
- package/dist/cdn/chunks/{chunk-SVIHEXDZ.js → chunk-YI34K4SS.js} +1 -1
- package/dist/cdn/chunks/{chunk-HTLQX2R3.js → chunk-YRZXUDPO.js} +1 -1
- package/dist/cdn/chunks/chunk-YZWLMKXA.js +1 -0
- package/dist/cdn/chunks/chunk-ZPLN3VRG.js +1 -0
- package/dist/cdn/chunks/{chunk-4ECYTYEB.js → chunk-ZWC7BGLD.js} +1 -1
- package/dist/cdn/chunks/create-document-capture-R7KKX6YY-5FG6AKTA.js +1 -0
- package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-5VGYZUOK-KTCFCHTN.js} +1 -1
- package/dist/cdn/chunks/{detector-scanic-YCDNLCGV-FH6NWNXC.js → detector-scanic-P2RTEQUV-A5WTP2Q7.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-2CSWLQWR-E6PKDMWJ.js +1 -0
- package/dist/cdn/chunks/eid-view-FEJHQBSB-BA27H43Q.js +1 -0
- package/dist/cdn/chunks/email-otp-view-4EY5CKR5-LVNJQLG6.js +1 -0
- package/dist/cdn/chunks/flow-views-Q4Z2BS6Z-MZ4EFAQ6.js +1 -0
- package/dist/cdn/chunks/form-view-GPITA6X5-LAPFWBZM.js +1 -0
- package/dist/cdn/chunks/mrz-band-A6NIHZV3-GJO4UMKB.js +1 -0
- package/dist/cdn/chunks/overlay-de-7NCDPEIN-KI2BS6I6.js +1 -0
- package/dist/cdn/chunks/overlay-es-6MGCPCFO-CYCUQRCB.js +1 -0
- package/dist/cdn/chunks/overlay-pt-VTK6XJDH-VFNANCPU.js +1 -0
- package/dist/cdn/chunks/plan-runner-HOMYGD6Y-GMUP34K3.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-5YLRWE4H-EGV5GCSU.js +1 -0
- package/dist/cdn/chunks/{portrait-review-view-XUWQ5LIN-M5WOPF2E.js → portrait-review-view-ZAJ5TIXP-W6UQWTWP.js} +1 -1
- package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
- package/dist/cdn/chunks/proof-of-address-view-VH573XDT-JJCHDOH4.js +1 -0
- package/dist/cdn/chunks/reader-652D2CK6.js +2 -0
- package/dist/cdn/chunks/upload-file-EGXXM6TQ-NNVVB5QQ.js +1 -0
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-IQ7FLSNW.js → chunk-3CAVDRYH.js} +1 -1
- package/dist/{chunk-LREBBPJW.js → chunk-3J5LUPKY.js} +1 -1
- package/dist/{chunk-GTN3SYJJ.js → chunk-5KU4GIMW.js} +1 -1
- package/dist/chunk-APMABLNO.js +1 -0
- package/dist/chunk-AVSVM522.js +25 -0
- package/dist/{chunk-INKK6CKB.js → chunk-BGEGDQXU.js} +1 -1
- package/dist/{chunk-S6JGFCOP.js → chunk-L2F6LQ7G.js} +1 -1
- package/dist/{chunk-OQUTKFRP.js → chunk-NHOIIIGP.js} +1 -1
- package/dist/{chunk-IFHBX74I.js → chunk-OAQM45LZ.js} +1 -1
- package/dist/chunk-P223YKM3.js +1 -0
- package/dist/{chunk-LHD2PSUM.js → chunk-PEFS2JPA.js} +1 -1
- package/dist/chunk-QNR2GBZ5.js +1 -0
- package/dist/chunk-TKRB6RXI.js +33 -0
- package/dist/chunk-XXCBLQ53.js +1 -0
- package/dist/chunk-XZZPJ2FQ.js +1 -0
- package/dist/{chunk-6LR6LY2U.js → chunk-ZBTWLEPS.js} +1 -1
- package/dist/define.cjs +6 -6
- package/dist/define.js +1 -1
- package/dist/document-capture-view-2CSWLQWR-TB6SX3MZ.js +1 -0
- package/dist/{eid-view-ERVRHLLD-NLA6CQL7.js → eid-view-FEJHQBSB-NDFXLUCN.js} +1 -1
- package/dist/email-otp-view-4EY5CKR5-PXH6WYZN.js +1 -0
- package/dist/flow-views-Q4Z2BS6Z-ZSPSSABE.js +1 -0
- package/dist/form-view-GPITA6X5-VZF6Y2HM.js +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +191 -8
- package/dist/index.d.ts +191 -8
- package/dist/index.js +1 -1
- package/dist/overlay-de-7NCDPEIN-BWTDIED4.js +1 -0
- package/dist/overlay-es-6MGCPCFO-SV56NQSV.js +1 -0
- package/dist/overlay-pt-VTK6XJDH-IWQLAZ7L.js +1 -0
- package/dist/{portrait-capture-view-TMHG2UX2-4DHDNWRH.js → portrait-capture-view-5YLRWE4H-4FZAEZS2.js} +1 -1
- package/dist/{portrait-review-view-XUWQ5LIN-7GZ3GF2B.js → portrait-review-view-ZAJ5TIXP-JKR2R7RK.js} +1 -1
- package/dist/proof-of-address-view-VH573XDT-UKGWSGG3.js +1 -0
- package/dist/styles.css +131 -20
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/capture-session-doc-O33KRXH7-X5MKSSBA.js +0 -1
- package/dist/cdn/chunks/challenge-frame-NUGPTWFP-V3GGQN65.js +0 -1
- package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
- package/dist/cdn/chunks/chunk-3NAYOW43.js +0 -1
- package/dist/cdn/chunks/chunk-CSM63KBJ.js +0 -3
- package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
- package/dist/cdn/chunks/chunk-EPEHFY6J.js +0 -1
- package/dist/cdn/chunks/chunk-FAQCPBKF.js +0 -1
- package/dist/cdn/chunks/chunk-GRJNZG6Y.js +0 -33
- package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
- package/dist/cdn/chunks/chunk-L22GFJQV.js +0 -1
- package/dist/cdn/chunks/chunk-LNQJGD3J.js +0 -1
- package/dist/cdn/chunks/chunk-OTGSYUHN.js +0 -25
- package/dist/cdn/chunks/chunk-OVRHETMK.js +0 -1
- package/dist/cdn/chunks/chunk-P3OIDL7Y.js +0 -1
- package/dist/cdn/chunks/chunk-UJSGILV7.js +0 -1
- package/dist/cdn/chunks/chunk-UQ5AELS3.js +0 -1
- package/dist/cdn/chunks/chunk-YF5BWIHV.js +0 -1
- package/dist/cdn/chunks/create-document-capture-OLKNUVTU-Q3AGV6QB.js +0 -1
- package/dist/cdn/chunks/document-capture-view-GZX5JJ7N-PRYTX37D.js +0 -1
- package/dist/cdn/chunks/eid-view-ERVRHLLD-ONTAYXU7.js +0 -1
- package/dist/cdn/chunks/email-otp-view-B7UQ5CHL-GWHWAR75.js +0 -1
- package/dist/cdn/chunks/flow-views-IGQ5MYS2-3UXKITDZ.js +0 -1
- package/dist/cdn/chunks/mrz-band-VYHOTDHY-VEZ2J5IL.js +0 -1
- package/dist/cdn/chunks/overlay-de-5KYN4JFO-I4ESJMAS.js +0 -1
- package/dist/cdn/chunks/overlay-es-6CAERCCN-SPFAX3SD.js +0 -1
- package/dist/cdn/chunks/overlay-pt-UBGXJ3C3-MWW4QOSN.js +0 -1
- package/dist/cdn/chunks/plan-runner-VKPRZ3AD-VYRGIMQG.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-TMHG2UX2-N44IPYHU.js +0 -1
- package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
- package/dist/cdn/chunks/upload-file-UYXOHCRG-MBYCMRP2.js +0 -1
- package/dist/chunk-4QKQAQKO.js +0 -1
- package/dist/chunk-GRQ3QAMU.js +0 -33
- package/dist/chunk-KXJRO6VZ.js +0 -1
- package/dist/chunk-SBJNQYEL.js +0 -25
- package/dist/chunk-YZ6YGLNN.js +0 -1
- package/dist/document-capture-view-GZX5JJ7N-ZW55IE6H.js +0 -1
- package/dist/email-otp-view-B7UQ5CHL-67LKMWBY.js +0 -1
- package/dist/flow-views-IGQ5MYS2-DVYTE4D2.js +0 -1
- package/dist/overlay-de-5KYN4JFO-MYA62T4Z.js +0 -1
- package/dist/overlay-es-6CAERCCN-QPH54AX7.js +0 -1
- package/dist/overlay-pt-UBGXJ3C3-VG6FOOCX.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,181 @@
|
|
|
1
1
|
# @sekyro/elements
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
8
|
+
- Updated dependencies [07f89de]
|
|
9
|
+
- @sekyro/web@0.1.0-rc.42
|
|
10
|
+
|
|
11
|
+
## 0.1.0-rc.20
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
16
|
+
- Updated dependencies [f341f83]
|
|
17
|
+
- Updated dependencies [62dd01e]
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- Updated dependencies [00bc614]
|
|
20
|
+
- Updated dependencies [49bb89b]
|
|
21
|
+
- Updated dependencies [8f3fb74]
|
|
22
|
+
- @sekyro/web@0.1.0-rc.41
|
|
23
|
+
|
|
24
|
+
## 0.1.0-rc.19
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
29
|
+
- Updated dependencies [4f4bd85]
|
|
30
|
+
- @sekyro/web@0.1.0-rc.40
|
|
31
|
+
|
|
32
|
+
## 0.1.0-rc.18
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
37
|
+
- Updated dependencies [9610931]
|
|
38
|
+
- Updated dependencies [10715ba]
|
|
39
|
+
- @sekyro/web@0.1.0-rc.39
|
|
40
|
+
|
|
41
|
+
## 0.1.0-rc.17
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
46
|
+
- Updated dependencies [7528fca]
|
|
47
|
+
- Updated dependencies [451cd78]
|
|
48
|
+
- Updated dependencies [4743339]
|
|
49
|
+
- Updated dependencies [ae5142b]
|
|
50
|
+
- @sekyro/web@0.1.0-rc.38
|
|
51
|
+
|
|
52
|
+
## 0.1.0-rc.16
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
57
|
+
- Updated dependencies [8bbc6f8]
|
|
58
|
+
- @sekyro/web@0.1.0-rc.36
|
|
59
|
+
|
|
60
|
+
## 0.1.0-rc.15
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- ba23547: The document camera keeps its instruction at the top steady: it says what to scan and nothing else. Problems and capture hints now show in a warning band directly under the scan frame. A wrong document says what the camera saw and what to show instead ("This looks like a passport. Show your residence permit instead.") and stays until a later photo is taken; it is no longer replaced after 2 seconds. A refused photo (blurry, unreadable, same side, a server retake reason with the attempts left) stays at least 3 seconds and through the retake, so a second refusal never makes the band blink. Capture hints (glare, too far, too dark, the code-line reader's coaching) stay at least 2.5 seconds once shown. The band is a polite live region and grows in and out, so nothing under it jumps. New string keys: `native.scan.seenPassport`, `native.scan.seenCard`, `native.scan.showInstead.{carte_identite,passport,residence_permit,drivers_license}`.
|
|
65
|
+
- Updated dependencies [675fc46]
|
|
66
|
+
- @sekyro/web@0.1.0-rc.35
|
|
67
|
+
|
|
68
|
+
## 0.1.0-rc.14
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- 9a15ded: Voice guidance now plays its first prompt when the capture starts on its own, before the person has tapped the page. Browsers refuse audio until the first tap. Before, that first prompt was counted as spoken and never played, so a cold page load stayed silent until the guidance changed. Now the refused prompt plays on the first tap, once. Prompts still play one at a time, a newer prompt replaces a waiting one, and a prompt never repeats.
|
|
73
|
+
|
|
74
|
+
## 0.1.0-rc.13
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
79
|
+
- Updated dependencies [e38c7e2]
|
|
80
|
+
- Updated dependencies [5c2b1fa]
|
|
81
|
+
- Updated dependencies [24c87ef]
|
|
82
|
+
- Updated dependencies [ea2bd51]
|
|
83
|
+
- Updated dependencies [b3a1018]
|
|
84
|
+
- @sekyro/web@0.1.0-rc.34
|
|
85
|
+
|
|
86
|
+
## 0.1.0-rc.12
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
91
|
+
- Updated dependencies [b61c1b7]
|
|
92
|
+
- @sekyro/web@0.1.0-rc.33
|
|
93
|
+
|
|
94
|
+
## 0.1.0-rc.11
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
99
|
+
- Updated dependencies [7a73651]
|
|
100
|
+
- Updated dependencies [18265a3]
|
|
101
|
+
- @sekyro/web@0.1.0-rc.32
|
|
102
|
+
|
|
103
|
+
## 0.1.0-rc.10
|
|
104
|
+
|
|
105
|
+
### Patch Changes
|
|
106
|
+
|
|
107
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
108
|
+
- Updated dependencies [a649247]
|
|
109
|
+
- @sekyro/web@0.1.0-rc.31
|
|
110
|
+
|
|
111
|
+
## 0.1.0-rc.9
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
116
|
+
- Updated dependencies [e70fdcd]
|
|
117
|
+
- @sekyro/web@0.1.0-rc.30
|
|
118
|
+
|
|
119
|
+
## 0.1.0-rc.8
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- 8a832f3: `<sekyro-verification>` draws the Form step with the bundled `@sekyro/react` (planned: no flow can contain it yet).
|
|
124
|
+
- 9d173d9: `<SekyroVerification>` titles no longer change shape when Geist arrives: until the title face has loaded they are drawn in a metric-matched bold fallback (Arial Bold or Roboto Bold, sized to Geist), where they used to show Inter or the system face at a different width, so the title reflowed when Geist arrived. The result title now uses the flow's hero size (28 px), as on iOS and Android. A partner font still replaces the titles' face.
|
|
125
|
+
- Updated dependencies [1e6001c]
|
|
126
|
+
- Updated dependencies [06d8764]
|
|
127
|
+
- Updated dependencies [1c7c752]
|
|
128
|
+
- Updated dependencies [030c9dc]
|
|
129
|
+
- Updated dependencies [4581cc5]
|
|
130
|
+
- Updated dependencies [1b8395d]
|
|
131
|
+
- Updated dependencies [43ae1ec]
|
|
132
|
+
- Updated dependencies [a63d45e]
|
|
133
|
+
- Updated dependencies [98f6752]
|
|
134
|
+
- Updated dependencies [567f41a]
|
|
135
|
+
- Updated dependencies [a75a33e]
|
|
136
|
+
- Updated dependencies [80fbf3d]
|
|
137
|
+
- @sekyro/web@0.1.0-rc.29
|
|
138
|
+
|
|
139
|
+
## 0.1.0-rc.7
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
144
|
+
|
|
145
|
+
## 0.1.0-rc.6
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- f3470cd: The result screen's words fit a person who is still in your app or page. The verified line reads "Your verification is complete." (no more "You can go back to {org}"). The inconclusive, unavailable and expired screens no longer ask for a new link: inconclusive says "Start again from {org}, in good light and holding the phone upright. Contact {org} if this keeps happening.", unavailable says "Try again later from {org}, or contact {org} if this keeps happening.", and expired is titled "This verification has ended" with "Start again from {org}.". The verified title now says what the session proved, from `result.level` and `result.assurance`: "Your identity is verified" at level 3, "Your phone number is confirmed" or "Your email address is confirmed" for a level 1 code, and "You're verified" otherwise (level 2, a liveness check, no longer claims an identity). All six languages. New string keys you can override through `strings`: `native.result.expiredTitle`, `session.result.verified.titleHuman`, `session.result.verified.titlePhone`, `session.result.verified.titleEmail`.
|
|
150
|
+
- 5379d91: A level 1 result that is not exactly one phone code or one email code (for example both confirmed, or a contact your organization supplied) is now titled "Your details are confirmed" instead of "You're verified". Level 2 and a result with no level keep "You're verified". The same on Android, iOS and Flutter. All six languages. New string key you can override through `strings`: `session.result.verified.titleContact`.
|
|
151
|
+
- 14faf9e: The result screen of a simulated Sandbox session now shows a short notice: "This was a simulation", with what to do to run real checks (enroll a Sandbox tester, or run the tester check at the start of the session). It appears only on a Sandbox session that no enrolled tester ran, never in Live, and it follows your theme and the six languages. The result you receive (`onResult`, `onClose`, the `sekyro-result` event) carries `sandbox: { simulated: true, reason }` with `@sekyro/web` at this release or later. Three string keys are new and can be overridden through `strings`: `sandbox.simulatedTitle`, `sandbox.simulatedNoTesters` and `sandbox.simulatedGate`.
|
|
152
|
+
- Updated dependencies [94565f2]
|
|
153
|
+
- Updated dependencies [14faf9e]
|
|
154
|
+
- @sekyro/web@0.1.0-rc.28
|
|
155
|
+
|
|
156
|
+
## 0.1.0-rc.5
|
|
157
|
+
|
|
158
|
+
### Patch Changes
|
|
159
|
+
|
|
160
|
+
- 3aab1fe: The result screen's button now reads "Continue" for every outcome (fr « Continuer », ar «متابعة», es "Continuar", pt "Continuar", de "Weiter"), with or without an organization name. The flow runs inside your app or page, so the person never left it: "Back to {org}" made people think they had. The dead-end pages (update needed, a step this browser cannot do) use the same button. Nothing else changes: the button still shows only when you pass `onClose`, and pressing it still calls `onClose({ reason: "finished", result })`. The string key `native.result.back` is replaced by `native.result.continue`; if you override the label through `strings`, rename the key.
|
|
161
|
+
|
|
162
|
+
## 0.1.0-rc.4
|
|
163
|
+
|
|
164
|
+
### Patch Changes
|
|
165
|
+
|
|
166
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
167
|
+
- Updated dependencies [707ccc7]
|
|
168
|
+
- @sekyro/web@0.1.0-rc.27
|
|
169
|
+
|
|
170
|
+
## 0.1.0-rc.3
|
|
171
|
+
|
|
172
|
+
### Patch Changes
|
|
173
|
+
|
|
174
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
175
|
+
- Updated dependencies [246b0f3]
|
|
176
|
+
- Updated dependencies [cc7eedb]
|
|
177
|
+
- @sekyro/web@0.1.0-rc.26
|
|
178
|
+
|
|
3
179
|
## 0.1.0-rc.2
|
|
4
180
|
|
|
5
181
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ It is idempotent and does nothing without a DOM.
|
|
|
59
59
|
| `locale` | `locale` | `ar`, `fr`, `en`, `es`, `pt` or `de`. Without it: the page's `<html lang>` when it is one of them, else `en`. Arabic runs right to left. |
|
|
60
60
|
| `color-scheme` | `colorScheme` | `light` (default), `dark`, or `system` to follow the device. |
|
|
61
61
|
| `asset-base-url` | `assetBaseUrl` | Where your page serves the face detector assets (see "Model assets"). |
|
|
62
|
-
| `closable` | `closable` | Shows the header's close button and the result's "
|
|
62
|
+
| `closable` | `closable` | Shows the header's close button and the result's "Continue" button; both fire `sekyro-close`. |
|
|
63
63
|
| `back-navigation` | `backNavigation` | `history`: the browser's back button goes one screen back inside the flow. `none` (default) never touches the page's history. |
|
|
64
64
|
| `handoff-url` | `handoffUrl` | The link a desktop shows as a QR code when a camera step needs a phone (the session's `hostedUrl`). Without it, a notice asks to continue on a phone. |
|
|
65
65
|
| `voice` | | `off` turns the spoken guidance off. |
|
|
@@ -79,6 +79,10 @@ The string attributes reflect: setting the property sets the attribute, and the
|
|
|
79
79
|
| `documentLiveMrz` | `DocumentLiveMrzOptions` | Live MRZ reading on the document step: `workerUrl`, `assetBaseUrl`, or `mode: "off"`. |
|
|
80
80
|
| `voice` | `false \| VoiceOptions` | Spoken guidance options. Set, it wins over the `voice` attribute. |
|
|
81
81
|
|
|
82
|
+
The element creates its own verification with the default `rearm: "auto"`: after a retryable refusal the camera
|
|
83
|
+
reopens by itself. For the coaching screen and a "Start a new attempt" button instead, create the verification with
|
|
84
|
+
`createVerification({ clientToken, locale, rearm: "manual" })` and set it as `verification`.
|
|
85
|
+
|
|
82
86
|
Properties set before the element is defined (a framework binding, a script that ran first) are picked up when it
|
|
83
87
|
upgrades.
|
|
84
88
|
|
|
@@ -232,17 +236,12 @@ page's resets: under Bootstrap's reboot or Tailwind's preflight the flow looks a
|
|
|
232
236
|
## Sandbox
|
|
233
237
|
|
|
234
238
|
A Sandbox session shows its test chrome in the element exactly as in `@sekyro/react`: the "Test session" badge, the
|
|
235
|
-
"Skip with test data" action
|
|
239
|
+
"Skip with test data" action, the tester check and, on the result screen of a session no enrolled tester ran, the
|
|
240
|
+
"This was a simulation" notice. The `sekyro-result` detail then carries `sandbox: { simulated: true, reason }`.
|
|
241
|
+
Nothing to configure: it follows the session.
|
|
236
242
|
|
|
237
243
|
## Size
|
|
238
244
|
|
|
239
245
|
React and ReactDOM (production builds) and the whole flow, gzip, measured by `npm run size`: about 143 KiB for the
|
|
240
246
|
npm entry (your bundler adds `@sekyro/web`), about 174 KiB for the CDN entry with `@sekyro/web`. Each step's view,
|
|
241
247
|
the document camera and the es, pt and de copy load later, when used.
|
|
242
|
-
|
|
243
|
-
## Scripts
|
|
244
|
-
|
|
245
|
-
- `npm run build`: the npm build (ESM and CJS), rolled-up declarations, `styles.css` and its fonts, and the CDN build.
|
|
246
|
-
- `npm test`: the manifest check and the unit tests (jsdom, over the real flow); `npm run test:dist` checks the build.
|
|
247
|
-
- `npm run e2e`: Playwright, the plain HTML page against a fixture-mode API (after `npm run build`).
|
|
248
|
-
- `npm run size`, `npm run api:check`, `npm run manifest`.
|
package/custom-elements.json
CHANGED
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"text": "boolean"
|
|
79
79
|
},
|
|
80
80
|
"fieldName": "closable",
|
|
81
|
-
"description": "Shows the header's close button and the result's
|
|
81
|
+
"description": "Shows the header's close button and the result's Continue button. Both fire `sekyro-close`; take the person on from your page there."
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"name": "voice",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
},
|
|
168
168
|
"attribute": "closable",
|
|
169
169
|
"reflects": true,
|
|
170
|
-
"description": "Shows the header's close button and the result's
|
|
170
|
+
"description": "Shows the header's close button and the result's Continue button. Both fire `sekyro-close`; take the person on from your page there."
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
173
|
"kind": "field",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-YZWLMKXA.js";import{a as t}from"./chunk-4FHWXBOB.js";var c={name:"zxing_reader.wasm",bytes:928265,sha256:"5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b",sha12:"5bb3ce7aeedc"},d=["PDF417","QRCode","DataMatrix","Aztec"];function f(e){return`${e.replace(/\/+$/,"")}/${c.sha12}/${c.name}`}t(f,"f");async function m(e,o=fetch){let r=await o(f(e),{cache:"force-cache",credentials:"omit"});if(!r.ok)throw new Error("barcode wasm download");let a=await r.arrayBuffer();if(a.byteLength!==c.bytes||await i(a)!==c.sha256)throw new Error("barcode wasm integrity");return a}t(m,"d");async function w(e,o=fetch){let r=await m(e,o),a=await import("./reader-652D2CK6.js");return await a.prepareZXingModule({overrides:{wasmBinary:r},fireImmediately:!0}),async s=>(await a.readBarcodes(s,{formats:[...d],tryHarder:!0,maxNumberOfSymbols:1})).some(n=>n.isValid)}t(w,"h");export{f as barcodeWasmUrl,m as fetchBarcodeWasm,w as loadBarcodeDetect};
|
package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b as e,c as r,d as o}from"./chunk-
|
|
1
|
+
import{a,b as e,c as r,d as o}from"./chunk-PND4F7JQ.js";import"./chunk-4FHWXBOB.js";export{a as bounded,r as cameraHash,e as hex16,o as noteCameraTrait};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s,c as a,d as _,e as C,f as A,g as D,h as o,i as S,j as r,k as t,l as E,m as p,n as T,o as O,p as i,q as m,r as R}from"./chunk-VJKFYIPK.js";import"./chunk-IWZRAEUN.js";import"./chunk-LSBUNQZU.js";import"./chunk-F4Q2Q4OC.js";import"./chunk-HHII35OF.js";import"./chunk-WICQIC37.js";import"./chunk-P7K7ELYZ.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{i as CAPTURE_CANDIDATE_SPACING_MS,O as CAPTURE_EXTRA_CANDIDATES,m as CAPTURE_WINDOW_MS,p as CaptureSessionDoc,_ as DOC_BLACK_FRAME_LUMA,C as DOC_BLACK_FRAME_TICKS,A as DOC_CADENCE_HZ,a as DOC_FIRST_FRAME_MS,o as DOC_PROFILE_TICKS,t as DOC_SHUTTER_DEFAULTS,r as DOC_SLOW_TICK_MS,S as DOC_WARMUP_TICKS,R as REFOCUS_APPLY_MAX_MS,D as SIDE_PROBE_MS,T as passportBandOf,E as resolveDocShutterTuning,s as warmDocDetector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-4FHWXBOB.js";var k=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),f,i=(f=class extends Error{constructor(t,r){super(`Sekyro challenge failed: ${t}${r!==void 0?` (${r})`:""}`),this.name="ChallengeError",this.code=t,r!==void 0&&(this.detail=r)}},o(f,"i"),f),b=3e4,p=12e4,E="sekyro.challenge.",M="position:fixed;width:1px;height:1px;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none;border:0",d=null,m=Promise.resolve();function T(){y(),m=Promise.resolve(),g=!1}o(T,"F");function u(){return new i("aborted")}o(u,"d");function S(){let e=globalThis.crypto;return e!==void 0&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}o(S,"C");function v(e){return new URL(e,document.baseURI).origin}o(v,"h");function y(){let e=d;if(e!==null){d=null,window.removeEventListener("message",e.listener),e.iframe.remove();for(let t of e.waiters.values())t.reject(new i("challenge_frame_blocked"));e.waiters.clear()}}o(y,"u");function A(e,t){if(t.source!==e.iframe.contentWindow||t.origin!==e.origin)return;let r=t.data;if(typeof r!="object"||r===null)return;let n=r;if(typeof n.type!="string"||!n.type.startsWith(E)||n.v!==1)return;if(n.type==="sekyro.challenge.ready"){e.readyMs??(e.readyMs=Date.now()-e.insertedAt),e.isReady=!0,e.onReady?.();return}if(typeof n.id!="string")return;let l=e.waiters.get(n.id);if(l!==void 0){if(n.type==="sekyro.challenge.token"&&typeof n.token=="string"&&n.token!=="")e.waiters.delete(n.id),l.resolve(n.token);else if(n.type==="sekyro.challenge.error"){e.waiters.delete(n.id);let a=typeof n.code=="string"&&k.has(n.code)?n.code:"challenge_failed",s=typeof n.detail=="string"||typeof n.detail=="number"?String(n.detail).slice(0,32):void 0;l.reject(new i(a==="challenge_failed"&&s==="200100"?"clock_wrong":a,s))}}}o(A,"k");function L(e){if(d!==null&&d.url===e)return d;y();let t=document.createElement("iframe");t.setAttribute("title","Security check"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex","-1"),t.setAttribute("referrerpolicy","no-referrer"),t.setAttribute("style",M);let r={url:e,origin:v(e),iframe:t,isReady:!1,insertedAt:Date.now(),onReady:null,waiters:new Map,listener:o(n=>A(r,n),"listener")};return window.addEventListener("message",r.listener),t.src=e,document.body.appendChild(t),d=r,r}o(L,"M");function R(e,t,r){return e.isReady?Promise.resolve():new Promise((n,l)=>{let a=o(()=>{clearTimeout(c),r?.removeEventListener("abort",s),e.onReady=null},"o"),s=o(()=>{a(),l(u())},"s"),c=setTimeout(()=>{a(),l(new i("challenge_frame_blocked"))},t);r?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{a(),n()}})}o(R,"A");async function w(e){if(e.signal?.aborted)throw u();let t=L(e.frameUrl);try{return await U(t,e)}catch(r){throw r instanceof i&&t.readyMs!==void 0&&(r.readyMs??(r.readyMs=t.readyMs)),r}}o(w,"y");async function U(e,t){let r=t.signal;await R(e,t.readyTimeoutMs??b,r);let n=e.iframe.contentWindow;if(n===null)throw new i("challenge_frame_blocked");let l=t.timeoutMs??p,a=S(),s,c;try{return await new Promise((_,h)=>{e.waiters.set(a,{resolve:_,reject:h}),s=setTimeout(()=>h(new i("timeout")),l),r!==void 0&&(c=o(()=>h(u()),"l"),r.addEventListener("abort",c,{once:!0})),n.postMessage({type:"sekyro.challenge.request",v:1,id:a,siteKey:t.siteKey,action:t.action,subject:t.subject},e.origin)})}finally{clearTimeout(s),r!==void 0&&c!==void 0&&r.removeEventListener("abort",c),e.waiters.delete(a)}}o(U,"x");var g=!1;function x(e,t){if(g)return;let r;if(t==="challenge_frame_blocked"){let n=e;try{n=v(e)}catch{}r=`Sekyro: the security check frame could not load. Allow \`frame-src ${n}\` in your Content-Security-Policy.`}else if(t==="embedder_opaque")r="Sekyro: the security check needs a page with an origin. Do not run the SDK in a sandboxed or data: document.";else return;g=!0,console.warn(r)}o(x,"R");async function C(e){if(globalThis.origin==="null")throw new i("embedder_opaque");if(e.signal?.aborted)throw u();try{return await w(e)}catch(t){if(y(),e.signal?.aborted||t instanceof i&&t.code==="aborted")throw u();if(t instanceof i&&t.code==="timeout")throw t;try{return await w(e)}catch(r){throw y(),e.signal?.aborted?u():r instanceof i?r:new i("challenge_failed")}}}o(C,"S");function D(e){let t=o(()=>C(e).catch(n=>{throw n instanceof i&&x(e.frameUrl,n.code),n}),"n"),r=m.then(t,t);return m=r.catch(()=>{}),r}o(D,"T");export{p as CHALLENGE_EXECUTE_TIMEOUT_MS,b as CHALLENGE_READY_TIMEOUT_MS,i as ChallengeError,D as executeChallenge,T as resetChallengeFrameForTests};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as Re,e as Xe,f as Ze,g as Ve}from"./chunk-WICQIC37.js";import{a as le,b as je,c as ce,d as $e}from"./chunk-P7K7ELYZ.js";import{a as Se,b as Q,c as Ae,d as Ie,e as Ce,h as Oe,i as ne,j as Pe,k as Ge,l as He,m as Ke}from"./chunk-6MYG4HWP.js";import{a as Ue,b as Fe,c as Ne,d as Le,e as Be,f as oe,g as j,h as qe,i as We,j as ze}from"./chunk-JS2IXPNL.js";import{b as xe,c as De}from"./chunk-SLLJX5QK.js";import{a as o}from"./chunk-4FHWXBOB.js";var Tt=["magenta","yellow","green","blue"],_t={magenta:"rgb(255, 72, 150)",yellow:"rgb(255, 190, 0)",green:"rgb(0, 238, 175)",blue:"rgb(25, 150, 255)",dark:"rgb(0, 0, 0)"};function zi(i){return _t[i]}o(zi,"P");var Et=4,St=4,J=o(i=>typeof i=="number"&&Number.isFinite(i),"R");function ee(i){if(typeof i!="object"||i===null)return!1;let e=i;if(typeof e.nonce!="string"||e.nonce.length===0||!Array.isArray(e.colours)||e.colours.length<1||e.colours.length>8||!e.colours.every(r=>Tt.includes(r))||!Array.isArray(e.onsetsMs)||e.onsetsMs.length!==e.colours.length)return!1;let t=-1;for(let r of e.onsetsMs){if(!J(r)||r<0||r<=t)return!1;t=r}return!(!J(e.holdMs)||e.holdMs<=0||!J(e.endMs)||e.endMs<=t||!J(e.clipMs)||e.clipMs<e.endMs||e.clipMs>8e3)}o(ee,"_");function Ye(i,e){return ee(i)?Math.max(e,Math.ceil(i.clipMs)):e}o(Ye,"O");function Qe(i,e){let t=e.now??(()=>performance.now()),r=ee(i)?i:void 0,s=[],a=null,n=null,l=null,c=!1,h=null,d=o(p=>{h=p;try{e.paint(p)}catch{}},"s"),u=o(p=>{let v=e.frames?.()??null;return v!==null&&l!==null?v.mediaTimeMs+(p-v.presentationTimeMs)-l:p-(n??p)},"p"),m=o((p,v,y=0)=>{if(c)return;let g=Math.max(0,p-u(t()));a=setTimeout(()=>{if(a=null,!c){if(y<Et&&u(t())<p-St){m(p,v,y+1);return}v()}},g)},"f"),w=o(p=>{if(r===void 0)return;let v=r.endMs;if(p>=r.colours.length){m(v,()=>d(null));return}let y=r.onsetsMs[p],g=p+1<r.onsetsMs.length?r.onsetsMs[p+1]:v;m(y,()=>{let M=u(t());if(M>v){h!==null&&d(null);return}let E=r.colours[p];d(E);let A=s.length===0?0:s[s.length-1].tMs;s.push({tMs:Math.max(A,Math.round(M)),colour:E});let I=y+r.holdMs;if(I<g){m(I,()=>{if(u(t())>v){h!==null&&d(null);return}d("dark"),w(p+1)});return}w(p+1)})},"S");return{started(p){if(r===void 0||c||n!==null)return;n=p;let v=e.frames?.()??null;l=v===null?null:v.mediaTimeMs+(p-v.presentationTimeMs),w(0)},stop(){c||(c=!0,a!==null&&clearTimeout(a),a=null,h!==null&&d(null))},report(){return r===void 0?void 0:{nonce:r.nonce,rendered:[...s]}}}}o(Qe,"w");var At=1e4,O,It=(O=class{constructor(e,t){this.tier="blaze",this.inner=e,t!==void 0&&(this.fallbackReason=t)}static async create(e,t){let r=await import("./vision_bundle-WBHR7TEE.js"),s=await r.FilesetResolver.forVisionTasks(e),a=await r.FaceDetector.createFromOptions(s,{baseOptions:{modelAssetPath:`${e}/blaze_face_short_range.tflite`,delegate:"CPU"},runningMode:"IMAGE"});return new O(a,t)}async detect(e,t,r){let s;try{s=this.inner.detect(e).detections}catch{return null}let a=xt(s);if(a?.boundingBox===void 0)return null;let n=te(e),l=Dt(a.keypoints,n),c=a.keypoints?.[2],h={box:{x:a.boundingBox.originX,y:a.boundingBox.originY,width:a.boundingBox.width,height:a.boundingBox.height},...l!==void 0?{eyes:l}:{},...c!==void 0?{nose:{x:c.x*n.width,y:c.y*n.height}}:{},score:a.categories[0]?.score??0,extraFaces:Je(s.map(d=>d.boundingBox??{width:0,height:0}),s.indexOf(a))};return et(h,e,t,r)}destroy(){try{this.inner.close()}catch{}}},o(O,"t"),O);function xt(i){let e,t=-1;for(let r of i){let s=r.categories[0]?.score??0;s>t&&(e=r,t=s)}return e}o(xt,"R");function Dt(i,e){let t=i?.[0],r=i?.[1];if(t===void 0||r===void 0)return;let s=o(l=>({x:l.x*e.width,y:l.y*e.height}),"n"),[a,n]=[s(t),s(r)];return a.x<=n.x?{left:a,right:n}:{left:n,right:a}}o(Dt,"T");function Rt(){if(typeof OffscreenCanvas=="function")return new OffscreenCanvas(2,2);let i=document.createElement("canvas");return i.width=2,i.height=2,i}o(Rt,"E");var Ct=4;async function Ot(){let i=globalThis.FaceDetector;if(typeof i!="function")return{ok:!1,reason:"unsupported"};try{let e=new i({fastMode:!0,maxDetectedFaces:Ct});return await e.detect(Rt()),{ok:!0,instance:e}}catch(e){return{ok:!1,reason:`smoke_failed:${e instanceof Error?e.message:String(e)}`}}}o(Ot,"w");var U,Pt=(U=class{constructor(e,t){this.tier="native",this.inner=e,t!==void 0&&(this.fallbackReason=t)}async detect(e,t,r){let s;try{s=await this.inner.detect(e)}catch{return null}let a=s.map(d=>d.boundingBox),n=-1;a.forEach((d,u)=>{let m=a[n];(m===void 0||d.width*d.height>m.width*m.height)&&(n=u)});let l=s[n];if(l===void 0)return null;let c=Gt(l.landmarks),h={box:{x:l.boundingBox.x,y:l.boundingBox.y,width:l.boundingBox.width,height:l.boundingBox.height},...c!==void 0?{eyes:c}:{},score:1,extraFaces:Je(a,n)};return et(h,e,t,r)}destroy(){}},o(U,"b"),U);function Gt(i){if(i===void 0)return;let e=i.filter(s=>s.type==="eye").map(s=>s.locations[0]).filter(s=>s!==void 0),[t,r]=e;if(!(t===void 0||r===void 0))return t.x<=r.x?{left:t,right:r}:{left:r,right:t}}o(Gt,"S");var Ut=.25;function Je(i,e){let t=i[e],r=t===void 0?0:t.width*t.height;if(!(r>0))return 0;let s=0;return i.forEach((a,n)=>{n!==e&&a.width*a.height>=Ut*r&&(s+=1)}),s}o(Je,"f");var ue="/models-v3",Ft=["native","blaze"],F,de=(F=class extends Error{constructor(e){super(`no detector tier available (${e})`),this.name="DetectorLadderError",this.fallbackReason=e}},o(F,"x"),F);function te(i){let e=i;if(typeof e.videoWidth=="number"&&e.videoWidth>0)return{width:e.videoWidth,height:e.videoHeight??0};if(typeof e.naturalWidth=="number"&&e.naturalWidth>0)return{width:e.naturalWidth,height:e.naturalHeight??0};let t=typeof e.width=="number"?e.width:0,r=typeof e.height=="number"?e.height:0;return{width:t,height:r}}o(te,"y");function et(i,e,t,r){let s=te(e),a=s.width>0?t/s.width:1,n=s.height>0?r/s.height:1,l=o(c=>({x:c.x*a,y:c.y*n}),"s");return{box:{x:i.box.x*a,y:i.box.y*n,width:i.box.width*a,height:i.box.height*n},...i.eyes!==void 0?{eyes:{left:l(i.eyes.left),right:l(i.eyes.right)}}:{},...i.nose!==void 0?{nose:l(i.nose)}:{},score:i.score,...i.extraFaces!==void 0?{extraFaces:i.extraFaces}:{}}}o(et,"h");function Nt(i){return i instanceof Error?i.message:String(i)}o(Nt,"C");async function x(i){let e=i.preferred??Ft,t=[];for(let r of e){if(r==="native"){let s=await Ot();if(s.ok)return new Pt(s.instance,he(t));t.push(`native:${s.reason}`);continue}try{return await Lt(It.create(i.v3AssetBaseUrl??ue,he(t)),i.blazeInitTimeoutMs??At)}catch(s){t.push(s instanceof tt?"blaze:blaze_init_timeout":`blaze:${Nt(s)}`)}}throw new de(he(t)??"no_tier_available")}o(x,"O");function he(i){return i.length>0?i.join("; "):void 0}o(he,"v");var N,tt=(N=class extends Error{},o(N,"g"),N);function Lt(i,e){return new Promise((t,r)=>{let s=setTimeout(()=>{r(new tt(`init exceeded ${e}ms`)),i.then(a=>a.destroy(),()=>{})},e);i.then(a=>{clearTimeout(s),t(a)},a=>{clearTimeout(s),r(a)})})}o(Lt,"W");var C=1;function it(){return typeof OffscreenCanvas=="function"&&typeof createImageBitmap=="function"&&typeof Worker=="function"}o(it,"K");function Bt(i,e={}){let t=e.createDetector??x,r=null;i.onmessage=s=>{let a=s.data;if(a.v!==C){a.bitmap?.close?.();return}if(a.type==="init"){t(a.options).then(n=>{r=n;let l={v:C,type:"ready",tier:n.tier,...n.fallbackReason!==void 0?{fallbackReason:n.fallbackReason}:{}};i.postMessage(l)});return}if(a.type==="detect"){let n=o(l=>{let c={v:C,type:"result",id:a.id,observation:l};i.postMessage(c),a.bitmap.close?.()},"a");if(r===null){n(null);return}r.detect(a.bitmap,a.streamWidth,a.streamHeight).then(n,()=>n(null))}}}o(Bt,"B");typeof self<"u"&&typeof self.importScripts=="function"&&Bt(self);var P,rt=(P=class{constructor(e,t){this.pending=new Map,this.nextId=1,this.worker=e,this.tier=t.tier,t.fallbackReason!==void 0&&(this.fallbackReason=t.fallbackReason),e.addEventListener("message",r=>{let s=r.data;if(s.v!==C||s.type!=="result")return;let a=this.pending.get(s.id);this.pending.delete(s.id),a?.(s.observation)})}static create(e,t,r=1e4){return new Promise((s,a)=>{let n=setTimeout(()=>{e.removeEventListener("message",l),e.terminate(),a(new Error(`worker detector not ready within ${r}ms`))},r),l=o(h=>{let d=h.data;d.v!==C||d.type!=="ready"||(clearTimeout(n),e.removeEventListener("message",l),s(new P(e,d)))},"s");e.addEventListener("message",l);let c={v:C,type:"init",options:t};e.postMessage(c)})}async detect(e,t,r){let s;try{typeof ImageBitmap<"u"&&e instanceof ImageBitmap?s=e:typeof createImageBitmap=="function"?s=await createImageBitmap(e):s=e}catch{return null}let a=this.nextId;return this.nextId+=1,new Promise(n=>{this.pending.set(a,n);let l={v:C,type:"detect",id:a,bitmap:s,streamWidth:t,streamHeight:r};this.worker.postMessage(l,[s])})}destroy(){for(let e of this.pending.values())e(null);this.pending.clear(),this.worker.terminate()}},o(P,"t"),P);var qt=[...Ue.filter(i=>i.startsWith("video/mp4")),"video/webm;codecs=h264","video/webm;codecs=avc1","video/webm;codecs=vp8","video/webm;codecs=vp9","video/webm"],dt=new Set;function Wt(i){let e=/(?:Chrome|Chromium)\/(\d+)\./.exec(i??"");return e?Number(e[1]):null}o(Wt,"Pe");function zt(i=Kt(),e=globalThis.navigator?.userAgent){if(i===void 0)return"";let t=Wt(e)===126;for(let r of qt)if(!(dt.has(r)||t&&r.startsWith("video/mp4")))try{if(i(r))return r}catch{}return""}o(zt,"be");function st(i){i!==""&&dt.add(i)}o(st,"L");function Ht(i){return i.replace(/^video\/x-matroska/i,"video/webm")}o(Ht,"ye");function ft(i){let e=/codecs=["']?([^,;"']+)/i.exec(i);return e?e[1].trim():i.split(";")[0].trim()}o(ft,"lt");function Kt(){let i=globalThis.MediaRecorder;return i&&typeof i.isTypeSupported=="function"?e=>i.isTypeSupported(e):void 0}o(Kt,"xe");var pt=2500,Xt=1e3,Zt=1500,at=25e5,Vt=100,jt=700,$t=20,Yt=1500,ie=null;function Qt(){return ie??(ie=import("./clip-inspect-DLJXVKV6-TNHTD4LV.js").catch(i=>{throw ie=null,i})),ie.catch(()=>null)}o(Qt,"He");var B,D=(B=class extends Error{constructor(e,t){super(t??e),this.kind=e}},o(B,"T"),B),Jt=100;function nt(i,e){return i.stats===void 0?!1:i.stats===null?!0:i.stats.durationMs<e-Jt}o(nt,"N");function ei(i,e){return i.stats?e.stats?i.stats.durationMs>e.stats.durationMs:!0:!1}o(ei,"Ee");var q,ti=(q=class{constructor(e={}){this.recorder=null,this.stream=null,this.chunks=[],this.bytes=0,this.hardStopTimer=null,this.graceTimer=null,this.pollTimer=null,this.settled=!1,this.now=e.now??(()=>globalThis.performance?.now?.()??Date.now())}clearTimers(){this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.graceTimer&&clearTimeout(this.graceTimer),this.pollTimer&&clearInterval(this.pollTimer),this.hardStopTimer=null,this.graceTimer=null,this.pollTimer=null}record(e,t,r,s=pt,a){let n=zt(),l=Qt();return this.recordRaw(e,t,r,s,a,n).then(c=>ii(c,l),c=>{throw c instanceof D&&(c.requestedMimeType=n),c})}recordRaw(e,t,r,s,a,n){return this.recorder&&!this.settled?Promise.reject(new D("generic","record() called while a recording is in flight — ClipRecorder handles one recording at a time")):(this.recorder=null,this.clearTimers(),this.chunks=[],this.bytes=0,this.settled=!1,this.stream=e,new Promise((l,c)=>{let h;try{h=new MediaRecorder(e,n?{mimeType:n,videoBitsPerSecond:at}:{videoBitsPerSecond:at})}catch{try{h=new MediaRecorder(e)}catch{c(new D("unsupported"));return}}this.recorder=h;let d=o(g=>{this.settled||(this.settled=!0,this.clearTimers(),g())},"d"),u=o(()=>d(()=>{let g=Ht(h.mimeType||n||Fe),M=new Blob(this.chunks,{type:g});if(M.size===0){c(new D("generic","empty clip"));return}if(oe(M)){c(new D("cliptoolarge"));return}l({blob:M,mimeType:g,requestedMimeType:n})}),"u");h.ondataavailable=g=>{g.data&&g.data.size&&(this.chunks.push(g.data),this.bytes+=g.data.size,this.bytes>Be&&d(()=>{try{h.state!=="inactive"&&h.stop()}catch{}c(new D("cliptoolarge"))}))},h.onstop=u,h.onerror=()=>d(()=>c(new D("generic")));let m=this.now();if(r!==void 0||a!==void 0){let g=!1;h.onstart=()=>{if(!(g||this.settled)&&(g=!0,m=this.now(),r!==void 0))try{r()}catch{}}}try{h.start(Xt)}catch{d(()=>c(new D("generic")));return}let w=o(()=>{if(this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=null,this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.hardStopTimer=null,this.settled||t?.(),h.state!=="inactive"){try{h.stop()}catch{u()}this.graceTimer=setTimeout(u,Zt)}else u()},"m"),p=this.now();if(a===void 0){this.hardStopTimer=setTimeout(w,s);return}let v=null,y=!1;this.hardStopTimer=setTimeout(w,s+jt),this.pollTimer=setInterval(()=>{if(this.settled||y)return;let g=null;try{g=a.latest()}catch{g=null}let M=g?.presentationTimeMs;M!==void 0&&Number.isFinite(M)&&M>=m&&v===null&&(v=M);let E=v!==null&&M!==void 0&&M-v>=s,A=v===null&&this.now()-p>=s;if(!(!E&&!A)){if(y=!0,this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=null,A){w();return}this.hardStopTimer&&clearTimeout(this.hardStopTimer),this.hardStopTimer=setTimeout(w,Vt)}},$t)}))}stop(e){this.clearTimers();let t=this.recorder;if(t&&t.state!=="inactive")try{t.stop()}catch{}this.recorder=null,(e??this.stream)?.getTracks().forEach(r=>r.stop()),this.stream=null}},o(q,"A"),q);async function ii(i,e){let t,r=new Promise(h=>{t=setTimeout(()=>h(null),Yt)}),s=await Promise.race([e,r]);if(clearTimeout(t),s===null)return i;let a;try{a=await s.blobBytes(i.blob)}catch{return{...i,stats:null}}let n=s.inspectClipBytes(a);if(n?.container!=="webm")return{...i,stats:n};let l=s.withWebmDuration(a,n.durationMs);if(l===null)return{...i,stats:n};let c=s.inspectClipBytes(l);return c===null||c.frames!==n.frames||c.durationMs!==n.durationMs?{...i,stats:n}:{...i,blob:new Blob([l],{type:i.blob.type}),stats:n}}o(ii,"Be");function ri(i,e,t=.92){return new Promise((r,s)=>{let a=i.videoWidth,n=i.videoHeight;if(!a||!n){s(new Error("video-not-ready"));return}let l=e.getContext("2d");if(!l){s(new Error("no-2d-context"));return}e.width=a,e.height=n,l.scale(-1,1),l.drawImage(i,-a,0),e.toBlob(c=>c?r(c):s(new Error("empty-keyframe")),"image/jpeg",t)})}o(ri,"Me");var W,si=(W=class{constructor(e){this.timer=null,this.frameCallbackId=null,this.running=!1,this.busy=!1,this.lastRunAt=Number.NEGATIVE_INFINITY,this.degradeCount=0,this.durations=[],this.options=e,this.periodMs=1e3/e.cadenceHz}start(){if(this.running)return;this.running=!0;let e=this.options.video;if(typeof e?.requestVideoFrameCallback=="function"){let t=o(()=>{this.running&&(this.frameCallbackId=e.requestVideoFrameCallback?.(()=>{this.frameCallbackId=null,this.now()-this.lastRunAt>=this.periodMs&&this.tick(),t()}))},"t");t();return}this.timer=setInterval(()=>this.tick(),this.periodMs)}stop(){this.running=!1,this.timer!==null&&(clearInterval(this.timer),this.timer=null),this.frameCallbackId!==null&&(this.options.video?.cancelVideoFrameCallback?.(this.frameCallbackId),this.frameCallbackId=null)}stats(){let e=this.durations.length===0?0:this.durations.reduce((t,r)=>t+r,0)/this.durations.length;return{degradeCount:this.degradeCount,meanDetectMs:e}}now(){return this.options.now?.()??performance.now()}tick(){if(!this.running)return;if(this.busy){this.degradeCount+=1;return}this.busy=!0,this.lastRunAt=this.now();let e=this.now();this.options.run().catch(()=>{}).finally(()=>{this.busy=!1,this.durations.push(this.now()-e),this.durations.length>20&&this.durations.shift()})}},o(W,"D"),W),ai=Object.freeze({Q_GOOD:.6,RISE_PER_S:.9,FALL_PER_S:.25,CENTER_FALLOFF_IOD_MULTIPLE:1.35,BOX_EYE_OFFSET_FACTOR:.12,IOD_BOX_PROXY_FACTOR:.42,SIZE_IDEAL_MIN:.12,SIZE_IDEAL_MAX:.3,SIZE_HARD_MIN:.08,SIZE_HARD_MAX:.45,ROLL_MAX_DEG:25,MOTION_VELOCITY_IOD_PER_S:.5,MOTION_TAU_S:.4,MOTION_DEADBAND_IOD_PER_S:.1,READY_WINDOW_MS:500,GUIDE_SIZE:.6,GUIDE_CENTERING:.6,GUIDE_POSE:.6,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,GUIDE_MOTION:.5}),L=o(i=>Math.min(1,Math.max(0,i)),"C"),z,ot=(z=class{constructor(e={}){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal",this.t={...ai,...e}}reset(){this.p=0,this.lastTickAt=null,this.lastCenter=null,this.velocityEma=0,this.qWindow=[],this.lastSizeDirection="ideal"}tick(e){let{observation:t,quality:r,timestampMs:s}=e,a=this.lastTickAt===null?0:Math.max(0,(s-this.lastTickAt)/1e3);this.lastTickAt=s;let n={presence:0,single:1,centering:0,size:0,pose:0,sharpness:L(r.sharpness),exposure:L(r.exposure),motion:1};if(t!==null){n.presence=1,n.single=(t.extraFaces??0)>0?0:1;let d=this.geometryOf(t,e);n.centering=d.centering,n.size=d.size,n.pose=d.pose,n.motion=this.motionOf(d.center,d.iod,s)}else this.lastCenter=null,this.velocityEma=0;let l=Math.min(n.presence,n.single,n.centering,n.size,n.pose,n.sharpness,n.exposure,n.motion);this.p=L(this.p+(l>=this.t.Q_GOOD?this.t.RISE_PER_S*l:-this.t.FALL_PER_S*(1-l))*a),this.qWindow.push({at:s,q:l}),this.qWindow=this.qWindow.filter(d=>d.at>=s-this.t.READY_WINDOW_MS);let c=this.qWindow.map(d=>d.q);if(c.length>=3){let d=Math.min(...c),u=c.indexOf(d);c=c.filter((m,w)=>w!==u)}let h=this.p>=1&&c.every(d=>d>=this.t.Q_GOOD);return{at:s,q:l,p:this.p,factors:n,guidanceKey:this.guidanceOf(n,r,l),ready:h,accepted:l>=this.t.Q_GOOD}}geometryOf(e,t){let{box:r,eyes:s}=e,a={x:t.frameWidth/2,y:t.frameHeight/2},n=Math.min(t.frameWidth,t.frameHeight),l=s!==void 0?{x:(s.left.x+s.right.x)/2,y:(s.left.y+s.right.y)/2}:{x:r.x+r.width/2,y:r.y+r.height/2-this.t.BOX_EYE_OFFSET_FACTOR*r.height},c=s!==void 0?Math.hypot(s.right.x-s.left.x,s.right.y-s.left.y):this.t.IOD_BOX_PROXY_FACTOR*r.width,h=Math.hypot(l.x-a.x,l.y-a.y),d=c<=0?0:1-L(h/(this.t.CENTER_FALLOFF_IOD_MULTIPLE*c)),u=n>0?c/n:0;this.lastSizeDirection=u<this.t.SIZE_IDEAL_MIN?"far":u>this.t.SIZE_IDEAL_MAX?"close":"ideal";let m;u<this.t.SIZE_HARD_MIN||u>this.t.SIZE_HARD_MAX?m=0:u<this.t.SIZE_IDEAL_MIN?m=(u-this.t.SIZE_HARD_MIN)/(this.t.SIZE_IDEAL_MIN-this.t.SIZE_HARD_MIN):u>this.t.SIZE_IDEAL_MAX?m=(this.t.SIZE_HARD_MAX-u)/(this.t.SIZE_HARD_MAX-this.t.SIZE_IDEAL_MAX):m=1;let w=1;if(s!==void 0){let p=Math.abs(Math.atan2(s.right.y-s.left.y,s.right.x-s.left.x))*180/Math.PI;w=1-L(p/this.t.ROLL_MAX_DEG)}return{center:l,iod:c,centering:d,size:m,pose:w}}motionOf(e,t,r){let s=this.lastCenter;if(this.lastCenter={...e,at:r},s===null||t<=0)return 1;let a=(r-s.at)/1e3;if(a<=0)return 1;let n=Math.hypot(e.x-s.x,e.y-s.y)/t/a;n<=this.t.MOTION_DEADBAND_IOD_PER_S&&(n=0);let l=1-Math.exp(-a/this.t.MOTION_TAU_S);return this.velocityEma=l*n+(1-l)*this.velocityEma,1-L(this.velocityEma/this.t.MOTION_VELOCITY_IOD_PER_S)}guidanceOf(e,t,r){if(e.presence<=0)return"fcv3.no_face";if(e.single<=0)return"fcv3.one_face";if(e.size<this.t.GUIDE_SIZE)return this.sizeGuidance();if(e.centering<this.t.GUIDE_CENTERING)return"fcv3.center_face";if(e.pose<this.t.GUIDE_POSE)return"fcv3.straighten";if(e.exposure<this.t.GUIDE_EXPOSURE)return this.exposureGuidance(t);if(e.sharpness<this.t.GUIDE_SHARPNESS)return"fcv3.steady_camera";if(e.motion<this.t.GUIDE_MOTION)return"fcv3.hold_still";if(r<this.t.Q_GOOD){let s=[["size",this.sizeGuidance()],["centering","fcv3.center_face"],["pose","fcv3.straighten"],["exposure",this.exposureGuidance(t)],["sharpness","fcv3.steady_camera"],["motion","fcv3.hold_still"]],a=s[0];for(let n of s)e[n[0]]<e[a[0]]&&(a=n);return a[1]}return"fcv3.hold_still"}sizeGuidance(){return this.lastSizeDirection==="far"?"fcv3.come_closer":"fcv3.move_back"}exposureGuidance(e){let t=(le[0]+le[1])/2;return e.meanLuma<t?"fcv3.more_light":"fcv3.too_bright"}},o(z,"_"),z),ni=["single","size","centering","pose","exposure","sharpness","motion"];function oi(i){if(i.accepted)return null;if(i.factors.presence<=0)return"no_face";let e="single";for(let t of ni)i.factors[t]<i.factors[e]&&(e=t);return e}o(oi,"ze");var H,lt=(H=class{constructor(){this.blocked={},this.acceptedMs=0,this.ticks=0,this.lastAt=null}record(e){let t=this.lastAt===null?0:Math.max(0,e.at-this.lastAt);this.lastAt=e.at,this.ticks+=1;let r=oi(e);if(r===null){this.acceptedMs+=t;return}let s=this.blocked[r]??{count:0,ms:0};s.count+=1,s.ms+=t,this.blocked[r]=s}summary(){let e={};for(let[t,r]of Object.entries(this.blocked))e[t]={count:r.count,ms:Math.round(r.ms)};return{blocked:e,acceptedMs:Math.round(this.acceptedMs),ticks:this.ticks}}},o(H,"w"),H),li=["obs","manycam","virtual","snap camera","xsplit","droidcam","iriun","camo","fake_device","fake-capture-device"],ci=[/^(front|back|rear)( [a-z ]+)? camera$/i,/^caméra (avant|arrière)\b/i,/^cámara (frontal|trasera|delantera)\b/i,/^câmera (frontal|traseira)\b/i,/^(front|rück)kamera\b/i,/^الكاميرا (الأمامية|الخلفية)/,/^camera2? ?\d+, facing (front|back|external)/i,/facetime/i,/\b(integrated|built-in|builtin) (web)?cam(era)?\b/i,/\b(hd )?web ?cam\b/i,/\([0-9a-f]{4}:[0-9a-f]{4}\)\s*$/i];function hi(i){let e=(i??"").trim().toLowerCase();return e.length===0?"unknown":li.some(t=>e.includes(t))?"known_virtual":ci.some(t=>t.test(e))?"platform":"unknown"}o(hi,"Qe");function ct(i){if(typeof i!="function")return!1;try{return/\{\s*\[native code\]\s*\}\s*$/.test(Function.prototype.toString.call(i))}catch{return!1}}o(ct,"Ce");function ui(i=globalThis){return ct(i.navigator?.mediaDevices?.getUserMedia)&&ct(i.MediaStreamTrack?.prototype?.getSettings)}o(ui,"Ye");async function di(i,e=globalThis){let t=e.crypto?.subtle?.digest;if(typeof t=="function")try{let r=new Uint8Array(await t.call(e.crypto?.subtle,"SHA-256",new TextEncoder().encode(i)));return Array.from(r.subarray(0,8),s=>s.toString(16).padStart(2,"0")).join("")}catch{return}}o(di,"je");async function fi(i,e=globalThis){let t={};try{t=typeof i.getSettings=="function"?i.getSettings()??{}:{}}catch{t={}}let r={};if((t.facingMode==="user"||t.facingMode==="environment"||t.facingMode==="left"||t.facingMode==="right")&&(r.facingMode=t.facingMode),typeof t.frameRate=="number"&&Number.isFinite(t.frameRate)&&(r.frameRate=t.frameRate),typeof t.width=="number"&&Number.isFinite(t.width)&&(r.width=t.width),typeof t.height=="number"&&Number.isFinite(t.height)&&(r.height=t.height),typeof t.deviceId=="string"&&t.deviceId.length>0){let a=await di(t.deviceId,e);a!==void 0&&(r.deviceIdHash=a)}let s;try{s=i.label}catch{s=void 0}return{trackSettings:r,capabilitiesPresent:typeof i.getCapabilities=="function",labelClass:hi(s),prototypesIntact:ui(e)}}o(fi,"Se");var fe=o(i=>Math.round(i*100)/100,"U");function pi(i){let e=i,t=typeof e?.requestVideoFrameCallback=="function",r=null,s=null,a=0,n=0,l=0,c=0,h=0,d=0,u=o(()=>{!t||e?.requestVideoFrameCallback===void 0||(r=e.requestVideoFrameCallback((m,w)=>{if(r=null,!t)return;let p=w.presentationTime;if(s!==null){let v=p-s.presentationTimeMs;n+=1;let y=v-l;l+=y/n,c+=y*(v-l)}typeof w.captureTime=="number"&&Number.isFinite(w.captureTime)&&(h+=p-w.captureTime,d+=1),a+=1,s={mediaTimeMs:w.mediaTime*1e3,presentationTimeMs:p},u()}))},"u");return u(),{latest:o(()=>s,"latest"),stats:o(()=>({n:a,meanGapMs:n===0?0:fe(l),stdGapMs:n<2?0:fe(Math.sqrt(c/(n-1))),captureLatencyMs:d===0?null:fe(h/d)}),"stats"),stop:o(()=>{t&&(t=!1,r!==null&&e?.cancelVideoFrameCallback?.(r),r=null)},"stop")}}o(pi,"ke");function mi(i,e,t){return{...i,rvfc:e,rampPainter:t}}o(mi,"_e");var gi=1e3,pe="fcv3.hold_upright",vi=200,me=4,yi=600,wi=1e3,ht={sharpness:1,exposure:1,meanLuma:128};function bi(i,e){return e.width=i.videoWidth,e.height=i.videoHeight,e.getContext("2d").drawImage(i,0,0),new Promise((t,r)=>e.toBlob(s=>s?t(s):r(new Error("empty-keyframe")),"image/jpeg",.92))}o(bi,"rt");function Mi(){return Q()==="phone"}o(Mi,"it");var K,mt=(K=class{constructor(e){this.handlers=new Map,this.stateValue="idle",this.attempt=0,this.stream=null,this.detector=null,this.scheduler=null,this.gate=null,this.profiler=null,this.lastGuidanceKey=null,this.positioningStartedAt=0,this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.fired=!1,this.carriedDegrade=0,this.carriedMeans=[],this.blockStats=null,this.lastGateSnapshotAt=Number.NEGATIVE_INFINITY,this.uprightGuard=!1,this.trackProvenance=null,this.openEnvironment=null,this.ramp=null,this.snapshotCanvas=null,this.options=e,this.facing=e.facingMode??"user"}get state(){return this.stateValue}on(e,t){let r=this.handlers.get(e);return r||(r=new Set,this.handlers.set(e,r)),r.add(t),()=>r?.delete(t)}emit(e,t){for(let r of[...this.handlers.get(e)??[]])r(t)}async start(e={}){e.facingMode!==void 0&&(this.facing=e.facingMode),this.attempt+=1,await this.run(this.attempt)}get facingMode(){return this.facing}retry(){this.teardownAttempt(),this.start()}switchCamera(){this.facing=this.facing==="user"?"environment":"user",this.teardownAttempt(),this.start()}restart(e){this.facing=e,this.teardownAttempt(),this.start()}destroy(){this.attempt+=1,this.teardownAttempt(),this.detector?.destroy(),this.detector=null,this.options.video.srcObject=null}async run(e){let{options:t}=this;this.fired=!1,this.lastGuidanceKey=null,this.carriedDegrade=0,this.carriedMeans=[],this.cameraRequestedAt=null,this.cameraReadyAt=null,this.faceAcquiredAt=null,this.captureCompleteAt=null,this.uprightGuard=(t.isPhone??Mi)(),this.setState("preflight");let r=Ne();if(r!=="OK"){this.fail(r==="INSECURE_CONTEXT"?"insecure":"unsupported",{phase:"preflight"});return}this.setState("acquiring");let s=t.getUserMedia??(h=>navigator.mediaDevices.getUserMedia(h)),a;this.cameraRequestedAt=this.now();try{let{facingMode:h,...d}=Se(Ae(),this.facing).video;a=await Ke(this.facing,d,{getUserMedia:s,enumerateDevices:_i(t)})}catch(h){if(e!==this.attempt)return;if(h instanceof He){this.fail("backcamera",{phase:"acquiring",name:j(h)});return}this.fail(We(h),{phase:"acquiring",name:j(h)});return}if(Re(a),ze(a),e!==this.attempt){for(let h of a.getTracks())h.stop();return}this.stream=a;let n=a.getVideoTracks?.()[0];if(this.trackProvenance=n===void 0?null:fi(n).catch(()=>null),this.openEnvironment=n===void 0?null:xe(n).catch(()=>({})),this.facing=Ie(a)??this.facing,t.video.srcObject=a,await t.video.play().catch(()=>{}),e!==this.attempt)return;if(this.cameraReadyAt=this.now(),this.detector===null){let h={v3AssetBaseUrl:t.v3AssetBaseUrl},d=t.createDetector??(t.createWorker!==void 0&&it()?async()=>{try{return await rt.create(t.createWorker(),h)}catch{return x(h)}}:()=>x(h)),u;try{u=await d()}catch(m){e===this.attempt&&this.fail("models",{phase:"models",name:j(m)},m instanceof de?m.fallbackReason:Ti(m));return}if(e!==this.attempt){u.destroy();return}this.detector=u,this.options.telemetry?.({type:"detector",tier:u.tier,fallbackReason:u.fallbackReason})}let l=Xe(),c=t.deviceClass??Ze(l);this.profiler=new Ve(c),this.options.telemetry?.({type:"profile",staticClass:c,activeClass:this.profiler.deviceClass,simd:l.simd}),this.gate=new ot(t.thresholds??{}),this.blockStats=new lt,this.lastGateSnapshotAt=this.now(),t.rankKeyframes?.()&&import("./keyframe-rank-YAJLYJYF-WCA6RPMD.js").then(h=>ge=h,()=>{}),this.setState("positioning"),this.positioningStartedAt=this.now(),this.startScheduler(e)}get animations(){return this.profiler?.profile.animations??"full"}startScheduler(e){let t=this.profiler;if(t===null)return;if(this.scheduler!==null){let s=this.scheduler.stats();this.carriedDegrade+=s.degradeCount,s.meanDetectMs>0&&this.carriedMeans.push(s.meanDetectMs),this.scheduler.stop()}let r=new si({cadenceHz:t.profile.cadenceHz,video:this.options.video,now:this.options.now,run:o(()=>this.detectTick(e),"run")});this.scheduler=r,r.start()}async detectTick(e){let{detector:t,gate:r,profiler:s}=this,a=this.options.video;if(e!==this.attempt||t===null||r===null||s===null||this.fired||a.videoWidth===0)return;if(this.isLandscape()){this.holdUpright(e);return}let n=s.deviceClass,l=this.now(),c=this.options.makeSnapshot?.(a,s.profile.inputWidth)??this.defaultSnapshot(a,s.profile.inputWidth),h=null;try{h=await t.detect(c,a.videoWidth,a.videoHeight)}catch{h=null}if(e!==this.attempt||this.fired)return;s.record(this.now()-l),s.deviceClass!==n&&this.startScheduler(e);let d=h===null?ht:this.options.measureQuality?.(a,h.box)??this.defaultQuality(a,h.box),u=r.tick({timestampMs:this.now(),observation:h,quality:d,frameWidth:a.videoWidth,frameHeight:a.videoHeight});u.accepted&&this.faceAcquiredAt===null&&(this.faceAcquiredAt=u.at),this.blockStats?.record(u),!u.ready&&u.at-this.lastGateSnapshotAt>=gi&&(this.lastGateSnapshotAt=u.at,this.reportGate(!1)),this.emit("checks",{engine:"v3",progress:u.p,q:u.q,factors:u.factors,attempt:e}),u.guidanceKey!==this.lastGuidanceKey&&(this.lastGuidanceKey=u.guidanceKey,this.emit("guidance",{key:u.guidanceKey})),u.ready&&this.stateValue==="positioning"&&(this.fired=!0,this.captureCompleteAt=u.at,this.fire(e))}async fire(e){let{options:t}=this,r=this.scheduler;r?.stop(),this.reportGate(!0);let s=r?.stats()??{degradeCount:0,meanDetectMs:0},a=[...this.carriedMeans,...s.meanDetectMs>0?[s.meanDetectMs]:[]];t.telemetry?.({type:"fired",timeToGateMs:this.now()-this.positioningStartedAt,degradeCount:this.carriedDegrade+s.degradeCount,meanDetectMs:a.length===0?0:a.reduce((_,b)=>_+b,0)/a.length});let n=t.mode??"clip",l=t.rankKeyframes?.()&&ge?ge.default(this,e).catch(()=>this.collectKeyframes(e)):this.collectKeyframes(e);if(n==="photo"){let _=this.watchRotation(e,null),b=await l;if(_(),e!==this.attempt)return;if(b===null){this.fail("generic",{phase:"keyframes"});return}let R=await this.provenance({n:0,meanGapMs:0,stdGapMs:0,captureLatencyMs:null},!1);if(e!==this.attempt)return;this.finishCapture({keyframe:b.blob,previewDataUrl:b.previewDataUrl,...R});return}this.setState("recording");let c=this.stream;if(c===null){this.fail("generic",{phase:"recording"});return}let h=t.screenRamp?.(),d=ee(h),u=null;l.then(_=>{u=_},()=>{});let m=o(()=>{e===this.attempt&&u!==null&&this.emit("frozen",{previewDataUrl:u.previewDataUrl})},"p"),w=Ye(h,pt),p=null,v,y=0;try{let _=this.recordTake(e,c,h,w,void 0).then(S=>S,S=>({failed:S})),[b,R]=await Promise.all([_,l]);if(v=R,e!==this.attempt)return;if("failed"in b){if(b.failed.kind==="cliptoolarge")throw b.failed;st(b.failed.requestedMimeType??"")}else p=b,nt(b.clip,w)?b.clip.stats===null&&st(b.clip.requestedMimeType??""):m();if(p===null||nt(p.clip,w)){y=1,t.telemetry?.({type:"clip_retake",reason:p===null?"error":p.clip.stats===null?"unreadable":"short"});let S=null;try{S=await this.recordTake(e,c,h,w,m)}catch($){if(p===null)throw $}if(e!==this.attempt)return;S!==null&&(p===null||ei(S.clip,p.clip))&&(p=S),S===null&&m()}}catch(_){if(e!==this.attempt)return;let b=_.kind;this.fail(b==="cliptoolarge"?"cliptoolarge":"recorder",{phase:"recording",name:j(_)});return}if(p===null){this.fail("recorder",{phase:"recording"});return}let{clip:g,rvfc:M,report:E,watched:A}=p;if(oe(g.blob)){this.fail("cliptoolarge",{phase:"recording"});return}if(v===null){this.fail("generic",{phase:"keyframes"});return}let I=await this.provenance(M,d,A);e===this.attempt&&this.finishCapture({clip:g.blob,clipMimeType:g.mimeType,...g.stats?{clipStats:g.stats}:{},clipRetakes:y,keyframe:v.blob,previewDataUrl:v.previewDataUrl,...E!==void 0&&E.rendered.length>0?{screenRamp:E}:{},...I})}async recordTake(e,t,r,s,a){let n=this.options.createRecorder?.()??new ti({now:o(()=>this.now(),"now")}),l=pi(this.options.video),c=Qe(r,{paint:o(m=>{(m===null||e===this.attempt)&&this.emit("ramp",{colour:m})},"paint"),now:o(()=>this.now(),"now"),frames:l.latest});this.ramp=c;let h=o(()=>{l.stop(),c.stop(),this.ramp===c&&(this.ramp=null)},"l"),d=this.watchRotation(e,n),u=De();try{return{clip:await n.record(t,a,()=>c.started(this.now()),s,l),rvfc:l.stats(),report:c.report(),watched:u.stop()}}finally{u.stop(),d(),h()}}async provenance(e,t,r={}){let s=this.trackProvenance;if(s===null)return{};let a,n=new Promise(d=>{a=setTimeout(()=>d(null),wi)}),l=await Promise.race([s,n]),c=l===null?null:await Promise.race([this.openEnvironment,n]);if(clearTimeout(a),l===null)return{};let h={...c,...r};return{provenance:{...mi(l,e,t),...Object.keys(h).length>0?{env:h}:{}}}}isLandscape(){let e=this.options.video;return this.uprightGuard&&e.videoWidth>e.videoHeight}holdUpright(e){this.gate?.reset(),this.emit("checks",{engine:"v3",progress:0,q:0,factors:{presence:0,single:1,centering:0,size:0,pose:0,sharpness:0,exposure:0,motion:0},attempt:e}),this.lastGuidanceKey!==pe&&(this.lastGuidanceKey=pe,this.emit("guidance",{key:pe}))}watchRotation(e,t){if(!this.uprightGuard)return()=>{};let r=this.options.video,s=o(()=>{if(e!==this.attempt||t!==null&&this.stateValue!=="recording"){l();return}r.videoWidth>0&&this.isLandscape()&&(l(),this.abortRecording(e,t))},"i"),a=setInterval(s,vi);r.addEventListener?.("resize",s);let n=!1;function l(){n||(n=!0,clearInterval(a),r.removeEventListener?.("resize",s))}return o(l,"o"),l}abortRecording(e,t){if(e!==this.attempt)return;this.attempt+=1;let r=this.attempt;try{t?.stop()}catch{}this.ramp?.stop(),this.ramp=null,this.fired=!1,this.captureCompleteAt=null,this.gate=new ot(this.options.thresholds??{}),this.blockStats=new lt,this.lastGateSnapshotAt=this.now(),this.lastGuidanceKey=null,this.setState("positioning"),this.positioningStartedAt=this.now(),this.holdUpright(r),this.startScheduler(r)}async collectKeyframes(e){let t=this.options.captureKeyframe??(a=>this.defaultKeyframe(a)),r=yi/(me-1),s=null;for(let a=0;a<me;a+=1){if(e!==this.attempt)return s;try{let n=await t(this.options.video);(s===null||n.sharpness>s.sharpness)&&(s=n)}catch{}a<me-1&&await ki(r)}return s}finishCapture(e){this.stopTracks(),this.setState("captured");let t=this.captureTiming();this.emit("artifacts",t===void 0?e:{...e,timing:t})}captureTiming(){let e={},t=o((r,s,a)=>{s!==null&&a!==null&&(e[r]=Math.max(0,Math.round(a-s)))},"t");return t("cameraReadyMs",this.cameraRequestedAt,this.cameraReadyAt),t("faceAcquireMs",this.cameraReadyAt,this.faceAcquiredAt),t("captureMs",this.faceAcquiredAt,this.captureCompleteAt),Object.keys(e).length>0?e:void 0}async defaultKeyframe(e){let t=document.createElement("canvas"),r=await(this.facing==="user"?ri:bi)(e,t),s=t.toDataURL("image/jpeg",.92);return{blob:r,previewDataUrl:s,sharpness:this.centerSharpness(e)}}defaultSnapshot(e,t){try{let r=this.snapshotCanvas??document.createElement("canvas"),s=t/Math.max(1,e.videoWidth),a=Math.max(1,Math.round(e.videoWidth*s)),n=Math.max(1,Math.round(e.videoHeight*s)),l=r.getContext("2d");return l===null?e:(r.width!==a&&(r.width=a),r.height!==n&&(r.height=n),l.drawImage(e,0,0,a,n),this.snapshotCanvas=r,r)}catch{return e}}defaultQuality(e,t){let r=ut(e,t,96);return r===null?ht:{sharpness:ce(r),exposure:$e(r),meanLuma:je(r)}}centerSharpness(e){let t=te(e),r=ut(e,{x:t.width*.25,y:t.height*.25,width:t.width*.5,height:t.height*.5},96);return r===null?0:ce(r)}teardownAttempt(){this.scheduler?.stop(),this.scheduler=null,this.reportGate(!0),this.gate=null,this.ramp?.stop(),this.ramp=null,this.stopTracks()}reportGate(e){let t=this.blockStats,r=this.profiler;if(t===null||r===null)return;let s=t.summary();e&&(this.blockStats=null),s.ticks!==0&&this.options.telemetry?.({type:"gate",final:e,activeClass:r.deviceClass,cadenceHz:r.profile.cadenceHz,...s})}stopTracks(){if(this.stream!==null){for(let e of this.stream.getTracks())e.stop();this.stream=null}}fail(e,t,r){this.scheduler?.stop(),this.reportGate(!0),this.stopTracks(),this.setState("error"),this.options.telemetry?.({type:"error",kind:e,fallbackReason:r});let{phase:s,name:a}=t;this.emit("error",{kind:e,retryable:e!=="insecure"&&e!=="unsupported",detail:a===void 0?{phase:s}:{phase:s,name:a}})}setState(e){this.stateValue=e,this.emit("statechange",{state:e})}now(){return this.options.now?.()??performance.now()}},o(K,"Ie"),K),ge;function ki(i){return new Promise(e=>setTimeout(e,i))}o(ki,"nt");function Ti(i){return i instanceof Error?i.message:String(i)}o(Ti,"at");function ut(i,e,t){try{let r=document.createElement("canvas"),s=t/Math.max(1,e.width);r.width=Math.max(1,Math.round(e.width*s)),r.height=Math.max(1,Math.round(e.height*s));let a=r.getContext("2d");return a===null?null:(a.drawImage(i,e.x,e.y,e.width,e.height,0,0,r.width,r.height),a.getImageData(0,0,r.width,r.height))}catch{return null}}o(ut,"Re");function _i(i){if(i.enumerateDevices!==void 0)return i.enumerateDevices;if(i.getUserMedia===void 0&&!(typeof navigator>"u"||typeof navigator.mediaDevices?.enumerateDevices!="function"))return()=>navigator.mediaDevices.enumerateDevices()}o(_i,"st");var Ei=12e4,gt=13e4,Si=3e3,Ai=1200,ve=Symbol.for("@sekyro/web.preload.v1");function we(){let i=globalThis;return i[ve]??(i[ve]=new Map),i[ve]}o(we,"h");function re(i){let e=(i??ue).replace(/\/+$/,"");return e===""?"/":e}o(re,"b");function yt(i){let e=we(),t=e.get(i);return t===void 0&&(t={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},e.set(i,t)),t}o(yt,"ae");function ye(i,e){if(i.status!==e){i.status=e;for(let t of[...i.listeners])t(e)}}o(ye,"k");var Ii=o(i=>x({preferred:["blaze"],v3AssetBaseUrl:i,blazeInitTimeoutMs:Ei}),"K"),xi=Ii;function Di(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}o(Di,"Ce");function Ri(){return navigator.connection?.saveData===!0}o(Ri,"Se");function Ci(i){let e=window;if(typeof e.requestIdleCallback=="function"){let r=e.requestIdleCallback(i,{timeout:Si});return()=>e.cancelIdleCallback?.(r)}let t=setTimeout(i,Ai);return()=>clearTimeout(t)}o(Ci,"Ee");function Oi(i,e){let t,r=new Promise(l=>{t=l}),s=!1,a=o(()=>{},"u"),n={promise:r,settle:o(l=>{s||(s=!0,a(),i.scheduled===n&&(i.scheduled=null),t(l))},"settle")};return i.scheduled=n,a=Ci(()=>{s||n.settle(be(i,e))}),r}o(Oi,"ye");function be(i,e){if((i.status==="loading"||i.status==="ready")&&i.promise!==null)return i.promise;ye(i,"loading");let t=new Promise(n=>n(xi(e)));i.detectorPromise=t;let r,s=new Promise((n,l)=>{r=setTimeout(()=>{t.then(c=>c.destroy(),()=>{}),l(new Error(`detector preload exceeded ${gt} ms`))},gt)}),a=Promise.race([t,s]).then(n=>i.detectorPromise!==t?(n.destroy(),i.status):(i.detector=n,ye(i,"ready"),"ready"),n=>(i.detectorPromise===t&&(i.detectorPromise=null,i.detector=null,ye(i,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",n)),i.status)).finally(()=>clearTimeout(r));return i.promise=a,i.scheduled?.settle(a),a}o(be,"U");function hr(i={}){if(!Di())return Promise.resolve("idle");let e=re(i.assetBaseUrl),t=yt(e);return i.respectSaveData===!0&&Ri()?Promise.resolve(t.status):(t.status==="loading"||t.status==="ready")&&t.promise!==null?t.promise:i.idle===!0?t.scheduled?.promise??Oi(t,e):be(t,e)}o(hr,"xe");function ur(i){return we().get(re(i))?.status??"idle"}o(ur,"Fe");function dr(i,e){let t=yt(re(e));return t.listeners.add(i),()=>{t.listeners.delete(i)}}o(dr,"Ie");function Pi(i){return{get tier(){return i.tier},get fallbackReason(){return i.fallbackReason},detect:o((...e)=>i.detect(...e),"detect"),destroy:o(()=>{},"destroy")}}o(Pi,"Le");function Gi(i){let e=re(i),t=we().get(e);if(!(t===void 0||t.detector===null&&t.detectorPromise===null&&t.scheduled===null))return async()=>{t.scheduled!==null&&be(t,e);let r=t.promise;for(;t.detector===null&&r!==null&&(await r,t.promise!==r);)r=t.promise;return t.detector!==null?Pi(t.detector):x({v3AssetBaseUrl:e})}}o(Gi,"de");var Ui=new Set(["inuse","overconstrained","notfound"]),Fi=[500,1500];function Ni(i){switch(i){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}o(Ni,"Ae");function Li(i){switch(i){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return i}}o(Li,"Pe");function vt(i){switch(i){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return i;case"backcamera":return"notfound";default:{let e=i;return"generic"}}}o(vt,"ue");function Bi(i,e,t){if(t===void 0)return{kind:vt(i),retryable:e};let r=qe(t.name);return{kind:vt(i),retryable:e,detail:{...r!==void 0?{name:r}:{},phase:t.phase,engineKind:i}}}o(Bi,"we");var qi=new Set(["captured","uploading","checking"]);function Wi(i,e={},t,r=()=>"self",s=()=>{},a){let n=e.now??(()=>performance.now()),l=e.canChooseFacing??Oe,c="user",h=Pe(),d=r(),u=Ce(),m=!Le(),w=e.engineOptions,p=w?.createDetector===void 0&&w?.createWorker===void 0?{createDetector:o(()=>{let f=Gi(i.assetBaseUrl);return f!==void 0?f():x({v3AssetBaseUrl:i.assetBaseUrl})},"createDetector")}:{},v={video:i.video,mode:m?"photo":"clip",rankKeyframes:t,facingMode:void 0,v3AssetBaseUrl:i.assetBaseUrl,screenRamp:o(()=>d==="self"&&u.count("ramp")>0?s():void 0,"screenRamp"),...e.engineOptions??{},...p},y=e.createEngine?.(v)??new mt(v),g="idle",M=null,E=0,A=!1,I="full",_=null,b=null,R=0,S=0,$=o(()=>{i.video.videoWidth>0&&i.video.videoHeight>0&&(R=i.video.videoWidth,S=i.video.videoHeight)},"W"),Me=Ge({enabled:i.keepScreenAwake!==!1}),X=o(f=>{g=f,Me.setActive(f==="starting"||f==="gating"||f==="recording"),u.emit("state",f)},"S"),se=o(()=>u.emit("gate",{progress:E,hint:M,faceDetected:A}),"F"),ae=o(()=>{let f=y.animations??"full";f!==I&&(I=f,u.emit("profile",{animations:I}))},"I"),G=0,Y=null,wt=e.schedule??((f,k)=>{let T=setTimeout(f,k);return()=>clearTimeout(T)}),Z=o(()=>{Y?.(),Y=null},"E"),bt=o((f,k)=>{if(V||!Ui.has(f)||k?.phase!=="acquiring")return!1;let T=Fi[G];return T===void 0?!1:(G+=1,Z(),Y=wt(()=>{Y=null,V||y.retry()},T),!0)},"fe"),Mt=[y.on("statechange",({state:f})=>{if(f==="error")return;let k=Li(f);k==="gating"&&(G=0),k==="starting"&&g!=="starting"&&(M=null,E=0,A=!1,_=null,b=null,R=0,S=0),X(k),ae(),k==="recording"&&($(),_=n(),M="hold",E=1,se())}),y.on("checks",f=>{$(),E=f.progress,A=f.factors.presence>0,se(),ae()}),y.on("guidance",({key:f})=>{M=Ni(f),se()}),y.on("frozen",({previewDataUrl:f})=>{b=n(),u.emit("frozen",{previewDataUrl:f})}),y.on("ramp",f=>u.emit("ramp",f)),y.on("artifacts",f=>{if(g!=="captured")return;let k=Q(),T=f.clipStats,_e=T!==void 0?Math.round(T.durationMs):_!==null&&b!==null?Math.max(0,Math.round(b-_)):void 0,Ee=T!==void 0&&T.frames>1&&T.durationMs>0?Math.round(T.frames*1e4/T.durationMs)/10:void 0;u.emit("captured",{keyframe:f.keyframe,...f.clip!==void 0?{clip:f.clip}:{},...f.clipMimeType!==void 0?{clipMime:f.clipMimeType}:{},width:i.video.videoWidth||R,height:i.video.videoHeight||S,..._e!==void 0?{clipMs:_e}:{},...T!==void 0?{clipFrames:T.frames}:{},...Ee!==void 0?{fps:Ee}:{},...f.clipRetakes!==void 0?{clipRetakes:f.clipRetakes}:{},...f.clipMimeType!==void 0?{codec:ft(f.clipMimeType)}:{},captureChannel:k==="desktop"?"desktop":"mobile",formFactor:k,...m?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:y.facingMode,mode:d,...f.timing,...f.screenRamp!==void 0?{screenRamp:f.screenRamp}:{},...f.provenance!==void 0?{provenance:f.provenance}:{}})}),y.on("error",({kind:f,retryable:k,detail:T})=>{f==="backcamera"&&kt()||bt(f,T)||(X("error"),ae(),u.emit("error",Bi(f,k,T)))})],ke=!1;function kt(){return V||ke||d!=="assisted"||a===void 0||a.session()!=="choice"?!1:(ke=!0,a.onModeChange("self"),d="self",c=ne("self"),X("mode_switch"),y.restart(c),!0)}o(kt,"me");let Te=o(async()=>a!==void 0&&a.session()==="choice"&&await l().catch(()=>!1),"$"),V=!1;return{handle:{get state(){return g},get captureMode(){return r()},get facingMode(){return y.facingMode??c},on:o((f,k)=>u.on(f,k),"on"),start:o(f=>(d=r(),h.facing(d,i.facing),c=h.facing(d,f?.facing),Z(),G=0,y.start({facingMode:c})),"start"),retry:o(()=>{Z(),G=0,y.retry()},"retry"),switchCamera:o(()=>h.refuseSwitch(r()),"switchCamera"),canSwitchCaptureMode:Te,setCaptureMode:o(async f=>{if(f===r()||!await Te()||V||qi.has(g)||a===void 0)return!1;a.onModeChange(f),d=f;let k=ne(f);return c=k,g==="idle"||(X("mode_switch"),Z(),G=0,y.restart(k)),!0},"setCaptureMode"),destroy:o(()=>{V=!0,Z();for(let f of Mt)f();Me.setActive(!1),y.destroy(),u.clear()},"destroy")},setFlowState:o(f=>{g!==f&&X(f)},"setFlowState")}}o(Wi,"De");function fr(i){return Wi(i).handle}o(fr,"Ze");export{zi as a,ee as b,hr as c,ur as d,dr as e,Bi as f,Wi as g,fr as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,b as ge,c as me,i as fe}from"./chunk-IO7MUUC6.js";import{b as ye}from"./chunk-Q5ZVLMKQ.js";import{d as we}from"./chunk-L244IUB3.js";import{a as pe}from"./chunk-Y6PC7FZV.js";import{d as re,e as le,
|
|
1
|
+
import{a as j,b as ge,c as me,i as fe}from"./chunk-IO7MUUC6.js";import{b as ye}from"./chunk-Q5ZVLMKQ.js";import{d as we}from"./chunk-L244IUB3.js";import{a as pe}from"./chunk-Y6PC7FZV.js";import{d as re,e as le,h as oe,i as W,j as se,k as ue,l as z,m as de}from"./chunk-6MYG4HWP.js";import{g as _,i as he,j as ce}from"./chunk-JS2IXPNL.js";import{a as s}from"./chunk-4FHWXBOB.js";var Ee=250,Ie=180,Ue=96;function qe(i){let{data:t,width:e,height:a}=i,n=new Uint8Array(e*a);for(let r=0,o=0;r<n.length;r+=1,o+=4)n[r]=Math.round(.299*(t[o]??0)+.587*(t[o+1]??0)+.114*(t[o+2]??0));return{data:n,width:e,height:a}}s(qe,"xe");function G(i,t){return{x0:Math.max(0,Math.floor(i.x)),y0:Math.max(0,Math.floor(i.y)),x1:Math.min(t.width,Math.ceil(i.x+i.width)),y1:Math.min(t.height,Math.ceil(i.y+i.height))}}s(G,"W");function q(i,t,e){let a=G(t,i),n=e===void 0?null:G(e,i),r=0,o=0,c=0,g=0;for(let u=a.y0;u<a.y1;u+=1)for(let x=a.x0;x<a.x1;x+=1){if(n!==null&&x>=n.x0&&x<n.x1&&u>=n.y0&&u<n.y1)continue;let D=i.data[u*i.width+x];r+=1,o+=D,c+=D*D,D>=Ee&&(g+=1)}if(r===0)return{mean:0,sd:0,clipped:0,count:0};let d=o/r;return{mean:d,sd:Math.sqrt(Math.max(0,c/r-d*d)),clipped:g/r,count:r}}s(q,"T");function xe(i){let{box:t}=i,e=(i.leftEye.y+i.rightEye.y)/2-.1*t.height,a=t.y+.85*t.height;return{x:t.x+.15*t.width,y:e,width:.7*t.width,height:Math.max(1,a-e)}}s(xe,"ve");function Be(i,t){let e=xe(t),a=q(i,e);if(a.count===0)return null;let n=Math.min(Math.max(t.nose.x,e.x+1),e.x+e.width-1),r=q(i,{x:e.x,y:e.y,width:n-e.x,height:e.height}),o=q(i,{x:n,y:e.y,width:e.x+e.width-n,height:e.height}),c=o.mean>0?r.mean/o.mean:r.mean>0?Number.POSITIVE_INFINITY:1;return{faceLuma:a.mean,halfRatio:c,clipped:a.clipped}}s(Be,"Be");function Fe(i,t){let e=0,a=0;for(let n of[t.leftEyeBox,t.rightEyeBox]){let r=n.width*.15,o=n.height*.5,c=q(i,{x:n.x-r,y:n.y-o,width:n.width+2*r,height:n.height+2*o});e+=c.count,a+=c.clipped*c.count}return e===0?null:a/e}s(Fe,"Ge");function He(i,t){let e=ge(t),{box:a}=t,n={x:a.x-.2*a.width,y:e.y,width:1.4*a.width,height:a.y+a.height-e.y},r=0,o=0,c=0;for(let d of[e.x,e.x+.8*e.width]){let u=q(i,{x:d,y:e.y+.04*e.height,width:.2*e.width,height:.25*e.height},n);r+=u.count,o+=u.mean*u.count,c+=(u.sd*u.sd+u.mean*u.mean)*u.count}if(r===0)return null;let g=o/r;return{luma:g,sd:Math.sqrt(Math.max(0,c/r-g*g)),count:r}}s(He,"Ae");function Pe(i,t){let e=G(xe(t),i),a=Math.max(1,Math.floor(Math.max(e.x1-e.x0,e.y1-e.y0)/Ue)),n=s((d,u)=>i.data[u*i.width+d],"r"),r=0,o=0,c=0;for(let d=e.y0+a;d<e.y1-a;d+=a)for(let u=e.x0+a;u<e.x1-a;u+=a){let x=n(u,d-a)+n(u-a,d)+n(u+a,d)+n(u,d+a)-4*n(u,d);r+=1,o+=x,c+=x*x}if(r===0)return null;let g=o/r;return Math.min(1,Math.max(0,c/r-g*g)/Ie)}s(Pe,"Oe");function je(i,t){return{lighting:Be(i,t),eyeSpecular:Fe(i,t),background:He(i,t),sharpness:Pe(i,t)}}s(je,"we");var Oe="/models-v3",Ve=640,Ae=.92;function Y(i){return{width:i.videoWidth||0,height:i.videoHeight||0}}s(Y,"Y");function $(i,t){if(typeof document<"u"){let e=document.createElement("canvas");return e.width=i,e.height=t,e}return typeof OffscreenCanvas=="function"?new OffscreenCanvas(i,t):null}s($,"j");function Ke(){let i=null;return(t,e)=>{let{width:a,height:n}=Y(t);if(a===0||n===0)return null;let r=e===null?1:Math.min(1,e/Math.max(a,n)),o=Math.round(a*r),c=Math.round(n*r),g;e===null?g=$(o,c):((i===null||i.width!==o||i.height!==c)&&(i=$(o,c)),g=i);let d=g?.getContext("2d",{willReadFrequently:!0});if(g==null||d==null)return null;d.drawImage(t,0,0,o,c);let u=null;try{u=d.getImageData(0,0,o,c)}catch{u=null}return{source:g,width:o,height:c,pixels:u}}}s(Ke,"He");async function Re(i,t,e,a){let n=Math.round(e*t.width/t.height),r=$(n,e),o=r?.getContext("2d");if(r==null||o==null)throw new Error("canvas unavailable");return o.fillStyle="#fff",o.fillRect(0,0,n,e),o.drawImage(i.source,t.x,t.y,t.width,t.height,0,0,n,e),"convertToBlob"in r?r.convertToBlob({type:"image/jpeg",quality:a}):new Promise((c,g)=>{r.toBlob(d=>d===null?g(new Error("encode failed")):c(d),"image/jpeg",a)})}s(Re,"qe");var I,Le=(I=class extends Error{},s(I,"z"),I);function Ne(i,t,e){return new Promise((a,n)=>{let r=setTimeout(()=>{n(new Le(`init exceeded ${t}ms`)),i.then(e,()=>{})},t);i.then(o=>{clearTimeout(r),a(o)},o=>{clearTimeout(r),n(o)})})}s(Ne,"Ne");function We(i){if(i instanceof z)return{kind:"notfound",retryable:!0,detail:{name:i.name,phase:"acquiring",engineKind:"backcamera"}};let t=he(i),e=t==="overconstrained"?"generic":t,a=_(i);return{kind:e,retryable:e!=="insecure"&&e!=="unsupported",detail:{...a!==void 0?{name:a}:{},phase:"acquiring",engineKind:t}}}s(We,"Ve");function _e(i,t,e,a){let n=i.length===1?i[0]:void 0,r=n===void 0?null:j(n.landmarks,e,a),o=null;if(n!==void 0&&t.pixels!==null){let c=j(n.landmarks,t.width,t.height),g=qe(t.pixels);c!==null&&(o=je(g,c))}return{frameWidth:e,frameHeight:a,faces:i.length,geometry:r,matrix:n?.matrix??null,blendshapes:n?.blendshapes??null,stats:o}}s(_e,"Ke");function tt(i,t={},e=()=>"self",a){let n=ye(i.tuning,i.tuningVersion),r=le(),o=t.now??(()=>performance.now()),c=t.setTimer??((l,h)=>setTimeout(l,h)),g=t.clearTimer??(l=>clearTimeout(l)),d=t.grabFrame??Ke(),u=t.encodeRegion??Re,x=t.getUserMedia??(l=>navigator.mediaDevices.getUserMedia(l)),D=t.enumerateDevices??(t.getUserMedia===void 0&&typeof navigator<"u"&&typeof navigator.mediaDevices?.enumerateDevices=="function"?()=>navigator.mediaDevices.enumerateDevices():void 0),ve=t.createLandmarker??we,J=i.assetBaseUrl??Oe,Q=ue({enabled:i.keepScreenAwake!==!1}),E=fe(n,{policy:i.policy??"reject"}),b=i.video,X=pe({tuning:n.backgroundCheck,assetBaseUrl:J,...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:o}),m="idle",k=null,v=null,B=null,O=!1,y=!1,w=0,Z=0,V=[],M="user",A=se(),ee=!1,Me=t.canChooseFacing??oe,C=s(l=>{m===l||y||(m=l,Q.setActive(l==="starting"||l==="gating"),r.emit("state",l))},"k"),K=s(()=>{B!==null&&g(B),B=null},"D"),F=s(()=>{K();for(let l of k?.getTracks()??[])l.stop();k=null;try{b.srcObject=null}catch{}},"I"),R=s(l=>{F(),C("error"),r.emit("error",l)},"_"),te=s(()=>{let l=Math.max(o(),Z+1);return Z=l,l},"ee"),be=s(async l=>{let h=d(b,null),{width:T,height:S}=h??Y(b);if(h===null||v===null){E.reset();return}let f=v.detect(h.source,te()),p=(f.length===1?f:V.length===1?V:[])[0],U=p===void 0?null:j(p.landmarks,T,S);if(U===null){E.reset();return}let P=me(U,T,S,{margin:n.cropMargin,minWidth:n.resolution.minWidth,minHeight:n.resolution.minHeight}),N=Math.max(n.resolution.minHeight,P.height),De=await u(h,P,N,Ae);if(y||l!==w)return;let ae={image:De,width:Math.round(N*P.width/P.height),height:N,gate:E.summary(),facingMode:M};n.tuningVersion!==null&&(ae.tuningVersion=n.tuningVersion),K(),C("captured"),r.emit("captured",ae)},"Me"),L=s(async l=>{if(!(y||l!==w||m!=="gating"||v===null)){if(!O){O=!0;try{let h=d(b,Ve);if(h!==null){let{width:T,height:S}=Y(b),f=v.detect(h.source,te());V=f;let p=_e(f,h,T||h.width,S||h.height);p.geometry!==null&&n.background.required&&(p.backgroundCheck=X.measure(h,p.geometry.box,T||h.width,S||h.height));let U=E.push(p,o());if(y||l!==w||(r.emit("gate",U),U.ready&&(await be(l),m!=="gating")))return}}catch{}finally{O=!1}}!y&&l===w&&m==="gating"&&(B=c(()=>{L(l)},1e3/n.cadenceHz))}},"H"),ke=s(()=>Ne(ve(J),2e4,l=>l.close()),"Pe"),Ce=s(l=>{let h=e()==="assisted"?"assisted":"self";return ee||A.facing(h,i.facing),A.facing(h,l)},"Le"),ie=!1;function Te(){return ie||a===void 0||a.session()!=="choice"||e()!=="assisted"?!1:(ie=!0,a.onModeChange("self"),M=W("self"),C("mode_switch"),H({facing:M}),!0)}s(Te,"Se");let H=s(async l=>{if(y||m==="starting"||m==="gating")return;w+=1;let h=w;E.reset(),C("starting");let T=Ce(l?.facing);if(k!==null&&T!==M&&F(),M=T,ee=!0,k===null&&t.getUserMedia===void 0&&(typeof navigator>"u"||typeof navigator.mediaDevices?.getUserMedia!="function")){let f=typeof window<"u"&&window.isSecureContext===!1?"insecure":"unsupported";R({kind:f,retryable:!1,detail:{phase:"preflight",engineKind:f}});return}let S=v!==null?Promise.resolve(v):ke();S.catch(()=>{});try{if(k===null){let f=await de(M,{width:{ideal:n.camera.width},height:{ideal:n.camera.height}},{getUserMedia:x,...D!==void 0?{enumerateDevices:D}:{}});if(y||h!==w){for(let p of f.getTracks())p.stop();return}k=f,ce(f),M=re(f)??M,b.srcObject=k,b.muted=!0,b.playsInline=!0,await b.play().catch(()=>{})}}catch(f){if(y||h!==w||f instanceof z&&Te())return;R(We(f));return}try{v=await S}catch(f){if(!y&&h===w){let p=_(f);R({kind:"generic",retryable:!0,detail:{...p!==void 0?{name:p}:{},phase:"models",engineKind:"models"}})}return}y||h!==w||(C("gating"),L(h))},"R"),ne=s(async()=>a!==void 0&&a.session()==="choice"&&await Me().catch(()=>!1),"ne"),Se=s(()=>m==="idle"||m==="starting"||m==="gating"||m==="error","Fe");return{handle:{get state(){return m},get captureMode(){return e()},get facingMode(){return M},on:s((l,h)=>r.on(l,h),"on"),start:H,retry:s(()=>{if(!y){if(k!==null&&v!==null&&m!=="error"){w+=1;let l=w;K(),E.reset(),C("gating"),L(l);return}m="idle",H()}},"retry"),switchCamera:s(()=>A.refuseSwitch(e()==="assisted"?"assisted":"self"),"switchCamera"),canSwitchCaptureMode:ne,setCaptureMode:s(async l=>{if(y||a===void 0||l===e()||!await ne()||y||!Se())return!1;a.onModeChange(l);let h=W(l);return m==="idle"&&k===null||(w+=1,F(),M=h,C("mode_switch"),H({facing:h})),!0},"setCaptureMode"),destroy:s(()=>{y||(w+=1,F(),Q.setActive(!1),y=!0,v?.close(),v=null,X.close(),r.clear())},"destroy")},gateScores:s(()=>E.scores(),"gateScores"),setFlowState:s(l=>{(m==="captured"||m==="uploading"||m==="checking"||m==="done"&&l==="done")&&C(l)},"setFlowState")}}s(tt,"ct");function it(){import("./vision_bundle-WBHR7TEE.js").catch(()=>{})}s(it,"ut");export{Ve as a,Ae as b,Ke as c,_e as d,tt as e,it as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as L}from"./chunk-4QUL7TEF.js";import{a as J,c as R}from"./chunk-WICQIC37.js";import{b as U}from"./chunk-6MYG4HWP.js";import{a as r}from"./chunk-4FHWXBOB.js";var g,h=(g=class extends Error{constructor(t){super(t.message),this.name="HostedApiError",this.status=t.status,this.code=t.code,t.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=t.retryAfterSeconds),t.details&&(this.details=t.details)}},r(g,"u"),g);function H(e,t,n=Math.random){let i=(e??t)*1e3,s=Math.min(Math.max(i,500),2e4),a=Math.round(s*(1+(n()*2-1)*.25));return Math.min(Math.max(a,500),2e4)}r(H,"T");var V=6e4,N=4,se=3e4,re=9e5,ae=200,oe=5,ce=400,de=new Set(["server_busy","request_timeout"]),ue=20,le=60,pe=600,he=2;function v(e){return(e.split(";")[0]??"").trim()}r(v,"l");var me={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},fe=`@sekyro/web/${J}`,ye=fe,b,st=(b=class{constructor(t){this.sessionId=null,this.bootstrap=null,this.captureNonces=[],this.captureFetch=null,this.reportedIssues=new Map,this.issueReports=0,this.issuesPausedUntil=0,this.apiOrigin=t.apiOrigin.replace(/\/+$/,""),this.sessionToken=t.sessionToken;let n=t.fetch;this.fetchImpl=(i,s)=>(n??globalThis.fetch).call(globalThis,i,s),this.requestTimeoutMs=t.requestTimeoutMs??se,this.retryAttempts=t.inProgressRetry?.attempts??oe,this.retryDelayMs=t.inProgressRetry?.delayMs??ce,this.random=t.random??Math.random,this.clientLocale=t.locale}async getSession(){let t=await this.api("GET","/hosted/session");return this.sessionId=t.sessionId,t}async recordConsent(t){let n=await this.api("POST","/hosted/consent",{body:{locale:t},busyRetry:!0}),i=this.captureHold;return this.captureHold=void 0,i&&this.armCapture(i),n}async reportCameraUnavailable(t){return this.api("POST","/hosted/camera-unavailable",{body:{cause:t}})}async testerGate(t){return this.api("POST","/hosted/tester-gate",{body:{input:t}})}async reportCaptureIssue(t){let n=typeof t.name=="string"?t.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",i=typeof t.engineKind=="string"&&/^[a-z_]{1,32}$/.test(t.engineKind)?t.engineKind:void 0,s=typeof t.attempt=="number"&&Number.isInteger(t.attempt)&&t.attempt>=0&&t.attempt<=1e3?t.attempt:void 0,a=t.check==="attestation"?s??"":"",c=[t.check,a,t.kind,n,t.phase??"",i??""].join("|"),d=this.reportedIssues.get(c);if(d!==void 0)return d;if(Date.now()<this.issuesPausedUntil||this.issueReports>=ue)return;let o={check:t.check,kind:t.kind,...n!==""?{name:n}:{},...t.phase!==void 0?{phase:t.phase}:{},...i!==void 0?{engineKind:i}:{},...s!==void 0?{attempt:s}:{},...t.formFactor!==void 0?{formFactor:t.formFactor}:{},...typeof t.detail=="string"&&/^\d{1,10}$/.test(t.detail)?{detail:t.detail}:{},...G(t.challengeMs)?{challengeMs:t.challengeMs}:{},...G(t.readyMs)?{readyMs:t.readyMs}:{},...t.inApp===!0?{inApp:!0}:{}};this.issueReports+=1;let u=this.api("POST","/hosted/capture-issue",{body:o,empty:!0}).catch(l=>{if(l instanceof h&&l.status===429){let p=Math.min(Math.max(l.retryAfterSeconds??le,0),pe);this.issuesPausedUntil=Math.max(this.issuesPausedUntil,Date.now()+p*1e3);return}(!(l instanceof h)||l.status===0||l.status>=500)&&this.reportedIssues.delete(c)});return this.reportedIssues.set(c,u),u}async choose(t,n){let i=await this.api("POST","/hosted/choice",{body:{nodeId:t,option:n},busyRetry:!0});return this.sessionId=i.sessionId,i}async confirmIdentity(t){return this.api("POST","/hosted/identity/confirm",{body:{decision:t}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(t,n,i,s={}){let a=await this.ensureSessionId(),c={kind:t,contentType:v(n),contentLength:i,...s.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${a}/media`,{body:c})}armCapture(t=2){let n=Date.now();this.captureNonces.filter(i=>i.expiresAt-V>n).length>=t||(this.captureHold===void 0?this.fillCaptureNonces(t,t):this.captureHold=Math.max(this.captureHold,t))}async armRamp(){try{let t=await this.ensureSessionId(),n=await this.api("POST",`/sessions/${t}/media/capture-nonces`,{body:{count:2,ramp:!0}}),i=Date.now(),s=L(n.screenRamp)?n.screenRamp:void 0,a=i+Math.max(0,n.expiresIn)*1e3;for(let d of Array.isArray(n.nonces)?n.nonces:[])typeof d!="string"||d.length===0||this.captureNonces.push({nonce:d,expiresAt:a,...s!==void 0?{arm:s.nonce}:{}});this.captureNonces=this.captureNonces.slice(-N),this.captureHold=void 0;let c=typeof n.rampExpiresIn=="number"&&n.rampExpiresIn>0?n.rampExpiresIn:0;return{...s!==void 0?{challenge:s}:{},expiresAt:i+c*1e3}}catch{return}}async presignCapture(t,n,i,s={}){let a=await this.ensureSessionId(),c=await this.takeCaptureNonce(s.arm),d=c===void 0?void 0:{nonce:c,...s.engine!==void 0?{engine:s.engine.slice(0,32)}:{},...s.durationMs!==void 0&&Number.isFinite(s.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(s.durationMs)))}:{}},o={kind:t,contentType:v(n),contentLength:i,capture:d};return this.api("POST",`/sessions/${a}/media`,{body:o})}async takeCaptureNonce(t){let n=r(()=>{let i=Date.now();this.captureNonces=this.captureNonces.filter(a=>a.expiresAt-V>i);let s=this.captureNonces.findIndex(a=>a.arm===t);return this.captureNonces.splice(s<0?0:s,1)[0]?.nonce},"n");for(let i=0;i<2;i++){let s=n();if(s!==void 0)return s;await this.fillCaptureNonces(1)}return n()}fillCaptureNonces(t,n=0){return this.captureFetch??(this.captureFetch=(async()=>{try{let i=await this.ensureSessionId(),s=await this.api("POST",`/sessions/${i}/media/capture-nonces`,{body:{count:Math.min(N,Math.max(1,t))}}),a=Date.now()+Math.max(0,s.expiresIn)*1e3;for(let c of Array.isArray(s.nonces)?s.nonces:[])typeof c=="string"&&c.length>0&&this.captureNonces.push({nonce:c,expiresAt:a});this.captureNonces=this.captureNonces.slice(-N),this.captureHold=void 0}catch(i){i instanceof h&&i.code==="consent_required"&&(this.captureHold=Math.max(this.captureHold??0,n))}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(t,n,i){let s;try{s=await this.fetchImpl(t,{method:"PUT",headers:{"content-type":v(i)},body:n,signal:AbortSignal.timeout(re)})}catch(a){throw K(a)}if(!s.ok){let a=(await s.text().catch(()=>"")).slice(0,ae);throw new h({status:s.status,code:"upload_failed",message:`media upload failed (HTTP ${s.status})${a?`: ${a}`:""}`})}}async completeMedia(t){let n=await this.ensureSessionId();return this.api("POST",`/sessions/${n}/media/complete`,{body:{key:t}})}async submitCheck(t,n,i={}){let s=await this.ensureSessionId(),a={input:n,forceOutcome:i.forceOutcome};return this.api("POST",`/sessions/${s}/checks/${t}`,{body:a,idempotencyKey:i.idempotencyKey,...i.browserCheckToken!==void 0?{browserCheckToken:i.browserCheckToken}:{},busyRetry:i.idempotencyKey!==void 0})}async uploadAndSubmit(t,n,i,s={}){let a=v(n.contentType),c=await this.presign(n.kind,a,n.blob.size);await this.uploadToSpaces(c.uploadUrl,n.blob,a);let d=await this.completeMedia(c.key),o={...i,[me[t]]:d.key};return this.submitCheck(t,o,s)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(t,n,i={}){let s=t==="GET"||i.busyRetry===!0,a=`${this.apiOrigin}/api/v2${n}`,c={"x-session-token":this.sessionToken,"x-sekyro-sdk":ye};i.body!==void 0&&(c["content-type"]="application/json"),i.idempotencyKey!==void 0&&(c["x-idempotency-key"]=i.idempotencyKey),i.browserCheckToken!==void 0&&(c["sekyro-browser-check"]=i.browserCheckToken),this.clientLocale!==void 0&&(c["sekyro-client-locale"]=this.clientLocale);try{let d=R.timezone();d!==void 0&&(c["sekyro-client-timezone"]=d)}catch{}c["sekyro-client-form-factor"]=U();try{let d=await R.deviceHeader();d!==void 0&&(c["sekyro-client-device"]=d)}catch{}for(let d=0;;d++){let o;try{o=await this.fetchImpl(a,{method:t,headers:c,...i.body!==void 0?{body:JSON.stringify(i.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(l){throw K(l)}if(o.ok){if(i.empty===!0)return;if(i.blob===!0)try{return await o.blob()}catch(p){throw K(p)}let l;try{l=await o.json()}catch{throw new h({status:o.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${o.status})`})}return _e(l)}let u=await ve(o);if(u.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await B(this.retryDelayMs);continue}if(s&&u.status===503&&de.has(u.code)){s=!1,await B(H(u.retryAfterSeconds,he,this.random));continue}throw u}}},r(b,"S"),b);function G(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=6e5}r(G,"k");function K(e){if((typeof e=="object"&&e!==null?e.name:void 0)==="TimeoutError")return new h({status:0,code:"timeout",message:"request timed out"});let t=e instanceof Error?e.message:String(e);return new h({status:0,code:"network_error",message:`network request failed: ${t}`})}r(K,"f");function _e(e){return e!==null&&typeof e=="object"&&"success"in e&&"data"in e?e.data:e}r(_e,"L");async function ve(e){let t="unknown_error",n=`request failed (HTTP ${e.status})`,i=Number.NaN,s;try{let d=await e.json();if(d!==null&&typeof d=="object"){let o=d;typeof o.code=="string"&&o.code.length>0&&(t=o.code),typeof o.message=="string"&&o.message.length>0&&(n=o.message),typeof o.retryAfterSeconds=="number"&&(i=o.retryAfterSeconds),Array.isArray(o.details?.issues)?s=o.details:Array.isArray(o.details?.errors)&&(s={...o.details,issues:[]})}}catch{}let a=e.headers.get("retry-after"),c=a===null?Math.floor(i):Number.parseInt(a,10);return new h({status:e.status,code:t,message:n,...Number.isFinite(c)&&c>=0?{retryAfterSeconds:c}:{},details:s})}r(ve,"V");function B(e){return new Promise(t=>setTimeout(t,e))}r(B,"R");function rt(e){let t=e?.portrait,n=t?.icao,i=t?.purpose==="id_document";return n==null?i?{policy:"reject",profile:"id_document"}:null:{policy:n.policy==="alert"?"alert":"reject",profile:i||n.profile==="id_document"?"id_document":"selfie"}}r(rt,"J");function at(e){return{...e.baselineEyeOpenness!==void 0?{baselineEyeOpenness:e.baselineEyeOpenness}:{},...e.baselineEyeOpennessLeft!==void 0&&e.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:e.baselineEyeOpennessLeft,baselineEyeOpennessRight:e.baselineEyeOpennessRight}:{},criteria:e.verdict??{},...e.backgroundCheck!==void 0?{backgroundCheck:e.backgroundCheck}:{}}}r(at,"Q");var ge=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function ut(e){return ge.has(e)}r(ut,"ve");function lt(e,t,n){let i=t.detail;return{check:e,kind:t.kind,...i?.name!==void 0?{name:i.name}:{},...i?.phase!==void 0?{phase:i.phase}:{},...i?.engineKind!==void 0?{engineKind:i.engineKind}:{},attempt:Math.max(0,Math.min(1e3,n))}}r(lt,"Pe");function pt(){let e=-1,t="";return{note(n){n==="starting"&&t!=="starting"&&(e+=1),t=n},newHandle(){t=""},noteError(){e<0&&(e=0)},get value(){return e}}}r(pt,"xe");var be={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function y(e){return e.plan?.steps??[]}r(y,"f");function F(e){return Math.max(0,e.attempts.max-e.attempts.used)}r(F,"x");function ke(e){let t=e.plan?.choice;return t!==void 0&&e.plan?.current===t.nodeId?t:null}r(ke,"J");function ht(e){let t=ke(e);if(t?.kind!=="identity_method")return null;let n=t.options.map(s=>be[s.service]).filter(s=>s!==void 0),i=t.options.find(s=>s.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:n,nationalEid:i}:{available:!0,selected:null,options:n}}r(ht,"Ve");var we=new Set(["liveness","face_match"]);function j(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}r(j,"R");function Me(e){return e.status!=="created"&&e.status!=="in_progress"}r(Me,"T");function Y(e){let t=e.plan?.current,n=t==null?void 0:y(e).find(i=>i.id===t);return j(n)?n:void 0}r(Y,"M");function $(e,t){return y(e).find(n=>n.checkType===t)}r($,"_");function O(e){let t=y(e),n=t.findIndex(i=>i.checkType==="liveness");return t.find((i,s)=>s>n&&i.checkType==="face_match")}r(O,"S");function Se(e,t){let n=$(t,"liveness")?.state,i=O(t)?.state;return(O(e)?.state??"pending")==="pending"&&(n==="passed"||n==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}r(Se,"F");function Z(e,t){let n=new Map(y(e).map(i=>[i.id,i.state]));return y(t).filter(i=>i.checkType==="face_match"&&(n.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}r(Z,"V");var Ie=/^[0-9a-f]{24}$/i;function x(e){return Ie.test(e)?`ses_${e}`:e}r(x,"k");function E(e,t){let n=x(e);return t===void 0?{sessionId:n,status:"unavailable"}:{sessionId:n,status:"unavailable",reasonCode:t}}r(E,"C");function W(e,t,n){let i=x(e);return n===void 0?{sessionId:i,status:t}:{sessionId:i,status:t,reasonCode:n}}r(W,"O");function mt(e,t){let n=Ae(e,t),i=Te(e);return i!==void 0&&(n.sandbox={simulated:!0,reason:i}),n}r(mt,"Ee");var Ce=new Set(["no_testers","tester_gate_not_used","tester_gate_missed"]);function Te(e){if(e.sandbox!==!0)return;let t=e.simulation?.reason;return Ce.has(t)?t:void 0}r(Te,"Z");function Ae(e,t){let n=x(e.sessionId);switch(e.status){case"created":case"in_progress":return $e(e,t);case"verified":return P(e,{sessionId:n,status:"verified"});case"review_pending":return P(e,W(n,"review",X(e,"review")));case"not_verified":return P(e,Ee(e));default:return P(e,{sessionId:n,status:"not_verified"})}}r(Ae,"Q");var xe=new Set([0,1,2,3]);function P(e,t){return xe.has(e.level)&&(t.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(t.assurance=e.assurance),t}r(P,"v");function Ee(e){let t={sessionId:x(e.sessionId),status:"not_verified"};return e.reason!==void 0&&(t.reason=e.reason),e.reasonCode!==void 0&&(t.reasonCode=e.reasonCode),e.reasonCode==="device_cooldown"&&e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),t}r(Ee,"ne");function Pe(e){return e==="rejected"?"rejected":e==="unavailable"?"unavailable":"inconclusive"}r(Pe,"te");function Oe(e,t){if(t===void 0)return!1;let n=y(t).find(i=>i.id===e.id);return n!==void 0&&n.attempts.used===e.attempts.used}r(Oe,"ie");function $e(e,t){let n=x(e.sessionId),i=y(e).find(a=>we.has(a.checkType)&&a.state==="input_required"&&a.reason!==void 0);if(i?.reason==="mobile_required")return E(n,"mobile_required");if(i?.reason!==void 0){if(i.result==="unavailable")return E(n,i.reason);let a=t.autoRetry&&(F(i)>0||Oe(i,t.previous))?{sessionId:n,status:"retry",reasonCode:i.reason,attemptsRemaining:F(i)}:{sessionId:n,status:"not_verified",reason:Pe(i.result),reasonCode:i.reason,attemptsRemaining:F(i)};return i.retakeHint!==void 0&&(a.retakeHint=i.retakeHint),a}let s=Y(e);return s===void 0&&y(e).some(a=>a.state==="review")?W(n,"review",X(e,"review")):s?.checkType==="portrait_icao"?E(n,"portrait_required"):E(n)}r($e,"re");function X(e,t){return y(e).find(n=>n.state===t&&n.reason!==void 0)?.reason}r(X,"L");function ee(e,t,n,i,s){return e.presignCapture!==void 0?e.presignCapture(t,n,i,s):e.presign(t,n,i)}r(ee,"K");function te(e){return{engine:e?.engine,durationMs:e?.clipMs,arm:e?.screenRamp?.nonce}}r(te,"q");var qe=["video/webm","video/mp4"],Q="image/jpeg",Re=2,Ne=1e3,Ke=1e4,He=3,Fe=10,ze=3,je=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),De=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","check_not_active","step_not_on_path","native_app_required"]),k,D=(k=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}},r(k,"b"),k);function Le(e){let t=O(e);return $(e,"portrait_icao")?.state!=="pending"&&(t!==void 0?j(t):e.capture?.livePhoto?.oneCapture===!0)}r(Le,"me");var w,A=(w=class extends Error{constructor(t){super(t),this.name="AttestationError"}},r(w,"h"),w),M,Ue=(M=class extends A{constructor(t){super(`no attestation token: ${t}`),this.name="AttestationUnavailableError",this.code=t}},r(M,"E"),M);function ft(e){return new h({status:400,code:"attestation_invalid",message:`browser check: ${e}`,details:{issues:[],browserCheck:e}})}r(ft,"Oe");function Je(e){if(!(e instanceof h)||e.code!=="attestation_invalid")return;let t=e.details?.browserCheck;return typeof t=="string"?t:void 0}r(Je,"he");async function ne(e,t,n={}){let i=e.uuid(),s=!1,a=!1,c=0,d=0;for(;;)try{return await t(e.client,i)}catch(o){if(o instanceof A){if(a||o instanceof Ue)throw o;a=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(!(o instanceof h))throw o;if(o.code==="consent_required"&&!s){s=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(o.code==="attestation_invalid"&&!a&&Je(o)===void 0){a=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(o.code==="inference_unavailable"&&d<He){d+=1;let u=H(o.retryAfterSeconds,Fe,e.random??Math.random);e.onBusy?.({attempt:d,retryAfterSeconds:u/1e3}),await e.sleep(u),n.onAttestationInvalid?.(),i=e.uuid();continue}if(je.has(o.code)&&c<Re){c+=1;let u=o.retryAfterSeconds!==void 0?o.retryAfterSeconds*1e3:void 0;await e.sleep(u!==void 0?Math.min(u,Ke):Ne);continue}throw o}}r(ne,"D");var Ve=new Set(["passed","review","processing","skipped"]);async function yt(e){let{artifacts:t}=e,n=t.clip,i=v(t.clipMime??"");if(t.degraded==="NO_RECORDER"||n===void 0||!qe.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let s=Ge(e,t.keyframe),a=Be(e,n,i,s),c=Ze(e,s),d=!1,o=new Set,u=!0,l=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let p=e.getView();if(Me(p))return{kind:"settled"};let m=Y(p),T=m?.checkType,q=T==="liveness"&&!d?"liveness":T==="face_match"&&!o.has(m?.id)&&o.size<2&&u?"face_match":null;if(q===null)return{kind:"settled"};if(q==="liveness"&&t.captureChannel==="desktop")return{kind:"unavailable",reason:"mobile_required"};try{if(q==="liveness"){d=!0;let f=await a();if(e.isCancelled())return{kind:"cancelled"};Se(p,f)&&o.add(O(f)?.id);for(let ie of Z(p,f))o.add(ie);await e.applySubmit(f,"liveness");let _=$(e.getView(),"liveness")?.state;u=_===void 0||Ve.has(_)}else{o.add(m?.id);let f=await c();if(e.isCancelled())return{kind:"cancelled"};for(let _ of Z(p,f))o.add(_);await e.applySubmit(f,"face_match")}}catch(f){if(e.isCancelled()||f instanceof D)return{kind:"cancelled"};let _=Xe(f);if(_.kind!=="resync"||l>=ze)return _;l+=1,await e.refreshView()}}}r(yt,"Le");function Ge(e,t){let n=null,i=null,s=r(()=>n!==null?Promise.resolve(n):(i??(i=(async()=>{let a=await ee(e.client,"image",Q,t.size,te(e.artifacts));return await e.client.uploadToSpaces(a.uploadUrl,t,Q),n=(await e.client.completeMedia(a.key)).key,e.onKeyframePromoted?.(n),n})().finally(()=>{i=null})),i),"r");return{ensure:s,attempt:r(()=>s().catch(()=>null),"attempt"),current:r(()=>n,"current")}}r(Ge,"ge");function Be(e,t,n,i){let s=e.clipKeys?.get()??null,a,c=null,d=0,o;return()=>ne(e,async(u,l)=>{if(s===null||a===void 0){if(e.isCancelled())throw new D;a===void 0&&!Le(e.getView())&&(a=null),e.onPhase("uploading");let[p,m]=await Promise.all([s!==null?Promise.resolve(s):(async()=>{let T=await ee(u,"clip",n,t.size,te(e.artifacts));return await u.uploadToSpaces(T.uploadUrl,t,n),(await u.completeMedia(T.key)).key})(),a!==void 0?Promise.resolve(a===null?null:a.imageKey):i.attempt()]);s=p,e.clipKeys?.set(p),a===void 0&&(a=m===null?null:{imageKey:m})}if(c===null){let p=performance.now();try{c=await e.getAttestation(),o=e.attestationError?.()}catch(m){throw m instanceof A?m:new A(m instanceof Error?m.message:String(m))}d=Math.round(performance.now()-p)}return e.onPhase("checking"),u.submitCheck("liveness",{clipKey:s,attestation:c,captureChannel:e.artifacts.captureChannel,capture:{...Qe(e.artifacts),attestationMs:d,attestationError:o,...We(e.attestationFacts?.())},...a!==null?{faceMatch:a}:{}},{idempotencyKey:l})},{onAttestationInvalid:r(()=>{c=null},"onAttestationInvalid")})}r(Be,"ye");function Ze(e,t){return()=>ne(e,async(n,i)=>{if(t.current()===null){if(e.isCancelled())throw new D;e.onPhase("uploading")}let s=await t.ensure();return e.onPhase("checking"),n.submitCheck("face_match",{imageKey:s},{idempotencyKey:i})})}r(Ze,"Se");function Qe(e){let t={width:e.width,height:e.height};for(let n of Ye)e[n]!==void 0&&(t[n]=e[n]);return t}r(Qe,"Re");var Ye=["engine","facingMode","mode","formFactor","clipMs","clipFrames","fps","clipRetakes","codec","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function We(e){return e===void 0?{}:{attestationChecks:e.checks,...e.challengeMs!==void 0?{attestationChallengeMs:e.challengeMs}:{}}}r(We,"be");function Xe(e){if(e instanceof A)return{kind:"unavailable",reason:"attestation"};if(e instanceof h){if(e.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(e.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(e.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(De.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}r(Xe,"we");var _t="form_answers_invalid",S,vt=(S=class extends Error{constructor(t,n){super(`form answers refused (${t.map(i=>`${i.id}: ${i.code}`).join(", ")})`),this.name="FormAnswersError",this.issues=t,this.source=n}},r(S,"U"),S),I,gt=(I=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="InvalidInputError",this.field=t,this.kind=n}},r(I,"B"),I),C,bt=(C=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="OtpInputError",this.field=t,this.kind=n}},r(C,"$"),C);function z(e){return e?.source==="upload"?null:e?.source==="choice"&&e.sourcePick!=="camera"?"upload_or_phone":"phone"}r(z,"I");function kt(e,t){if(t===void 0||!j(t)||t.requiresMobile!==!0)return null;switch(t.checkType){case"liveness":return"phone";case"face_match":{if(t.reason!==void 0)return"phone";let n=$(e,"portrait_icao");return n?.state==="passed"||n?.state==="review"?null:"phone"}case"doc_ocr":return z(e.documents);case"poa":return z(e.proofOfAddress);case"portrait_icao":{let n=e.portrait;return n?.pendingFix!==void 0||n?.reuse?.pending===!0?null:z(n)}default:return null}}r(kt,"Be");function et(e){let t=e?.capture,n=t?.mode;return n==="assisted"||n==="self"||n==="choice"?n:t?.cameraSwitch===!0?"assisted":"self"}r(et,"Ce");function wt(e){let t=e?.capture?.pick;return et(e)==="choice"&&(t==="self"||t==="assisted")?t:null}r(wt,"Ye");function Mt(e,t,n=null){return e==="choice"?t??n??"self":e}r(Mt,"ze");var St={"JP:drivers_license":{normalize:"upper_no_space_or_hyphen",pattern:"^[0-9]{12}$",check:null,registrySources:[],describe:"number must be the 12-digit Japanese driving licence number"},"JP:residence_permit":{normalize:"upper_no_space_or_hyphen",pattern:"^[A-Z]{2}[0-9]{8}[A-Z]{2}$",check:null,registrySources:[],describe:"number must be the 12-character residence card number: two letters, eight digits, two letters"},"MR:drivers_license":{normalize:"upper_no_space_or_hyphen",pattern:"^[0-9]{8}$",check:null,registrySources:[],describe:"number must be the 8-digit Mauritanian driver's license number"},"MR:national_id":{normalize:"trim",pattern:"^[0-9]{10}$",check:"mr_nni_mod97",registrySources:["MR.anrpts"],describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}};export{h as a,v as b,st as c,rt as d,at as e,ut as f,lt as g,pt as h,be as i,y as j,F as k,ke as l,ht as m,j as n,Me as o,Y as p,$ as q,x as r,E as s,mt as t,Te as u,ee as v,qe as w,Ue as x,ft as y,Je as z,ne as A,yt as B,Qe as C,_t as D,vt as E,gt as F,bt as G,kt as H,et as I,wt as J,Mt as K,St as L};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as p}from"./chunk-JS2IXPNL.js";import{a as n}from"./chunk-4FHWXBOB.js";function U(e,r){return{video:{width:{ideal:1280,max:1280},height:{ideal:720,max:720},facingMode:r,frameRate:{ideal:24,max:30}},audio:!1}}n(U,"c");var P=600;function A(){if(typeof window>"u"||typeof navigator>"u")return"desktop";let e=navigator.userAgentData,r=e?.mobile||/Android|i(Pad)?OS/.test(String(e?.platform)),t=String(navigator.userAgent??"");if(/iPhone|iPod/i.test(t))return"phone";if(/iPad/i.test(t))return"tablet";if(/Android/i.test(t))return/Mobile/i.test(t)?"phone":"tablet";if(/BlackBerry|IEMobile|Opera Mini/i.test(t))return"phone";if(!r){if(Number(navigator.maxTouchPoints??0)<=1)return"desktop";if(/Macintosh/.test(t))return"tablet";if(/Windows NT|CrOS/.test(t)||!T())return"desktop"}let i=L();return i>0&&i<P?"phone":"tablet"}n(A,"i");function q(){return A()!=="desktop"}n(q,"u");function L(){try{let e=window.screen,r=Number(e?.width??0),t=Number(e?.height??0);return r>0&&t>0?Math.min(r,t):0}catch{return 0}}n(L,"a");function w(e){try{let r=e?.getVideoTracks?.()[0]?.getSettings?.().facingMode;return r==="user"||r==="environment"?r:null}catch{return null}}n(w,"d");function T(){try{return typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}catch{return!1}}n(T,"s");function B(){let e=new Map;return{on(r,t){let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i));let a=t;return i.add(a),()=>{i?.delete(a)}},emit(r,t){let i=e.get(r);if(i!==void 0)for(let a of[...i])a(t)},count(r){return e.get(r)?.size??0},clear(){e.clear()}}}n(B,"y");async function M(){try{return typeof navigator>"u"||typeof navigator.permissions?.query!="function"?null:await navigator.permissions.query({name:"camera"})}catch{return null}}n(M,"f");function m(e){return e==="granted"||e==="prompt"||e==="denied"?e:"unknown"}n(m,"c");async function O(){let e=await M();return e===null?"unknown":m(e.state)}n(O,"k");function I(e){let r=!1,t=null,i=n(()=>{!r&&t!==null&&e(m(t.state))},"t");return M().then(a=>{r||(t=a,e(a===null?"unknown":m(a.state)),a?.addEventListener?.("change",i))}),()=>{r=!0,t?.removeEventListener?.("change",i)}}n(I,"w");async function z(){if(typeof navigator>"u")return!1;let e=String(navigator.userAgent??"");if(/Android|iPhone|iPad|iPod/i.test(e)||/Macintosh/.test(e)&&(navigator.maxTouchPoints??0)>1)return!0;try{return(await navigator.mediaDevices?.enumerateDevices?.()??[]).filter(r=>r.kind==="videoinput").length>=2}catch{return!1}}n(z,"b");var D=n(e=>e==="self"?"user":"environment","h");function R(){let e=!1,r=n(i=>{e||(e=!0,console.warn(`[@sekyro/web] ${i}`))},"i"),t=n(i=>i==="self"?"this capture is a self capture (the person films themselves), which uses the front camera only. The back camera is for assisted capture, set in the flow.":"this capture is an assisted capture (another person films the face), which uses the back camera only. The front camera is for self capture, set in the flow.","n");return{facing:n((i,a)=>{let s=D(i);return a!==void 0&&a!==s&&r(`facing "${a}" ignored: ${t(i)}`),s},"facing"),refuseSwitch:n(i=>(r(`switchCamera() ignored: ${t(i)}`),!1),"refuseSwitch")}}n(R,"S");function y(){if(typeof navigator>"u"||!("wakeLock"in navigator))return null;let e=navigator.wakeLock;return typeof e?.request=="function"?e:null}n(y,"v");function b(){return typeof document>"u"||document.visibilityState==="visible"}n(b,"m");function k(e){try{e.release().catch(()=>{})}catch{}}n(k,"p");function V(e={}){if(e.enabled===!1)return{setActive:n(()=>{},"setActive")};let r=!1,t=null,i=!1,a=!1,s=n(()=>{if(!r||i||t!==null&&!t.released)return;let u=y();if(u===null||!b())return;let c;try{c=u.request("screen")}catch{return}i=!0,c.then(o=>{if(i=!1,!r){k(o);return}t=o,o.addEventListener?.("release",()=>{t===o&&(t=null)})},()=>{i=!1})},"o"),f=n(()=>{b()&&s()},"l"),d=n(u=>{typeof document>"u"||u===a||(a=u,u?document.addEventListener("visibilitychange",f):document.removeEventListener("visibilitychange",f))},"d");return{setActive:n(u=>{if(r=u,u){if(y()===null)return;d(!0),s();return}if(d(!1),t!==null){let c=t;t=null,k(c)}},"setActive")}}n(V,"P");var l,N=(l=class extends Error{constructor(){super("the back camera could not be opened"),this.name="BackCameraUnavailableError"}},n(l,"u"),l),S=new Set(["NotAllowedError","PermissionDeniedError","SecurityError"]);function x(e){try{return String(e?.name??"")}catch{return""}}n(x,"h");function g(e){if(e!==null)for(let r of e.getTracks())r.stop()}n(g,"c");async function J(e,r,t){let i=n(o=>({video:{...r,...o},audio:!1}),"a");if(e==="user")return t.getUserMedia(i({facingMode:"user"}));let a=n(o=>w(o)!=="user","o");try{let o=await t.getUserMedia(i({facingMode:{exact:"environment"}}));if(a(o))return o;g(o)}catch(o){if(S.has(x(o)))throw o}let s=!1,f=n(async()=>{if(t.enumerateDevices===void 0||s)return null;let o;try{o=p(await t.enumerateDevices()).slice(0,3)}catch{return null}s=o.length>0;for(let E of o){let h;try{h=await t.getUserMedia(i({deviceId:{exact:E}}))}catch(v){if(S.has(x(v)))throw v;continue}if(a(h))return h;g(h)}return null},"l"),d=await f();if(d!==null)return d;let u=await t.getUserMedia(i({facingMode:"environment"}));if(a(u))return u;g(u);let c=await f();if(c!==null)return c;throw new N}n(J,"C");export{U as a,A as b,q as c,w as d,B as e,O as f,I as g,z as h,D as i,R as j,V as k,N as l,J as m};
|