ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     var u=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);function l(e){let t=new Uint8Array(e),n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function h(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,"="),o=atob(r),i=new ArrayBuffer(o.length),s=new Uint8Array(i);for(let R=0;R<o.length;R++)s[R]=o.charCodeAt(R);return i}function E(){return window?.PublicKeyCredential!==void 0&&typeof window.PublicKeyCredential=="function"}function $(){let e=window.PublicKeyCredential;return e.isConditionalMediationAvailable===void 0?new Promise(t=>t(!1)):e.isConditionalMediationAvailable()}function W(){return E()?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():new Promise(e=>e(!1))}var a,k,I,f=u(()=>{a=class extends Error{constructor({message:t,code:n,cause:r,name:o}){super(t,{cause:r}),this.name=o??r.name,this.code=n;}},k=class{createNewAbortSignal(){if(this.controller){let n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n);}let t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){let t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0;}}},I=new k;});var F,q,j,H=u(()=>{F="mgv-register-passkey",q="mgv-authenticate-passkey",j="myGov passkey ";});var J=u(()=>{H();});var _,N,C,V,S,P,m,g,D,O=u(()=>{_="Device doesn't support passkeys. Try again on a different device. (RFM158)",N="There was a problem creating your passkey. Try again later. (RFM159)",C="Something went wrong. Contact myGov. (RFM165)",V="There was a problem accessing passkeys. Try again later. (RFM169)",S="Your sign in details are incorrect. (RFM10A)",P=N,m={ERROR_WEBAUTHN_NOT_SUPPORTED:"Device doesn't support passkeys. Try creating a passkey on a different device. (RFM158)",ERROR_AUTHENTICATOR_GENERAL_ERROR:_},g={ERROR_CEREMONY_ABORTED:P,ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT:_,ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT:_,ERROR_MALFORMED_PUBKEYCREDPARAMS:N,ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG:N,ERROR_INVALID_DOMAIN:C,ERROR_INVALID_RP_ID:C,ERROR_INVALID_USER_ID_LENGTH:N,ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED:"You have already registered this passkey to your myGov account. (RFM167)",ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY:P,ERROR_AUTHENTICATOR_GENERAL_ERROR:_,MYGOVPKF000:V,MYGOVPKB001:S,MYGOVPKR001:P,MYGOVPKR002:"You can't have more than 3 passkeys for your myGov account. Remove an existing passkey before creating another. (RFM170)",MYGOVPKR003:"Enter a different passkey name. (RFM171)",MYGOVPKR004:"Passkey name can only include these characters a-z A-Z 0-9 _ ' - (RFM172)",REGISTRATION_GENERAL_ERROR:P,REGISTRATION_NOT_AUTHENTICATED_ERROR:"You are not authenticated or your session timed out"},D={ERROR_CEREMONY_ABORTED:_,ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY:V,ERROR_INVALID_DOMAIN:C,ERROR_INVALID_RP_ID:C,ERROR_AUTHENTICATOR_GENERAL_ERROR:_,MYGOVPKF000:V,MYGOVPKB001:S,MYGOVPKL001:S,MYGOVPKL002:"This passkey is not registered with myGov. Go to your device's password manger to delete the passkey from your device. (RFM166)",MYGOVPKL003:"Your account has been temporarily locked. You can try again in 2 hours. (RFM12)",MYGOVPKL004:"Your account has been permanently locked. You will need to create a new account to continue using myGov. (RFM13)",MYGOVPKL005:"You can no longer use this myGov username. To access myGov, create a new account. (RFM47)",AUTHENTICATION_GENERAL_ERROR:S};});function p(e="UNKNOWN",t,n){let r=t[e]||m[x];return new a({message:r,code:e,cause:n,name:e})}var U,x,M=u(()=>{f();O();U="ERROR_WEBAUTHN_NOT_SUPPORTED",x="ERROR_AUTHENTICATOR_GENERAL_ERROR";});async function y(e,t){let n=await fetch(e,t),r=e.endsWith("/login")?c.OPERATION_AUTHENTICATION:c.OPERATION_REGISTRATION;if(n.ok)return await n.json();if(n.status===401&&r===c.OPERATION_REGISTRATION)return Promise.reject(p(`${r}_NOT_AUTHENTICATED_ERROR`,g));if(n.status===400)return n.json().then(o=>Promise.reject(p(o.error_code||`${r}_GENERAL_ERROR`,r===c.OPERATION_AUTHENTICATION?D:g)));throw p(x,m)}var c,Y=u(()=>{O();M();c=class{static RegisterPasskey(){return "/mga/api/v1/passkey/register"}static AuthenticatePasskey(){return "/mga/api/v1/passkey/login"}};c.OPERATION_AUTHENTICATION="AUTHENTICATION",c.OPERATION_REGISTRATION="REGISTRATION";});function K(e){let{id:t}=e;return {...e,id:h(t),transports:e.transports}}function z({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new a({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(n.authenticatorSelection?.requireResidentKey===!0)return new a({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(n.authenticatorSelection?.userVerification==="required")return new a({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else {if(e.name==="InvalidStateError")return new a({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new a({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return n.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new a({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new a({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){let r=window.location.hostname;if(Z(r)){if(n.rp.id!==r)return new a({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new a({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new a({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new a({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}function X({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new a({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else {if(e.name==="NotAllowedError")return new a({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){let r=window.location.hostname;if(Z(r)){if(n.rpId!==r)return new a({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new a({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new a({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return e}function Z(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function v(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.
`,t);}function G(e){if(e&&!(fe.indexOf(e)<0))return e}var fe,B=u(()=>{f();fe=["cross-platform","platform"];});async function Q(e,t=!1){if(!E())throw new Error("WebAuthn is not supported in this browser");let n;e.allowCredentials?.length!==0&&(n=e.allowCredentials?.map(K));let r={...e,challenge:h(e.challenge),allowCredentials:n},o={};if(t){if(!await $())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation="conditional",r.allowCredentials=[];}o.publicKey=r,o.signal=I.createNewAbortSignal();let i;try{i=await navigator.credentials.get(o);}catch(T){throw X({error:T,options:o})}if(!i)throw new Error("Authentication was not completed");let{id:s,rawId:R,response:A,type:b}=i,w;return A.userHandle&&(w=l(A.userHandle)),{id:s,rawId:l(R),response:{authenticatorData:l(A.authenticatorData),clientDataJSON:l(A.clientDataJSON),signature:l(A.signature),userHandle:w},type:b,clientExtensionResults:i.getClientExtensionResults(),authenticatorAttachment:G(i.authenticatorAttachment)}}var ee=u(()=>{f();B();});function te(){return document.querySelector('input[name="clientId"]').value??void 0}var ne=u(()=>{});async function re(){if(E())try{let t=await y(c.AuthenticatePasskey()),n=await Q(t);return await me(n)}catch(t){throw p(t?.code,D,t)}else throw p(U,m)}async function me(e){return {authenticated:!0,redirectUrl:(await y(c.AuthenticatePasskey(),{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({passkey:e,client_id:te()||void 0})})).location}}var oe=u(()=>{f();O();Y();M();ee();ne();});async function ie(e){if(!E())throw new Error("WebAuthn is not supported in this browser");let n={publicKey:{...e,challenge:h(e.challenge),user:{...e.user,id:h(e.user.id)},excludeCredentials:e.excludeCredentials?.map(K)}};n.signal=I.createNewAbortSignal();let r;try{r=await navigator.credentials.create(n);}catch(d){throw z({error:d,options:n})}if(!r)throw new Error("Registration was not completed");let{id:o,rawId:i,response:s,type:R}=r,A;typeof s.getTransports=="function"&&(A=s.getTransports());let b;if(typeof s.getPublicKeyAlgorithm=="function")try{b=s.getPublicKeyAlgorithm();}catch(d){v("getPublicKeyAlgorithm()",d);}let w;if(typeof s.getPublicKey=="function")try{let d=s.getPublicKey();d!==null&&(w=l(d));}catch(d){v("getPublicKey()",d);}let T;if(typeof s.getAuthenticatorData=="function")try{T=l(s.getAuthenticatorData());}catch(d){v("getAuthenticatorData()",d);}return {id:o,rawId:l(i),response:{attestationObject:l(s.attestationObject),clientDataJSON:l(s.clientDataJSON),transports:A,publicKeyAlgorithm:b,publicKey:w,authenticatorData:T},type:R,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:G(r.authenticatorAttachment)}}var ae=u(()=>{f();B();});async function ce(e=j){let t=1,n;try{let r=await le(),o=new RegExp(`^${e}([0-9]+)$`);n=r.extensions?.authenticators||[],t=n.filter(i=>o.test(i)).map(i=>+i.replace(e,"")).reduce((i,s)=>s>i?s:i,0)+1;}catch(r){throw p(r?.code,g,r)}return {alreadyUsedNames:n,suggestedName:`${e}${t}`}}async function ue(e,t=!1){if(await E())try{let r=await le(),o=await ie(r);if(t)return new Promise((i,s)=>se(o).then(R=>i(R.nickname?R.nickname:Promise.reject(new Error("No nickname returned.")))).catch(s));{let i=await se(o);if(!i.nickname)throw new Error("No nickname returned.");return i.nickname}}catch(r){throw p(r?.code,g,r)}else throw p(U,m)}async function le(){return y(c.RegisterPasskey())}async function se(e){return y(c.RegisterPasskey(),{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({passkey:e})})}var Re=u(()=>{f();O();H();Y();M();ae();});async function he(){return L!==void 0?Promise.resolve(L):(L=await W(),L)}var L,_e,Ee,pe=u(()=>{f();J();oe();Re();_e=E(),Ee={getDefaultPasskeyName:ce,registerPasskey:ue,authenticatePasskey:re,isPasskeySupportedOnPlatform:he,isWebAuthnSupportedOnPlatform:_e,events:{create:F,login:q}};});var ge=Ae((pt,de)=>{pe();de.exports=Ee;});var mygovPasskeys = ge();

export { mygovPasskeys as default };
