@sekyro/elements 0.1.0-rc.2 → 0.1.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +176 -0
- package/README.md +8 -9
- package/custom-elements.json +2 -2
- package/dist/cdn/chunks/barcode-detect-C5IOXMKI-ZOZ2WOWU.js +1 -0
- package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
- package/dist/cdn/chunks/capture-session-doc-HZJLTWTY-XAP4ZT6R.js +1 -0
- package/dist/cdn/chunks/challenge-frame-YBTLAQ5G-NN763UU5.js +1 -0
- package/dist/cdn/chunks/chunk-4QUL7TEF.js +1 -0
- package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-5JSOPXYS.js} +1 -1
- package/dist/cdn/chunks/chunk-67YJZR73.js +1 -0
- package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
- package/dist/cdn/chunks/chunk-AUH3O7Y7.js +1 -0
- package/dist/cdn/chunks/{chunk-WQW232LA.js → chunk-B2KJUHRZ.js} +1 -1
- package/dist/cdn/chunks/chunk-CUFOLAZN.js +25 -0
- package/dist/cdn/chunks/chunk-F4Q2Q4OC.js +1 -0
- package/dist/cdn/chunks/chunk-HHII35OF.js +1 -0
- package/dist/cdn/chunks/chunk-IBCFJKIO.js +3 -0
- package/dist/cdn/chunks/{chunk-Y27EXTAY.js → chunk-IWZRAEUN.js} +1 -1
- package/dist/cdn/chunks/chunk-KPGPSJ64.js +1 -0
- package/dist/cdn/chunks/chunk-LSBUNQZU.js +1 -0
- package/dist/cdn/chunks/{chunk-KQQ6BZAH.js → chunk-MLNUIPVU.js} +1 -1
- package/dist/cdn/chunks/chunk-NU2VUYVN.js +1 -0
- package/dist/cdn/chunks/{chunk-NQHMZQZA.js → chunk-NUIGLBFF.js} +1 -1
- package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
- package/dist/cdn/chunks/{chunk-Y7VOIKUK.js → chunk-POVLMWGM.js} +1 -1
- package/dist/cdn/chunks/chunk-QAZ7TATZ.js +1 -0
- package/dist/cdn/chunks/{chunk-M2F5OJOZ.js → chunk-QE347ZEI.js} +1 -1
- package/dist/cdn/chunks/chunk-QESNTWNP.js +33 -0
- package/dist/cdn/chunks/{chunk-JAIRD73U.js → chunk-QFCNXANK.js} +1 -1
- package/dist/cdn/chunks/chunk-SIBJ56BG.js +1 -0
- package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
- package/dist/cdn/chunks/chunk-VJKFYIPK.js +1 -0
- package/dist/cdn/chunks/chunk-WICQIC37.js +1 -0
- package/dist/cdn/chunks/{chunk-SVIHEXDZ.js → chunk-YI34K4SS.js} +1 -1
- package/dist/cdn/chunks/{chunk-HTLQX2R3.js → chunk-YRZXUDPO.js} +1 -1
- package/dist/cdn/chunks/chunk-YZWLMKXA.js +1 -0
- package/dist/cdn/chunks/chunk-ZPLN3VRG.js +1 -0
- package/dist/cdn/chunks/{chunk-4ECYTYEB.js → chunk-ZWC7BGLD.js} +1 -1
- package/dist/cdn/chunks/create-document-capture-R7KKX6YY-5FG6AKTA.js +1 -0
- package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-5VGYZUOK-KTCFCHTN.js} +1 -1
- package/dist/cdn/chunks/{detector-scanic-YCDNLCGV-FH6NWNXC.js → detector-scanic-P2RTEQUV-A5WTP2Q7.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-2CSWLQWR-E6PKDMWJ.js +1 -0
- package/dist/cdn/chunks/eid-view-FEJHQBSB-BA27H43Q.js +1 -0
- package/dist/cdn/chunks/email-otp-view-4EY5CKR5-LVNJQLG6.js +1 -0
- package/dist/cdn/chunks/flow-views-Q4Z2BS6Z-MZ4EFAQ6.js +1 -0
- package/dist/cdn/chunks/form-view-GPITA6X5-LAPFWBZM.js +1 -0
- package/dist/cdn/chunks/mrz-band-A6NIHZV3-GJO4UMKB.js +1 -0
- package/dist/cdn/chunks/overlay-de-7NCDPEIN-KI2BS6I6.js +1 -0
- package/dist/cdn/chunks/overlay-es-6MGCPCFO-CYCUQRCB.js +1 -0
- package/dist/cdn/chunks/overlay-pt-VTK6XJDH-VFNANCPU.js +1 -0
- package/dist/cdn/chunks/plan-runner-HOMYGD6Y-GMUP34K3.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-5YLRWE4H-EGV5GCSU.js +1 -0
- package/dist/cdn/chunks/{portrait-review-view-XUWQ5LIN-M5WOPF2E.js → portrait-review-view-ZAJ5TIXP-W6UQWTWP.js} +1 -1
- package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
- package/dist/cdn/chunks/proof-of-address-view-VH573XDT-JJCHDOH4.js +1 -0
- package/dist/cdn/chunks/reader-652D2CK6.js +2 -0
- package/dist/cdn/chunks/upload-file-EGXXM6TQ-NNVVB5QQ.js +1 -0
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-IQ7FLSNW.js → chunk-3CAVDRYH.js} +1 -1
- package/dist/{chunk-LREBBPJW.js → chunk-3J5LUPKY.js} +1 -1
- package/dist/{chunk-GTN3SYJJ.js → chunk-5KU4GIMW.js} +1 -1
- package/dist/chunk-APMABLNO.js +1 -0
- package/dist/chunk-AVSVM522.js +25 -0
- package/dist/{chunk-INKK6CKB.js → chunk-BGEGDQXU.js} +1 -1
- package/dist/{chunk-S6JGFCOP.js → chunk-L2F6LQ7G.js} +1 -1
- package/dist/{chunk-OQUTKFRP.js → chunk-NHOIIIGP.js} +1 -1
- package/dist/{chunk-IFHBX74I.js → chunk-OAQM45LZ.js} +1 -1
- package/dist/chunk-P223YKM3.js +1 -0
- package/dist/{chunk-LHD2PSUM.js → chunk-PEFS2JPA.js} +1 -1
- package/dist/chunk-QNR2GBZ5.js +1 -0
- package/dist/chunk-TKRB6RXI.js +33 -0
- package/dist/chunk-XXCBLQ53.js +1 -0
- package/dist/chunk-XZZPJ2FQ.js +1 -0
- package/dist/{chunk-6LR6LY2U.js → chunk-ZBTWLEPS.js} +1 -1
- package/dist/define.cjs +6 -6
- package/dist/define.js +1 -1
- package/dist/document-capture-view-2CSWLQWR-TB6SX3MZ.js +1 -0
- package/dist/{eid-view-ERVRHLLD-NLA6CQL7.js → eid-view-FEJHQBSB-NDFXLUCN.js} +1 -1
- package/dist/email-otp-view-4EY5CKR5-PXH6WYZN.js +1 -0
- package/dist/flow-views-Q4Z2BS6Z-ZSPSSABE.js +1 -0
- package/dist/form-view-GPITA6X5-VZF6Y2HM.js +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.cts +191 -8
- package/dist/index.d.ts +191 -8
- package/dist/index.js +1 -1
- package/dist/overlay-de-7NCDPEIN-BWTDIED4.js +1 -0
- package/dist/overlay-es-6MGCPCFO-SV56NQSV.js +1 -0
- package/dist/overlay-pt-VTK6XJDH-IWQLAZ7L.js +1 -0
- package/dist/{portrait-capture-view-TMHG2UX2-4DHDNWRH.js → portrait-capture-view-5YLRWE4H-4FZAEZS2.js} +1 -1
- package/dist/{portrait-review-view-XUWQ5LIN-7GZ3GF2B.js → portrait-review-view-ZAJ5TIXP-JKR2R7RK.js} +1 -1
- package/dist/proof-of-address-view-VH573XDT-UKGWSGG3.js +1 -0
- package/dist/styles.css +131 -20
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/capture-session-doc-O33KRXH7-X5MKSSBA.js +0 -1
- package/dist/cdn/chunks/challenge-frame-NUGPTWFP-V3GGQN65.js +0 -1
- package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
- package/dist/cdn/chunks/chunk-3NAYOW43.js +0 -1
- package/dist/cdn/chunks/chunk-CSM63KBJ.js +0 -3
- package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
- package/dist/cdn/chunks/chunk-EPEHFY6J.js +0 -1
- package/dist/cdn/chunks/chunk-FAQCPBKF.js +0 -1
- package/dist/cdn/chunks/chunk-GRJNZG6Y.js +0 -33
- package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
- package/dist/cdn/chunks/chunk-L22GFJQV.js +0 -1
- package/dist/cdn/chunks/chunk-LNQJGD3J.js +0 -1
- package/dist/cdn/chunks/chunk-OTGSYUHN.js +0 -25
- package/dist/cdn/chunks/chunk-OVRHETMK.js +0 -1
- package/dist/cdn/chunks/chunk-P3OIDL7Y.js +0 -1
- package/dist/cdn/chunks/chunk-UJSGILV7.js +0 -1
- package/dist/cdn/chunks/chunk-UQ5AELS3.js +0 -1
- package/dist/cdn/chunks/chunk-YF5BWIHV.js +0 -1
- package/dist/cdn/chunks/create-document-capture-OLKNUVTU-Q3AGV6QB.js +0 -1
- package/dist/cdn/chunks/document-capture-view-GZX5JJ7N-PRYTX37D.js +0 -1
- package/dist/cdn/chunks/eid-view-ERVRHLLD-ONTAYXU7.js +0 -1
- package/dist/cdn/chunks/email-otp-view-B7UQ5CHL-GWHWAR75.js +0 -1
- package/dist/cdn/chunks/flow-views-IGQ5MYS2-3UXKITDZ.js +0 -1
- package/dist/cdn/chunks/mrz-band-VYHOTDHY-VEZ2J5IL.js +0 -1
- package/dist/cdn/chunks/overlay-de-5KYN4JFO-I4ESJMAS.js +0 -1
- package/dist/cdn/chunks/overlay-es-6CAERCCN-SPFAX3SD.js +0 -1
- package/dist/cdn/chunks/overlay-pt-UBGXJ3C3-MWW4QOSN.js +0 -1
- package/dist/cdn/chunks/plan-runner-VKPRZ3AD-VYRGIMQG.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-TMHG2UX2-N44IPYHU.js +0 -1
- package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
- package/dist/cdn/chunks/upload-file-UYXOHCRG-MBYCMRP2.js +0 -1
- package/dist/chunk-4QKQAQKO.js +0 -1
- package/dist/chunk-GRQ3QAMU.js +0 -33
- package/dist/chunk-KXJRO6VZ.js +0 -1
- package/dist/chunk-SBJNQYEL.js +0 -25
- package/dist/chunk-YZ6YGLNN.js +0 -1
- package/dist/document-capture-view-GZX5JJ7N-ZW55IE6H.js +0 -1
- package/dist/email-otp-view-B7UQ5CHL-67LKMWBY.js +0 -1
- package/dist/flow-views-IGQ5MYS2-DVYTE4D2.js +0 -1
- package/dist/overlay-de-5KYN4JFO-MYA62T4Z.js +0 -1
- package/dist/overlay-es-6CAERCCN-QPH54AX7.js +0 -1
- package/dist/overlay-pt-UBGXJ3C3-VG6FOOCX.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as N}from"./chunk-YRZXUDPO.js";import"./chunk-POVLMWGM.js";import{a as te}from"./chunk-B2KJUHRZ.js";import{c as X}from"./chunk-NUIGLBFF.js";import{a as ae,b as re,c as ie}from"./chunk-QFCNXANK.js";import"./chunk-IBCFJKIO.js";import"./chunk-MLNUIPVU.js";import"./chunk-YI34K4SS.js";import"./chunk-ZWC7BGLD.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-CUFOLAZN.js";import"./chunk-67YJZR73.js";import"./chunk-4QUL7TEF.js";import"./chunk-WICQIC37.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-YRZXUDPO.js";import"./chunk-POVLMWGM.js";import"./chunk-YI34K4SS.js";import"./chunk-ZWC7BGLD.js";import"./chunk-CUFOLAZN.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};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as ee}from"./chunk-SLLJX5QK.js";import{a as G,b as te}from"./chunk-PND4F7JQ.js";import{a as u}from"./chunk-4FHWXBOB.js";var fe="thumbmark",pe="https://api.thumbmarkjs.com",F={exclude:[],include:[],stabilize:["private","iframe"],logging:!0,collect_beacon:!0,timeout:5e3,cache_api_call:!0,cache_lifetime_in_ms:0,performance:!1,experimental:!1,simple_request:!1,property_name_factory:u(t=>`${fe}_${t}`,"property_name_factory")},dt={...F};var xe={private:[{exclude:["canvas"],browsers:["firefox","safari>=17","brave"]},{exclude:["audio"],browsers:["samsungbrowser","safari"]},{exclude:["fonts"],browsers:["firefox"]},{exclude:["audio.sampleHash","hardware.deviceMemory","header.acceptLanguage.q","system.hardwareConcurrency","plugins"],browsers:["brave"]},{exclude:["tls.extensions"],browsers:["firefox","chrome","safari"]},{exclude:["header.acceptLanguage"],browsers:["edge","chrome"]}],iframe:[{exclude:["system.applePayVersion","system.cookieEnabled"],browsers:["safari"]},{exclude:["permissions"]}],vpn:[{exclude:["ip"]}],always:[{exclude:["speech"],browsers:["brave","firefox"]}]},ne=typeof window<"u"?window.OfflineAudioContext||window.webkitOfflineAudioContext:null;function Ee(t){let r=0;for(let n=0;n<t.length;++n)r+=Math.abs(t[n]);return r}u(Ee,"c");function re(t,r,n){if(t.length===1)return t[0];if(t.length===3){let e=t[0].data,c=t[1].data,l=t[2].data,a=new Uint8ClampedArray(e.length);for(let s=0;s<e.length;s++){let m=e[s],f=c[s],d=l[s];a[s]=m===f||m===d?m:f===d?f:m}return new ImageData(a,r,n)}let o=[];for(let e=0;e<t[0].data.length;e++){let c=[];for(let l=0;l<t.length;l++)c.push(t[l].data[e]);o.push(Ce(c))}let i=new Uint8ClampedArray(o);return new ImageData(i,r,n)}u(re,"l");function Ce(t){if(t.length===0)return 0;let r={};for(let o of t)r[o]=(r[o]||0)+1;let n=t[0];for(let o in r)r[o]>r[n]&&(n=parseInt(o,10));return n}u(Ce,"u");function L(t){return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),(t^=t>>>16)>>>0}u(L,"d");var _=new Uint32Array([597399067,2869860233,951274213,2716044179]);function E(t,r){return t<<r|t>>>32-r}u(E,"p");function M(t,r=0){if(r=r?0|r:0,typeof t=="string"&&(t=(function(i){if(typeof TextEncoder<"u")return new TextEncoder().encode(i).buffer;let e=[];for(let c=0;c<i.length;c++){let l=i.charCodeAt(c);l<128?e.push(l):l<2048?e.push(192|l>>6,128|63&l):l<55296||l>=57344?e.push(224|l>>12,128|l>>6&63,128|63&l):(c++,l=65536+((1023&l)<<10|1023&i.charCodeAt(c)),e.push(240|l>>18,128|l>>12&63,128|l>>6&63,128|63&l))}return new Uint8Array(e).buffer})(t)),!(t instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");let n=new Uint32Array([r,r,r,r]);(function(i,e){let c=i.byteLength/16|0,l=new Uint32Array(i,0,4*c);for(let a=0;a<c;a++){let s=l.subarray(4*a,4*(a+1));s[0]=Math.imul(s[0],_[0]),s[0]=E(s[0],15),s[0]=Math.imul(s[0],_[1]),e[0]=e[0]^s[0],e[0]=E(e[0],19),e[0]=e[0]+e[1],e[0]=Math.imul(e[0],5)+1444728091,s[1]=Math.imul(s[1],_[1]),s[1]=E(s[1],16),s[1]=Math.imul(s[1],_[2]),e[1]=e[1]^s[1],e[1]=E(e[1],17),e[1]=e[1]+e[2],e[1]=Math.imul(e[1],5)+197830471,s[2]=Math.imul(s[2],_[2]),s[2]=E(s[2],17),s[2]=Math.imul(s[2],_[3]),e[2]=e[2]^s[2],e[2]=E(e[2],15),e[2]=e[2]+e[3],e[2]=Math.imul(e[2],5)+2530024501,s[3]=Math.imul(s[3],_[3]),s[3]=E(s[3],18),s[3]=Math.imul(s[3],_[0]),e[3]=e[3]^s[3],e[3]=E(e[3],13),e[3]=e[3]+e[0],e[3]=Math.imul(e[3],5)+850148119}})(t,n),(function(i,e){let c=i.byteLength/16|0,l=i.byteLength%16,a=new Uint32Array(4),s=new Uint8Array(i,16*c,l);switch(l){case 15:a[3]=a[3]^s[14]<<16;case 14:a[3]=a[3]^s[13]<<8;case 13:a[3]=a[3]^s[12],a[3]=Math.imul(a[3],_[3]),a[3]=E(a[3],18),a[3]=Math.imul(a[3],_[0]),e[3]=e[3]^a[3];case 12:a[2]=a[2]^s[11]<<24;case 11:a[2]=a[2]^s[10]<<16;case 10:a[2]=a[2]^s[9]<<8;case 9:a[2]=a[2]^s[8],a[2]=Math.imul(a[2],_[2]),a[2]=E(a[2],17),a[2]=Math.imul(a[2],_[3]),e[2]=e[2]^a[2];case 8:a[1]=a[1]^s[7]<<24;case 7:a[1]=a[1]^s[6]<<16;case 6:a[1]=a[1]^s[5]<<8;case 5:a[1]=a[1]^s[4],a[1]=Math.imul(a[1],_[1]),a[1]=E(a[1],16),a[1]=Math.imul(a[1],_[2]),e[1]=e[1]^a[1];case 4:a[0]=a[0]^s[3]<<24;case 3:a[0]=a[0]^s[2]<<16;case 2:a[0]=a[0]^s[1]<<8;case 1:a[0]=a[0]^s[0],a[0]=Math.imul(a[0],_[0]),a[0]=E(a[0],15),a[0]=Math.imul(a[0],_[1]),e[0]=e[0]^a[0]}})(t,n),(function(i,e){e[0]=e[0]^i.byteLength,e[1]=e[1]^i.byteLength,e[2]=e[2]^i.byteLength,e[3]=e[3]^i.byteLength,e[0]=e[0]+e[1]|0,e[0]=e[0]+e[2]|0,e[0]=e[0]+e[3]|0,e[1]=e[1]+e[0]|0,e[2]=e[2]+e[0]|0,e[3]=e[3]+e[0]|0,e[0]=L(e[0]),e[1]=L(e[1]),e[2]=L(e[2]),e[3]=L(e[3]),e[0]=e[0]+e[1]|0,e[0]=e[0]+e[2]|0,e[0]=e[0]+e[3]|0,e[1]=e[1]+e[0]|0,e[2]=e[2]+e[0]|0,e[3]=e[3]+e[0]|0})(t,n);let o=new Uint8Array(n.buffer);return Array.from(o).map((i=>i.toString(16).padStart(2,"0"))).join("")}u(M,"f");var oe=280;function Me(t,r){return new Promise((n=>setTimeout(n,t,r)))}u(Me,"g");var Te=["Arial","Arial Black","Arial Narrow","Arial Rounded MT","Arimo","Archivo","Barlow","Bebas Neue","Bitter","Bookman","Calibri","Cabin","Candara","Century","Century Gothic","Comic Sans MS","Constantia","Courier","Courier New","Crimson Text","DM Mono","DM Sans","DM Serif Display","DM Serif Text","Dosis","Droid Sans","Exo","Fira Code","Fira Sans","Franklin Gothic Medium","Garamond","Geneva","Georgia","Gill Sans","Helvetica","Impact","Inconsolata","Indie Flower","Inter","Josefin Sans","Karla","Lato","Lexend","Lucida Bright","Lucida Console","Lucida Sans Unicode","Manrope","Merriweather","Merriweather Sans","Montserrat","Myriad","Noto Sans","Nunito","Nunito Sans","Open Sans","Optima","Orbitron","Oswald","Pacifico","Palatino","Perpetua","PT Sans","PT Serif","Poppins","Prompt","Public Sans","Quicksand","Rajdhani","Recursive","Roboto","Roboto Condensed","Rockwell","Rubik","Segoe Print","Segoe Script","Segoe UI","Sora","Source Sans Pro","Space Mono","Tahoma","Taviraj","Times","Times New Roman","Titillium Web","Trebuchet MS","Ubuntu","Varela Round","Verdana","Work Sans"],ke=["monospace","sans-serif","serif"];function ie(t,r){return t.font=`72px ${r}`,t.measureText("WwMmLli0Oo").width}u(ie,"w");function Re(){var t;let r=document.createElement("canvas"),n=(t=r.getContext("webgl"))!==null&&t!==void 0?t:r.getContext("experimental-webgl");if(n&&"getParameter"in n)try{let o=(n.getParameter(n.VENDOR)||"").toString(),i=(n.getParameter(n.RENDERER)||"").toString(),e={vendor:o,renderer:i,version:(n.getParameter(n.VERSION)||"").toString(),shadingLanguageVersion:(n.getParameter(n.SHADING_LANGUAGE_VERSION)||"").toString()};if(!i.length||!o.length){let c=n.getExtension("WEBGL_debug_renderer_info");if(c){let l=(n.getParameter(c.UNMASKED_VENDOR_WEBGL)||"").toString(),a=(n.getParameter(c.UNMASKED_RENDERER_WEBGL)||"").toString();l&&(e.vendorUnmasked=l),a&&(e.rendererUnmasked=a)}}return e}catch{}return"undefined"}u(Re,"S");function Oe(){let t=new Float32Array(1),r=new Uint8Array(t.buffer);return t[0]=1/0,t[0]=t[0]-t[0],r[3]}u(Oe,"b");var j=u((t,r,n,o)=>{let i=(n-r)/o,e=0;for(let c=0;c<o;c++)e+=t(r+(c+.5)*i);return e*i},"_");function Ie(t,r){let n={};return r.forEach((o=>{let i=(function(e){if(e.length===0)return null;let c={};e.forEach((s=>{let m=String(s);c[m]=(c[m]||0)+1}));let l=e[0],a=1;return Object.keys(c).forEach((s=>{c[s]>a&&(l=s,a=c[s])})),l})(t.map((e=>o in e?e[o]:void 0)).filter((e=>e!==void 0)));i&&(n[o]=i)})),n}u(Ie,"P");var Be=["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],z=new Map;function $(){if(typeof navigator>"u")return{name:"unknown",version:"unknown"};let t=!!navigator.brave,r=(t?"B|":"N|")+navigator.userAgent,n=z.get(r);if(n)return n;let o=[{name:"Brave",detect:u(()=>t,"detect")}],i;for(let e of o)if(e.detect()){let c=ae(navigator.userAgent);return i={name:e.name,version:c.version},z.set(r,i),i}return i=ae(navigator.userAgent),z.set(r,i),i}u($,"M");function ae(t){var r,n,o,i,e,c;let l=[/(?<name>SamsungBrowser)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>EdgA|EdgiOS|Edg)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>OPR|OPX)\/(?<version>\d+(?:\.\d+)+)/,/Opera[\s\/](?<version>\d+(?:\.\d+)+)/,/Opera Mini\/(?<version>\d+(?:\.\d+)+)/,/Opera Mobi\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Vivaldi)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>CriOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>FxiOS)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Chrome|Chromium)\/(?<version>\d+(?:\.\d+)+)/,/(?<name>Firefox|Waterfox|Iceweasel|IceCat)\/(?<version>\d+(?:\.\d+)+)/,/Version\/(?<version1>[\d.]+).*Safari\/[\d.]+|(?<name>Safari)\/(?<version2>[\d.]+)/,/(?<name>MSIE|Trident|IEMobile).+?(?<version>\d+(?:\.\d+)+)/,/(?<name>[A-Za-z]+)\/(?<version>\d+(?:\.\d+)+)/],a={edg:"Edge",edga:"Edge",edgios:"Edge",opr:"Opera",opx:"Opera",crios:"Chrome",fxios:"Firefox",samsung:"SamsungBrowser",vivaldi:"Vivaldi"};for(let s of l){let m=t.match(s);if(m){let f=(r=m.groups)===null||r===void 0?void 0:r.name,d=((n=m.groups)===null||n===void 0?void 0:n.version)||((o=m.groups)===null||o===void 0?void 0:o.version1)||((i=m.groups)===null||i===void 0?void 0:i.version2);if(f||!(!((e=m.groups)===null||e===void 0)&&e.version1)&&!(!((c=m.groups)===null||c===void 0)&&c.version2)||(f="Safari"),!f&&s.source.includes("Opera Mini")&&(f="Opera Mini"),!f&&s.source.includes("Opera Mobi")&&(f="Opera Mobi"),!f&&s.source.includes("Opera")&&(f="Opera"),!f&&m[1]&&(f=m[1]),!d&&m[2]&&(d=m[2]),f)return{name:a[f.toLowerCase()]||f,version:d||"unknown"}}}return{name:"unknown",version:"unknown"}}u(ae,"C");function se(){if(typeof navigator>"u"||!navigator.userAgent)return!1;let t=navigator.userAgent;return/Mobi|Android|iPhone|iPod|IEMobile|Opera Mini|Opera Mobi|webOS|BlackBerry|Windows Phone/i.test(t)&&!/iPad/i.test(t)}u(se,"E");function De(){let t=[],r={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(r).forEach((n=>{r[n].forEach((o=>{matchMedia(`(${n}: ${o})`).matches&&t.push(`${n}: ${o}`)}))})),t}u(De,"T");function Le(){if(window.location.protocol==="https:"&&typeof window.ApplePaySession=="function")try{let t=window.ApplePaySession.supportsVersion;for(let r=15;r>0;r--)if(t(r))return r}catch{return 0}return 0}u(Le,"k");var je=$().name!=="SamsungBrowser"?1:3,Ne=$().name!=="Brave",ce=137,Ue=(()=>{let t=new Float32Array(548),r=2*Math.PI/ce;for(let n=0;n<ce;n++){let o=n*r;t[4*n]=0,t[4*n+1]=0,t[4*n+2]=100*Math.cos(o),t[4*n+3]=50*Math.sin(o)}return t})(),D=null;function le(){try{if(typeof document>"u")return null;let t=document.createElement("canvas");t.width=200,t.height=100;let r=t.getContext("webgl");if(!r)return null;t.addEventListener("webglcontextlost",(c=>{c.preventDefault(),D=null}),{once:!0});let n=r.createShader(r.VERTEX_SHADER),o=r.createShader(r.FRAGMENT_SHADER);if(!n||!o||(r.shaderSource(n,`
|
|
2
|
+
attribute vec2 position;
|
|
3
|
+
void main() {
|
|
4
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
5
|
+
}
|
|
6
|
+
`),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))||(r.shaderSource(o,`
|
|
7
|
+
precision mediump float;
|
|
8
|
+
void main() {
|
|
9
|
+
gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color
|
|
10
|
+
}
|
|
11
|
+
`),r.compileShader(o),!r.getShaderParameter(o,r.COMPILE_STATUS)))return null;let i=r.createProgram();if(!i||(r.attachShader(i,n),r.attachShader(i,o),r.linkProgram(i),!r.getProgramParameter(i,r.LINK_STATUS)))return null;let e=r.createBuffer();return e?(r.bindBuffer(r.ARRAY_BUFFER,e),r.bufferData(r.ARRAY_BUFFER,Ue,r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),{canvas:t,gl:r,program:i,buffer:e}):null}catch{return null}}u(le,"D");function R(t){let r=new Set;return u(function n(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o===void 0)return;if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);let i,e;if(Array.isArray(o)){for(e="[",i=0;i<o.length;i++)i&&(e+=","),e+=n(o[i])||"null";return e+"]"}if(o===null)return"null";if(r.has(o))throw new TypeError("Converting circular structure to JSON");r.add(o);let c=Object.keys(o).sort();for(e="",i=0;i<c.length;i++){let l=c[i],a=n(o[l]);a&&(e&&(e+=","),e+=JSON.stringify(l)+":"+a)}return r.delete(o),"{"+e+"}"},"e")(t)||""}u(R,"N");var Fe={audio:u(async function(){return ne?(async function(){return new Promise(((t,r)=>{try{let n=new ne(1,5e3,44100),o=n.createBufferSource(),i=n.createOscillator();i.frequency.value=1e3;let e=n.createDynamicsCompressor(),c;e.threshold.value=-50,e.knee.value=40,e.ratio.value=12,e.attack.value=0,e.release.value=.2,i.connect(e),e.connect(n.destination),i.start(),n.oncomplete=l=>{c=l.renderedBuffer.getChannelData(0),t({sampleHash:Ee(c),maxChannels:n.destination.maxChannelCount,channelCountMode:o.channelCountMode})},n.startRendering()}catch(n){r(n)}}))})():null},"audio"),canvas:u(async function(){return new Promise((t=>{let r=Array.from({length:3},(()=>(function(){let n=document.createElement("canvas"),o=n.getContext("2d");if(!o)return null;n.width=oe,n.height=20;let i=o.createLinearGradient(0,0,n.width,n.height);i.addColorStop(0,"red"),i.addColorStop(.16666666666666666,"orange"),i.addColorStop(.3333333333333333,"yellow"),i.addColorStop(.5,"green"),i.addColorStop(.6666666666666666,"blue"),i.addColorStop(.8333333333333334,"indigo"),i.addColorStop(1,"violet"),o.fillStyle=i,o.fillRect(0,0,n.width,n.height);let e="Random Text WMwmil10Oo";return o.font="23.123px Arial",o.fillStyle="black",o.fillText(e,-5,15),o.fillStyle="rgba(0, 0, 255, 0.5)",o.fillText(e,-3.3,17.7),o.beginPath(),o.moveTo(0,0),o.lineTo(2*n.width/7,n.height),o.strokeStyle="white",o.lineWidth=2,o.stroke(),o.getImageData(0,0,n.width,n.height)})())).filter((n=>n!==null));r.length!==0?t({commonPixelsHash:M(re(r,oe,20).data.toString()).toString()}):t(null)}))},"canvas"),fonts:u(async function(t){return new Promise((r=>{try{(async function(n){for(var o;!document.body;)await Me(50);let i=document.createElement("iframe");i.setAttribute("frameBorder","0");let e=i.style;e.setProperty("position","fixed"),e.setProperty("display","block","important"),e.setProperty("visibility","visible"),e.setProperty("border","0"),e.setProperty("opacity","0"),i.src="about:blank",document.body.appendChild(i);let c=i.contentDocument||((o=i.contentWindow)===null||o===void 0?void 0:o.document);if(!c)throw new Error("Iframe document is not accessible");n({iframe:c}),setTimeout((()=>{document.body.removeChild(i)}),0)})((async({iframe:n})=>{let o=n.createElement("canvas").getContext("2d");if(!o)return void r(null);let i=ke.map((c=>ie(o,c))),e={};Te.forEach((c=>{let l=ie(o,c);i.includes(l)||(e[c]=l)})),r(e)}))}catch{r(null)}}))},"fonts"),hardware:u(function(){return new Promise(((t,r)=>{let n=navigator.deviceMemory!==void 0?navigator.deviceMemory:0,o=window.performance&&window.performance.memory?window.performance.memory:0;t({videocard:Re(),architecture:Oe(),deviceMemory:n.toString()||"undefined",jsHeapSizeLimit:o.jsHeapSizeLimit||0})}))},"hardware"),locales:u(function(){return new Promise((t=>{t({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}))},"locales"),math:u(function(){return new Promise((t=>{t({acos:Math.acos(.5),asin:j(Math.asin,-1,1,97),cos:j(Math.cos,0,Math.PI,97),largeCos:Math.cos(1e20),largeSin:Math.sin(1e20),largeTan:Math.tan(1e20),sin:j(Math.sin,-Math.PI,Math.PI,97),tan:j(Math.tan,0,2*Math.PI,97)})}))},"math"),permissions:u(async function(t){let r=t?.permissions_to_check||Be;return Ie(await Promise.all(Array.from({length:3},(()=>(async function(n){let o={};for(let i of n)try{let e=await navigator.permissions.query({name:i});o[i]=e.state.toString()}catch{}return o})(r)))),r)},"permissions"),plugins:u(async function(){let t=[];if(navigator.plugins)for(let r=0;r<navigator.plugins.length;r++){let n=navigator.plugins[r];t.push([n.name,n.filename,n.description].join("|"))}return new Promise((r=>{r({plugins:t})}))},"plugins"),screen:u(function(){return new Promise((t=>{if(typeof matchMedia>"u"||typeof screen>"u")return void t(null);let r={is_touchscreen:navigator.maxTouchPoints>0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:De()};se()&&navigator.maxTouchPoints>0&&(r.resolution=(function(){let n=window.screen.width,o=window.screen.height,i=Math.max(n,o).toString(),e=Math.min(n,o).toString();return`${i}x${e}`})()),t(r)}))},"screen"),system:u(function(){return new Promise((t=>{let r=$();t({platform:window.navigator.platform,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:r.name,version:r.version},mobile:se(),applePayVersion:Le(),cookieEnabled:window.navigator.cookieEnabled})}))},"system"),webgl:u(async function(){let t=Ne?(D||(D=le()),D):le();if(!t)return{webgl:"unsupported"};try{let r=Array.from({length:je},(()=>(function(n){let{canvas:o,gl:i,program:e,buffer:c}=n;try{i.useProgram(e),i.bindBuffer(i.ARRAY_BUFFER,c);let l=i.getAttribLocation(e,"position");i.enableVertexAttribArray(l),i.vertexAttribPointer(l,2,i.FLOAT,!1,0,0),i.viewport(0,0,o.width,o.height),i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.LINES,0,274);let a=new Uint8ClampedArray(o.width*o.height*4);return i.readPixels(0,0,o.width,o.height,i.RGBA,i.UNSIGNED_BYTE,a),new ImageData(a,o.width,o.height)}catch{return D=null,new ImageData(1,1)}finally{i.bindBuffer(i.ARRAY_BUFFER,null),i.useProgram(null),i.viewport(0,0,i.drawingBufferWidth,i.drawingBufferHeight),i.clearColor(0,0,0,0)}})(t)));return{commonPixelsHash:M(re(r,t.canvas.width,t.canvas.height).data.toString()).toString()}}catch{return{webgl:"unsupported"}}},"webgl"),webrtc:u(async function(t){return new Promise((r=>{let n;try{let o=window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection;if(!o)return void r({supported:!1,error:"WebRTC not supported"});n=new o({iceCandidatePoolSize:1,iceServers:[]});let i=n;i.createDataChannel(""),(async()=>{try{let e={offerToReceiveAudio:!0,offerToReceiveVideo:!0},c=await i.createOffer(e);await i.setLocalDescription(c);let l=c.sdp||"",a=[...new Set((l.match(/extmap:\d+ [^\n\r]+/g)||[]).map((A=>A.replace(/extmap:\d+ /,""))))].sort(),s=u(A=>{let w=l.match(new RegExp(`m=${A} [^\\s]+ [^\\s]+ ([^\\n\\r]+)`));return w?w[1].split(" "):[]},"a"),m=u((A,w)=>w.map((C=>{let T=new RegExp(`(rtpmap|fmtp|rtcp-fb):${C} (.+)`,"g"),h=[...l.matchAll(T)];if(!h.length)return null;let g={};return h.forEach((b=>{let[S,x,P]=b,O=P.split("/");x==="rtpmap"?(g.mimeType=`${A}/${O[0]}`,g.clockRate=+O[1],A==="audio"&&(g.channels=+O[2]||1)):x==="rtcp-fb"?(g.feedbackSupport=g.feedbackSupport||[],g.feedbackSupport.push(P)):x==="fmtp"&&(g.sdpFmtpLine=P)})),g})).filter(Boolean),"s"),f=m("audio",s("audio")),d=m("video",s("video")),p={audio:{count:f.length,hash:M(R(f))},video:{count:d.length,hash:M(R(d))},extensionsHash:M(R(a))};i.close();let v={supported:!0,...p,candidateType:"host"};r({details:v,hash:M(R(v))})}catch(e){i.close(),r({supported:!0,error:`WebRTC offer failed: ${e.message}`})}})()}catch(o){n?.close(),r({supported:!1,error:`WebRTC error: ${o.message}`})}}))},"webrtc"),speech:u(async function(){return new Promise((t=>{try{if(typeof window>"u"||!window.speechSynthesis||typeof window.speechSynthesis.getVoices!="function")return void t({supported:!1,error:"Speech Synthesis API not supported"});let r=!1,n=null,o=u(c=>{if(!r){r=!0,n&&clearTimeout(n);try{let l=c.map((s=>{let m=u(f=>f.replace(/\\/g,"\\\\").replace(/,/g,"\\,"),"n");return[m(s.voiceURI||""),m(s.name||""),m(s.lang||""),s.localService?"1":"0",s.default?"1":"0"].join(",")}));l.sort();let a={voiceCount:c.length,voicesHash:M(R(l))};t({details:a,hash:M(R(a))})}catch(l){t({supported:!0,error:`Voice processing failed: ${l.message}`})}}},"r"),i=window.speechSynthesis.getVoices();if(i.length>0)return void o(i);n=setTimeout((()=>{let c=window.speechSynthesis.getVoices();o(c)}),800);let e=u(()=>{window.speechSynthesis.removeEventListener("voiceschanged",e);let c=window.speechSynthesis.getVoices();o(c)},"i");window.speechSynthesis.addEventListener("voiceschanged",e)}catch(r){t({supported:!1,error:`Speech Synthesis error: ${r.message}`})}}))},"speech")},$e={},Ve={timeout:"true"};function he(t,r){var n,o;let i=$();if(i.name==="unknown"&&r){let s=(n=r.system)===null||n===void 0?void 0:n.browser;s?.name&&(i={name:String(s.name),version:String(s.version||"unknown")})}let e=i.name.toLowerCase(),c=parseInt(i.version.split(".")[0]||"0",10),l=Array.isArray(t?.exclude)?[...t.exclude]:[],a=[...new Set([...t?.stabilize||[],"always"])];for(let s of a){let m=xe[s];if(m)for(let f of m)"browsers"in f&&!(!((o=f.browsers)===null||o===void 0)&&o.some((d=>{let p=d.match(/(.+?)(>=)(\d+)/);return p?e===p[1]&&c>=+p[3]:e===d})))||l.push(...f.exclude)}return l}u(he,"W");function ge(t,r){let n=he(r,t),o=Array.isArray(r?.include)?r.include:[];return u(function i(e,c=""){let l={};for(let[a,s]of Object.entries(e)){let m=c?`${c}.${a}`:a;if(typeof s!="object"||Array.isArray(s)||s===null){let f=n.some((p=>m.startsWith(p))),d=o.some((p=>m.startsWith(p)));f&&!d||(l[a]=s)}else{let f=i(s,m);Object.keys(f).length>0&&(l[a]=f)}}return l},"e")(t)}u(ge,"G");var He="https://experimental.thumbmarkjs.com/experimental.min.js",We=131072;function k(t,r){let n={target:"request",type:t};return r&&(n.message=r.slice(0,200)),{schema:0,payload_id:"none",signals:{},errors:[n]}}u(k,"J");function ue(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let r=Object.getPrototypeOf(t);return r===Object.prototype||r===null}u(ue,"z");function J(t){return t instanceof Error?t.message:void 0}u(J,"Y");async function qe(){var t;try{return(t=await(function(r,n){let o,i=new Promise((e=>{o=setTimeout((()=>e(null)),n)}));return Promise.race([r,i]).finally((()=>clearTimeout(o)))})((async function(){let r,n;try{let o=await fetch(He,{method:"GET"});if(!o.ok)return k("http",`HTTP ${o.status}`);r=await o.text()}catch(o){return k("fetch",J(o))}if(!r)return k("empty");if(r.length>We)return k("oversized",`${r.length} chars`);try{let o=eval;n=await Promise.resolve(o(r))}catch(o){return k((function(i){return i instanceof SyntaxError?"syntax":i instanceof EvalError?"eval_blocked":"threw"})(o),J(o))}return(function(o){return!!ue(o)&&!(typeof o.schema!="number"||o.schema<1)&&typeof o.payload_id=="string"&&ue(o.signals)})(n)?{...n,errors:Array.isArray(n.errors)?n.errors:[]}:k("malformed")})(),2e3))!==null&&t!==void 0?t:k("timeout","exceeded 2000ms")}catch(r){return k("threw",J(r))}}u(qe,"K");var ve="_tmjs_c";function N(t){return new TextEncoder().encode(t).length}u(N,"Z");function de(){try{if(typeof sessionStorage>"u")return;sessionStorage.setItem(ve,"1")}catch{}}u(de,"Q");function Ge(t,r,n){try{if(r.collect_beacon===!1||!t||N(t)>64||(function(){try{return typeof sessionStorage<"u"&&!!sessionStorage.getItem(ve)}catch{return!1}})())return;let o=r.collect_endpoint||"https://collect.thumbmarkjs.com/beacon",i=typeof navigator<"u"?navigator.userAgent:"",e={thumbmark:t};i&&N(i)<=512&&(e.ua=i),n?.ja4&&N(n.ja4)<=64&&(e.ja4=n.ja4),n?.source&&N(n.source)<=32&&(e.ja4_source=n.source);let c=JSON.stringify(e);if(typeof navigator<"u"&&typeof navigator.sendBeacon=="function"){let l=!1;try{l=navigator.sendBeacon(o,c)}catch{l=!1}if(l)return void de()}try{let l=fetch(o,{method:"POST",mode:"no-cors",keepalive:!0,headers:{"Content-Type":"text/plain;charset=UTF-8"},body:c});de(),l.catch((()=>{}))}catch{}}catch{}}u(Ge,"ee");var ye="visitor_id";function we(t){return t.storage_property_name?t.storage_property_name:t.property_name_factory(ye)}u(we,"te");var me=`${fe}_${ye}`;function be(t,r){try{localStorage.setItem(we(r),t)}catch{}}u(be,"oe");var Se="cache";function Y(t){try{let r=localStorage.getItem(t.property_name_factory(Se));return JSON.parse(r)||{}}catch{}return{}}u(Y,"ae");function ze(t){return t.cache_lifetime_in_ms>2592e5?Date.now()+2592e5:Date.now()+t.cache_lifetime_in_ms}u(ze,"se");var X=class X extends Error{constructor(r){super(`HTTP error! status: ${r}`),this.status=r}};u(X,"ce");var I=X,B=null,K=null;async function Je(t,r,n,o){let i=n.simple_request?{"Content-Type":"text/plain"}:{"x-api-key":n.api_key,Authorization:"custom-authorized","Content-Type":"application/json"},e=await fetch(t,{method:"POST",headers:i,body:JSON.stringify(r)});if(!e.ok)throw new I(e.status);let c=await e.json();return c.visitorId&&c.visitorId!==o&&be(c.visitorId,n),K=c,(function(l,a){if(!l.cache_api_call||!l.cache_lifetime_in_ms)return;let{collect:s,...m}=a;(function(f,d){let p={...Y(f),...d};try{localStorage.setItem(f.property_name_factory(Se),JSON.stringify(p))}catch{}})(l,{apiResponseExpiry:ze(l),apiResponse:m})})(n,c),c}u(Je,"de");var Ye=u((t,r)=>{var n;if(t.cache_api_call){if(K)return Promise.resolve(K);let d=(function(p){let v=Y(p);if(v&&v.apiResponse&&v.apiResponseExpiry&&Date.now()<=v.apiResponseExpiry)return v.apiResponse})(t);if(d)return Promise.resolve(d);if(B)return B}let o=t.api_endpoint||pe,i;try{let d=new URL(o);i=d.pathname!=="/"||o.endsWith("/")?o:`${d.origin}/thumbmark`}catch{i=`${o}/thumbmark`}let e=(function(d){try{let p=we(d),v=localStorage.getItem(p);return v||p===me||(v=localStorage.getItem(me),v&&be(v,d)),v}catch{return null}})(t),{api_key:c,...l}=t,a={components:r,options:l,clientHash:M(R(r)),version:"1.12.0",path:(n=window?.location)===null||n===void 0?void 0:n.pathname};if(e&&(a.visitorId=e),t.metadata){let d=typeof t.metadata=="function"?t.metadata():t.metadata;d&&((typeof d=="string"?d.length:JSON.stringify(d).length)>1e3?console.error("ThumbmarkJS: Metadata exceeds 1000 characters. Skipping metadata."):a.metadata=d)}let s=t.timeout||5e3,m=(async function(d,p,v,A){for(let w=0;w<3;w++){w>0&&await new Promise((C=>setTimeout(C,200*w)));try{return await Je(d,p,v,A)}catch(C){if(C instanceof I||w===2)throw C}}throw new Error("Unreachable")})(i,a,t,e).finally((()=>{B=null})),f=new Promise((d=>{setTimeout((()=>{let p=Y(t);d(p?.apiResponse||{info:{timed_out:!0},...e&&{visitorId:e}})}),s)}));return B=Promise.race([m,f]),B},"me");async function Ke(t,r={}){var n;if(typeof document>"u"||typeof window>"u")return{thumbmark:"",components:{},info:{},version:"1.12.0",error:[{type:"fatal",message:"Browser environment required"}]};try{let o={...F,...t},i=[],e=o.logging&&!sessionStorage.getItem("_tmjs_l")&&Math.random()<1e-4,c={...Fe,...$e,...r},{elapsed:l,resolvedComponents:a,errors:s,pipelineTimings:m}=await Xe(c,o);i.push(...s);let f=o.api_key||o.simple_request?Ye(o,a):null,d=null;if(f)try{d=await f}catch(y){if(y instanceof I&&y.status===403)return{error:[{type:"api_unauthorized",message:"Invalid API key or quota exceeded"}],components:{},info:{},version:"1.12.0",thumbmark:""};i.push({type:y instanceof I?"api_error":"network_error",message:y instanceof Error?y.message:String(y)})}!((n=d?.info)===null||n===void 0)&&n.timed_out&&i.push({type:"api_timeout",message:"API request timed out"});let p=performance.now(),v=ge(d?.components||{},o),A=performance.now()-p,w={...a,...v},C=d?.info||{uniqueness:{score:"api only"}},T,h=0,g=0;if(d?.thumbmark)T=d.thumbmark;else{let y=performance.now(),H=R(w);h=performance.now()-y;let W=performance.now();T=M(H),g=performance.now()-W}let b="1.12.0";e&&(async function(y,H,W,Q=[]){var q;let Pe=`${pe}/log`;sessionStorage.setItem("_tmjs_l","1");let Ae={thumbmark:y,components:H,experimental:await qe(),version:"1.12.0",options:W,path:(q=window?.location)===null||q===void 0?void 0:q.pathname,...Q.length>0&&{errors:Q}};try{await fetch(Pe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ae)})}catch{}})(T,w,o,i).catch((()=>{})),d?.collect&&typeof d.collect=="object"&&Ge(T,o,d.collect);let S={"_pipeline.dispatch":m["_pipeline.dispatch"],"_pipeline.resolve":m["_pipeline.resolve"],"_pipeline.filter":m["_pipeline.filter"]+A,"_pipeline.stringify":h,"_pipeline.hash":g,"_pipeline.assembly":0},x={...l,...m,...S},P=o.performance?{elapsed:x}:{},O=performance.now(),V={...d?.visitorId&&{visitorId:d.visitorId},thumbmark:T,components:w,info:C,version:b,...P,...i.length>0&&{error:i},...d?.requestId&&{requestId:d.requestId},...d?.metadata&&{metadata:d.metadata}};return x["_pipeline.assembly"]=performance.now()-O,V}catch(o){return{thumbmark:"",components:{},info:{},version:"1.12.0",error:[{type:"fatal",message:o instanceof Error?o.message:String(o)}]}}}u(Ke,"pe");async function Xe(t,r){let n={...F,...r},o=he(n).filter((h=>!h.includes("."))),i=Object.entries(t).filter((([h])=>{var g;return!(!((g=n?.exclude)===null||g===void 0)&&g.includes(h))})).filter((([h])=>!o.includes(h))).filter((([h])=>{var g,b,S,x;return!((g=n?.include)===null||g===void 0)&&g.some((P=>P.includes(".")))?(b=n?.include)===null||b===void 0?void 0:b.some((P=>P.startsWith(h))):((S=n?.include)===null||S===void 0?void 0:S.length)===0||((x=n?.include)===null||x===void 0?void 0:x.includes(h))})),e=i.map((([h])=>h)),c={},l=performance.now(),a=i.map((([h,g])=>{let b=performance.now(),S=g(r);return c[`_dispatch.${h}`]=performance.now()-b,S})),s=performance.now()-l,m=performance.now(),f=await(function(h,g,b){return Promise.all(h.map((S=>{let x=performance.now(),P,O=S.then((y=>(P!==void 0&&clearTimeout(P),{value:y,elapsed:performance.now()-x}))).catch((y=>(P!==void 0&&clearTimeout(P),{value:b,elapsed:performance.now()-x,error:y instanceof Error?y.message:String(y)}))),V=new Promise((y=>{P=setTimeout((()=>{y({value:b,elapsed:performance.now()-x,error:"timeout"})}),g)}));return Promise.race([O,V])})))})(a,n?.timeout||5e3,Ve),d=performance.now()-m,p={},v={},A=[];f.forEach(((h,g)=>{var b;let S=e[g];p[S]=(b=h.elapsed)!==null&&b!==void 0?b:0,h.error==="timeout"?A.push({type:"component_timeout",message:`Component '${S}' timed out`,component:S}):h.error&&A.push({type:"component_error",message:h.error,component:S}),h.value!=null&&(v[S]=h.value)}));let w=performance.now(),C=ge(v,n),T={"_pipeline.dispatch":s,"_pipeline.resolve":d,"_pipeline.filter":performance.now()-w,...c};return{elapsed:p,resolvedComponents:C,errors:A,pipelineTimings:T}}u(Xe,"fe");var Z=class Z{constructor(r){this.options={...F,...r},this.customComponents={}}async get(r){return Ke({...this.options,...r},this.customComponents)}getVersion(){return"1.12.0"}includeComponent(r,n){this.customComponents[r]=n}};u(Z,"ye");var U=Z;var Ze=["canvas","webgl","audio","fonts","hardware","screen","system","locales","math","plugins"],Qe=2e3,et=4e3,tt=1e3,nt=2e3,rt=64,ot=32,it=8,at=128;function _e(t,r){if(typeof t!="string")return;let n=t.trim();return n.length>0&&n.length<=r?n:void 0}u(_e,"c");async function st(){let t=navigator.userAgentData;if(typeof t?.getHighEntropyValues!="function")return;let r=await G(()=>t.getHighEntropyValues(["model","platformVersion"]),tt);if(r==null)return;let n=_e(r.model,rt),o=_e(r.platformVersion,ot),i={...n!==void 0?{model:n}:{},...o!==void 0?{platformVersion:o}:{}};return Object.keys(i).length>0?i:void 0}u(st,"_");async function ct(){let[t,r]=await Promise.all([new U({stabilize:["private","iframe"],exclude:["permissions","webrtc","speech"],logging:!1,collect_beacon:!1,timeout:Qe}).get(),st()]),n=t?.components?.hardware?.videocard;n!==null&&typeof n=="object"&&ee(n.rendererUnmasked??n.renderer,n.vendorUnmasked??n.vendor);let o=t?.thumbmark;if(typeof o!="string"||o.length<it||o.length>at)return;let i={};for(let e of Ze){let c=t.components?.[e];c==null||c.timeout==="true"||(i[e]=await te(c))}return{hash:o,c:i,...r!==void 0?{hints:r}:{}}}u(ct,"E");function lt(){return new Promise(t=>{typeof globalThis.requestIdleCallback=="function"?globalThis.requestIdleCallback(()=>t(),{timeout:nt}):t()})}u(lt,"H");async function vt(t){return t()||(await lt(),t())?"busy":G(ct,et)}u(vt,"A");export{vt as computePrint,st as readHints};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{a as J}from"./chunk-SIBJ56BG.js";import{a as S}from"./chunk-POVLMWGM.js";import{a as q}from"./chunk-NU2VUYVN.js";import"./chunk-MLNUIPVU.js";import{d as M}from"./chunk-YI34K4SS.js";import"./chunk-ZWC7BGLD.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-CUFOLAZN.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"./chunk-4FHWXBOB.js";var Wt=[["Aztec","M"],["Codabar","L"],["Code39","L"],["Code93","L"],["Code128","L"],["DataBar","L"],["DataBarExpanded","L"],["DataMatrix","M"],["EAN-8","L"],["EAN-13","L"],["ITF","L"],["MaxiCode","M"],["PDF417","M"],["QRCode","M"],["UPC-A","L"],["UPC-E","L"],["MicroQRCode","M"],["rMQRCode","M"],["DXFilmEdge","L"],["DataBarLimited","L"]],ft=Wt.map(([h])=>h),qr=ft.filter((h,v)=>Wt[v][1]==="L"),Qr=ft.filter((h,v)=>Wt[v][1]==="M");function tr(h){switch(h){case"Linear-Codes":return qr.reduce((v,O)=>v|tr(O),0);case"Matrix-Codes":return Qr.reduce((v,O)=>v|tr(O),0);case"Any":return(1<<Wt.length)-1;case"None":return 0;default:return 1<<ft.indexOf(h)}}a(tr,"l");function Na(h){if(h===0)return"None";let v=31-Math.clz32(h);return ft[v]}a(Na,"w");function za(h){return h.reduce((v,O)=>v|tr(O),0)}a(za,"E");var Jr=["LocalAverage","GlobalHistogram","FixedThreshold","BoolCast"];function Va(h){return Jr.indexOf(h)}a(Va,"x");var rr=["Unknown","ASCII","ISO8859_1","ISO8859_2","ISO8859_3","ISO8859_4","ISO8859_5","ISO8859_6","ISO8859_7","ISO8859_8","ISO8859_9","ISO8859_10","ISO8859_11","ISO8859_13","ISO8859_14","ISO8859_15","ISO8859_16","Cp437","Cp1250","Cp1251","Cp1252","Cp1256","Shift_JIS","Big5","GB2312","GB18030","EUC_JP","EUC_KR","UTF16BE","UTF16BE","UTF8","UTF16LE","UTF32BE","UTF32LE","BINARY"];function Ga(h){return h==="UnicodeBig"?rr.indexOf("UTF16BE"):rr.indexOf(h)}a(Ga,"B");var Kr=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function Za(h){return Kr[h]}a(Za,"T");var Yr=["Ignore","Read","Require"];function Xa(h){return Yr.indexOf(h)}a(Xa,"U");var te=["Plain","ECI","HRI","Hex","Escaped"];function qa(h){return te.indexOf(h)}a(qa,"p");var Rt={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,tryDenoise:!1,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!0,returnErrors:!1,eanAddOnSymbol:"Ignore",textMode:"HRI",characterSet:"Unknown"};function Xr(h){return{...h,formats:za(h.formats),binarizer:Va(h.binarizer),eanAddOnSymbol:Xa(h.eanAddOnSymbol),textMode:qa(h.textMode),characterSet:Ga(h.characterSet)}}a(Xr,"I");var Qa={format:"QRCode",readerInit:!1,forceSquareDataMatrix:!1,ecLevel:"",scale:0,sizeHint:0,rotate:0,withHRT:!1,withQuietZones:!0};function Ja(h){return{...h,format:Na(h.format),contentType:Za(h.contentType),eccLevel:h.ecLevel}}a(Ja,"z");var Ka="2.1.0",Ya="37b847798a1af55d3a289a9516a751fcafae3c23",ti={locateFile:a((h,v)=>{let O=h.match(/_(.+?)\.wasm$/);return O?`https://fastly.jsdelivr.net/npm/zxing-wasm@2.1.0/dist/${O[1]}/${h}`:v+h},"locateFile")},xt=new WeakMap;function ri(h,v){return Object.is(h,v)||Object.keys(h).length===Object.keys(v).length&&Object.keys(h).every(O=>Object.prototype.hasOwnProperty.call(v,O)&&h[O]===v[O])}a(ri,"D");function er(h,{overrides:v,equalityFn:O=ri,fireImmediately:X=!1}={}){var l;let[W,E]=(l=xt.get(h))!=null?l:[ti],k=v??W,F;if(X){if(E&&(F=O(W,k)))return E;let M=h({...k});return xt.set(h,[k,M]),M}(F??O(W,k))||xt.set(h,[k])}a(er,"S");function re(h){xt.delete(h)}a(re,"v");async function ee(h,v,O=Rt){let X={...Rt,...O},l=await er(h,{fireImmediately:!0}),W,E;if("width"in v&&"height"in v&&"data"in v){let{data:F,data:{byteLength:M},width:nt,height:dt}=v;E=l._malloc(M),l.HEAPU8.set(F,E),W=l.readBarcodesFromPixmap(E,nt,dt,Xr(X))}else{let F,M;if("buffer"in v)[F,M]=[v.byteLength,v];else if("byteLength"in v)[F,M]=[v.byteLength,new Uint8Array(v)];else if("size"in v)[F,M]=[v.size,new Uint8Array(await v.arrayBuffer())];else throw new TypeError("Invalid input type");E=l._malloc(F),l.HEAPU8.set(M,E),W=l.readBarcodesFromImage(E,F,Xr(X))}l._free(E);let k=[];for(let F=0;F<W.size();++F)k.push(Ja(W.get(F)));return k}a(ee,"Z");var ei={...Rt,formats:[...Rt.formats]},ni={...Qa};var nr=(()=>{var h,v=typeof document<"u"&&((h=document.currentScript)==null?void 0:h.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(O={}){var X,l=O,W,E,k=new Promise((t,r)=>{W=t,E=r}),F=typeof window=="object",M=typeof Bun<"u",nt=typeof WorkerGlobalScope<"u";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var dt=Object.assign({},l),ar="./this.program",D="";function ie(t){return l.locateFile?l.locateFile(t,D):D+t}a(ie,"Ve");var ir,Mt;if(F||nt||M){var Ut;nt?D=self.location.href:typeof document<"u"&&((Ut=document.currentScript)===null||Ut===void 0?void 0:Ut.tagName.toUpperCase())==="SCRIPT"&&(D=document.currentScript.src),v&&(D=v),D.startsWith("blob:")?D="":D=D.substr(0,D.replace(/[?#].*/,"").lastIndexOf("/")+1),nt&&(Mt=a(t=>{var r=new XMLHttpRequest;return r.open("GET",t,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)},"Cr")),ir=a(async t=>{var r=await fetch(t,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)},"Gr")}var oe=l.print||console.log.bind(console),Y=l.printErr||console.error.bind(console);Object.assign(l,dt),dt=null,l.arguments&&l.arguments,l.thisProgram&&(ar=l.thisProgram);var ht=l.wasmBinary,pt,or=!1,L,R,at,vt,tt,T,sr,ur;function cr(){var t=pt.buffer;l.HEAP8=L=new Int8Array(t),l.HEAP16=at=new Int16Array(t),l.HEAPU8=R=new Uint8Array(t),l.HEAPU16=vt=new Uint16Array(t),l.HEAP32=tt=new Int32Array(t),l.HEAPU32=T=new Uint32Array(t),l.HEAPF32=sr=new Float32Array(t),l.HEAPF64=ur=new Float64Array(t)}a(cr,"Kr");var lr=[],fr=[],dr=[];function se(){if(l.preRun)for(typeof l.preRun=="function"&&(l.preRun=[l.preRun]);l.preRun.length;)le(l.preRun.shift());Dt(lr)}a(se,"Ne");function ue(){Dt(fr)}a(ue,"Ze");function ce(){if(l.postRun)for(typeof l.postRun=="function"&&(l.postRun=[l.postRun]);l.postRun.length;)de(l.postRun.shift());Dt(dr)}a(ce,"ze");function le(t){lr.unshift(t)}a(le,"Ge");function fe(t){fr.unshift(t)}a(fe,"Xe");function de(t){dr.unshift(t)}a(de,"Le");var q=0,it=null;function he(t){var r;q++,(r=l.monitorRunDependencies)===null||r===void 0||r.call(l,q)}a(he,"qe");function pe(t){var r;if(q--,(r=l.monitorRunDependencies)===null||r===void 0||r.call(l,q),q==0&&it){var e=it;it=null,e()}}a(pe,"Ke");function kt(t){var r;(r=l.onAbort)===null||r===void 0||r.call(l,t),t="Aborted("+t+")",Y(t),or=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw E(e),e}a(kt,"Pr");var ve="data:application/octet-stream;base64,",hr=a(t=>t.startsWith(ve),"re");function ye(){var t="zxing_reader.wasm";return hr(t)?t:ie(t)}a(ye,"Je");var yt;function me(t){if(t==yt&&ht)return new Uint8Array(ht);if(Mt)return Mt(t);throw"both async and sync fetching of the wasm failed"}a(me,"Qe");async function ge(t){if(!ht)try{var r=await ir(t);return new Uint8Array(r)}catch{}return me(t)}a(ge,"rt");async function $e(t,r){try{var e=await ge(t),n=await WebAssembly.instantiate(e,r);return n}catch(i){Y(`failed to asynchronously prepare wasm: ${i}`),kt(i)}}a($e,"et");async function we(t,r,e){if(!t&&typeof WebAssembly.instantiateStreaming=="function"&&!hr(r)&&typeof fetch=="function")try{var n=fetch(r,{credentials:"same-origin"}),i=await WebAssembly.instantiateStreaming(n,e);return i}catch(o){Y(`wasm streaming compile failed: ${o}`),Y("falling back to ArrayBuffer instantiation")}return $e(r,e)}a(we,"tt");function be(){return{a:sa}}a(be,"nt");async function Ce(){var t;function r(o,u){return _=o.exports,pt=_.xa,cr(),Tr=_.Ba,fe(_.ya),pe(),_}a(r,"r"),he();function e(o){r(o.instance)}a(e,"t");var n=be();if(l.instantiateWasm)try{return l.instantiateWasm(n,r)}catch(o){Y(`Module.instantiateWasm callback failed with error: ${o}`),E(o)}(t=yt)!==null&&t!==void 0||(yt=ye());try{var i=await we(ht,yt,n);return e(i),i}catch(o){E(o);return}}a(Ce,"it");var Dt=a(t=>{for(;t.length>0;)t.shift()(l)},"Ar");l.noExitRuntime;var m=a(t=>Mr(t),"p"),g=a(()=>Ur(),"h"),mt=[],gt=0,Te=a(t=>{var r=new ot(t);return r.get_caught()||(r.set_caught(!0),gt--),r.set_rethrown(!1),mt.push(r),Dr(t),Rr(t)},"at"),H=0,Pe=a(()=>{y(0,0);var t=mt.pop();kr(t.excPtr),H=0},"ot");let Yt=class Yt{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){T[this.ptr+4>>2]=r}get_type(){return T[this.ptr+4>>2]}set_destructor(r){T[this.ptr+8>>2]=r}get_destructor(){return T[this.ptr+8>>2]}set_caught(r){r=r?1:0,L[this.ptr+12]=r}get_caught(){return L[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,L[this.ptr+13]=r}get_rethrown(){return L[this.ptr+13]!=0}init(r,e){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(e)}set_adjusted_ptr(r){T[this.ptr+16>>2]=r}get_adjusted_ptr(){return T[this.ptr+16>>2]}};a(Yt,"Rr");let ot=Yt;var _e=a(t=>{throw H||(H=t),H},"st"),$t=a(t=>Wr(t),"fr"),Bt=a(t=>{var r=H;if(!r)return $t(0),0;var e=new ot(r);e.set_adjusted_ptr(r);var n=e.get_type();if(!n)return $t(0),r;for(var i of t){if(i===0||i===n)break;var o=e.ptr+16;if(Br(i,n,o))return $t(i),r}return $t(n),r},"Er"),Ae=a(()=>Bt([]),"ut"),Se=a(t=>Bt([t]),"ft"),Oe=a((t,r)=>Bt([t,r]),"lt"),je=a(()=>{var t=mt.pop();t||kt("no exception to throw");var r=t.excPtr;throw t.get_rethrown()||(mt.push(t),t.set_rethrown(!0),t.set_caught(!1),gt++),H=r,H},"ct"),Fe=a((t,r,e)=>{var n=new ot(t);throw n.init(r,e),H=t,gt++,H},"vt"),Ee=a(()=>gt,"dt"),Ie=a(()=>kt(""),"pt"),wt={},Lt=a(t=>{for(;t.length;){var r=t.pop(),e=t.pop();e(r)}},"Fr");function st(t){return this.fromWireType(T[t>>2])}a(st,"Y");var rt={},Q={},bt={},pr,Ct=a(t=>{throw new pr(t)},"vr"),J=a((t,r,e)=>{t.forEach(s=>bt[s]=r);function n(s){var c=e(s);c.length!==t.length&&Ct("Mismatched type converter count");for(var f=0;f<t.length;++f)B(t[f],c[f])}a(n,"n");var i=new Array(r.length),o=[],u=0;r.forEach((s,c)=>{Q.hasOwnProperty(s)?i[c]=Q[s]:(o.push(s),rt.hasOwnProperty(s)||(rt[s]=[]),rt[s].push(()=>{i[c]=Q[s],++u,u===o.length&&n(i)}))}),o.length===0&&n(i)},"N"),xe=a(t=>{var r=wt[t];delete wt[t];var e=r.rawConstructor,n=r.rawDestructor,i=r.fields,o=i.map(u=>u.getterReturnType).concat(i.map(u=>u.setterArgumentType));J([t],o,u=>{var s={};return i.forEach((c,f)=>{var d=c.fieldName,p=u[f],w=c.getter,C=c.getterContext,P=u[f+i.length],j=c.setter,A=c.setterContext;s[d]={read:a(S=>p.fromWireType(w(C,S)),"read"),write:a((S,K)=>{var x=[];j(A,S,P.toWireType(x,K)),Lt(x)},"write")}}),[{name:r.name,fromWireType:a(c=>{var f={};for(var d in s)f[d]=s[d].read(c);return n(c),f},"fromWireType"),toWireType:a((c,f)=>{for(var d in s)if(!(d in f))throw new TypeError(`Missing field: "${d}"`);var p=e();for(d in s)s[d].write(p,f[d]);return c!==null&&c.push(n,p),p},"toWireType"),argPackAdvance:N,readValueFromPointer:st,destructorFunction:n}]})},"ht"),Re=a((t,r,e,n,i)=>{},"_t"),We=a(()=>{for(var t=new Array(256),r=0;r<256;++r)t[r]=String.fromCharCode(r);vr=t},"gt"),vr,I=a(t=>{for(var r="",e=t;R[e];)r+=vr[R[e++]];return r},"A"),et,b=a(t=>{throw new et(t)},"y");function Me(t,r){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.name;if(t||b(`type "${n}" must have a positive integer typeid pointer`),Q.hasOwnProperty(t)){if(e.ignoreDuplicateRegistrations)return;b(`Cannot register type '${n}' twice`)}if(Q[t]=r,delete bt[t],rt.hasOwnProperty(t)){var i=rt[t];delete rt[t],i.forEach(o=>o())}}a(Me,"yt");function B(t,r){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Me(t,r,e)}a(B,"j");var N=8,Ue=a((t,r,e,n)=>{r=I(r),B(t,{name:r,fromWireType:a(function(i){return!!i},"fromWireType"),toWireType:a(function(i,o){return o?e:n},"toWireType"),argPackAdvance:N,readValueFromPointer:a(function(i){return this.fromWireType(R[i])},"readValueFromPointer"),destructorFunction:null})},"mt"),ke=a(t=>({count:t.count,deleteScheduled:t.deleteScheduled,preservePointerOnDelete:t.preservePointerOnDelete,ptr:t.ptr,ptrType:t.ptrType,smartPtr:t.smartPtr,smartPtrType:t.smartPtrType}),"$t"),Ht=a(t=>{function r(e){return e.$$.ptrType.registeredClass.name}a(r,"r"),b(r(t)+" instance already deleted")},"kr"),Nt=!1,yr=a(t=>{},"ne"),De=a(t=>{t.smartPtr?t.smartPtrType.rawDestructor(t.smartPtr):t.ptrType.registeredClass.rawDestructor(t.ptr)},"bt"),mr=a(t=>{t.count.value-=1;var r=t.count.value===0;r&&De(t)},"ie"),gr=a((t,r,e)=>{if(r===e)return t;if(e.baseClass===void 0)return null;var n=gr(t,r,e.baseClass);return n===null?null:e.downcast(n)},"ae"),$r={},Be={},Le=a((t,r)=>{for(r===void 0&&b("ptr should not be undefined");t.baseClass;)r=t.upcast(r),t=t.baseClass;return r},"Ct"),He=a((t,r)=>(r=Le(t,r),Be[r]),"Tt"),Tt=a((t,r)=>{(!r.ptrType||!r.ptr)&&Ct("makeClassHandle requires ptr and ptrType");var e=!!r.smartPtrType,n=!!r.smartPtr;return e!==n&&Ct("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ut(Object.create(t,{$$:{value:r,writable:!0}}))},"dr");function Ne(t){var r=this.getPointee(t);if(!r)return this.destructor(t),null;var e=He(this.registeredClass,r);if(e!==void 0){if(e.$$.count.value===0)return e.$$.ptr=r,e.$$.smartPtr=t,e.clone();var n=e.clone();return this.destructor(t),n}function i(){return this.isSmartPointer?Tt(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:t}):Tt(this.registeredClass.instancePrototype,{ptrType:this,ptr:t})}a(i,"i");var o=this.registeredClass.getActualType(r),u=$r[o];if(!u)return i.call(this);var s;this.isConst?s=u.constPointerType:s=u.pointerType;var c=gr(r,this.registeredClass,s.registeredClass);return c===null?i.call(this):this.isSmartPointer?Tt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c,smartPtrType:this,smartPtr:t}):Tt(s.registeredClass.instancePrototype,{ptrType:s,ptr:c})}a(Ne,"Pt");var ut=a(t=>typeof FinalizationRegistry>"u"?(ut=a(r=>r,"J"),t):(Nt=new FinalizationRegistry(r=>{mr(r.$$)}),ut=a(r=>{var e=r.$$,n=!!e.smartPtr;if(n){var i={$$:e};Nt.register(r,i,r)}return r},"J"),yr=a(r=>Nt.unregister(r),"ne"),ut(t)),"J"),ze=a(()=>{Object.assign(Pt.prototype,{isAliasOf(t){if(!(this instanceof Pt)||!(t instanceof Pt))return!1;var r=this.$$.ptrType.registeredClass,e=this.$$.ptr;t.$$=t.$$;for(var n=t.$$.ptrType.registeredClass,i=t.$$.ptr;r.baseClass;)e=r.upcast(e),r=r.baseClass;for(;n.baseClass;)i=n.upcast(i),n=n.baseClass;return r===n&&e===i},clone(){if(this.$$.ptr||Ht(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var t=ut(Object.create(Object.getPrototypeOf(this),{$$:{value:ke(this.$$)}}));return t.$$.count.value+=1,t.$$.deleteScheduled=!1,t},delete(){this.$$.ptr||Ht(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),yr(this),mr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||Ht(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&b("Object already scheduled for deletion"),this.$$.deleteScheduled=!0,this}})},"At");function Pt(){}a(Pt,"pr");var _t=a((t,r)=>Object.defineProperty(r,"name",{value:t}),"hr"),wr=a((t,r,e)=>{if(t[r].overloadTable===void 0){var n=t[r];t[r]=function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];return t[r].overloadTable.hasOwnProperty(o.length)||b(`Function '${e}' called with an invalid number of arguments (${o.length}) - expects one of (${t[r].overloadTable})!`),t[r].overloadTable[o.length].apply(this,o)},t[r].overloadTable=[],t[r].overloadTable[n.argCount]=n}},"se"),br=a((t,r,e)=>{l.hasOwnProperty(t)?((e===void 0||l[t].overloadTable!==void 0&&l[t].overloadTable[e]!==void 0)&&b(`Cannot register public name '${t}' twice`),wr(l,t,t),l[t].overloadTable.hasOwnProperty(e)&&b(`Cannot register multiple overloads of a function with the same number of arguments (${e})!`),l[t].overloadTable[e]=r):(l[t]=r,l[t].argCount=e)},"ue"),Ve=48,Ge=57,Ze=a(t=>{t=t.replace(/[^a-zA-Z0-9_]/g,"$");var r=t.charCodeAt(0);return r>=Ve&&r<=Ge?`_${t}`:t},"Ft");function Xe(t,r,e,n,i,o,u,s){this.name=t,this.constructor=r,this.instancePrototype=e,this.rawDestructor=n,this.baseClass=i,this.getActualType=o,this.upcast=u,this.downcast=s,this.pureVirtualFunctions=[]}a(Xe,"kt");var zt=a((t,r,e)=>{for(;r!==e;)r.upcast||b(`Expected null or instance of ${e.name}, got an instance of ${r.name}`),t=r.upcast(t),r=r.baseClass;return t},"jr");function qe(t,r){if(r===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;r.$$||b(`Cannot pass "${qt(r)}" as a ${this.name}`),r.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`);var e=r.$$.ptrType.registeredClass,n=zt(r.$$.ptr,e,this.registeredClass);return n}a(qe,"St");function Qe(t,r){var e;if(r===null)return this.isReference&&b(`null is not a valid ${this.name}`),this.isSmartPointer?(e=this.rawConstructor(),t!==null&&t.push(this.rawDestructor,e),e):0;(!r||!r.$$)&&b(`Cannot pass "${qt(r)}" as a ${this.name}`),r.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&r.$$.ptrType.isConst&&b(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);var n=r.$$.ptrType.registeredClass;if(e=zt(r.$$.ptr,n,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&b("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?e=r.$$.smartPtr:b(`Cannot convert argument of type ${r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:e=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)e=r.$$.smartPtr;else{var i=r.clone();e=this.rawShare(e,V.toHandle(()=>i.delete())),t!==null&&t.push(this.rawDestructor,e)}break;default:b("Unsupporting sharing policy")}return e}a(Qe,"jt");function Je(t,r){if(r===null)return this.isReference&&b(`null is not a valid ${this.name}`),0;r.$$||b(`Cannot pass "${qt(r)}" as a ${this.name}`),r.$$.ptr||b(`Cannot pass deleted object as a pointer of type ${this.name}`),r.$$.ptrType.isConst&&b(`Cannot convert argument of type ${r.$$.ptrType.name} to parameter type ${this.name}`);var e=r.$$.ptrType.registeredClass,n=zt(r.$$.ptr,e,this.registeredClass);return n}a(Je,"Ot");var Ke=a(()=>{Object.assign(At.prototype,{getPointee(t){return this.rawGetPointee&&(t=this.rawGetPointee(t)),t},destructor(t){var r;(r=this.rawDestructor)===null||r===void 0||r.call(this,t)},argPackAdvance:N,readValueFromPointer:st,fromWireType:Ne})},"Wt");function At(t,r,e,n,i,o,u,s,c,f,d){this.name=t,this.registeredClass=r,this.isReference=e,this.isConst=n,this.isSmartPointer=i,this.pointeeType=o,this.sharingPolicy=u,this.rawGetPointee=s,this.rawConstructor=c,this.rawShare=f,this.rawDestructor=d,!i&&r.baseClass===void 0?n?(this.toWireType=qe,this.destructorFunction=null):(this.toWireType=Je,this.destructorFunction=null):this.toWireType=Qe}a(At,"_r");var Cr=a((t,r,e)=>{l.hasOwnProperty(t)||Ct("Replacing nonexistent public symbol"),l[t].overloadTable!==void 0&&e!==void 0?l[t].overloadTable[e]=r:(l[t]=r,l[t].argCount=e)},"fe"),Ye=a((t,r,e)=>{t=t.replace(/p/g,"i");var n=l["dynCall_"+t];return n(r,...e)},"Dt"),St=[],Tr,$=a(t=>{var r=St[t];return r||(t>=St.length&&(St.length=t+1),St[t]=r=Tr.get(t)),r},"_"),tn=a(function(t,r){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.includes("j"))return Ye(t,r,e);var n=$(r)(...e);return n},"Mt"),rn=a((t,r)=>function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return tn(t,r,n)},"xt"),U=a((t,r)=>{t=I(t);function e(){return t.includes("j")?rn(t,r):$(r)}a(e,"t");var n=e();return typeof n!="function"&&b(`unknown function pointer with signature ${t}: ${r}`),n},"k"),en=a((t,r)=>{var e=_t(r,function(n){this.name=r,this.message=n;var i=new Error(n).stack;i!==void 0&&(this.stack=this.toString()+`
|
|
2
|
+
`+i.replace(/^Error(:[^\n]*)?\n/,""))});return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},e},"Ut"),Pr,_r=a(t=>{var r=xr(t),e=I(r);return G(r),e},"ve"),Ot=a((t,r)=>{var e=[],n={};function i(o){if(!n[o]&&!Q[o]){if(bt[o]){bt[o].forEach(i);return}e.push(o),n[o]=!0}}throw a(i,"i"),r.forEach(i),new Pr(`${t}: `+e.map(_r).join([", "]))},"yr"),nn=a((t,r,e,n,i,o,u,s,c,f,d,p,w)=>{d=I(d),o=U(i,o),s&&(s=U(u,s)),f&&(f=U(c,f)),w=U(p,w);var C=Ze(d);br(C,function(){Ot(`Cannot construct ${d} due to unbound types`,[n])}),J([t,r,e],n?[n]:[],P=>{P=P[0];var j,A;n?(j=P.registeredClass,A=j.instancePrototype):A=Pt.prototype;var S=_t(d,function(){if(Object.getPrototypeOf(this)!==K)throw new et("Use 'new' to construct "+d);if(x.constructor_body===void 0)throw new et(d+" has no accessible constructor");for(var Gr=arguments.length,Et=new Array(Gr),It=0;It<Gr;It++)Et[It]=arguments[It];var Zr=x.constructor_body[Et.length];if(Zr===void 0)throw new et(`Tried to invoke ctor of ${d} with invalid number of parameters (${Et.length}) - expected (${Object.keys(x.constructor_body).toString()}) parameters instead!`);return Zr.apply(this,Et)}),K=Object.create(A,{constructor:{value:S}});S.prototype=K;var x=new Xe(d,S,K,w,j,o,s,f);if(x.baseClass){var Z,Ft;(Ft=(Z=x.baseClass).__derivedClasses)!==null&&Ft!==void 0||(Z.__derivedClasses=[]),x.baseClass.__derivedClasses.push(x)}var Ha=new At(d,x,!0,!1,!1),zr=new At(d+"*",x,!1,!1,!1),Vr=new At(d+" const*",x,!1,!0,!1);return $r[t]={pointerType:zr,constPointerType:Vr},Cr(C,S),[Ha,zr,Vr]})},"It"),Vt=a((t,r)=>{for(var e=[],n=0;n<t;n++)e.push(T[r+n*4>>2]);return e},"Or");function an(t){for(var r=1;r<t.length;++r)if(t[r]!==null&&t[r].destructorFunction===void 0)return!0;return!1}a(an,"Ht");function Gt(t,r,e,n,i,o){var u=r.length;u<2&&b("argTypes array size mismatch! Must at least get return value and 'this' types!");var s=r[1]!==null&&e!==null,c=an(r),f=r[0].name!=="void",d=u-2,p=new Array(d),w=[],C=[],P=a(function(){C.length=0;var j;w.length=s?2:1,w[0]=i,s&&(j=r[1].toWireType(C,this),w[1]=j);for(var A=0;A<d;++A)p[A]=r[A+2].toWireType(C,A<0||arguments.length<=A?void 0:arguments[A]),w.push(p[A]);var S=n(...w);function K(x){if(c)Lt(C);else for(var Z=s?1:2;Z<r.length;Z++){var Ft=Z===1?j:p[Z-2];r[Z].destructorFunction!==null&&r[Z].destructorFunction(Ft)}if(f)return r[0].fromWireType(x)}return a(K,"Z"),K(S)},"b");return _t(t,P)}a(Gt,"Wr");var on=a((t,r,e,n,i,o)=>{var u=Vt(r,e);i=U(n,i),J([],[t],s=>{s=s[0];var c=`constructor ${s.name}`;if(s.registeredClass.constructor_body===void 0&&(s.registeredClass.constructor_body=[]),s.registeredClass.constructor_body[r-1]!==void 0)throw new et(`Cannot register multiple constructors with identical number of parameters (${r-1}) for class '${s.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return s.registeredClass.constructor_body[r-1]=()=>{Ot(`Cannot construct ${s.name} due to unbound types`,u)},J([],u,f=>(f.splice(1,0,null),s.registeredClass.constructor_body[r-1]=Gt(c,f,null,i,o),[])),[]})},"Vt"),Ar=a(t=>{t=t.trim();let r=t.indexOf("(");return r!==-1?t.substr(0,r):t},"de"),sn=a((t,r,e,n,i,o,u,s,c,f)=>{var d=Vt(e,n);r=I(r),r=Ar(r),o=U(i,o),J([],[t],p=>{p=p[0];var w=`${p.name}.${r}`;r.startsWith("@@")&&(r=Symbol[r.substring(2)]),s&&p.registeredClass.pureVirtualFunctions.push(r);function C(){Ot(`Cannot call ${w} due to unbound types`,d)}a(C,"m");var P=p.registeredClass.instancePrototype,j=P[r];return j===void 0||j.overloadTable===void 0&&j.className!==p.name&&j.argCount===e-2?(C.argCount=e-2,C.className=p.name,P[r]=C):(wr(P,r,w),P[r].overloadTable[e-2]=C),J([],d,A=>{var S=Gt(w,A,p,o,u);return P[r].overloadTable===void 0?(S.argCount=e-2,P[r]=S):P[r].overloadTable[e-2]=S,[]}),[]})},"Bt"),Zt=[],z=[],Xt=a(t=>{t>9&&--z[t+1]===0&&(z[t]=void 0,Zt.push(t))},"Mr"),un=a(()=>z.length/2-5-Zt.length,"Nt"),cn=a(()=>{z.push(0,1,void 0,1,null,1,!0,1,!1,1),l.count_emval_handles=un},"Zt"),V={toValue:a(t=>(t||b("Cannot use deleted val. handle = "+t),z[t]),"toValue"),toHandle:a(t=>{switch(t){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{let r=Zt.pop()||z.length;return z[r]=t,z[r+1]=1,r}}},"toHandle")},Sr={name:"emscripten::val",fromWireType:a(t=>{var r=V.toValue(t);return Xt(t),r},"fromWireType"),toWireType:a((t,r)=>V.toHandle(r),"toWireType"),argPackAdvance:N,readValueFromPointer:st,destructorFunction:null},ln=a(t=>B(t,Sr),"zt"),qt=a(t=>{if(t===null)return"null";var r=typeof t;return r==="object"||r==="array"||r==="function"?t.toString():""+t},"xr"),fn=a((t,r)=>{switch(r){case 4:return function(e){return this.fromWireType(sr[e>>2])};case 8:return function(e){return this.fromWireType(ur[e>>3])};default:throw new TypeError(`invalid float width (${r}): ${t}`)}},"Gt"),dn=a((t,r,e)=>{r=I(r),B(t,{name:r,fromWireType:a(n=>n,"fromWireType"),toWireType:a((n,i)=>i,"toWireType"),argPackAdvance:N,readValueFromPointer:fn(r,e),destructorFunction:null})},"Xt"),hn=a((t,r,e,n,i,o,u,s)=>{var c=Vt(r,e);t=I(t),t=Ar(t),i=U(n,i),br(t,function(){Ot(`Cannot call ${t} due to unbound types`,c)},r-1),J([],c,f=>{var d=[f[0],null].concat(f.slice(1));return Cr(t,Gt(t,d,null,i,o),r-1),[]})},"Lt"),pn=a((t,r,e)=>{switch(r){case 1:return e?n=>L[n]:n=>R[n];case 2:return e?n=>at[n>>1]:n=>vt[n>>1];case 4:return e?n=>tt[n>>2]:n=>T[n>>2];default:throw new TypeError(`invalid integer width (${r}): ${t}`)}},"qt"),vn=a((t,r,e,n,i)=>{r=I(r);var o=a(d=>d,"a");if(n===0){var u=32-8*e;o=a(d=>d<<u>>>u,"a")}var s=r.includes("unsigned"),c=a((d,p)=>{},"u"),f;s?f=a(function(d,p){return c(p,this.name),p>>>0},"l"):f=a(function(d,p){return c(p,this.name),p},"l"),B(t,{name:r,fromWireType:o,toWireType:f,argPackAdvance:N,readValueFromPointer:pn(r,e,n!==0),destructorFunction:null})},"Kt"),yn=a((t,r,e)=>{var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],i=n[r];function o(u){var s=T[u>>2],c=T[u+4>>2];return new i(L.buffer,c,s)}a(o,"a"),e=I(e),B(t,{name:e,fromWireType:o,argPackAdvance:N,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})},"Yt"),mn=Object.assign({optional:!0},Sr),gn=a((t,r)=>{B(t,mn)},"Qt"),$n=a((t,r,e,n)=>{if(!(n>0))return 0;for(var i=e,o=e+n-1,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var c=t.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(e>=o)break;r[e++]=s}else if(s<=2047){if(e+1>=o)break;r[e++]=192|s>>6,r[e++]=128|s&63}else if(s<=65535){if(e+2>=o)break;r[e++]=224|s>>12,r[e++]=128|s>>6&63,r[e++]=128|s&63}else{if(e+3>=o)break;r[e++]=240|s>>18,r[e++]=128|s>>12&63,r[e++]=128|s>>6&63,r[e++]=128|s&63}}return r[e]=0,e-i},"rn"),ct=a((t,r,e)=>$n(t,R,r,e),"Q"),wn=a(t=>{for(var r=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);n<=127?r++:n<=2047?r+=2:n>=55296&&n<=57343?(r+=4,++e):r+=3}return r},"en"),Or=typeof TextDecoder<"u"?new TextDecoder:void 0,jr=a(function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var n=r+e,i=r;t[i]&&!(i>=n);)++i;if(i-r>16&&t.buffer&&Or)return Or.decode(t.subarray(r,i));for(var o="";r<i;){var u=t[r++];if(!(u&128)){o+=String.fromCharCode(u);continue}var s=t[r++]&63;if((u&224)==192){o+=String.fromCharCode((u&31)<<6|s);continue}var c=t[r++]&63;if((u&240)==224?u=(u&15)<<12|s<<6|c:u=(u&7)<<18|s<<12|c<<6|t[r++]&63,u<65536)o+=String.fromCharCode(u);else{var f=u-65536;o+=String.fromCharCode(55296|f>>10,56320|f&1023)}}return o},"_e"),bn=a((t,r)=>t?jr(R,t,r):"","tn"),Cn=a((t,r)=>{r=I(r),B(t,{name:r,fromWireType(e){for(var n=T[e>>2],i=e+4,o,s,u=i,s=0;s<=n;++s){var c=i+s;if(s==n||R[c]==0){var f=c-u,d=bn(u,f);o===void 0?o=d:(o+="\0",o+=d),u=c+1}}return G(e),o},toWireType(e,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var i,o=typeof n=="string";o||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||b("Cannot pass non-string to std::string"),o?i=wn(n):i=n.length;var u=Kt(4+i+1),s=u+4;if(T[u>>2]=i,o)ct(n,s,i+1);else if(o)for(var c=0;c<i;++c){var f=n.charCodeAt(c);f>255&&(G(s),b("String has UTF-16 code units that do not fit in 8 bits")),R[s+c]=f}else for(var c=0;c<i;++c)R[s+c]=n[c];return e!==null&&e.push(G,u),u},argPackAdvance:N,readValueFromPointer:st,destructorFunction(e){G(e)}})},"nn"),Fr=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,Tn=a((t,r)=>{for(var e=t,n=e>>1,i=n+r/2;!(n>=i)&&vt[n];)++n;if(e=n<<1,e-t>32&&Fr)return Fr.decode(R.subarray(t,e));for(var o="",u=0;!(u>=r/2);++u){var s=at[t+u*2>>1];if(s==0)break;o+=String.fromCharCode(s)}return o},"an"),Pn=a((t,r,e)=>{var n;if((n=e)!==null&&n!==void 0||(e=2147483647),e<2)return 0;e-=2;for(var i=r,o=e<t.length*2?e/2:t.length,u=0;u<o;++u){var s=t.charCodeAt(u);at[r>>1]=s,r+=2}return at[r>>1]=0,r-i},"on"),_n=a(t=>t.length*2,"sn"),An=a((t,r)=>{for(var e=0,n="";!(e>=r/4);){var i=tt[t+e*4>>2];if(i==0)break;if(++e,i>=65536){var o=i-65536;n+=String.fromCharCode(55296|o>>10,56320|o&1023)}else n+=String.fromCharCode(i)}return n},"un"),Sn=a((t,r,e)=>{var n;if((n=e)!==null&&n!==void 0||(e=2147483647),e<4)return 0;for(var i=r,o=i+e-4,u=0;u<t.length;++u){var s=t.charCodeAt(u);if(s>=55296&&s<=57343){var c=t.charCodeAt(++u);s=65536+((s&1023)<<10)|c&1023}if(tt[r>>2]=s,r+=4,r+4>o)break}return tt[r>>2]=0,r-i},"fn"),On=a(t=>{for(var r=0,e=0;e<t.length;++e){var n=t.charCodeAt(e);n>=55296&&n<=57343&&++e,r+=4}return r},"ln"),jn=a((t,r,e)=>{e=I(e);var n,i,o,u;r===2?(n=Tn,i=Pn,u=_n,o=a(s=>vt[s>>1],"a")):r===4&&(n=An,i=Sn,u=On,o=a(s=>T[s>>2],"a")),B(t,{name:e,fromWireType:a(s=>{for(var c=T[s>>2],f,d=s+4,p=0;p<=c;++p){var w=s+4+p*r;if(p==c||o(w)==0){var C=w-d,P=n(d,C);f===void 0?f=P:(f+="\0",f+=P),d=w+r}}return G(s),f},"fromWireType"),toWireType:a((s,c)=>{typeof c!="string"&&b(`Cannot pass non-string to C++ string type ${e}`);var f=u(c),d=Kt(4+f+r);return T[d>>2]=f/r,i(c,d+4,f+r),s!==null&&s.push(G,d),d},"toWireType"),argPackAdvance:N,readValueFromPointer:st,destructorFunction(s){G(s)}})},"cn"),Fn=a((t,r,e,n,i,o)=>{wt[t]={name:I(r),rawConstructor:U(e,n),rawDestructor:U(i,o),fields:[]}},"vn"),En=a((t,r,e,n,i,o,u,s,c,f)=>{wt[t].fields.push({fieldName:I(r),getterReturnType:e,getter:U(n,i),getterContext:o,setterArgumentType:u,setter:U(s,c),setterContext:f})},"dn"),In=a((t,r)=>{r=I(r),B(t,{isVoid:!0,name:r,argPackAdvance:0,fromWireType:a(()=>{},"fromWireType"),toWireType:a((e,n)=>{},"toWireType")})},"pn"),xn=a((t,r,e)=>R.copyWithin(t,r,r+e),"hn"),Qt=[],Rn=a((t,r,e,n)=>(t=Qt[t],r=V.toValue(r),t(null,r,e,n)),"_n"),Wn={},Mn=a(t=>{var r=Wn[t];return r===void 0?I(t):r},"yn"),Er=a(()=>{if(typeof globalThis=="object")return globalThis;function t(r){r.$$$embind_global$$$=r;var e=typeof $$$embind_global$$$=="object"&&r.$$$embind_global$$$==r;return e||delete r.$$$embind_global$$$,e}if(a(t,"e"),typeof $$$embind_global$$$=="object"||(typeof global=="object"&&t(global)?$$$embind_global$$$=global:typeof self=="object"&&t(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},"ye"),Un=a(t=>t===0?V.toHandle(Er()):(t=Mn(t),V.toHandle(Er()[t])),"mn"),kn=a(t=>{var r=Qt.length;return Qt.push(t),r},"$n"),Ir=a((t,r)=>{var e=Q[t];return e===void 0&&b(`${r} has unknown type ${_r(t)}`),e},"me"),Dn=a((t,r)=>{for(var e=new Array(t),n=0;n<t;++n)e[n]=Ir(T[r+n*4>>2],"parameter "+n);return e},"bn"),Bn=Reflect.construct,Ln=a((t,r,e)=>{var n=[],i=t.toWireType(n,e);return n.length&&(T[r>>2]=V.toHandle(n)),i},"Cn"),Hn=a((t,r,e)=>{var n=Dn(t,r),i=n.shift();t--;var o=new Array(t),u=a((c,f,d,p)=>{for(var w=0,C=0;C<t;++C)o[C]=n[C].readValueFromPointer(p+w),w+=n[C].argPackAdvance;var P=e===1?Bn(f,o):f.apply(c,o);return Ln(i,d,P)},"s"),s=`methodCaller<(${n.map(c=>c.name).join(", ")}) => ${i.name}>`;return kn(_t(s,u))},"Tn"),Nn=a(t=>{t>9&&(z[t+1]+=1)},"Pn"),zn=a(t=>{var r=V.toValue(t);Lt(r),Xt(t)},"An"),Vn=a((t,r)=>{t=Ir(t,"_emval_take_value");var e=t.readValueFromPointer(r);return V.toHandle(e)},"Rn"),Gn=a((t,r,e,n)=>{var i=new Date().getFullYear(),o=new Date(i,0,1),u=new Date(i,6,1),s=o.getTimezoneOffset(),c=u.getTimezoneOffset(),f=Math.max(s,c);T[t>>2]=f*60,tt[r>>2]=+(s!=c);var d=a(C=>{var P=C>=0?"-":"+",j=Math.abs(C),A=String(Math.floor(j/60)).padStart(2,"0"),S=String(j%60).padStart(2,"0");return`UTC${P}${A}${S}`},"c"),p=d(s),w=d(c);c<s?(ct(p,e,17),ct(w,n,17)):(ct(p,n,17),ct(w,e,17))},"En"),Zn=a(()=>2147483648,"Fn"),Xn=a((t,r)=>Math.ceil(t/r)*r,"kn"),qn=a(t=>{var r=pt.buffer,e=(t-r.byteLength+65535)/65536|0;try{return pt.grow(e),cr(),1}catch{}},"Sn"),Qn=a(t=>{var r=R.length;t>>>=0;var e=Zn();if(t>e)return!1;for(var n=1;n<=4;n*=2){var i=r*(1+.2/n);i=Math.min(i,t+100663296);var o=Math.min(e,Xn(Math.max(t,i),65536)),u=qn(o);if(u)return!0}return!1},"jn"),Jt={},Jn=a(()=>ar||"./this.program","On"),lt=a(()=>{if(!lt.strings){var t=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:t,_:Jn()};for(var e in Jt)Jt[e]===void 0?delete r[e]:r[e]=Jt[e];var n=[];for(var e in r)n.push(`${e}=${r[e]}`);lt.strings=n}return lt.strings},"rr"),Kn=a((t,r)=>{for(var e=0;e<t.length;++e)L[r++]=t.charCodeAt(e);L[r]=0},"Wn"),Yn=a((t,r)=>{var e=0;return lt().forEach((n,i)=>{var o=r+e;T[t+i*4>>2]=o,Kn(n,o),e+=n.length+1}),0},"Dn"),ta=a((t,r)=>{var e=lt();T[t>>2]=e.length;var n=0;return e.forEach(i=>n+=i.length+1),T[r>>2]=n,0},"Mn"),ra=a(t=>52,"xn");function ea(t,r,e,n,i){return 70}a(ea,"Un");var na=[null,[],[]],aa=a((t,r)=>{var e=na[t];r===0||r===10?((t===1?oe:Y)(jr(e)),e.length=0):e.push(r)},"Hn"),ia=a((t,r,e,n)=>{for(var i=0,o=0;o<e;o++){var u=T[r>>2],s=T[r+4>>2];r+=8;for(var c=0;c<s;c++)aa(t,R[u+c]);i+=s}return T[n>>2]=i,0},"Vn"),oa=a(t=>t,"Bn");pr=l.InternalError=class extends Error{constructor(t){super(t),this.name="InternalError"}},We(),et=l.BindingError=class extends Error{constructor(t){super(t),this.name="BindingError"}},ze(),Ke(),Pr=l.UnboundTypeError=en(Error,"UnboundTypeError"),cn();var sa={s:Te,w:Pe,a:Ae,j:Se,l:Oe,M:je,p:Fe,ca:Ee,d:_e,Z:Ie,sa:xe,Y:Re,na:Ue,qa:nn,pa:on,D:sn,la:ln,Q:dn,R:hn,x:vn,t:yn,ra:gn,ma:Cn,N:jn,J:Fn,ta:En,oa:In,fa:xn,U:Rn,ua:Xt,wa:Un,_:Hn,S:Nn,va:zn,ka:Vn,$:Gn,da:Qn,aa:Yn,ba:ta,ea:ra,W:ea,P:ia,H:Oa,B:Fa,T:ha,O:Ua,q:Pa,b:ca,C:Sa,ha:Ia,c:fa,ga:xa,h:da,i:ga,r:$a,L:Aa,v:ba,G:Wa,I:_a,z:Ea,F:ka,X:Ba,V:La,k:va,f:pa,e:la,g:ua,K:Ma,m:ma,ia:ja,o:wa,u:Ca,ja:Ta,A:Ra,n:ya,E:Da,y:oa},_;Ce();var xr=a(t=>(xr=_.za)(t),"$e"),G=l._free=t=>(G=l._free=_.Aa)(t),Kt=l._malloc=t=>(Kt=l._malloc=_.Ca)(t),Rr=a(t=>(Rr=_.Da)(t),"be"),y=a((t,r)=>(y=_.Ea)(t,r),"d"),Wr=a(t=>(Wr=_.Fa)(t),"we"),Mr=a(t=>(Mr=_.Ga)(t),"Ce"),Ur=a(()=>(Ur=_.Ha)(),"Te"),kr=a(t=>(kr=_.Ia)(t),"Pe"),Dr=a(t=>(Dr=_.Ja)(t),"Ae"),Br=a((t,r,e)=>(Br=_.Ka)(t,r,e),"Re");l.dynCall_viijii=(t,r,e,n,i,o,u)=>(l.dynCall_viijii=_.La)(t,r,e,n,i,o,u);var Lr=l.dynCall_jiii=(t,r,e,n)=>(Lr=l.dynCall_jiii=_.Ma)(t,r,e,n);l.dynCall_jiji=(t,r,e,n,i)=>(l.dynCall_jiji=_.Na)(t,r,e,n,i);var Hr=l.dynCall_jiiii=(t,r,e,n,i)=>(Hr=l.dynCall_jiiii=_.Oa)(t,r,e,n,i);l.dynCall_iiiiij=(t,r,e,n,i,o,u)=>(l.dynCall_iiiiij=_.Pa)(t,r,e,n,i,o,u),l.dynCall_iiiiijj=(t,r,e,n,i,o,u,s,c)=>(l.dynCall_iiiiijj=_.Qa)(t,r,e,n,i,o,u,s,c),l.dynCall_iiiiiijj=(t,r,e,n,i,o,u,s,c,f)=>(l.dynCall_iiiiiijj=_.Ra)(t,r,e,n,i,o,u,s,c,f);function ua(t,r,e,n){var i=g();try{$(t)(r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(ua,"Zn");function ca(t,r){var e=g();try{return $(t)(r)}catch(n){if(m(e),n!==n+0)throw n;y(1,0)}}a(ca,"zn");function la(t,r,e){var n=g();try{$(t)(r,e)}catch(i){if(m(n),i!==i+0)throw i;y(1,0)}}a(la,"Gn");function fa(t,r,e){var n=g();try{return $(t)(r,e)}catch(i){if(m(n),i!==i+0)throw i;y(1,0)}}a(fa,"Xn");function da(t,r,e,n){var i=g();try{return $(t)(r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(da,"Ln");function ha(t,r,e,n,i){var o=g();try{return $(t)(r,e,n,i)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}a(ha,"qn");function pa(t,r){var e=g();try{$(t)(r)}catch(n){if(m(e),n!==n+0)throw n;y(1,0)}}a(pa,"Kn");function va(t){var r=g();try{$(t)()}catch(e){if(m(r),e!==e+0)throw e;y(1,0)}}a(va,"Yn");function ya(t,r,e,n,i,o,u,s,c,f,d){var p=g();try{$(t)(r,e,n,i,o,u,s,c,f,d)}catch(w){if(m(p),w!==w+0)throw w;y(1,0)}}a(ya,"Jn");function ma(t,r,e,n,i){var o=g();try{$(t)(r,e,n,i)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}a(ma,"Qn");function ga(t,r,e,n,i){var o=g();try{return $(t)(r,e,n,i)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}a(ga,"ri");function $a(t,r,e,n,i,o){var u=g();try{return $(t)(r,e,n,i,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}a($a,"ei");function wa(t,r,e,n,i,o){var u=g();try{$(t)(r,e,n,i,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}a(wa,"ti");function ba(t,r,e,n,i,o,u){var s=g();try{return $(t)(r,e,n,i,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}a(ba,"ni");function Ca(t,r,e,n,i,o,u,s){var c=g();try{$(t)(r,e,n,i,o,u,s)}catch(f){if(m(c),f!==f+0)throw f;y(1,0)}}a(Ca,"ii");function Ta(t,r,e,n,i,o,u,s,c){var f=g();try{$(t)(r,e,n,i,o,u,s,c)}catch(d){if(m(f),d!==d+0)throw d;y(1,0)}}a(Ta,"ai");function Pa(t){var r=g();try{return $(t)()}catch(e){if(m(r),e!==e+0)throw e;y(1,0)}}a(Pa,"oi");function _a(t,r,e,n,i,o,u,s,c){var f=g();try{return $(t)(r,e,n,i,o,u,s,c)}catch(d){if(m(f),d!==d+0)throw d;y(1,0)}}a(_a,"si");function Aa(t,r,e,n,i,o,u){var s=g();try{return $(t)(r,e,n,i,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}a(Aa,"ui");function Sa(t,r,e,n){var i=g();try{return $(t)(r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(Sa,"fi");function Oa(t,r,e,n){var i=g();try{return $(t)(r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(Oa,"li");function ja(t,r,e,n,i,o,u,s){var c=g();try{$(t)(r,e,n,i,o,u,s)}catch(f){if(m(c),f!==f+0)throw f;y(1,0)}}a(ja,"ci");function Fa(t,r,e,n,i,o){var u=g();try{return $(t)(r,e,n,i,o)}catch(s){if(m(u),s!==s+0)throw s;y(1,0)}}a(Fa,"vi");function Ea(t,r,e,n,i,o,u,s,c,f){var d=g();try{return $(t)(r,e,n,i,o,u,s,c,f)}catch(p){if(m(d),p!==p+0)throw p;y(1,0)}}a(Ea,"di");function Ia(t,r,e){var n=g();try{return $(t)(r,e)}catch(i){if(m(n),i!==i+0)throw i;y(1,0)}}a(Ia,"pi");function xa(t,r,e,n,i){var o=g();try{return $(t)(r,e,n,i)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}a(xa,"hi");function Ra(t,r,e,n,i,o,u,s,c,f){var d=g();try{$(t)(r,e,n,i,o,u,s,c,f)}catch(p){if(m(d),p!==p+0)throw p;y(1,0)}}a(Ra,"_i");function Wa(t,r,e,n,i,o,u,s){var c=g();try{return $(t)(r,e,n,i,o,u,s)}catch(f){if(m(c),f!==f+0)throw f;y(1,0)}}a(Wa,"gi");function Ma(t,r,e,n,i,o,u){var s=g();try{$(t)(r,e,n,i,o,u)}catch(c){if(m(s),c!==c+0)throw c;y(1,0)}}a(Ma,"yi");function Ua(t,r,e,n){var i=g();try{return $(t)(r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(Ua,"mi");function ka(t,r,e,n,i,o,u,s,c,f,d,p){var w=g();try{return $(t)(r,e,n,i,o,u,s,c,f,d,p)}catch(C){if(m(w),C!==C+0)throw C;y(1,0)}}a(ka,"$i");function Da(t,r,e,n,i,o,u,s,c,f,d,p,w,C,P,j){var A=g();try{$(t)(r,e,n,i,o,u,s,c,f,d,p,w,C,P,j)}catch(S){if(m(A),S!==S+0)throw S;y(1,0)}}a(Da,"bi");function Ba(t,r,e,n){var i=g();try{return Lr(t,r,e,n)}catch(o){if(m(i),o!==o+0)throw o;y(1,0)}}a(Ba,"wi");function La(t,r,e,n,i){var o=g();try{return Hr(t,r,e,n,i)}catch(u){if(m(o),u!==u+0)throw u;y(1,0)}}a(La,"Ci");var jt;it=a(function t(){jt||Nr(),jt||(it=t)},"e");function Nr(){if(q>0||(se(),q>0))return;function t(){var r;jt||(jt=!0,l.calledRun=!0,!or&&(ue(),W(l),(r=l.onRuntimeInitialized)===null||r===void 0||r.call(l),ce()))}a(t,"e"),l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1),t()},1)):t()}if(a(Nr,"ke"),l.preInit)for(typeof l.preInit=="function"&&(l.preInit=[l.preInit]);l.preInit.length>0;)l.preInit.pop()();return Nr(),X=k,X}})();function ne(h){return er(nr,h)}a(ne,"De");function ui(){return re(nr)}a(ui,"Si");function ci(h){return ne({overrides:h,equalityFn:Object.is,fireImmediately:!0})}a(ci,"ji");function li(h){ne({overrides:h,equalityFn:Object.is,fireImmediately:!1})}a(li,"Oi");async function ae(h,v){return ee(nr,h,v)}a(ae,"Me");async function fi(h,v){return ae(h,v)}a(fi,"Wi");async function di(h,v){return ae(h,v)}a(di,"Di");var hi="5bb3ce7aeedc314e24afb873bebcf366a01c27a00b21cdf2fa98b819c005c16b";export{Ya as ZXING_CPP_COMMIT,hi as ZXING_WASM_SHA256,Ka as ZXING_WASM_VERSION,ft as barcodeFormats,Jr as binarizers,rr as characterSets,Kr as contentTypes,ei as defaultReaderOptions,Yr as eanAddOnSymbols,ci as getZXingModule,qr as linearBarcodeFormats,Qr as matrixBarcodeFormats,ne as prepareZXingModule,ui as purgeZXingModule,ae as readBarcodes,di as readBarcodesFromImageData,fi as readBarcodesFromImageFile,li as setZXingModuleOverrides,te as textModes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-4FHWXBOB.js";var A=5242880,E=2560,w=[.92,.85,.75],c=new Set(["","image/jpeg","image/jpg","image/pjpeg","image/png","image/heic","image/heif","image/heic-sequence","image/heif-sequence"]),m=new Set(["heic","heix","hevc","hevx","heim","heis","mif1","msf1"]);function y(e){if(e.length>=3&&e[0]===255&&e[1]===216&&e[2]===255)return"jpeg";if(e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10)return"png";if(e.length>=12&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112){let t=String.fromCharCode(e[8],e[9],e[10],e[11]);return m.has(t)?"heif":null}return null}h(y,"w");function _(e){return e.length>=5&&e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70&&e[4]===45}h(_,"x");var x=new Set(["application/pdf","application/x-pdf"]);async function T(e){let t=(e.type??"").toLowerCase();if(t!==""&&!x.has(t))return"other";let r;try{r=_(await u(e))}catch{r=!1}return r?"pdf":t===""?"other":"bad"}h(T,"E");async function u(e){let t=e.slice(0,16);return typeof t.arrayBuffer=="function"?new Uint8Array(await t.arrayBuffer()):new Promise((r,i)=>{let a=new FileReader;a.onload=()=>r(new Uint8Array(a.result)),a.onerror=()=>i(a.error),a.readAsArrayBuffer(t)})}h(u,"p");var M=h(async e=>{let t=await createImageBitmap(e,{imageOrientation:"from-image"});return{width:t.width,height:t.height,draw:h((r,i,a)=>r.drawImage(t,0,0,i,a),"draw"),close:h(()=>t.close(),"close")}},"y"),v=h((e,t)=>{let r=document.createElement("canvas");r.width=e.width,r.height=e.height;let i=r.getContext("2d");return i===null?Promise.resolve(null):(e.draw(i,e.width,e.height),new Promise(a=>r.toBlob(a,"image/jpeg",t)))},"A");async function b(e,t={}){let r=(e.type??"").toLowerCase();if(!c.has(r)||e.size===0)throw new TypeError("unsupported_file");let i;try{i=y(await u(e))}catch{i=null}if(i===null)throw new TypeError("unsupported_file");if(i!=="heif"&&e.size<=5242880)return{blob:e,contentType:i==="png"?"image/png":"image/jpeg",converted:!1};let a=t.decode??M,d=t.encode??v,n;try{n=await a(e)}catch{throw new TypeError("unsupported_file")}try{if(!(n.width>0&&n.height>0))throw new TypeError("unsupported_file");let l=Math.min(2560,Math.max(n.width,n.height));for(let f=0;f<2;f+=1){let p=l/Math.max(n.width,n.height),g={width:Math.max(1,Math.round(n.width*p)),height:Math.max(1,Math.round(n.height*p)),draw:n.draw};for(let s of w){let o=await d(g,s).catch(()=>null);if(o!==null&&o.size>0&&o.size<=5242880)return{blob:o,contentType:"image/jpeg",converted:!0}}l=Math.round(l*.75)}throw new TypeError("unsupported_file")}finally{n.close()}}h(b,"P");export{A as UPLOAD_MAX_BYTES,E as UPLOAD_MAX_LONG_SIDE,T as pdfFileKind,b as prepareUploadFile,_ as sniffPdf,y as sniffUploadFormat};
|
package/dist/cdn/define.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./chunks/chunk-
|
|
1
|
+
import{g as e}from"./chunks/chunk-QESNTWNP.js";import"./chunks/chunk-KPGPSJ64.js";import"./chunks/chunk-ZPLN3VRG.js";import"./chunks/chunk-QE347ZEI.js";import"./chunks/chunk-QAZ7TATZ.js";import"./chunks/chunk-NU2VUYVN.js";import"./chunks/chunk-B2KJUHRZ.js";import"./chunks/chunk-NUIGLBFF.js";import"./chunks/chunk-QFCNXANK.js";import"./chunks/chunk-IBCFJKIO.js";import"./chunks/chunk-MLNUIPVU.js";import"./chunks/chunk-YI34K4SS.js";import"./chunks/chunk-ZWC7BGLD.js";import"./chunks/chunk-CUFOLAZN.js";import"./chunks/chunk-67YJZR73.js";import"./chunks/chunk-4QUL7TEF.js";import"./chunks/chunk-WICQIC37.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-QESNTWNP.js";import"./chunks/chunk-KPGPSJ64.js";import"./chunks/chunk-ZPLN3VRG.js";import"./chunks/chunk-QE347ZEI.js";import"./chunks/chunk-QAZ7TATZ.js";import"./chunks/chunk-NU2VUYVN.js";import"./chunks/chunk-B2KJUHRZ.js";import"./chunks/chunk-NUIGLBFF.js";import"./chunks/chunk-QFCNXANK.js";import{a as n}from"./chunks/chunk-IBCFJKIO.js";import"./chunks/chunk-MLNUIPVU.js";import"./chunks/chunk-YI34K4SS.js";import"./chunks/chunk-ZWC7BGLD.js";import"./chunks/chunk-CUFOLAZN.js";import"./chunks/chunk-67YJZR73.js";import"./chunks/chunk-4QUL7TEF.js";import"./chunks/chunk-WICQIC37.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-OAQM45LZ.js";import{d as U}from"./chunk-BGEGDQXU.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-AVSVM522.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{d as U}from"./chunk-
|
|
1
|
+
import{d as U}from"./chunk-PEFS2JPA.js";import{F as C,J as H,a as Z,b as E,v as B}from"./chunk-AVSVM522.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(S,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:S,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),j=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:j-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:j+2*e.b+48},children:[S?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-AVSVM522.js";import{a as i,c as r,i as t}from"./chunk-SSU37LFQ.js";var s=r(d(),1);var u=(0,s.createContext)(null);function c(a,n,o){let e=n.detail;return{check:a,kind:n.kind,...e?.name!==void 0?{name:e.name}:{},...e?.phase!==void 0?{phase:e.phase}:{},...e?.engineKind!==void 0?{engineKind:e.engineKind}:{},attempt:Math.max(0,Math.min(1e3,o))}}i(c,"a");t(c,"captureIssueOf");function m(a,n){if(a!==void 0)try{a(n)}catch{}}i(m,"o");t(m,"sendCaptureIssue");export{u as a,c as b,m as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as hr,d as fr}from"./chunk-PEFS2JPA.js";import{b as kr,c as bt}from"./chunk-5KU4GIMW.js";import{a as br}from"./chunk-XXCBLQ53.js";import{c as Ct}from"./chunk-QNR2GBZ5.js";import{a as ur,b as dr,c as pr,d as Ae}from"./chunk-L2F6LQ7G.js";import{G as yr,L as gr,M as vr,a as K,b as de,c as te,m as lr,n as Je,p as or,q as et,r as ir,s as cr,t as kt,u as oe,v as Le,w as tt,y as mr}from"./chunk-AVSVM522.js";import{a as l,c as U,i as s}from"./chunk-SSU37LFQ.js";var _r=U(K(),1),y=U(de(),1),re=U(de(),1),ye=U(K(),1),D=U(de(),1),C=U(K(),1),m=U(K(),1),at=U(K(),1),fe=U(de(),1),Gr=U(K(),1),X=U(K(),1),ot=U(K(),1),we=U(de(),1),Se=U(de(),1),B=U(de(),1),it=U(K(),1),pe=U(K(),1),Q=U(K(),1),L=U(K(),1),me=U(K(),1),Te=U(K(),1),Rt=U(de(),1),v=U(de(),1);import{subscribeCameraPermission as Tn}from"@sekyro/web";import{getLivenessAssetsStatus as Pn,preloadLivenessAssets as Bn,subscribeLivenessAssets as On}from"@sekyro/web";import{createLivenessCapture as Vn}from"@sekyro/web";function ce({className:e,children:t}){return(0,y.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}l(ce,"ne");s(ce,"Svg");var Mt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function wr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,y.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}l(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,y.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,y.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Nr,"pn");s(Nr,"LookStraightIcon");function Rr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Rr,"fn");s(Rr,"CameraCheckIcon");function Mr(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}l(Mr,"mn");s(Mr,"CameraAskIcon");function Ar(e){return(0,y.jsxs)(ce,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M3 3l18 18"})]})}l(Ar,"yn");s(Ar,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,y.jsxs)(ce,{className:t,children:[(0,y.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,y.jsx)("path",{d:"M4 4l16 16"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,y.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(nt,"Ve");s(nt,"SpeakerIcon");function Lr(e){return(0,y.jsx)(ce,{...e,children:(0,y.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Lr,"gn");s(Lr,"CheckIcon");function Er(e){return(0,y.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,y.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],Nn={light:{key:"capture.tips.light",icon:s(()=>(0,re.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,re.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,re.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,re.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Ae(),n=(0,_r.useId)();return e.length===0?null:(0,re.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,re.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,re.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?Nn[r]:void 0,o=typeof r=="string"?r:r.id,c=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,d=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,re.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,re.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,re.jsx)("span",{children:d})]},o)})})]})}l(Ir,"Cn");s(Ir,"TipList");var Rn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:c,look:d="cards",marked:S,onChoose:p}){let w=(0,ye.useId)(),N=kt(),[j,R]=(0,ye.useState)(null),O=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&R(null)},[a]),(0,ye.useEffect)(()=>()=>{O.current!==null&&clearTimeout(O.current)},[]);let q=s(M=>{r||j!==null||(R(M),O.current=setTimeout(()=>{O.current=null,R(null),p(M)},Rn))},"choose");return(0,D.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":c,children:[(0,D.jsxs)("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,D.jsx)("h2",{id:w,ref:o?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,D.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,D.jsx)(oe,{tone:"danger",children:(0,D.jsx)("span",{children:a})}):null,d==="buttons"?(0,D.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((M,J)=>(0,D.jsx)(te,{kind:J===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>p(M.id),"onClick"),children:M.label},M.id))}):(0,D.jsx)("div",{className:"sekyro-choices",children:n.map(M=>(0,D.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(j??S)===M.id,"aria-busy":r||void 0,disabled:r||j!==null&&j!==M.id,onClick:l(()=>q(M.id),"onClick"),children:[M.glyph!==void 0?(0,D.jsx)("span",{className:"sekyro-card__tile",children:M.glyph}):null,(0,D.jsxs)("span",{className:"sekyro-card__body",children:[(0,D.jsx)("span",{className:"sekyro-card__title",children:M.label}),M.sub!==void 0?(0,D.jsx)("span",{className:"sekyro-card__sub",children:M.sub}):null]}),(0,D.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},M.id))})]})}l(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}l(st,"he");s(st,"isVoiceKey");var Mn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Mn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"Me");s(je,"resolveClip");var An="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Ln={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ie(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(ie,"re");s(ie,"synth");function Tr(){return ie()!==null&&typeof SpeechSynthesisUtterance=="function"}l(Tr,"Lr");s(Tr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(wt,"Sn");s(wt,"baseLang");function At(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}l(At,"Mn");s(At,"pickVoice");function Pr(e){if(!Tr())return!1;let t=[];try{t=ie()?.getVoices()??[]}catch{return!0}return t.length===0||At(t,e)!==void 0}l(Pr,"wn");s(Pr,"speechUsable");function Br(e){let t=ie();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Br,"Ln");s(Br,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l($e,"Ke");s($e,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}l(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=null,o=null,c=!1,d=null,S=[],p=new Map,w=s(()=>{S=ie()?.getVoices()??[]},"loadVoices"),N=!1,j=s(()=>{let h=ie();N||h===null||(N=!0,w(),h.addEventListener?.("voiceschanged",w))},"bindVoices"),R=s(()=>(e??(e=new Audio),e),"element"),O=s((h,x,_,k)=>{let u=ie();if(u!==null&&h!==""&&typeof SpeechSynthesisUtterance=="function"){j();let A=At(S,x);if(S.length===0||A!==void 0){u.cancel();let I=new SpeechSynthesisUtterance(h);I.lang=x,A!==void 0&&(I.voice=A),I.rate=.95,_!==void 0&&(I.onend=_),(_!==void 0||k!==void 0)&&(I.onerror=$=>{k!==void 0&&$.error==="not-allowed"?k():_?.()}),u.speak(I);return}}_?.()},"speak"),q=s(()=>{n+=1,r=null,a=o=null,e!==null&&(e.pause(),e.currentTime=0),ie()?.cancel()},"stop"),M=s(h=>{for(let x of h){let _=$e(x);if(p.has(_))continue;let k=new Audio;k.preload="auto",k.src=x,p.set(_,k)}},"warmClips"),J=s((h,x,_)=>{let k={utterance:h,generation:x,end:_};d=k;let u=s(()=>x===n&&d===k,"live"),A=s(()=>{u()&&(a=k)},"block");if(ie()?.cancel(),h.url!==null){let I=R();I.pause(),I.muted=!1,I.src=h.url,I.currentTime=0,I.onended=_??null;let $=s(()=>{o===k&&(o=null)},"settled"),i=I.play();if(i===void 0)return;o=k,i.then($,T=>{if($(),!u())return;let P=T?.name;if(P!=="AbortError"){if(P==="NotAllowedError")return A();h.speech?O(h.text,h.lang,_,A):_?.()}});return}h.speech?O(h.text,h.lang,_,A):_?.()},"start");return{say(h){let x=h.url!==null?$e(h.url):`tts:${h.lang}:${h.text}`;if(x===r)return;r=x,a=o=null,n+=1;let _=n,k=h.onEnd;J(h,_,k!==void 0?()=>{_===n&&k()}:void 0)},unlock({lang:h,speech:x,prefetch:_}){let k=a??(c?null:o);c=!0;let u=k!==null&&k.generation===n?k:null;a=o=null,u!==null&&J(u.utterance,u.generation,u.end);let A=R();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let T=Uint8Array.from(atob(An),P=>P.charCodeAt(0));t=URL.createObjectURL(new Blob([T],{type:"audio/wav"}))}let I=A.paused===!1&&t!==null&&A.src!==t;t!==null&&!I&&(u===null||u.utterance.url===null)&&(A.muted=!0,A.onended=null,A.src=t,A.play()?.catch(()=>{}));let $=ie(),i=u!==null&&u.utterance.url===null;if(x&&!i&&$!==null&&typeof SpeechSynthesisUtterance=="function"){j();let T=new SpeechSynthesisUtterance(" ");T.volume=0,T.lang=h,$.speak(T)}M(_??[])},prefetch:M,stop:q,dispose(){q(),N&&ie()?.removeEventListener?.("voiceschanged",w),N=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let h of p.values())St(h);p.clear()}}}l(Or,"_n");s(Or,"createVoicePlayer");var En="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}l(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",In=typeof window<"u"?C.useLayoutEffect:C.useEffect,Un=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}l(rt,"ht");s(rt,"resolvedClipUrls");function $r({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?En:a.storageKey,[c,d]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(c),[p,w]=(0,C.useState)(!1),[N,j]=(0,C.useState)("none"),[R,O]=(0,C.useState)(!1),q=(0,C.useRef)(!1),[M,J]=(0,C.useState)(0),h=(0,C.useRef)(null),x=(0,C.useCallback)(()=>(h.current??(h.current=Or()),h.current),[]),_=Ln[e],k=a.speechFallback,u=k===void 0||k===!0?!0:k===!1?!1:k.includes(e),A=a.clips??t??Un,I=(0,C.useRef)(!1),$=(0,C.useRef)(A);In(()=>{$.current=A,S.current=c}),(0,C.useEffect)(()=>{if(r||o===null)return;let E=qr(o);E!==null&&(S.current=E,d(E))},[r,o]),(0,C.useEffect)(()=>{if(!(r||!u))return Br(()=>J(E=>E+1))},[r,u]);let i=a.clips;(0,C.useEffect)(()=>{if(r)return;let E=u&&Pr(_);w(rt(A,e).length>0||E),j(i!==void 0&&je(i,Ve,e)!==null?"partner":je(A,Ve,e)!==null||E?"default":"none")},[r,A,i,e,u,_,M]),(0,C.useEffect)(()=>{if(r||!c||!I.current)return;let E=rt(A,e);E.length>0&&x().prefetch(E)},[r,c,A,e,x]),(0,C.useEffect)(()=>()=>{h.current?.dispose(),h.current=null,I.current=!1},[]);let T=(0,C.useCallback)(E=>{r||(I.current=!0,x().unlock({lang:_,speech:u,...E?{prefetch:rt($.current,e)}:{}}))},[r,x,_,u,e]),P=(0,C.useCallback)(()=>T(S.current),[T]),z=(0,C.useCallback)(()=>{q.current=!1,O(!1)},[]),F=(0,C.useCallback)(()=>{z(),h.current?.stop()},[z]),ge=(0,C.useCallback)(()=>{q.current&&F()},[F]),he=(0,C.useCallback)((E,xe)=>{if(r)return;if(q.current){F();return}let ve=x();ve.stop(),q.current=!0,O(!0);let V=xe?.clip===!1?null:je($.current,Ve,e);ve.say({url:V,text:E,lang:_,speech:u,onEnd:z})},[r,F,x,e,_,u,z]),Y=(0,C.useCallback)(E=>{r||(E?T(!0):F(),o!==null&&Vr(o,E),S.current=E,d(E))},[r,T,F,o]),W=(0,C.useCallback)(()=>Y(!S.current),[Y]),ne=(0,C.useCallback)((E,xe)=>{if(r||!c)return;q.current&&z();let ve=je($.current,E,e);x().say({url:ve,text:xe,lang:_,speech:u})},[r,c,e,x,_,u,z]);return(0,C.useMemo)(()=>({supported:!r&&p,enabled:!r&&c,setEnabled:Y,toggle:W,unlock:P,speakKey:ne,stop:F,summary:r?"none":N,summaryPlaying:R,toggleSummary:he,stopSummary:ge}),[r,p,c,Y,W,P,ne,F,N,R,he,ge])}l($r,"vt");s($r,"useVoiceGuidance");function Fr(e,t,n,r){let{speakKey:a,stop:o,enabled:c}=e,d=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!c){d.current&&o(),d.current=!1;return}d.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,c,t,n,a,o])}l(Fr,"Ct");s(Fr,"useSpeakGuidance");function lt(e,t){let n=Dr(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}l(lt,"Pn");s(lt,"retryCoachingOf");function Dr(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}l(Dr,"Pr");s(Dr,"coachingOfReason");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Hr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Ae(),c=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(d=>(0,fe.jsx)("li",{children:o(d)},d))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(te,{ref:c,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}l(Hr,"Tn");s(Hr,"CapturedPanel");function Lt(){try{return!1}catch{return!1}}l(Lt,"nt");s(Lt,"isDevBuild");var jn=(0,Gr.createContext)(null);function Kr({state:e}){let t=Ae(),[n,r]=(0,ot.useState)(!1);(0,ot.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Rr,{}):e==="denied"?(0,we.jsx)(Ar,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(Kr,"On");s(Kr,"PermissionRow");function Zr({voice:e}){let t=Ae();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Lr,{className:"sekyro-switch__check"}):null})})]})}l(Zr,"Hn");s(Zr,"VoiceSwitch");function zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:c,startLabel:d,startDisabled:S,onStart:p}){let w=Ae(),N=(0,X.useRef)(c?.stop);N.current=c?.stop,(0,X.useEffect)(()=>()=>N.current?.(),[]);let j=(0,X.useRef)(null),R=(0,X.useRef)(null),O=(0,X.useRef)(null),q=(0,X.useRef)(e),M=(0,X.useRef)(!1);(0,X.useEffect)(()=>{let u=q.current;if(q.current=e,u===e)return;let A=M.current;e!=="loading"&&(M.current=!1),Yr(j.current)&&(e==="failed"?O.current?.focus():A&&R.current?.focus())},[e]);let J=(0,X.useCallback)(()=>{M.current=!0,t()},[t]),h=e==="loading",x=h||S,_=(0,X.useCallback)(()=>{x||(N.current?.(),p())},[x,p]),k;return e==="failed"?k=(0,B.jsxs)(oe,{tone:"danger",testId:"sekyro-assets-error",children:[(0,B.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,B.jsx)(te,{kind:"ghost",ref:O,className:"sekyro-btn--start",onClick:J,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):k=(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,B.jsx)(te,{ref:R,full:!0,"data-testid":"sekyro-start","aria-disabled":x?"true":void 0,"aria-busy":h?"true":void 0,onClick:_,children:h?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Er,{}),w("capture.preparing.title")]}):d??w("capture.start")}),h?(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,B.jsxs)("div",{ref:j,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,B.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,B.jsx)(Ir,{tips:o}):null,c!==void 0?(0,B.jsxs)(te,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,B.jsx)(nt,{off:!1}),w(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,B.jsx)(Kr,{state:n}),(0,B.jsx)(Zr,{voice:a}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),k,(0,B.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}l(zr,"Fn");s(zr,"PreCaptureScreen");function Yr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(Yr,"Hr");s(Yr,"focusIsOurs");function Wr(){let[e,t]=(0,it.useState)({state:"unknown",settled:!1});return(0,it.useEffect)(()=>Tn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(Wr,"Dn");s(Wr,"useCameraStatus");function Qr(e){return Et(e,"mobileRequired")}l(Qr,"qn");s(Qr,"useMobileRequired");function Xr(e){return Et(e,"returning").required}l(Xr,"jn");s(Xr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(c=>{o&&r({required:c===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}l(Et,"Yn");s(Et,"useFlag");function Jr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:c,settled:!0});return}let d=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let p=e.captureChoice??null;d&&r({session:p!==null&&S===p?"choice":S==="assisted"||S==="choice"?S:"self",choice:p,settled:!0})},()=>{d&&r({session:"self",choice:null,settled:!0})}),()=>{d=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(c=>({...c,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}l(Jr,"$n");s(Jr,"useCaptureMode");function en(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}l(en,"zn");s(en,"useBusy");var qn=s(()=>"idle","serverSnapshot");function xt(e){return Bn(e!==void 0?{assetBaseUrl:e}:{})}l(xt,"Qn");s(xt,"preload");function tn(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(p=>On(p,e),[e]),()=>Pn(e),qn),[r,a]=(0,Q.useState)(null),o=(0,Q.useRef)(!1),c=(0,Q.useCallback)(()=>{xt(e).then(p=>{o.current&&p==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]);let d=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[n,e,c,t]);let S=(0,Q.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}l(tn,"Jn");s(tn,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function rn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,a=(0,L.useRef)(!1);e.verification!==r&&!a.current&&Lt()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let o=(0,L.useRef)(null),[c,d]=(0,L.useState)("idle"),[S,p]=(0,L.useState)(Cr),[w,N]=(0,L.useState)(!1),[j,R]=(0,L.useState)(!1),[O,q]=(0,L.useState)(null),[M,J]=(0,L.useState)(!1),[h,x]=(0,L.useState)(null),[_,k]=(0,L.useState)(null),[u,A]=(0,L.useState)(null),[I,$]=(0,L.useState)(null),[i,T]=(0,L.useState)(null),[P,z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ge=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Y,W]=(0,L.useState)(0),ne=(0,L.useRef)(e);ne.current=e,(0,L.useEffect)(()=>{let ee=t.current;if(ee===null)return;let ue={video:ee,...n!==void 0?{assetBaseUrl:n}:{}},H=r!==void 0?r.liveness(ue):Vn(ue);o.current=H;let Ne=s(()=>T(H.facingMode??null),"readFacing");Ne();let De=[H.on("state",b=>{b==="mode_switch"?z(!0):b!=="starting"&&b!=="gating"&&z(!1),b==="starting"?(ge.current!=="starting"&&(he.current+=1,W(Math.max(0,he.current))),k(null),A(null),p(Cr),R(!1),N(!1),q(null),x(null),F.current=null):b==="gating"&&ge.current==="recording"&&(R(!1),N(!1),q(null),F.current=null),ge.current=b,Ne(),d(b),ne.current.onStateChange?.(b)}),H.on("gate",b=>{let ke=F.current;F.current=b.progress,N(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&R(!0),p(b)}),H.on("frozen",({previewDataUrl:b})=>q(b)),H.on("profile",({animations:b})=>J(b==="reduced")),H.on("ramp",({colour:b})=>x(b)),H.on("captured",b=>{k(b),$(null),ne.current.onCaptured?.(b)}),H.on("error",b=>{A(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),ne.current.onError?.(b)}),r?.on("result",b=>{$(b),ne.current.onResult?.(b)})];return()=>{for(let b of De)b?.();o.current=null,H.destroy()}},[r,t,n]);let E=(0,L.useCallback)(()=>{o.current?.start()},[]),xe=(0,L.useCallback)(()=>{o.current?.retry()},[]),ve=(0,L.useCallback)(async()=>{let ee=o.current;return ee===null||typeof ee.canSwitchCaptureMode!="function"?!1:await ee.canSwitchCaptureMode().catch(()=>!1)===!0},[]),V=(0,L.useCallback)(async ee=>{let ue=o.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let H=await ue.setCaptureMode(ee).catch(()=>!1)===!0;return H&&T(ue.facingMode??null),H},[]);return{state:c,gate:S,draining:w,gateLocked:j,frozenPreview:O,reduceMotion:M,rampColour:h,artifacts:_,error:u,result:I,facingMode:i,start:E,retry:xe,canSwitchCaptureMode:ve,setCaptureMode:V,modeRestarted:P,attempt:Y}}l(rn,"er");s(rn,"useLivenessHandle");var $n=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>$n.has(n));return t.length>0?{...e,options:t}:null}l(Nt,"tr");s(Nt,"pending");function nn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,c]=(0,me.useState)(!1),[d,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let N=!0,j=e.methodChoice;typeof j=="function"?(a(!1),Promise.resolve().then(()=>j.call(e)).then(O=>{N&&n(Nt(O))},()=>{}).finally(()=>{N&&a(!0)})):a(!0);let R=e.on("method",O=>n(Nt(O)));return()=>{N=!1,R()}},[e]);let p=(0,me.useCallback)(async N=>{if(e===void 0)return!1;c(!0),S(!1);try{return await e.selectMethod(N),n(null),!0}catch{return S(!0),!1}finally{c(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!d?w:null,settled:r,busy:o,failed:d,select:p}}l(nn,"nr");s(nn,"useMethodChoice");var Fn=["ar","fr","en"];function sn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}l(sn,"io");s(sn,"isClipUrl");function an(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Fn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,c]of Object.entries(a))!st(o)||!sn(c)||((n[r]??(n[r]={}))[o]=c)}return Object.keys(n).length>0?n:null}l(an,"ao");s(an,"toVoiceClipMap");function ln(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(d=>{if(!a)return;let S=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;n(p=>p?.setId===S?.setId?p:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let c=e.on("view",d=>o(d.voice));return()=>{a=!1,c()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?an(t):null,[t]);return e===void 0?null:r}l(ln,"rr");s(ln,"useServerVoiceClips");function on({voice:e}){let t=Ae();return(0,Rt.jsx)(te,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Rt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}l(on,"sr");s(on,"VoiceChip");var Dn=new Set(["abandoned","not_opened","cancelled","superseded"]),Hn=800,Gn="capture.lookAtColours";function cn(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}l(cn,"mo");s(cn,"isDefaultTips");function un(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}l(un,"yo");s(un,"carriesActivation");function dn(e){return typeof e=="object"&&e!==null&&!(0,m.isValidElement)(e)&&"tone"in e&&"text"in e}l(dn,"go");s(dn,"isNoticeObject");var Kn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function pn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(pn,"vo");s(pn,"isCapturing");function hn(e){return e==="captured"||e==="uploading"||e==="checking"}l(hn,"Co");s(hn,"isPostCapture");function Zn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:c,startDisabled:d=!1,startLabel:S,tips:p,tipsSummary:w,coach:N,voice:j,onGuidance:R,onCaptured:O,onResult:q,onError:M,onStateChange:J,assetBaseUrl:h,className:x}){let _=dr(t),k=(0,m.useMemo)(()=>ur(t,r),[t,r,_]),u=(0,m.useMemo)(()=>g=>k[g]??"",[k]),A=n??(t==="ar"?"rtl":"ltr"),I=(0,m.useRef)(null),$=(0,m.useContext)(jn),i=rn({verification:e,videoRef:I,assetBaseUrl:h,onCaptured:O,onResult:q,onError:M,onStateChange:J}),T=tn(h,i.state==="idle"&&i.error===null),P=nn(e),z=P.choice!==null,F=Qr(e),ge=Xr(e),he=en(e),Y=Wr(),W=Jr(e),ne=W.session==="choice",E=W.mode==="assisted",xe=j!==!1&&j?.clips===void 0,ve=ln(xe?e:void 0),V=$r({locale:t,defaultClips:ve,options:j}),ee=E?"environment":"user",ue=W.settled,H=(0,m.useRef)(null),Ne=(0,m.useRef)(!1),De=(0,m.useRef)(V.unlock);De.current=V.unlock,(0,m.useEffect)(()=>{let g=H.current;if(g===null)return;let le=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of le)g.removeEventListener(qe,Me,!0)},"disarm");function Me(qe){if(Ne.current){_e();return}un(qe)&&(Ne.current=!0,_e(),De.current())}l(Me,"Re"),s(Me,"onGesture");for(let qe of le)g.addEventListener(qe,Me,{capture:!0,passive:!0});return _e},[]);let b=(0,m.useCallback)(()=>{Ne.current||(Ne.current=!0,V.unlock()),i.start()},[V.unlock,i.start]),ke=(0,m.useCallback)(()=>i.start(),[i.start]),Ee=(0,m.useRef)(!1),Pe=i.state==="idle"&&i.error===null,Ut=!z&&!F.required&&(o===!0||o==="when-permitted"&&Y.permission==="granted"),jt=Ut&&P.settled&&F.settled&&ue,yn=o==="when-permitted"&&!Y.permissionSettled&&!Ee.current,Tt=Ut&&Pe&&!Ee.current,ut=(yn||Tt||!ue)&&T.gate==="ready"?"loading":T.gate;(0,m.useEffect)(()=>{!jt||!Pe||T.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Pe,T.gate,ke]);let gn=Pe&&!z&&!F.required&&!(Tt&&T.gate==="ready"),[Pt,Bt]=(0,m.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=i;(0,m.useEffect)(()=>{if(!W.settled||!ne){Bt(!1);return}let g=!0;return Ot().then(le=>{g&&Bt(le)}),()=>{g=!1}},[W.settled,ne,Ot]);let{choose:Vt}=W,Ie=E?"self":"assisted",vn=(0,m.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),$t=i.state!=="idle"&&i.facingMode!==null?i.facingMode:ee;(0,m.useEffect)(()=>{let g=I.current?.style;$t==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[$t]);let He=(0,m.useMemo)(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);(0,m.useEffect)(()=>{if(He!==null)return()=>URL.revokeObjectURL(He)},[He]);let Ft=i.frozenPreview??He,Ue=e!==void 0,Z=pn(i.state),be=hn(i.state),Ge=Z||be,se=i.result,Dt=i.state==="done"&&se!==null,Ke=Z&&i.rampColour!==null,dt=i.state==="recording"&&i.frozenPreview!==null&&!Ke,Ze=$!==null,Ht=Pt&&Z&&!dt?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{vn()},"onSwitch")}:null,ze=i.modeRestarted&&Z?u("capture.modeSwitch.restarted"):null,Be=be||dt,Gt=be?"checking":dt?"frozen":i.state==="recording"||Ke?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ye=Z?i.gate.hint:null,We=i.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!i.gate.faceDetected?"fcv3.no_face":lr(Ye),[kn,Kt]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!Z)return;let g=setTimeout(()=>Kt(We),Hn);return()=>clearTimeout(g)},[We,Z]);let pt=Z&&!Ke&&typeof N=="string"&&N!=="",Zt=E&&Z?u("capture.assisted.stage"):null,Re=Z&&!pt?Ke?Gn:kn:null,ht=pt?N:Re===null?"":u(Re);Fr(V,Re,ht,Z);let zt=(0,m.useRef)(R);zt.current=R,(0,m.useEffect)(()=>{if(st(Re))try{zt.current?.(Re)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Re]);let Oe=(0,m.useMemo)(()=>({supported:V.supported,enabled:V.enabled,setEnabled:V.setEnabled,toggle:V.toggle}),[V.supported,V.enabled,V.setEnabled,V.toggle]),ft=a?.voicePrompt,Yt=ft!==void 0,Wt=j===void 0,Qt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!Yt||!Wt||Qt.current||!Lt()||(Qt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Yt,Wt]);let bn=ft!==void 0?(g,le,_e)=>ft(g,le,_e,Oe):V.supported?()=>(0,v.jsx)(on,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Xt,toggleSummary:Jt,stopSummary:er}=V,Qe=w!==void 0&&w!=="",tr=Qe?w:u("capture.tips.summary"),rr=Qe?mt!=="none":mt==="partner"||mt==="default"&&cn(p),Cn=(0,m.useMemo)(()=>rr?{playing:Xt,toggle:s(()=>Jt(tr,{clip:!Qe}),"toggle"),stop:er}:void 0,[rr,Xt,Jt,tr,er,Qe]),_n=(0,m.useMemo)(()=>({assets:ut,retryAssets:T.retry,permission:Y.permission,permissionSettled:Y.permissionSettled,captureMode:W.mode,facing:ee,voice:Oe}),[ut,T.retry,Y.permission,Y.permissionSettled,W.mode,ee,Oe]),wn=dn(c)?(0,v.jsx)(oe,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,ae=se!==null&&se.status==="retry"?se:null,G=Dt&&se.status==="unavailable"&&!z&&se.reasonCode!=="portrait_required"?se:null,Ce=Dt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,yt=s((g,le)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Me=ir(t,le);if(Me!==null)return u(Me.key).replace("{time}",Me.time)}let _e=et(g);return _e===null?null:u(_e)},"reasonText"),gt=s(g=>{let le=g.retakeHint===void 0?null:Je(g.retakeHint);return le===null?yt(g.reasonCode):u(le)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Dn.has(Ce.reason)?u("errors.session_expired"):null),Sn=G!==null&&G.reasonCode!==void 0&&G.reasonCode!=="nni_unbound"&&G.reasonCode!=="id_number_unbound"&&G.reasonCode!=="method_required"&&G.reasonCode!=="mobile_required"&&!(G.reasonCode==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Xe=G?.reasonCode,sr=i.attempt;(0,m.useEffect)(()=>{G===null||Xe===void 0||e?.reportCaptureIssue===void 0||Kn.has(Xe)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Xe,attempt:Math.min(1e3,sr)})},[G,Xe,sr,e]);let ar=kt(),xn=z&&P.auto===null&&!Z&&!be&&i.error===null,vt=(0,m.useCallback)(async g=>{await P.select(g)&&i.state==="done"&&i.retry()},[P.select,i.state,i.retry]);return(0,m.useEffect)(()=>{P.auto!==null&&!P.busy&&!Z&&!be&&vt(P.auto)},[P.auto,P.busy,Z,be,vt]),(0,v.jsx)(pr,{value:u,children:(0,v.jsxs)("div",{ref:H,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:A,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[a?.header,ae!==null&>(ae)!==null&&!(Ze&&Ge)?(0,v.jsx)(oe,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:gt(ae)})}):null,ze!==null&&!Ze?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:ze})}):null,he&&be&&!Ze?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Pe?(0,v.jsx)(oe,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,i.error!==null?a?.errorPanel!==void 0?a.errorPanel(i.error,i.retry):(0,v.jsxs)(oe,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(or(i.error))}),i.error.retryable?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u("common.retry")}):null]}):null,G!==null?(0,v.jsxs)(oe,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(G.reasonCode==="attestation"&&G.attestationError==="clock_wrong"?u("errors.device_clock"):yt(G.reasonCode))??u(G.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Sn?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u(G.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,v.jsx)(oe,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:nr})}):null,(0,v.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ze?$({videoRef:I,guidance:Be&&Ue?u("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?u(he?"capture.busy":"capture.checkingHint"):null:ze??(ae!==null?gt(ae):Zt),settled:Be&&Ue,progress:i.gate.progress,phase:Gt,still:Be?Ft:null,live:Ge,modeSwitch:Ht,...Pt?{status:ze}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):(0,v.jsx)(hr,{videoRef:I,guidanceText:ht,guidanceHint:Ye,guidanceKey:Re,progress:i.gate.progress,phase:Gt,draining:i.draining,stillUrl:Ft,showChecking:Ue,operatorText:Zt,voicePrompt:bn,overlay:l(g=>(0,v.jsxs)(v.Fragment,{children:[a?.stageOverlay?.(g),(0,v.jsx)(fr,{colour:i.rampColour})]}),"overlay"),reduceMotion:i.reduceMotion,modeSwitch:Ht})}),xn&&P.choice!==null?(0,v.jsx)(Ur,{title:u("method.title"),description:u("method.description"),options:P.choice.options.map(g=>({id:g,label:u(`method.${g}`)})),busy:P.busy,error:P.failed?u("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(g=>{vt(g)},"onChoose")}):null,gn?(0,v.jsxs)(v.Fragment,{children:[ge&&a?.header===void 0&&a?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,wn,a?.intro!==void 0?a.intro(b,_n):(0,v.jsx)(zr,{assets:ut,onRetryAssets:T.retry,permission:Y.permission,captureMode:W.mode,voice:Oe,tips:p??_t,summary:Cn,startLabel:S,startDisabled:d,onStart:b})]}):null,(0,v.jsx)(Hr,{showCoaching:ae!==null,coaching:lt(ae?.reasonCode,ae?.retakeHint),attemptsText:ae?.attemptsRemaining!==void 0?cr(k,t,ae.attemptsRemaining):null,showRetake:ae!==null&&!Z&&!be||!Ue&&i.state==="captured",onRetake:i.retry}),a?.footer]})})}l(Zn,"Ei");s(Zn,"LivenessCapture");var It=U(K(),1),ct=U(K(),1),f=U(de(),1);import{isInAppBrowser as ts}from"@sekyro/web/client";var bs={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},Cs={population_registry:"hashtag",national_eid:"key"};function zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}l(zn,"D");s(zn,"identityLabel");function Yn(e,t){let[n,r]=(0,It.useState)(!1),[a,o]=(0,It.useState)(null);return{busy:n,error:a,run:s(c=>{r(!0),o(null),c().then(()=>r(!1),d=>{r(!1),o(e.t(br(d,e.strings))),t?.(d)})},"run")}}l(Yn,"q");s(Yn,"useChoiceAction");function fn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,f.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("defs",{children:(0,f.jsx)("mask",{id:e,children:(0,f.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,f.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,f.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(fn,"O");s(fn,"FaceMark");var Wn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Qn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}l(Qn,"ne");s(Qn,"faceIntroRetryOf");var Xn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Jn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:c,retry:d}){let S=Ct(),{t:p}=S,w=d===void 0?"face":lt(d.reason,d.retakeHint),N=w==="face"?null:Fe[w].tips,j=(0,ct.useContext)(yr)?.busy===!0;return(0,f.jsxs)("section",{className:"sekyro-step",children:[(0,f.jsx)(fn,{}),t.captureMode==="assisted"?(0,f.jsx)(tt,{title:p("capture.assisted.heading"),lead:p("capture.assisted.lead")}):o?(0,f.jsx)(tt,{title:p("returning.heading"),lead:p("returning.description")}):(0,f.jsx)(tt,{title:p(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:p(a?"native.face.humanIntroLead":"native.face.introLead")}),d!==void 0?(0,f.jsx)(mn,{retry:d,title:Fe[w].title}):null,r!==void 0&&N===null?(0,f.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,f.jsx)("ul",{className:"sekyro-tiprows",children:N!==null?N.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Xn[R]??"face"}),p(R)]},R)):n!==void 0?n.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Wn[R.id]??"face"}),R.text]},R.id)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"light"}),p("capture.tips.light")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"jGlasses"}),p("capture.tips.uncover")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"smartphone"}),p("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,f.jsx)(te,{kind:"secondary",full:!0,onClick:t.retryAssets,children:p("common.retry")}):null,c!==void 0?null:(0,f.jsx)(mr,{children:(0,f.jsxs)(te,{full:!0,disabled:t.assets!=="ready"||j,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,f.jsx)(Le,{name:"camera"}),p("capture.start")]})})]})}l(Jn,"re");s(Jn,"FaceIntro");var es=new Set(["match_inconclusive","no_face_source","below_threshold"]);function mn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":es.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,f.jsxs)(gr,{tone:"warning",children:[r!==null?(0,f.jsx)("span",{children:n.t(r)}):a!==null?(0,f.jsx)("span",{children:n.t(a)}):null,r===null?(0,f.jsx)("span",{children:n.t(t)}):null,(0,f.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(mn,"K");s(mn,"RetryNotice");function rs(e){return ts(e)}l(rs,"ce");s(rs,"isInAppBrowser");function ns(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(ns,"le");s(ns,"androidBrowserIntent");export{Ur as a,Lt as b,jn as c,Jr as d,Zn as e,bs as f,Cs as g,zn as h,Yn as i,Qn as j,Jn as k,rs as l,ns as m};
|