Plugin Directory

Changeset 3264076


Ignore:
Timestamp:
03/30/2025 12:31:09 PM (11 months ago)
Author:
authress
Message:

Update to version 0.2.100 from GitHub

Location:
authress
Files:
2 added
21 edited
1 copied

Legend:

Unmodified
Added
Removed
  • authress/assets/readme.txt

    r3263764 r3264076  
    55Requires PHP: 8.2
    66Tested up to: 6.6
    7 Stable tag: 0.2.99
     7Stable tag: 0.2.100
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
  • authress/tags/0.2.100/Authress_Sso_Login.php

    r3263764 r3264076  
    44    Plugin URI:   https://wordpress.org/plugins/authress
    55    Description:  Upgrades the WordPress login to support SSO Login.
    6     Version:      0.2.99
     6    Version:      0.2.100
    77    Author:       Authress
    88    Author URI:   https://authress.io
     
    1111*/
    1212
    13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.99' );
     13define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.100' );
    1414
    1515define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ );
  • authress/tags/0.2.100/readme.txt

    r3263764 r3264076  
    55Requires PHP: 8.2
    66Tested up to: 6.6
    7 Stable tag: 0.2.99
     7Stable tag: 0.2.100
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
  • authress/tags/0.2.100/templates/assets/js/authress-login-sdk.min.js

    r3263764 r3264076  
    1 /*! Authress Login SDK 2.5.361 | Author - Authress Developers | License information can be found at https://github.com/Authress/login-sdk.js */
    2 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.authress=t():e.authress=t()}(this,(()=>(()=>{var e,t,n={75:(e,t,n)=>{const{sanitizeUrl:r}=n(332),o=n(629),i={"Content-Type":"application/json","X-Powered-By":`Authress Login SDK; Javascript; ${n(330).version}`},a=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","Load failed","<HTML DOCUMENT></HTML>"]);function s(e){return"Network Error"===e.message||"ERR_NETWORK"===e.code||!e.status||e.status>=500||"string"==typeof e.message&&a.has(e.message)||"string"==typeof e.data&&a.has(e.data)}async function c(e){let t=null;for(let n=0;n<5;n++)try{return await e()}catch(e){if(e.retryCount=n,!s(e))throw e;t=e,t.isNetworkError=!0,await new Promise((e=>setTimeout(e,10*2**n)));continue}const n=new Error("[Authress Login SDK] Http Request failed due to a Network Error even after multiple retries",{cause:t});throw n.code="AuthressSdkNetworkError",n}e.exports=class{constructor(e,t){if(!e)throw Error("Custom Authress Domain Host is required");const n=t||{debug(){},warn(){},critical(){}};this.logger=n;const o=new URL(r(e));this.loginUrl=`${o.origin}/api`}get(e,t,n,r){return c((()=>this.fetchWrapper("GET",e,null,n,t,r)))}delete(e,t,n,r){return c((()=>this.fetchWrapper("DELETE",e,null,n,t,r)))}post(e,t,n,r,o){return c((()=>this.fetchWrapper("POST",e,n,r,t,o)))}put(e,t,n,r,o){return c((()=>this.fetchWrapper("PUT",e,n,r,t,o)))}patch(e,t,n,r,o){return c((()=>this.fetchWrapper("PATCH",e,n,r,t,o)))}async fetchWrapper(e,t,n,r,a,s){const c=`${this.loginUrl}${t.toString()}`,d=e.toUpperCase(),l=Object.assign({},i,r);try{this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] HttpClient Request",method:d,url:c});const e={method:d,headers:l};n&&(e.body=JSON.stringify(n)),!o.isLocalHost()&&a&&(e.credentials="include");const t=await fetch(c,e);if(!t.ok)throw t;let r={};try{r=await t.text(),r=JSON.parse(r)}catch(e){}return{url:c,method:d,headers:t.headers,status:t.status,data:r}}catch(e){let t=e;try{t=await e.text(),t=JSON.parse(t)}catch(e){}const r=t.stack&&t.stack.match(/chrome-extension:[/][/](\w+)[/]/);if(r){this.logger&&this.logger.debug&&this.logger.debug({title:`[Authress Login SDK] Fetch failed due to a browser extension - ${d} - ${c}`,method:d,url:c,data:n,headers:l,error:e,resolvedError:t,extensionErrorId:r});const o=new Error(`Extension Error ID: ${r}`);throw o.code="BROWSER_EXTENSION_ERROR",o}const o=e.status;let i="warn",a="[Authress Login SDK] HttpClient Response Error";e?401===o?(a="[Authress Login SDK] HttpClient Response Error due to invalid token",i="debug"):404===o?(a="[Authress Login SDK] HttpClient Response: Not Found",i="debug"):o<500&&s&&(i="debug"):a="[Authress Login SDK] HttpClient Response Error - Unknown error occurred",this.logger&&this.logger[i]&&this.logger[i]({title:a,online:"undefined"==typeof navigator||navigator.onLine,method:d,url:c,status:o,data:n,headers:l,error:e,resolvedError:t});throw{url:c,method:d,status:o,data:t,headers:e.headers}}}}},160:(e,t,n)=>{const r=n(427),o="AuthenticationCredentialsStorage";e.exports=new class{getUserCookie(){if("undefined"==typeof window||"undefined"==typeof document)return null;return document.cookie.split(";").filter((e=>"user"===e.split("=")[0].trim())).map((e=>e.replace(/^user=/,""))).find((e=>e&&e.trim()))||null}set(e,t){if("undefined"!=typeof window&&"undefined"!=typeof document)try{const n=r.parse(document.cookie);localStorage.setItem(o,JSON.stringify({idToken:e,expiry:t&&t.getTime(),jsCookies:!!n.authorization})),this.clearCookies("user")}catch(e){console.debug("LocalStorage failed in Browser",e)}}get(){if("undefined"==typeof window||"undefined"==typeof document)return null;let e={};try{e=r.parse(document.cookie)}catch(e){console.debug("CookieManagement failed in Browser",e)}try{const{idToken:t,expiry:n,jsCookies:r}=JSON.parse(localStorage.getItem(o)||"{}");return t?n<Date.now()||r&&!e.authorization?null:t:this.getUserCookie()}catch(e){return console.debug("LocalStorage failed in Browser",e),this.getUserCookie()}}delete(){try{localStorage.removeItem(o)}catch(e){console.debug("LocalStorage failed in Browser",e)}try{this.clearCookies("user")}catch(e){console.debug("CookieManagement failed in Browser",e)}}clear(){this.clearCookies(),this.delete()}clearCookies(e){if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.cookie.split("; ");for(const n of t){if(!["user","authorization","auth-code","AuthUserId"].includes(n.split("=")[0])||e&&n.split("=")[0]!==e)continue;const t=window.location.hostname.split("."),r=[...Array(t.length-1)].map(((e,n)=>t.reverse().slice(0,n+2).reverse().join("."))).map((e=>[e,`.${e}`])).flat(1).concat(null);"localhost"===window.location.hostname&&r.push("localhost");for(const e of r){const t=e?`domain=${e};`:"",r=`${encodeURIComponent(n.split(";")[0].split("=")[0])}=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ${t} SameSite=Strict; path=`;document.cookie=`${r}/`;const o=location.pathname.split("/");for(;o.length>0;)document.cookie=r+o.join("/"),o.pop()}}}}},321:e=>{var t=1/0,n=17976931348623157e292,r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e,h,p){return e&&e.length?function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,0,(h=p||void 0===h?1:(f=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&l.call(e)==o}(e))return r;if(u(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):a.test(e)?r:+e}(e))===t||e===-1/0?(e<0?-1:1)*n:e==e?e:0:0===e?e:0}(h),g=f%1,f==f?g?f-g:f:0))<0?0:h):[];var f,g}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"@authress/login","version":"2.5.361","description":"Universal login sdk for Authress authentication as a service. Provides managed authentication for user identity, authentication, and token verification.","main":"./src/index.js","types":"./index.d.ts","files":["index.d.ts","src","dist"],"scripts":{"build":"node make.js build && NODE_ENV=production webpack --mode=production","lint":"eslint --ext .js,.ts src tests make.js index.d.ts","test":"check-dts index.d.ts && mocha tests/*.test.js tests/**/*.test.js -R spec"},"dependencies":{"cookie":"<1","lodash.take":"^4.1.1"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@types/node":"^14.14.35","@typescript-eslint/eslint-plugin":"^3.1.0","@typescript-eslint/parser":"^3.1.0","babel-loader":"^8.2.3","chai":"^4.2.0","check-dts":"^0.4.4","ci-build-tools":"^1.0.13","commander":"^4.0.1","compression-webpack-plugin":"^9.2.0","eslint":"^7.12.1","eslint-config-cimpress-atsquad":"^1.0.67","eslint-loader":"^4.0.2","eslint-plugin-mocha":"^7.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","fs-extra":"^8.1.0","glob":"^7.1.6","mocha":"^11.1.0","path-browserify":"^1.0.1","sinon":"^7.5.0","sinon-chai":"^3.3.0","terser-webpack-plugin":"^5.3.1","typescript":"^3.9.5","webpack":"^5.69.1","webpack-cli":"^4.9.2"},"repository":{"type":"git","url":"git+https://github.com/Authress/authress-login.js"},"keywords":["authentication","authentication as a service","Login","Login Client","universal login","auth","federated login","secure login","application security","IDaaS","authentication","user authentication","user identity","Oauth2","Oauth2.1","Oauth3","platform","platform login","extension","Authress","Authress client","user security","DBSC","Device Bound Session Credentials"],"author":"Authress Developers <[email protected]> (https://authress.io)","license":"Apache-2.0","bugs":{"url":"https://github.com/Authress/authress-login.js/issues"},"homepage":"https://authress.io","engines":{"node":">=18"}}')},332:e=>{e.exports.sanitizeUrl=function(e){let t=e;t.startsWith("http")||(t=`https://${t}`);const n=new URL(t),r=n.host.match(/^([a-z0-9-]+)[.][a-z0-9-]+[.]authress[.]io$/);return r&&(n.host=`${r[1]}.login.authress.io`,t=n.toString()),t.replace(/[/]+$/,"")}},354:(e,t,n)=>{const r=n(427),o=n(321),i=n(629),a=n(75),s=n(836),{sanitizeUrl:c}=n(332),d=n(160);let l,u=new Promise((e=>l=e)),h=null;const p="AuthenticationRequestNonce";const f=n(568);e.exports={LoginClient:class{constructor(e,t){const n=Object.assign({applicationId:"app_default"},e);this.logger=t||console;const r=n.authressApiUrl||n.authressLoginHostUrl||n.authenticationServiceUrl||"";if(!r)throw Error('Missing required property "authressApiUrl" in LoginClient constructor. Custom Authress Domain Host is required.');if(this.applicationId=n.applicationId,!this.applicationId||this.applicationId.match(/^(sc_|ext_)/)){const e=Error("You have incorrectly specified an Authress Service Client or Extension as the applicationId instead of a valid application. The applicationId is your application that your users will log into, usually hosted on your domain https://example.yourdomain.com. Users cannot log *into* a Service Client, but they can log in *with* one. Users can use a Service Client to log in, by setting the connection ID in the *authenticate({ connectionId })* method to be the Authress Service Client.\n(1) If you are building an Custom Login Portal, then the application ID should correspond to this login portal.\n(2) If you are replacing or extending an Authress connection, then specify the Service Client as the connectionId and the end user application as the applicationId.\n(3) If you are building a platform or plugin marketplace, where users will log into third party extensions or apps, then distribute in your SDK a wrapper for the Authress Extension Client using: import { extensionClient } from '@authress/login' found within this SDK.\n(4) If you aren't sure what to do here to fix the problem, the fastest and usually correct solution is go to https://authress.io/app/#/settings?focus=applications create a new application, specify your site in the application url property and then update the value here.");throw e.code="InvalidApplication",e}this.hostUrl=c(r),this.httpClient=new a(this.hostUrl,t),this.lastSessionCheck=0,this.enableCredentials=this.getMatchingDomainInfo(this.hostUrl),n.skipBackgroundCredentialsCheck||i.onLoad((async()=>{await this.userSessionExists(!0)}))}getMatchingDomainInfo(e){const t=new URL(e);if(i.isLocalHost())return!1;const n=i.getCurrentLocation();if("https:"!==n.protocol)return!1;const r=t.host.toLowerCase().split(".").reverse(),a=n.host.toLowerCase().split(".").reverse();let s=[];for(let e of r){const t=o(a,s.length+1).join(".");if(s.concat(e).join(".")!==t)break;s.push(e)}return s.length===r.length&&s.length===a.length||s.length>1}getUserIdentity(){const e=d.getUserCookie(),t=s.decodeOrParse(e);if(t){const n=t.exp?new Date(1e3*t.exp):new Date(Date.now()+864e5);return d.set(e,n),t.userId=t.sub,t}const n=d.get(),r=s.decodeOrParse(n);if(!r)return null;const o=new URL(r.iss).hostname,i=new URL(this.hostUrl).hostname;return o.endsWith(i)||i.endsWith(o)?(r.userId=r.sub,r):(d.clear(),null)}async getConnectionCredentials(){await this.waitForUserSession();try{const e=await this.ensureToken();return(await this.httpClient.get("/session/credentials",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data}catch(e){return null}}async getDevices(){try{const e=await this.ensureToken();return(await this.httpClient.get("/session/devices",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data.devices}catch(e){return[]}}async deleteDevice(e){try{const t=await this.ensureToken();await this.httpClient.delete(`/session/devices/${encodeURIComponent(e)}`,this.enableCredentials,{Authorization:t&&`Bearer ${t}`})}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to delete device",error:e}),e}}async openUserConfigurationScreen(e={redirectUrl:null,startPage:"Profile"}){if(!await this.userSessionExists()){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}const t=new URL("/settings",this.hostUrl);t.searchParams.set("client_id",this.applicationId),t.searchParams.set("start_page",e&&e.startPage||"Profile"),t.searchParams.set("redirect_uri",e&&e.redirectUrl||i.getCurrentLocation().href),i.assign(t.toString()),await Promise.resolve()}async registerDevice(e={name:"",type:"",totp:{}}){const t=await this.getUserIdentity();if(!t){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}if(!e){const e=Error("Register Device missing required parameter: 'Options'");throw e.code="InvalidInput",e}let n;if(e.type&&"WebAuthN"!==e.type)"TOTP"===e.type&&(n={name:e.name,code:e.totp.verificationCode,totpData:e.totp,type:"TOTP"});else{const r=t.sub,o={challenge:Uint8Array.from(r,(e=>e.charCodeAt(0))),rp:{id:this.hostUrl.split(".").slice(1).join("."),name:"WebAuthN Login"},user:{id:Uint8Array.from(r,(e=>e.charCodeAt(0))),name:r,displayName:`Generated User ID: ${r}`},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],authenticatorSelection:{residentKey:"discouraged",requireResidentKey:!1,userVerification:"discouraged"},timeout:6e4,attestation:"direct"},i=await navigator.credentials.create({publicKey:o}),a={authenticatorAttachment:i.authenticatorAttachment,credentialId:i.id,type:i.type,userId:r,attestation:btoa(String.fromCharCode(...new Uint8Array(i.response.attestationObject))),client:btoa(String.fromCharCode(...new Uint8Array(i.response.clientDataJSON)))};n={name:e&&e.name,code:a,type:"WebAuthN"}}try{const e=await this.ensureToken();return(await this.httpClient.post("/session/devices",this.enableCredentials,n,{Authorization:e&&`Bearer ${e}`})).data}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to register new device",error:e,request:n}),e}}async waitForUserSession(){try{return await u,!0}catch(e){return!1}}userSessionExists(e){return h?Date.now()-this.lastSessionCheck<50?h:(this.lastSessionCheck=Date.now(),h=h.catch((()=>{})).then((()=>this.userSessionContinuation(e)))):(this.lastSessionCheck=Date.now(),h=this.userSessionContinuation(e))}async userSessionContinuation(e){const t=new URLSearchParams(i.getCurrentLocation().search);let n={};if("undefined"!=typeof localStorage)try{n=JSON.parse(localStorage.getItem(p)||"{}"),localStorage.removeItem(p),Object.hasOwnProperty.call(n,"enableCredentials")&&(this.enableCredentials=n.enableCredentials)}catch(e){this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] LocalStorage failed in Browser",error:e})}if(t.get("state")&&"oauthLogin"===t.get("flow"))return!1;if((n.nonce||t.get("iss")&&t.get("iss").includes(this.hostUrl))&&this.sanitizeQueryParameters(),n.nonce&&t.get("code")&&n.nonce===t.get("nonce")){const e="cookie"===t.get("code")?r.parse(document.cookie)["auth-code"]:t.get("code"),o=await s.calculateAntiAbuseHash({client_id:this.applicationId,authenticationRequestId:n.nonce,code:e}),i={grant_type:"authorization_code",redirect_uri:n.redirectUrl,client_id:this.applicationId,code:e,code_verifier:n.codeVerifier,antiAbuseHash:o};try{const e=await this.httpClient.post(`/authentication/${n.nonce}/tokens`,this.enableCredentials,i),t=s.decode(e.data.id_token),o=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);return document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:o,path:"/",sameSite:"strict"}),d.set(e.data.id_token,o),l(),!0}catch(e){if(this.logger&&this.logger.log({title:"[Authress Login SDK] Failed exchange authentication response for a token.",error:e}),e.data&&"invalid_request"===e.data.error)return!1;throw e.data||e}}if(i.isLocalHost()&&t.get("nonce")&&t.get("access_token")&&(!n.nonce||n.nonce===t.get("nonce"))){const e=s.decode(t.get("id_token")),n=e.exp&&new Date(1e3*e.exp)||Number(t.get("expires_in"))&&new Date(Date.now()+1e3*Number(t.get("expires_in")));return document.cookie=r.serialize("authorization",t.get("access_token")||"",{expires:n,path:"/",sameSite:"strict"}),d.set(t.get("id_token"),n),l(),!0}if(this.getUserIdentity())return l(),!0;if(!i.isLocalHost()&&!e){try{const e=await this.httpClient.patch("/session",this.enableCredentials,{},null,!0);if(e.data.access_token){const t=s.decode(e.data.id_token),n=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:n,path:"/",sameSite:"strict"}),d.set(e.data.id_token,n)}}catch(e){400===e.status||404===e.status||409===e.status?this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] User does not have an existing authentication session",error:e}):this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed attempting to check if the user has an existing authentication session",error:e})}if(this.getUserIdentity())return l(),!0}return!1}async updateExtensionAuthenticationRequest({state:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r}){if(!t&&!n){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}const o=new URLSearchParams(i.getCurrentLocation().search),a=e||o.get("state");if(!a){const e=Error("The `state` parameters must be specified to update this authentication request");throw e.code="InvalidAuthenticationRequest",e}try{const e=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,authenticationRequestId:a}),o=await this.httpClient.patch(`/authentication/${a}`,!0,{antiAbuseHash:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r});if(new URL(o.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:o.data.authenticationUrl};i.assign(o.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to update extension authentication request",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async unlinkIdentity(e){if(!e){const e=Error("connectionId must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged in to unlink an account.");throw e.code="NotLoggedIn",e}let t;try{t=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const n=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${t}`};try{await this.httpClient.delete(`/identities/${encodeURIComponent(e)}`,this.enableCredentials,n)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to unlink user identity",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}}async linkIdentity({connectionId:e,tenantLookupIdentifier:t,redirectUrl:n,connectionProperties:r}){if(!e&&!t){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}let o;try{o=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const{codeChallenge:a}=await s.getAuthCodes(),c=await s.calculateAntiAbuseHash({connectionId:e,tenantLookupIdentifier:t,applicationId:this.applicationId});try{const s=n&&new URL(n).toString()||i.getCurrentLocation().href,d=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${o}`},l=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:c,linkIdentity:!0,redirectUrl:s,codeChallengeMethod:"S256",codeChallenge:a,connectionId:e,tenantLookupIdentifier:t,connectionProperties:r,applicationId:this.applicationId},d);i.assign(l.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start user identity link",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e}await new Promise((e=>setTimeout(e,5e3)))}async authenticate(e={}){const{connectionId:t,tenantLookupIdentifier:n,inviteId:r,redirectUrl:o,force:a,responseLocation:c,flowType:l,connectionProperties:u,openType:h,multiAccount:f,clearUserDataBeforeLogin:g}=e||{};if(c&&"cookie"!==c&&"query"!==c&&"none"!==c){const e=Error("Authentication response location is not valid");throw e.code="InvalidResponseLocation",e}if(!r&&!a&&!f&&await this.userSessionExists()){const n=await this.ensureToken(),r=s.decode(n);if(t&&r&&r.azp&&t!==r.azp){this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Authentication blocked because the user is already logged in, and the requested authentication parameters do not match the original session.",requestedAuthenticationOptions:e,currentAuthenticationSessionData:r});const t=Error('Authentication requested for user that is already logged in, but the connectionId specified does not match their existing session.\n        Recommended Options:\n          (1) If the goal is to force them to log in with this new connection and ignore their existing session, use the "force" flag.\n          (2) If the goal is link their current identity with a new from the new connection, use the linkIdentity() method.\n          (3) If the goal is skip log in if they are already logged in or force log in with the connectionId, first check if userSessionExists() and then only if "false", call authenticate().');throw t.code="AuthenticationConstraintContention",t}return null}const{codeVerifier:m,codeChallenge:w}=await s.getAuthCodes(),y=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,inviteId:r,applicationId:this.applicationId});try{const e=o&&new URL(o).toString()||i.getCurrentLocation().href;!1!==g&&d.clear();const a=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:y,redirectUrl:e,codeChallengeMethod:"S256",codeChallenge:w,connectionId:t,tenantLookupIdentifier:n,inviteId:r,connectionProperties:u,applicationId:this.applicationId,responseLocation:c,flowType:l,multiAccount:f});if(localStorage.setItem(p,JSON.stringify({nonce:a.data.authenticationRequestId,codeVerifier:m,lastConnectionId:t,tenantLookupIdentifier:n,redirectUrl:e,enableCredentials:a.data.enableCredentials,multiAccount:f})),new URL(a.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:a.data.authenticationUrl};if("tab"===h){const e=i.open(a.data.authenticationUrl,"_blank");e&&!e.closed&&void 0!==e.closed||i.assign(a.data.authenticationUrl)}else i.assign(a.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start authentication for user",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async ensureToken(e){if(e&&0===e.timeoutInMillis){const e=this.getUserIdentity(),t=r.parse(document.cookie);if(e)return"undefined"!==t.authorization&&t.authorization;const n=Error("No token retrieved after timeout");throw n.code="TokenTimeout",n}await this.userSessionExists();const t=Object.assign({timeoutInMillis:5e3},e||{}),n=this.waitForUserSession(),o=-1===t.timeoutInMillis||t.timeoutInMillis>2**31-1?2**31-1:t.timeoutInMillis,i=new Promise(((e,t)=>setTimeout(t,o||0)));try{await Promise.race([n,i])}catch(e){const t=Error("No token retrieved after timeout");throw t.code="TokenTimeout",t}const a=r.parse(document.cookie);return"undefined"!==a.authorization&&a.authorization}async logout(e){let t;if(e)try{new URL(e),t=e}catch(n){try{t=new URL(e,i.getCurrentLocation().href).toString()}catch(t){const n=Error(`The logout redirect url is not valid URL: ${e}`);throw n.code="InvalidRedirectUrl",n}}if(d.clear(),this.sanitizeQueryParameters(),u=new Promise((e=>l=e)),this.enableCredentials)try{return await this.httpClient.delete("/session",this.enableCredentials),this.lastSessionCheck=0,void(e&&e!==i.getCurrentLocation().href&&i.assign(e))}catch(e){}const n=new URL("/logout",this.hostUrl);n.searchParams.set("redirect_uri",t||i.getCurrentLocation().href),n.searchParams.set("client_id",this.applicationId),i.assign(n.toString()),this.lastSessionCheck=0,await new Promise((e=>setTimeout(e,500)))}sanitizeQueryParameters(){const e=new URL(i.getCurrentLocation());e.searchParams.delete("iss"),e.searchParams.delete("nonce"),e.searchParams.delete("code"),e.searchParams.delete("expires_in"),e.searchParams.delete("access_token"),e.searchParams.delete("id_token"),history.replaceState({},void 0,e.toString())}},ExtensionClient:f,UserConfigurationScreen:{Profile:"Profile",MFA:"MFA"}}},427:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||l,a=0,s=0,h=0;do{if(-1===(s=e.indexOf("=",a)))break;if(-1===(h=e.indexOf(";",a)))h=o;else if(s>h){a=e.lastIndexOf(";",s-1)+1;continue}var p=c(e,a,s),f=d(e,s,p),g=e.slice(p,f);if(!r.call(n,g)){var m=c(e,s+1,h),w=d(e,h,m);34===e.charCodeAt(m)&&34===e.charCodeAt(w-1)&&(m++,w--);var y=e.slice(m,w);n[g]=u(y,i)}a=h+1}while(a<o);return n},t.serialize=function(e,t,r){var c=r&&r.encode||encodeURIComponent;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var d=c(t);if(!i.test(d))throw new TypeError("argument val is invalid");var l=e+"="+d;if(!r)return l;if(null!=r.maxAge){var u=Math.floor(r.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+u}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){var h=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(h)||isNaN(h.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+h.toUTCString()}r.httpOnly&&(l+="; HttpOnly");r.secure&&(l+="; Secure");r.partitioned&&(l+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/;function c(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function d(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function u(e,t){try{return t(e)}catch(t){return e}}},568:(e,t,n)=>{const r=n(836),{sanitizeUrl:o}=n(332),i=n(629),a="ExtensionRequestNonce";let s=null;e.exports=class{constructor(e,t){if(this.extensionId=t,!e)throw Error('Missing required property "authressCustomDomain" in ExtensionClient constructor. The Custom Authress Domain Host is required.');if(!t)throw Error('Missing required property "extensionId" in ExtensionClient constructor. The extension is required for selecting the correct login method.');this.authressCustomDomain=o(e),this.accessToken=null,i.onLoad((async()=>{await this.requestToken({silent:!0})}))}async getUserIdentity(){const e=this.accessToken&&await r.decode(this.accessToken);return e?1e3*e.exp<Date.now()?(this.accessToken=null,null):e:null}async getTokenResponse(){return await this.getUserIdentity()?{accessToken:this.accessToken}:null}requestToken(e={code:null,silent:!1}){if(s)return s=s.catch((()=>{})).then((()=>this.requestTokenContinuation(e)));const t=this.requestTokenContinuation(e);return t.catch((()=>{})),s=t}async requestTokenContinuation(e={code:null,silent:!1}){const t=e&&e.code||new URLSearchParams(i.getCurrentLocation().search).get("code");if(!t){if(!e||!e.silent){const e=Error("OAuth Authorization code is required");throw e.code="InvalidAuthorizationCode",e}return this.getTokenResponse()}const n=new URL(this.authressCustomDomain);n.pathname="/api/authentication/oauth/tokens";const{codeVerifier:r,redirectUrl:o}=JSON.parse(localStorage.getItem(a)||"{}"),s=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code_verifier:r,code:t,grant_type:"authorization_code",client_id:this.extensionId,redirect_uri:o})}),c=await s.json();this.accessToken=c.access_token;const d=new URL(i.getCurrentLocation());return d.searchParams.delete("code"),d.searchParams.delete("iss"),d.searchParams.delete("nonce"),d.searchParams.delete("expires_in"),d.searchParams.delete("access_token"),d.searchParams.delete("id_token"),history.replaceState({},void 0,d.toString()),this.getTokenResponse()}async login(e){const t=await this.getTokenResponse();if(t)return t;const n=await this.requestToken({silent:!0});if(n)return n;const o=new URL(this.authressCustomDomain),{codeVerifier:s,codeChallenge:c}=r.getAuthCodes(),d=e||i.getCurrentLocation().href;return localStorage.setItem(a,JSON.stringify({codeVerifier:s,redirectUrl:d})),o.searchParams.set("client_id",this.extensionId),o.searchParams.set("code_challenge",c),o.searchParams.set("code_challenge_method","S256"),o.searchParams.set("redirect_uri",d),i.assign(o.toString()),await new Promise((e=>setTimeout(e,5e3))),null}}},629:e=>{e.exports=new class{onLoad(e){"undefined"!=typeof window&&(window.onload=e)}isLocalHost(){return"undefined"!=typeof window&&window.location&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)}getCurrentLocation(){return"undefined"!=typeof window&&new URL(window.location)||new URL("http://localhost:8080")}assign(e){return"undefined"==typeof window?null:window.location.assign(e.toString())}open(e){return"undefined"==typeof window?null:window.open(e.toString())}}},836:(e,t,n)=>{const r=n(878);e.exports=new class{decode(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[1]));return t.exp&&(t.exp=t.exp-10),t}catch(e){return null}}decodeOrParse(e){if(!e)return null;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(t){return this.decode(e)}}decodeFull(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[0])),n=JSON.parse(r.decode(e.split(".")[1]));return n.exp&&(n.exp=n.exp-10),{header:t,payload:n}}catch(e){return null}}async getAuthCodes(){const e=r.encode((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(16)).toString()),t=await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(e));return{codeVerifier:e,codeChallenge:r.encode(t)}}async calculateAntiAbuseHash(e){const t=Date.now(),n=Object.values(e).filter((e=>e)).join("|");let o=0,i=null;for(;++o&&(i=r.encode(await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(`${t};${o};${n}`))),!i.match(/^00/)););return`v2;${t};${o};${i}`}}},878:e=>{function t(e){return String.fromCharCode(parseInt(e.slice(1),16))}function n(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}e.exports.decode=function(e){return function(e){return decodeURIComponent(Array.from(atob(e),n).join(""))}(e.replace(/-/g,"+").replace(/_/g,"/"))},e.exports.encode=function(e){return e&&"object"==typeof e?btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,""):function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,t))}(e).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}}},r={};function o(e){var t=r[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var i=r[e]={exports:{}};try{var a={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(a)})),i=a.module,a.factory.call(i.exports,i,i.exports,a.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=r,o.i=[],o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"9847b2de00ec05815eb6",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="authress:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[r];var h=(t,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},(()=>{var e,t,n,r={},i=o.c,a=[],s=[],c="idle",d=0,l=[];function u(e){c=e;for(var t=[],n=0;n<s.length;n++)t[n]=s[n].call(null,e);return Promise.all(t).then((function(){}))}function h(){0==--d&&u("ready").then((function(){if(0===d){var e=l;l=[];for(var t=0;t<e.length;t++)e[t]()}}))}function p(e){if("idle"!==c)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(n){return n?u("prepare").then((function(){var r=[];return t=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,i){return o.hmrC[i](n.c,n.r,n.m,e,t,r),e}),[])).then((function(){return t=function(){return e?g(e):u("ready").then((function(){return r}))},0===d?t():new Promise((function(e){l.push((function(){e(t())}))}));var t}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function f(e){return"ready"!==c?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status (state: "+c+")")})):g(e)}function g(e){e=e||{},m();var r=t.map((function(t){return t(e)}));t=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var a,s=u("apply"),c=function(e){a||(a=e)},d=[];return r.forEach((function(e){if(e.apply){var t=e.apply(c);if(t)for(var n=0;n<t.length;n++)d.push(t[n])}})),Promise.all([i,s]).then((function(){return a?u("fail").then((function(){throw a})):n?g(e).then((function(e){return d.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e})):u("idle").then((function(){return d}))}))}function m(){if(n)return t||(t=[]),Object.keys(o.hmrI).forEach((function(e){n.forEach((function(n){o.hmrI[e](n,t)}))})),n=void 0,!0}o.hmrD=r,o.i.push((function(l){var g,m,w,y,v=l.module,b=function(t,n){var r=i[n];if(!r)return t;var o=function(o){if(r.hot.active){if(i[o]){var s=i[o].parents;-1===s.indexOf(n)&&s.push(n)}else a=[n],e=o;-1===r.children.indexOf(o)&&r.children.push(o)}else console.warn("[HMR] unexpected require("+o+") from disposed module "+n),a=[];return t(o)},s=function(e){return{configurable:!0,enumerable:!0,get:function(){return t[e]},set:function(n){t[e]=n}}};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&"e"!==l&&Object.defineProperty(o,l,s(l));return o.e=function(e,n){return function(e){switch(c){case"ready":u("prepare");case"prepare":return d++,e.then(h,h),e;default:return e}}(t.e(e,n))},o}(l.require,l.id);v.hot=(g=l.id,m=v,y={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:w=e!==g,_requireSelf:function(){a=m.parents.slice(),e=w?void 0:g,o(g)},active:!0,accept:function(e,t,n){if(void 0===e)y._selfAccepted=!0;else if("function"==typeof e)y._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)y._acceptedDependencies[e[r]]=t||function(){},y._acceptedErrorHandlers[e[r]]=n;else y._acceptedDependencies[e]=t||function(){},y._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)y._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)y._declinedDependencies[e[t]]=!0;else y._declinedDependencies[e]=!0},dispose:function(e){y._disposeHandlers.push(e)},addDisposeHandler:function(e){y._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=y._disposeHandlers.indexOf(e);t>=0&&y._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,c){case"idle":t=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)}));break;case"prepare":case"check":case"dispose":case"apply":(n=n||[]).push(g)}},check:p,apply:f,status:function(e){if(!e)return c;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:r[g]},e=void 0,y),v.parents=a,v.children=[],a=[],l.require=b})),o.hmrC={},o.hmrI={}})(),o.p="",(()=>{var e,t,n,r,i,a=o.hmrS_jsonp=o.hmrS_jsonp||{792:0},s={};function c(t,n){return e=n,new Promise(((e,n)=>{s[t]=e;var r=o.p+o.hu(t),i=new Error;o.l(r,(e=>{if(s[t]){s[t]=void 0;var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading hot update chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n(i)}}))}))}function d(e){function s(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,s=i.chain,d=o.c[a];if(d&&(!d.hot._selfAccepted||d.hot._selfInvalidated)){if(d.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:a};if(d.hot._main)return{type:"unaccepted",chain:s,moduleId:a};for(var l=0;l<d.parents.length;l++){var u=d.parents[l],h=o.c[u];if(h){if(h.hot._declinedDependencies[a])return{type:"declined",chain:s.concat([u]),moduleId:a,parentId:u};-1===t.indexOf(u)&&(h.hot._acceptedDependencies[a]?(n[u]||(n[u]=[]),c(n[u],[a])):(delete n[u],t.push(u),r.push({chain:s.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}o.f&&delete o.f.jsonpHmr,t=void 0;var d={},l=[],u={},h=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in n)if(o.o(n,p)){var f=n[p],g=f?s(p):{type:"disposed",moduleId:p},m=!1,w=!1,y=!1,v="";switch(g.chain&&(v="\nUpdate propagation: "+g.chain.join(" -> ")),g.type){case"self-declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of self decline: "+g.moduleId+v));break;case"declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of declined dependency: "+g.moduleId+" in "+g.parentId+v));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(g),e.ignoreUnaccepted||(m=new Error("Aborted because "+p+" is not accepted"+v));break;case"accepted":e.onAccepted&&e.onAccepted(g),w=!0;break;case"disposed":e.onDisposed&&e.onDisposed(g),y=!0;break;default:throw new Error("Unexception type "+g.type)}if(m)return{error:m};if(w)for(p in u[p]=f,c(l,g.outdatedModules),g.outdatedDependencies)o.o(g.outdatedDependencies,p)&&(d[p]||(d[p]=[]),c(d[p],g.outdatedDependencies[p]));y&&(c(l,[g.moduleId]),u[p]=h)}n=void 0;for(var b,k=[],C=0;C<l.length;C++){var I=l[C],S=o.c[I];S&&(S.hot._selfAccepted||S.hot._main)&&u[I]!==h&&!S.hot._selfInvalidated&&k.push({module:I,require:S.hot._requireSelf,errorHandler:S.hot._selfAccepted})}return{dispose:function(){var e;r.forEach((function(e){delete a[e]})),r=void 0;for(var t,n=l.slice();n.length>0;){var i=n.pop(),s=o.c[i];if(s){var c={},u=s.hot._disposeHandlers;for(C=0;C<u.length;C++)u[C].call(null,c);for(o.hmrD[i]=c,s.hot.active=!1,delete o.c[i],delete d[i],C=0;C<s.children.length;C++){var h=o.c[s.children[C]];h&&((e=h.parents.indexOf(i))>=0&&h.parents.splice(e,1))}}}for(var p in d)if(o.o(d,p)&&(s=o.c[p]))for(b=d[p],C=0;C<b.length;C++)t=b[C],(e=s.children.indexOf(t))>=0&&s.children.splice(e,1)},apply:function(t){for(var n in u)o.o(u,n)&&(o.m[n]=u[n]);for(var r=0;r<i.length;r++)i[r](o);for(var a in d)if(o.o(d,a)){var s=o.c[a];if(s){b=d[a];for(var c=[],h=[],p=[],f=0;f<b.length;f++){var g=b[f],m=s.hot._acceptedDependencies[g],w=s.hot._acceptedErrorHandlers[g];if(m){if(-1!==c.indexOf(m))continue;c.push(m),h.push(w),p.push(g)}}for(var y=0;y<c.length;y++)try{c[y].call(null,b)}catch(n){if("function"==typeof h[y])try{h[y](n,{moduleId:a,dependencyId:p[y]})}catch(r){e.onErrored&&e.onErrored({type:"accept-error-handler-errored",moduleId:a,dependencyId:p[y],error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"accept-errored",moduleId:a,dependencyId:p[y],error:n}),e.ignoreErrored||t(n)}}}for(var v=0;v<k.length;v++){var C=k[v],I=C.module;try{C.require(I)}catch(n){if("function"==typeof C.errorHandler)try{C.errorHandler(n,{moduleId:I,module:o.c[I]})}catch(r){e.onErrored&&e.onErrored({type:"self-accept-error-handler-errored",moduleId:I,error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"self-accept-errored",moduleId:I,error:n}),e.ignoreErrored||t(n)}}return l}}}this.webpackHotUpdateauthress=(t,r,a)=>{for(var c in r)o.o(r,c)&&(n[c]=r[c],e&&e.push(c));a&&i.push(a),s[t]&&(s[t](),s[t]=void 0)},o.hmrI.jsonp=function(e,t){n||(n={},i=[],r=[],t.push(d)),o.o(n,e)||(n[e]=o.m[e])},o.hmrC.jsonp=function(e,s,l,u,h,p){h.push(d),t={},r=s,n=l.reduce((function(e,t){return e[t]=!1,e}),{}),i=[],e.forEach((function(e){o.o(a,e)&&void 0!==a[e]?(u.push(c(e,p)),t[e]=!0):t[e]=!1})),o.f&&(o.f.jsonpHmr=function(e,n){t&&o.o(t,e)&&!t[e]&&(n.push(c(e)),t[e]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(354)})()));
     1/*! Authress Login SDK 2.5.362 | Author - Authress Developers | License information can be found at https://github.com/Authress/login-sdk.js */
     2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.authress=t():e.authress=t()}(this,(()=>(()=>{var e,t,n={75:(e,t,n)=>{const{sanitizeUrl:r}=n(332),o=n(629),i={"Content-Type":"application/json","X-Powered-By":`Authress Login SDK; Javascript; ${n(330).version}`},a=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","Load failed","<HTML DOCUMENT></HTML>"]);function s(e){return"Network Error"===e.message||"ERR_NETWORK"===e.code||!e.status||e.status>=500||"string"==typeof e.message&&a.has(e.message)||"string"==typeof e.data&&a.has(e.data)}async function c(e){let t=null;for(let n=0;n<5;n++)try{return await e()}catch(e){if(e.retryCount=n,!s(e))throw e;t=e,t.isNetworkError=!0,await new Promise((e=>setTimeout(e,10*2**n)));continue}const n=new Error("[Authress Login SDK] Http Request failed due to a Network Error even after multiple retries",{cause:t});throw n.code="AuthressSdkNetworkError",n}e.exports=class{constructor(e,t){if(!e)throw Error("Custom Authress Domain Host is required");const n=t||{debug(){},warn(){},critical(){}};this.logger=n;const o=new URL(r(e));this.loginUrl=`${o.origin}/api`}get(e,t,n,r){return c((()=>this.fetchWrapper("GET",e,null,n,t,r)))}delete(e,t,n,r){return c((()=>this.fetchWrapper("DELETE",e,null,n,t,r)))}post(e,t,n,r,o){return c((()=>this.fetchWrapper("POST",e,n,r,t,o)))}put(e,t,n,r,o){return c((()=>this.fetchWrapper("PUT",e,n,r,t,o)))}patch(e,t,n,r,o){return c((()=>this.fetchWrapper("PATCH",e,n,r,t,o)))}async fetchWrapper(e,t,n,r,a,s){const c=`${this.loginUrl}${t.toString()}`,d=e.toUpperCase(),l=Object.assign({},i,r);try{this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] HttpClient Request",method:d,url:c});const e={method:d,headers:l};n&&(e.body=JSON.stringify(n)),!o.isLocalHost()&&a&&(e.credentials="include");const t=await fetch(c,e);if(!t.ok)throw t;let r={};try{r=await t.text(),r=JSON.parse(r)}catch(e){}return{url:c,method:d,headers:t.headers,status:t.status,data:r}}catch(e){let t=e;try{t=await e.text(),t=JSON.parse(t)}catch(e){}const r=t.stack&&t.stack.match(/chrome-extension:[/][/](\w+)[/]/);if(r){this.logger&&this.logger.debug&&this.logger.debug({title:`[Authress Login SDK] Fetch failed due to a browser extension - ${d} - ${c}`,method:d,url:c,data:n,headers:l,error:e,resolvedError:t,extensionErrorId:r});const o=new Error(`Extension Error ID: ${r}`);throw o.code="BROWSER_EXTENSION_ERROR",o}const o=e.status;let i="warn",a="[Authress Login SDK] HttpClient Response Error";e?401===o?(a="[Authress Login SDK] HttpClient Response Error due to invalid token",i="debug"):404===o?(a="[Authress Login SDK] HttpClient Response: Not Found",i="debug"):o<500&&s&&(i="debug"):a="[Authress Login SDK] HttpClient Response Error - Unknown error occurred",this.logger&&this.logger[i]&&this.logger[i]({title:a,online:"undefined"==typeof navigator||navigator.onLine,method:d,url:c,status:o,data:n,headers:l,error:e,resolvedError:t});throw{url:c,method:d,status:o,data:t,headers:e.headers}}}}},160:(e,t,n)=>{const r=n(427),o="AuthenticationCredentialsStorage";e.exports=new class{constructor(){this.retainUserCookie=!1}getUserCookie(){if("undefined"==typeof window||"undefined"==typeof document)return null;return document.cookie.split(";").filter((e=>"user"===e.split("=")[0].trim())).map((e=>e.replace(/^user=/,""))).find((e=>e&&e.trim()))||null}set(e,t){if("undefined"!=typeof window&&"undefined"!=typeof document)try{const n=r.parse(document.cookie);localStorage.setItem(o,JSON.stringify({idToken:e,expiry:t&&t.getTime(),jsCookies:!!n.authorization})),this.retainUserCookie||this.clearCookies("user")}catch(e){console.debug("LocalStorage failed in Browser",e)}}get(){if("undefined"==typeof window||"undefined"==typeof document)return null;let e={};try{e=r.parse(document.cookie)}catch(e){console.debug("CookieManagement failed in Browser",e)}try{const{idToken:t,expiry:n,jsCookies:r}=JSON.parse(localStorage.getItem(o)||"{}");return t?n<Date.now()||r&&!e.authorization?null:t:this.getUserCookie()}catch(e){return console.debug("LocalStorage failed in Browser",e),this.getUserCookie()}}delete(){try{localStorage.removeItem(o)}catch(e){console.debug("LocalStorage failed in Browser",e)}try{this.clearCookies("user")}catch(e){console.debug("CookieManagement failed in Browser",e)}}clear(){this.clearCookies(),this.delete()}clearCookies(e){if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.cookie.split("; ");for(const n of t){if(!["user","authorization","auth-code","AuthUserId"].includes(n.split("=")[0])||e&&n.split("=")[0]!==e)continue;const t=window.location.hostname.split("."),r=[...Array(t.length-1)].map(((e,n)=>t.reverse().slice(0,n+2).reverse().join("."))).map((e=>[e,`.${e}`])).flat(1).concat(null);"localhost"===window.location.hostname&&r.push("localhost");for(const e of r){const t=e?`domain=${e};`:"",r=`${encodeURIComponent(n.split(";")[0].split("=")[0])}=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ${t} SameSite=Strict; path=`;document.cookie=`${r}/`;const o=location.pathname.split("/");for(;o.length>0;)document.cookie=r+o.join("/"),o.pop()}}}}},321:e=>{var t=1/0,n=17976931348623157e292,r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e,h,p){return e&&e.length?function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,0,(h=p||void 0===h?1:(f=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&l.call(e)==o}(e))return r;if(u(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):a.test(e)?r:+e}(e))===t||e===-1/0?(e<0?-1:1)*n:e==e?e:0:0===e?e:0}(h),g=f%1,f==f?g?f-g:f:0))<0?0:h):[];var f,g}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"@authress/login","version":"2.5.362","description":"Universal login sdk for Authress authentication as a service. Provides managed authentication for user identity, authentication, and token verification.","main":"./src/index.js","types":"./index.d.ts","files":["index.d.ts","src","dist"],"scripts":{"build":"node make.js build && NODE_ENV=production webpack --mode=production","lint":"eslint --ext .js,.ts src tests make.js index.d.ts","test":"check-dts index.d.ts && mocha tests/*.test.js tests/**/*.test.js -R spec"},"dependencies":{"cookie":"<1","lodash.take":"^4.1.1"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@types/node":"^14.14.35","@typescript-eslint/eslint-plugin":"^3.1.0","@typescript-eslint/parser":"^3.1.0","babel-loader":"^8.2.3","chai":"^4.2.0","check-dts":"^0.4.4","ci-build-tools":"^1.0.13","commander":"^4.0.1","compression-webpack-plugin":"^9.2.0","eslint":"^7.12.1","eslint-config-cimpress-atsquad":"^1.0.67","eslint-loader":"^4.0.2","eslint-plugin-mocha":"^7.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","fs-extra":"^8.1.0","glob":"^7.1.6","mocha":"^11.1.0","path-browserify":"^1.0.1","sinon":"^7.5.0","sinon-chai":"^3.3.0","terser-webpack-plugin":"^5.3.1","typescript":"^3.9.5","webpack":"^5.69.1","webpack-cli":"^4.9.2"},"repository":{"type":"git","url":"git+https://github.com/Authress/authress-login.js"},"keywords":["authentication","authentication as a service","Login","Login Client","universal login","auth","federated login","secure login","application security","IDaaS","authentication","user authentication","user identity","Oauth2","Oauth2.1","Oauth3","platform","platform login","extension","Authress","Authress client","user security","DBSC","Device Bound Session Credentials"],"author":"Authress Developers <[email protected]> (https://authress.io)","license":"Apache-2.0","bugs":{"url":"https://github.com/Authress/authress-login.js/issues"},"homepage":"https://authress.io","engines":{"node":">=18"}}')},332:e=>{e.exports.sanitizeUrl=function(e){let t=e;t.startsWith("http")||(t=`https://${t}`);const n=new URL(t),r=n.host.match(/^([a-z0-9-]+)[.][a-z0-9-]+[.]authress[.]io$/);return r&&(n.host=`${r[1]}.login.authress.io`,t=n.toString()),t.replace(/[/]+$/,"")}},354:(e,t,n)=>{const r=n(427),o=n(321),i=n(629),a=n(75),s=n(836),{sanitizeUrl:c}=n(332),d=n(160);let l,u=new Promise((e=>l=e)),h=null;const p="AuthenticationRequestNonce";const f=n(568);e.exports={LoginClient:class{constructor(e,t){const n=Object.assign({applicationId:"app_default"},e);this.logger=t||console;const r=n.authressApiUrl||n.authressLoginHostUrl||n.authenticationServiceUrl||"";if(!r)throw Error('Missing required property "authressApiUrl" in LoginClient constructor. Custom Authress Domain Host is required.');if(this.applicationId=n.applicationId,!this.applicationId||this.applicationId.match(/^(sc_|ext_)/)){const e=Error("You have incorrectly specified an Authress Service Client or Extension as the applicationId instead of a valid application. The applicationId is your application that your users will log into, usually hosted on your domain https://example.yourdomain.com. Users cannot log *into* a Service Client, but they can log in *with* one. Users can use a Service Client to log in, by setting the connection ID in the *authenticate({ connectionId })* method to be the Authress Service Client.\n(1) If you are building an Custom Login Portal, then the application ID should correspond to this login portal.\n(2) If you are replacing or extending an Authress connection, then specify the Service Client as the connectionId and the end user application as the applicationId.\n(3) If you are building a platform or plugin marketplace, where users will log into third party extensions or apps, then distribute in your SDK a wrapper for the Authress Extension Client using: import { extensionClient } from '@authress/login' found within this SDK.\n(4) If you aren't sure what to do here to fix the problem, the fastest and usually correct solution is go to https://authress.io/app/#/settings?focus=applications create a new application, specify your site in the application url property and then update the value here.");throw e.code="InvalidApplication",e}this.hostUrl=c(r),this.httpClient=new a(this.hostUrl,t),this.lastSessionCheck=0,this.enableCredentials=this.getMatchingDomainInfo(this.hostUrl),d.retainUserCookie=e.retainUserCookie,n.skipBackgroundCredentialsCheck||i.onLoad((async()=>{await this.userSessionExists(!0)}))}getMatchingDomainInfo(e){const t=new URL(e);if(i.isLocalHost())return!1;const n=i.getCurrentLocation();if("https:"!==n.protocol)return!1;const r=t.host.toLowerCase().split(".").reverse(),a=n.host.toLowerCase().split(".").reverse();let s=[];for(let e of r){const t=o(a,s.length+1).join(".");if(s.concat(e).join(".")!==t)break;s.push(e)}return s.length===r.length&&s.length===a.length||s.length>1}getUserIdentity(){const e=d.getUserCookie(),t=s.decodeOrParse(e);if(t){const n=t.exp?new Date(1e3*t.exp):new Date(Date.now()+864e5);return d.set(e,n),t.userId=t.sub,t}const n=d.get(),r=s.decodeOrParse(n);if(!r)return null;const o=new URL(r.iss).hostname,i=new URL(this.hostUrl).hostname;return o.endsWith(i)||i.endsWith(o)?(r.userId=r.sub,r):(d.clear(),null)}async getConnectionCredentials(){await this.waitForUserSession();try{const e=await this.ensureToken();return(await this.httpClient.get("/session/credentials",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data}catch(e){return null}}async getDevices(){try{const e=await this.ensureToken();return(await this.httpClient.get("/session/devices",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data.devices}catch(e){return[]}}async deleteDevice(e){try{const t=await this.ensureToken();await this.httpClient.delete(`/session/devices/${encodeURIComponent(e)}`,this.enableCredentials,{Authorization:t&&`Bearer ${t}`})}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to delete device",error:e}),e}}async openUserConfigurationScreen(e={redirectUrl:null,startPage:"Profile"}){if(!await this.userSessionExists()){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}const t=new URL("/settings",this.hostUrl);t.searchParams.set("client_id",this.applicationId),t.searchParams.set("start_page",e&&e.startPage||"Profile"),t.searchParams.set("redirect_uri",e&&e.redirectUrl||i.getCurrentLocation().href),i.assign(t.toString()),await Promise.resolve()}async registerDevice(e={name:"",type:"",totp:{}}){const t=await this.getUserIdentity();if(!t){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}if(!e){const e=Error("Register Device missing required parameter: 'Options'");throw e.code="InvalidInput",e}let n;if(e.type&&"WebAuthN"!==e.type)"TOTP"===e.type&&(n={name:e.name,code:e.totp.verificationCode,totpData:e.totp,type:"TOTP"});else{const r=t.sub,o={challenge:Uint8Array.from(r,(e=>e.charCodeAt(0))),rp:{id:this.hostUrl.split(".").slice(1).join("."),name:"WebAuthN Login"},user:{id:Uint8Array.from(r,(e=>e.charCodeAt(0))),name:r,displayName:`Generated User ID: ${r}`},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],authenticatorSelection:{residentKey:"discouraged",requireResidentKey:!1,userVerification:"discouraged"},timeout:6e4,attestation:"direct"},i=await navigator.credentials.create({publicKey:o}),a={authenticatorAttachment:i.authenticatorAttachment,credentialId:i.id,type:i.type,userId:r,attestation:btoa(String.fromCharCode(...new Uint8Array(i.response.attestationObject))),client:btoa(String.fromCharCode(...new Uint8Array(i.response.clientDataJSON)))};n={name:e&&e.name,code:a,type:"WebAuthN"}}try{const e=await this.ensureToken();return(await this.httpClient.post("/session/devices",this.enableCredentials,n,{Authorization:e&&`Bearer ${e}`})).data}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to register new device",error:e,request:n}),e}}async waitForUserSession(){try{return await u,!0}catch(e){return!1}}userSessionExists(e){return h?Date.now()-this.lastSessionCheck<50?h:(this.lastSessionCheck=Date.now(),h=h.catch((()=>{})).then((()=>this.userSessionContinuation(e)))):(this.lastSessionCheck=Date.now(),h=this.userSessionContinuation(e))}async userSessionContinuation(e){const t=new URLSearchParams(i.getCurrentLocation().search);let n={};if("undefined"!=typeof localStorage)try{n=JSON.parse(localStorage.getItem(p)||"{}"),localStorage.removeItem(p),Object.hasOwnProperty.call(n,"enableCredentials")&&(this.enableCredentials=n.enableCredentials)}catch(e){this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] LocalStorage failed in Browser",error:e})}if(t.get("state")&&"oauthLogin"===t.get("flow"))return!1;if((n.nonce||t.get("iss")&&t.get("iss").includes(this.hostUrl))&&this.sanitizeQueryParameters(),n.nonce&&t.get("code")&&n.nonce===t.get("nonce")){const e="cookie"===t.get("code")?r.parse(document.cookie)["auth-code"]:t.get("code"),o=await s.calculateAntiAbuseHash({client_id:this.applicationId,authenticationRequestId:n.nonce,code:e}),i={grant_type:"authorization_code",redirect_uri:n.redirectUrl,client_id:this.applicationId,code:e,code_verifier:n.codeVerifier,antiAbuseHash:o};try{const e=await this.httpClient.post(`/authentication/${n.nonce}/tokens`,this.enableCredentials,i),t=s.decode(e.data.id_token),o=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);return document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:o,path:"/",sameSite:"strict"}),d.set(e.data.id_token,o),l(),!0}catch(e){if(this.logger&&this.logger.log({title:"[Authress Login SDK] Failed exchange authentication response for a token.",error:e}),e.data&&"invalid_request"===e.data.error)return!1;throw e.data||e}}if(i.isLocalHost()&&t.get("nonce")&&t.get("access_token")&&(!n.nonce||n.nonce===t.get("nonce"))){const e=s.decode(t.get("id_token")),n=e.exp&&new Date(1e3*e.exp)||Number(t.get("expires_in"))&&new Date(Date.now()+1e3*Number(t.get("expires_in")));return document.cookie=r.serialize("authorization",t.get("access_token")||"",{expires:n,path:"/",sameSite:"strict"}),d.set(t.get("id_token"),n),l(),!0}if(this.getUserIdentity())return l(),!0;if(!i.isLocalHost()&&!e){try{const e=await this.httpClient.patch("/session",this.enableCredentials,{},null,!0);if(e.data.access_token){const t=s.decode(e.data.id_token),n=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:n,path:"/",sameSite:"strict"}),d.set(e.data.id_token,n)}}catch(e){400===e.status||404===e.status||409===e.status?this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] User does not have an existing authentication session",error:e}):this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed attempting to check if the user has an existing authentication session",error:e})}if(this.getUserIdentity())return l(),!0}return!1}async updateExtensionAuthenticationRequest({state:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r}){if(!t&&!n){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}const o=new URLSearchParams(i.getCurrentLocation().search),a=e||o.get("state");if(!a){const e=Error("The `state` parameters must be specified to update this authentication request");throw e.code="InvalidAuthenticationRequest",e}try{const e=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,authenticationRequestId:a}),o=await this.httpClient.patch(`/authentication/${a}`,!0,{antiAbuseHash:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r});if(new URL(o.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:o.data.authenticationUrl};i.assign(o.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to update extension authentication request",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async unlinkIdentity(e){if(!e){const e=Error("connectionId must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged in to unlink an account.");throw e.code="NotLoggedIn",e}let t;try{t=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const n=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${t}`};try{await this.httpClient.delete(`/identities/${encodeURIComponent(e)}`,this.enableCredentials,n)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to unlink user identity",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}}async linkIdentity({connectionId:e,tenantLookupIdentifier:t,redirectUrl:n,connectionProperties:r}){if(!e&&!t){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}let o;try{o=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const{codeChallenge:a}=await s.getAuthCodes(),c=await s.calculateAntiAbuseHash({connectionId:e,tenantLookupIdentifier:t,applicationId:this.applicationId});try{const s=n&&new URL(n).toString()||i.getCurrentLocation().href,d=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${o}`},l=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:c,linkIdentity:!0,redirectUrl:s,codeChallengeMethod:"S256",codeChallenge:a,connectionId:e,tenantLookupIdentifier:t,connectionProperties:r,applicationId:this.applicationId},d);i.assign(l.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start user identity link",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e}await new Promise((e=>setTimeout(e,5e3)))}async authenticate(e={}){const{connectionId:t,tenantLookupIdentifier:n,inviteId:r,redirectUrl:o,force:a,responseLocation:c,flowType:l,connectionProperties:u,openType:h,multiAccount:f,clearUserDataBeforeLogin:g}=e||{};if(c&&"cookie"!==c&&"query"!==c&&"none"!==c){const e=Error("Authentication response location is not valid");throw e.code="InvalidResponseLocation",e}if(!r&&!a&&!f&&await this.userSessionExists()){const n=await this.ensureToken(),r=s.decode(n);if(t&&r&&r.azp&&t!==r.azp){this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Authentication blocked because the user is already logged in, and the requested authentication parameters do not match the original session.",requestedAuthenticationOptions:e,currentAuthenticationSessionData:r});const t=Error('Authentication requested for user that is already logged in, but the connectionId specified does not match their existing session.\n        Recommended Options:\n          (1) If the goal is to force them to log in with this new connection and ignore their existing session, use the "force" flag.\n          (2) If the goal is link their current identity with a new from the new connection, use the linkIdentity() method.\n          (3) If the goal is skip log in if they are already logged in or force log in with the connectionId, first check if userSessionExists() and then only if "false", call authenticate().');throw t.code="AuthenticationConstraintContention",t}return null}const{codeVerifier:m,codeChallenge:w}=await s.getAuthCodes(),y=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,inviteId:r,applicationId:this.applicationId});try{const e=o&&new URL(o).toString()||i.getCurrentLocation().href;!1!==g&&d.clear();const a=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:y,redirectUrl:e,codeChallengeMethod:"S256",codeChallenge:w,connectionId:t,tenantLookupIdentifier:n,inviteId:r,connectionProperties:u,applicationId:this.applicationId,responseLocation:c,flowType:l,multiAccount:f});if(localStorage.setItem(p,JSON.stringify({nonce:a.data.authenticationRequestId,codeVerifier:m,lastConnectionId:t,tenantLookupIdentifier:n,redirectUrl:e,enableCredentials:a.data.enableCredentials,multiAccount:f})),new URL(a.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:a.data.authenticationUrl};if("tab"===h){const e=i.open(a.data.authenticationUrl,"_blank");e&&!e.closed&&void 0!==e.closed||i.assign(a.data.authenticationUrl)}else i.assign(a.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start authentication for user",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async ensureToken(e){if(e&&0===e.timeoutInMillis){const e=this.getUserIdentity(),t=r.parse(document.cookie);if(e)return"undefined"!==t.authorization&&t.authorization;const n=Error("No token retrieved after timeout");throw n.code="TokenTimeout",n}await this.userSessionExists();const t=Object.assign({timeoutInMillis:5e3},e||{}),n=this.waitForUserSession(),o=-1===t.timeoutInMillis||t.timeoutInMillis>2**31-1?2**31-1:t.timeoutInMillis,i=new Promise(((e,t)=>setTimeout(t,o||0)));try{await Promise.race([n,i])}catch(e){const t=Error("No token retrieved after timeout");throw t.code="TokenTimeout",t}const a=r.parse(document.cookie);return"undefined"!==a.authorization&&a.authorization}async logout(e){let t;if(e)try{new URL(e),t=e}catch(n){try{t=new URL(e,i.getCurrentLocation().href).toString()}catch(t){const n=Error(`The logout redirect url is not valid URL: ${e}`);throw n.code="InvalidRedirectUrl",n}}if(d.clear(),this.sanitizeQueryParameters(),u=new Promise((e=>l=e)),this.enableCredentials)try{return await this.httpClient.delete("/session",this.enableCredentials),this.lastSessionCheck=0,void(e&&e!==i.getCurrentLocation().href&&i.assign(e))}catch(e){}const n=new URL("/logout",this.hostUrl);n.searchParams.set("redirect_uri",t||i.getCurrentLocation().href),n.searchParams.set("client_id",this.applicationId),i.assign(n.toString()),this.lastSessionCheck=0,await new Promise((e=>setTimeout(e,500)))}sanitizeQueryParameters(){const e=new URL(i.getCurrentLocation());e.searchParams.delete("iss"),e.searchParams.delete("nonce"),e.searchParams.delete("code"),e.searchParams.delete("expires_in"),e.searchParams.delete("access_token"),e.searchParams.delete("id_token"),history.replaceState({},void 0,e.toString())}},ExtensionClient:f,UserConfigurationScreen:{Profile:"Profile",MFA:"MFA"}}},427:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||l,a=0,s=0,h=0;do{if(-1===(s=e.indexOf("=",a)))break;if(-1===(h=e.indexOf(";",a)))h=o;else if(s>h){a=e.lastIndexOf(";",s-1)+1;continue}var p=c(e,a,s),f=d(e,s,p),g=e.slice(p,f);if(!r.call(n,g)){var m=c(e,s+1,h),w=d(e,h,m);34===e.charCodeAt(m)&&34===e.charCodeAt(w-1)&&(m++,w--);var y=e.slice(m,w);n[g]=u(y,i)}a=h+1}while(a<o);return n},t.serialize=function(e,t,r){var c=r&&r.encode||encodeURIComponent;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var d=c(t);if(!i.test(d))throw new TypeError("argument val is invalid");var l=e+"="+d;if(!r)return l;if(null!=r.maxAge){var u=Math.floor(r.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+u}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){var h=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(h)||isNaN(h.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+h.toUTCString()}r.httpOnly&&(l+="; HttpOnly");r.secure&&(l+="; Secure");r.partitioned&&(l+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/;function c(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function d(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function u(e,t){try{return t(e)}catch(t){return e}}},568:(e,t,n)=>{const r=n(836),{sanitizeUrl:o}=n(332),i=n(629),a="ExtensionRequestNonce";let s=null;e.exports=class{constructor(e,t){if(this.extensionId=t,!e)throw Error('Missing required property "authressCustomDomain" in ExtensionClient constructor. The Custom Authress Domain Host is required.');if(!t)throw Error('Missing required property "extensionId" in ExtensionClient constructor. The extension is required for selecting the correct login method.');this.authressCustomDomain=o(e),this.accessToken=null,i.onLoad((async()=>{await this.requestToken({silent:!0})}))}async getUserIdentity(){const e=this.accessToken&&await r.decode(this.accessToken);return e?1e3*e.exp<Date.now()?(this.accessToken=null,null):e:null}async getTokenResponse(){return await this.getUserIdentity()?{accessToken:this.accessToken}:null}requestToken(e={code:null,silent:!1}){if(s)return s=s.catch((()=>{})).then((()=>this.requestTokenContinuation(e)));const t=this.requestTokenContinuation(e);return t.catch((()=>{})),s=t}async requestTokenContinuation(e={code:null,silent:!1}){const t=e&&e.code||new URLSearchParams(i.getCurrentLocation().search).get("code");if(!t){if(!e||!e.silent){const e=Error("OAuth Authorization code is required");throw e.code="InvalidAuthorizationCode",e}return this.getTokenResponse()}const n=new URL(this.authressCustomDomain);n.pathname="/api/authentication/oauth/tokens";const{codeVerifier:r,redirectUrl:o}=JSON.parse(localStorage.getItem(a)||"{}"),s=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code_verifier:r,code:t,grant_type:"authorization_code",client_id:this.extensionId,redirect_uri:o})}),c=await s.json();this.accessToken=c.access_token;const d=new URL(i.getCurrentLocation());return d.searchParams.delete("code"),d.searchParams.delete("iss"),d.searchParams.delete("nonce"),d.searchParams.delete("expires_in"),d.searchParams.delete("access_token"),d.searchParams.delete("id_token"),history.replaceState({},void 0,d.toString()),this.getTokenResponse()}async login(e){const t=await this.getTokenResponse();if(t)return t;const n=await this.requestToken({silent:!0});if(n)return n;const o=new URL(this.authressCustomDomain),{codeVerifier:s,codeChallenge:c}=r.getAuthCodes(),d=e||i.getCurrentLocation().href;return localStorage.setItem(a,JSON.stringify({codeVerifier:s,redirectUrl:d})),o.searchParams.set("client_id",this.extensionId),o.searchParams.set("code_challenge",c),o.searchParams.set("code_challenge_method","S256"),o.searchParams.set("redirect_uri",d),i.assign(o.toString()),await new Promise((e=>setTimeout(e,5e3))),null}}},629:e=>{e.exports=new class{onLoad(e){"undefined"!=typeof window&&(window.onload=e)}isLocalHost(){return"undefined"!=typeof window&&window.location&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)}getCurrentLocation(){return"undefined"!=typeof window&&new URL(window.location)||new URL("http://localhost:8080")}assign(e){return"undefined"==typeof window?null:window.location.assign(e.toString())}open(e){return"undefined"==typeof window?null:window.open(e.toString())}}},836:(e,t,n)=>{const r=n(878);e.exports=new class{decode(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[1]));return t.exp&&(t.exp=t.exp-10),t}catch(e){return null}}decodeOrParse(e){if(!e)return null;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(t){return this.decode(e)}}decodeFull(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[0])),n=JSON.parse(r.decode(e.split(".")[1]));return n.exp&&(n.exp=n.exp-10),{header:t,payload:n}}catch(e){return null}}async getAuthCodes(){const e=r.encode((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(16)).toString()),t=await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(e));return{codeVerifier:e,codeChallenge:r.encode(t)}}async calculateAntiAbuseHash(e){const t=Date.now(),n=Object.values(e).filter((e=>e)).join("|");let o=0,i=null;for(;++o&&(i=r.encode(await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(`${t};${o};${n}`))),!i.match(/^00/)););return`v2;${t};${o};${i}`}}},878:e=>{function t(e){return String.fromCharCode(parseInt(e.slice(1),16))}function n(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}e.exports.decode=function(e){return function(e){return decodeURIComponent(Array.from(atob(e),n).join(""))}(e.replace(/-/g,"+").replace(/_/g,"/"))},e.exports.encode=function(e){return e&&"object"==typeof e?btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,""):function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,t))}(e).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}}},r={};function o(e){var t=r[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var i=r[e]={exports:{}};try{var a={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(a)})),i=a.module,a.factory.call(i.exports,i,i.exports,a.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=r,o.i=[],o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"3727d279383e9571121c",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="authress:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[r];var h=(t,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},(()=>{var e,t,n,r={},i=o.c,a=[],s=[],c="idle",d=0,l=[];function u(e){c=e;for(var t=[],n=0;n<s.length;n++)t[n]=s[n].call(null,e);return Promise.all(t).then((function(){}))}function h(){0==--d&&u("ready").then((function(){if(0===d){var e=l;l=[];for(var t=0;t<e.length;t++)e[t]()}}))}function p(e){if("idle"!==c)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(n){return n?u("prepare").then((function(){var r=[];return t=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,i){return o.hmrC[i](n.c,n.r,n.m,e,t,r),e}),[])).then((function(){return t=function(){return e?g(e):u("ready").then((function(){return r}))},0===d?t():new Promise((function(e){l.push((function(){e(t())}))}));var t}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function f(e){return"ready"!==c?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status (state: "+c+")")})):g(e)}function g(e){e=e||{},m();var r=t.map((function(t){return t(e)}));t=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var a,s=u("apply"),c=function(e){a||(a=e)},d=[];return r.forEach((function(e){if(e.apply){var t=e.apply(c);if(t)for(var n=0;n<t.length;n++)d.push(t[n])}})),Promise.all([i,s]).then((function(){return a?u("fail").then((function(){throw a})):n?g(e).then((function(e){return d.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e})):u("idle").then((function(){return d}))}))}function m(){if(n)return t||(t=[]),Object.keys(o.hmrI).forEach((function(e){n.forEach((function(n){o.hmrI[e](n,t)}))})),n=void 0,!0}o.hmrD=r,o.i.push((function(l){var g,m,w,y,v=l.module,k=function(t,n){var r=i[n];if(!r)return t;var o=function(o){if(r.hot.active){if(i[o]){var s=i[o].parents;-1===s.indexOf(n)&&s.push(n)}else a=[n],e=o;-1===r.children.indexOf(o)&&r.children.push(o)}else console.warn("[HMR] unexpected require("+o+") from disposed module "+n),a=[];return t(o)},s=function(e){return{configurable:!0,enumerable:!0,get:function(){return t[e]},set:function(n){t[e]=n}}};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&"e"!==l&&Object.defineProperty(o,l,s(l));return o.e=function(e,n){return function(e){switch(c){case"ready":u("prepare");case"prepare":return d++,e.then(h,h),e;default:return e}}(t.e(e,n))},o}(l.require,l.id);v.hot=(g=l.id,m=v,y={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:w=e!==g,_requireSelf:function(){a=m.parents.slice(),e=w?void 0:g,o(g)},active:!0,accept:function(e,t,n){if(void 0===e)y._selfAccepted=!0;else if("function"==typeof e)y._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)y._acceptedDependencies[e[r]]=t||function(){},y._acceptedErrorHandlers[e[r]]=n;else y._acceptedDependencies[e]=t||function(){},y._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)y._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)y._declinedDependencies[e[t]]=!0;else y._declinedDependencies[e]=!0},dispose:function(e){y._disposeHandlers.push(e)},addDisposeHandler:function(e){y._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=y._disposeHandlers.indexOf(e);t>=0&&y._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,c){case"idle":t=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)}));break;case"prepare":case"check":case"dispose":case"apply":(n=n||[]).push(g)}},check:p,apply:f,status:function(e){if(!e)return c;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:r[g]},e=void 0,y),v.parents=a,v.children=[],a=[],l.require=k})),o.hmrC={},o.hmrI={}})(),o.p="",(()=>{var e,t,n,r,i,a=o.hmrS_jsonp=o.hmrS_jsonp||{792:0},s={};function c(t,n){return e=n,new Promise(((e,n)=>{s[t]=e;var r=o.p+o.hu(t),i=new Error;o.l(r,(e=>{if(s[t]){s[t]=void 0;var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading hot update chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n(i)}}))}))}function d(e){function s(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,s=i.chain,d=o.c[a];if(d&&(!d.hot._selfAccepted||d.hot._selfInvalidated)){if(d.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:a};if(d.hot._main)return{type:"unaccepted",chain:s,moduleId:a};for(var l=0;l<d.parents.length;l++){var u=d.parents[l],h=o.c[u];if(h){if(h.hot._declinedDependencies[a])return{type:"declined",chain:s.concat([u]),moduleId:a,parentId:u};-1===t.indexOf(u)&&(h.hot._acceptedDependencies[a]?(n[u]||(n[u]=[]),c(n[u],[a])):(delete n[u],t.push(u),r.push({chain:s.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}o.f&&delete o.f.jsonpHmr,t=void 0;var d={},l=[],u={},h=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in n)if(o.o(n,p)){var f=n[p],g=f?s(p):{type:"disposed",moduleId:p},m=!1,w=!1,y=!1,v="";switch(g.chain&&(v="\nUpdate propagation: "+g.chain.join(" -> ")),g.type){case"self-declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of self decline: "+g.moduleId+v));break;case"declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of declined dependency: "+g.moduleId+" in "+g.parentId+v));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(g),e.ignoreUnaccepted||(m=new Error("Aborted because "+p+" is not accepted"+v));break;case"accepted":e.onAccepted&&e.onAccepted(g),w=!0;break;case"disposed":e.onDisposed&&e.onDisposed(g),y=!0;break;default:throw new Error("Unexception type "+g.type)}if(m)return{error:m};if(w)for(p in u[p]=f,c(l,g.outdatedModules),g.outdatedDependencies)o.o(g.outdatedDependencies,p)&&(d[p]||(d[p]=[]),c(d[p],g.outdatedDependencies[p]));y&&(c(l,[g.moduleId]),u[p]=h)}n=void 0;for(var k,C=[],b=0;b<l.length;b++){var I=l[b],S=o.c[I];S&&(S.hot._selfAccepted||S.hot._main)&&u[I]!==h&&!S.hot._selfInvalidated&&C.push({module:I,require:S.hot._requireSelf,errorHandler:S.hot._selfAccepted})}return{dispose:function(){var e;r.forEach((function(e){delete a[e]})),r=void 0;for(var t,n=l.slice();n.length>0;){var i=n.pop(),s=o.c[i];if(s){var c={},u=s.hot._disposeHandlers;for(b=0;b<u.length;b++)u[b].call(null,c);for(o.hmrD[i]=c,s.hot.active=!1,delete o.c[i],delete d[i],b=0;b<s.children.length;b++){var h=o.c[s.children[b]];h&&((e=h.parents.indexOf(i))>=0&&h.parents.splice(e,1))}}}for(var p in d)if(o.o(d,p)&&(s=o.c[p]))for(k=d[p],b=0;b<k.length;b++)t=k[b],(e=s.children.indexOf(t))>=0&&s.children.splice(e,1)},apply:function(t){for(var n in u)o.o(u,n)&&(o.m[n]=u[n]);for(var r=0;r<i.length;r++)i[r](o);for(var a in d)if(o.o(d,a)){var s=o.c[a];if(s){k=d[a];for(var c=[],h=[],p=[],f=0;f<k.length;f++){var g=k[f],m=s.hot._acceptedDependencies[g],w=s.hot._acceptedErrorHandlers[g];if(m){if(-1!==c.indexOf(m))continue;c.push(m),h.push(w),p.push(g)}}for(var y=0;y<c.length;y++)try{c[y].call(null,k)}catch(n){if("function"==typeof h[y])try{h[y](n,{moduleId:a,dependencyId:p[y]})}catch(r){e.onErrored&&e.onErrored({type:"accept-error-handler-errored",moduleId:a,dependencyId:p[y],error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"accept-errored",moduleId:a,dependencyId:p[y],error:n}),e.ignoreErrored||t(n)}}}for(var v=0;v<C.length;v++){var b=C[v],I=b.module;try{b.require(I)}catch(n){if("function"==typeof b.errorHandler)try{b.errorHandler(n,{moduleId:I,module:o.c[I]})}catch(r){e.onErrored&&e.onErrored({type:"self-accept-error-handler-errored",moduleId:I,error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"self-accept-errored",moduleId:I,error:n}),e.ignoreErrored||t(n)}}return l}}}this.webpackHotUpdateauthress=(t,r,a)=>{for(var c in r)o.o(r,c)&&(n[c]=r[c],e&&e.push(c));a&&i.push(a),s[t]&&(s[t](),s[t]=void 0)},o.hmrI.jsonp=function(e,t){n||(n={},i=[],r=[],t.push(d)),o.o(n,e)||(n[e]=o.m[e])},o.hmrC.jsonp=function(e,s,l,u,h,p){h.push(d),t={},r=s,n=l.reduce((function(e,t){return e[t]=!1,e}),{}),i=[],e.forEach((function(e){o.o(a,e)&&void 0!==a[e]?(u.push(c(e,p)),t[e]=!0):t[e]=!1})),o.f&&(o.f.jsonpHmr=function(e,n){t&&o.o(t,e)&&!t[e]&&(n.push(c(e)),t[e]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(354)})()));
  • authress/tags/0.2.100/templates/authress-login-form.php

    r3103661 r3264076  
    2121        const authressLoginHostUrl = "<?php echo esc_attr($authress_options->get('customDomain')); ?>";
    2222        const applicationId = "<?php echo esc_attr($authress_options->get('applicationId')); ?>";
    23         const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId });
     23        const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId, retainUserCookie: true });
    2424       
    2525        // const redirectUrl = 'http://localhost:8081';
     
    5656        const authressLoginHostUrl = "<?php echo esc_attr($authress_options->get('customDomain')); ?>";
    5757        const applicationId = "<?php echo esc_attr($authress_options->get('applicationId')); ?>";
    58         const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId });
     58        const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId, retainUserCookie: true });
    5959        const currentUrl = new URL(window.location.href);
    6060        const redirectUrl = currentUrl.searchParams.get('redirect_to') ? decodeURIComponent(currentUrl.searchParams.get('redirect_to')) : window.location.origin;
  • authress/tags/0.2.100/vendor/autoload.php

    r3263764 r3264076  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee::getLoader();
     7return ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be::getLoader();
  • authress/tags/0.2.100/vendor/composer/InstalledVersions.php

    r3263764 r3264076  
    3131    array (
    3232    ),
    33     'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     33    'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    3434    'name' => 'authress/wordpress-plugin.php',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     45      'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    4646    ),
    4747    'codercat/jwk-to-pem' =>
  • authress/tags/0.2.100/vendor/composer/autoload_real.php

    r3263764 r3264076  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee
     5class ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInitc27caacadade3b37e1575eb21199faee::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInitc27caacadade3b37e1575eb21199faee::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequirec27caacadade3b37e1575eb21199faee($fileIdentifier, $file);
     61            composerRequire0afc4f4830b212e88cd7a189750a61be($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequirec27caacadade3b37e1575eb21199faee($fileIdentifier, $file)
     68function composerRequire0afc4f4830b212e88cd7a189750a61be($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • authress/tags/0.2.100/vendor/composer/autoload_static.php

    r3263764 r3264076  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc27caacadade3b37e1575eb21199faee
     7class ComposerStaticInit0afc4f4830b212e88cd7a189750a61be
    88{
    99    public static $files = array (
     
    658658    {
    659659        return \Closure::bind(function () use ($loader) {
    660             $loader->prefixLengthsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$prefixLengthsPsr4;
    661             $loader->prefixDirsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$prefixDirsPsr4;
    662             $loader->fallbackDirsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$fallbackDirsPsr4;
    663             $loader->classMap = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$classMap;
     660            $loader->prefixLengthsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$prefixLengthsPsr4;
     661            $loader->prefixDirsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$prefixDirsPsr4;
     662            $loader->fallbackDirsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$fallbackDirsPsr4;
     663            $loader->classMap = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$classMap;
    664664
    665665        }, null, ClassLoader::class);
  • authress/tags/0.2.100/vendor/composer/installed.php

    r3263764 r3264076  
    77    array (
    88    ),
    9     'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     9    'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    1010    'name' => 'authress/wordpress-plugin.php',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     21      'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    2222    ),
    2323    'codercat/jwk-to-pem' =>
  • authress/tags/0.2.100/wordpress/readme.txt

    r3263764 r3264076  
    55Requires PHP: 8.2
    66Tested up to: 6.6
    7 Stable tag: 0.2.99
     7Stable tag: 0.2.100
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
  • authress/trunk/Authress_Sso_Login.php

    r3263764 r3264076  
    44    Plugin URI:   https://wordpress.org/plugins/authress
    55    Description:  Upgrades the WordPress login to support SSO Login.
    6     Version:      0.2.99
     6    Version:      0.2.100
    77    Author:       Authress
    88    Author URI:   https://authress.io
     
    1111*/
    1212
    13 define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.99' );
     13define( 'AUTHRESS_SSO_LOGIN_VERSION', '0.2.100' );
    1414
    1515define( 'AUTHRESS_SSO_LOGIN_PLUGIN_FILE', __FILE__ );
  • authress/trunk/readme.txt

    r3263764 r3264076  
    55Requires PHP: 8.2
    66Tested up to: 6.6
    7 Stable tag: 0.2.99
     7Stable tag: 0.2.100
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
  • authress/trunk/templates/assets/js/authress-login-sdk.min.js

    r3263764 r3264076  
    1 /*! Authress Login SDK 2.5.361 | Author - Authress Developers | License information can be found at https://github.com/Authress/login-sdk.js */
    2 !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.authress=t():e.authress=t()}(this,(()=>(()=>{var e,t,n={75:(e,t,n)=>{const{sanitizeUrl:r}=n(332),o=n(629),i={"Content-Type":"application/json","X-Powered-By":`Authress Login SDK; Javascript; ${n(330).version}`},a=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","Load failed","<HTML DOCUMENT></HTML>"]);function s(e){return"Network Error"===e.message||"ERR_NETWORK"===e.code||!e.status||e.status>=500||"string"==typeof e.message&&a.has(e.message)||"string"==typeof e.data&&a.has(e.data)}async function c(e){let t=null;for(let n=0;n<5;n++)try{return await e()}catch(e){if(e.retryCount=n,!s(e))throw e;t=e,t.isNetworkError=!0,await new Promise((e=>setTimeout(e,10*2**n)));continue}const n=new Error("[Authress Login SDK] Http Request failed due to a Network Error even after multiple retries",{cause:t});throw n.code="AuthressSdkNetworkError",n}e.exports=class{constructor(e,t){if(!e)throw Error("Custom Authress Domain Host is required");const n=t||{debug(){},warn(){},critical(){}};this.logger=n;const o=new URL(r(e));this.loginUrl=`${o.origin}/api`}get(e,t,n,r){return c((()=>this.fetchWrapper("GET",e,null,n,t,r)))}delete(e,t,n,r){return c((()=>this.fetchWrapper("DELETE",e,null,n,t,r)))}post(e,t,n,r,o){return c((()=>this.fetchWrapper("POST",e,n,r,t,o)))}put(e,t,n,r,o){return c((()=>this.fetchWrapper("PUT",e,n,r,t,o)))}patch(e,t,n,r,o){return c((()=>this.fetchWrapper("PATCH",e,n,r,t,o)))}async fetchWrapper(e,t,n,r,a,s){const c=`${this.loginUrl}${t.toString()}`,d=e.toUpperCase(),l=Object.assign({},i,r);try{this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] HttpClient Request",method:d,url:c});const e={method:d,headers:l};n&&(e.body=JSON.stringify(n)),!o.isLocalHost()&&a&&(e.credentials="include");const t=await fetch(c,e);if(!t.ok)throw t;let r={};try{r=await t.text(),r=JSON.parse(r)}catch(e){}return{url:c,method:d,headers:t.headers,status:t.status,data:r}}catch(e){let t=e;try{t=await e.text(),t=JSON.parse(t)}catch(e){}const r=t.stack&&t.stack.match(/chrome-extension:[/][/](\w+)[/]/);if(r){this.logger&&this.logger.debug&&this.logger.debug({title:`[Authress Login SDK] Fetch failed due to a browser extension - ${d} - ${c}`,method:d,url:c,data:n,headers:l,error:e,resolvedError:t,extensionErrorId:r});const o=new Error(`Extension Error ID: ${r}`);throw o.code="BROWSER_EXTENSION_ERROR",o}const o=e.status;let i="warn",a="[Authress Login SDK] HttpClient Response Error";e?401===o?(a="[Authress Login SDK] HttpClient Response Error due to invalid token",i="debug"):404===o?(a="[Authress Login SDK] HttpClient Response: Not Found",i="debug"):o<500&&s&&(i="debug"):a="[Authress Login SDK] HttpClient Response Error - Unknown error occurred",this.logger&&this.logger[i]&&this.logger[i]({title:a,online:"undefined"==typeof navigator||navigator.onLine,method:d,url:c,status:o,data:n,headers:l,error:e,resolvedError:t});throw{url:c,method:d,status:o,data:t,headers:e.headers}}}}},160:(e,t,n)=>{const r=n(427),o="AuthenticationCredentialsStorage";e.exports=new class{getUserCookie(){if("undefined"==typeof window||"undefined"==typeof document)return null;return document.cookie.split(";").filter((e=>"user"===e.split("=")[0].trim())).map((e=>e.replace(/^user=/,""))).find((e=>e&&e.trim()))||null}set(e,t){if("undefined"!=typeof window&&"undefined"!=typeof document)try{const n=r.parse(document.cookie);localStorage.setItem(o,JSON.stringify({idToken:e,expiry:t&&t.getTime(),jsCookies:!!n.authorization})),this.clearCookies("user")}catch(e){console.debug("LocalStorage failed in Browser",e)}}get(){if("undefined"==typeof window||"undefined"==typeof document)return null;let e={};try{e=r.parse(document.cookie)}catch(e){console.debug("CookieManagement failed in Browser",e)}try{const{idToken:t,expiry:n,jsCookies:r}=JSON.parse(localStorage.getItem(o)||"{}");return t?n<Date.now()||r&&!e.authorization?null:t:this.getUserCookie()}catch(e){return console.debug("LocalStorage failed in Browser",e),this.getUserCookie()}}delete(){try{localStorage.removeItem(o)}catch(e){console.debug("LocalStorage failed in Browser",e)}try{this.clearCookies("user")}catch(e){console.debug("CookieManagement failed in Browser",e)}}clear(){this.clearCookies(),this.delete()}clearCookies(e){if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.cookie.split("; ");for(const n of t){if(!["user","authorization","auth-code","AuthUserId"].includes(n.split("=")[0])||e&&n.split("=")[0]!==e)continue;const t=window.location.hostname.split("."),r=[...Array(t.length-1)].map(((e,n)=>t.reverse().slice(0,n+2).reverse().join("."))).map((e=>[e,`.${e}`])).flat(1).concat(null);"localhost"===window.location.hostname&&r.push("localhost");for(const e of r){const t=e?`domain=${e};`:"",r=`${encodeURIComponent(n.split(";")[0].split("=")[0])}=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ${t} SameSite=Strict; path=`;document.cookie=`${r}/`;const o=location.pathname.split("/");for(;o.length>0;)document.cookie=r+o.join("/"),o.pop()}}}}},321:e=>{var t=1/0,n=17976931348623157e292,r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e,h,p){return e&&e.length?function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,0,(h=p||void 0===h?1:(f=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&l.call(e)==o}(e))return r;if(u(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):a.test(e)?r:+e}(e))===t||e===-1/0?(e<0?-1:1)*n:e==e?e:0:0===e?e:0}(h),g=f%1,f==f?g?f-g:f:0))<0?0:h):[];var f,g}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"@authress/login","version":"2.5.361","description":"Universal login sdk for Authress authentication as a service. Provides managed authentication for user identity, authentication, and token verification.","main":"./src/index.js","types":"./index.d.ts","files":["index.d.ts","src","dist"],"scripts":{"build":"node make.js build && NODE_ENV=production webpack --mode=production","lint":"eslint --ext .js,.ts src tests make.js index.d.ts","test":"check-dts index.d.ts && mocha tests/*.test.js tests/**/*.test.js -R spec"},"dependencies":{"cookie":"<1","lodash.take":"^4.1.1"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@types/node":"^14.14.35","@typescript-eslint/eslint-plugin":"^3.1.0","@typescript-eslint/parser":"^3.1.0","babel-loader":"^8.2.3","chai":"^4.2.0","check-dts":"^0.4.4","ci-build-tools":"^1.0.13","commander":"^4.0.1","compression-webpack-plugin":"^9.2.0","eslint":"^7.12.1","eslint-config-cimpress-atsquad":"^1.0.67","eslint-loader":"^4.0.2","eslint-plugin-mocha":"^7.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","fs-extra":"^8.1.0","glob":"^7.1.6","mocha":"^11.1.0","path-browserify":"^1.0.1","sinon":"^7.5.0","sinon-chai":"^3.3.0","terser-webpack-plugin":"^5.3.1","typescript":"^3.9.5","webpack":"^5.69.1","webpack-cli":"^4.9.2"},"repository":{"type":"git","url":"git+https://github.com/Authress/authress-login.js"},"keywords":["authentication","authentication as a service","Login","Login Client","universal login","auth","federated login","secure login","application security","IDaaS","authentication","user authentication","user identity","Oauth2","Oauth2.1","Oauth3","platform","platform login","extension","Authress","Authress client","user security","DBSC","Device Bound Session Credentials"],"author":"Authress Developers <[email protected]> (https://authress.io)","license":"Apache-2.0","bugs":{"url":"https://github.com/Authress/authress-login.js/issues"},"homepage":"https://authress.io","engines":{"node":">=18"}}')},332:e=>{e.exports.sanitizeUrl=function(e){let t=e;t.startsWith("http")||(t=`https://${t}`);const n=new URL(t),r=n.host.match(/^([a-z0-9-]+)[.][a-z0-9-]+[.]authress[.]io$/);return r&&(n.host=`${r[1]}.login.authress.io`,t=n.toString()),t.replace(/[/]+$/,"")}},354:(e,t,n)=>{const r=n(427),o=n(321),i=n(629),a=n(75),s=n(836),{sanitizeUrl:c}=n(332),d=n(160);let l,u=new Promise((e=>l=e)),h=null;const p="AuthenticationRequestNonce";const f=n(568);e.exports={LoginClient:class{constructor(e,t){const n=Object.assign({applicationId:"app_default"},e);this.logger=t||console;const r=n.authressApiUrl||n.authressLoginHostUrl||n.authenticationServiceUrl||"";if(!r)throw Error('Missing required property "authressApiUrl" in LoginClient constructor. Custom Authress Domain Host is required.');if(this.applicationId=n.applicationId,!this.applicationId||this.applicationId.match(/^(sc_|ext_)/)){const e=Error("You have incorrectly specified an Authress Service Client or Extension as the applicationId instead of a valid application. The applicationId is your application that your users will log into, usually hosted on your domain https://example.yourdomain.com. Users cannot log *into* a Service Client, but they can log in *with* one. Users can use a Service Client to log in, by setting the connection ID in the *authenticate({ connectionId })* method to be the Authress Service Client.\n(1) If you are building an Custom Login Portal, then the application ID should correspond to this login portal.\n(2) If you are replacing or extending an Authress connection, then specify the Service Client as the connectionId and the end user application as the applicationId.\n(3) If you are building a platform or plugin marketplace, where users will log into third party extensions or apps, then distribute in your SDK a wrapper for the Authress Extension Client using: import { extensionClient } from '@authress/login' found within this SDK.\n(4) If you aren't sure what to do here to fix the problem, the fastest and usually correct solution is go to https://authress.io/app/#/settings?focus=applications create a new application, specify your site in the application url property and then update the value here.");throw e.code="InvalidApplication",e}this.hostUrl=c(r),this.httpClient=new a(this.hostUrl,t),this.lastSessionCheck=0,this.enableCredentials=this.getMatchingDomainInfo(this.hostUrl),n.skipBackgroundCredentialsCheck||i.onLoad((async()=>{await this.userSessionExists(!0)}))}getMatchingDomainInfo(e){const t=new URL(e);if(i.isLocalHost())return!1;const n=i.getCurrentLocation();if("https:"!==n.protocol)return!1;const r=t.host.toLowerCase().split(".").reverse(),a=n.host.toLowerCase().split(".").reverse();let s=[];for(let e of r){const t=o(a,s.length+1).join(".");if(s.concat(e).join(".")!==t)break;s.push(e)}return s.length===r.length&&s.length===a.length||s.length>1}getUserIdentity(){const e=d.getUserCookie(),t=s.decodeOrParse(e);if(t){const n=t.exp?new Date(1e3*t.exp):new Date(Date.now()+864e5);return d.set(e,n),t.userId=t.sub,t}const n=d.get(),r=s.decodeOrParse(n);if(!r)return null;const o=new URL(r.iss).hostname,i=new URL(this.hostUrl).hostname;return o.endsWith(i)||i.endsWith(o)?(r.userId=r.sub,r):(d.clear(),null)}async getConnectionCredentials(){await this.waitForUserSession();try{const e=await this.ensureToken();return(await this.httpClient.get("/session/credentials",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data}catch(e){return null}}async getDevices(){try{const e=await this.ensureToken();return(await this.httpClient.get("/session/devices",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data.devices}catch(e){return[]}}async deleteDevice(e){try{const t=await this.ensureToken();await this.httpClient.delete(`/session/devices/${encodeURIComponent(e)}`,this.enableCredentials,{Authorization:t&&`Bearer ${t}`})}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to delete device",error:e}),e}}async openUserConfigurationScreen(e={redirectUrl:null,startPage:"Profile"}){if(!await this.userSessionExists()){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}const t=new URL("/settings",this.hostUrl);t.searchParams.set("client_id",this.applicationId),t.searchParams.set("start_page",e&&e.startPage||"Profile"),t.searchParams.set("redirect_uri",e&&e.redirectUrl||i.getCurrentLocation().href),i.assign(t.toString()),await Promise.resolve()}async registerDevice(e={name:"",type:"",totp:{}}){const t=await this.getUserIdentity();if(!t){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}if(!e){const e=Error("Register Device missing required parameter: 'Options'");throw e.code="InvalidInput",e}let n;if(e.type&&"WebAuthN"!==e.type)"TOTP"===e.type&&(n={name:e.name,code:e.totp.verificationCode,totpData:e.totp,type:"TOTP"});else{const r=t.sub,o={challenge:Uint8Array.from(r,(e=>e.charCodeAt(0))),rp:{id:this.hostUrl.split(".").slice(1).join("."),name:"WebAuthN Login"},user:{id:Uint8Array.from(r,(e=>e.charCodeAt(0))),name:r,displayName:`Generated User ID: ${r}`},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],authenticatorSelection:{residentKey:"discouraged",requireResidentKey:!1,userVerification:"discouraged"},timeout:6e4,attestation:"direct"},i=await navigator.credentials.create({publicKey:o}),a={authenticatorAttachment:i.authenticatorAttachment,credentialId:i.id,type:i.type,userId:r,attestation:btoa(String.fromCharCode(...new Uint8Array(i.response.attestationObject))),client:btoa(String.fromCharCode(...new Uint8Array(i.response.clientDataJSON)))};n={name:e&&e.name,code:a,type:"WebAuthN"}}try{const e=await this.ensureToken();return(await this.httpClient.post("/session/devices",this.enableCredentials,n,{Authorization:e&&`Bearer ${e}`})).data}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to register new device",error:e,request:n}),e}}async waitForUserSession(){try{return await u,!0}catch(e){return!1}}userSessionExists(e){return h?Date.now()-this.lastSessionCheck<50?h:(this.lastSessionCheck=Date.now(),h=h.catch((()=>{})).then((()=>this.userSessionContinuation(e)))):(this.lastSessionCheck=Date.now(),h=this.userSessionContinuation(e))}async userSessionContinuation(e){const t=new URLSearchParams(i.getCurrentLocation().search);let n={};if("undefined"!=typeof localStorage)try{n=JSON.parse(localStorage.getItem(p)||"{}"),localStorage.removeItem(p),Object.hasOwnProperty.call(n,"enableCredentials")&&(this.enableCredentials=n.enableCredentials)}catch(e){this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] LocalStorage failed in Browser",error:e})}if(t.get("state")&&"oauthLogin"===t.get("flow"))return!1;if((n.nonce||t.get("iss")&&t.get("iss").includes(this.hostUrl))&&this.sanitizeQueryParameters(),n.nonce&&t.get("code")&&n.nonce===t.get("nonce")){const e="cookie"===t.get("code")?r.parse(document.cookie)["auth-code"]:t.get("code"),o=await s.calculateAntiAbuseHash({client_id:this.applicationId,authenticationRequestId:n.nonce,code:e}),i={grant_type:"authorization_code",redirect_uri:n.redirectUrl,client_id:this.applicationId,code:e,code_verifier:n.codeVerifier,antiAbuseHash:o};try{const e=await this.httpClient.post(`/authentication/${n.nonce}/tokens`,this.enableCredentials,i),t=s.decode(e.data.id_token),o=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);return document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:o,path:"/",sameSite:"strict"}),d.set(e.data.id_token,o),l(),!0}catch(e){if(this.logger&&this.logger.log({title:"[Authress Login SDK] Failed exchange authentication response for a token.",error:e}),e.data&&"invalid_request"===e.data.error)return!1;throw e.data||e}}if(i.isLocalHost()&&t.get("nonce")&&t.get("access_token")&&(!n.nonce||n.nonce===t.get("nonce"))){const e=s.decode(t.get("id_token")),n=e.exp&&new Date(1e3*e.exp)||Number(t.get("expires_in"))&&new Date(Date.now()+1e3*Number(t.get("expires_in")));return document.cookie=r.serialize("authorization",t.get("access_token")||"",{expires:n,path:"/",sameSite:"strict"}),d.set(t.get("id_token"),n),l(),!0}if(this.getUserIdentity())return l(),!0;if(!i.isLocalHost()&&!e){try{const e=await this.httpClient.patch("/session",this.enableCredentials,{},null,!0);if(e.data.access_token){const t=s.decode(e.data.id_token),n=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:n,path:"/",sameSite:"strict"}),d.set(e.data.id_token,n)}}catch(e){400===e.status||404===e.status||409===e.status?this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] User does not have an existing authentication session",error:e}):this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed attempting to check if the user has an existing authentication session",error:e})}if(this.getUserIdentity())return l(),!0}return!1}async updateExtensionAuthenticationRequest({state:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r}){if(!t&&!n){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}const o=new URLSearchParams(i.getCurrentLocation().search),a=e||o.get("state");if(!a){const e=Error("The `state` parameters must be specified to update this authentication request");throw e.code="InvalidAuthenticationRequest",e}try{const e=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,authenticationRequestId:a}),o=await this.httpClient.patch(`/authentication/${a}`,!0,{antiAbuseHash:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r});if(new URL(o.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:o.data.authenticationUrl};i.assign(o.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to update extension authentication request",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async unlinkIdentity(e){if(!e){const e=Error("connectionId must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged in to unlink an account.");throw e.code="NotLoggedIn",e}let t;try{t=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const n=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${t}`};try{await this.httpClient.delete(`/identities/${encodeURIComponent(e)}`,this.enableCredentials,n)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to unlink user identity",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}}async linkIdentity({connectionId:e,tenantLookupIdentifier:t,redirectUrl:n,connectionProperties:r}){if(!e&&!t){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}let o;try{o=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const{codeChallenge:a}=await s.getAuthCodes(),c=await s.calculateAntiAbuseHash({connectionId:e,tenantLookupIdentifier:t,applicationId:this.applicationId});try{const s=n&&new URL(n).toString()||i.getCurrentLocation().href,d=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${o}`},l=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:c,linkIdentity:!0,redirectUrl:s,codeChallengeMethod:"S256",codeChallenge:a,connectionId:e,tenantLookupIdentifier:t,connectionProperties:r,applicationId:this.applicationId},d);i.assign(l.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start user identity link",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e}await new Promise((e=>setTimeout(e,5e3)))}async authenticate(e={}){const{connectionId:t,tenantLookupIdentifier:n,inviteId:r,redirectUrl:o,force:a,responseLocation:c,flowType:l,connectionProperties:u,openType:h,multiAccount:f,clearUserDataBeforeLogin:g}=e||{};if(c&&"cookie"!==c&&"query"!==c&&"none"!==c){const e=Error("Authentication response location is not valid");throw e.code="InvalidResponseLocation",e}if(!r&&!a&&!f&&await this.userSessionExists()){const n=await this.ensureToken(),r=s.decode(n);if(t&&r&&r.azp&&t!==r.azp){this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Authentication blocked because the user is already logged in, and the requested authentication parameters do not match the original session.",requestedAuthenticationOptions:e,currentAuthenticationSessionData:r});const t=Error('Authentication requested for user that is already logged in, but the connectionId specified does not match their existing session.\n        Recommended Options:\n          (1) If the goal is to force them to log in with this new connection and ignore their existing session, use the "force" flag.\n          (2) If the goal is link their current identity with a new from the new connection, use the linkIdentity() method.\n          (3) If the goal is skip log in if they are already logged in or force log in with the connectionId, first check if userSessionExists() and then only if "false", call authenticate().');throw t.code="AuthenticationConstraintContention",t}return null}const{codeVerifier:m,codeChallenge:w}=await s.getAuthCodes(),y=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,inviteId:r,applicationId:this.applicationId});try{const e=o&&new URL(o).toString()||i.getCurrentLocation().href;!1!==g&&d.clear();const a=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:y,redirectUrl:e,codeChallengeMethod:"S256",codeChallenge:w,connectionId:t,tenantLookupIdentifier:n,inviteId:r,connectionProperties:u,applicationId:this.applicationId,responseLocation:c,flowType:l,multiAccount:f});if(localStorage.setItem(p,JSON.stringify({nonce:a.data.authenticationRequestId,codeVerifier:m,lastConnectionId:t,tenantLookupIdentifier:n,redirectUrl:e,enableCredentials:a.data.enableCredentials,multiAccount:f})),new URL(a.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:a.data.authenticationUrl};if("tab"===h){const e=i.open(a.data.authenticationUrl,"_blank");e&&!e.closed&&void 0!==e.closed||i.assign(a.data.authenticationUrl)}else i.assign(a.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start authentication for user",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async ensureToken(e){if(e&&0===e.timeoutInMillis){const e=this.getUserIdentity(),t=r.parse(document.cookie);if(e)return"undefined"!==t.authorization&&t.authorization;const n=Error("No token retrieved after timeout");throw n.code="TokenTimeout",n}await this.userSessionExists();const t=Object.assign({timeoutInMillis:5e3},e||{}),n=this.waitForUserSession(),o=-1===t.timeoutInMillis||t.timeoutInMillis>2**31-1?2**31-1:t.timeoutInMillis,i=new Promise(((e,t)=>setTimeout(t,o||0)));try{await Promise.race([n,i])}catch(e){const t=Error("No token retrieved after timeout");throw t.code="TokenTimeout",t}const a=r.parse(document.cookie);return"undefined"!==a.authorization&&a.authorization}async logout(e){let t;if(e)try{new URL(e),t=e}catch(n){try{t=new URL(e,i.getCurrentLocation().href).toString()}catch(t){const n=Error(`The logout redirect url is not valid URL: ${e}`);throw n.code="InvalidRedirectUrl",n}}if(d.clear(),this.sanitizeQueryParameters(),u=new Promise((e=>l=e)),this.enableCredentials)try{return await this.httpClient.delete("/session",this.enableCredentials),this.lastSessionCheck=0,void(e&&e!==i.getCurrentLocation().href&&i.assign(e))}catch(e){}const n=new URL("/logout",this.hostUrl);n.searchParams.set("redirect_uri",t||i.getCurrentLocation().href),n.searchParams.set("client_id",this.applicationId),i.assign(n.toString()),this.lastSessionCheck=0,await new Promise((e=>setTimeout(e,500)))}sanitizeQueryParameters(){const e=new URL(i.getCurrentLocation());e.searchParams.delete("iss"),e.searchParams.delete("nonce"),e.searchParams.delete("code"),e.searchParams.delete("expires_in"),e.searchParams.delete("access_token"),e.searchParams.delete("id_token"),history.replaceState({},void 0,e.toString())}},ExtensionClient:f,UserConfigurationScreen:{Profile:"Profile",MFA:"MFA"}}},427:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||l,a=0,s=0,h=0;do{if(-1===(s=e.indexOf("=",a)))break;if(-1===(h=e.indexOf(";",a)))h=o;else if(s>h){a=e.lastIndexOf(";",s-1)+1;continue}var p=c(e,a,s),f=d(e,s,p),g=e.slice(p,f);if(!r.call(n,g)){var m=c(e,s+1,h),w=d(e,h,m);34===e.charCodeAt(m)&&34===e.charCodeAt(w-1)&&(m++,w--);var y=e.slice(m,w);n[g]=u(y,i)}a=h+1}while(a<o);return n},t.serialize=function(e,t,r){var c=r&&r.encode||encodeURIComponent;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var d=c(t);if(!i.test(d))throw new TypeError("argument val is invalid");var l=e+"="+d;if(!r)return l;if(null!=r.maxAge){var u=Math.floor(r.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+u}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){var h=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(h)||isNaN(h.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+h.toUTCString()}r.httpOnly&&(l+="; HttpOnly");r.secure&&(l+="; Secure");r.partitioned&&(l+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/;function c(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function d(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function u(e,t){try{return t(e)}catch(t){return e}}},568:(e,t,n)=>{const r=n(836),{sanitizeUrl:o}=n(332),i=n(629),a="ExtensionRequestNonce";let s=null;e.exports=class{constructor(e,t){if(this.extensionId=t,!e)throw Error('Missing required property "authressCustomDomain" in ExtensionClient constructor. The Custom Authress Domain Host is required.');if(!t)throw Error('Missing required property "extensionId" in ExtensionClient constructor. The extension is required for selecting the correct login method.');this.authressCustomDomain=o(e),this.accessToken=null,i.onLoad((async()=>{await this.requestToken({silent:!0})}))}async getUserIdentity(){const e=this.accessToken&&await r.decode(this.accessToken);return e?1e3*e.exp<Date.now()?(this.accessToken=null,null):e:null}async getTokenResponse(){return await this.getUserIdentity()?{accessToken:this.accessToken}:null}requestToken(e={code:null,silent:!1}){if(s)return s=s.catch((()=>{})).then((()=>this.requestTokenContinuation(e)));const t=this.requestTokenContinuation(e);return t.catch((()=>{})),s=t}async requestTokenContinuation(e={code:null,silent:!1}){const t=e&&e.code||new URLSearchParams(i.getCurrentLocation().search).get("code");if(!t){if(!e||!e.silent){const e=Error("OAuth Authorization code is required");throw e.code="InvalidAuthorizationCode",e}return this.getTokenResponse()}const n=new URL(this.authressCustomDomain);n.pathname="/api/authentication/oauth/tokens";const{codeVerifier:r,redirectUrl:o}=JSON.parse(localStorage.getItem(a)||"{}"),s=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code_verifier:r,code:t,grant_type:"authorization_code",client_id:this.extensionId,redirect_uri:o})}),c=await s.json();this.accessToken=c.access_token;const d=new URL(i.getCurrentLocation());return d.searchParams.delete("code"),d.searchParams.delete("iss"),d.searchParams.delete("nonce"),d.searchParams.delete("expires_in"),d.searchParams.delete("access_token"),d.searchParams.delete("id_token"),history.replaceState({},void 0,d.toString()),this.getTokenResponse()}async login(e){const t=await this.getTokenResponse();if(t)return t;const n=await this.requestToken({silent:!0});if(n)return n;const o=new URL(this.authressCustomDomain),{codeVerifier:s,codeChallenge:c}=r.getAuthCodes(),d=e||i.getCurrentLocation().href;return localStorage.setItem(a,JSON.stringify({codeVerifier:s,redirectUrl:d})),o.searchParams.set("client_id",this.extensionId),o.searchParams.set("code_challenge",c),o.searchParams.set("code_challenge_method","S256"),o.searchParams.set("redirect_uri",d),i.assign(o.toString()),await new Promise((e=>setTimeout(e,5e3))),null}}},629:e=>{e.exports=new class{onLoad(e){"undefined"!=typeof window&&(window.onload=e)}isLocalHost(){return"undefined"!=typeof window&&window.location&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)}getCurrentLocation(){return"undefined"!=typeof window&&new URL(window.location)||new URL("http://localhost:8080")}assign(e){return"undefined"==typeof window?null:window.location.assign(e.toString())}open(e){return"undefined"==typeof window?null:window.open(e.toString())}}},836:(e,t,n)=>{const r=n(878);e.exports=new class{decode(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[1]));return t.exp&&(t.exp=t.exp-10),t}catch(e){return null}}decodeOrParse(e){if(!e)return null;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(t){return this.decode(e)}}decodeFull(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[0])),n=JSON.parse(r.decode(e.split(".")[1]));return n.exp&&(n.exp=n.exp-10),{header:t,payload:n}}catch(e){return null}}async getAuthCodes(){const e=r.encode((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(16)).toString()),t=await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(e));return{codeVerifier:e,codeChallenge:r.encode(t)}}async calculateAntiAbuseHash(e){const t=Date.now(),n=Object.values(e).filter((e=>e)).join("|");let o=0,i=null;for(;++o&&(i=r.encode(await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(`${t};${o};${n}`))),!i.match(/^00/)););return`v2;${t};${o};${i}`}}},878:e=>{function t(e){return String.fromCharCode(parseInt(e.slice(1),16))}function n(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}e.exports.decode=function(e){return function(e){return decodeURIComponent(Array.from(atob(e),n).join(""))}(e.replace(/-/g,"+").replace(/_/g,"/"))},e.exports.encode=function(e){return e&&"object"==typeof e?btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,""):function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,t))}(e).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}}},r={};function o(e){var t=r[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var i=r[e]={exports:{}};try{var a={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(a)})),i=a.module,a.factory.call(i.exports,i,i.exports,a.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=r,o.i=[],o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"9847b2de00ec05815eb6",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="authress:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[r];var h=(t,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},(()=>{var e,t,n,r={},i=o.c,a=[],s=[],c="idle",d=0,l=[];function u(e){c=e;for(var t=[],n=0;n<s.length;n++)t[n]=s[n].call(null,e);return Promise.all(t).then((function(){}))}function h(){0==--d&&u("ready").then((function(){if(0===d){var e=l;l=[];for(var t=0;t<e.length;t++)e[t]()}}))}function p(e){if("idle"!==c)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(n){return n?u("prepare").then((function(){var r=[];return t=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,i){return o.hmrC[i](n.c,n.r,n.m,e,t,r),e}),[])).then((function(){return t=function(){return e?g(e):u("ready").then((function(){return r}))},0===d?t():new Promise((function(e){l.push((function(){e(t())}))}));var t}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function f(e){return"ready"!==c?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status (state: "+c+")")})):g(e)}function g(e){e=e||{},m();var r=t.map((function(t){return t(e)}));t=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var a,s=u("apply"),c=function(e){a||(a=e)},d=[];return r.forEach((function(e){if(e.apply){var t=e.apply(c);if(t)for(var n=0;n<t.length;n++)d.push(t[n])}})),Promise.all([i,s]).then((function(){return a?u("fail").then((function(){throw a})):n?g(e).then((function(e){return d.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e})):u("idle").then((function(){return d}))}))}function m(){if(n)return t||(t=[]),Object.keys(o.hmrI).forEach((function(e){n.forEach((function(n){o.hmrI[e](n,t)}))})),n=void 0,!0}o.hmrD=r,o.i.push((function(l){var g,m,w,y,v=l.module,b=function(t,n){var r=i[n];if(!r)return t;var o=function(o){if(r.hot.active){if(i[o]){var s=i[o].parents;-1===s.indexOf(n)&&s.push(n)}else a=[n],e=o;-1===r.children.indexOf(o)&&r.children.push(o)}else console.warn("[HMR] unexpected require("+o+") from disposed module "+n),a=[];return t(o)},s=function(e){return{configurable:!0,enumerable:!0,get:function(){return t[e]},set:function(n){t[e]=n}}};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&"e"!==l&&Object.defineProperty(o,l,s(l));return o.e=function(e,n){return function(e){switch(c){case"ready":u("prepare");case"prepare":return d++,e.then(h,h),e;default:return e}}(t.e(e,n))},o}(l.require,l.id);v.hot=(g=l.id,m=v,y={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:w=e!==g,_requireSelf:function(){a=m.parents.slice(),e=w?void 0:g,o(g)},active:!0,accept:function(e,t,n){if(void 0===e)y._selfAccepted=!0;else if("function"==typeof e)y._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)y._acceptedDependencies[e[r]]=t||function(){},y._acceptedErrorHandlers[e[r]]=n;else y._acceptedDependencies[e]=t||function(){},y._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)y._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)y._declinedDependencies[e[t]]=!0;else y._declinedDependencies[e]=!0},dispose:function(e){y._disposeHandlers.push(e)},addDisposeHandler:function(e){y._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=y._disposeHandlers.indexOf(e);t>=0&&y._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,c){case"idle":t=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)}));break;case"prepare":case"check":case"dispose":case"apply":(n=n||[]).push(g)}},check:p,apply:f,status:function(e){if(!e)return c;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:r[g]},e=void 0,y),v.parents=a,v.children=[],a=[],l.require=b})),o.hmrC={},o.hmrI={}})(),o.p="",(()=>{var e,t,n,r,i,a=o.hmrS_jsonp=o.hmrS_jsonp||{792:0},s={};function c(t,n){return e=n,new Promise(((e,n)=>{s[t]=e;var r=o.p+o.hu(t),i=new Error;o.l(r,(e=>{if(s[t]){s[t]=void 0;var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading hot update chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n(i)}}))}))}function d(e){function s(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,s=i.chain,d=o.c[a];if(d&&(!d.hot._selfAccepted||d.hot._selfInvalidated)){if(d.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:a};if(d.hot._main)return{type:"unaccepted",chain:s,moduleId:a};for(var l=0;l<d.parents.length;l++){var u=d.parents[l],h=o.c[u];if(h){if(h.hot._declinedDependencies[a])return{type:"declined",chain:s.concat([u]),moduleId:a,parentId:u};-1===t.indexOf(u)&&(h.hot._acceptedDependencies[a]?(n[u]||(n[u]=[]),c(n[u],[a])):(delete n[u],t.push(u),r.push({chain:s.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}o.f&&delete o.f.jsonpHmr,t=void 0;var d={},l=[],u={},h=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in n)if(o.o(n,p)){var f=n[p],g=f?s(p):{type:"disposed",moduleId:p},m=!1,w=!1,y=!1,v="";switch(g.chain&&(v="\nUpdate propagation: "+g.chain.join(" -> ")),g.type){case"self-declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of self decline: "+g.moduleId+v));break;case"declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of declined dependency: "+g.moduleId+" in "+g.parentId+v));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(g),e.ignoreUnaccepted||(m=new Error("Aborted because "+p+" is not accepted"+v));break;case"accepted":e.onAccepted&&e.onAccepted(g),w=!0;break;case"disposed":e.onDisposed&&e.onDisposed(g),y=!0;break;default:throw new Error("Unexception type "+g.type)}if(m)return{error:m};if(w)for(p in u[p]=f,c(l,g.outdatedModules),g.outdatedDependencies)o.o(g.outdatedDependencies,p)&&(d[p]||(d[p]=[]),c(d[p],g.outdatedDependencies[p]));y&&(c(l,[g.moduleId]),u[p]=h)}n=void 0;for(var b,k=[],C=0;C<l.length;C++){var I=l[C],S=o.c[I];S&&(S.hot._selfAccepted||S.hot._main)&&u[I]!==h&&!S.hot._selfInvalidated&&k.push({module:I,require:S.hot._requireSelf,errorHandler:S.hot._selfAccepted})}return{dispose:function(){var e;r.forEach((function(e){delete a[e]})),r=void 0;for(var t,n=l.slice();n.length>0;){var i=n.pop(),s=o.c[i];if(s){var c={},u=s.hot._disposeHandlers;for(C=0;C<u.length;C++)u[C].call(null,c);for(o.hmrD[i]=c,s.hot.active=!1,delete o.c[i],delete d[i],C=0;C<s.children.length;C++){var h=o.c[s.children[C]];h&&((e=h.parents.indexOf(i))>=0&&h.parents.splice(e,1))}}}for(var p in d)if(o.o(d,p)&&(s=o.c[p]))for(b=d[p],C=0;C<b.length;C++)t=b[C],(e=s.children.indexOf(t))>=0&&s.children.splice(e,1)},apply:function(t){for(var n in u)o.o(u,n)&&(o.m[n]=u[n]);for(var r=0;r<i.length;r++)i[r](o);for(var a in d)if(o.o(d,a)){var s=o.c[a];if(s){b=d[a];for(var c=[],h=[],p=[],f=0;f<b.length;f++){var g=b[f],m=s.hot._acceptedDependencies[g],w=s.hot._acceptedErrorHandlers[g];if(m){if(-1!==c.indexOf(m))continue;c.push(m),h.push(w),p.push(g)}}for(var y=0;y<c.length;y++)try{c[y].call(null,b)}catch(n){if("function"==typeof h[y])try{h[y](n,{moduleId:a,dependencyId:p[y]})}catch(r){e.onErrored&&e.onErrored({type:"accept-error-handler-errored",moduleId:a,dependencyId:p[y],error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"accept-errored",moduleId:a,dependencyId:p[y],error:n}),e.ignoreErrored||t(n)}}}for(var v=0;v<k.length;v++){var C=k[v],I=C.module;try{C.require(I)}catch(n){if("function"==typeof C.errorHandler)try{C.errorHandler(n,{moduleId:I,module:o.c[I]})}catch(r){e.onErrored&&e.onErrored({type:"self-accept-error-handler-errored",moduleId:I,error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"self-accept-errored",moduleId:I,error:n}),e.ignoreErrored||t(n)}}return l}}}this.webpackHotUpdateauthress=(t,r,a)=>{for(var c in r)o.o(r,c)&&(n[c]=r[c],e&&e.push(c));a&&i.push(a),s[t]&&(s[t](),s[t]=void 0)},o.hmrI.jsonp=function(e,t){n||(n={},i=[],r=[],t.push(d)),o.o(n,e)||(n[e]=o.m[e])},o.hmrC.jsonp=function(e,s,l,u,h,p){h.push(d),t={},r=s,n=l.reduce((function(e,t){return e[t]=!1,e}),{}),i=[],e.forEach((function(e){o.o(a,e)&&void 0!==a[e]?(u.push(c(e,p)),t[e]=!0):t[e]=!1})),o.f&&(o.f.jsonpHmr=function(e,n){t&&o.o(t,e)&&!t[e]&&(n.push(c(e)),t[e]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(354)})()));
     1/*! Authress Login SDK 2.5.362 | Author - Authress Developers | License information can be found at https://github.com/Authress/login-sdk.js */
     2!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.authress=t():e.authress=t()}(this,(()=>(()=>{var e,t,n={75:(e,t,n)=>{const{sanitizeUrl:r}=n(332),o=n(629),i={"Content-Type":"application/json","X-Powered-By":`Authress Login SDK; Javascript; ${n(330).version}`},a=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","Load failed","<HTML DOCUMENT></HTML>"]);function s(e){return"Network Error"===e.message||"ERR_NETWORK"===e.code||!e.status||e.status>=500||"string"==typeof e.message&&a.has(e.message)||"string"==typeof e.data&&a.has(e.data)}async function c(e){let t=null;for(let n=0;n<5;n++)try{return await e()}catch(e){if(e.retryCount=n,!s(e))throw e;t=e,t.isNetworkError=!0,await new Promise((e=>setTimeout(e,10*2**n)));continue}const n=new Error("[Authress Login SDK] Http Request failed due to a Network Error even after multiple retries",{cause:t});throw n.code="AuthressSdkNetworkError",n}e.exports=class{constructor(e,t){if(!e)throw Error("Custom Authress Domain Host is required");const n=t||{debug(){},warn(){},critical(){}};this.logger=n;const o=new URL(r(e));this.loginUrl=`${o.origin}/api`}get(e,t,n,r){return c((()=>this.fetchWrapper("GET",e,null,n,t,r)))}delete(e,t,n,r){return c((()=>this.fetchWrapper("DELETE",e,null,n,t,r)))}post(e,t,n,r,o){return c((()=>this.fetchWrapper("POST",e,n,r,t,o)))}put(e,t,n,r,o){return c((()=>this.fetchWrapper("PUT",e,n,r,t,o)))}patch(e,t,n,r,o){return c((()=>this.fetchWrapper("PATCH",e,n,r,t,o)))}async fetchWrapper(e,t,n,r,a,s){const c=`${this.loginUrl}${t.toString()}`,d=e.toUpperCase(),l=Object.assign({},i,r);try{this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] HttpClient Request",method:d,url:c});const e={method:d,headers:l};n&&(e.body=JSON.stringify(n)),!o.isLocalHost()&&a&&(e.credentials="include");const t=await fetch(c,e);if(!t.ok)throw t;let r={};try{r=await t.text(),r=JSON.parse(r)}catch(e){}return{url:c,method:d,headers:t.headers,status:t.status,data:r}}catch(e){let t=e;try{t=await e.text(),t=JSON.parse(t)}catch(e){}const r=t.stack&&t.stack.match(/chrome-extension:[/][/](\w+)[/]/);if(r){this.logger&&this.logger.debug&&this.logger.debug({title:`[Authress Login SDK] Fetch failed due to a browser extension - ${d} - ${c}`,method:d,url:c,data:n,headers:l,error:e,resolvedError:t,extensionErrorId:r});const o=new Error(`Extension Error ID: ${r}`);throw o.code="BROWSER_EXTENSION_ERROR",o}const o=e.status;let i="warn",a="[Authress Login SDK] HttpClient Response Error";e?401===o?(a="[Authress Login SDK] HttpClient Response Error due to invalid token",i="debug"):404===o?(a="[Authress Login SDK] HttpClient Response: Not Found",i="debug"):o<500&&s&&(i="debug"):a="[Authress Login SDK] HttpClient Response Error - Unknown error occurred",this.logger&&this.logger[i]&&this.logger[i]({title:a,online:"undefined"==typeof navigator||navigator.onLine,method:d,url:c,status:o,data:n,headers:l,error:e,resolvedError:t});throw{url:c,method:d,status:o,data:t,headers:e.headers}}}}},160:(e,t,n)=>{const r=n(427),o="AuthenticationCredentialsStorage";e.exports=new class{constructor(){this.retainUserCookie=!1}getUserCookie(){if("undefined"==typeof window||"undefined"==typeof document)return null;return document.cookie.split(";").filter((e=>"user"===e.split("=")[0].trim())).map((e=>e.replace(/^user=/,""))).find((e=>e&&e.trim()))||null}set(e,t){if("undefined"!=typeof window&&"undefined"!=typeof document)try{const n=r.parse(document.cookie);localStorage.setItem(o,JSON.stringify({idToken:e,expiry:t&&t.getTime(),jsCookies:!!n.authorization})),this.retainUserCookie||this.clearCookies("user")}catch(e){console.debug("LocalStorage failed in Browser",e)}}get(){if("undefined"==typeof window||"undefined"==typeof document)return null;let e={};try{e=r.parse(document.cookie)}catch(e){console.debug("CookieManagement failed in Browser",e)}try{const{idToken:t,expiry:n,jsCookies:r}=JSON.parse(localStorage.getItem(o)||"{}");return t?n<Date.now()||r&&!e.authorization?null:t:this.getUserCookie()}catch(e){return console.debug("LocalStorage failed in Browser",e),this.getUserCookie()}}delete(){try{localStorage.removeItem(o)}catch(e){console.debug("LocalStorage failed in Browser",e)}try{this.clearCookies("user")}catch(e){console.debug("CookieManagement failed in Browser",e)}}clear(){this.clearCookies(),this.delete()}clearCookies(e){if("undefined"==typeof window||"undefined"==typeof document)return;const t=document.cookie.split("; ");for(const n of t){if(!["user","authorization","auth-code","AuthUserId"].includes(n.split("=")[0])||e&&n.split("=")[0]!==e)continue;const t=window.location.hostname.split("."),r=[...Array(t.length-1)].map(((e,n)=>t.reverse().slice(0,n+2).reverse().join("."))).map((e=>[e,`.${e}`])).flat(1).concat(null);"localhost"===window.location.hostname&&r.push("localhost");for(const e of r){const t=e?`domain=${e};`:"",r=`${encodeURIComponent(n.split(";")[0].split("=")[0])}=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ${t} SameSite=Strict; path=`;document.cookie=`${r}/`;const o=location.pathname.split("/");for(;o.length>0;)document.cookie=r+o.join("/"),o.pop()}}}}},321:e=>{var t=1/0,n=17976931348623157e292,r=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,d=parseInt,l=Object.prototype.toString;function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=function(e,h,p){return e&&e.length?function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(e,0,(h=p||void 0===h?1:(f=function(e){return e?(e=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&l.call(e)==o}(e))return r;if(u(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=u(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=s.test(e);return n||c.test(e)?d(e.slice(2),n?2:8):a.test(e)?r:+e}(e))===t||e===-1/0?(e<0?-1:1)*n:e==e?e:0:0===e?e:0}(h),g=f%1,f==f?g?f-g:f:0))<0?0:h):[];var f,g}},330:e=>{"use strict";e.exports=JSON.parse('{"name":"@authress/login","version":"2.5.362","description":"Universal login sdk for Authress authentication as a service. Provides managed authentication for user identity, authentication, and token verification.","main":"./src/index.js","types":"./index.d.ts","files":["index.d.ts","src","dist"],"scripts":{"build":"node make.js build && NODE_ENV=production webpack --mode=production","lint":"eslint --ext .js,.ts src tests make.js index.d.ts","test":"check-dts index.d.ts && mocha tests/*.test.js tests/**/*.test.js -R spec"},"dependencies":{"cookie":"<1","lodash.take":"^4.1.1"},"devDependencies":{"@babel/core":"^7.17.5","@babel/preset-env":"^7.16.11","@types/node":"^14.14.35","@typescript-eslint/eslint-plugin":"^3.1.0","@typescript-eslint/parser":"^3.1.0","babel-loader":"^8.2.3","chai":"^4.2.0","check-dts":"^0.4.4","ci-build-tools":"^1.0.13","commander":"^4.0.1","compression-webpack-plugin":"^9.2.0","eslint":"^7.12.1","eslint-config-cimpress-atsquad":"^1.0.67","eslint-loader":"^4.0.2","eslint-plugin-mocha":"^7.0.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^6.1.1","fs-extra":"^8.1.0","glob":"^7.1.6","mocha":"^11.1.0","path-browserify":"^1.0.1","sinon":"^7.5.0","sinon-chai":"^3.3.0","terser-webpack-plugin":"^5.3.1","typescript":"^3.9.5","webpack":"^5.69.1","webpack-cli":"^4.9.2"},"repository":{"type":"git","url":"git+https://github.com/Authress/authress-login.js"},"keywords":["authentication","authentication as a service","Login","Login Client","universal login","auth","federated login","secure login","application security","IDaaS","authentication","user authentication","user identity","Oauth2","Oauth2.1","Oauth3","platform","platform login","extension","Authress","Authress client","user security","DBSC","Device Bound Session Credentials"],"author":"Authress Developers <[email protected]> (https://authress.io)","license":"Apache-2.0","bugs":{"url":"https://github.com/Authress/authress-login.js/issues"},"homepage":"https://authress.io","engines":{"node":">=18"}}')},332:e=>{e.exports.sanitizeUrl=function(e){let t=e;t.startsWith("http")||(t=`https://${t}`);const n=new URL(t),r=n.host.match(/^([a-z0-9-]+)[.][a-z0-9-]+[.]authress[.]io$/);return r&&(n.host=`${r[1]}.login.authress.io`,t=n.toString()),t.replace(/[/]+$/,"")}},354:(e,t,n)=>{const r=n(427),o=n(321),i=n(629),a=n(75),s=n(836),{sanitizeUrl:c}=n(332),d=n(160);let l,u=new Promise((e=>l=e)),h=null;const p="AuthenticationRequestNonce";const f=n(568);e.exports={LoginClient:class{constructor(e,t){const n=Object.assign({applicationId:"app_default"},e);this.logger=t||console;const r=n.authressApiUrl||n.authressLoginHostUrl||n.authenticationServiceUrl||"";if(!r)throw Error('Missing required property "authressApiUrl" in LoginClient constructor. Custom Authress Domain Host is required.');if(this.applicationId=n.applicationId,!this.applicationId||this.applicationId.match(/^(sc_|ext_)/)){const e=Error("You have incorrectly specified an Authress Service Client or Extension as the applicationId instead of a valid application. The applicationId is your application that your users will log into, usually hosted on your domain https://example.yourdomain.com. Users cannot log *into* a Service Client, but they can log in *with* one. Users can use a Service Client to log in, by setting the connection ID in the *authenticate({ connectionId })* method to be the Authress Service Client.\n(1) If you are building an Custom Login Portal, then the application ID should correspond to this login portal.\n(2) If you are replacing or extending an Authress connection, then specify the Service Client as the connectionId and the end user application as the applicationId.\n(3) If you are building a platform or plugin marketplace, where users will log into third party extensions or apps, then distribute in your SDK a wrapper for the Authress Extension Client using: import { extensionClient } from '@authress/login' found within this SDK.\n(4) If you aren't sure what to do here to fix the problem, the fastest and usually correct solution is go to https://authress.io/app/#/settings?focus=applications create a new application, specify your site in the application url property and then update the value here.");throw e.code="InvalidApplication",e}this.hostUrl=c(r),this.httpClient=new a(this.hostUrl,t),this.lastSessionCheck=0,this.enableCredentials=this.getMatchingDomainInfo(this.hostUrl),d.retainUserCookie=e.retainUserCookie,n.skipBackgroundCredentialsCheck||i.onLoad((async()=>{await this.userSessionExists(!0)}))}getMatchingDomainInfo(e){const t=new URL(e);if(i.isLocalHost())return!1;const n=i.getCurrentLocation();if("https:"!==n.protocol)return!1;const r=t.host.toLowerCase().split(".").reverse(),a=n.host.toLowerCase().split(".").reverse();let s=[];for(let e of r){const t=o(a,s.length+1).join(".");if(s.concat(e).join(".")!==t)break;s.push(e)}return s.length===r.length&&s.length===a.length||s.length>1}getUserIdentity(){const e=d.getUserCookie(),t=s.decodeOrParse(e);if(t){const n=t.exp?new Date(1e3*t.exp):new Date(Date.now()+864e5);return d.set(e,n),t.userId=t.sub,t}const n=d.get(),r=s.decodeOrParse(n);if(!r)return null;const o=new URL(r.iss).hostname,i=new URL(this.hostUrl).hostname;return o.endsWith(i)||i.endsWith(o)?(r.userId=r.sub,r):(d.clear(),null)}async getConnectionCredentials(){await this.waitForUserSession();try{const e=await this.ensureToken();return(await this.httpClient.get("/session/credentials",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data}catch(e){return null}}async getDevices(){try{const e=await this.ensureToken();return(await this.httpClient.get("/session/devices",this.enableCredentials,{Authorization:e&&`Bearer ${e}`})).data.devices}catch(e){return[]}}async deleteDevice(e){try{const t=await this.ensureToken();await this.httpClient.delete(`/session/devices/${encodeURIComponent(e)}`,this.enableCredentials,{Authorization:t&&`Bearer ${t}`})}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to delete device",error:e}),e}}async openUserConfigurationScreen(e={redirectUrl:null,startPage:"Profile"}){if(!await this.userSessionExists()){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}const t=new URL("/settings",this.hostUrl);t.searchParams.set("client_id",this.applicationId),t.searchParams.set("start_page",e&&e.startPage||"Profile"),t.searchParams.set("redirect_uri",e&&e.redirectUrl||i.getCurrentLocation().href),i.assign(t.toString()),await Promise.resolve()}async registerDevice(e={name:"",type:"",totp:{}}){const t=await this.getUserIdentity();if(!t){const e=Error("User must be logged to configure user profile data.");throw e.code="NotLoggedIn",e}if(!e){const e=Error("Register Device missing required parameter: 'Options'");throw e.code="InvalidInput",e}let n;if(e.type&&"WebAuthN"!==e.type)"TOTP"===e.type&&(n={name:e.name,code:e.totp.verificationCode,totpData:e.totp,type:"TOTP"});else{const r=t.sub,o={challenge:Uint8Array.from(r,(e=>e.charCodeAt(0))),rp:{id:this.hostUrl.split(".").slice(1).join("."),name:"WebAuthN Login"},user:{id:Uint8Array.from(r,(e=>e.charCodeAt(0))),name:r,displayName:`Generated User ID: ${r}`},pubKeyCredParams:[{type:"public-key",alg:-7},{type:"public-key",alg:-257}],authenticatorSelection:{residentKey:"discouraged",requireResidentKey:!1,userVerification:"discouraged"},timeout:6e4,attestation:"direct"},i=await navigator.credentials.create({publicKey:o}),a={authenticatorAttachment:i.authenticatorAttachment,credentialId:i.id,type:i.type,userId:r,attestation:btoa(String.fromCharCode(...new Uint8Array(i.response.attestationObject))),client:btoa(String.fromCharCode(...new Uint8Array(i.response.clientDataJSON)))};n={name:e&&e.name,code:a,type:"WebAuthN"}}try{const e=await this.ensureToken();return(await this.httpClient.post("/session/devices",this.enableCredentials,n,{Authorization:e&&`Bearer ${e}`})).data}catch(e){throw this.logger&&this.logger.log({title:"[Authress Login SDK] Failed to register new device",error:e,request:n}),e}}async waitForUserSession(){try{return await u,!0}catch(e){return!1}}userSessionExists(e){return h?Date.now()-this.lastSessionCheck<50?h:(this.lastSessionCheck=Date.now(),h=h.catch((()=>{})).then((()=>this.userSessionContinuation(e)))):(this.lastSessionCheck=Date.now(),h=this.userSessionContinuation(e))}async userSessionContinuation(e){const t=new URLSearchParams(i.getCurrentLocation().search);let n={};if("undefined"!=typeof localStorage)try{n=JSON.parse(localStorage.getItem(p)||"{}"),localStorage.removeItem(p),Object.hasOwnProperty.call(n,"enableCredentials")&&(this.enableCredentials=n.enableCredentials)}catch(e){this.logger&&this.logger.debug&&this.logger.debug({title:"[Authress Login SDK] LocalStorage failed in Browser",error:e})}if(t.get("state")&&"oauthLogin"===t.get("flow"))return!1;if((n.nonce||t.get("iss")&&t.get("iss").includes(this.hostUrl))&&this.sanitizeQueryParameters(),n.nonce&&t.get("code")&&n.nonce===t.get("nonce")){const e="cookie"===t.get("code")?r.parse(document.cookie)["auth-code"]:t.get("code"),o=await s.calculateAntiAbuseHash({client_id:this.applicationId,authenticationRequestId:n.nonce,code:e}),i={grant_type:"authorization_code",redirect_uri:n.redirectUrl,client_id:this.applicationId,code:e,code_verifier:n.codeVerifier,antiAbuseHash:o};try{const e=await this.httpClient.post(`/authentication/${n.nonce}/tokens`,this.enableCredentials,i),t=s.decode(e.data.id_token),o=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);return document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:o,path:"/",sameSite:"strict"}),d.set(e.data.id_token,o),l(),!0}catch(e){if(this.logger&&this.logger.log({title:"[Authress Login SDK] Failed exchange authentication response for a token.",error:e}),e.data&&"invalid_request"===e.data.error)return!1;throw e.data||e}}if(i.isLocalHost()&&t.get("nonce")&&t.get("access_token")&&(!n.nonce||n.nonce===t.get("nonce"))){const e=s.decode(t.get("id_token")),n=e.exp&&new Date(1e3*e.exp)||Number(t.get("expires_in"))&&new Date(Date.now()+1e3*Number(t.get("expires_in")));return document.cookie=r.serialize("authorization",t.get("access_token")||"",{expires:n,path:"/",sameSite:"strict"}),d.set(t.get("id_token"),n),l(),!0}if(this.getUserIdentity())return l(),!0;if(!i.isLocalHost()&&!e){try{const e=await this.httpClient.patch("/session",this.enableCredentials,{},null,!0);if(e.data.access_token){const t=s.decode(e.data.id_token),n=t.exp&&new Date(1e3*t.exp)||e.data.expires_in&&new Date(Date.now()+1e3*e.data.expires_in);document.cookie=r.serialize("authorization",e.data.access_token||"",{expires:n,path:"/",sameSite:"strict"}),d.set(e.data.id_token,n)}}catch(e){400===e.status||404===e.status||409===e.status?this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] User does not have an existing authentication session",error:e}):this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed attempting to check if the user has an existing authentication session",error:e})}if(this.getUserIdentity())return l(),!0}return!1}async updateExtensionAuthenticationRequest({state:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r}){if(!t&&!n){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}const o=new URLSearchParams(i.getCurrentLocation().search),a=e||o.get("state");if(!a){const e=Error("The `state` parameters must be specified to update this authentication request");throw e.code="InvalidAuthenticationRequest",e}try{const e=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,authenticationRequestId:a}),o=await this.httpClient.patch(`/authentication/${a}`,!0,{antiAbuseHash:e,connectionId:t,tenantLookupIdentifier:n,connectionProperties:r});if(new URL(o.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:o.data.authenticationUrl};i.assign(o.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to update extension authentication request",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async unlinkIdentity(e){if(!e){const e=Error("connectionId must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged in to unlink an account.");throw e.code="NotLoggedIn",e}let t;try{t=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const n=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${t}`};try{await this.httpClient.delete(`/identities/${encodeURIComponent(e)}`,this.enableCredentials,n)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to unlink user identity",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}}async linkIdentity({connectionId:e,tenantLookupIdentifier:t,redirectUrl:n,connectionProperties:r}){if(!e&&!t){const e=Error("connectionId or tenantLookupIdentifier must be specified");throw e.code="InvalidConnection",e}if(!this.getUserIdentity()){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}let o;try{o=await this.ensureToken({timeoutInMillis:100})}catch(e){if("TokenTimeout"===e.code){const e=Error("User must be logged into an existing account before linking a second account.");throw e.code="NotLoggedIn",e}}const{codeChallenge:a}=await s.getAuthCodes(),c=await s.calculateAntiAbuseHash({connectionId:e,tenantLookupIdentifier:t,applicationId:this.applicationId});try{const s=n&&new URL(n).toString()||i.getCurrentLocation().href,d=this.enableCredentials&&!i.isLocalHost()?{}:{Authorization:`Bearer ${o}`},l=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:c,linkIdentity:!0,redirectUrl:s,codeChallengeMethod:"S256",codeChallenge:a,connectionId:e,tenantLookupIdentifier:t,connectionProperties:r,applicationId:this.applicationId},d);i.assign(l.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start user identity link",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e}await new Promise((e=>setTimeout(e,5e3)))}async authenticate(e={}){const{connectionId:t,tenantLookupIdentifier:n,inviteId:r,redirectUrl:o,force:a,responseLocation:c,flowType:l,connectionProperties:u,openType:h,multiAccount:f,clearUserDataBeforeLogin:g}=e||{};if(c&&"cookie"!==c&&"query"!==c&&"none"!==c){const e=Error("Authentication response location is not valid");throw e.code="InvalidResponseLocation",e}if(!r&&!a&&!f&&await this.userSessionExists()){const n=await this.ensureToken(),r=s.decode(n);if(t&&r&&r.azp&&t!==r.azp){this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Authentication blocked because the user is already logged in, and the requested authentication parameters do not match the original session.",requestedAuthenticationOptions:e,currentAuthenticationSessionData:r});const t=Error('Authentication requested for user that is already logged in, but the connectionId specified does not match their existing session.\n        Recommended Options:\n          (1) If the goal is to force them to log in with this new connection and ignore their existing session, use the "force" flag.\n          (2) If the goal is link their current identity with a new from the new connection, use the linkIdentity() method.\n          (3) If the goal is skip log in if they are already logged in or force log in with the connectionId, first check if userSessionExists() and then only if "false", call authenticate().');throw t.code="AuthenticationConstraintContention",t}return null}const{codeVerifier:m,codeChallenge:w}=await s.getAuthCodes(),y=await s.calculateAntiAbuseHash({connectionId:t,tenantLookupIdentifier:n,inviteId:r,applicationId:this.applicationId});try{const e=o&&new URL(o).toString()||i.getCurrentLocation().href;!1!==g&&d.clear();const a=await this.httpClient.post("/authentication",this.enableCredentials,{antiAbuseHash:y,redirectUrl:e,codeChallengeMethod:"S256",codeChallenge:w,connectionId:t,tenantLookupIdentifier:n,inviteId:r,connectionProperties:u,applicationId:this.applicationId,responseLocation:c,flowType:l,multiAccount:f});if(localStorage.setItem(p,JSON.stringify({nonce:a.data.authenticationRequestId,codeVerifier:m,lastConnectionId:t,tenantLookupIdentifier:n,redirectUrl:e,enableCredentials:a.data.enableCredentials,multiAccount:f})),new URL(a.data.authenticationUrl).hostname===i.getCurrentLocation().hostname)return{authenticationUrl:a.data.authenticationUrl};if("tab"===h){const e=i.open(a.data.authenticationUrl,"_blank");e&&!e.closed&&void 0!==e.closed||i.assign(a.data.authenticationUrl)}else i.assign(a.data.authenticationUrl)}catch(e){if(this.logger&&this.logger.log&&this.logger.log({title:"[Authress Login SDK] Failed to start authentication for user",error:e}),e.status&&e.status>=400&&e.status<500){const t=Error(e.data&&(e.data.title||e.data.errorCode)||e.data||"Unknown Error");throw t.code=e.data&&e.data.errorCode,t}throw e.data||e}return await new Promise((e=>setTimeout(e,5e3))),null}async ensureToken(e){if(e&&0===e.timeoutInMillis){const e=this.getUserIdentity(),t=r.parse(document.cookie);if(e)return"undefined"!==t.authorization&&t.authorization;const n=Error("No token retrieved after timeout");throw n.code="TokenTimeout",n}await this.userSessionExists();const t=Object.assign({timeoutInMillis:5e3},e||{}),n=this.waitForUserSession(),o=-1===t.timeoutInMillis||t.timeoutInMillis>2**31-1?2**31-1:t.timeoutInMillis,i=new Promise(((e,t)=>setTimeout(t,o||0)));try{await Promise.race([n,i])}catch(e){const t=Error("No token retrieved after timeout");throw t.code="TokenTimeout",t}const a=r.parse(document.cookie);return"undefined"!==a.authorization&&a.authorization}async logout(e){let t;if(e)try{new URL(e),t=e}catch(n){try{t=new URL(e,i.getCurrentLocation().href).toString()}catch(t){const n=Error(`The logout redirect url is not valid URL: ${e}`);throw n.code="InvalidRedirectUrl",n}}if(d.clear(),this.sanitizeQueryParameters(),u=new Promise((e=>l=e)),this.enableCredentials)try{return await this.httpClient.delete("/session",this.enableCredentials),this.lastSessionCheck=0,void(e&&e!==i.getCurrentLocation().href&&i.assign(e))}catch(e){}const n=new URL("/logout",this.hostUrl);n.searchParams.set("redirect_uri",t||i.getCurrentLocation().href),n.searchParams.set("client_id",this.applicationId),i.assign(n.toString()),this.lastSessionCheck=0,await new Promise((e=>setTimeout(e,500)))}sanitizeQueryParameters(){const e=new URL(i.getCurrentLocation());e.searchParams.delete("iss"),e.searchParams.delete("nonce"),e.searchParams.delete("code"),e.searchParams.delete("expires_in"),e.searchParams.delete("access_token"),e.searchParams.delete("id_token"),history.replaceState({},void 0,e.toString())}},ExtensionClient:f,UserConfigurationScreen:{Profile:"Profile",MFA:"MFA"}}},427:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||l,a=0,s=0,h=0;do{if(-1===(s=e.indexOf("=",a)))break;if(-1===(h=e.indexOf(";",a)))h=o;else if(s>h){a=e.lastIndexOf(";",s-1)+1;continue}var p=c(e,a,s),f=d(e,s,p),g=e.slice(p,f);if(!r.call(n,g)){var m=c(e,s+1,h),w=d(e,h,m);34===e.charCodeAt(m)&&34===e.charCodeAt(w-1)&&(m++,w--);var y=e.slice(m,w);n[g]=u(y,i)}a=h+1}while(a<o);return n},t.serialize=function(e,t,r){var c=r&&r.encode||encodeURIComponent;if("function"!=typeof c)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var d=c(t);if(!i.test(d))throw new TypeError("argument val is invalid");var l=e+"="+d;if(!r)return l;if(null!=r.maxAge){var u=Math.floor(r.maxAge);if(!isFinite(u))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+u}if(r.domain){if(!a.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){var h=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(h)||isNaN(h.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+h.toUTCString()}r.httpOnly&&(l+="; HttpOnly");r.secure&&(l+="; Secure");r.partitioned&&(l+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,a=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/;function c(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function d(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function u(e,t){try{return t(e)}catch(t){return e}}},568:(e,t,n)=>{const r=n(836),{sanitizeUrl:o}=n(332),i=n(629),a="ExtensionRequestNonce";let s=null;e.exports=class{constructor(e,t){if(this.extensionId=t,!e)throw Error('Missing required property "authressCustomDomain" in ExtensionClient constructor. The Custom Authress Domain Host is required.');if(!t)throw Error('Missing required property "extensionId" in ExtensionClient constructor. The extension is required for selecting the correct login method.');this.authressCustomDomain=o(e),this.accessToken=null,i.onLoad((async()=>{await this.requestToken({silent:!0})}))}async getUserIdentity(){const e=this.accessToken&&await r.decode(this.accessToken);return e?1e3*e.exp<Date.now()?(this.accessToken=null,null):e:null}async getTokenResponse(){return await this.getUserIdentity()?{accessToken:this.accessToken}:null}requestToken(e={code:null,silent:!1}){if(s)return s=s.catch((()=>{})).then((()=>this.requestTokenContinuation(e)));const t=this.requestTokenContinuation(e);return t.catch((()=>{})),s=t}async requestTokenContinuation(e={code:null,silent:!1}){const t=e&&e.code||new URLSearchParams(i.getCurrentLocation().search).get("code");if(!t){if(!e||!e.silent){const e=Error("OAuth Authorization code is required");throw e.code="InvalidAuthorizationCode",e}return this.getTokenResponse()}const n=new URL(this.authressCustomDomain);n.pathname="/api/authentication/oauth/tokens";const{codeVerifier:r,redirectUrl:o}=JSON.parse(localStorage.getItem(a)||"{}"),s=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code_verifier:r,code:t,grant_type:"authorization_code",client_id:this.extensionId,redirect_uri:o})}),c=await s.json();this.accessToken=c.access_token;const d=new URL(i.getCurrentLocation());return d.searchParams.delete("code"),d.searchParams.delete("iss"),d.searchParams.delete("nonce"),d.searchParams.delete("expires_in"),d.searchParams.delete("access_token"),d.searchParams.delete("id_token"),history.replaceState({},void 0,d.toString()),this.getTokenResponse()}async login(e){const t=await this.getTokenResponse();if(t)return t;const n=await this.requestToken({silent:!0});if(n)return n;const o=new URL(this.authressCustomDomain),{codeVerifier:s,codeChallenge:c}=r.getAuthCodes(),d=e||i.getCurrentLocation().href;return localStorage.setItem(a,JSON.stringify({codeVerifier:s,redirectUrl:d})),o.searchParams.set("client_id",this.extensionId),o.searchParams.set("code_challenge",c),o.searchParams.set("code_challenge_method","S256"),o.searchParams.set("redirect_uri",d),i.assign(o.toString()),await new Promise((e=>setTimeout(e,5e3))),null}}},629:e=>{e.exports=new class{onLoad(e){"undefined"!=typeof window&&(window.onload=e)}isLocalHost(){return"undefined"!=typeof window&&window.location&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)}getCurrentLocation(){return"undefined"!=typeof window&&new URL(window.location)||new URL("http://localhost:8080")}assign(e){return"undefined"==typeof window?null:window.location.assign(e.toString())}open(e){return"undefined"==typeof window?null:window.open(e.toString())}}},836:(e,t,n)=>{const r=n(878);e.exports=new class{decode(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[1]));return t.exp&&(t.exp=t.exp-10),t}catch(e){return null}}decodeOrParse(e){if(!e)return null;if("object"==typeof e)return e;try{return JSON.parse(e)}catch(t){return this.decode(e)}}decodeFull(e){if(!e)return null;try{const t=JSON.parse(r.decode(e.split(".")[0])),n=JSON.parse(r.decode(e.split(".")[1]));return n.exp&&(n.exp=n.exp-10),{header:t,payload:n}}catch(e){return null}}async getAuthCodes(){const e=r.encode((window.crypto||window.msCrypto).getRandomValues(new Uint32Array(16)).toString()),t=await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(e));return{codeVerifier:e,codeChallenge:r.encode(t)}}async calculateAntiAbuseHash(e){const t=Date.now(),n=Object.values(e).filter((e=>e)).join("|");let o=0,i=null;for(;++o&&(i=r.encode(await(window.crypto||window.msCrypto).subtle.digest("SHA-256",(new TextEncoder).encode(`${t};${o};${n}`))),!i.match(/^00/)););return`v2;${t};${o};${i}`}}},878:e=>{function t(e){return String.fromCharCode(parseInt(e.slice(1),16))}function n(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}e.exports.decode=function(e){return function(e){return decodeURIComponent(Array.from(atob(e),n).join(""))}(e.replace(/-/g,"+").replace(/_/g,"/"))},e.exports.encode=function(e){return e&&"object"==typeof e?btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,""):function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,t))}(e).replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}}},r={};function o(e){var t=r[e];if(void 0!==t){if(void 0!==t.error)throw t.error;return t.exports}var i=r[e]={exports:{}};try{var a={id:e,module:i,factory:n[e],require:o};o.i.forEach((function(e){e(a)})),i=a.module,a.factory.call(i.exports,i,i.exports,a.require)}catch(e){throw i.error=e,e}return i.exports}return o.m=n,o.c=r,o.i=[],o.hu=e=>e+"."+o.h()+".hot-update.js",o.hmrF=()=>"main."+o.h()+".hot-update.json",o.h=()=>"3727d279383e9571121c",o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="authress:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var d=document.getElementsByTagName("script"),l=0;l<d.length;l++){var u=d[l];if(u.getAttribute("src")==n||u.getAttribute("data-webpack")==t+i){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[r];var h=(t,r)=>{s.onerror=s.onload=null,clearTimeout(p);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=h.bind(null,s.onerror),s.onload=h.bind(null,s.onload),c&&document.head.appendChild(s)}},(()=>{var e,t,n,r={},i=o.c,a=[],s=[],c="idle",d=0,l=[];function u(e){c=e;for(var t=[],n=0;n<s.length;n++)t[n]=s[n].call(null,e);return Promise.all(t).then((function(){}))}function h(){0==--d&&u("ready").then((function(){if(0===d){var e=l;l=[];for(var t=0;t<e.length;t++)e[t]()}}))}function p(e){if("idle"!==c)throw new Error("check() is only allowed in idle status");return u("check").then(o.hmrM).then((function(n){return n?u("prepare").then((function(){var r=[];return t=[],Promise.all(Object.keys(o.hmrC).reduce((function(e,i){return o.hmrC[i](n.c,n.r,n.m,e,t,r),e}),[])).then((function(){return t=function(){return e?g(e):u("ready").then((function(){return r}))},0===d?t():new Promise((function(e){l.push((function(){e(t())}))}));var t}))})):u(m()?"ready":"idle").then((function(){return null}))}))}function f(e){return"ready"!==c?Promise.resolve().then((function(){throw new Error("apply() is only allowed in ready status (state: "+c+")")})):g(e)}function g(e){e=e||{},m();var r=t.map((function(t){return t(e)}));t=void 0;var o=r.map((function(e){return e.error})).filter(Boolean);if(o.length>0)return u("abort").then((function(){throw o[0]}));var i=u("dispose");r.forEach((function(e){e.dispose&&e.dispose()}));var a,s=u("apply"),c=function(e){a||(a=e)},d=[];return r.forEach((function(e){if(e.apply){var t=e.apply(c);if(t)for(var n=0;n<t.length;n++)d.push(t[n])}})),Promise.all([i,s]).then((function(){return a?u("fail").then((function(){throw a})):n?g(e).then((function(e){return d.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e})):u("idle").then((function(){return d}))}))}function m(){if(n)return t||(t=[]),Object.keys(o.hmrI).forEach((function(e){n.forEach((function(n){o.hmrI[e](n,t)}))})),n=void 0,!0}o.hmrD=r,o.i.push((function(l){var g,m,w,y,v=l.module,k=function(t,n){var r=i[n];if(!r)return t;var o=function(o){if(r.hot.active){if(i[o]){var s=i[o].parents;-1===s.indexOf(n)&&s.push(n)}else a=[n],e=o;-1===r.children.indexOf(o)&&r.children.push(o)}else console.warn("[HMR] unexpected require("+o+") from disposed module "+n),a=[];return t(o)},s=function(e){return{configurable:!0,enumerable:!0,get:function(){return t[e]},set:function(n){t[e]=n}}};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&"e"!==l&&Object.defineProperty(o,l,s(l));return o.e=function(e,n){return function(e){switch(c){case"ready":u("prepare");case"prepare":return d++,e.then(h,h),e;default:return e}}(t.e(e,n))},o}(l.require,l.id);v.hot=(g=l.id,m=v,y={_acceptedDependencies:{},_acceptedErrorHandlers:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:w=e!==g,_requireSelf:function(){a=m.parents.slice(),e=w?void 0:g,o(g)},active:!0,accept:function(e,t,n){if(void 0===e)y._selfAccepted=!0;else if("function"==typeof e)y._selfAccepted=e;else if("object"==typeof e&&null!==e)for(var r=0;r<e.length;r++)y._acceptedDependencies[e[r]]=t||function(){},y._acceptedErrorHandlers[e[r]]=n;else y._acceptedDependencies[e]=t||function(){},y._acceptedErrorHandlers[e]=n},decline:function(e){if(void 0===e)y._selfDeclined=!0;else if("object"==typeof e&&null!==e)for(var t=0;t<e.length;t++)y._declinedDependencies[e[t]]=!0;else y._declinedDependencies[e]=!0},dispose:function(e){y._disposeHandlers.push(e)},addDisposeHandler:function(e){y._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=y._disposeHandlers.indexOf(e);t>=0&&y._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,c){case"idle":t=[],Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)})),u("ready");break;case"ready":Object.keys(o.hmrI).forEach((function(e){o.hmrI[e](g,t)}));break;case"prepare":case"check":case"dispose":case"apply":(n=n||[]).push(g)}},check:p,apply:f,status:function(e){if(!e)return c;s.push(e)},addStatusHandler:function(e){s.push(e)},removeStatusHandler:function(e){var t=s.indexOf(e);t>=0&&s.splice(t,1)},data:r[g]},e=void 0,y),v.parents=a,v.children=[],a=[],l.require=k})),o.hmrC={},o.hmrI={}})(),o.p="",(()=>{var e,t,n,r,i,a=o.hmrS_jsonp=o.hmrS_jsonp||{792:0},s={};function c(t,n){return e=n,new Promise(((e,n)=>{s[t]=e;var r=o.p+o.hu(t),i=new Error;o.l(r,(e=>{if(s[t]){s[t]=void 0;var r=e&&("load"===e.type?"missing":e.type),o=e&&e.target&&e.target.src;i.message="Loading hot update chunk "+t+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n(i)}}))}))}function d(e){function s(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),a=i.id,s=i.chain,d=o.c[a];if(d&&(!d.hot._selfAccepted||d.hot._selfInvalidated)){if(d.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:a};if(d.hot._main)return{type:"unaccepted",chain:s,moduleId:a};for(var l=0;l<d.parents.length;l++){var u=d.parents[l],h=o.c[u];if(h){if(h.hot._declinedDependencies[a])return{type:"declined",chain:s.concat([u]),moduleId:a,parentId:u};-1===t.indexOf(u)&&(h.hot._acceptedDependencies[a]?(n[u]||(n[u]=[]),c(n[u],[a])):(delete n[u],t.push(u),r.push({chain:s.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}o.f&&delete o.f.jsonpHmr,t=void 0;var d={},l=[],u={},h=function(e){console.warn("[HMR] unexpected require("+e.id+") to disposed module")};for(var p in n)if(o.o(n,p)){var f=n[p],g=f?s(p):{type:"disposed",moduleId:p},m=!1,w=!1,y=!1,v="";switch(g.chain&&(v="\nUpdate propagation: "+g.chain.join(" -> ")),g.type){case"self-declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of self decline: "+g.moduleId+v));break;case"declined":e.onDeclined&&e.onDeclined(g),e.ignoreDeclined||(m=new Error("Aborted because of declined dependency: "+g.moduleId+" in "+g.parentId+v));break;case"unaccepted":e.onUnaccepted&&e.onUnaccepted(g),e.ignoreUnaccepted||(m=new Error("Aborted because "+p+" is not accepted"+v));break;case"accepted":e.onAccepted&&e.onAccepted(g),w=!0;break;case"disposed":e.onDisposed&&e.onDisposed(g),y=!0;break;default:throw new Error("Unexception type "+g.type)}if(m)return{error:m};if(w)for(p in u[p]=f,c(l,g.outdatedModules),g.outdatedDependencies)o.o(g.outdatedDependencies,p)&&(d[p]||(d[p]=[]),c(d[p],g.outdatedDependencies[p]));y&&(c(l,[g.moduleId]),u[p]=h)}n=void 0;for(var k,C=[],b=0;b<l.length;b++){var I=l[b],S=o.c[I];S&&(S.hot._selfAccepted||S.hot._main)&&u[I]!==h&&!S.hot._selfInvalidated&&C.push({module:I,require:S.hot._requireSelf,errorHandler:S.hot._selfAccepted})}return{dispose:function(){var e;r.forEach((function(e){delete a[e]})),r=void 0;for(var t,n=l.slice();n.length>0;){var i=n.pop(),s=o.c[i];if(s){var c={},u=s.hot._disposeHandlers;for(b=0;b<u.length;b++)u[b].call(null,c);for(o.hmrD[i]=c,s.hot.active=!1,delete o.c[i],delete d[i],b=0;b<s.children.length;b++){var h=o.c[s.children[b]];h&&((e=h.parents.indexOf(i))>=0&&h.parents.splice(e,1))}}}for(var p in d)if(o.o(d,p)&&(s=o.c[p]))for(k=d[p],b=0;b<k.length;b++)t=k[b],(e=s.children.indexOf(t))>=0&&s.children.splice(e,1)},apply:function(t){for(var n in u)o.o(u,n)&&(o.m[n]=u[n]);for(var r=0;r<i.length;r++)i[r](o);for(var a in d)if(o.o(d,a)){var s=o.c[a];if(s){k=d[a];for(var c=[],h=[],p=[],f=0;f<k.length;f++){var g=k[f],m=s.hot._acceptedDependencies[g],w=s.hot._acceptedErrorHandlers[g];if(m){if(-1!==c.indexOf(m))continue;c.push(m),h.push(w),p.push(g)}}for(var y=0;y<c.length;y++)try{c[y].call(null,k)}catch(n){if("function"==typeof h[y])try{h[y](n,{moduleId:a,dependencyId:p[y]})}catch(r){e.onErrored&&e.onErrored({type:"accept-error-handler-errored",moduleId:a,dependencyId:p[y],error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"accept-errored",moduleId:a,dependencyId:p[y],error:n}),e.ignoreErrored||t(n)}}}for(var v=0;v<C.length;v++){var b=C[v],I=b.module;try{b.require(I)}catch(n){if("function"==typeof b.errorHandler)try{b.errorHandler(n,{moduleId:I,module:o.c[I]})}catch(r){e.onErrored&&e.onErrored({type:"self-accept-error-handler-errored",moduleId:I,error:r,originalError:n}),e.ignoreErrored||(t(r),t(n))}else e.onErrored&&e.onErrored({type:"self-accept-errored",moduleId:I,error:n}),e.ignoreErrored||t(n)}}return l}}}this.webpackHotUpdateauthress=(t,r,a)=>{for(var c in r)o.o(r,c)&&(n[c]=r[c],e&&e.push(c));a&&i.push(a),s[t]&&(s[t](),s[t]=void 0)},o.hmrI.jsonp=function(e,t){n||(n={},i=[],r=[],t.push(d)),o.o(n,e)||(n[e]=o.m[e])},o.hmrC.jsonp=function(e,s,l,u,h,p){h.push(d),t={},r=s,n=l.reduce((function(e,t){return e[t]=!1,e}),{}),i=[],e.forEach((function(e){o.o(a,e)&&void 0!==a[e]?(u.push(c(e,p)),t[e]=!0):t[e]=!1})),o.f&&(o.f.jsonpHmr=function(e,n){t&&o.o(t,e)&&!t[e]&&(n.push(c(e)),t[e]=!0)})},o.hmrM=()=>{if("undefined"==typeof fetch)throw new Error("No browser support: need fetch API");return fetch(o.p+o.hmrF()).then((e=>{if(404!==e.status){if(!e.ok)throw new Error("Failed to fetch update manifest "+e.statusText);return e.json()}}))}})(),o(354)})()));
  • authress/trunk/templates/authress-login-form.php

    r3103661 r3264076  
    2121        const authressLoginHostUrl = "<?php echo esc_attr($authress_options->get('customDomain')); ?>";
    2222        const applicationId = "<?php echo esc_attr($authress_options->get('applicationId')); ?>";
    23         const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId });
     23        const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId, retainUserCookie: true });
    2424       
    2525        // const redirectUrl = 'http://localhost:8081';
     
    5656        const authressLoginHostUrl = "<?php echo esc_attr($authress_options->get('customDomain')); ?>";
    5757        const applicationId = "<?php echo esc_attr($authress_options->get('applicationId')); ?>";
    58         const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId });
     58        const loginClient = new authress.LoginClient({ authressLoginHostUrl, applicationId, retainUserCookie: true });
    5959        const currentUrl = new URL(window.location.href);
    6060        const redirectUrl = currentUrl.searchParams.get('redirect_to') ? decodeURIComponent(currentUrl.searchParams.get('redirect_to')) : window.location.origin;
  • authress/trunk/vendor/autoload.php

    r3263764 r3264076  
    55require_once __DIR__ . '/composer/autoload_real.php';
    66
    7 return ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee::getLoader();
     7return ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be::getLoader();
  • authress/trunk/vendor/composer/InstalledVersions.php

    r3263764 r3264076  
    3131    array (
    3232    ),
    33     'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     33    'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    3434    'name' => 'authress/wordpress-plugin.php',
    3535  ),
     
    4343      array (
    4444      ),
    45       'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     45      'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    4646    ),
    4747    'codercat/jwk-to-pem' =>
  • authress/trunk/vendor/composer/autoload_real.php

    r3263764 r3264076  
    33// autoload_real.php @generated by Composer
    44
    5 class ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee
     5class ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be
    66{
    77    private static $loader;
     
    2525        require __DIR__ . '/platform_check.php';
    2626
    27         spl_autoload_register(array('ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee', 'loadClassLoader'), true, true);
     27        spl_autoload_register(array('ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be', 'loadClassLoader'), true, true);
    2828        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
    29         spl_autoload_unregister(array('ComposerAutoloaderInitc27caacadade3b37e1575eb21199faee', 'loadClassLoader'));
     29        spl_autoload_unregister(array('ComposerAutoloaderInit0afc4f4830b212e88cd7a189750a61be', 'loadClassLoader'));
    3030
    3131        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
     
    3333            require __DIR__ . '/autoload_static.php';
    3434
    35             call_user_func(\Composer\Autoload\ComposerStaticInitc27caacadade3b37e1575eb21199faee::getInitializer($loader));
     35            call_user_func(\Composer\Autoload\ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::getInitializer($loader));
    3636        } else {
    3737            $map = require __DIR__ . '/autoload_namespaces.php';
     
    5454
    5555        if ($useStaticLoader) {
    56             $includeFiles = Composer\Autoload\ComposerStaticInitc27caacadade3b37e1575eb21199faee::$files;
     56            $includeFiles = Composer\Autoload\ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$files;
    5757        } else {
    5858            $includeFiles = require __DIR__ . '/autoload_files.php';
    5959        }
    6060        foreach ($includeFiles as $fileIdentifier => $file) {
    61             composerRequirec27caacadade3b37e1575eb21199faee($fileIdentifier, $file);
     61            composerRequire0afc4f4830b212e88cd7a189750a61be($fileIdentifier, $file);
    6262        }
    6363
     
    6666}
    6767
    68 function composerRequirec27caacadade3b37e1575eb21199faee($fileIdentifier, $file)
     68function composerRequire0afc4f4830b212e88cd7a189750a61be($fileIdentifier, $file)
    6969{
    7070    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
  • authress/trunk/vendor/composer/autoload_static.php

    r3263764 r3264076  
    55namespace Composer\Autoload;
    66
    7 class ComposerStaticInitc27caacadade3b37e1575eb21199faee
     7class ComposerStaticInit0afc4f4830b212e88cd7a189750a61be
    88{
    99    public static $files = array (
     
    658658    {
    659659        return \Closure::bind(function () use ($loader) {
    660             $loader->prefixLengthsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$prefixLengthsPsr4;
    661             $loader->prefixDirsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$prefixDirsPsr4;
    662             $loader->fallbackDirsPsr4 = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$fallbackDirsPsr4;
    663             $loader->classMap = ComposerStaticInitc27caacadade3b37e1575eb21199faee::$classMap;
     660            $loader->prefixLengthsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$prefixLengthsPsr4;
     661            $loader->prefixDirsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$prefixDirsPsr4;
     662            $loader->fallbackDirsPsr4 = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$fallbackDirsPsr4;
     663            $loader->classMap = ComposerStaticInit0afc4f4830b212e88cd7a189750a61be::$classMap;
    664664
    665665        }, null, ClassLoader::class);
  • authress/trunk/vendor/composer/installed.php

    r3263764 r3264076  
    77    array (
    88    ),
    9     'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     9    'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    1010    'name' => 'authress/wordpress-plugin.php',
    1111  ),
     
    1919      array (
    2020      ),
    21       'reference' => '7964048a85b56ddb8d580c5820fb85d1782c437e',
     21      'reference' => '96e0eab8ebba749fdfc6becf25a6501b8eaa1b43',
    2222    ),
    2323    'codercat/jwk-to-pem' =>
  • authress/trunk/wordpress/readme.txt

    r3263764 r3264076  
    55Requires PHP: 8.2
    66Tested up to: 6.6
    7 Stable tag: 0.2.99
     7Stable tag: 0.2.100
    88License: Apache-2.0
    99License URI: https://github.com/Authress/wordpress-sso-login/blob/main/LICENSE
Note: See TracChangeset for help on using the changeset viewer.