@sekyro/elements 0.1.0-rc.19 → 0.1.0-rc.20
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 +13 -0
- package/dist/cdn/chunks/capture-session-doc-HIN3YZG2-ZOYOVMIF.js +1 -0
- package/dist/cdn/chunks/{chunk-3PBU4237.js → chunk-2GVFM77I.js} +2 -2
- package/dist/cdn/chunks/{chunk-WANVL25H.js → chunk-32CNXSJQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-L66SWMJ5.js → chunk-677IJRH3.js} +1 -1
- package/dist/cdn/chunks/chunk-BMTTAXWY.js +25 -0
- package/dist/cdn/chunks/{chunk-EPMGZQHF.js → chunk-BO327WCQ.js} +1 -1
- package/dist/cdn/chunks/chunk-BWOTZKA7.js +1 -0
- package/dist/cdn/chunks/{chunk-EXMVZUHU.js → chunk-CYEDFGUG.js} +1 -1
- package/dist/cdn/chunks/{chunk-RTCZJKYC.js → chunk-FQHV53QQ.js} +1 -1
- package/dist/cdn/chunks/chunk-FZP5NLDQ.js +1 -0
- package/dist/cdn/chunks/chunk-HOBGJOBT.js +1 -0
- package/dist/cdn/chunks/{chunk-ZWP6MDIC.js → chunk-HPTNANWX.js} +1 -1
- package/dist/cdn/chunks/{chunk-CGOCWIXM.js → chunk-K67DQTFL.js} +1 -1
- package/dist/cdn/chunks/{chunk-PAU2BFT7.js → chunk-L7I27OCG.js} +1 -1
- package/dist/cdn/chunks/{chunk-WCEIXBIS.js → chunk-LHYSCL4T.js} +1 -1
- package/dist/cdn/chunks/chunk-MINBJAVX.js +1 -0
- package/dist/cdn/chunks/chunk-MXMEO2IW.js +1 -0
- package/dist/cdn/chunks/{chunk-IXRKOBFA.js → chunk-PZVVXMQ6.js} +1 -1
- package/dist/cdn/chunks/chunk-RH466MDF.js +3 -0
- package/dist/cdn/chunks/{chunk-HXD7VO3F.js → chunk-U7QPOSFH.js} +1 -1
- package/dist/cdn/chunks/{chunk-6H2SLOEK.js → chunk-X6LDVTUQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-K2JDLIFO.js → chunk-Z6OYPC4S.js} +1 -1
- package/dist/cdn/chunks/chunk-ZJNLNYA5.js +1 -0
- package/dist/cdn/chunks/{create-document-capture-4ZOSBL3Y-KLZDMWOQ.js → create-document-capture-Z3UK34XH-J7HHUVQU.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-NI4452T4-UL6ELWE6.js +1 -0
- package/dist/cdn/chunks/{eid-view-6DXZ5ELB-ZX35JGDS.js → eid-view-GAIQODI5-AH3LJYP4.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-3UJPJOQ6-MIOPWSME.js → email-otp-view-SM2POPMA-XEEHDST5.js} +1 -1
- package/dist/cdn/chunks/{flow-views-ZVDXJZWH-C5ZVKCB6.js → flow-views-NBUWHG7J-HB57IJYX.js} +1 -1
- package/dist/cdn/chunks/{form-view-4NKEHYNF-I25LMP47.js → form-view-GOFXOQJO-6K34NRBN.js} +1 -1
- package/dist/cdn/chunks/overlay-de-YLCWZB42-REI3GVKV.js +1 -0
- package/dist/cdn/chunks/overlay-es-YIPBOMXT-5DHSESGX.js +1 -0
- package/dist/cdn/chunks/overlay-pt-JSDCAYVA-MQHVGOHK.js +1 -0
- package/dist/cdn/chunks/plan-runner-JSLWPJ6D-7PE72QOP.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-QDUJ36UH-GRTZTYTJ.js → portrait-capture-view-TTUVVA7L-ENQSXXXH.js} +1 -1
- package/dist/cdn/chunks/{portrait-review-view-LW5DBF3L-K7WAOPAG.js → portrait-review-view-BCIENGKR-SHYX5FRE.js} +1 -1
- package/dist/cdn/chunks/{proof-of-address-view-E6WJTTIV-7ISFWEEZ.js → proof-of-address-view-SS2TIV3D-GFY3THLT.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-BRS7YLGB.js → chunk-2TOYHI7F.js} +1 -1
- package/dist/{chunk-VBJ4CJHE.js → chunk-2ZWLZDO2.js} +1 -1
- package/dist/{chunk-QNK7OBIW.js → chunk-3NYC5YLB.js} +1 -1
- package/dist/chunk-3T7JA7T7.js +1 -0
- package/dist/{chunk-SVGBNMXK.js → chunk-47ELGOCA.js} +1 -1
- package/dist/{chunk-KYDIB6KR.js → chunk-7FYJ4XL4.js} +1 -1
- package/dist/{chunk-CY66YE6F.js → chunk-AUISCZAL.js} +1 -1
- package/dist/{chunk-7XJHQ3NM.js → chunk-GXENE4GQ.js} +1 -1
- package/dist/{chunk-5QJOJLKJ.js → chunk-HRJ5PESP.js} +1 -1
- package/dist/{chunk-RPA5QQVH.js → chunk-IYLMNTY5.js} +2 -2
- package/dist/chunk-TBECC5OK.js +1 -0
- package/dist/{chunk-PKK72TVJ.js → chunk-UJM3T4QD.js} +1 -1
- package/dist/{chunk-6FAODASF.js → chunk-V4USJ5ZA.js} +1 -1
- package/dist/chunk-XXCBLQ53.js +1 -0
- package/dist/chunk-YUZW7NSK.js +25 -0
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/document-capture-view-NI4452T4-VZHREVJN.js +1 -0
- package/dist/{eid-view-6DXZ5ELB-XDQVFDXS.js → eid-view-GAIQODI5-KCEO3AZS.js} +1 -1
- package/dist/{email-otp-view-3UJPJOQ6-5PQM7LNW.js → email-otp-view-SM2POPMA-O7WM3ZEZ.js} +1 -1
- package/dist/{flow-views-ZVDXJZWH-LOGNCRIA.js → flow-views-NBUWHG7J-PO2CMTIF.js} +1 -1
- package/dist/{form-view-4NKEHYNF-VFMN6QFW.js → form-view-GOFXOQJO-CRQWOLQA.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/overlay-de-YLCWZB42-XINMWIXZ.js +1 -0
- package/dist/overlay-es-YIPBOMXT-MS7EN5ZX.js +1 -0
- package/dist/overlay-pt-JSDCAYVA-27WQ3BLB.js +1 -0
- package/dist/{portrait-capture-view-QDUJ36UH-QZR4O3YW.js → portrait-capture-view-TTUVVA7L-6BGZEV6C.js} +1 -1
- package/dist/{portrait-review-view-LW5DBF3L-QVERJXKH.js → portrait-review-view-BCIENGKR-WZ7GCBEX.js} +1 -1
- package/dist/{proof-of-address-view-E6WJTTIV-4SHZIQ3O.js → proof-of-address-view-SS2TIV3D-C6YD4BRC.js} +1 -1
- package/dist/styles.css +2 -0
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/capture-session-doc-DFLSX6BB-3ULMTYJH.js +0 -1
- package/dist/cdn/chunks/chunk-2TFK736S.js +0 -1
- package/dist/cdn/chunks/chunk-4VHWJD57.js +0 -1
- package/dist/cdn/chunks/chunk-AC45ZP53.js +0 -1
- package/dist/cdn/chunks/chunk-D7YINY2U.js +0 -3
- package/dist/cdn/chunks/chunk-JR4AQLJ2.js +0 -1
- package/dist/cdn/chunks/chunk-LUO3AZFS.js +0 -1
- package/dist/cdn/chunks/chunk-PLWGAXYM.js +0 -25
- package/dist/cdn/chunks/chunk-YULJCSQ3.js +0 -1
- package/dist/cdn/chunks/document-capture-view-25EASYV7-EUEYS55L.js +0 -1
- package/dist/cdn/chunks/overlay-de-64ABPD3N-KIBBQI36.js +0 -1
- package/dist/cdn/chunks/overlay-es-VIMXYK2Q-KTLONTNF.js +0 -1
- package/dist/cdn/chunks/overlay-pt-3IBDZBAW-DQTJHDLG.js +0 -1
- package/dist/cdn/chunks/plan-runner-3BLEJWHF-3K3RBXJU.js +0 -1
- package/dist/chunk-57MVUXQ6.js +0 -25
- package/dist/chunk-M7HNWDQD.js +0 -1
- package/dist/chunk-XQPY6G2B.js +0 -1
- package/dist/chunk-YZ6YGLNN.js +0 -1
- package/dist/document-capture-view-25EASYV7-MOFQVGV6.js +0 -1
- package/dist/overlay-de-64ABPD3N-ARJE63WR.js +0 -1
- package/dist/overlay-es-VIMXYK2Q-JRHIX3OT.js +0 -1
- package/dist/overlay-pt-3IBDZBAW-JXQE6BVY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as He,l as Ze}from"./chunk-FZP5NLDQ.js";import"./chunk-IWZRAEUN.js";import"./chunk-YZWLMKXA.js";import{e as We}from"./chunk-MINBJAVX.js";import{m as he,n as $e}from"./chunk-HOBGJOBT.js";import"./chunk-F4Q2Q4OC.js";import{e as Ge}from"./chunk-5JSOPXYS.js";import"./chunk-IO7MUUC6.js";import"./chunk-Q5ZVLMKQ.js";import"./chunk-L244IUB3.js";import"./chunk-Y6PC7FZV.js";import"./chunk-KHSYTJ46.js";import"./chunk-L22GFJQV.js";import{A as Oe,D as Ve,E as me,F as W,G as se,H as De,I as Be,K as Ue,L as ze,a as $,d as ie,e as ae,g as ue,h as Se,i as oe,j as Ce,k as Pe,l as Ie,n as Ee,o as pe,q as le,r as fe,t as Re,u as je,v as X,z as Ne}from"./chunk-PZVVXMQ6.js";import"./chunk-32CNXSJQ.js";import{a as de}from"./chunk-U7QPOSFH.js";import{b as Le,c as Ke,d as qe}from"./chunk-P7K7ELYZ.js";import{m as Fe}from"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-SLLJX5QK.js";import{a as r}from"./chunk-4FHWXBOB.js";var te={fp12:"936b9c4ccc4a",engine:"sekyro-ocr-1",precision:"fp32",files:{"sekyro-ocr.wasm":{bytes:3550687,sha256:"00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09",tier:"live",contentType:"application/wasm"},"sekyro-ocr.mjs":{bytes:4270,sha256:"209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac",tier:"bundled",contentType:"text/javascript"},"det.param":{bytes:24252,sha256:"c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3",tier:"live",contentType:"text/plain"},"det.bin":{bytes:4685856,sha256:"652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb",tier:"live",contentType:"application/octet-stream"},"mrz-rec.param":{bytes:3510,sha256:"bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01",tier:"live",contentType:"text/plain"},"mrz-rec.bin":{bytes:494196,sha256:"de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae",tier:"live",contentType:"application/octet-stream"},"mrz_dict.txt":{bytes:73,sha256:"b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f",tier:"live",contentType:"text/plain"},"v5-latin-fp16.param":{bytes:19800,sha256:"843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-latin-fp16.bin":{bytes:3995900,sha256:"0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90",tier:"lazy",group:"latin",contentType:"application/octet-stream"},"latin.dict.txt":{bytes:2615,sha256:"c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-arabic-fp16.param":{bytes:19791,sha256:"1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-arabic-fp16.bin":{bytes:3974364,sha256:"4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1",tier:"lazy",group:"arabic",contentType:"application/octet-stream"},"arabic.dict.txt":{bytes:2368,sha256:"8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-cyrillic-fp16.param":{bytes:19806,sha256:"c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-cyrillic-fp16.bin":{bytes:3999288,sha256:"97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa",tier:"lazy",group:"cyrillic",contentType:"application/octet-stream"},"cyrillic.dict.txt":{bytes:2780,sha256:"2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-greek-fp16.param":{bytes:19815,sha256:"1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-greek-fp16.bin":{bytes:3879256,sha256:"04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3",tier:"lazy",group:"greek",contentType:"application/octet-stream"},"greek.dict.txt":{bytes:1102,sha256:"60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-devanagari-fp16.param":{bytes:19807,sha256:"c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-devanagari-fp16.bin":{bytes:3931044,sha256:"d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828",tier:"lazy",group:"devanagari",contentType:"application/octet-stream"},"devanagari.dict.txt":{bytes:1942,sha256:"c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-thai-fp16.param":{bytes:19786,sha256:"4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-thai-fp16.bin":{bytes:3920396,sha256:"3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079",tier:"lazy",group:"thai",contentType:"application/octet-stream"},"thai.dict.txt":{bytes:1766,sha256:"e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-hangul-fp16.param":{bytes:19804,sha256:"8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c",tier:"lazy",group:"hangul",contentType:"text/plain"},"v5-hangul-fp16.bin":{bytes:6684280,sha256:"1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4",tier:"lazy",group:"hangul",contentType:"application/octet-stream"},"hangul.dict.txt":{bytes:47450,sha256:"a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb",tier:"lazy",group:"hangul",contentType:"text/plain"}},scripts:{latin:{classes:838,rtl:!1,param:"v5-latin-fp16.param",bin:"v5-latin-fp16.bin",dict:"latin.dict.txt"},arabic:{classes:749,rtl:!0,param:"v5-arabic-fp16.param",bin:"v5-arabic-fp16.bin",dict:"arabic.dict.txt"},cyrillic:{classes:852,rtl:!1,param:"v5-cyrillic-fp16.param",bin:"v5-cyrillic-fp16.bin",dict:"cyrillic.dict.txt"},greek:{classes:356,rtl:!1,param:"v5-greek-fp16.param",bin:"v5-greek-fp16.bin",dict:"greek.dict.txt"},devanagari:{classes:570,rtl:!1,param:"v5-devanagari-fp16.param",bin:"v5-devanagari-fp16.bin",dict:"devanagari.dict.txt"},thai:{classes:526,rtl:!1,param:"v5-thai-fp16.param",bin:"v5-thai-fp16.bin",dict:"thai.dict.txt"},hangul:{classes:11947,rtl:!1,param:"v5-hangul-fp16.param",bin:"v5-hangul-fp16.bin",dict:"hangul.dict.txt"}}};var Rn=Object.keys(te.files).filter(e=>te.files[e].tier==="live"),jn=Object.keys(te.files).filter(e=>te.files[e].tier==="lazy");function Je(e,t){return e==="hosted"?"/models-ocr":t==="live"?"https://assets.sekyro.ai/sdk/web/ocr":"https://assets-staging.sekyro.ai/sdk/web/ocr"}r(Je,"E");var wt=["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"],kt=["carte_identite","passport","residence_permit","drivers_license"],xt=["carte_identite","passport","residence_permit"];function _e(e,t){let n=e.byIssuer?.[t]??e.default;return kt.filter(a=>n==="*"?xt.includes(a):n.includes(a))}r(_e,"dt");function it(e,t=wt){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(n=>_e(e,n).length>0).sort()}r(it,"Ln");function Mt(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}r(Mt,"Le");var Tt=640,At=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),Qe=6,Ye=1500,Xe={sharpness:1,exposure:1,meanLuma:128},ye=null;function St(e,t){try{ye??(ye=document.createElement("canvas"));let n=ye,a=96/Math.max(1,t.width);n.width=Math.max(1,Math.round(t.width*a)),n.height=Math.max(1,Math.round(t.height*a));let i=n.getContext("2d");if(i===null)return Xe;i.drawImage(e,t.x,t.y,t.width,t.height,0,0,n.width,n.height);let l=i.getImageData(0,0,n.width,n.height);return{sharpness:Ke(l),exposure:qe(l),meanLuma:Le(l)}}catch{return Xe}}r(St,"ft");async function Ct(e,t){let n=e.source;return"convertToBlob"in n?n.convertToBlob({type:"image/jpeg",quality:t}):new Promise((a,i)=>{n.toBlob(l=>l===null?i(new Error("encode failed")):a(l),"image/jpeg",t)})}r(Ct,"mt");function at(e,t={}){let n=t.now??(()=>performance.now()),a=t.setTimer??((f,x)=>setTimeout(f,x)),i=t.clearTimer??(f=>clearTimeout(f)),l=t.encode??Ct,s=t.quality??St,c=e.tuningVersion??null,y=new Set,v=!1,m=e.video??null,b=null,p=t.grabFrame??null,w=null,T=1e3/Qe,S=null,z=null,I=!1,O=!1,U=Number.NEGATIVE_INFINITY,N=null,Z=0,g=null,A=null,K=Promise.all([import("./icao-gate-T3BTOKFJ-BWMLKL7A.js"),import("./icao-tuning-4ETMF53W-FRBTB5R7.js"),import("./create-portrait-capture-5VGYZUOK-KTCFCHTN.js"),import("./landmarker-KB7LVXAU-F7BQTP3H.js"),import("./background-monitor-A7FKJOAG-K3WF3C2D.js")]).then(async([f,x,C,M,E])=>{let R=x.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);R.background.required&&(z=E.createBackgroundMonitor({tuning:R.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:n})),b=f.createIcaoGate(R,{policy:e.policy??"reject"}),p??(p=C.defaultGrabber()),w=C.observe,T=1e3/Math.min(Qe,R.cadenceHz);let L=(t.createLandmarker??M.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),j=await new Promise((o,d)=>{let u=setTimeout(()=>{d(new Error("landmarker init timeout")),L.then(h=>h.close(),()=>{})},M.LANDMARKER_INIT_TIMEOUT_MS);L.then(h=>{clearTimeout(u),o(h)},h=>{clearTimeout(u),d(h)})});v?j.close():S=j}).catch(()=>{I=!0}),V=r(f=>{for(let x of y)x({holding:O||I,update:f})},"Z"),P=r(()=>{if(N=null,!(v||S===null||b===null||p===null||w===null||m===null)){if(n()-U>Ye){V(null);return}try{let f=p(m,Tt);if(f!==null){let x=Math.max(n(),Z+1);Z=x;let C=S.detect(f.source,x),M=m.videoWidth||f.width,E=m.videoHeight||f.height,R=w(C,f,M,E);R.geometry!==null&&z!==null&&(R.backgroundCheck=z.measure(f,R.geometry.box,M,E));let L=b.push(R,n());O=L.ready,V(L)}}catch{}N=a(P,T)}},"G"),D=r(()=>{let f=n()-U>Ye;U=n(),f&&(b?.reset(),O=!1,g=null,A=null),N===null&&S!==null&&!v&&(N=a(P,0))},"ne"),H=r(()=>{let f=p===null||m===null?null:p(m,null);if(f===null||b===null||Math.max(f.width,f.height)<e.still.minLongSidePx)return Promise.resolve(null);let x=b.summary();return l(f,e.still.jpegQuality).then(C=>({image:C,width:f.width,height:f.height,gate:x}),()=>null)},"W"),_=null;return{engineOptions:{measureQuality:r((f,x)=>{m=f,D();let C=s(f,x);return O||I?C:{...C,sharpness:0}},"measureQuality"),telemetry:r(f=>{if(f.type!=="fired"||v)return;g=H();let x=_;x!==null&&g.then(C=>C===null?void 0:x(C).catch(()=>{})),O=!1,N!==null&&i(N),N=null,U=Number.NEGATIVE_INFINITY},"telemetry")},decorate:r(f=>{let x=new WeakMap,C=new Map,M=r(j=>{let o=x.get(j);return o===void 0&&(o=(async()=>{let d=await X(f,"image","image/jpeg",j.image.size,{engine:"portrait"});return await f.uploadToSpaces(d.uploadUrl,j.image,"image/jpeg"),(await f.completeMedia(d.key)).key})(),o.catch(()=>x.delete(j)),x.set(j,o)),o},"T");_=M;let E=r(async j=>{let o;try{o=await M(j)}catch(d){let u=d?.code;if(typeof u=="string"&&At.has(u))throw d;return null}return{media:{portrait:o},gate:ae(j.gate),...c!==null?{tuningVersion:c}:{}}},"H"),R=f.submitCheck.bind(f),L=r((async(j,o,d)=>{if(j!=="liveness")return R(j,o,d);let u=d?.idempotencyKey,h=u===void 0?void 0:C.get(u);if(h===void 0){let q=g;h=q===null?Promise.resolve(null):q.then(F=>F===null?null:E(F)),u!==void 0&&(C.set(u,h),h.catch(()=>C.delete(u)))}let k=await h;if(k===null)return R("liveness",o,d);let B=await R("liveness",{...o,portraitIcao:k},d);return A=k,B}),"M");return new Proxy(f,{get(j,o){if(o==="submitCheck")return L;let d=Reflect.get(j,o);return typeof d=="function"?d.bind(j):d}})},"decorate"),onGate:r(f=>(y.add(f),()=>y.delete(f)),"onGate"),lastPortraitInput:r(()=>A,"lastPortraitInput"),destroy:r(()=>{v=!0,g=null,A=null,N!==null&&i(N),N=null,y.clear(),K.then(()=>{S?.close(),S=null,z?.close(),z=null})},"destroy")}}r(at,"Gn");function Pt(e){return e.idNumberBound??e.nniBound}r(Pt,"Ge");function It(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}r(It,"Be");function Et(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}r(Et,"Ue");var ot=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"}),Rt=new Map(Object.entries(ot)),Un=new Map(Object.entries(ot).map(([e,t])=>[t,e]));function jt(e){return Rt.get(e)??e}r(jt,"je");var G={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"},Nt=new Set(["full_name","birth_date","email","phone","address","country","occupation"]),Ot=new Set(["short_text","long_text","single_choice","multiple_choice","yes_no","date","number"]),Vt=new Set(["ar","fa","he","ur"]);function Dt(e){return Vt.has(e.split("-")[0]?.toLowerCase()??"")?"rtl":"ltr"}r(Dt,"qe");function Bt(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.locale!="string"||!Array.isArray(t.questions)||t.questions.length===0)return null;let n=t.consents??[];if(!Array.isArray(n))return null;for(let i of t.questions)if(!Ut(i))return null;for(let i of n)if(!zt(i))return null;let a={locale:t.locale,questions:t.questions,consents:n};return typeof t.title=="string"&&t.title.trim()!==""&&(a.title=t.title),typeof t.intro=="string"&&t.intro.trim()!==""&&(a.intro=t.intro),typeof t.prefill=="object"&&t.prefill!==null&&!Array.isArray(t.prefill)&&(a.prefill=t.prefill),a}r(Bt,"Ye");function Ut(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id!="string"||typeof t.required!="boolean"?!1:t.kind==="field"?typeof t.field=="string"&&Nt.has(t.field):t.kind!=="custom"||typeof t.type!="string"||!Ot.has(t.type)||typeof t.label!="string"?!1:t.type==="single_choice"||t.type==="multiple_choice"?Array.isArray(t.choices)&&t.choices.length>=2&&t.choices.every(n=>typeof n=="object"&&n!==null&&typeof n.value=="string"&&typeof n.label=="string"):!0}r(Ut,"_t");function zt(e){if(typeof e!="object"||e===null)return!1;let t=e;if(typeof t.id!="string"||typeof t.required!="boolean"||typeof t.text!="string")return!1;if(t.link===void 0)return!0;let n=t.link;return typeof n=="object"&&n!==null&&typeof n.url=="string"&&/^https:\/\//.test(n.url)&&typeof n.label=="string"}r(zt,"bt");var Ft=/^(\d{4})-(\d{2})-(\d{2})$/;function Lt(e){if(typeof e!="string")return!1;let t=Ft.exec(e);return t===null?!1:new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]))).toISOString().slice(0,10)===e&&e>=G.dateMin&&e<=G.dateMax}r(Lt,"Ct");function Kt(e){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<G.number&&Math.round(e*100)/100===e}r(Kt,"Pt");function lt(e){for(let t of e.matchAll(/\d[\d -]{11,}\d/g)){let n=t[0].replace(/[ -]/g,"");if(n.length>=13&&n.length<=19&&qt(n))return!0}return!1}r(lt,"Ze");function qt(e){let t=0;for(let n=0;n<e.length;n++){let a=Number(e[e.length-1-n]);n%2===1&&(a*=2,a>9&&(a-=9)),t+=a}return t%10===0}r(qt,"At");var Gt=/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/,$t=/^\+[1-9]\d{6,14}$/,st=/^[A-Z]{2}$/,Ht=r(e=>e===void 0||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0,"xt");function ct(e=Date.now()){return new Date(e).toISOString().slice(0,10)}r(ct,"Qe");function be(e,t,n=ct()){let a=[];for(let i of e.questions){let l=t.answers[i.id];if(Ht(l)){i.required&&a.push({id:i.id,code:"required"});continue}let s=i.kind==="field"?Zt(i.field,l,n):Jt(i,l,n);s!==null&&a.push({id:i.id,...s})}for(let i of e.consents)i.required&&t.consents[i.id]!==!0&&a.push({id:i.id,code:"consent_required"});return a}r(be,"X");function ce(e,t,n=1){if(typeof e!="string")return{code:"required"};let a=e.trim();return[...a].length>t?{code:"too_long",params:{max:t}}:[...a].length<n?{code:"too_short",params:{min:n}}:lt(a)?{code:"card_number"}:null}r(ce,"z");function dt(e,t,n={}){return Lt(e)?n.period==="past"&&e>=t?{code:"date_not_past"}:n.period==="future"&&e<=t?{code:"date_not_future"}:n.min!==void 0&&e<n.min?{code:"date_too_early",params:{date:n.min}}:n.max!==void 0&&e>n.max?{code:"date_too_late",params:{date:n.max}}:null:{code:"date_invalid"}}r(dt,"$e");function Zt(e,t,n){switch(e){case"full_name":return ce(t,G.fullName,G.fullNameMin);case"occupation":return ce(t,G.occupation);case"birth_date":return dt(t,n,{period:"past"});case"email":return typeof t=="string"&&t.trim().length<=G.email&&Gt.test(t.trim())?null:{code:"email_invalid"};case"phone":return typeof t=="string"&&$t.test(t)?null:{code:"phone_invalid"};case"country":return typeof t=="string"&&st.test(t)?null:{code:"choice_invalid"};case"address":return Wt(t)?null:{code:"address_invalid"};default:return null}}r(Zt,"Et");function Wt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Array.isArray(t.lines)?t.lines.filter(a=>typeof a=="string"&&a.trim()!==""):[];return typeof t.country=="string"&&st.test(t.country)&&typeof t.city=="string"&&t.city.trim()!==""&&t.city.trim().length<=G.city&&n.length>=1&&n.length<=G.addressLines&&n.every(a=>a.trim().length<=G.addressLine&&!lt(a))&&(t.postcode===void 0||typeof t.postcode=="string"&&t.postcode.trim().length<=G.postcode)}r(Wt,"It");function Jt(e,t,n){let a=new Set((e.choices??[]).map(i=>i.value));switch(e.type){case"short_text":return ce(t,G.shortText);case"long_text":return ce(t,G.longText);case"single_choice":return typeof t=="string"&&a.has(t)?null:{code:"choice_invalid"};case"multiple_choice":return Array.isArray(t)&&t.length>0&&new Set(t).size===t.length&&t.every(i=>a.has(i))?null:{code:"choice_invalid"};case"yes_no":return typeof t=="boolean"?null:{code:"choice_invalid"};case"date":{let i=e.options??{};return dt(t,n,{...typeof i.min=="string"?{min:i.min}:{},...typeof i.max=="string"?{max:i.max}:{},...i.period==="past"||i.period==="future"?{period:i.period}:{}})}case"number":{if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>=G.number)return{code:"number_invalid"};let i=e.options??{};return i.integer===!0&&!Number.isInteger(t)?{code:"number_not_integer"}:Kt(t)?typeof i.min=="number"&&t<i.min?{code:"number_too_small",params:{min:i.min}}:typeof i.max=="number"&&t>i.max?{code:"number_too_large",params:{max:i.max}}:null:{code:"number_decimals"}}default:return null}}r(Jt,"Mt");function Qt(e,t,n,a=ct()){let i=e?.errors;return Array.isArray(i)?i.flatMap(l=>{if(typeof l!="object"||l===null)return[];let{id:s,code:c}=l;return typeof s!="string"||typeof c!="string"?[]:[Xt(s,c,t,n)]}):be(t,n,a)}r(Qt,"Je");var Yt={full_name:G.fullName,occupation:G.occupation,email:G.email,short_text:G.shortText,long_text:G.longText};function Xt(e,t,n,a){let i=n.questions.find(y=>y.id===e),l=i===void 0?void 0:i.kind==="field"?i.field:i.type,s=a.answers[e],c=i!==void 0&&i.kind==="custom"?i.options??{}:{};switch(t){case"required":case"card_number":return{id:e,code:t};case"consent_required":return{id:e,code:"consent_required"};case"too_short":return{id:e,code:t,params:{min:l==="full_name"?G.fullNameMin:1}};case"too_long":{let y=l===void 0?void 0:Yt[l];return y===void 0?{id:e,code:t}:{id:e,code:t,params:{max:y}}}case"not_a_choice":return{id:e,code:"choice_invalid"};case"not_in_past":return{id:e,code:"date_not_past"};case"not_in_future":return{id:e,code:"date_not_future"};case"not_an_integer":return{id:e,code:"number_not_integer"};case"out_of_range":return er(e,l,s,c);case"invalid":return i===void 0?n.consents.some(y=>y.id===e)?{id:e,code:"consent_required"}:{id:e,code:t}:{id:e,code:tr(l,s)};default:return{id:e,code:t}}}r(Xt,"vt");function er(e,t,n,a){if(t==="date"){let s=typeof a.min=="string"?a.min:void 0,c=typeof a.max=="string"?a.max:void 0;return c!==void 0&&(s===void 0||typeof n=="string"&&n>c)?{id:e,code:"date_too_late",params:{date:c}}:s!==void 0?{id:e,code:"date_too_early",params:{date:s}}:{id:e,code:"date_invalid"}}let i=typeof a.min=="number"?a.min:void 0,l=typeof a.max=="number"?a.max:void 0;return l!==void 0&&(i===void 0||typeof n=="number"&&n>l)?{id:e,code:"number_too_large",params:{max:l}}:i!==void 0?{id:e,code:"number_too_small",params:{min:i}}:{id:e,code:"number_invalid"}}r(er,"Tt");function tr(e,t){switch(e){case"email":return"email_invalid";case"phone":return"phone_invalid";case"birth_date":case"date":return"date_invalid";case"number":return typeof t=="number"&&Number.isFinite(t)&&Math.abs(t)<G.number?"number_decimals":"number_invalid";case"address":return"address_invalid";case"full_name":case"occupation":case"short_text":case"long_text":return"required";default:return"choice_invalid"}}r(tr,"Nt");var rr=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","portrait","face_match","aml_screening","face_dedup","age_estimation","proof_of_address","form"]),nr=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),we=["document","population_registry","national_eid"],ke=["phone_otp","email_otp"],ut={identity_method:we,contact:ke},ir=["population_registry","document"],xe="platform_unsupported",ar=new Set(["prefilled","user_entered","prefilled_or_entered"]),or={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo",poa:"documents",form:"form"};function J(e){return e.section??or[e.checkType]??null}r(J,"L");function pt(e,t){let n=e.plan?.choice;if(n===void 0||n.locked)return;let a=n.options.find(i=>i.id!==n.selected&&i.available!==!1&&t.includes(i.service));return a===void 0?void 0:{nodeId:n.nodeId,option:a}}r(pt,"de");function Me(e){let t=e.plan,n=t?.choice;if(t===void 0||n===void 0||n.locked||t.current===null||t.current===n.nodeId||pe(e))return null;let a=ut[n.kind]??[...we,...ke],i=n.options.flatMap(c=>{if(c.available===!1||!a.includes(c.service))return[];let y=c.nationalEid!=null?{id:c.id,service:c.service,nationalEid:c.nationalEid}:{id:c.id,service:c.service},v=c.countries??(c.nationalEid!=null?[c.nationalEid.country]:void 0);return v!==void 0&&v.length>0&&(y.countries=v),c.names!=null&&Object.keys(c.names).length>0&&(y.names=c.names),[y]}),l=t.steps.find(c=>c.id===t.current)?.service,s=n.selected??i.find(c=>c.service===l)?.id??null;return i.some(c=>c.id!==s)?{nodeId:n.nodeId,kind:n.kind,current:s,options:i}:null}r(Me,"le");function ft(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}r(ft,"tt");function lr(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:n,skipCapture:a}=t;if(typeof n!="string"||n===""||typeof a!="boolean")return;let i=je(e);return i!==void 0?{otpCode:n,skipCapture:a,reason:i}:{otpCode:n,skipCapture:a}}r(lr,"Gt");function sr(e){let t=e.levelTarget?.max;return typeof t=="number"&&t<=1?"contact":e.purpose??"identity"}r(sr,"Bt");function cr(e){let t=(e.plan?.sections??[]).map(s=>({id:s.id,state:s.state})),n={sessionId:fe(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(s=>s.id),progress:t,purpose:e.purpose??"identity",levelName:sr(e)};e.branding!==void 0&&(n.branding=e.branding),e.cameraUnavailableHandled===!0&&(n.cameraUnavailableHandled=!0);let a=lr(e);a!==void 0&&(n.simulation=a);let i=e.testerGate;i?.offered===!0&&typeof i.attemptsLeft=="number"&&i.attemptsLeft>0&&(n.testerGate={attemptsLeft:i.attemptsLeft});let l=Me(e);return l!==null&&(n.switchable=l),n}r(cr,"Ut");function dr(e){let t={attemptsRemaining:Pe(e),attemptsExhausted:e.attempts.used>=e.attempts.max};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}r(dr,"Kt");var mt={phone_otp:"phone",email_otp:"email"};function ur(e,t){let n=pt(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return n===void 0?void 0:mt[n.option.service]}r(ur,"jt");function pr(e,t,n,a){let i=t.checkType==="email_otp",l=(i?t.emailOtp:t.otp)??{},s=i?t.emailOtp?.emailSource:t.otp?.numberSource,c=s!==void 0&&ar.has(s)?s:i?"prefilled_or_entered":"user_entered",y=typeof l.sentToMasked=="string"&&l.sentToMasked.length>0,v=l.prefilled===!0,m=ur(e,i?"email_otp":"phone_otp"),b={key:t.checkType,context:n,section:J(t),phase:y?"verify":"send",canSwitch:m!==void 0,...a},p=i?{kind:"email_otp",...b,emailSource:c,needsEmail:c!=="prefilled"&&!v}:{kind:"phone_otp",...b,numberSource:c,needsPhone:c!=="prefilled"&&!v,channels:(t.otp?.channels??[]).filter(w=>w==="whatsapp"||w==="sms")};if(m!==void 0&&(p.switchChannel=m),v&&(p.prefilled=!0),y&&(p.sentToMasked=l.sentToMasked),!i&&t.otp?.channel!==void 0&&(p.channel=t.otp.channel),!i&&Array.isArray(t.phoneCountries)&&(p.phoneCountries=t.phoneCountries.filter(w=>typeof w=="string"&&/^[A-Z]{2}$/.test(w))),!i&&Array.isArray(t.phoneRules)){let w=p.phoneCountries??[];p.phoneRules=t.phoneRules.flatMap(T=>{let S=hr(T);return S!==void 0&&w.includes(S.code)?[S]:[]})}return!i&&t.phoneInternational===!0&&(p.phoneInternational=!0),l.expiresAt!==void 0&&(p.codeExpiresAt=l.expiresAt),l.resendAvailableAt!==void 0&&(p.resendAvailableAt=l.resendAvailableAt),p}r(pr,"qt");var fr=/^[\d[\]\-|()?:^]{1,64}$/;function mr(e){try{return typeof e=="string"&&fr.test(e)&&new RegExp(e)!==null}catch{return!1}}r(mr,"Zt");var et=r(e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15,"ze");function hr(e){let{code:t,dial:n,trunk:a,lengths:i,formats:l}=e??{};if(typeof t!="string"||typeof n!="string"||!/^\d{1,3}$/.test(n)||a!==void 0&&(typeof a!="string"||!/^\d{1,3}$/.test(a))||!Array.isArray(i)||i.length===0||!i.every(et))return;let s={code:t,dial:n,lengths:[...i].sort((c,y)=>c-y)};if(a!==void 0&&(s.trunk=a),l!==void 0){if(!(Array.isArray(l)&&l.length<=8&&l.every(c=>mr(c?.leading)&&Array.isArray(c.groups)&&c.groups.every(et)&&i.includes(c.groups.reduce((y,v)=>y+v,0)))))return;s.formats=l.map(c=>({leading:c.leading,groups:[...c.groups]}))}return s}r(hr,"Wt");function yr(e,t,n,a){let i=Pt(e)===!0?"bound":It(t)===!0?"document":"typed",l=i==="typed"&&t.state==="input_required"&&t.reason!==void 0&&jt(t.reason)==="id_number_recheck",s=ft(Me(e)),c=!a.attemptsExhausted&&s.length===1&&s[0]?.service==="document";return{kind:"registry",key:"registry",context:n,section:J(t),state:t.state==="input_required"?"input_required":"pending",source:i,recheck:l,canUseDocument:c,...a}}r(yr,"Qt");function gr(e,t,n,a,i){let l=[...t.acceptedSides??[]],s={kind:"document",key:"document",context:n,section:J(t),side:l.includes("recto")?"verso":"recto",acceptedSides:l,documents:Mt(e),photo:Ae(Te(e.documents),i),...a};return e.detectedCountry!==void 0&&(s.detectedCountry=e.detectedCountry),_r(e)&&(s.ageStepUp=!0),s}r(gr,"$t");function Te(e,t=!0){let n=e?.source==="upload"||e?.source==="choice"?e.source:"camera",a=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:n,pick:a,uploadOffered:t&&e?.uploadOffered===!0}}r(Te,"pe");function Ae(e,t){return t?{...e,cameraOnPhone:!0}:e}r(Ae,"fe");var br=10*1024*1024;function vr(e,t,n,a,i){let l=e.proofOfAddress,s=l?.pdf?.maxBytes,c=l?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:n,section:J(t),phase:c,rule:l?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:l?.nameMatch??"exact_person",photo:Ae(Te(l),i),maxPages:3,pdf:{maxBytes:typeof s=="number"&&s>0?s:br,maxPages:3},licenceAddressAccepted:c==="document"&&l?.licenceAddressAccepted===!0,...a}}r(vr,"zt");function _r(e){let t=Ce(e).find(a=>a.checkType==="age_estimation"),n=t?.reason;return t?.state==="failed"&&(n==="age_uncertain"||n==="age_unavailable")}r(_r,"Xt");function wr(e){let t=le(e,"liveness");return t?.state==="passed"||t?.state==="review"}r(wr,"en");function tt(e,t,n,a,i,l=!1){let s=t.icao?.report,c=e.portrait,y=i==="capture"?c?.pendingFix??null:null;y!==null&&(i="review");let v=re(e);return{kind:"portrait",key:`portrait:${i}`,context:n,section:J(t),phase:i,report:Array.isArray(s)?s:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:ie(e),retakeOnly:i==="capture"&&t.state==="input_required"&&v===void 0&&e.capture?.livePhoto?.oneCapture===!0&&wr(e),photo:Ae(Te(c,i==="capture"),l&&i==="capture"),pendingFix:y,...v!==void 0?{captureMode:v}:{},...c?.reuse?.pending===!0?{reuse:!0}:{},...a}}r(tt,"Xe");function re(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}r(re,"rt");var ge={minLongSidePx:1280,jpegQuality:.95};function kr(e,t){let n=e.capture?.livePhoto;if(n?.oneCapture!==!0)return null;let a=le(e,"portrait_icao"),i=n.still??ge;return{icao:t==="liveness"&&ie(e)!==null&&re(e)===void 0&&a!==void 0&&a.state==="pending"&&a.reason===void 0,still:{minLongSidePx:i.minLongSidePx??ge.minLongSidePx,jpegQuality:i.jpegQuality??ge.jpegQuality}}}r(kr,"tn");function xr(e,t,n,a){let i=t.eid,l=J(t);if(i===void 0||i.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:n,section:l,checkType:"eid_auth",reason:"update_required"};let s=ft(Me(e)),c=s.length===1&&ir.includes(s[0]?.service??"")?s[0]:void 0,y=c===void 0?void 0:oe[c.service],v=y!==void 0,m={kind:"eid",key:"eid",context:n,section:l,provider:i.provider,providerName:i.providerName,country:i.country,challenge:"app_code",phase:i.awaiting==="code"?"code":"identifier",identifierBound:i.identifierBound===!0,canUseCamera:v,afterPass:i.afterPass==="continue"?"continue":"end",...a};return v&&(m.cameraMethod=y),i.expiresAt!==void 0&&(m.codeExpiresAt=i.expiresAt),i.resendAvailableAt!==void 0&&(m.resendAvailableAt=i.resendAvailableAt),i.resendsRemaining!==void 0&&(m.resendsRemaining=i.resendsRemaining),i.codeAttemptsRemaining!==void 0&&(m.codeAttemptsRemaining=i.codeAttemptsRemaining),m}r(xr,"nn");function Mr(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let n=le(e,"portrait_icao");return n!==void 0&&(n.state==="passed"||n.state==="review")?n:null}r(Mr,"rn");var Tr={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function Ar(e){return e.reasonCode===xe?"platform_unsupported":e.status==="review_pending"?"review":e.status==="verified"?"verified":e.reasonCode==="device_cooldown"?"cooldown":e.reasonCode==="starter_credit_claimed"?"policy":(e.status==="not_verified"&&e.reason!==void 0?Tr[e.reason]:void 0)??"rejected"}r(Ar,"sn");function Sr(e,t){let n=Ar(e),a=n==="platform_unsupported"?{sessionId:fe(e.sessionId),status:"unavailable",reasonCode:xe}:Re(e,{autoRetry:!1}),i={kind:"result",key:"result",context:t,section:null,display:n,result:a};return e.status==="not_verified"&&e.reason!==void 0&&(i.reason=e.reason),e.reasonCode!==void 0&&(i.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(i.step=e.step),e.retryAfter!==void 0&&(i.retryAfter=e.retryAfter),i}r(Sr,"an");function Cr(e,t,n){let a=e.identitySummary;if(a==null)return null;let i={kind:"identity_summary",key:"identity_summary",context:t,section:n??"identity",summaryKind:a.kind==="partial"?"partial":a.kind??"full",source:a.source,portraitAvailable:a.portrait?.available===!0,retakeAvailable:a.retakeAvailable===!0};for(let s of Pr){let c=a[s];typeof c=="string"&&c!==""&&(i[s]=c)}let l=Et(a);return l!==void 0&&(i.idNumberMasked=l,i.nniMasked=l),i}r(Cr,"un");var Pr=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function Y(e,t,n,a){return{kind:"unsupported",key:`unsupported:${n}`,context:e,section:t,checkType:n,reason:a}}r(Y,"B");function Ir(e){return e.kind==="contact"?"contact":(e.kind,"identity")}r(Ir,"dn");function Er(e,t){let n=ut[e.kind]??[...we,...ke],a=Ir(e),i=e.options.flatMap(s=>{if(s.available===!1||!n.includes(s.service))return[];let c={id:s.id,service:s.service};s.nationalEid!=null&&(c.nationalEid=s.nationalEid);let y=(s.channels??[]).filter(v=>v==="whatsapp"||v==="sms");return s.service==="phone_otp"&&y.length>0&&(c.channels=y),[c]});if(i.length===0){let s=e.options.length>0&&e.options.every(c=>c.service==="nfc");return Y(t,a,"choice",s?"platform_unsupported":"update_required")}let l={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:i};if(e.kind==="identity_method"){let s={kind:"method",key:"method",context:t,section:a,options:i.map(y=>oe[y.service]),choice:l},c=i.find(y=>y.nationalEid!==void 0)?.nationalEid;return c!==void 0&&(s.nationalEid=c),s}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:a,options:i.map(s=>mt[s.service]),selected:null,locked:!1,choice:l}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:a,choice:l}}r(Er,"ln");function Rr(e,t,n,a){let i=e.nativeApp,l=typeof i=="object"&&i!==null?i:{},s={sekyroApp:l.sekyroApp===!0};return typeof l.link=="string"&&l.link!==""&&(s.link=l.link),s.sekyroApp&&typeof l.sekyroAppLink=="string"&&l.sekyroAppLink.startsWith("sekyro://")&&(s.sekyroAppLink=l.sekyroAppLink),{kind:"native_app_required",key:`native_app_required:${a}`,context:t,section:n,checkType:a,nativeApp:s}}r(Rr,"pn");function Q(e,t={}){let n=cr(e);if(pe(e)||e.reasonCode===xe)return Sr(e,n);let a=e.plan;if(a===void 0||!Array.isArray(a.sections))return Y(n,null,"plan","update_required");let i=Ie(e);if(i!==null)return Er(i,n);let l=a.current===null?void 0:a.steps.find(p=>p.id===a.current),s=r(p=>{let w={kind:"processing",key:"processing",context:n,section:p!==void 0?J(p):a.sections.find(T=>T.state==="current")?.id??null,stalled:!1};return typeof p?.service=="string"&&p.service!==""&&(w.service=p.service),w},"d");if(a.current===null)return s(a.steps.find(p=>p.state==="processing"));if(l===void 0)return Y(n,null,"step","update_required");if(!rr.has(l.service))return l.interaction==="server"?s(l):Y(n,J(l),l.service,"update_required");if(nr.has(l.service)||!Ee(l))return s(l);let c=l,y=dr(c),v=c.checkType,m=J(c);if(c.requiresNativeApp===!0)return Rr(e,n,m,v);let b=t.isMobile===!1?De(e,c):null;if(b==="phone")return{kind:"mobile_required",key:"mobile_required",context:n,section:m,checkType:v};switch(v){case"phone_otp":case"email_otp":return pr(e,c,n,y);case"population_registry":return yr(e,c,n,y);case"eid_auth":return xr(e,c,n,y);case"doc_ocr":return gr(e,c,n,y,b==="upload_or_phone");case"identity_confirm":return Cr(e,n,m)??s(c);case"portrait_icao":return tt(e,c,n,y,"capture",b==="upload_or_phone");case"liveness":case"face_match":{let p=Mr(e,c);if(p!==null)return tt(e,p,n,y,"match");let w=c.requiresMobile===!0,T=ie(e);return{kind:"liveness",key:"biometric",context:n,section:m,mode:v==="face_match"?"selfie":"liveness",requiresMobile:w,instructions:T===null?"standard":"icao",icao:T,livePhoto:kr(e,v),...y}}case"poa":return vr(e,c,n,y,b==="upload_or_phone");case"form":{let p=Bt(c.form);return p===null?Y(n,m,v,"update_required"):{kind:"form",key:"form",context:n,section:m,form:p,dir:Dt(p.locale),...y}}case"nfc_chip":return Y(n,m,v,"platform_unsupported");default:return Y(n,m,v,"update_required")}}r(Q,"ee");var jr=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,Nr=Object.freeze({normalize:r(e=>e.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:r(e=>jr.test(e),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),Or=/^[A-Z0-9]{4,20}$/,ve=r(e=>e.trim().toUpperCase().replace(/[\s-]+/g,""),"me"),Vr=Object.freeze({normalize:ve,check:r(e=>Or.test(ve(e)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function Dr(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}r(Dr,"Sn");var Br={trim:r(e=>e.trim(),"trim"),upper_single_space:r(e=>e.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:ve},Ur={mr_nni_mod97:r(e=>Dr(e),"mr_nni_mod97")};function zr(e){let t=new RegExp(e.pattern,"u"),n=e.check===null?void 0:Ur[e.check];return Object.freeze({normalize:Br[e.normalize],check:r(a=>t.test(a.trim())&&(n===void 0||n(a)),"check"),registrySources:Object.freeze([...e.registrySources]),describe:e.describe})}r(zr,"bn");var Fr=Object.freeze(Object.fromEntries(Object.entries(ze).map(([e,t])=>[e,zr(t)])));function ht(e,t){return Fr[`${e.toUpperCase()}:${t}`]??(t==="drivers_license"?Vr:Nr)}r(ht,"he");var Lr=Object.freeze({JPN:"JP",MRT:"MR"});function Kr(e,t){let n=e.trim().toUpperCase();return ht(Lr[n]??n,t)}r(Kr,"ot");function qr(e){let t=Kr(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}r(qr,"it");function Gr(e){return ht("MR","national_id").check(e)}r(Gr,"st");function rt(e){let t="";for(let n of e){let a=n.codePointAt(0)??0;a>=1632&&a<=1641?t+=String(a-1632):a>=1776&&a<=1785?t+=String(a-1776):n!==" "&&n!=="-"&&n!==" "&&(t+=n)}return t}r(rt,"ge");var $r=[1e3,2e3,4e3,8e3,15e3],Hr=3e4,Zr=/^\+[1-9]\d{6,14}$/,Wr=/^\d{6}$/,Jr=/^\d{6}$/,Qr=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,nt=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active","native_app_required"]),Yr={simulatedCapture:!0},Xr=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function yt(e){let t=!1,n=null,a="",i=!1,l=!1,s=!1,c={},y={},v=new Set,m=!1,b=!1,p=null,w="idle",T=new Map,S=new Map,z=r((o,d,u)=>{let h=`${o}.${d}`,k=T.get(h);if(k!==void 0)return k;let B=S.get(o),q=(B===void 0?u():B.then(u)).finally(()=>{T.delete(h)});T.set(h,q);let F=q.then(()=>{},()=>{});return S.set(o,F),F.then(()=>{S.get(o)===F&&S.delete(o)}),q},"I"),I=r(async(o,d,u)=>{await e.ensureConsent();let h;try{h=await Oe(e.runtime,d)}catch(B){if(B instanceof $&&nt.has(B.code)){await e.refreshView();return}throw B}if(u?.(h),e.destroyed())return;let k=h;k.plan!==void 0&&e.setView!==void 0?e.setView(k):await e.refreshView()},"v"),O=r(async o=>{await e.ensureConsent();let d;try{try{d=await o(e.runtime.client)}catch(u){if(!(u instanceof $)||u.code!=="consent_required")throw u;await e.runtime.ensureConsent({force:!0}),d=await o(e.runtime.client)}}catch(u){if(u instanceof $&&nt.has(u.code)){await e.refreshView();return}throw u}e.destroyed()||(d!==void 0&&e.setView!==void 0?e.setView(d):await e.refreshView())},"V"),U=r((o,d)=>z("choice",`${o}:${d}`,()=>O(u=>u.choose(o,d))),"D"),N=r((o,d)=>o.options.some(u=>u.id===d)?U(o.nodeId,d):Promise.reject(new RangeError(`option ${String(d)} is not offered`)),"x"),Z=r((o,d)=>{let u=e.currentView(),h=u===null?void 0:pt(u,o);return h===void 0?Promise.reject(new RangeError(`the ${d} is not offered`)):U(h.nodeId,h.option.id)},"U"),g=r(o=>z("identity",o,()=>O(d=>d.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):d.confirmIdentity(o))),"F"),A=r((o,d)=>{let u=be(o.form,d);if(u.length>0)return Promise.reject(new me(u,"client"));let h={answers:{...d.answers},consents:{}};for(let k of o.form.consents)h.consents[k.id]=d.consents[k.id]===!0;return z("form","submit",()=>I("form",(k,B)=>k.submitCheck("form",h,{idempotencyKey:B})).catch(k=>{throw k instanceof $&&k.code===Ve?new me(Qt(k.details,o.form,h),"server"):k}))},"K"),K=r((o,d)=>{let u=o.kind,h=u==="phone_otp",k=h?"phone":"email",B={action:"send"};if(h?o.needsPhone:o.needsEmail){let q=d[k]??y[u],F=h?q?.replace(/[\s().-]/g,""):q?.trim();if(F!==void 0||o.phase!=="verify"){if(F===void 0||!(h?Zr:Qr).test(F))return Promise.reject(h?new W("phone","format"):new se("email","format"));B[k]=F}}if(h){let q=o.channels,F=d.channel??(q.length===1?q[0]:void 0);if(q.length>0){if(F===void 0)return Promise.reject(new se("channel","required"));if(!q.includes(F))return Promise.reject(new se("channel","unavailable"))}F!==void 0&&(B.channel=F),B.phoneRules=1}return z(u,"send",()=>I(u,(q,F)=>q.submitCheck(u,B,{idempotencyKey:F}),q=>{tn(q,u)||(c[u]=e.now(),B[k]!==void 0&&(y[u]=B[k]))}))},"te"),V=r((o,d)=>Wr.test(d)?z(o,"verify",()=>I(o,(u,h)=>u.submitCheck(o,{action:"verify",code:d},{idempotencyKey:h}))):Promise.reject(new W("code","format")),"Z"),P=r((o,d)=>z("eid_auth",o,()=>I("eid_auth",(u,h)=>u.submitCheck("eid_auth",d,{idempotencyKey:h}))),"G"),D=r((o,d)=>{if(o.identifierBound)return P("start",{action:"start"});let u=rt(d??"");if(o.country==="MR"){if(!/^\d{10}$/.test(u))return Promise.reject(new W("nni","format"));if(!Gr(u))return Promise.reject(new W("nni","check_digit"))}else if(u==="")return Promise.reject(new W("nni","format"));return P("start",{action:"start",identifier:u})},"ne"),H=r((o,d,u)=>{if(o.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let h=rt(d);return/^\d{10}$/.test(h)?qr({type:"national_id",issuingCountry:"MR",number:h})?z("population_registry","submitIdNumber",()=>I("population_registry",(k,B)=>k.submitCheck("population_registry",{idNumber:h,nni:h},{idempotencyKey:B}),()=>{p=`••••••${h.slice(-4)}`})):Promise.reject(new W(u,"check_digit")):Promise.reject(new W(u,"format"))},"W"),_=r(o=>(e.stopCameras?.(),z(o,"skipCapture",()=>I(o,(d,u)=>d.submitCheck(o,Yr,{idempotencyKey:u}),()=>{(o==="liveness"||o==="portrait_icao")&&(m=!0)}))),"Q"),f=r(o=>{if(o.kind==="result"||o.context.simulation?.skipCapture!==!0)return o;let d=en(o);return d===null?o:{...o,skipCapture:r(()=>_(d),"skipCapture")}},"Se"),x=r(o=>((o.kind==="document"||o.kind==="portrait"||o.kind==="proof_of_address")&&o.photo?.cameraOnPhone===!0&&(o.refresh=async()=>{await e.refreshView()}),o),"m"),C=r(o=>{switch(o.kind){case"phone_otp":case"email_otp":{let d={...o,send:r((h={})=>K(o,h),"send"),verify:r(h=>V(o.kind,h),"verify"),switchTo:r(()=>o.canSwitch&&o.switchChannel!==void 0?Z([o.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option")),"switchTo")},u=c[o.kind];return d.resendAvailableAt===void 0&&u!==void 0&&(d.resendAvailableAt=new Date(u+Hr).toISOString()),d}case"eid":return{...o,start:r(d=>D(o,d),"start"),verify:r(d=>Jr.test(d)?P("verify",{action:"verify",code:d}):Promise.reject(new W("code","format")),"verify"),resend:r(()=>o.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):P("resend",{action:"resend"}),"resend"),useCamera:r(()=>o.canUseCamera&&o.cameraMethod!==void 0?Z(o.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered")),"useCamera")};case"method":return{...o,select:r(d=>{let u=o.choice.options.find(h=>oe[h.service]===d);return u!==void 0?N(o.choice,u.id):Promise.reject(new RangeError(`method ${String(d)} is not offered`))},"select"),choose:r(d=>N(o.choice,d),"choose")};case"choice":return{...o,choose:r(d=>N(o.choice,d),"choose")};case"registry":return{...o,submitIdNumber:r(d=>H(o,d,"idNumber"),"submitIdNumber"),submitNni:r(d=>H(o,d,"nni"),"submitNni"),confirm:r(()=>z("population_registry","confirm",()=>I("population_registry",(d,u)=>d.submitCheck("population_registry",{},{idempotencyKey:u}))),"confirm"),useDocument:r(()=>o.canUseDocument?Z(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered")),"useDocument")};case"document":return e.bindDocument!==void 0?x(e.bindDocument(o,j)):{...o,issuer:null,documentType:null,captureSide:null,selectDocument:r(()=>{throw new Error("document capture is not available in this build")},"selectDocument"),capture:r(()=>{throw new Error("document capture is not available in this build")},"capture"),uploadDocument:r(()=>Promise.reject(new Error("document upload is not available in this build")),"uploadDocument")};case"portrait":return e.bindPortrait!==void 0?x(e.bindPortrait(o,j)):{...o,uploadFailed:!1,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(()=>{throw new Error("portrait capture is not available in this build")},"capture"),uploadPortrait:r(()=>Promise.reject(new Error("portrait upload is not available in this build")),"uploadPortrait"),confirmFix:r(()=>Promise.reject(new Error("portrait review is not available in this build")),"confirmFix")};case"proof_of_address":return e.bindProofOfAddress!==void 0?x(e.bindProofOfAddress(o,j)):{...o,uploadPages:r(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadPages"),uploadHolderLetter:r(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadHolderLetter"),capturePage:r(()=>{throw new Error("proof of address capture is not available in this build")},"capturePage")};case"form":return{...o,validate:r(d=>be(o.form,d),"validate"),submit:r(d=>A(o,d),"submit")};case"contact_choice":return{...o,select:r(d=>{let u=d==="phone"?"phone_otp":d==="email"?"email_otp":void 0,h=o.choice.options.find(k=>k.service===u);return h!==void 0?N(o.choice,h.id):Promise.reject(new RangeError(`contact ${String(d)} is not offered`))},"select"),choose:r(d=>N(o.choice,d),"choose")};case"identity_summary":return{...o,...o.idNumberMasked===void 0&&o.summaryKind==="partial"&&p!==null?{idNumberMasked:p,nniMasked:p}:{},portrait:r(async()=>{let d=e.runtime.client;if(!o.portraitAvailable||d.identityPortrait===void 0)return null;try{return await d.identityPortrait()}catch{return null}},"portrait"),confirm:r(()=>g("confirm"),"confirm"),retake:r(()=>o.retakeAvailable?g("retake"):Promise.reject(new RangeError("no retake is left")),"retake")};case"liveness":return{...o,capture:r(d=>e.liveness(d),"capture"),onLivePhoto:r(d=>o.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(d):()=>{},"onLivePhoto")};case"mobile_required":case"native_app_required":case"processing":return{...o,refresh:r(async()=>{i=!1,await e.refreshView()},"refresh")};case"unsupported":case"result":return{...o};default:{let d=o;throw new Error(`runner: unhandled step ${JSON.stringify(d)}`)}}},"k"),M=r(o=>f(C(o)),"A"),E=r(async()=>{if(!l){l=!0;try{for(let o of $r){if(await e.sleep(o),!t||e.destroyed())return;let d=await e.refreshView().catch(()=>null);if(d!==null&&Q(d,{isMobile:e.isMobile()}).kind!=="processing")return}i=!0,j()}finally{l=!1}}},"T"),R=r(o=>{if(o.kind!=="liveness"||o.mode!=="selfie")return null;let d={kind:"processing",key:"processing",context:o.context,section:o.section,stalled:!1};if(w==="inflight")return d;if(!b||w==="done")return null;let u=e.keptFaceKey?.()??null;return u===null?null:(w="inflight",I("face_match",(h,k)=>h.submitCheck("face_match",{imageKey:u},{idempotencyKey:k}),()=>{w="done"}).then(()=>{w==="inflight"&&(w="done",j())},()=>{w="done",j()}),d)},"H"),L=r((o,d=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let u=Q(o,{isMobile:e.isMobile()});u.kind==="registry"&&u.recheck&&(b=!0,w="idle"),u=R(u)??u,u.kind==="processing"?u.stalled=i:i=!1;let h=M(u),k=u.kind==="result"?void 0:u.context.switchable,B=k===void 0?h:{...h,chooseOption:r(F=>N({nodeId:k.nodeId,kind:k.kind,selected:k.current,options:k.options},F),"chooseOption")},q=JSON.stringify(B);u.kind==="registry"&&u.source==="document"&&u.state==="pending"&&!v.has("registry")&&(v.add("registry"),B.confirm().catch(F=>{(!(F instanceof $)||Xr.has(F.code))&&v.delete("registry")})),!(!d&&q===a)&&(a=q,n=B,e.emitStep(B),u.kind==="processing"&&!i&&w!=="inflight"&&E(),u.kind==="result"&&!s&&(s=!0,e.emitResult(u.result)))},"R");function j(){let o=e.currentView();o!==null&&L(o,!0)}return r(j,"M"),{run:r(async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let o=await e.ensureView();return n===null&&L(o),n??M(Q(o,{isMobile:e.isMobile()}))},"run"),current:r(()=>n,"current"),onView:r(o=>L(o),"onView"),onChainIdle:r(()=>{let o=e.currentView();o!==null&&L(o)},"onChainIdle"),republish:j,submit:I,faceProbeSkipped:r(()=>m,"faceProbeSkipped")}}r(yt,"pr");function en(e){switch(e.kind){case"document":return"doc_ocr";case"liveness":return e.mode==="selfie"?"face_match":"liveness";case"portrait":return e.phase==="capture"?"portrait_icao":null;case"proof_of_address":return"poa";case"mobile_required":case"native_app_required":return e.checkType;case"unsupported":return e.checkType==="nfc_chip"?"nfc_chip":null;default:return null}}r(en,"On");function tn(e,t){let n=e,a=n?.plan?.steps??n?.steps;return Array.isArray(a)?a.some(i=>i.checkType===t&&typeof i.reason=="string"):!1}r(tn,"vn");var rn=2e4,nn=new Set(["media_type_unsupported","media_type_mismatch"]),gt=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function an(e){let t=null,n=Promise.resolve(),a=!1,i=null,l=null,s=!1,c=null,y=!1,v=!1,m=r(()=>{t?.controller.handle.destroy(),t=null},"I"),b=r(()=>{let g=e.currentView(),A=g===null?null:Q(g,{isMobile:e.isMobile()});return A?.kind==="portrait"?A:null},"r"),p=r(()=>{if(e.destroyed())return"self";let g=e.currentView(),A=g===null?void 0:re(g);return A==="self"||A==="assisted"?A:A==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??Ue(A??Be(g),null)},"a"),w=e.captureModeSwitch,T=w===void 0?void 0:{session:r(()=>{let g=e.currentView();return g!==null&&re(g)==="choice"?"choice":p()},"session"),onModeChange:r(g=>w.choose(g),"onModeChange")},S=r(async(g,A)=>{if(e.destroyed())return;let K=p();A.setFlowState("uploading"),a=!1;let V=null;try{await e.runner().submit("portrait_icao",async(D,H)=>{if(V===null){let f=await X(D,"image","image/jpeg",g.image.size,{engine:"portrait"});await D.uploadToSpaces(f.uploadUrl,g.image,"image/jpeg"),V=(await D.completeMedia(f.key)).key}A.setFlowState("checking");let _={media:{portrait:V},gate:ae(g.gate),...g.tuningVersion!==void 0?{tuningVersion:g.tuningVersion}:{},source:"camera",capture:{mode:K,facingMode:g.facingMode}};return D.submitCheck("portrait_icao",_,{idempotencyKey:H})})}catch(D){a=!0,D instanceof $&>.has(D.code)&&await e.refreshView?.().catch(()=>{})}if(A.setFlowState("done"),e.destroyed())return;let P=b();(P===null||P.phase!=="capture")&&t?.controller===A&&m(),e.runner().republish()},"v"),z=r(g=>e.runner().submit("face_match",(A,K)=>A.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:K})).then(()=>{},()=>{a=!0,g()}),"B"),I=null,O=r(async g=>{let A=b();if(A===null||A.phase!=="capture"||!A.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:K}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),V=await K(g,e.uploadInternals);if(e.destroyed())return;m(),a=!1;let P=null;try{await e.runner().submit("portrait_icao",async(D,H)=>{if(P===null){let f=await D.presign("image",V.contentType,V.blob.size,{source:"upload"});await D.uploadToSpaces(f.uploadUrl,V.blob,V.contentType),P=(await D.completeMedia(f.key)).key}let _={media:{portrait:P},source:"upload"};return D.submitCheck("portrait_icao",_,{idempotencyKey:H})})}catch(D){throw D instanceof $&&nn.has(D.code)?new TypeError("unsupported_file"):(D instanceof $&>.has(D.code)&&await e.refreshView?.().catch(()=>{}),D)}},"_"),U=null,N=r(g=>{if(U!==null)return U;let A=b();if(A===null||A.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let K={fixReview:{accept:g}},V=e.runner().submit("portrait_icao",(P,D)=>P.submitCheck("portrait_icao",K,{idempotencyKey:D})).catch(async P=>{throw P instanceof $&&P.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),P}).finally(()=>{U=null});return U=V,V},"O"),Z=r(g=>{let A=r(()=>O(g),"y"),K=(I===null?A():I.then(A,A)).finally(()=>{I===K&&(I=null)});return I=K,K},"j");return{bind:r((g,A)=>{if(g.phase==="review")return m(),{...g,uploadFailed:a,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(()=>{throw new Error("the adjusted photo waits for confirmFix()")},"capture"),uploadPortrait:r(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:N};if(g.phase==="match")return m(),i!==g.attemptsRemaining&&!a&&(i=g.attemptsRemaining,z(A)),{...g,uploadFailed:a,resubmit:r(()=>(a=!1,i=g.attemptsRemaining,A(),z(A)),"resubmit"),capture:r(()=>{throw new Error("the portrait was already accepted")},"capture"),uploadPortrait:r(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:N};if(i=null,g.reuse===!0&&g.phase==="capture")return m(),!y&&c!==g.attemptsRemaining&&(c=g.attemptsRemaining,y=!0,e.runner().submit("portrait_icao",(V,P)=>V.submitCheck("portrait_icao",{},{idempotencyKey:P})).then(()=>{v=!1},()=>{v=!0}).finally(()=>{y=!1,A()})),{kind:"processing",key:"processing",context:g.context,section:g.section,stalled:v&&!y,refresh:r(()=>(v=!1,c=null,A(),Promise.resolve()),"refresh")};let K=e.keptPortraitInput?.()??null;return K!==null&&(s||K!==l&&g.report===null&&g.reason===void 0&&!g.retakeOnly)?(s||(l=K,s=!0,e.runner().submit("portrait_icao",(V,P)=>V.submitCheck("portrait_icao",K,{idempotencyKey:P})).catch(()=>{}).finally(()=>{s=!1,A()})),{kind:"processing",key:"processing",context:g.context,section:g.section,stalled:!1,refresh:r(()=>Promise.resolve(),"refresh")}):{...g,uploadFailed:a,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(V=>{if(t!==null&&t.video===V.video)return t.controller.handle;m(),a=!1;let P=Ge({video:V.video,tuning:g.tuning,tuningVersion:g.tuningVersion,...g.icao!=null?{policy:g.icao.policy}:{},...V.keepScreenAwake!==void 0?{keepScreenAwake:V.keepScreenAwake}:{},...V.assetBaseUrl!==void 0?{assetBaseUrl:V.assetBaseUrl}:{}},e.internals,p,T);t={video:V.video,controller:P};let D=P.handle.destroy;P.handle.destroy=()=>{t?.controller===P&&(t=null),D()},P.handle.on("error",f=>{e.reportCaptureIssue?.(ue("portrait",f,0))});let H=!1,_=r((f,x)=>{let C=P.gateScores();C!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:f,...x!==null?{failing:x}:{},...C})},"l");return P.handle.on("gate",f=>{!H&&!f.ready&&(P.gateScores()?.elapsedMs??0)>=rn&&(H=!0,_("stuck",f.failing))}),P.handle.on("captured",f=>{_("captured",null),H=!1,n=n.then(()=>S(f,P)).catch(()=>{})}),P.handle},"capture"),uploadPortrait:Z,confirmFix:N}},"bind"),destroy:m}}r(an,"he");var on=.92,ln=r(()=>Fe("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:r(e=>navigator.mediaDevices.getUserMedia(e),"getUserMedia"),enumerateDevices:r(()=>navigator.mediaDevices.enumerateDevices(),"enumerateDevices")}),"Ee"),sn=r(e=>{let t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;let n=t.getContext("2d");return n===null||t.width===0||t.height===0?Promise.reject(new Error("the camera has no frame yet")):(n.drawImage(e,0,0,t.width,t.height),new Promise((a,i)=>t.toBlob(l=>l===null?i(new Error("the still could not be encoded")):a(l),"image/jpeg",on)))},"xe"),cn=r((e,t)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=t,e.play().catch(()=>{})}catch{}},"Oe");function dn(e){let t=null,n=null,a=r(b=>{let p=(n===null?b():n.then(b,b)).finally(()=>{n===p&&(n=null)});return n=p,p},"s"),i=r(()=>{t?.handle.destroy(),t=null},"d"),l=r(()=>{let b=e.currentView(),p=b===null?null:Q(b,{isMobile:e.isMobile()});return p?.kind==="proof_of_address"?p:null},"u"),s=r(async(b,p)=>{if(p.length===0)throw new RangeError("no_pages");if(p.length>b.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:w,prepareUploadFile:T}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),S=await Promise.all(p.map(I=>w(I)));if(S.includes("bad"))throw new TypeError("unsupported_file");if(S.includes("pdf")){if(p.length>1)throw new RangeError("too_many_pages");let I=p[0];if(I.size>b.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:I,contentType:"application/pdf"}]}let z=[];for(let I of p){let O=await T(I,e.uploadInternals);z.push({kind:"image",blob:O.blob,contentType:O.contentType})}return z},"f"),c=r(async(b,p,w)=>{let T=null;try{await e.runner().submit("poa",async(S,z)=>{if(T===null){let O=[];for(let U of w){let N=p==="upload"?await S.presign(U.kind,U.contentType,U.blob.size,{source:"upload"}):await X(S,U.kind,U.contentType,U.blob.size,{engine:"poa_page"});await S.uploadToSpaces(N.uploadUrl,U.blob,U.contentType),O.push((await S.completeMedia(N.key)).key)}T=O}let I=w[0]?.kind==="document_file"?{part:b,source:"upload",pdfKey:T[0]}:{part:b,source:p,imageKeys:T};return S.submitCheck("poa",I,{idempotencyKey:z})})}catch(S){throw S instanceof $&&(S.code==="media_type_unsupported"||S.code==="media_type_mismatch")?new TypeError("unsupported_file"):(S instanceof $&&(S.code==="document_upload_not_allowed"||S.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),S)}},"C"),y=r(async(b,p)=>{let w=l();if(w===null||!w.photo.uploadOffered)throw new RangeError("upload_not_offered");if(b==="holder_letter"&&w.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let T=await s(w,p);e.destroyed()||(i(),await c(b,"upload",T))},"E"),v=r((b,p)=>{let w=null,T=[],S=!0,z=r(()=>{for(let O of w?.getTracks()??[])O.stop();w=null},"B"),I={get pages(){return T},start:r(async()=>{if(!S||w!==null)return;let O=await(e.pageCamera?.open??ln)();if(!S){for(let U of O.getTracks())U.stop();return}w=O,(e.pageCamera?.attach??cn)(b,O)},"start"),takePage:r(async()=>{if(T.length>=p)throw new RangeError("too_many_pages");let O=await(e.pageCamera?.grab??sn)(b);if(T.length>=p)throw new RangeError("too_many_pages");return T=[...T,O],O},"takePage"),removePage:r(O=>{T=T.filter((U,N)=>N!==O)},"removePage"),submitPages:r(()=>a(async()=>{if(T.length===0)throw new RangeError("no_pages");let O=l();if(O===null)throw new RangeError("camera_not_offered");let U=O.phase==="holder_letter"?"holder_letter":"document";await c(U,"camera",T.map(N=>({kind:"image",blob:N,contentType:"image/jpeg"}))),t?.handle===I?i():I.destroy()}),"submitPages"),destroy:r(()=>{S=!1,T=[],z(),t?.handle===I&&(t=null)},"destroy")};return I},"M"),m=r(async()=>{let b=l();if(b===null||!b.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;i();let p={part:"document"};await e.runner().submit("poa",(w,T)=>w.submitCheck("poa",p,{idempotencyKey:T}))},"I");return{bind:r(b=>({...b,...b.licenceAddressAccepted?{useLicenceAddress:r(()=>a(m),"useLicenceAddress")}:{},uploadPages:r(p=>a(()=>y("document",p)),"uploadPages"),uploadHolderLetter:r(p=>a(()=>y("holder_letter",p)),"uploadHolderLetter"),capturePage:r(p=>{if(b.photo.source==="upload")throw new RangeError("camera_not_offered");if(t!==null&&t.video===p.video)return t.handle;i();let w=v(p.video,b.maxPages);return t={video:p.video,handle:w},w},"capturePage")}),"bind"),destroy:i}}r(dn,"we");function un(e,t){let n=e!==null&&typeof e=="object"?e:{};if(n.refuseExpired!==!0||typeof n.serverTime!="string")return null;let a=Date.parse(n.serverTime);return!Number.isFinite(a)||!Number.isFinite(t)||Math.abs(t-a)>864e5?null:new Date(a-1*864e5).toISOString().slice(0,10)}r(un,"be");function pn(e,t){let n=null,a=null,i=!1,l=null,s=null,c=[],y=r((m,b)=>{m.off=b.on(m.event,m.handler)},"E"),v=r(()=>(a??(a=e.then(m=>{if(i)return null;let b=t(m),p=b.handle;for(let w of c)w.removed||y(w,p);return l!==null&&p.setSide(l),s!==null&&p.setGuide(s.guide),n=b,p}).catch(()=>{if(a=null,!i)for(let m of c)!m.removed&&m.event==="error"&&m.handler({kind:"generic",retryable:!0});return null})),a),"M");return{handle:{get state(){return n?.handle.state??"idle"},on:r((m,b)=>{let p={event:m,handler:b,off:null,removed:!1};return c.push(p),n!==null&&y(p,n.handle),()=>{p.removed=!0,p.off?.()}},"on"),start:r(async()=>{let m=await v();m!==null&&!i&&await m.start()},"start"),retry:r(()=>{n!==null?n.handle.retry():v().then(m=>m?.start())},"retry"),setSide:r(m=>{n!==null?n.handle.setSide(m):l=m},"setSide"),shutter:r(()=>n?.handle.shutter(),"shutter"),setTorch:r(m=>n?.handle.setTorch(m),"setTorch"),focusAt:r((m,b)=>n?.handle.focusAt(m,b),"focusAt"),setGuide:r(m=>{n!==null?n.handle.setGuide(m):s={guide:m}},"setGuide"),destroy:r(()=>{i=!0,n?.handle.destroy(),c.length=0},"destroy")},get plan(){return n?.plan??null},setFlowState:r(m=>n?.setFlowState(m),"setFlowState"),settle:r((m,b)=>n?.settle(m,b),"settle"),takeDeviceRead:r(m=>n?.takeDeviceRead(m)??null,"takeDeviceRead")}}r(pn,"ve");var fn=1500,mn=["ID-1","ID-2","ID-3"],hn=["recto","verso","single"],yn=["td1","td2","td3"],gn=["pdf417","qr","datamatrix","aztec"],bn=["yes","no","some"],vn=["dmy","mdy","ymd"],_n=["gregorian","hijri","solar_hijri","thai_buddhist"],wn=24,ne=r(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"X"),ee=r((e,t)=>typeof e=="string"&&t.includes(e),"$"),bt=r((e,t)=>e===null||ee(e,t),"ke");function kn(e){if(!ne(e))return null;let{side:t,portrait:n,mrz:a,barcode:i,scripts:l}=e;return!ee(t,hn)||typeof n!="boolean"||!bt(a,yn)||!bt(i,gn)||!Array.isArray(l)||!l.every(s=>typeof s=="string")?null:{side:t,portrait:n,mrz:a,barcode:i,scripts:[...l]}}r(kn,"Ke");function xn(e){if(!ne(e))return null;let{id:t,format:n,mrzCode:a,chip:i,dates:l,sides:s}=e;if(typeof t!="string"||!ee(n,mn)||!(a===null||typeof a=="string")||!ee(i,bn)||!ne(l)||!ee(l.order,vn)||!ee(l.calendar,_n)||!Array.isArray(s)||s.length<1||s.length>2)return null;let c=s.map(kn);return c.some(y=>y===null)?null:{id:t,format:n,mrzCode:a,chip:i,dates:{order:l.order,calendar:l.calendar},sides:c}}r(xn,"$e");function Mn(e,t,n){if(!ne(e)||e.country!==t||e.documentType!==n)return null;let{version:a,series:i}=e;if(typeof a!="number"||!Number.isInteger(a)||!Array.isArray(i)||i.length>wn)return null;let l=i.map(xn);return l.some(s=>s===null)?null:{country:t,documentType:n,version:a,series:l}}r(Mn,"Ye");function Tn(e){return e.series.map(t=>({format:t.format,sides:t.sides}))}r(Tn,"Pe");function An(e){return ne(e)&&"success"in e&&"data"in e?e.data:e}r(An,"Xe");function Sn(e,t={}){let n=e;if(n===null||typeof n.apiOrigin!="string"||typeof n.sessionToken!="string")return;let a=n.apiOrigin,i=n.sessionToken,l=t.timeoutMs??fn;return(s,c)=>{let y=t.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(y===void 0)return Promise.resolve(null);let v=typeof AbortController=="function"?new AbortController:void 0,m,b=new Promise(w=>{m=setTimeout(()=>{v?.abort(),w(null)},l)}),p=(async()=>{let w=`country=${encodeURIComponent(s)}&type=${encodeURIComponent(c)}`,T=await y(`${a}/api/v2/hosted/document-facts?${w}`,{method:"GET",headers:{"x-session-token":i,"x-sekyro-sdk":`@sekyro/web/${de}`},cache:"default",...v!==void 0?{signal:v.signal}:{}});return T.ok?Mn(An(await T.json()),s,c):null})().catch(()=>null);return Promise.race([p,b]).finally(()=>clearTimeout(m))}}r(Sn,"Se");function Cn(e,t){let n=t!==null&&typeof t=="object"?t:{},a=r((i,l,s,c)=>typeof i=="number"&&Number.isFinite(i)&&i>=l&&i<=s?i:c,"s");return{guide:$e(he(e)),safetyNetMs:a(n.safetyNetMs,2e3,2e4,6e3),sideChangeMs:a(n.sideChangeMs,100,2e3,300)}}r(Cn,"We");function vt(e){let t=e;if(typeof t.apiOrigin!="string"||typeof t.sessionToken!="string")return;let n=`${t.apiOrigin}/api/v2/hosted/capture-reports`,a=t.sessionToken;return i=>{try{fetch(n,{method:"POST",headers:{"content-type":"application/json","x-session-token":a,"x-sekyro-sdk":`@sekyro/web/${de}`},body:JSON.stringify({reports:i}),keepalive:!0}).catch(()=>{})}catch{}}}r(vt,"Ce");function _t(e){let t=e.apiOrigin;return Je("sdk",typeof t=="string"&&/staging|sandbox|localhost/.test(t)?"sandbox":"live")}r(_t,"_e");function Pn(e){return _t(e).replace(/\/ocr$/,"/barcode")}r(Pn,"qe");function ei(e){let t=null,n=null,a={issuer:"",documentType:""},i=new Set(["document_type_mismatch","document_kind_not_accepted","document_type_not_accepted","document_type_not_supported"]),l=null,s=null,c=Se(),y=Promise.resolve(),v=r(()=>{s?.flow.handle.destroy(),s=null},"M"),m=null,b=r((_,f)=>new Promise(x=>{if(s?.flow!==_){x(!1);return}let C=r(M=>{m?.flow===_&&(m=null,x(M),e.destroyed()||t.republish())},"D");m={code:Ne(f)==="clock_wrong"?"clock_wrong":"failed",flow:_,retry:r(()=>C(!0),"retry"),end:C},t.republish()}),"r"),p=null,w=r(()=>e.documentInternals?.catalogCapture??e.currentView()?.capture?.document?.catalog===!0,"p"),T=r((_,f)=>{let x=`${_}:${f}`;if(p?.key===x)return p;if(p=null,!w()||e.documentInternals?.captureSeries!==void 0)return null;let C=e.documentFacts??Sn(e.runtime.client);if(C===void 0)return null;let M={key:x,promise:Promise.resolve(null),settled:!1,value:null};return M.promise=C(_,f).catch(()=>null).then(E=>(M.value=E,M.settled=!0,E)),p=M,M},"g"),S=r(_=>_===null?{}:{documentType:_.documentType,documentCountry:_.issuer},"v"),z=r(async(_,f,x)=>{if(e.destroyed())return;f.setFlowState("uploading");let C=null,M=S(x),E,R=!1,L=!1,j=e.currentView()?.documents!==void 0,o=r(()=>t.submit("doc_ocr",async(k,B)=>{if(C===null){let F=await X(k,"image","image/jpeg",_.image.size,{engine:"document"});await k.uploadToSpaces(F.uploadUrl,_.image,"image/jpeg"),C=(await k.completeMedia(F.key)).key}f.setFlowState("checking"),E===void 0&&(E=f.takeDeviceRead(_));let q=await k.submitCheck("doc_ocr",{imageKey:C,side:_.side,...E!==null?{deviceRead:E}:{},...j?{source:"camera"}:{},...M},{idempotencyKey:B});return l=x,q}),"S");try{for(;;)try{await o();break}catch(k){if(e.destroyed()||!(k instanceof $)||k.code!=="attestation_invalid")throw k;if(!await b(f,k)){L=!0;break}}}catch{R=!0}finally{f.setFlowState("done")}if(e.destroyed()||L)return;if(R){f.settle(_.side,{ok:!1,issue:"technical"});return}let d=e.currentView(),u=d===null?null:Q(d,{isMobile:e.isMobile()});if(u?.kind!=="document"){f.settle(_.side,{ok:!0}),s?.flow===f?v():f.handle.destroy();return}if(l=u.reason!==void 0?x:null,u.reason==="document_type_not_accepted"||u.reason==="document_type_not_supported"){n=null,s?.flow===f&&v(),t.republish();return}let h=u.acceptedSides;_.side!=="single"&&u.side!==_.side&&(h.includes(_.side)||u.reason==="side_missing")&&!(h.includes("recto")&&h.includes("verso"))?(f.settle(_.side,{ok:!0}),n?.documentType!=="passport"&&f.handle.setSide(u.side)):_.side!=="single"&&h.length===0?(f.settle(_.side,{ok:!1,issue:"reread"}),f.handle.retry()):f.settle(_.side,{ok:!1,issue:"reread"})},"B"),I=null,O=r(async _=>{let f=e.currentView(),x=f===null?null:Q(f,{isMobile:e.isMobile()});if(f===null||x?.kind!=="document")throw new RangeError("upload_not_offered");if(!x.photo.uploadOffered)throw new RangeError("upload_not_offered");let C=n,M=C?.documentType==="passport"?"single":x.side,{prepareUploadFile:E}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),R=await E(_,e.uploadInternals);if(e.destroyed())return;v();let L=null,j=S(C);try{await t.submit("doc_ocr",async(o,d)=>{if(L===null){let h=await o.presign("image",R.contentType,R.blob.size,{source:"upload"});await o.uploadToSpaces(h.uploadUrl,R.blob,R.contentType),L=(await o.completeMedia(h.key)).key}let u=await o.submitCheck("doc_ocr",{imageKey:L,side:M,source:"upload",...j},{idempotencyKey:d});return l=C,u})}catch(o){throw o instanceof $&&(o.code==="media_type_unsupported"||o.code==="media_type_mismatch")?new TypeError("unsupported_file"):(o instanceof $&&(o.code==="document_upload_not_allowed"||o.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),o)}},"_"),U=r((_,f)=>{_.reason===void 0?l=null:l===null&&(l=n??(i.has(_.reason)?a:null));let x=n!==null&&l!==null&&(l===a||n.issuer!==l.issuer||n.documentType!==l.documentType),C={..._};return x&&delete C.reason,{...C,...x?{reasonHidden:!0}:{},...m!==null?{browserCheck:{code:m.code,retry:m.retry}}:{},uploadDocument:r(M=>{let E=r(()=>O(M),"w"),R=(I===null?E():I.then(E,E)).finally(()=>{I===R&&(I=null)});return I=R,R},"uploadDocument"),issuer:n?.issuer??null,documentType:n?.documentType??null,captureSide:n===null?null:n.documentType==="passport"?"single":_.side,selectDocument:r((M,E)=>{if(!it(_.documents).includes(M)||!_e(_.documents,M).includes(E))throw new RangeError(`${E} from ${M} is not accepted`);(n?.issuer!==M||n.documentType!==E)&&v(),n={issuer:M,documentType:E},T(M,E),f()},"selectDocument"),capture:r(M=>{if(n===null)throw new Error("selectDocument() first");if(s!==null&&s.video===M.video)return s.flow.handle;v();let E=n,R=E.documentType==="passport"?"single":_.acceptedSides.length>0?_.side:void 0,L=r(u=>We({video:M.video,documentType:E.documentType,issuer:E.issuer,...R!==void 0?{side:R}:{},...M.keepScreenAwake!==void 0?{keepScreenAwake:M.keepScreenAwake}:{},...M.liveMrz!==void 0?{liveMrz:M.liveMrz}:{},...M.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:M.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let h=e.currentView()?.capture?.document,k=e.documentInternals?.blurRefuseSharpnessMax??h?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:He(h?.camera),shutter:Ze(h?.scan),guideLock:he(h?.guide),...e.documentInternals?.engineOptions??{}},...typeof k=="number"&&Number.isFinite(k)&&k>=0&&k<=1?{blurRefuseSharpnessMax:k}:{},catalogCapture:e.documentInternals?.catalogCapture??h?.catalog===!0,...u!==null&&e.documentInternals?.captureSeries===void 0?{captureSeries:Tn(u)}:{},...h?.secondSide?.enabled===!0&&e.documentInternals?.secondSide===void 0?{secondSide:Cn(h.guide,h.scan)}:{},...(()=>{if(e.documentInternals?.expiredBefore!==void 0)return{};let B=un(h,Date.now());return B===null?{}:{expiredBefore:B}})()}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:Pn(e.runtime.client)}},...(()=>{let h=e.currentView();if(h===null||e.documentInternals?.webOcr!==void 0)return{};let k=vt(e.runtime.client);return{webOcr:{captureDocument:h.capture?.document,salt:h.sessionId,baseUrl:_t(e.runtime.client),...k!==void 0?{reports:k}:{}}}})()}),"H"),j=T(E.issuer,E.documentType),o=j===null||j.settled?L(j?.value??null):pn(j.promise,L);s={video:M.video,flow:o};let d=o.handle.destroy;return o.handle.destroy=()=>{s?.flow===o&&(s=null),d(),m?.flow===o&&m.end(!1)},c.newHandle(),o.handle.on("state",u=>c.note(u)),o.handle.on("error",u=>{c.noteError(),e.reportCaptureIssue?.(ue("document",u,c.value))}),o.handle.on("captured",u=>{y=y.then(()=>z(u,o,E)).catch(()=>{})}),o.handle},"capture")}},"T"),N=null,Z=null,g=new Set,A=e.runtime.client;e.runtime.client=new Proxy(A,{get(_,f){if(f==="submitCheck")return(Z??_).submitCheck.bind(Z??_);let x=Reflect.get(_,f);return typeof x=="function"?x.bind(_):x}});let K=r(()=>{N?.destroy(),N=null,Z=null},"y"),V=r(_=>{let f=e.currentView(),x=f===null?null:Q(f,{isMobile:e.isMobile()});if(f===null||x?.kind!=="liveness"||x.livePhoto?.icao!==!0)return;if(N===null){let R=at({tuning:f.capture?.icao??null,tuningVersion:f.capture?.tuningVersion??null,...x.icao!=null?{policy:x.icao.policy}:{},still:x.livePhoto.still,..._.assetBaseUrl!==void 0?{assetBaseUrl:_.assetBaseUrl}:{}},e.livePhotoInternals);N=R,Z=R.decorate(A),R.onGate(L=>{for(let j of g)j(L)})}let C=N,M=e.baseCapture??{},E=M.engineOptions?.telemetry;return{...M,engineOptions:{...M.engineOptions??{},measureQuality:C.engineOptions.measureQuality,telemetry:r(R=>{E?.(R),C.engineOptions.telemetry(R)},"telemetry")}}},"x"),P=an({keptPortraitInput:r(()=>N?.lastPortraitInput()??null,"keptPortraitInput"),runner:r(()=>t,"runner"),currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:r(()=>e.refreshView(),"refreshView"),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:r(_=>vt(e.runtime.client)?.([_]),"reportGate")}),D=dn({runner:r(()=>t,"runner"),currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:r(()=>e.refreshView(),"refreshView")}),H=yt({...e,bindDocument:U,bindPortrait:P.bind,bindProofOfAddress:D.bind,stopCameras:r(()=>{v(),P.destroy(),D.destroy(),K(),e.stopLiveness?.()},"stopCameras"),onLivePhoto:r(_=>(g.add(_),()=>g.delete(_)),"onLivePhoto")});return t=H,{...H,captureInternals:V,destroy:r(()=>{v(),P.destroy(),D.destroy(),K(),g.clear()},"destroy")}}r(ei,"At");export{Pn as barcodeAssetBase,ei as createPlanRunner,vt as reportSink,_t as sdkAssetBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as N}from"./chunk-
|
|
1
|
+
"use client";import{a as N}from"./chunk-677IJRH3.js";import"./chunk-L7I27OCG.js";import{a as te}from"./chunk-HPTNANWX.js";import{c as X}from"./chunk-BO327WCQ.js";import{a as ae,b as re,c as ie}from"./chunk-CYEDFGUG.js";import"./chunk-RH466MDF.js";import"./chunk-FQHV53QQ.js";import"./chunk-X6LDVTUQ.js";import"./chunk-Z6OYPC4S.js";import{C as Y,H as Z,L as f,M as ee,a as ke,b as ye,c as C,t as Q}from"./chunk-BMTTAXWY.js";import"./chunk-PZVVXMQ6.js";import"./chunk-32CNXSJQ.js";import"./chunk-U7QPOSFH.js";import"./chunk-P7K7ELYZ.js";import{a as n}from"./chunk-5QL6W6FW.js";import"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-SLLJX5QK.js";import{a as S,c as O}from"./chunk-4FHWXBOB.js";var i=O(ke(),1),e=O(ye(),1);var x=["pose","eyes","mouth","lighting","background","resolution"],se="occlusion";function le(r){return r?.startsWith("icao_")===!0?r.slice(5):null}S(le,"Se");n(le,"reasonCriterion");function ve({step:r,i18n:c,assetBaseUrl:M,onUpload:P}){let{t:a}=c,B=(0,i.useRef)(null),p=(0,i.useRef)(null),[s,oe]=(0,i.useState)("idle"),[k,L]=(0,i.useState)(null),[_,y]=(0,i.useState)(null),[$,E]=(0,i.useState)({facing:"user",assisted:!1}),[F,ne]=(0,i.useState)(!1),[de,I]=(0,i.useState)(!1),[j,ce]=(0,i.useState)(!1),pe=Q(),T=(0,i.useContext)(Y),U=(0,i.useContext)(ae),A=(0,i.useRef)(U);A.current=U,(0,i.useEffect)(()=>{let t=B.current;if(t===null)return;let l=r.capture({video:t,...M!==void 0?{assetBaseUrl:M}:{}});p.current=l;let g=n(()=>E({facing:l.facingMode??"user",assisted:l.captureMode==="assisted"}),"readCamera");g();let fe=[l.on("state",o=>{g(),o==="mode_switch"?I(!0):o!=="starting"&&o!=="gating"&&I(!1),oe(o)}),l.on("gate",L),l.on("error",o=>{y(o);let K=A.current;K!==null&&ie(K,re("portrait",o,0))})],J=!0;return Promise.resolve(l.canSwitchCaptureMode?.()??!1).catch(()=>!1).then(o=>{J&&ne(o===!0)}),l.start().catch(()=>{}),()=>{J=!1;for(let o of fe)o();l.destroy(),p.current=null}},[]);let u=s==="uploading"||s==="checking",h=s==="done",v=h&&r.reason!==void 0&&!r.uploadFailed,ue=s==="starting"||s==="idle"||s==="mode_switch"?"portrait.starting":s==="captured"?"portrait.taken":s==="uploading"?"portrait.uploading":s==="checking"?"portrait.checking":`portrait.coach.${k?.coach??"no_face"}`,R=(r.report??[]).filter(t=>!t.pass),V=r.reason!==void 0?`reasons.${r.reason}`:null,m=le(r.reason),q=R.filter(t=>t.criterion!==m),H=new Set([...R.map(t=>t.criterion),...m!==null?[m]:[]]),he=H.has(se),W=n(()=>{y(null),p.current?.retry()},"retake"),w=n(t=>{let l=k?.criteria.find(g=>g.criterion===t);return l!==void 0&&(l.held||l.waived)},"met"),me=k?.ready||s==="captured"||u?1:x.filter(w).length/x.length;v&&!j&&ce(!0);let z=V!==null&&(v||s==="gating"&&(m===null||!j)),ge=!v,D=s==="starting"||s==="gating"||s==="error"||s==="mode_switch",d=$.assisted?"self":"assisted",G=F&&D?{to:d,label:a(d==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelfPhoto"),description:a(d==="assisted"?"capture.modeSwitch.toAssistedLabelPhoto":"capture.modeSwitch.toSelfLabelPhoto"),onSwitch:n(()=>{let t=p.current;t?.setCaptureMode(d).then(l=>{l&&(y(null),L(null),E({facing:t.facingMode??"user",assisted:d==="assisted"}))})},"onSwitch")}:null,b=de&&D?a("capture.modeSwitch.restarted"):null;return(0,e.jsxs)(te,{testId:"sekyro-portrait",video:(0,e.jsx)("video",{ref:B,className:`sekyro-lm-video sekyro-fc-video${$.facing==="environment"?" is-rear":""}`,playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),instruction:a(ue),...b!==null?{note:b}:{},...F?{status:b}:{},progress:me,closeLabel:a("native.close"),...T!==void 0?{onClose:T}:{},...G!==null?{end:(0,e.jsx)(X,{view:G,className:"sekyro-glass sekyro-glass--label"})}:{},children:[(0,e.jsx)("h2",{ref:pe,tabIndex:-1,className:"sekyro-visually-hidden",children:a(r.reason!==void 0?"portrait.retryTitle":"session.steps.portrait.title")}),z||_!==null||h&&(r.uploadFailed||!r.attemptsExhausted)?(0,e.jsxs)("div",{className:"sekyro-fc-panel",children:[z?(0,e.jsxs)(f,{tone:"warning",children:[(0,e.jsx)("span",{children:N(c)(V)||a("portrait.retryTitle")}),q.length>0?(0,e.jsxs)("span",{children:[a("portrait.reportTitle"),": ",q.map(t=>a(`portrait.report.${t.criterion}`)).join(", ")]}):null,(0,e.jsx)("span",{children:ee(c,r.attemptsRemaining,r.attemptsExhausted)})]}):null,_!==null?(0,e.jsxs)(f,{tone:"danger",children:[(0,e.jsx)("span",{children:a("portrait.cameraBlocked")}),(0,e.jsx)("span",{children:a("portrait.cameraBlockedHint")}),(0,e.jsx)(C,{kind:"secondary",onClick:W,children:a("portrait.retryCamera")})]}):null,r.uploadFailed&&h?(0,e.jsx)(f,{tone:"danger",children:(0,e.jsx)("span",{children:a("portrait.uploadFailed")})}):null,h&&!r.attemptsExhausted?(0,e.jsx)(C,{full:!0,onClick:W,disabled:u,children:a("portrait.retake")}):null]}):null,ge?(0,e.jsxs)("ul",{className:"sekyro-fc-checks","aria-label":a("portrait.checksLabel"),children:[x.map(t=>(0,e.jsxs)("li",{className:w(t)?"is-met":H.has(t)?"is-flagged":void 0,"data-criterion":t,children:[(0,e.jsx)("span",{className:"sekyro-fc-mark","aria-hidden":"true",children:(0,e.jsx)("svg",{viewBox:"0 0 18 18",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})}),(0,e.jsx)("span",{children:a(`portrait.criteria.${t}`)}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",children:a(w(t)?"portrait.met":"portrait.notMet")})]},t)),he?(0,e.jsxs)("li",{className:"is-flagged","data-criterion":se,children:[(0,e.jsx)("span",{className:"sekyro-fc-mark","aria-hidden":"true",children:(0,e.jsx)("svg",{viewBox:"0 0 18 18",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})}),(0,e.jsx)("span",{children:a("portrait.report.occlusion")}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",children:a("portrait.notMet")})]}):null]}):null,P!==void 0&&!u?(0,e.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:P,"data-testid":"sekyro-portrait-upload-instead",children:N(c)("portrait.source.uploadInstead")}):null,u?null:(0,e.jsx)(Z,{})]})}S(ve,"Le");n(ve,"PortraitCaptureView");export{ve as PortraitCaptureView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as r,b as t,c as i,d as o,e as a}from"./chunk-
|
|
1
|
+
"use client";import{a as r,b as t,c as i,d as o,e as a}from"./chunk-677IJRH3.js";import"./chunk-L7I27OCG.js";import"./chunk-X6LDVTUQ.js";import"./chunk-Z6OYPC4S.js";import"./chunk-BMTTAXWY.js";import"./chunk-5QL6W6FW.js";import"./chunk-4FHWXBOB.js";export{o as PortraitReviewView,a as PortraitScreens,t as PortraitSourceView,i as PortraitUploadView,r as portraitCopy};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as J}from"./chunk-SIBJ56BG.js";import{a as S}from"./chunk-PAU2BFT7.js";import{a as q}from"./chunk-4VHWJD57.js";import"./chunk-RTCZJKYC.js";import{d as M}from"./chunk-6H2SLOEK.js";import"./chunk-K2JDLIFO.js";import{L as b,M as G,a as O,b as j,c as k,v as N,w as D,y as R}from"./chunk-PLWGAXYM.js";import{a as p}from"./chunk-5QL6W6FW.js";import{a as l,c as x}from"./chunk-4FHWXBOB.js";var v=x(O(),1),f=x(O(),1),o=x(j(),1),t=x(j(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},U={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function B({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}l(B,"Q");p(B,"PageThumb");function $({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:i}){let y=(0,f.useRef)(null),s=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,F]=(0,f.useState)(!1),A=p(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return s.current=g,A(g),()=>{g.destroy(),s.current=null}},[]);let E=c.length>=a.maxPages,Q=p(async()=>{let u=s.current;if(!(u===null||E)){C("taking"),F(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=p(u=>{let g=s.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=p(async()=>{let u=s.current;if(!(u===null||c.length===0)){C("sending"),F(!1);try{await u.submitPages()}catch{F(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),s.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:l(()=>s.current!==null&&A(s.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(B,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:l(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:l(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(N,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:l(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,i!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:i,disabled:T,children:e("poa.source.upload")}):null]})]})}l($,"J");p($,"PageCamera");var te={en:U,fr:ae,ar:ee,es:U,pt:U,de:U},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>q(n[r]??e[r]??"",d)}l(V,"ae");p(V,"poaCopy");function z({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:G(n,a.attemptsRemaining,a.attemptsExhausted)})]})}l(z,"U");p(z,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:J(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(i=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${i.kind}`)||i.kind,days:i.maxAgeDays})},i.kind))})]})}l(w,"j");p(w,"AcceptedList");var re={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}l(W,"re");p(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[i,y]=(0,v.useState)("idle"),s=i==="sending",c=p(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),i==="idle"||s?(0,t.jsx)(z,{step:a,i18n:n,c:e}):null,i!=="idle"&&!s?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(re[i])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),s?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:l(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:l(()=>m.current?.click(),"onClick"),disabled:s||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":s||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:s,children:[(0,t.jsx)(N,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}l(H,"se");p(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=p(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:l(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}l(Y,"de");p(Y,"LicenceShortcut");function ne({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",i=a.photo.source,y=i==="choice"?r??a.photo.pick:i,s=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(S,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(s?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:s,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),onCamera:l(()=>d("camera"),"onCamera"),onUpload:l(()=>d("upload"),"onUpload")}):y==="camera"&&s?h=(0,t.jsx)(M,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)($,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...i==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...i==="choice"?{onCamera:p(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}l(ne,"we");p(ne,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,ne as ProofOfAddressView,V as poaCopy};
|
|
1
|
+
"use client";import{a as J}from"./chunk-SIBJ56BG.js";import{a as S}from"./chunk-L7I27OCG.js";import{a as q}from"./chunk-MXMEO2IW.js";import"./chunk-FQHV53QQ.js";import{d as M}from"./chunk-X6LDVTUQ.js";import"./chunk-Z6OYPC4S.js";import{L as b,M as G,a as O,b as j,c as k,v as N,w as D,y as R}from"./chunk-BMTTAXWY.js";import{a as p}from"./chunk-5QL6W6FW.js";import{a as l,c as x}from"./chunk-4FHWXBOB.js";var v=x(O(),1),f=x(O(),1),o=x(j(),1),t=x(j(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},U={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function B({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}l(B,"Q");p(B,"PageThumb");function $({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:i}){let y=(0,f.useRef)(null),s=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,F]=(0,f.useState)(!1),A=p(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return s.current=g,A(g),()=>{g.destroy(),s.current=null}},[]);let E=c.length>=a.maxPages,Q=p(async()=>{let u=s.current;if(!(u===null||E)){C("taking"),F(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=p(u=>{let g=s.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=p(async()=>{let u=s.current;if(!(u===null||c.length===0)){C("sending"),F(!1);try{await u.submitPages()}catch{F(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),s.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:l(()=>s.current!==null&&A(s.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(B,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:l(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:l(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(N,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:l(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,i!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:i,disabled:T,children:e("poa.source.upload")}):null]})]})}l($,"J");p($,"PageCamera");var te={en:U,fr:ae,ar:ee,es:U,pt:U,de:U},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>q(n[r]??e[r]??"",d)}l(V,"ae");p(V,"poaCopy");function z({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:G(n,a.attemptsRemaining,a.attemptsExhausted)})]})}l(z,"U");p(z,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:J(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(i=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${i.kind}`)||i.kind,days:i.maxAgeDays})},i.kind))})]})}l(w,"j");p(w,"AcceptedList");var re={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}l(W,"re");p(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[i,y]=(0,v.useState)("idle"),s=i==="sending",c=p(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),i==="idle"||s?(0,t.jsx)(z,{step:a,i18n:n,c:e}):null,i!=="idle"&&!s?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(re[i])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),s?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:l(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:l(()=>m.current?.click(),"onClick"),disabled:s||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":s||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:s,children:[(0,t.jsx)(N,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}l(H,"se");p(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=p(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:l(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}l(Y,"de");p(Y,"LicenceShortcut");function ne({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",i=a.photo.source,y=i==="choice"?r??a.photo.pick:i,s=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(S,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(s?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:s,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),onCamera:l(()=>d("camera"),"onCamera"),onUpload:l(()=>d("upload"),"onUpload")}):y==="camera"&&s?h=(0,t.jsx)(M,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)($,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...i==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...i==="choice"?{onCamera:p(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}l(ne,"we");p(ne,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,ne as ProofOfAddressView,V as poaCopy};
|
package/dist/cdn/define.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./chunks/chunk-
|
|
1
|
+
import{g as e}from"./chunks/chunk-2GVFM77I.js";import"./chunks/chunk-LHYSCL4T.js";import"./chunks/chunk-ZJNLNYA5.js";import"./chunks/chunk-K67DQTFL.js";import"./chunks/chunk-BWOTZKA7.js";import"./chunks/chunk-MXMEO2IW.js";import"./chunks/chunk-HPTNANWX.js";import"./chunks/chunk-BO327WCQ.js";import"./chunks/chunk-CYEDFGUG.js";import"./chunks/chunk-RH466MDF.js";import"./chunks/chunk-FQHV53QQ.js";import"./chunks/chunk-X6LDVTUQ.js";import"./chunks/chunk-Z6OYPC4S.js";import"./chunks/chunk-BMTTAXWY.js";import"./chunks/chunk-PZVVXMQ6.js";import"./chunks/chunk-32CNXSJQ.js";import"./chunks/chunk-U7QPOSFH.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-6MYG4HWP.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-SLLJX5QK.js";import"./chunks/chunk-4FHWXBOB.js";e();export{e as defineSekyroElements};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-
|
|
1
|
+
import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-2GVFM77I.js";import"./chunks/chunk-LHYSCL4T.js";import"./chunks/chunk-ZJNLNYA5.js";import"./chunks/chunk-K67DQTFL.js";import"./chunks/chunk-BWOTZKA7.js";import"./chunks/chunk-MXMEO2IW.js";import"./chunks/chunk-HPTNANWX.js";import"./chunks/chunk-BO327WCQ.js";import"./chunks/chunk-CYEDFGUG.js";import{a as n}from"./chunks/chunk-RH466MDF.js";import"./chunks/chunk-FQHV53QQ.js";import"./chunks/chunk-X6LDVTUQ.js";import"./chunks/chunk-Z6OYPC4S.js";import"./chunks/chunk-BMTTAXWY.js";import"./chunks/chunk-PZVVXMQ6.js";import"./chunks/chunk-32CNXSJQ.js";import"./chunks/chunk-U7QPOSFH.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-6MYG4HWP.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-SLLJX5QK.js";import"./chunks/chunk-4FHWXBOB.js";export{r as ATTRIBUTES,i as EVENTS,t as PROPERTIES,o as SLOTS,a as SekyroVerificationElement,e as TAG_NAME,n as createVerification,f as defineSekyroElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j}from"./chunk-
|
|
1
|
+
import{a as j}from"./chunk-3NYC5YLB.js";import{d as U}from"./chunk-2ZWLZDO2.js";import{L as k,M as I,a as A,b as V,c as h,v as T,w as _,y as C}from"./chunk-YUZW7NSK.js";import{a as s,c as N,i as n}from"./chunk-SSU37LFQ.js";var f=N(A(),1),e=N(V(),1);var D={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."},y={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."},G={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."},H={en:y,fr:G,ar:D,es:y,pt:y,de:y},S="image/jpeg,image/png,image/heic,image/heif";function m(r){let o=r.strings,a=H[r.locale];return t=>o[t]??a[t]??""}s(m,"v");n(m,"portraitCopy");function b({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let a=m(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return(0,e.jsxs)(k,{tone:"warning",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:I(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(b,"R");n(b,"ReasonNotice");function z({step:r,i18n:o,onCamera:a,onUpload:t}){let i=m(o),p=r.photo?.cameraOnPhone===!0;return(0,e.jsx)(j,{testId:"sekyro-portrait-source",title:i("portrait.source.title"),lead:i("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):i("portrait.source.camera"),onPhone:p,uploadLabel:i("portrait.source.upload"),notice:(0,e.jsx)(b,{step:r,i18n:o}),onCamera:a,onUpload:t})}s(z,"z");n(z,"PortraitSourceView");function R({step:r,i18n:o,onCamera:a}){let t=m(o),i=(0,f.useRef)(null),[p,v]=(0,f.useState)("idle"),u=p==="sending",d=r.photo?.uploadOffered===!0,g=n(async c=>{let x=c.currentTarget.files?.[0];if(c.currentTarget.value="",x!==void 0){v("sending");try{await r.uploadPortrait(x),v("idle")}catch(w){v(w instanceof TypeError&&w.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[(0,e.jsx)(_,{title:t("portrait.upload.title"),lead:t("portrait.upload.hint")}),p==="idle"||p==="sending"?(0,e.jsx)(b,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?(0,e.jsx)(k,{tone:"warning",children:(0,e.jsx)("span",{children:t(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,(0,e.jsx)("input",{ref:i,type:"file",accept:S,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":t("portrait.upload.title"),onChange:s(c=>{g(c)},"onChange")}),(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>i.current?.click(),"onClick"),disabled:u||!d||r.attemptsExhausted,children:t("portrait.upload.choose")}),a!==void 0?(0,e.jsxs)(h,{full:!0,kind:"ghost",onClick:a,disabled:u,children:[(0,e.jsx)(T,{name:"camera"}),t("portrait.source.camera")]}):null]})]})}s(R,"A");n(R,"PortraitUploadView");function E({step:r,i18n:o,onDeclined:a}){let t=m(o),[i,p]=(0,f.useState)(!1),[v,u]=(0,f.useState)(!1),d=r.pendingFix;if(d==null)return null;let g=n(async l=>{p(!0),u(!1);try{await r.confirmFix(l),l||a?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?t("portrait.review.uploadAnother"):t("portrait.review.retake"),x=n(l=>t(`portrait.fixes.${l}`)||l,"fixName"),w=t("portrait.review.original"),P=t("portrait.review.fixed");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[(0,e.jsx)(_,{title:t("portrait.review.title"),lead:t("portrait.review.description")}),(0,e.jsxs)("div",{className:"sekyro-portrait-pair",children:[(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.originalUrl,alt:w}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:w})]}),(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.fixedUrl,alt:P}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:P})]})]}),d.fixes.length>0?(0,e.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,e.jsx)("p",{className:"sekyro-text-body",children:t("portrait.review.fixesTitle")}),(0,e.jsx)("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:d.fixes.map(l=>(0,e.jsx)("li",{children:x(l)},l))})]}):null,v?(0,e.jsx)(k,{tone:"danger",children:(0,e.jsx)("span",{children:o.t("errors.network_error")})}):null,(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>{g(!0)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-accept",children:t("portrait.review.accept")}),(0,e.jsx)(h,{full:!0,kind:"ghost",onClick:s(()=>{g(!1)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(E,"j");n(E,"PortraitReviewView");function q({screen:r,step:o,i18n:a,onCamera:t,onUpload:i,onDeclined:p}){return r==="phone"?(0,e.jsx)(U,{i18n:a,lead:a.t("handoff.lead.portrait"),refresh:o.refresh,actions:(0,e.jsx)(h,{kind:"ghost",full:!0,onClick:i,children:m(a)("portrait.source.upload")})}):r==="review"?(0,e.jsx)(E,{step:o,i18n:a,onDeclined:p}):r==="upload"?(0,e.jsx)(R,{step:o,i18n:a,...t!==void 0?{onCamera:t}:{}}):(0,e.jsx)(z,{step:o,i18n:a,onCamera:t??i,onUpload:i})}s(q,"Q");n(q,"PortraitScreens");export{m as a,z as b,R as c,E as d,q as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-UJM3T4QD.js";import{L as b,a as k,b as y,c as x}from"./chunk-YUZW7NSK.js";import{a as c,c as f,i as n}from"./chunk-SSU37LFQ.js";var l=f(k(),1),t=f(k(),1),w=f(k(),1),r=f(y(),1),e=f(y(),1);var i,C=(i=class extends w.Component{constructor(){super(...arguments),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}},c(i,"c"),i);n(C,"LoadBoundary");var j=C,F={load:n(()=>import("./flow-views-NBUWHG7J-PO2CMTIF.js"),"load")};function S({view:s,i18n:a,quiet:o,...m}){let[d,h]=(0,t.useState)(0),u=(0,t.useMemo)(()=>(0,t.lazy)(()=>F.load().then(v=>({default:v[s]}))),[s,d]),p=(0,r.jsxs)(b,{tone:"danger",children:[(0,r.jsx)("span",{children:a.t("errors.network_error")}),(0,r.jsx)(x,{kind:"secondary",onClick:c(()=>h(v=>v+1),"onClick"),children:a.t("common.retry")})]});return(0,r.jsx)(j,{fallback:p,children:(0,r.jsx)(t.Suspense,{fallback:o===!0?null:(0,r.jsx)("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:(0,r.jsx)(u,{...m,i18n:a})})},d)}c(S,"k");n(S,"Flow");var q=(0,l.createContext)(void 0);function B({i18n:s,lead:a,refresh:o,actions:m}){let d=(0,l.useContext)(q),[h,u]=(0,l.useState)(!1);if(d!==void 0)return(0,e.jsx)(S,{view:"HandoffView",i18n:s,url:d,lead:a,...o!==void 0?{refresh:o}:{},footer:m});let p=n(()=>{o!==void 0&&(u(!0),o().catch(()=>{}).finally(()=>u(!1)))},"again");return(0,e.jsx)(g,{tone:"brand",icon:"smartphone",title:s.t("handoff.title"),testId:"sekyro-phone-handoff",actions:(0,e.jsxs)(e.Fragment,{children:[m,o!==void 0?(0,e.jsx)(x,{kind:"secondary",full:!0,disabled:h,onClick:p,children:s.t("common.refresh")}):null]}),children:(0,e.jsx)("p",{children:a})})}c(B,"K");n(B,"PhoneHandoff");export{j as a,S as b,q as c,B as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,c as t,v as s,w as i,y as l}from"./chunk-
|
|
1
|
+
import{b,c as t,v as s,w as i,y as l}from"./chunk-YUZW7NSK.js";import{a as o,c as k,i as r}from"./chunk-SSU37LFQ.js";var a=k(b(),1);function x({title:n,lead:d,cameraLabel:c,uploadLabel:m,notice:p,testId:e,onCamera:h,onUpload:u,onPhone:f=!1}){return(0,a.jsxs)("section",{className:"sekyro-step","data-testid":e,children:[(0,a.jsx)(i,{title:n,lead:d}),p,(0,a.jsxs)(l,{children:[(0,a.jsxs)(t,{full:!0,onClick:h,"data-testid":`${e}-camera`,children:[(0,a.jsx)(s,{name:f?"smartphone":"camera"}),c]}),(0,a.jsx)(t,{full:!0,kind:"ghost",onClick:u,"data-testid":`${e}-upload`,children:m})]})]})}o(x,"k");r(x,"PhotoSourceView");export{x as a};
|