1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4943],{44943:(e,t,r)=>{let o;r.d(t,{Onfido:()=>S});var n,i,a,s,l=Object.defineProperty,d=(e,t,r)=>(((e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),r);class c{addEventListener(e,t){return this.eventListener[e]=this.eventListener[e]||[],this.eventListener[e].push(t),this}removeEventListener(e,t){let r=this.eventListener[e];if(r){let e;for(;-1!==(e=r.indexOf(t));)r.splice(e,1)}}trigger(e,t){(this.eventListener[e]||[]).forEach(e=>{null==e||e(t)})}constructor(){this.eventListener={}}}let p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));let u=new Uint8Array(16),v={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function m(e,t,r){return!v.randomUUID||t||e?function(e,t,r){var n,i,a;let s=null!=(a=null!=(i=(e=e||{}).random)?i:null==(n=e.rng)?void 0:n.call(e))?a:function(){if(!o){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");o=crypto.getRandomValues.bind(crypto)}return o(u)}();if(s.length<16)throw Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((r=r||0)<0||r+16>t.length)throw RangeError("UUID byte range ".concat(r,":").concat(r+15," is out of buffer bounds"));for(let e=0;e<16;++e)t[r+e]=s[e];return t}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]).toLowerCase()}(s)}(e,t,r):v.randomUUID()}!function(e){e.MicrophonePermissionDenied="MicrophonePermissionDenied",e.CameraPermissionDenied="CameraPermissionDenied",e.PermissionsUnavailable="PermissionsUnavailable",e.CameraNotDetected="CameraNotDetected",e.CameraException="CameraException",e.FailedToWriteToDisk="FailedToWriteToDisk",e.InvalidImageData="InvalidImageData",e.WorkflowTaskAbandoned="WorkflowTaskAbandoned",e.WorkflowTaskError="WorkflowTaskError",e.BiometricTokenRetrievalException="BiometricTokenRetrievalException",e.WorkflowBiometricTokenStorageException="WorkflowBiometricTokenStorageException",e.CrossDeviceRestartError="CrossDeviceRestartError",e.CrossDeviceDesktopError="CrossDeviceDesktopError",e.CrossDeviceVerificationInvalidError="CrossDeviceVerificationInvalidError",e.CrossDeviceVerificationAbortError="CrossDeviceVerificationAbortError",e.InvalidToken="InvalidToken",e.ExpiredToken="ExpiredToken",e.ExpiredTrial="ExpiredTrial",e.NetworkException="NetworkException",e.UploadError="UploadError",e.InitialisationInvalid="InitialisationInvalid",e.SdkVersionInsufficient="SdkVersionInsufficient",e.UnsupportedError="UnsupportedError",e.UnsupportedFeatureError="UnsupportedFeatureError",e.InvalidSdkParameter="InvalidSdkParameter",e.FeaturesNotAuthorized="FeaturesNotAuthorized",e.MissingSteps="MissingSteps",e.DuplicateStep="DuplicateStep",e.WelcomeMustBeFirstStep="WelcomeMustBeFirstStep",e.WorkflowVersionMismatch="WorkflowVersionMismatch",e.WorkflowInputError="WorkflowInputError",e.MissingLogoCobrandingParameter="MissingLogoCobrandingParameter",e.InvalidCustomTranslations="InvalidCustomTranslations",e.InvalidCountryCode="InvalidCountryCode",e.InvalidDocumentFormatAndCountryCombination="InvalidDocumentFormatAndCountryCombination",e.InvalidDocumentTypeException="InvalidDocumentTypeException",e.InvalidDocumentTitle="InvalidDocumentTitle",e.DuplicateGenericDocument="DuplicateGenericDocument",e.NfcInputNotAvailable="NfcInputNotAvailable",e.AppTerminated="AppTerminated",e.GenericException="GenericException",e.GeoBlocked="GeoBlocked",e.ModuleLoadError="ModuleLoadError"}(n||(n={})),function(e){e.UserExit="UserExit",e.ConsentDenied="ConsentDenied",e.RequiredNfcNotCompleted="RequiredNfcNotCompleted"}(i||(i={})),function(e){e.AppInBackground="AppInBackground",e.AppInactive="AppInactive"}(a||(a={})),function(e){e.AppBackInForeground="AppBackInForeground",e.AppBackToActive="AppB
1ackToActive"}(s||(s={})),n.CrossDeviceRestartError,n.CrossDeviceDesktopError,n.CrossDeviceVerificationInvalidError,n.CrossDeviceVerificationAbortError;let h={type:"invalid_token",message:"The token is invalid.",level:"external"};n.WorkflowTaskAbandoned,n.WorkflowInputError,n.ExpiredToken,n.ExpiredTrial,n.GeoBlocked,n.PermissionsUnavailable,n.GenericException,n.UnsupportedError,n.UnsupportedFeatureError,n.InitialisationInvalid,n.SdkVersionInsufficient,n.CameraNotDetected,n.NetworkException,n.ModuleLoadError;class f extends Error{encode(){return{name:this.name,type:this.type,message:this.message,level:this.level,stack:this.stack,exception:this.exception,body:this.body,httpCode:this.httpCode,analyticsError:this.analyticsError}}static decode(e){return"SdkError"===e.name?new f({type:e.type,message:e.message,level:e.level,exception:e.exception,stack:e.stack,body:e.body,httpCode:e.httpCode,analyticsError:e.analyticsError}):e}constructor({type:e,message:t,level:r,exception:o,stack:n,body:i,httpCode:a,analyticsError:s}){super(t),this.name="SdkError",this.type=e,this.level=r,this.exception=o,this.body=i,this.httpCode=a,this.analyticsError=s,n&&(this.stack=n)}}let k=e=>{if(!e)throw new f(h);try{return(e=>{let{payload:t,urls:r}=e;return{sub:e.sub,type:"studio"===e.iss?"studio":"sdk",enterpriseFeatures:e.enterprise_features,urls:{authUrl:r.auth_url,detectDocumentUrl:r.detect_document_url,hostedSdkUrl:r.hosted_sdk_url,syncUrl:r.sync_url,syncUrlMultiRegion:r.sync_url_multi_region,onfidoApiUrl:r.onfido_api_url,telephonyUrl:r.telephony_url,crossDeviceUrl:r.cross_device_url},exp:e.exp,payload:{applicantUuid:t.app,applicationId:t.application_id,clientUuid:t.client_uuid,isSandbox:t.is_sandbox,isTrial:t.is_trial}}})(JSON.parse(atob(e.split(".")[1])))}catch(e){throw new f(h)}},E="fallback";var y=(e=>(e.Npm="Npm",e.Evergreen="Evergreen",e))(y||{}),g=(e=>(e.Started="Started",e.Error="Error",e.Retry="Retry",e.Fallback="Fallback",e.Completed="Completed",e))(g||{});let b=e=>e===E?"0.0.0":I(e),I=e=>"".concat(e||"14").replace(/^v/g,""),D=function(e,t){var r,o;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;try{if("token"in e&&e.token){let s,l,d=e.token,c=k(d),p="Light";null!=(r=e.theme)&&r.name&&(p=(s=null==(o=e.theme)?void 0:o.name).charAt(0).toUpperCase()+s.slice(1));let u=[];"steps"in e&&(u=e.steps.map(e=>"object"==typeof e&&"type"in e?e.type:e)),fetch("".concat(c.urls.onfidoApiUrl,"/v4/sdk/analytics"),{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer ".concat(d),"x-onfido-sdk-platform":"web","x-onfido-sdk-version":b(null==n?void 0:n.version)},body:JSON.stringify({context:{device:{deviceType:"Desktop",hardware:{},os:{deviceLanguages:[]},browser:{userAgent:navigator.userAgent}},runtimeInfo:{client:{clientId:c.payload.clientUuid},identifiers:{sessionId:m(),applicantId:c.payload.applicantUuid},appInfo:{referrer:""},emittedAt:new Date().toISOString(),crossDevice:!1},sdkInfo:{library:{sdk:"Web",version:b((null==n?void 0:n.version)||E),pinnedVersion:b(e.version),variant:"Bundled",analyticsLibraryVersion:"0.0.141"}},configuration:{analytics:{loggingLevel:[]},callback:{},ui:{themeConfigured:p},orchestration:{steps:u},languageInformation:{displayedLocaleCode:(l=e.language)&&"string"==typeof l?l:l&&"object"==typeof l&&l.locale||"en-GB"},clientDomain:null==location?void 0:location.href,scriptHostname:"sdk.onfido.com"},dynamicRuntimeInfo:[]},events:[{...t,errorInfo:i,duration:a,eventMetadata:{runtimeId:m(),generatedAt:new Date().toISOString()}}]})}).catch(()=>{})}}catch(e){}},C=new Set(["token","workflowRunId","crossDeviceValidationToken","roomId","onComplete","onError","onUserExit","onExternalLink","onBiometricTokenGenerated","onBiometricTokenRequested","containerEl","containerId","version","sdkUrl"]),w=["onComplete","onError","onUserExit","onExternalLink","onBiometricTokenGenerated","onBiometricTokenRequested"];window.OnfidoDistribution={name:"NPM"};class x extends c{_setHandle(e){this._handle=e,this._handleSetCallbacks.forEach(t=>t(e)),this._handleSetCallbacks=[],Object.entries(this.eventListener).forEach(t=>{let[r,o]=t;e.addEventListener(r,o)}),this.eventListener={}}addEventListener(e,t){return this._handle?(this._handle.addEventListener(e,t),this):super.addEventListener(e,t)}removeEventListener(e,t){if(this._handle)return this._handle.removeEventListener(e,t),this;super.removeEventListener(e,t)}async tearDown(){var e;if(!this._handle)return this._handleSetCallbacks.push(()=>{this.tearDown()}),Promise.resolve();await (null==(e=this._handle)?void 0:e.tearDown())}get version(){var e;return null==(e=this._handle)?void 0:e.version}constructor(){super(...arguments),d(this,"_handle"),d(this,"_handleSetCallbacks",[])}}let U={init(e){let t,r=new x,o=I(e.version),n=e.sdkUrl||"https://sdk.onfid
1o.com/".concat((t=e.version,"v".concat((t||"14").replace(/^v/,""))),"/Onfido.js");return D(e,{identifier:"LoaderStateEvent",state:g.Started,loaderSource:y.Npm},{version:o}),import(n).then(t=>{D(e,{identifier:"LoaderStateEvent",state:g.Completed,loaderSource:y.Npm},{version:o});let{Onfido:n}=t;r._setHandle(n.init(e)),(e=>{if(!e)return!1;let[t,r]=(null==e?void 0:e.split("."))||[];return!r})(o)||((e,t)=>{try{var r;if(!("token"in e)||!e.token)return;let o=e.token,n=k(o),{smsNumber:i,...a}=null!=(r=e.userDetails)?r:{},s={...Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!C.has(t)})),...Object.fromEntries(w.map(t=>[t,"function"==typeof e[t]])),..."userDetails"in e&&{userDetails:a}};fetch("".concat(n.urls.onfidoApiUrl,"/v4/sdk/capture/configuration"),{method:"POST",headers:{authorization:"Bearer ".concat(o),"content-type":"application/json","x-onfido-sdk-platform":"web","x-onfido-sdk-version":t},body:JSON.stringify({sdk:"Web",sdkVersion:t,configuration:s,captureApiVersion:t})}).catch(()=>{})}catch(e){}})(e,o)}).catch(t=>{var n;D(e,{identifier:"LoaderStateEvent",state:g.Error,loaderSource:y.Npm},{version:o},{message:null==t?void 0:t.message}),r.trigger("error",{error:t}),null==(n=e.onError)||n.call(e,t)}),r}};Object.defineProperty(U,"environment",{get:()=>null==window?void 0:window.Onfido.environment,set:e=>{window.Onfido=window.Onfido||{},window.Onfido.environment=e}});let S=U}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.