PageSourceSearch

https://uscgq.com/build/assets/passkeys-ZWACIUjA.js

js uscgq.com collected 2026-09-24 09:28:31 UTC 12,080 bytes, 1 lines download raw bytes

1function e(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function t(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function n(){return r.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var r={stubThis:e=>e};function i(e){let{id:n}=e;return{...e,id:t(n),transports:e.transports}}function a(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var o=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function s({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 o({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 o({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new o({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new o({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 o({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new o({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new o({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new o({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!a(t))return new o({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new o({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new o({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 o({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}var c=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},l=[`cross-platform`,`platform`];function u(e){if(e&&!(l.indexOf(e)<0))return e}async function d(r){!r.optionsJSON&&r.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),r={optionsJSON:r});let{optionsJSON:a,useAutoRegister:o=!1}=r;if(!n())throw Error(`WebAuthn is not supported in this browser`);let l={...a,challenge:t(a.challenge),user:{...a.user,id:t(a.user.id)},excludeCredentials:a.excludeCredentials?.map(i)},d={};o&&(d.mediation=`conditional`),d.publicKey=l,d.signal=c.createNewAbortSignal();let p;try{p=await navigator.credentials.create(d)}catch(e){throw s({error:e,options:d})}if(!p)throw Error(`Registration was not completed`);let{id:m,rawId:h,response:g,type:_}=p,v;typeof g.getTransports==`function`&&(v=g.getTransports());let y;if(typeof g.getPublicKeyAlgorithm==`function`)try{y=g.getPublicKeyAlgorithm()}catch(e){f(`getPublicKeyAlgorithm()`,e)}let b;if(typeof g.getPublicKey==`function`)try{let t=g.getPublicKey();t!==null&&(b=e(t))}catch(e){f(`getPublicKey()`,e)}let x;if(typeof g.getAuthenticatorData==`function`)try{x=e(g.getAuthenticatorData())}catch(e){f(`getAuthenticatorData()`,e)}return{id:m,rawId:e(h),response:{attestationObject:e(g.attestationObject),clientDataJSON:e(g.clientDataJSON),transports:v,publicKeyAlgorithm:y,publicKey:b,authenticatorData:x},type:_,clientExtensionResults:p.getClientExtensionResults(),authenticatorAttachment:u(p.authenticatorAttachment)}}function f(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function p(){if(!n())return m.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?m.stubThis(new Promise(e=>e(!1))):m.stubThis(e.isConditionalMediationAvailable())}var m={stubThis:e=>e};function h({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);
1if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new o({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new o({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!a(t))return new o({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new o({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new o({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}async function g(r){!r.optionsJSON&&r.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),r={optionsJSON:r});let{optionsJSON:a,useBrowserAutofill:o=!1,verifyBrowserAutofillInput:s=!0}=r;if(!n())throw Error(`WebAuthn is not supported in this browser`);let l;a.allowCredentials?.length!==0&&(l=a.allowCredentials?.map(i));let d={...a,challenge:t(a.challenge),allowCredentials:l},f={};if(o){if(!await p())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');f.mediation=`conditional`,d.allowCredentials=[]}f.publicKey=d,f.signal=c.createNewAbortSignal();let m;try{m=await navigator.credentials.get(f)}catch(e){throw h({error:e,options:f})}if(!m)throw Error(`Authentication was not completed`);let{id:g,rawId:_,response:v,type:y}=m,b;return v.userHandle&&(b=e(v.userHandle)),{id:g,rawId:e(_),response:{authenticatorData:e(v.authenticatorData),clientDataJSON:e(v.clientDataJSON),signature:e(v.signature),userHandle:b},type:y,clientExtensionResults:m.getClientExtensionResults(),authenticatorAttachment:u(m.authenticatorAttachment)}}var _=class extends Error{constructor(e){super(e),this.name=`PasskeyError`}},v=class extends _{constructor(){super(`Passkeys are not supported in this browser.`),this.name=`NotSupportedError`}},y=class extends _{constructor(){super(`The passkey operation was cancelled.`),this.name=`UserCancelledError`}},b=class extends _{constructor(){super(`This device is already registered as a passkey.`),this.name=`PasskeyExistsError`}},x=class extends _{constructor(e){super(`Passkeys can't be used on ${e??`this domain`}. For local development, use localhost.`),this.name=`InvalidDomainError`}},S=e=>{if(e instanceof _)return e;if(!(e instanceof Error))return new _(`An unknown error occurred.`);if(C(e))return new x(T());switch(e.name){case`NotAllowedError`:return new y;case`InvalidStateError`:return new b;case`NotSupportedError`:return new v;default:return new _(e.message)}},C=e=>w(e)===`ERROR_INVALID_DOMAIN`,w=e=>`code`in e&&typeof e.code==`string`?e.code:void 0,T=()=>typeof globalThis.location?.hostname==`string`&&globalThis.location.hostname.length>0?globalThis.location.hostname:void 0,E={},D=e=>{E={...E,...e,fetch:{...E.fetch,...e.fetch,headers:{...E.fetch?.headers,...e.fetch?.headers}}}},O=()=>typeof document>`u`?null:k()||A(),k=()=>{let e=document.querySelector(`meta[name="csrf-token"]`);if(!e)return null;let t=e.getAttribute(`content`);return t?{header:`X-CSRF-TOKEN`,value:t}:null},A=()=>{let e=document.cookie.split(`; `).find(e=>e.startsWith(`XSRF-TOKEN=`));if(!e)return null;let t=e.slice(11);return t?{header:`X-XSRF-TOKEN`,value:decodeURIComponent(t)}:null},j=async e=>{let t=await fetch(e,{method:`GET`,headers:{Accept:`application/json`,...E.fetch?.headers},credentials:E.fetch?.credentials??`same-origin`});return t.ok||await N(t),t.json()},M=async(e,t)=>{let n=O(),r={"Content-Type":`application/json`,Accept:`application/json`,...E.fetch?.headers};n&&(r[n.header]=n.value);let i=await fetch(e,{method:`POST`,headers:r,credentials:E.fetch?.credentials??`same-origin`,body:JSON.stringify(t)});return i.ok||await N(i),i.json()},N=async e=>{let t=`Request failed with status ${e.status}`;try{let n=await e.json();n&&typeof n==`object`&&`message`in n&&typeof n.message==`string`&&(t=n.message)}catch{}throw Error(t)},P={registerOptions:`/user/passkeys/options`,registerStore:`/user/passkeys`,verifyOptions:`/passkeys/login/options`,verifySubmit:`/passkeys/login`},F={configure(e){D(e)},isSupported(){return n()},async isAutofillSupported(){return p()},async register(e){if(!this.isSupported())throw new v;this.cancel();try{let t=I(e,{options:P.registerOptions,submit:P.registerStore}),{options:n}=await j(t.optionsRoute),r=await d({optionsJSON:n}),i={name:e.name,credential:r};return await M(t.submitRoute,i)}catch(e){throw S(e)}},async verify(e={}){if(!this.isSupported())throw new v;this.cancel();try{let t=I(e,{options:P.verifyOptions,submit:P.verifySubmit}),{options:n}=await j(t.optionsRoute),r={credential:await g({optionsJSON:n})};return await M(t.submitRoute,r)}catch(e){throw S(e)}},async autofill(e={}){if(!(!this.isSupported()||!await this.isAutofillSupported()))try{let t=I(e,{options:P.verifyOptions,submit:P.verifySubmit}),{options:n}=await j(t.optionsRoute),r={credential:await g({optionsJSON:n,useBrowserAutofill:!0})};return await M(t.submitRoute,r)}catch(e){if(e instanceof Error&&[`AbortError`,`NotAllowedError`].includes(e.name))return;throw S(e)}},cancel(){c.cancelCeremony()}},I=(e,t)=>({optionsRoute:e.routes?.options??t.options,submitRoute:e.routes?.submit??t.submit});window.Passkeys=F,window.dispatchEvent(new CustomEvent(`passkeys:ready`));

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.