@sekyro/elements 0.1.0-rc.1 → 0.1.0-rc.10
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 +84 -0
- package/README.md +8 -9
- package/custom-elements.json +2 -2
- package/dist/cdn/chunks/{background-monitor-GCMNCJMG-UXYQ5GX7.js → background-monitor-A7FKJOAG-K3WF3C2D.js} +1 -1
- package/dist/cdn/chunks/barcode-detect-C5IOXMKI-ZOZ2WOWU.js +1 -0
- package/dist/cdn/chunks/{camera-trait-HVV5ZEDI-JB4HN6S3.js → camera-trait-V4UAOPIQ-TFCPOCSU.js} +1 -1
- package/dist/cdn/chunks/{capture-session-doc-ELX6VK6Z-SDM3ILRA.js → capture-session-doc-2LIRRKFX-GZQBYOR3.js} +1 -1
- package/dist/cdn/chunks/challenge-frame-YAQJ5YMB-MHZYRGKY.js +1 -0
- package/dist/cdn/chunks/chunk-52CHUGVC.js +3 -0
- package/dist/cdn/chunks/chunk-574O5HZZ.js +1 -0
- package/dist/cdn/chunks/chunk-5FPDMYLD.js +33 -0
- package/dist/cdn/chunks/{chunk-6H22RNSK.js → chunk-6N4AXKCS.js} +1 -1
- package/dist/cdn/chunks/chunk-BIK4PGBE.js +1 -0
- package/dist/cdn/chunks/{chunk-FEWP7HBJ.js → chunk-BZDKXIWD.js} +1 -1
- package/dist/cdn/chunks/{chunk-D334IAZJ.js → chunk-CW56KMMH.js} +1 -1
- package/dist/cdn/chunks/{chunk-BF6SE2AC.js → chunk-FVMJYXGV.js} +1 -1
- package/dist/cdn/chunks/{chunk-36WGD7QV.js → chunk-JDANRDDK.js} +1 -1
- package/dist/cdn/chunks/chunk-LAF6JZRH.js +1 -0
- package/dist/cdn/chunks/{chunk-FCTRNWRU.js → chunk-MDDGAHO6.js} +1 -1
- package/dist/cdn/chunks/{chunk-LYYAVERP.js → chunk-MZ6WG3QQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-FDWO4KXK.js → chunk-NNYJYD3Q.js} +1 -1
- package/dist/cdn/chunks/{chunk-ZIC5GEH2.js → chunk-NT7PZPBW.js} +1 -1
- package/dist/cdn/chunks/chunk-PH7RJ5GZ.js +1 -0
- package/dist/cdn/chunks/{chunk-T4M2J44L.js → chunk-Q5ZVLMKQ.js} +1 -1
- package/dist/cdn/chunks/chunk-Q6GRUOR3.js +1 -0
- package/dist/cdn/chunks/chunk-SIBJ56BG.js +1 -0
- package/dist/cdn/chunks/{chunk-CYGAKCKG.js → chunk-SJAQ7DUY.js} +1 -1
- package/dist/cdn/chunks/{chunk-X767DBO7.js → chunk-SVROKIYG.js} +1 -1
- package/dist/cdn/chunks/{chunk-JM3CYFFZ.js → chunk-UQKRYXN5.js} +1 -1
- package/dist/cdn/chunks/chunk-WKQRKYX4.js +25 -0
- package/dist/cdn/chunks/chunk-X42LECG5.js +1 -0
- package/dist/cdn/chunks/chunk-X7QE75V5.js +1 -0
- package/dist/cdn/chunks/{chunk-IBOJTLL7.js → chunk-Y6PC7FZV.js} +1 -1
- package/dist/cdn/chunks/{chunk-KLE75SX4.js → chunk-YGXNL7S2.js} +1 -1
- package/dist/cdn/chunks/{chunk-BZ37D4FR.js → chunk-YPIQ6IU7.js} +1 -1
- package/dist/cdn/chunks/chunk-YZWLMKXA.js +1 -0
- package/dist/cdn/chunks/{chunk-7Y73DZJB.js → chunk-ZRL6E7XH.js} +1 -1
- package/dist/cdn/chunks/create-document-capture-X35M4UAK-BB2SCTPK.js +1 -0
- package/dist/cdn/chunks/create-portrait-capture-5VGYZUOK-N3333DJC.js +1 -0
- package/dist/cdn/chunks/{detector-scanic-F3Y5X3DF-FGVR4NEM.js → detector-scanic-KMAVOHGF-NFYSZ7GU.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-QMXAAYA2-5HJJKIZ4.js +1 -0
- package/dist/cdn/chunks/{eid-view-RZS6MLT6-35VSHTV3.js → eid-view-3QTJORA7-S7APLLOM.js} +1 -1
- package/dist/cdn/chunks/email-otp-view-6MD74OFN-PRYGFOHY.js +1 -0
- package/dist/cdn/chunks/flow-views-AEVFAZOT-DUBO6WU5.js +1 -0
- package/dist/cdn/chunks/form-view-YAGVGWMI-7BEAIBSC.js +1 -0
- package/dist/cdn/chunks/icao-gate-T3BTOKFJ-BWMLKL7A.js +1 -0
- package/dist/cdn/chunks/icao-tuning-4ETMF53W-FRBTB5R7.js +1 -0
- package/dist/cdn/chunks/{landmarker-3BBP3RBY-DDXMOLGK.js → landmarker-KB7LVXAU-F7BQTP3H.js} +1 -1
- package/dist/cdn/chunks/mrz-band-VYHOTDHY-VEZ2J5IL.js +1 -0
- package/dist/cdn/chunks/overlay-de-U5AM34SS-UPJSNTKZ.js +1 -0
- package/dist/cdn/chunks/overlay-es-LS4JWU5J-UFZMJAU6.js +1 -0
- package/dist/cdn/chunks/overlay-pt-M4ZJJRFE-HJIXIX5G.js +1 -0
- package/dist/cdn/chunks/plan-runner-T2ZTSBI4-SEXJ6KJP.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-GQIBQY4U-TJUYRCTI.js → portrait-capture-view-6EUUL2QA-7F2WSHIW.js} +1 -1
- package/dist/cdn/chunks/portrait-review-view-TTVTYGLG-SVRXTB4Q.js +1 -0
- package/dist/cdn/chunks/{print-4WOMNRBE-DNXJ7ERA.js → print-SEWS3VHQ-HWJTHADG.js} +1 -1
- package/dist/cdn/chunks/proof-of-address-view-5WWGRXJL-JQWHMWVI.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-B6A5RXN4.js → chunk-2WPZFQUP.js} +1 -1
- package/dist/chunk-BCDTYNQ3.js +1 -0
- package/dist/{chunk-IBPUWYHJ.js → chunk-DMESMWZ7.js} +1 -1
- package/dist/chunk-F2IYM4GV.js +1 -0
- package/dist/chunk-F67N4IZQ.js +1 -0
- package/dist/{chunk-RMV3BNWO.js → chunk-GIMNUGVE.js} +1 -1
- package/dist/chunk-K5DAJSLX.js +25 -0
- package/dist/{chunk-QE2B3MSJ.js → chunk-M3SKGQUG.js} +1 -1
- package/dist/{chunk-ESSKMX7I.js → chunk-NQQZCBHQ.js} +1 -1
- package/dist/chunk-P223YKM3.js +1 -0
- package/dist/{chunk-XEY5ANJ6.js → chunk-PCLZBE2D.js} +1 -1
- package/dist/{chunk-AGPBG22V.js → chunk-SSSIPHG7.js} +1 -1
- package/dist/chunk-W23RACX3.js +33 -0
- package/dist/{chunk-IGC6OQZ2.js → chunk-XJJ3KCLT.js} +1 -1
- package/dist/{chunk-6NQ7EWA4.js → chunk-YC4IK7VG.js} +1 -1
- package/dist/{chunk-SEE6MST7.js → chunk-YZ6YGLNN.js} +1 -1
- package/dist/define.cjs +6 -6
- package/dist/define.js +1 -1
- package/dist/document-capture-view-QMXAAYA2-62JPLXV7.js +1 -0
- package/dist/{eid-view-RZS6MLT6-2W2T3AWK.js → eid-view-3QTJORA7-TLA52WL7.js} +1 -1
- package/dist/email-otp-view-6MD74OFN-WVIWSE4A.js +1 -0
- package/dist/flow-views-AEVFAZOT-PKXWQC2K.js +1 -0
- package/dist/form-view-YAGVGWMI-CWM5GSJJ.js +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +154 -6
- package/dist/index.d.ts +154 -6
- package/dist/index.js +1 -1
- package/dist/overlay-de-U5AM34SS-ISYPWAT7.js +1 -0
- package/dist/overlay-es-LS4JWU5J-2VRTV7R4.js +1 -0
- package/dist/overlay-pt-M4ZJJRFE-UCQAZFCI.js +1 -0
- package/dist/{portrait-capture-view-GQIBQY4U-AFPEUDLY.js → portrait-capture-view-6EUUL2QA-ZTAGMPU2.js} +1 -1
- package/dist/portrait-review-view-TTVTYGLG-HVTGBDRR.js +1 -0
- package/dist/proof-of-address-view-5WWGRXJL-3BWMP23I.js +1 -0
- package/dist/styles.css +109 -18
- package/package.json +2 -2
- package/sbom.cdx.json +153 -0
- package/dist/cdn/chunks/chunk-5FLR7RPJ.js +0 -1
- package/dist/cdn/chunks/chunk-CFJJD6T2.js +0 -1
- package/dist/cdn/chunks/chunk-CMS5FVGM.js +0 -1
- package/dist/cdn/chunks/chunk-HQF66Y6S.js +0 -1
- package/dist/cdn/chunks/chunk-PUO2VWDE.js +0 -33
- package/dist/cdn/chunks/chunk-U3UDWPBG.js +0 -1
- package/dist/cdn/chunks/chunk-X3BGM3B2.js +0 -1
- package/dist/cdn/chunks/chunk-YWPZG2MZ.js +0 -25
- package/dist/cdn/chunks/chunk-ZKLSZJFN.js +0 -1
- package/dist/cdn/chunks/create-document-capture-UHZJUZHC-YYZNCSW6.js +0 -1
- package/dist/cdn/chunks/create-portrait-capture-VRZZOMJS-I4FBRNBP.js +0 -1
- package/dist/cdn/chunks/document-capture-view-JE6IX4IE-2454PW6Z.js +0 -1
- package/dist/cdn/chunks/email-otp-view-WUQ5OGDD-YDSUKAN2.js +0 -1
- package/dist/cdn/chunks/flow-views-5L7JF3MM-M6C3RXSX.js +0 -1
- package/dist/cdn/chunks/icao-gate-SO6YJ7RV-MPW6W3QN.js +0 -1
- package/dist/cdn/chunks/icao-tuning-DCZCMCEQ-ZQSK7ZOV.js +0 -1
- package/dist/cdn/chunks/mrz-band-DCXFWDBD-OPMO6HYS.js +0 -1
- package/dist/cdn/chunks/overlay-de-JQ2FDZBA-HLFTXIF6.js +0 -1
- package/dist/cdn/chunks/overlay-es-WDYRSRHH-UXHTYCHD.js +0 -1
- package/dist/cdn/chunks/overlay-pt-AQMDWDWX-BD7TO6Y4.js +0 -1
- package/dist/cdn/chunks/plan-runner-ZHOYMRAO-RDS523K5.js +0 -1
- package/dist/cdn/chunks/portrait-review-view-XOQYQNU7-LPONGGFW.js +0 -1
- package/dist/cdn/chunks/turnstile-N4K4U2AI-SLP55XAA.js +0 -1
- package/dist/cdn/chunks/upload-file-C4MFKLT3-DXCNEDXP.js +0 -1
- package/dist/chunk-72JW2LCH.js +0 -25
- package/dist/chunk-7URX73UH.js +0 -1
- package/dist/chunk-EIRNIJXL.js +0 -1
- package/dist/chunk-ZDF5JILV.js +0 -33
- package/dist/document-capture-view-JE6IX4IE-5HJYAEDX.js +0 -1
- package/dist/email-otp-view-WUQ5OGDD-NGI6PBX3.js +0 -1
- package/dist/flow-views-5L7JF3MM-P55CCCOH.js +0 -1
- package/dist/overlay-de-JQ2FDZBA-FR25JPE4.js +0 -1
- package/dist/overlay-es-WDYRSRHH-PFDMX5D2.js +0 -1
- package/dist/overlay-pt-AQMDWDWX-LTD4N2DW.js +0 -1
- package/dist/portrait-review-view-XOQYQNU7-IPKAZBP6.js +0 -1
- /package/dist/cdn/chunks/{chunk-SK6UAYX2.js → chunk-2FETDQV5.js} +0 -0
- /package/dist/cdn/chunks/{chunk-RK4HVNRS.js → chunk-5QL6W6FW.js} +0 -0
- /package/dist/cdn/chunks/{chunk-HDJ6JFXX.js → chunk-IO7MUUC6.js} +0 -0
- /package/dist/cdn/chunks/{chunk-RRLXNT33.js → chunk-JS2IXPNL.js} +0 -0
- /package/dist/cdn/chunks/{chunk-ET7NCKUV.js → chunk-KHSYTJ46.js} +0 -0
- /package/dist/cdn/chunks/{chunk-CMDITVXF.js → chunk-KVTY4E6J.js} +0 -0
- /package/dist/cdn/chunks/{chunk-7HJH5Q4M.js → chunk-L22GFJQV.js} +0 -0
- /package/dist/cdn/chunks/{chunk-FAIDO3QL.js → chunk-L244IUB3.js} +0 -0
- /package/dist/cdn/chunks/{chunk-UZWMCNZI.js → chunk-P7K7ELYZ.js} +0 -0
- /package/dist/cdn/chunks/{chunk-JOZCJGRV.js → chunk-YVQ6LFN4.js} +0 -0
- /package/dist/cdn/chunks/{clip-inspect-HZ7N2YOP-DCDXB76T.js → clip-inspect-DLJXVKV6-TNHTD4LV.js} +0 -0
- /package/dist/cdn/chunks/{keyframe-rank-R4NPQGN3-VRURE6OQ.js → keyframe-rank-YAJLYJYF-WCA6RPMD.js} +0 -0
- /package/dist/cdn/chunks/{scanic-ml-stub-XPNKT2N3-YSXFN7KY.js → scanic-ml-stub-KW7IZHUT-XLERBDWM.js} +0 -0
- /package/dist/cdn/chunks/{segmenter-3CVPTZMM-WGI6XGWN.js → segmenter-USLNBX65-HFEEUGXG.js} +0 -0
- /package/dist/{chunk-TPIBYY2S.js → chunk-N2DNXUEA.js} +0 -0
- /package/dist/{chunk-RPLVIGTS.js → chunk-SSU37LFQ.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @sekyro/elements
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.10
|
|
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 [a649247]
|
|
9
|
+
- @sekyro/web@0.1.0-rc.31
|
|
10
|
+
|
|
11
|
+
## 0.1.0-rc.9
|
|
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 [e70fdcd]
|
|
17
|
+
- @sekyro/web@0.1.0-rc.30
|
|
18
|
+
|
|
19
|
+
## 0.1.0-rc.8
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 8a832f3: `<sekyro-verification>` draws the Form step with the bundled `@sekyro/react` (planned: no flow can contain it yet).
|
|
24
|
+
- 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.
|
|
25
|
+
- Updated dependencies [1e6001c]
|
|
26
|
+
- Updated dependencies [06d8764]
|
|
27
|
+
- Updated dependencies [1c7c752]
|
|
28
|
+
- Updated dependencies [030c9dc]
|
|
29
|
+
- Updated dependencies [4581cc5]
|
|
30
|
+
- Updated dependencies [1b8395d]
|
|
31
|
+
- Updated dependencies [43ae1ec]
|
|
32
|
+
- Updated dependencies [a63d45e]
|
|
33
|
+
- Updated dependencies [98f6752]
|
|
34
|
+
- Updated dependencies [567f41a]
|
|
35
|
+
- Updated dependencies [a75a33e]
|
|
36
|
+
- Updated dependencies [80fbf3d]
|
|
37
|
+
- @sekyro/web@0.1.0-rc.29
|
|
38
|
+
|
|
39
|
+
## 0.1.0-rc.7
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
44
|
+
|
|
45
|
+
## 0.1.0-rc.6
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- 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`.
|
|
50
|
+
- 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`.
|
|
51
|
+
- 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`.
|
|
52
|
+
- Updated dependencies [94565f2]
|
|
53
|
+
- Updated dependencies [14faf9e]
|
|
54
|
+
- @sekyro/web@0.1.0-rc.28
|
|
55
|
+
|
|
56
|
+
## 0.1.0-rc.5
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 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.
|
|
61
|
+
|
|
62
|
+
## 0.1.0-rc.4
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
67
|
+
- Updated dependencies [707ccc7]
|
|
68
|
+
- @sekyro/web@0.1.0-rc.27
|
|
69
|
+
|
|
70
|
+
## 0.1.0-rc.3
|
|
71
|
+
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
75
|
+
- Updated dependencies [246b0f3]
|
|
76
|
+
- Updated dependencies [cc7eedb]
|
|
77
|
+
- @sekyro/web@0.1.0-rc.26
|
|
78
|
+
|
|
79
|
+
## 0.1.0-rc.2
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Carries the @sekyro/react release of this version: the changes in its changelog reach the element.
|
|
84
|
+
- Updated dependencies [0d23a56]
|
|
85
|
+
- @sekyro/web@0.1.0-rc.25
|
|
86
|
+
|
|
3
87
|
## 0.1.0-rc.1
|
|
4
88
|
|
|
5
89
|
### Minor 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",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-Y6PC7FZV.js";import"./chunk-KHSYTJ46.js";import"./chunk-4FHWXBOB.js";export{o as createBackgroundMonitor};
|
|
@@ -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-HVV5ZEDI-JB4HN6S3.js → camera-trait-V4UAOPIQ-TFCPOCSU.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-KVTY4E6J.js";import"./chunk-4FHWXBOB.js";export{a as bounded,r as cameraHash,e as hex16,o as noteCameraTrait};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a,d as s,e as o,f as r,g as _,h as t,i as A,j as C,k as D,l as p,m as i}from"./chunk-
|
|
1
|
+
import{c as a,d as s,e as o,f as r,g as _,h as t,i as A,j as C,k as D,l as p,m as i}from"./chunk-ZRL6E7XH.js";import"./chunk-SVROKIYG.js";import"./chunk-2FETDQV5.js";import"./chunk-BIK4PGBE.js";import"./chunk-L22GFJQV.js";import"./chunk-6N4AXKCS.js";import"./chunk-P7K7ELYZ.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{i as CAPTURE_CANDIDATE_SPACING_MS,p as CAPTURE_EXTRA_CANDIDATES,C as CaptureSessionDoc,o as DOC_BLACK_FRAME_LUMA,r as DOC_BLACK_FRAME_TICKS,_ as DOC_CADENCE_HZ,s as DOC_FIRST_FRAME_MS,t as DOC_SHUTTER_DEFAULTS,D as passportBandOf,A as resolveDocShutterTuning,a as warmDocDetector};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-4FHWXBOB.js";var k=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),f,o=(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)}},i(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}i(T,"F");function u(){return new o("aborted")}i(u,"c");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)}`}i(S,"C");function v(e){return new URL(e,document.baseURI).origin}i(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 o("challenge_frame_blocked"));e.waiters.clear()}}i(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 o(a,s))}}}i(A,"M");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:i(n=>A(r,n),"listener")};return window.addEventListener("message",r.listener),t.src=e,document.body.appendChild(t),d=r,r}i(L,"k");function R(e,t,r){return e.isReady?Promise.resolve():new Promise((n,l)=>{let a=i(()=>{clearTimeout(c),r?.removeEventListener("abort",s),e.onReady=null},"o"),s=i(()=>{a(),l(u())},"s"),c=setTimeout(()=>{a(),l(new o("challenge_frame_blocked"))},t);r?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{a(),n()}})}i(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 o&&t.readyMs!==void 0&&(r.readyMs??(r.readyMs=t.readyMs)),r}}i(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 o("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 o("timeout")),l),r!==void 0&&(c=i(()=>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)}}i(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)}i(x,"R");async function C(e){if(globalThis.origin==="null")throw new o("embedder_opaque");if(e.signal?.aborted)throw u();try{return await w(e)}catch(t){if(y(),e.signal?.aborted||t instanceof o&&t.code==="aborted")throw u();if(t instanceof o&&t.code==="timeout")throw t;try{return await w(e)}catch(r){throw y(),e.signal?.aborted?u():r instanceof o?r:new o("challenge_failed")}}}i(C,"S");function D(e){let t=i(()=>C(e).catch(n=>{throw n instanceof o&&x(e.frameUrl,n.code),n}),"n"),r=m.then(t,t);return m=r.catch(()=>{}),r}i(D,"T");export{p as CHALLENGE_EXECUTE_TIMEOUT_MS,b as CHALLENGE_READY_TIMEOUT_MS,o as ChallengeError,D as executeChallenge,T as resetChallengeFrameForTests};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{A as Je,F as ue,G as W,H as Qe,I as Xe,J as et,a as I,b as Ue,c as Fe,f as je,g as Ke,h as Be,i as Ve,j as se,k as $e,m as P,o as M,p as O,q as j,r as Z,s as E,t as le,v as He,w as ze,x as Ze,y as We,z as Ye}from"./chunk-574O5HZZ.js";import{f as nt}from"./chunk-X42LECG5.js";import{b as Ge}from"./chunk-6N4AXKCS.js";import{b as qe,c as oe,e as tt}from"./chunk-CW56KMMH.js";import{a as t}from"./chunk-4FHWXBOB.js";function Et(r){return r.idNumberBound??r.nniBound}t(Et,"ae");function rt(r){return r===void 0?void 0:r.idNumberFromDocument??r.nniFromDocument}t(rt,"ee");var ot="https://api.sekyro.ai",Rt=5e3,Nt=24e4,Pt=9e4,Ot=25*6e4,Lt=20*6e4,Dt=3,qt=3e3,Gt=1500,Ut=10;function it(r){return r instanceof Error&&r.name==="ChallengeError"&&r.code||"challenge_failed"}t(it,"St");var at=new Set(["aborted","embedder_opaque","site_key_rejected"]);function Ft(r){return new Promise(l=>setTimeout(l,r))}t(Ft,"un");function jt(){let r=globalThis.crypto;if(r!==void 0&&typeof r.randomUUID=="function")return r.randomUUID();let l=new Uint8Array(16);if(r!==void 0&&typeof r.getRandomValues=="function")r.getRandomValues(l);else for(let f=0;f<16;f+=1)l[f]=Math.floor(Math.random()*256);l[6]=(l[6]??0)&15|64,l[8]=(l[8]??0)&63|128;let p=[...l].map(f=>f.toString(16).padStart(2,"0")).join("");return`${p.slice(0,8)}-${p.slice(8,12)}-${p.slice(12,16)}-${p.slice(16,20)}-${p.slice(20)}`}t(jt,"cn");function Kt(r){return Bt(r,{})}t(Kt,"wo");function Bt(r,l){let p=r.apiOrigin??ot,f=r.autoRetry??!0,dt=r.rearm??"auto",K=l.client??new Fe({apiOrigin:p,sessionToken:r.clientToken,fetch:r.fetch}),y=new Proxy(K,{get(e,n){if(n==="submitCheck")return _t;let i=Reflect.get(e,n,e);return typeof i=="function"?i.bind(e):i}}),D=l.sleep??Ft,pe=l.uuid??jt,pt=l.getChallengeToken??((e,n)=>import("./challenge-frame-YAQJ5YMB-MHZYRGKY.js").then(i=>i.executeChallenge({frameUrl:e.url,siteKey:e.siteKey,action:"liveness",subject:n.subject,signal:n.signal}))),S=tt(),R=null,fe=null,u=!1,me=new AbortController,c=null,B=null,V=null,$=t(()=>V??Qe(c),"ne"),he=t(()=>Xe(W(c),$()),"Re"),b=t(e=>{c=e,!M(e)&&(xe(Lt)||yt(e))&&ie(e),S.emit("view",e),R?.onView(e)},"O"),v=t(()=>c!==null?Promise.resolve(c):(B??(B=y.getSession().then(e=>(b(e),e)).finally(()=>{B=null})),B),"A"),k=t(async()=>{let e=await y.getSession();return b(e),e},"E"),Y=t(async(e,n)=>{e.plan!==void 0?b(e):await k()},"de"),H=null,ye=t(async e=>{let n=await v();if(e||!n.consentRecorded){let i=await y.recordConsent(r.locale);i.plan!==void 0?b(i):c!==null&&b({...c,consentRecorded:!0})}z()&&ie(n)},"Ie"),A=t(e=>e?.force===!0?ye(!0):(H??(H=ye(!1).finally(()=>{H=null})),H),"N"),J={client:y,ensureConsent:t(e=>A(e),"ensureConsent"),sleep:D,uuid:pe,...l.random!==void 0?{random:l.random}:{},onBusy:t(e=>{u||S.emit("busy",e)},"onBusy")},ve=!1,_e=null,Q=t(e=>{if(e.status==="verified"||e.status==="not_verified"||e.status==="review"){if(ve)return;ve=!0}_e=JSON.stringify(e),S.emit("result",e)},"fe"),ft=t(e=>{_e!==JSON.stringify(e)&&Q(e)},"Nt"),ge=t(async e=>{let n=c;e&&(n=await k().catch(()=>c));let i=n===null?null:P(n);return i!==null&&!u&&S.emit("method",i),i!==null},"Ee"),X=null,be=!1,ke=!1,we=t(()=>We(J,(e,n)=>e.submitCheck("population_registry",{},{idempotencyKey:n})),"Ne"),Ae=t(e=>Et(e)===!0||rt(j(e,"population_registry"))===!0,"Fe"),mt=t(async()=>{try{let e=await v();if(M(e)||P(e)!==null||O(e)?.checkType!=="population_registry")return;if(!Ae(e)&&rt(j(e,"population_registry"))===void 0&&(e=await k()),!Ae(e)){ke=!0;return}await A(),await Y(await we(),"population_registry");let n=c===null?void 0:j(c,"population_registry");if(n?.state==="input_required"&&n.reason==="registry_unavailable"&&$e(n)>0){if(await D(Rt),u)return;await Y(await we(),"population_registry")}}catch(e){if(e instanceof I&&(e.code==="check_not_active"||e.code==="step_not_on_path")){await k().catch(()=>{});return}be=!0;return}c!==null&&M(c)&&Q(le(c,{autoRetry:f}))},"Ft"),Ce=t(()=>(X??(X=mt()),X),"He"),w=l.now??Date.now,N=null,q,ee,ht=0,te=t((e,n)=>`${e.url}
|
|
2
|
+
${e.siteKey}
|
|
3
|
+
${n}`,"he"),Me=0,ne,re=t((e,n)=>{Me+=1;let i=w(),s=pt(e,{signal:me.signal,subject:n}),o={key:te(e,n),at:i,token:s};return s.then(()=>{o.issuedAt=w(),ee=void 0},d=>{let m=it(d);if(o.failed=m,u||m==="aborted")return;ee=m;let{detail:h,readyMs:a}=d;G({check:"attestation",kind:"unavailable",engineKind:m,attempt:ht++,challengeMs:w()-i,readyMs:a,detail:h,inApp:Ge()})}),s.catch(()=>{}),o},"ge"),Se=t((e,n)=>e!==null&&e.key===n&&(e.issuedAt===void 0||w()-e.issuedAt<Nt),"De"),ie=t((e,n={})=>{let i=e?.challenge??null;if(e===null||i===null||u)return;let s=Z(e.sessionId),o=N;(n.replaceFailed===!0&&o?.failed!==void 0&&!at.has(o.failed)||!Se(o,te(i,s)))&&(N=re(i,s))},"Se"),Te=t(async(e,n)=>{let i=te(e,n),s=N;N=null;let o=Se(s,i)?s:re(e,n),d=o===s?0:1,m,h=new Promise(a=>{m=setTimeout(()=>a("late"),Pt)});try{for(;;){let a=await Promise.race([o.token.then(_=>({token:_}),_=>({error:it(_)})),h]);if(a==="late")return!u&&N===null&&(N=o),{error:ee??"timeout"};if("token"in a)return ne=Math.max(0,Math.round((o.issuedAt??w())-o.at)),a;if(u||at.has(a.error)||d>=Dt||d>0&&await Promise.race([D(qt*d),h])==="late")return a;if(u)return{error:"aborted"};d+=1,o=re(e,n)}}finally{clearTimeout(m)}},"Ue"),T=null,yt=t(e=>se(e).some(n=>(n.checkType==="phone_otp"||n.checkType==="email_otp")&&n.state!=="passed"&&n.state!=="skipped"),"Lt"),xe=t(e=>T===null||w()-T>=e,"Be"),z=t(()=>xe(Ot),"oe"),vt=t(e=>{let n=e.attestation;return typeof n?.turnstileToken=="string"&&n.turnstileToken.length>0},"Dt"),Ie=new Map,Ee=t(async()=>{let e=await v(),n=e.challenge;if(n==null||e.simulation!==void 0)return;let i=await Te(n,Z(e.sessionId));if(!("token"in i))throw new I({status:400,code:"attestation_invalid",message:`browser check: ${i.error}`});return i.token},"Ge"),_t=t(async(e,n,i={})=>{let s=n;if("attestation"in s)try{let a=await K.submitCheck(e,n,i);return vt(s)&&(T=w()),a}catch(a){throw a instanceof I&&a.code==="attestation_invalid"&&(T=null),a}let o=(e==="phone_otp"||e==="email_otp")&&s.action!=="verify",d=i.idempotencyKey,m=d!==void 0?Ie.get(d):void 0;m===void 0&&(o||z())&&(m=await Ee(),d!==void 0&&m!==void 0&&Ie.set(d,m));let h=t((a,_)=>a!==void 0?{..._,browserCheckToken:a}:_,"w");try{let a=await K.submitCheck(e,n,h(m,i));return m!==void 0&&(T=w()),a}catch(a){if(!(a instanceof I)||a.code!=="attestation_invalid"||(T=null,m!==void 0))throw a;let _=await Ee(),x=d!==void 0?{...i,idempotencyKey:pe()}:i,C=await K.submitCheck(e,n,h(_,x));return _!==void 0&&(T=w()),C}},"Ut"),Re=t(async(e={})=>{if(q=void 0,e.always!==!0&&!z())return{};let n=await v(),i=n.challenge;if(i==null)return{};let s=await Te(i,Z(n.sessionId));if("token"in s)return{channel:"hosted_web",turnstileToken:s.token};if(q=s.error,n.simulation!==void 0)return{channel:"hosted_web"};throw new Ze(s.error)},"Ke"),gt=t(()=>q,"Bt"),bt=t(()=>({checks:Math.min(50,Me),...ne!==void 0?{challengeMs:Math.min(6e5,ne)}:{}}),"qt"),G=t(e=>{if(u)return;let n=y.reportCaptureIssue;if(n===void 0)return;let i=e.formFactor;try{i??(i=qe())}catch{}try{Promise.resolve(n.call(y,{...e,...i!==void 0?{formFactor:i}:{}})).catch(()=>{})}catch{}},"W"),g=null,U=null,Ne=new WeakMap,Pe=Promise.resolve(),F=0,kt=t(async()=>{let e=await v();for(let n=0;n<Ut&&!u&&!M(e)&&O(e)===void 0&&se(e).some(i=>i.state==="processing")&&(await D(Gt),!u);n+=1)e=await k();return e},"Gt"),wt=t(async(e,n,i)=>{let{capture:s}=e,o=t(()=>u,"p"),d=t(()=>e.alive&&e.attempt===i,"k"),m=t(a=>{d()&&s.setFlowState(a)},"C"),h=t(a=>{if(!o()&&(a.status==="unavailable"&&a.reasonCode!==void 0&&!je(a.reasonCode)&&G({check:"liveness",kind:"unavailable",phase:"upload",engineKind:a.reasonCode,attempt:Math.max(0,e.issues.value)}),Q(a),!!d())){if(a.status==="retry"&&dt==="auto"){s.handle.retry();return}s.setFlowState("done")}},"w");if(n.degraded==="NO_RECORDER"){let a=c?.sessionId??(await v().catch(()=>null))?.sessionId??"";h(E(a,"no_recorder"));return}m("uploading");try{if(await Ce(),o())return;let a=await v(),_;if(!M(a)&&P(a)!==null){await ge(!1),h(E(a.sessionId,"method_required"));return}if(!M(a)){if(O(a)?.checkType==="population_registry"){h(E(a.sessionId,ke?"nni_unbound":be?"network":"registry_unavailable"));return}if(await A(),o())return;_=c??a;let x=await Ye({...J,artifacts:n,getAttestation:Re,attestationError:gt,attestationFacts:bt,clipKeys:{get:t(()=>Ne.get(n)??null,"get"),set:t(C=>{Ne.set(n,C)},"set")},getView:t(()=>c??a,"getView"),refreshView:k,applySubmit:Y,onPhase:m,isCancelled:o,onKeyframePromoted:t(C=>{fe=C},"onKeyframePromoted")});if(o())return;if(x.kind==="unavailable"){x.reason==="attestation"&&(U={bound:e,artifacts:n});let C=E(a.sessionId,x.reason),De=x.reason==="attestation"?q:void 0;h(De!==void 0?{...C,attestationError:De}:C);return}if(x.kind==="resync"&&await k(),c!==null&&P(c)!==null){await ge(!1),h(E(a.sessionId,"method_required"));return}a=await kt()}h(le(a,{autoRetry:f,previous:_}))}catch{if(o())return;h(E(c?.sessionId??"","network"))}},"Kt"),Oe=t((e,n)=>{let i=e.attempt;F>0&&e.alive&&e.capture.setFlowState("uploading"),F+=1,Pe=Pe.then(()=>wt(e,n,i)).finally(()=>{F-=1,F===0&&R?.onChainIdle()}).catch(()=>{})},"We"),Le=t(e=>{g?.capture.handle.destroy(),g!==null&&(g.alive=!1);let n=nt(e,R?.captureInternals?.(e)??l.capture,()=>c?.capture?.liveness?.keyframe?.rank===!0,he,()=>c?.capture?.liveness?.screenRamp,{session:t(()=>W(c),"session"),onModeChange:t(o=>{V=o},"onModeChange")}),i={capture:n,alive:!0,attempt:0,issues:Be()};g=i,n.handle.on("error",o=>{G(Ke("liveness",o,i.issues.value))}),n.handle.on("state",o=>{if(i.issues.note(o),o==="starting"){i.attempt+=1,U?.bound===i&&(U=null),z()&&ie(c,{replaceFailed:!0});let d=c===null?void 0:O(c)?.checkType;(d==="liveness"||d==="face_match")&&A().catch(()=>{})}}),n.handle.on("captured",o=>{Promise.resolve().then(()=>Oe(i,o))});let s=n.handle;return{get state(){return s.state},get captureMode(){return s.captureMode},get facingMode(){return s.facingMode},on:t((o,d)=>s.on(o,d),"on"),start:t(async o=>{if(c===null&&await v().catch(()=>{}),!!i.alive)return s.start(o)},"start"),retry:t(()=>{let o=U;if(o!==null&&o.bound===i&&i.alive){U=null,Oe(i,o.artifacts);return}s.retry()},"retry"),switchCamera:t(()=>s.switchCamera(),"switchCamera"),canSwitchCaptureMode:t(()=>s.canSwitchCaptureMode(),"canSwitchCaptureMode"),setCaptureMode:t(o=>s.setCaptureMode(o),"setCaptureMode"),destroy:t(()=>{i.alive=!1,g===i&&(g=null),s.destroy()},"destroy")}},"$e"),At=t(async()=>{if(u)return null;try{let e=await v();return u?null:P(e)}catch{return null}},"jt"),Ct=t(async()=>{if(u)return"self";try{let e=await v();if(u)return"self";let n=W(e);return n==="choice"?$()??n:n}catch{return"self"}},"Yt"),Mt=t(async()=>{if(u)return!1;try{let e=await v();return u||M(e)||oe()?!1:ue(e,O(e))==="phone"||ue(e,j(e,"liveness"))==="phone"}catch{return!1}},"Wt"),St=t(async()=>{if(u)return!1;try{let e=await v();return!u&&e.returning===!0}catch{return!1}},"$t"),Tt=t(async e=>{let n=(await v()).plan?.choice,i=n?.options.find(o=>Ve[o.service]===e);if(!i)throw new RangeError(`method ${String(e)} is not offered`);let s=await y.choose(n.nodeId,i.id);u||b(s)},"Qt"),ae=null,xt=t(()=>(ae??(ae=import("./plan-runner-T2ZTSBI4-SEXJ6KJP.js").then(e=>{let n=e.createPlanRunner({runtime:J,currentView:t(()=>c,"currentView"),cameraMode:he,captureModeSwitch:{pick:$,choose:t(i=>{V=i},"choose")},ensureView:v,refreshView:k,ensureConsent:t(()=>A(),"ensureConsent"),liveness:Le,stopLiveness:t(()=>{g!==null&&(g.alive=!1,g.capture.handle.destroy(),g=null)},"stopLiveness"),chainBusy:t(()=>F>0,"chainBusy"),destroyed:t(()=>u,"destroyed"),sleep:D,isMobile:oe,now:l.now??Date.now,keptFaceKey:t(()=>fe,"keptFaceKey"),setView:b,baseCapture:l.capture,emitStep:t(i=>{u||S.emit("step",i)},"emitStep"),emitResult:ft,reportCaptureIssue:G,documentInternals:l.document,portraitInternals:l.portrait,livePhotoInternals:l.livePhoto,uploadInternals:l.upload,pageCameraInternals:l.pageCamera});return R=n,n})),ae),"Zt");return{consent:t(()=>A(),"consent"),startRegistry:Ce,methodChoice:At,selectMethod:Tt,reportCameraUnavailable:t(async e=>{await A();let n=y.reportCameraUnavailable;if(n===void 0)throw new TypeError("this client cannot report a missing camera");let i=await n.call(y,e).catch(s=>{if(s instanceof I&&s.code==="check_out_of_order")return y.getSession();throw s});u||b(i)},"reportCameraUnavailable"),reportCaptureIssue:G,testerGate:t(async e=>{let n=y.testerGate;if(n===void 0)throw new TypeError("this client cannot run the tester gate");let i=e.clip,s=Ue(e.clipMime??"");if(i===void 0||!ze.includes(s))throw new TypeError("the capture has no clip");await A();let o=await He(y,"clip",s,i.size,{engine:e.engine,durationMs:e.clipMs});await y.uploadToSpaces(o.uploadUrl,i,s);let{key:d}=await y.completeMedia(o.key),m=await Re({always:!0}),h=await n.call(y,{clipKey:d,attestation:m,captureChannel:e.captureChannel,capture:{...Je(e),attestationError:q}}),{bound:a,..._}=h;return u||(_.plan!==void 0?b(_):await k()),{bound:a===!0}},"testerGate"),mobileRequired:Mt,captureMode:Ct,chooseCaptureMode:t(e=>{V=e},"chooseCaptureMode"),get captureChoice(){return $()},returning:St,liveness:Le,run:t(async()=>{if(u)throw new Error("verification destroyed");return(await xt()).run()},"run"),currentStep:t(()=>R?.current()??null,"currentStep"),voiceClips:t(async()=>{if(u)return null;try{let e=await v();return u?null:e.voice??null}catch{return null}},"voiceClips"),on:t((e,n)=>S.on(e,n),"on"),destroy:t(()=>{u=!0,me.abort(),R?.destroy(),g!==null&&(g.alive=!1,g.capture.handle.destroy(),g=null),S.clear()},"destroy")}}t(Bt,"dn");var st=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],lt=["carte_identite","passport","residence_permit","drivers_license"],Vt=["carte_identite","passport","residence_permit"];function ce(r,l){let p=r.byIssuer?.[l]??r.default;return lt.filter(f=>p==="*"?Vt.includes(f):p.includes(f))}t(ce,"fn");function ut(r,l=st){return[...new Set([...l,...Object.keys(r.byIssuer??{})])].filter(p=>ce(r,p).length>0).sort()}t(ut,"Ro");var L={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31"};var yn={full_name:L.fullName,occupation:L.occupation,email:L.email,short_text:L.shortText,long_text:L.longText},ct=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),vn=new Map(Object.entries(ct)),_n=new Map(Object.entries(ct).map(([r,l])=>[l,r]));var gn=10*1024*1024;function ir(r){if(r==="permission")return"denied";if(r==="notfound"||r==="insecure"||r==="unsupported")return"no_camera"}t(ir,"ce");var $t=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,Ht=Object.freeze({normalize:t(r=>r.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:t(r=>$t.test(r),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),zt=/^[A-Z0-9]{4,20}$/,de=t(r=>r.trim().toUpperCase().replace(/[\s-]+/g,""),"m"),Zt=Object.freeze({normalize:de,check:t(r=>zt.test(de(r)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function Wt(r){return typeof r=="string"&&/^\d{10}$/.test(r)&&Number(r)%97===1}t(Wt,"fe");var Yt={trim:t(r=>r.trim(),"trim"),upper_single_space:t(r=>r.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:de},Jt={mr_nni_mod97:t(r=>Wt(r),"mr_nni_mod97")};function Qt(r){let l=new RegExp(r.pattern,"u"),p=r.check===null?void 0:Jt[r.check];return Object.freeze({normalize:Yt[r.normalize],check:t(f=>l.test(f.trim())&&(p===void 0||p(f)),"check"),registrySources:Object.freeze([...r.registrySources]),describe:r.describe})}t(Qt,"Pe");var Xt=Object.freeze(Object.fromEntries(Object.entries(et).map(([r,l])=>[r,Qt(l)])));function en(r,l){return Xt[`${r.toUpperCase()}:${l}`]??(l==="drivers_license"?Zt:Ht)}t(en,"C");var ar=Object.freeze({MRT:"MR"});function or(r){return en("MR","national_id").check(r)}t(or,"Me");function tn(r){let l="";for(let p of r){let f=p.codePointAt(0)??0;f>=1632&&f<=1641?l+=String(f-1632):f>=1776&&f<=1785?l+=String(f-1776):p!==" "&&p!=="-"&&p!==" "&&(l+=p)}return l}t(tn,"H");function sr(r){return tn(r)}t(sr,"He");var lr=ce,ur=ut;var nn=t(()=>import("./create-document-capture-X35M4UAK-BB2SCTPK.js"),"E");function rn(){nn().then(r=>r.warmDocumentCapture()).catch(()=>{})}t(rn,"D");function cr(){rn()}t(cr,"et");var an=t(()=>import("./create-portrait-capture-5VGYZUOK-N3333DJC.js"),"O");function on(){an().then(r=>r.warmPortraitCapture()).catch(()=>{})}t(on,"I");function dr(){on()}t(dr,"at");export{Kt as a,ir as b,or as c,sr as d,lr as e,ur as f,cr as g,dr as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as L,c as K}from"./chunk-6N4AXKCS.js";import{b as D}from"./chunk-CW56KMMH.js";import{a as s}from"./chunk-4FHWXBOB.js";var k,y=(k=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)}},s(k,"c"),k);function R(e,t,n=Math.random){let i=(e??t)*1e3,r=Math.min(Math.max(i,500),2e4),a=Math.round(r*(1+(n()*2-1)*.25));return Math.min(Math.max(a,500),2e4)}s(R,"_");var ne=6e4,U=4,ie=3e4,se=9e5,re=200,ae=5,oe=400,ce=new Set(["server_busy","request_timeout"]),de=2;function v(e){return(e.split(";")[0]??"").trim()}s(v,"l");var ue={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},le=`@sekyro/web/${L}`,pe=le,g,Xe=(g=class{constructor(t){this.sessionId=null,this.bootstrap=null,this.captureNonces=[],this.captureFetch=null,this.reportedIssues=new Map,this.apiOrigin=t.apiOrigin.replace(/\/+$/,""),this.sessionToken=t.sessionToken;let n=t.fetch;this.fetchImpl=(i,r)=>(n??globalThis.fetch).call(globalThis,i,r),this.requestTimeoutMs=t.requestTimeoutMs??ie,this.retryAttempts=t.inProgressRetry?.attempts??ae,this.retryDelayMs=t.inProgressRetry?.delayMs??oe,this.random=t.random??Math.random}async getSession(){let t=await this.api("GET","/hosted/session");return this.sessionId=t.sessionId,t}async recordConsent(t){return this.api("POST","/hosted/consent",{body:{locale:t},busyRetry:!0})}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,r=typeof t.attempt=="number"&&Number.isInteger(t.attempt)&&t.attempt>=0&&t.attempt<=1e3?t.attempt:void 0,a=[t.check,r??"",t.kind,n,t.phase??""].join("|"),c=this.reportedIssues.get(a);if(c!==void 0)return c;let d={check:t.check,kind:t.kind,...n!==""?{name:n}:{},...t.phase!==void 0?{phase:t.phase}:{},...i!==void 0?{engineKind:i}:{},...r!==void 0?{attempt:r}:{},...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}:{}},o=this.api("POST","/hosted/capture-issue",{body:d,empty:!0}).catch(()=>{this.reportedIssues.delete(a)});return this.reportedIssues.set(a,o),o}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,r={}){let a=await this.ensureSessionId(),c={kind:t,contentType:v(n),contentLength:i,...r.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${a}/media`,{body:c})}armCapture(t=2){this.fillCaptureNonces(t)}async presignCapture(t,n,i,r={}){let a=await this.ensureSessionId(),c=await this.takeCaptureNonce(),d=c===void 0?void 0:{nonce:c,...r.engine!==void 0?{engine:r.engine.slice(0,32)}:{},...r.durationMs!==void 0&&Number.isFinite(r.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(r.durationMs)))}:{}},o={kind:t,contentType:v(n),contentLength:i,capture:d};return this.api("POST",`/sessions/${a}/media`,{body:o})}async takeCaptureNonce(){let t=s(()=>{let n=Date.now();return this.captureNonces=this.captureNonces.filter(i=>i.expiresAt-ne>n),this.captureNonces.shift()?.nonce},"e");for(let n=0;n<2;n++){let i=t();if(i!==void 0)return i;await this.fillCaptureNonces(1)}return t()}fillCaptureNonces(t){return this.captureFetch??(this.captureFetch=(async()=>{try{let n=await this.ensureSessionId(),i=await this.api("POST",`/sessions/${n}/media/capture-nonces`,{body:{count:Math.min(U,Math.max(1,t))}}),r=Date.now()+Math.max(0,i.expiresIn)*1e3;for(let a of Array.isArray(i.nonces)?i.nonces:[])typeof a=="string"&&a.length>0&&this.captureNonces.push({nonce:a,expiresAt:r});this.captureNonces=this.captureNonces.slice(-U)}catch{}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(t,n,i){let r;try{r=await this.fetchImpl(t,{method:"PUT",headers:{"content-type":v(i)},body:n,signal:AbortSignal.timeout(se)})}catch(a){throw N(a)}if(!r.ok){let a=(await r.text().catch(()=>"")).slice(0,re);throw new y({status:r.status,code:"upload_failed",message:`media upload failed (HTTP ${r.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 r=await this.ensureSessionId(),a={input:n,forceOutcome:i.forceOutcome};return this.api("POST",`/sessions/${r}/checks/${t}`,{body:a,idempotencyKey:i.idempotencyKey,...i.browserCheckToken!==void 0?{browserCheckToken:i.browserCheckToken}:{},busyRetry:i.idempotencyKey!==void 0})}async uploadAndSubmit(t,n,i,r={}){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,[ue[t]]:d.key};return this.submitCheck(t,o,r)}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 r=t==="GET"||i.busyRetry===!0,a=`${this.apiOrigin}/api/v2${n}`,c={"x-session-token":this.sessionToken,"x-sekyro-sdk":pe};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);try{let d=K.timezone();d!==void 0&&(c["sekyro-client-timezone"]=d)}catch{}c["sekyro-client-form-factor"]=D();try{let d=await K.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(f){throw N(f)}if(o.ok){if(i.empty===!0)return;if(i.blob===!0)try{return await o.blob()}catch(l){throw N(l)}let f;try{f=await o.json()}catch{throw new y({status:o.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${o.status})`})}return he(f)}let u=await fe(o);if(u.code==="idempotency_in_progress"&&d<this.retryAttempts){this.retryDelayMs>0&&await V(this.retryDelayMs);continue}if(r&&u.status===503&&ce.has(u.code)){r=!1,await V(R(u.retryAfterSeconds,de,this.random));continue}throw u}}},s(g,"g"),g);function G(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=6e5}s(G,"T");function N(e){if((typeof e=="object"&&e!==null?e.name:void 0)==="TimeoutError")return new y({status:0,code:"timeout",message:"request timed out"});let t=e instanceof Error?e.message:String(e);return new y({status:0,code:"network_error",message:`network request failed: ${t}`})}s(N,"m");function he(e){return e!==null&&typeof e=="object"&&"success"in e&&"data"in e?e.data:e}s(he,"x");async function fe(e){let t="unknown_error",n=`request failed (HTTP ${e.status})`,i=Number.NaN,r;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)?r=o.details:Array.isArray(o.details?.errors)&&(r={...o.details,issues:[]})}}catch{}let a=e.headers.get("retry-after"),c=a===null?Math.floor(i):Number.parseInt(a,10);return new y({status:e.status,code:t,message:n,...Number.isFinite(c)&&c>=0?{retryAfterSeconds:c}:{},details:r})}s(fe,"D");function V(e){return new Promise(t=>setTimeout(t,e))}s(V,"k");function Ye(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"}}s(Ye,"j");function et(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}:{}}}s(et,"B");var me=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function st(e){return me.has(e)}s(st,"be");function rt(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))}}s(rt,"ve");function at(){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}}}s(at,"Pe");var ye={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function m(e){return e.plan?.steps??[]}s(m,"f");function F(e){return Math.max(0,e.attempts.max-e.attempts.used)}s(F,"x");function _e(e){let t=e.plan?.choice;return t!==void 0&&e.plan?.current===t.nodeId?t:null}s(_e,"W");function ot(e){let t=_e(e);if(t?.kind!=="identity_method")return null;let n=t.options.map(r=>ye[r.service]).filter(r=>r!==void 0),i=t.options.find(r=>r.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:n,nationalEid:i}:{available:!0,selected:null,options:n}}s(ot,"Me");var ve=new Set(["liveness","face_match"]);function z(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}s(z,"y");function ke(e){return e.status!=="created"&&e.status!=="in_progress"}s(ke,"T");function Z(e){let t=e.plan?.current,n=t==null?void 0:m(e).find(i=>i.id===t);return z(n)?n:void 0}s(Z,"M");function $(e,t){return m(e).find(n=>n.checkType===t)}s($,"_");function P(e){let t=m(e),n=t.findIndex(i=>i.checkType==="liveness");return t.find((i,r)=>r>n&&i.checkType==="face_match")}s(P,"S");function ge(e,t){let n=$(t,"liveness")?.state,i=P(t)?.state;return(P(e)?.state??"pending")==="pending"&&(n==="passed"||n==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}s(ge,"F");function B(e,t){let n=new Map(m(e).map(i=>[i.id,i.state]));return m(t).filter(i=>i.checkType==="face_match"&&(n.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}s(B,"V");var be=/^[0-9a-f]{24}$/i;function E(e){return be.test(e)?`ses_${e}`:e}s(E,"R");function x(e,t){let n=E(e);return t===void 0?{sessionId:n,status:"unavailable"}:{sessionId:n,status:"unavailable",reasonCode:t}}s(x,"w");function Q(e,t,n){let i=E(e);return n===void 0?{sessionId:i,status:t}:{sessionId:i,status:t,reasonCode:n}}s(Q,"O");function ct(e,t){let n=Se(e,t),i=Me(e);return i!==void 0&&(n.sandbox={simulated:!0,reason:i}),n}s(ct,"Ve");var we=new Set(["no_testers","tester_gate_not_used","tester_gate_missed"]);function Me(e){if(e.sandbox!==!0)return;let t=e.simulation?.reason;return we.has(t)?t:void 0}s(Me,"Q");function Se(e,t){let n=E(e.sessionId);switch(e.status){case"created":case"in_progress":return Ee(e,t);case"verified":return O(e,{sessionId:n,status:"verified"});case"review_pending":return O(e,Q(n,"review",W(e,"review")));case"not_verified":return O(e,Te(e));default:return O(e,{sessionId:n,status:"not_verified"})}}s(Se,"Z");var Ie=new Set([0,1,2,3]);function O(e,t){return Ie.has(e.level)&&(t.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(t.assurance=e.assurance),t}s(O,"b");function Te(e){let t={sessionId:E(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}s(Te,"ne");function Ce(e){return e==="rejected"?"rejected":e==="unavailable"?"unavailable":"inconclusive"}s(Ce,"te");function Ae(e,t){if(t===void 0)return!1;let n=m(t).find(i=>i.id===e.id);return n!==void 0&&n.attempts.used===e.attempts.used}s(Ae,"ie");function Ee(e,t){let n=E(e.sessionId),i=m(e).find(a=>ve.has(a.checkType)&&a.state==="input_required"&&a.reason!==void 0);if(i?.reason==="mobile_required")return x(n,"mobile_required");if(i?.reason!==void 0){if(i.result==="unavailable")return x(n,i.reason);let a=t.autoRetry&&(F(i)>0||Ae(i,t.previous))?{sessionId:n,status:"retry",reasonCode:i.reason,attemptsRemaining:F(i)}:{sessionId:n,status:"not_verified",reason:Ce(i.result),reasonCode:i.reason,attemptsRemaining:F(i)};return i.retakeHint!==void 0&&(a.retakeHint=i.retakeHint),a}let r=Z(e);return r===void 0&&m(e).some(a=>a.state==="review")?Q(n,"review",W(e,"review")):r?.checkType==="portrait_icao"?x(n,"portrait_required"):x(n)}s(Ee,"re");function W(e,t){return m(e).find(n=>n.state===t&&n.reason!==void 0)?.reason}s(W,"L");function X(e,t,n,i,r){return e.presignCapture!==void 0?e.presignCapture(t,n,i,r):e.presign(t,n,i)}s(X,"K");function Y(e){return{engine:e?.engine,durationMs:e?.clipMs}}s(Y,"q");var xe=["video/webm","video/mp4"],J="image/jpeg",Oe=2,Pe=1e3,$e=1e4,qe=3,Ke=10,Ne=3,Re=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),Fe=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"]),b,H=(b=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}},s(b,"k"),b);function je(e){let t=P(e);return $(e,"portrait_icao")?.state!=="pending"&&(t!==void 0?z(t):e.capture?.livePhoto?.oneCapture===!0)}s(je,"me");var w,A=(w=class extends Error{constructor(t){super(t),this.name="AttestationError"}},s(w,"h"),w),M,ze=(M=class extends A{constructor(t){super(`no attestation token: ${t}`),this.name="AttestationUnavailableError",this.code=t}},s(M,"E"),M);async function ee(e,t,n={}){let i=e.uuid(),r=!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 ze)throw o;a=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(!(o instanceof y))throw o;if(o.code==="consent_required"&&!r){r=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(o.code==="attestation_invalid"&&!a){a=!0,n.onAttestationInvalid?.(),i=e.uuid();continue}if(o.code==="inference_unavailable"&&d<qe){d+=1;let u=R(o.retryAfterSeconds,Ke,e.random??Math.random);e.onBusy?.({attempt:d,retryAfterSeconds:u/1e3}),await e.sleep(u),n.onAttestationInvalid?.(),i=e.uuid();continue}if(Re.has(o.code)&&c<Oe){c+=1;let u=o.retryAfterSeconds!==void 0?o.retryAfterSeconds*1e3:void 0;await e.sleep(u!==void 0?Math.min(u,$e):Pe);continue}throw o}}s(ee,"D");var He=new Set(["passed","review","processing","skipped"]);async function dt(e){let{artifacts:t}=e,n=t.clip,i=v(t.clipMime??"");if(t.degraded==="NO_RECORDER"||n===void 0||!xe.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let r=De(e,t.keyframe),a=Le(e,n,i,r),c=Ue(e,r),d=!1,o=new Set,u=!0,f=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let l=e.getView();if(ke(l))return{kind:"settled"};let p=Z(l),C=p?.checkType,q=C==="liveness"&&!d?"liveness":C==="face_match"&&!o.has(p?.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 h=await a();if(e.isCancelled())return{kind:"cancelled"};ge(l,h)&&o.add(P(h)?.id);for(let te of B(l,h))o.add(te);await e.applySubmit(h,"liveness");let _=$(e.getView(),"liveness")?.state;u=_===void 0||He.has(_)}else{o.add(p?.id);let h=await c();if(e.isCancelled())return{kind:"cancelled"};for(let _ of B(l,h))o.add(_);await e.applySubmit(h,"face_match")}}catch(h){if(e.isCancelled()||h instanceof H)return{kind:"cancelled"};let _=Je(h);if(_.kind!=="resync"||f>=Ne)return _;f+=1,await e.refreshView()}}}s(dt,"Fe");function De(e,t){let n=null,i=null,r=s(()=>n!==null?Promise.resolve(n):(i??(i=(async()=>{let a=await X(e.client,"image",J,t.size,Y(e.artifacts));return await e.client.uploadToSpaces(a.uploadUrl,t,J),n=(await e.client.completeMedia(a.key)).key,e.onKeyframePromoted?.(n),n})().finally(()=>{i=null})),i),"r");return{ensure:r,attempt:s(()=>r().catch(()=>null),"attempt"),current:s(()=>n,"current")}}s(De,"_e");function Le(e,t,n,i){let r=e.clipKeys?.get()??null,a,c=null,d=0,o;return()=>ee(e,async(u,f)=>{if(r===null||a===void 0){if(e.isCancelled())throw new H;a===void 0&&!je(e.getView())&&(a=null),e.onPhase("uploading");let[l,p]=await Promise.all([r!==null?Promise.resolve(r):(async()=>{let C=await X(u,"clip",n,t.size,Y(e.artifacts));return await u.uploadToSpaces(C.uploadUrl,t,n),(await u.completeMedia(C.key)).key})(),a!==void 0?Promise.resolve(a===null?null:a.imageKey):i.attempt()]);r=l,e.clipKeys?.set(l),a===void 0&&(a=p===null?null:{imageKey:p})}if(c===null){let l=performance.now();try{c=await e.getAttestation(),o=e.attestationError?.()}catch(p){throw p instanceof A?p:new A(p instanceof Error?p.message:String(p))}d=Math.round(performance.now()-l)}return e.onPhase("checking"),u.submitCheck("liveness",{clipKey:r,attestation:c,captureChannel:e.artifacts.captureChannel,capture:{...Ge(e.artifacts),attestationMs:d,attestationError:o,...Be(e.attestationFacts?.())},...a!==null?{faceMatch:a}:{}},{idempotencyKey:f})},{onAttestationInvalid:s(()=>{c=null},"onAttestationInvalid")})}s(Le,"ge");function Ue(e,t){return()=>ee(e,async(n,i)=>{if(t.current()===null){if(e.isCancelled())throw new H;e.onPhase("uploading")}let r=await t.ensure();return e.onPhase("checking"),n.submitCheck("face_match",{imageKey:r},{idempotencyKey:i})})}s(Ue,"Se");function Ge(e){let t={width:e.width,height:e.height};for(let n of Ve)e[n]!==void 0&&(t[n]=e[n]);return t}s(Ge,"ye");var Ve=["engine","facingMode","mode","formFactor","clipMs","clipFrames","fps","clipRetakes","codec","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function Be(e){return e===void 0?{}:{attestationChecks:e.checks,...e.challengeMs!==void 0?{attestationChallengeMs:e.challengeMs}:{}}}s(Be,"ke");function Je(e){if(e instanceof A)return{kind:"unavailable",reason:"attestation"};if(e instanceof y){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(Fe.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}s(Je,"Ce");var ut="form_answers_invalid",S,lt=(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}},s(S,"U"),S),I,pt=(I=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="InvalidInputError",this.field=t,this.kind=n}},s(I,"B"),I),T,ht=(T=class extends Error{constructor(t,n){super(`invalid ${t} (${n})`),this.name="OtpInputError",this.field=t,this.kind=n}},s(T,"$"),T);function j(e){return e?.source==="upload"?null:e?.source==="choice"&&e.sourcePick!=="camera"?"upload_or_phone":"phone"}s(j,"I");function ft(e,t){if(t===void 0||!z(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 j(e.documents);case"poa":return j(e.proofOfAddress);case"portrait_icao":{let n=e.portrait;return n?.pendingFix!==void 0||n?.reuse?.pending===!0?null:j(n)}default:return null}}s(ft,"De");function Ze(e){let t=e?.capture,n=t?.mode;return n==="assisted"||n==="self"||n==="choice"?n:t?.cameraSwitch===!0?"assisted":"self"}s(Ze,"we");function mt(e){let t=e?.capture?.pick;return Ze(e)==="choice"&&(t==="self"||t==="assisted")?t:null}s(mt,"Be");function yt(e,t,n=null){return e==="choice"?t??n??"self":e}s(yt,"$e");var _t={"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{y as a,v as b,Xe as c,Ye as d,et as e,st as f,rt as g,at as h,ye as i,m as j,F as k,_e as l,ot as m,z as n,ke as o,Z as p,$ as q,E as r,x as s,ct as t,Me as u,X as v,xe as w,ze as x,ee as y,dt as z,Ge as A,ut as B,lt as C,pt as D,ht as E,ft as F,Ze as G,mt as H,yt as I,_t as J};
|