Socket
Socket
Sign inDemoInstall

@auth0/auth0-spa-js

Package Overview
Dependencies
Maintainers
36
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0/auth0-spa-js - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

dist/typings/src/Auth0Client.d.ts

18

CHANGELOG.md

@@ -1,7 +0,19 @@

## [v.1.3.2](https://github.com/auth0/auth0-spa-js/tree/v1.3.2) (2019-10-17)
## [v1.4.0](https://github.com/auth0/auth0-spa-js/tree/v1.4.0) (2019-10-30)
**Added**
Add 'lock' to prevent `getTokenSilently` to be invoked in parallel https://github.com/auth0/auth0-spa-js/pull/238
Improved OIDC compliance https://github.com/auth0/auth0-spa-js/pull/248
**Fixed**
Fix for race condition when using `sha256` on IE11 https://github.com/auth0/auth0-spa-js/pull/252
Fixed the codeowners file with the correct group https://github.com/auth0/auth0-spa-js/pull/253
Document leeway default value https://github.com/auth0/auth0-spa-js/pull/256
Clear transaction data on error https://github.com/auth0/auth0-spa-js/pull/254
## [v1.3.2](https://github.com/auth0/auth0-spa-js/tree/v1.3.2) (2019-10-17)
**Fixed**
`parseQueryString` now removes hash fragment on query before parsing https://github.com/auth0/auth0-spa-js/pull/246
## [v.1.3.1](https://github.com/auth0/auth0-spa-js/tree/v1.3.1) (2019-10-14)
## [v1.3.1](https://github.com/auth0/auth0-spa-js/tree/v1.3.1) (2019-10-14)

@@ -11,3 +23,3 @@ **Fixed**

## [v.1.3.0](https://github.com/auth0/auth0-spa-js/tree/v1.3.0) (2019-10-10)
## [v1.3.0](https://github.com/auth0/auth0-spa-js/tree/v1.3.0) (2019-10-10)

@@ -14,0 +26,0 @@ **Fixed**

2

dist/auth0-spa-js.production.esm.js

@@ -1,2 +0,2 @@

var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};var e=function(){return(e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function n(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function r(t,e,n,r){return new(n||(n=Promise))(function(o,i){function c(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(c,a)}u((r=r.apply(t,e||[])).next())})}function o(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var a,u,s,f="object",l=function(t){return t&&t.Math==Math&&t},p=l(typeof globalThis==f&&globalThis)||l(typeof window==f&&window)||l(typeof self==f&&self)||l(typeof i==f&&i)||Function("return this")(),d=function(t){try{return!!t()}catch(t){return!0}},h=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,g={f:v&&!y.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:y},w=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m={}.toString,_=function(t){return m.call(t).slice(8,-1)},b="".split,O=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==_(t)?b.call(t,""):Object(t)}:Object,E=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return O(E(t))},S=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=function(t,e){if(!S(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!S(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,P=function(t,e){return A.call(t,e)},x=p.document,U=S(x)&&S(x.createElement),C=function(t){return U?x.createElement(t):{}},k=!h&&!d(function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a}),I=Object.getOwnPropertyDescriptor,F={f:h?I:function(t,e){if(t=T(t),e=j(e,!0),k)try{return I(t,e)}catch(t){}if(P(t,e))return w(!g.f.call(t,e),t[e])}},R=function(t){if(!S(t))throw TypeError(String(t)+" is not an object");return t},D=Object.defineProperty,L={f:h?D:function(t,e,n){if(R(t),e=j(e,!0),R(n),k)try{return D(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},M=h?function(t,e,n){return L.f(t,e,w(1,n))}:function(t,e,n){return t[e]=n,t},z=function(t,e){try{M(p,t,e)}catch(n){p[t]=e}return e},N=c(function(t){var e=p["__core-js_shared__"]||z("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),B=N("native-function-to-string",Function.toString),W=p.WeakMap,q="function"==typeof W&&/native code/.test(B.call(W)),G=0,J=Math.random(),H=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+J).toString(36)},Y=N("keys"),V=function(t){return Y[t]||(Y[t]=H(t))},K={},Q=p.WeakMap;if(q){var X=new Q,Z=X.get,$=X.has,tt=X.set;a=function(t,e){return tt.call(X,t,e),e},u=function(t){return Z.call(X,t)||{}},s=function(t){return $.call(X,t)}}else{var et=V("state");K[et]=!0,a=function(t,e){return M(t,et,e),e},u=function(t){return P(t,et)?t[et]:{}},s=function(t){return P(t,et)}}var nt={set:a,get:u,has:s,enforce:function(t){return s(t)?u(t):a(t,{})},getterFor:function(t){return function(e){var n;if(!S(e)||(n=u(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},rt=c(function(t){var e=nt.get,n=nt.enforce,r=String(B).split("toString");N("inspectSource",function(t){return B.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||P(o,"name")||M(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==p?(c?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=o:M(t,e,o)):a?t[e]=o:z(e,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||B.call(this)})}),ot=p,it=function(t){return"function"==typeof t?t:void 0},ct=function(t,e){return arguments.length<2?it(ot[t])||it(p[t]):ot[t]&&ot[t][e]||p[t]&&p[t][e]},at=Math.ceil,ut=Math.floor,st=function(t){return isNaN(t=+t)?0:(t>0?ut:at)(t)},ft=Math.min,lt=function(t){return t>0?ft(st(t),9007199254740991):0},pt=Math.max,dt=Math.min,ht=function(t){return function(e,n,r){var o,i=T(e),c=lt(i.length),a=function(t,e){var n=st(t);return n<0?pt(n+e,0):dt(n,e)}(r,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},yt={includes:ht(!0),indexOf:ht(!1)},vt=yt.indexOf,gt=function(t,e){var n,r=T(t),o=0,i=[];for(n in r)!P(K,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mt=wt.concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return gt(t,mt)}},bt={f:Object.getOwnPropertySymbols},Ot=ct("Reflect","ownKeys")||function(t){var e=_t.f(R(t)),n=bt.f;return n?e.concat(n(t)):e},Et=function(t,e){for(var n=Ot(e),r=L.f,o=F.f,i=0;i<n.length;i++){var c=n[i];P(t,c)||r(t,c,o(e,c))}},Tt=/#|\.prototype\./,St=function(t,e){var n=At[jt(t)];return n==xt||n!=Pt&&("function"==typeof e?d(e):!!e)},jt=St.normalize=function(t){return String(t).replace(Tt,".").toLowerCase()},At=St.data={},Pt=St.NATIVE="N",xt=St.POLYFILL="P",Ut=St,Ct=F.f,kt=function(t,e){var n,r,o,i,c,a=t.target,u=t.global,s=t.stat;if(n=u?p:s?p[a]||z(a,{}):(p[a]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=Ct(n,r))&&c.value:n[r],!Ut(u?r:a+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Et(i,o)}(t.sham||o&&o.sham)&&M(i,"sham",!0),rt(n,r,i,t)}},It=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())}),Ft=p.Symbol,Rt=N("wks"),Dt=function(t){return Rt[t]||(Rt[t]=It&&Ft[t]||(It?Ft:H)("Symbol."+t))},Lt=Dt("match"),Mt=function(t){if(function(t){var e;return S(t)&&(void 0!==(e=t[Lt])?!!e:"RegExp"==_(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},zt=Dt("match"),Nt="".startsWith,Bt=Math.min;kt({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[zt]=!1,"/./"[t](e)}catch(t){}}return!1}("startsWith")},{startsWith:function(t){var e=String(E(this));Mt(t);var n=lt(Bt(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return Nt?Nt.call(e,r,n):e.slice(n,n+r.length)===r}});var Wt,qt,Gt,Jt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Ht=function(t,e,n){if(Jt(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},Yt=Function.call,Vt=function(t,e,n){return Ht(Yt,p[t].prototype[e],n)},Kt=(Vt("String","startsWith"),function(t){return function(e,n){var r,o,i=String(E(e)),c=st(n),a=i.length;return c<0||c>=a?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===a||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}}),Qt={codeAt:Kt(!1),charAt:Kt(!0)},Xt=function(t){return Object(E(t))},Zt=!d(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),$t=V("IE_PROTO"),te=Object.prototype,ee=Zt?Object.getPrototypeOf:function(t){return t=Xt(t),P(t,$t)?t[$t]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?te:null},ne=Dt("iterator"),re=!1;[].keys&&("next"in(Gt=[].keys())?(qt=ee(ee(Gt)))!==Object.prototype&&(Wt=qt):re=!0),null==Wt&&(Wt={}),P(Wt,ne)||M(Wt,ne,function(){return this});var oe={IteratorPrototype:Wt,BUGGY_SAFARI_ITERATORS:re},ie=Object.keys||function(t){return gt(t,wt)},ce=h?Object.defineProperties:function(t,e){R(t);for(var n,r=ie(e),o=r.length,i=0;o>i;)L.f(t,n=r[i++],e[n]);return t},ae=ct("document","documentElement"),ue=V("IE_PROTO"),se=function(){},fe=function(){var t,e=C("iframe"),n=wt.length;for(e.style.display="none",ae.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),fe=t.F;n--;)delete fe.prototype[wt[n]];return fe()},le=Object.create||function(t,e){var n;return null!==t?(se.prototype=R(t),n=new se,se.prototype=null,n[ue]=t):n=fe(),void 0===e?n:ce(n,e)};K[ue]=!0;var pe=L.f,de=Dt("toStringTag"),he=function(t,e,n){t&&!P(t=n?t:t.prototype,de)&&pe(t,de,{configurable:!0,value:e})},ye={},ve=oe.IteratorPrototype,ge=function(){return this},we=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return R(n),function(t){if(!S(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),me=oe.IteratorPrototype,_e=oe.BUGGY_SAFARI_ITERATORS,be=Dt("iterator"),Oe=function(){return this},Ee=Qt.charAt,Te=nt.set,Se=nt.getterFor("String Iterator");!function(t,e,n,r,o,i,c){!function(t,e,n){var r=e+" Iterator";t.prototype=le(ve,{next:w(1,n)}),he(t,r,!1),ye[r]=ge}(n,e,r);var a,u,s,f=function(t){if(t===o&&y)return y;if(!_e&&t in d)return d[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",p=!1,d=t.prototype,h=d[be]||d["@@iterator"]||o&&d[o],y=!_e&&h||f(o),v="Array"==e&&d.entries||h;if(v&&(a=ee(v.call(new t)),me!==Object.prototype&&a.next&&(ee(a)!==me&&(we?we(a,me):"function"!=typeof a[be]&&M(a,be,Oe)),he(a,l,!0))),"values"==o&&h&&"values"!==h.name&&(p=!0,y=function(){return h.call(this)}),d[be]!==y&&M(d,be,y),ye[e]=y,o)if(u={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},c)for(s in u)!_e&&!p&&s in d||rt(d,s,u[s]);else kt({target:e,proto:!0,forced:_e||p},u)}(String,"String",function(t){Te(this,{type:"String Iterator",string:String(t),index:0})},function(){var t,e=Se(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Ee(n,r),e.index+=t.length,{value:t,done:!1})});var je=function(t,e,n,r){try{return r?e(R(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&R(o.call(t)),e}},Ae=Dt("iterator"),Pe=Array.prototype,xe=function(t){return void 0!==t&&(ye.Array===t||Pe[Ae]===t)},Ue=function(t,e,n){var r=j(e);r in t?L.f(t,r,w(0,n)):t[r]=n},Ce=Dt("toStringTag"),ke="Arguments"==_(function(){return arguments}()),Ie=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ce))?n:ke?_(e):"Object"==(r=_(e))&&"function"==typeof e.callee?"Arguments":r},Fe=Dt("iterator"),Re=function(t){if(null!=t)return t[Fe]||t["@@iterator"]||ye[Ie(t)]},De=Dt("iterator"),Le=!1;try{var Me=0,ze={next:function(){return{done:!!Me++}},return:function(){Le=!0}};ze[De]=function(){return this},Array.from(ze,function(){throw 2})}catch(t){}var Ne=!function(t,e){if(!e&&!Le)return!1;var n=!1;try{var r={};r[De]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}(function(t){Array.from(t)});kt({target:"Array",stat:!0,forced:Ne},{from:function(t){var e,n,r,o,i=Xt(t),c="function"==typeof this?this:Array,a=arguments.length,u=a>1?arguments[1]:void 0,s=void 0!==u,f=0,l=Re(i);if(s&&(u=Ht(u,a>2?arguments[2]:void 0,2)),null==l||c==Array&&xe(l))for(n=new c(e=lt(i.length));e>f;f++)Ue(n,f,s?u(i[f],f):i[f]);else for(o=l.call(i),n=new c;!(r=o.next()).done;f++)Ue(n,f,s?je(o,u,[r.value,f],!0):r.value);return n.length=f,n}});ot.Array.from;var Be,We=L.f,qe=p.DataView,Ge=qe&&qe.prototype,Je=p.Int8Array,He=Je&&Je.prototype,Ye=p.Uint8ClampedArray,Ve=Ye&&Ye.prototype,Ke=Je&&ee(Je),Qe=He&&ee(He),Xe=Object.prototype,Ze=Xe.isPrototypeOf,$e=Dt("toStringTag"),tn=H("TYPED_ARRAY_TAG"),en=!(!p.ArrayBuffer||!qe),nn=en&&!!we&&"Opera"!==Ie(p.opera),rn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},on=function(t){return S(t)&&P(rn,Ie(t))};for(Be in rn)p[Be]||(nn=!1);if((!nn||"function"!=typeof Ke||Ke===Function.prototype)&&(Ke=function(){throw TypeError("Incorrect invocation")},nn))for(Be in rn)p[Be]&&we(p[Be],Ke);if((!nn||!Qe||Qe===Xe)&&(Qe=Ke.prototype,nn))for(Be in rn)p[Be]&&we(p[Be].prototype,Qe);if(nn&&ee(Ve)!==Qe&&we(Ve,Qe),h&&!P(Qe,$e))for(Be in!0,We(Qe,$e,{get:function(){return S(this)?this[tn]:void 0}}),rn)p[Be]&&M(p[Be],tn,Be);en&&we&&ee(Ge)!==Xe&&we(Ge,Xe);var cn=function(t){if(on(t))return t;throw TypeError("Target is not a typed array")},an=function(t){if(we){if(Ze.call(Ke,t))return t}else for(var e in rn)if(P(rn,Be)){var n=p[e];if(n&&(t===n||Ze.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},un=function(t,e,n){if(h){if(n)for(var r in rn){var o=p[r];o&&P(o.prototype,t)&&delete o.prototype[t]}Qe[t]&&!n||rt(Qe,t,n?e:nn&&He[t]||e)}},sn=Dt("species"),fn=cn,ln=an,pn=[].slice;un("slice",function(t,e){for(var n=pn.call(fn(this),t,e),r=function(t,e){var n,r=R(t).constructor;return void 0===r||null==(n=R(r)[sn])?e:Jt(n)}(this,this.constructor),o=0,i=n.length,c=new(ln(r))(i);i>o;)c[o]=n[o++];return c},d(function(){new Int8Array(1).slice()}));var dn=Dt("unscopables"),hn=Array.prototype;null==hn[dn]&&M(hn,dn,le(null));var yn,vn=yt.includes;kt({target:"Array",proto:!0},{includes:function(t){return vn(this,t,arguments.length>1?arguments[1]:void 0)}}),yn="includes",hn[dn][yn]=!0;Vt("Array","includes");function gn(t){var e=this.constructor;return this.then(function(n){return e.resolve(t()).then(function(){return n})},function(n){return e.resolve(t()).then(function(){return e.reject(n)})})}var wn=setTimeout;function mn(t){return Boolean(t&&void 0!==t.length)}function _n(){}function bn(t){if(!(this instanceof bn))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],An(t,this)}function On(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,bn._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void Tn(e.promise,t)}En(e.promise,r)}else(1===t._state?En:Tn)(e.promise,t._value)})):t._deferreds.push(e)}function En(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof bn)return t._state=3,t._value=e,void Sn(t);if("function"==typeof n)return void An((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,Sn(t)}catch(e){Tn(t,e)}var r,o}function Tn(t,e){t._state=2,t._value=e,Sn(t)}function Sn(t){2===t._state&&0===t._deferreds.length&&bn._immediateFn(function(){t._handled||bn._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)On(t,t._deferreds[e]);t._deferreds=null}function jn(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function An(t,e){var n=!1;try{t(function(t){n||(n=!0,En(e,t))},function(t){n||(n=!0,Tn(e,t))})}catch(t){if(n)return;n=!0,Tn(e,t)}}bn.prototype.catch=function(t){return this.then(null,t)},bn.prototype.then=function(t,e){var n=new this.constructor(_n);return On(this,new jn(t,e,n)),n},bn.prototype.finally=gn,bn.all=function(t){return new bn(function(e,n){if(!mn(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var a=c.then;if("function"==typeof a)return void a.call(c,function(e){i(t,e)},n)}r[t]=c,0==--o&&e(r)}catch(t){n(t)}}for(var c=0;c<r.length;c++)i(c,r[c])})},bn.resolve=function(t){return t&&"object"==typeof t&&t.constructor===bn?t:new bn(function(e){e(t)})},bn.reject=function(t){return new bn(function(e,n){n(t)})},bn.race=function(t){return new bn(function(e,n){if(!mn(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=t.length;r<o;r++)bn.resolve(t[r]).then(e,n)})},bn._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){wn(t,0)},bn._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var Pn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function xn(t,e){return e=e||{},new Promise(function(n,r){var o=new XMLHttpRequest,i=[],c=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return c},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var s in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){i.push(e=e.toLowerCase()),c.push([e,n]),a[e]=a[e]?a[e]+","+n:n}),n(u())},o.onerror=r,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(s,e.headers[s]);o.send(e.body||null)})}"Promise"in Pn?Pn.Promise.prototype.finally||(Pn.Promise.prototype.finally=gn):Pn.Promise=bn,function(t){function e(t){if("utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+t+"') is invalid.")}function n(t,e){if(e=void 0===e?{fatal:!1}:e,"utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(t.TextEncoder&&t.TextDecoder)return!1;Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);e<n;){var c=t.charCodeAt(e++);if(55296<=c&&56319>=c){if(e<n){var a=t.charCodeAt(e);56320==(64512&a)&&(++e,c=((1023&c)<<10)+(1023&a)+65536)}if(55296<=c&&56319>=c)continue}if(r+4>i.length&&(o+=8,o=(o*=1+e/t.length*2)>>3<<3,(a=new Uint8Array(o)).set(i),i=a),0==(4294967168&c))i[r++]=c;else{if(0==(4294965248&c))i[r++]=c>>6&31|192;else if(0==(4294901760&c))i[r++]=c>>12&15|224,i[r++]=c>>6&63|128;else{if(0!=(4292870144&c))continue;i[r++]=c>>18&7|240,i[r++]=c>>12&63|128,i[r++]=c>>6&63|128}i[r++]=63&c|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e=0;for(var n=(t=new Uint8Array(t)).length,r=[];e<n;){var o=t[e++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&t[e++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&t[e++];var c=63&t[e++];r.push((31&o)<<12|i<<6|c)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&t[e++])<<12|(c=63&t[e++])<<6|63&t[e++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:i);var Un,Cn={timeoutInSeconds:60},kn=function(t){return t.filter(function(e,n){return t.indexOf(e)===n})},In={error:"timeout",error_description:"Timeout"},Fn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean).join();return kn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Rn=function(){var t=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!t)throw new Error("Could not open popup");return t},Dn=function(t,n,r){return t.location.href=n,new Promise(function(n,o){var i=setTimeout(function(){o(e({},In,{popup:t}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(e){if(e.data&&"authorization_response"===e.data.type){if(clearTimeout(i),t.close(),e.data.response.error)return o(e.data.response);n(e.data.response)}})})},Ln=function(){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",e="";return Array.from(Jn().getRandomValues(new Uint8Array(43))).forEach(function(n){return e+=t[n%t.length]}),e},Mn=function(t){return btoa(t)},zn=function(t){return Object.keys(t).filter(function(e){return void 0!==t[e]}).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},Nn=function(t){return r(void 0,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,Promise.resolve(Hn().digest({name:"SHA-256"},(new TextEncoder).encode(t)))];case 1:return(e=n.sent()).result?[2,e.result]:[2,e]}})})},Bn=function(t){return function(t){return decodeURIComponent(atob(t).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(t.replace(/_/g,"/").replace(/-/g,"+"))},Wn=function(t){var e=new Uint8Array(t);return function(t){var e={"+":"-","/":"_","=":""};return t.replace(/[\+\/=]/g,function(t){return e[t]})}(window.btoa(String.fromCharCode.apply(String,Array.from(e))))},qn=function(t,e){return r(void 0,void 0,void 0,function(){var r,i,c,a,u,s,f;return o(this,function(o){switch(o.label){case 0:return[4,xn(t,e)];case 1:return[4,(r=o.sent()).json()];case 2:if(i=o.sent(),c=i.error,a=i.error_description,u=n(i,["error","error_description"]),!r.ok)throw s=a||"HTTP error. Unable to fetch "+t,(f=new Error(s)).error=c||"request_error",f.error_description=s,f;return[2,u]}})})},Gn=function(t){return r(void 0,void 0,void 0,function(){var r=t.baseUrl,i=n(t,["baseUrl"]);return o(this,function(t){switch(t.label){case 0:return[4,qn(r+"/oauth/token",{method:"POST",body:JSON.stringify(e({grant_type:"authorization_code",redirect_uri:window.location.origin},i)),headers:{"Content-type":"application/json"}})];case 1:return[2,t.sent()]}})})},Jn=function(){return window.crypto||window.msCrypto},Hn=function(){var t=Jn();return t.subtle||t.webkitSubtle},Yn=function(){if(!Jn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Hn())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},Vn=function(t){return t.audience+"::"+t.scope},Kn=function(){function t(){this.cache={}}return t.prototype.save=function(t){var e=this,n=Vn(t);this.cache[n]=t;var r,o,i,c=(r=t.expires_in,o=t.decodedToken.claims.exp,i=(new Date(1e3*o).getTime()-(new Date).getTime())/1e3,1e3*Math.min(r,i)*.8);setTimeout(function(){delete e.cache[n]},c)},t.prototype.get=function(t){return this.cache[Vn(t)]},t}(),Qn=c(function(t,e){var n=i&&i.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function r(t,e){if(!e)return"";var n="; "+t;return!0===e?n:n+"="+e}function o(t,e,n){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(t){if("number"==typeof t.expires){var e=new Date;e.setMilliseconds(e.getMilliseconds()+864e5*t.expires),t.expires=e}return r("Expires",t.expires?t.expires.toUTCString():"")+r("Domain",t.domain)+r("Path",t.path)+r("Secure",t.secure)+r("SameSite",t.sameSite)}(n)}function c(t){for(var e={},n=t?t.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),c=i.slice(1).join("=");'"'===c.charAt(0)&&(c=c.slice(1,-1));try{e[i[0].replace(r,decodeURIComponent)]=c.replace(r,decodeURIComponent)}catch(t){}}return e}function a(){return c(document.cookie)}function u(t,e,r){document.cookie=o(t,e,n({path:"/"},r))}e.__esModule=!0,e.encode=o,e.parse=c,e.getAll=a,e.get=function(t){return a()[t]},e.set=u,e.remove=function(t,e){u(t,"",n({},e,{expires:-1}))}});(Un=Qn)&&Un.__esModule&&Object.prototype.hasOwnProperty.call(Un,"default")&&Un.default;Qn.encode,Qn.parse;var Xn=Qn.getAll,Zn=Qn.get,$n=Qn.set,tr=Qn.remove,er=function(){return Object.keys(Xn()||{})},nr=function(t){var e=Zn(t);if(void 0!==e)return JSON.parse(e)},rr=function(t,e,n){$n(t,JSON.stringify(e),{expires:n.daysUntilExpire})},or=function(t){tr(t)},ir="a0.spajs.txs.",cr=function(t){return""+ir+t},ar=function(){function t(){var t=this;this.transactions={},er().filter(function(t){return t.startsWith(ir)}).forEach(function(e){var n=e.replace(ir,"");t.transactions[n]=nr(e)})}return t.prototype.create=function(t,e){this.transactions[t]=e,rr(cr(t),e,{daysUntilExpire:1})},t.prototype.get=function(t){return this.transactions[t]},t.prototype.remove=function(t){delete this.transactions[t],or(cr(t))},t}(),ur=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],sr=function(t){var e,n,r,o,i,c,a,u,s=(e=t.id_token,n=e.split("."),r=n[0],o=n[1],i=n[2],c=JSON.parse(Bn(o)),a={__raw:e},u={},Object.keys(c).forEach(function(t){a[t]=c[t],ur.includes(t)||(u[t]=c[t])}),{encoded:{header:r,payload:o,signature:i},header:JSON.parse(Bn(r)),claims:a,user:u});if(s.claims.iss!==t.iss)throw new Error("Invalid issuer");if(s.claims.aud!==t.aud)throw new Error("Invalid audience");if("RS256"!==s.header.alg)throw new Error("Invalid algorithm");if(s.claims.nonce!==t.nonce)throw new Error("Invalid nonce");var f=new Date,l=new Date(0),p=new Date(0),d=new Date(0),h=t.leeway||60;if(l.setUTCSeconds(s.claims.exp+h),p.setUTCSeconds(s.claims.iat-h),d.setUTCSeconds(s.claims.nbf-h),f>l)throw new Error("id_token expired");if(f<p)throw new Error("id_token was issued in the future (invalid iat)");if(void 0!==s.claims.nbf&&f<d)throw new Error("token is not yet valid (invalid notBefore)");return s},fr=function(e){function n(t,r,o){var i=e.call(this,r)||this;return i.error=t,i.error_description=r,i.state=o,Object.setPrototypeOf(i,n.prototype),i}return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,e),n}(Error),lr=function(){function t(t){this.options=t,this.DEFAULT_SCOPE="openid profile email",this.cache=new Kn,this.transactionManager=new ar,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return t.prototype._url=function(t){var e=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.3.2"})));return""+this.domainUrl+t+"&auth0Client="+e},t.prototype._getParams=function(t,r,o,i,c){var a=this.options,u=(a.domain,a.leeway,n(a,["domain","leeway"]));return e({},u,t,{scope:Fn(this.DEFAULT_SCOPE,this.options.scope,t.scope),response_type:"code",response_mode:"query",state:r,nonce:o,redirect_uri:c||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},t.prototype._authorizeUrl=function(t){return this._url("/authorize?"+zn(t))},t.prototype._verifyIdToken=function(t,e){return sr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:e,leeway:this.options.leeway})},t.prototype.loginWithPopup=function(t,i){return void 0===t&&(t={}),void 0===i&&(i=Cn),r(this,void 0,void 0,function(){var r,c,a,u,s,f,l,p,d,h,y,v,g;return o(this,function(o){switch(o.label){case 0:return[4,Rn()];case 1:return r=o.sent(),c=n(t,[]),a=Mn(Ln()),u=Ln(),s=Ln(),[4,Nn(s)];case 2:return f=o.sent(),l=Wn(f),p=this._getParams(c,a,u,l,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(e({},p,{response_mode:"web_message"})),[4,Dn(r,d,i)];case 3:if(h=o.sent(),a!==h.state)throw new Error("Invalid state");return[4,Gn({baseUrl:this.domainUrl,audience:t.audience||this.options.audience,client_id:this.options.client_id,code_verifier:s,code:h.code})];case 4:return y=o.sent(),v=this._verifyIdToken(y.id_token,u),g=e({},y,{decodedToken:v,scope:p.scope,audience:p.audience||"default"}),this.cache.save(g),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},t.prototype.getUser=function(t){return void 0===t&&(t={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var e;return o(this,function(n){return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),[2,(e=this.cache.get(t))&&e.decodedToken.user]})})},t.prototype.getIdTokenClaims=function(t){return void 0===t&&(t={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var e;return o(this,function(n){return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),[2,(e=this.cache.get(t))&&e.decodedToken.claims]})})},t.prototype.loginWithRedirect=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){var e,r,i,c,a,u,s,f,l,p;return o(this,function(o){switch(o.label){case 0:return e=t.redirect_uri,r=t.appState,i=n(t,["redirect_uri","appState"]),c=Mn(Ln()),a=Ln(),u=Ln(),[4,Nn(u)];case 1:return s=o.sent(),f=Wn(s),l=this._getParams(i,c,a,f,e),p=this._authorizeUrl(l),this.transactionManager.create(c,{nonce:a,code_verifier:u,appState:r,scope:l.scope,audience:l.audience||"default"}),window.location.assign(p),[2]}})})},t.prototype.handleRedirectCallback=function(){return r(this,void 0,void 0,function(){var t,n,r,i,c,a,u,s,f,l;return o(this,function(o){switch(o.label){case 0:if(0===(t=window.location.href.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(n=function(t){t.indexOf("#")>-1&&(t=t.substr(0,t.indexOf("#")));var n=t.split("&"),r={};return n.forEach(function(t){var e=t.split("="),n=e[0],o=e[1];r[n]=decodeURIComponent(o)}),e({},r,{expires_in:parseInt(r.expires_in)})}(t.join("")),r=n.state,i=n.code,c=n.error,a=n.error_description,c)throw new fr(c,a,r);if(!(u=this.transactionManager.get(r)))throw new Error("Invalid state");return this.transactionManager.remove(r),[4,Gn({baseUrl:this.domainUrl,audience:this.options.audience,client_id:this.options.client_id,code_verifier:u.code_verifier,code:i})];case 1:return s=o.sent(),f=this._verifyIdToken(s.id_token,u.nonce),l=e({},s,{decodedToken:f,audience:u.audience,scope:u.scope}),this.cache.save(l),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},t.prototype.getTokenSilently=function(t){return void 0===t&&(t={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE,ignoreCache:!1}),r(this,void 0,void 0,function(){var n,r,i,c,a,u,s,f,l,p,d,h,y;return o(this,function(o){switch(o.label){case 0:return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),!t.ignoreCache&&(n=this.cache.get({scope:t.scope,audience:t.audience||"default"}))?[2,n.access_token]:(r=Mn(Ln()),i=Ln(),c=Ln(),[4,Nn(c)]);case 1:return a=o.sent(),u=Wn(a),s={audience:t.audience,scope:t.scope},f=this._getParams(s,r,i,u,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(e({},f,{prompt:"none",response_mode:"web_message"})),[4,(v=l,g=this.domainUrl,new Promise(function(t,e){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){e(In),window.document.body.removeChild(n)},6e4),o=function(i){i.origin==g&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?e(i.data.response):t(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",v)}))];case 2:if(p=o.sent(),r!==p.state)throw new Error("Invalid state");return[4,Gn({baseUrl:this.domainUrl,audience:t.audience||this.options.audience,client_id:this.options.client_id,code_verifier:c,code:p.code})];case 3:return d=o.sent(),h=this._verifyIdToken(d.id_token,i),y=e({},d,{decodedToken:h,scope:f.scope,audience:f.audience||"default"}),this.cache.save(y),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,d.access_token]}var v,g})})},t.prototype.getTokenWithPopup=function(t,e){return void 0===t&&(t={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===e&&(e=Cn),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return t.scope=Fn(this.DEFAULT_SCOPE,this.options.scope,t.scope),[4,this.loginWithPopup(t,e)];case 1:return n.sent(),[2,this.cache.get({scope:t.scope,audience:t.audience||"default"}).access_token]}})})},t.prototype.isAuthenticated=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getUser()];case 1:return[2,!!t.sent()]}})})},t.prototype.logout=function(t){void 0===t&&(t={}),null!==t.client_id?t.client_id=t.client_id||this.options.client_id:delete t.client_id,or("auth0.is.authenticated");var e=t.federated,r=n(t,["federated"]),o=e?"&federated":"",i=this._url("/v2/logout?"+zn(r));window.location.assign(""+i+o)},t}();export default function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:if(Yn(),e=new lr(t),!nr("auth0.is.authenticated"))return[2,e];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.getTokenSilently({audience:t.audience,scope:t.scope,ignoreCache:!0})];case 2:case 3:return n.sent(),[3,4];case 4:return[2,e]}})})}
var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};var t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}u((r=r.apply(e,t||[])).next())})}function o(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e,t){return e(t={exports:{}},t.exports),t.exports}var c,u,s,f="object",l=function(e){return e&&e.Math==Math&&e},p=l(typeof globalThis==f&&globalThis)||l(typeof window==f&&window)||l(typeof self==f&&self)||l(typeof i==f&&i)||Function("return this")(),d=function(e){try{return!!e()}catch(e){return!0}},h=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,m={f:v&&!y.call({1:2},1)?function(e){var t=v(this,e);return!!t&&t.enumerable}:y},w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g={}.toString,b=function(e){return g.call(e).slice(8,-1)},_="".split,E=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==b(e)?_.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},S=function(e){return E(T(e))},O=function(e){return"object"==typeof e?null!==e:"function"==typeof e},k=function(e,t){if(!O(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!O(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!O(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!O(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,x=function(e,t){return A.call(e,t)},j=p.document,I=O(j)&&O(j.createElement),P=function(e){return I?j.createElement(e):{}},C=!h&&!d(function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a}),U=Object.getOwnPropertyDescriptor,D={f:h?U:function(e,t){if(e=S(e),t=k(t,!0),C)try{return U(e,t)}catch(e){}if(x(e,t))return w(!m.f.call(e,t),e[t])}},F=function(e){if(!O(e))throw TypeError(String(e)+" is not an object");return e},R=Object.defineProperty,L={f:h?R:function(e,t,n){if(F(e),t=k(t,!0),F(n),C)try{return R(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},M=h?function(e,t,n){return L.f(e,t,w(1,n))}:function(e,t,n){return e[t]=n,e},z=function(e,t){try{M(p,e,t)}catch(n){p[e]=t}return t},N=a(function(e){var t=p["__core-js_shared__"]||z("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),W=N("native-function-to-string",Function.toString),q=p.WeakMap,B="function"==typeof q&&/native code/.test(W.call(q)),J=0,G=Math.random(),H=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++J+G).toString(36)},Y=N("keys"),V=function(e){return Y[e]||(Y[e]=H(e))},K={},Q=p.WeakMap;if(B){var X=new Q,Z=X.get,$=X.has,ee=X.set;c=function(e,t){return ee.call(X,e,t),t},u=function(e){return Z.call(X,e)||{}},s=function(e){return $.call(X,e)}}else{var te=V("state");K[te]=!0,c=function(e,t){return M(e,te,t),t},u=function(e){return x(e,te)?e[te]:{}},s=function(e){return x(e,te)}}var ne={set:c,get:u,has:s,enforce:function(e){return s(e)?u(e):c(e,{})},getterFor:function(e){return function(t){var n;if(!O(t)||(n=u(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},re=a(function(e){var t=ne.get,n=ne.enforce,r=String(W).split("toString");N("inspectSource",function(e){return W.call(e)}),(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||x(o,"name")||M(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==p?(a?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=o:M(e,t,o)):c?e[t]=o:z(t,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||W.call(this)})}),oe=p,ie=function(e){return"function"==typeof e?e:void 0},ae=function(e,t){return arguments.length<2?ie(oe[e])||ie(p[e]):oe[e]&&oe[e][t]||p[e]&&p[e][t]},ce=Math.ceil,ue=Math.floor,se=function(e){return isNaN(e=+e)?0:(e>0?ue:ce)(e)},fe=Math.min,le=function(e){return e>0?fe(se(e),9007199254740991):0},pe=Math.max,de=Math.min,he=function(e){return function(t,n,r){var o,i=S(t),a=le(i.length),c=function(e,t){var n=se(e);return n<0?pe(n+t,0):de(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},ye={includes:he(!0),indexOf:he(!1)},ve=ye.indexOf,me=function(e,t){var n,r=S(e),o=0,i=[];for(n in r)!x(K,n)&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~ve(i,n)||i.push(n));return i},we=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=we.concat("length","prototype"),be={f:Object.getOwnPropertyNames||function(e){return me(e,ge)}},_e={f:Object.getOwnPropertySymbols},Ee=ae("Reflect","ownKeys")||function(e){var t=be.f(F(e)),n=_e.f;return n?t.concat(n(e)):t},Te=function(e,t){for(var n=Ee(t),r=L.f,o=D.f,i=0;i<n.length;i++){var a=n[i];x(e,a)||r(e,a,o(t,a))}},Se=/#|\.prototype\./,Oe=function(e,t){var n=Ae[ke(e)];return n==je||n!=xe&&("function"==typeof t?d(t):!!t)},ke=Oe.normalize=function(e){return String(e).replace(Se,".").toLowerCase()},Ae=Oe.data={},xe=Oe.NATIVE="N",je=Oe.POLYFILL="P",Ie=Oe,Pe=D.f,Ce=function(e,t){var n,r,o,i,a,c=e.target,u=e.global,s=e.stat;if(n=u?p:s?p[c]||z(c,{}):(p[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=Pe(n,r))&&a.value:n[r],!Ie(u?r:c+(s?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Te(i,o)}(e.sham||o&&o.sham)&&M(i,"sham",!0),re(n,r,i,e)}},Ue=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())}),De=p.Symbol,Fe=N("wks"),Re=function(e){return Fe[e]||(Fe[e]=Ue&&De[e]||(Ue?De:H)("Symbol."+e))},Le=Re("match"),Me=function(e){if(function(e){var t;return O(e)&&(void 0!==(t=e[Le])?!!t:"RegExp"==b(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},ze=Re("match"),Ne="".startsWith,We=Math.min;Ce({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[ze]=!1,"/./"[e](t)}catch(e){}}return!1}("startsWith")},{startsWith:function(e){var t=String(T(this));Me(e);var n=le(We(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Ne?Ne.call(t,r,n):t.slice(n,n+r.length)===r}});var qe,Be,Je,Ge=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},He=function(e,t,n){if(Ge(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},Ye=Function.call,Ve=function(e,t,n){return He(Ye,p[e].prototype[t],n)},Ke=(Ve("String","startsWith"),function(e){return function(t,n){var r,o,i=String(T(t)),a=se(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),Qe={codeAt:Ke(!1),charAt:Ke(!0)},Xe=function(e){return Object(T(e))},Ze=!d(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),$e=V("IE_PROTO"),et=Object.prototype,tt=Ze?Object.getPrototypeOf:function(e){return e=Xe(e),x(e,$e)?e[$e]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?et:null},nt=Re("iterator"),rt=!1;[].keys&&("next"in(Je=[].keys())?(Be=tt(tt(Je)))!==Object.prototype&&(qe=Be):rt=!0),null==qe&&(qe={}),x(qe,nt)||M(qe,nt,function(){return this});var ot={IteratorPrototype:qe,BUGGY_SAFARI_ITERATORS:rt},it=Object.keys||function(e){return me(e,we)},at=h?Object.defineProperties:function(e,t){F(e);for(var n,r=it(t),o=r.length,i=0;o>i;)L.f(e,n=r[i++],t[n]);return e},ct=ae("document","documentElement"),ut=V("IE_PROTO"),st=function(){},ft=function(){var e,t=P("iframe"),n=we.length;for(t.style.display="none",ct.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),ft=e.F;n--;)delete ft.prototype[we[n]];return ft()},lt=Object.create||function(e,t){var n;return null!==e?(st.prototype=F(e),n=new st,st.prototype=null,n[ut]=e):n=ft(),void 0===t?n:at(n,t)};K[ut]=!0;var pt=L.f,dt=Re("toStringTag"),ht=function(e,t,n){e&&!x(e=n?e:e.prototype,dt)&&pt(e,dt,{configurable:!0,value:t})},yt={},vt=ot.IteratorPrototype,mt=function(){return this},wt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return F(n),function(e){if(!O(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),gt=ot.IteratorPrototype,bt=ot.BUGGY_SAFARI_ITERATORS,_t=Re("iterator"),Et=function(){return this},Tt=Qe.charAt,St=ne.set,Ot=ne.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=lt(vt,{next:w(1,n)}),ht(e,r,!1),yt[r]=mt}(n,t,r);var c,u,s,f=function(e){if(e===o&&y)return y;if(!bt&&e in d)return d[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",p=!1,d=e.prototype,h=d[_t]||d["@@iterator"]||o&&d[o],y=!bt&&h||f(o),v="Array"==t&&d.entries||h;if(v&&(c=tt(v.call(new e)),gt!==Object.prototype&&c.next&&(tt(c)!==gt&&(wt?wt(c,gt):"function"!=typeof c[_t]&&M(c,_t,Et)),ht(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(p=!0,y=function(){return h.call(this)}),d[_t]!==y&&M(d,_t,y),yt[t]=y,o)if(u={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(s in u)!bt&&!p&&s in d||re(d,s,u[s]);else Ce({target:t,proto:!0,forced:bt||p},u)}(String,"String",function(e){St(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=Ot(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Tt(n,r),t.index+=e.length,{value:e,done:!1})});var kt=function(e,t,n,r){try{return r?t(F(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&F(o.call(e)),t}},At=Re("iterator"),xt=Array.prototype,jt=function(e){return void 0!==e&&(yt.Array===e||xt[At]===e)},It=function(e,t,n){var r=k(t);r in e?L.f(e,r,w(0,n)):e[r]=n},Pt=Re("toStringTag"),Ct="Arguments"==b(function(){return arguments}()),Ut=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Pt))?n:Ct?b(t):"Object"==(r=b(t))&&"function"==typeof t.callee?"Arguments":r},Dt=Re("iterator"),Ft=function(e){if(null!=e)return e[Dt]||e["@@iterator"]||yt[Ut(e)]},Rt=Re("iterator"),Lt=!1;try{var Mt=0,zt={next:function(){return{done:!!Mt++}},return:function(){Lt=!0}};zt[Rt]=function(){return this},Array.from(zt,function(){throw 2})}catch(e){}var Nt=!function(e,t){if(!t&&!Lt)return!1;var n=!1;try{var r={};r[Rt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}(function(e){Array.from(e)});Ce({target:"Array",stat:!0,forced:Nt},{from:function(e){var t,n,r,o,i=Xe(e),a="function"==typeof this?this:Array,c=arguments.length,u=c>1?arguments[1]:void 0,s=void 0!==u,f=0,l=Ft(i);if(s&&(u=He(u,c>2?arguments[2]:void 0,2)),null==l||a==Array&&jt(l))for(n=new a(t=le(i.length));t>f;f++)It(n,f,s?u(i[f],f):i[f]);else for(o=l.call(i),n=new a;!(r=o.next()).done;f++)It(n,f,s?kt(o,u,[r.value,f],!0):r.value);return n.length=f,n}});oe.Array.from;var Wt,qt=L.f,Bt=p.DataView,Jt=Bt&&Bt.prototype,Gt=p.Int8Array,Ht=Gt&&Gt.prototype,Yt=p.Uint8ClampedArray,Vt=Yt&&Yt.prototype,Kt=Gt&&tt(Gt),Qt=Ht&&tt(Ht),Xt=Object.prototype,Zt=Xt.isPrototypeOf,$t=Re("toStringTag"),en=H("TYPED_ARRAY_TAG"),tn=!(!p.ArrayBuffer||!Bt),nn=tn&&!!wt&&"Opera"!==Ut(p.opera),rn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},on=function(e){return O(e)&&x(rn,Ut(e))};for(Wt in rn)p[Wt]||(nn=!1);if((!nn||"function"!=typeof Kt||Kt===Function.prototype)&&(Kt=function(){throw TypeError("Incorrect invocation")},nn))for(Wt in rn)p[Wt]&&wt(p[Wt],Kt);if((!nn||!Qt||Qt===Xt)&&(Qt=Kt.prototype,nn))for(Wt in rn)p[Wt]&&wt(p[Wt].prototype,Qt);if(nn&&tt(Vt)!==Qt&&wt(Vt,Qt),h&&!x(Qt,$t))for(Wt in!0,qt(Qt,$t,{get:function(){return O(this)?this[en]:void 0}}),rn)p[Wt]&&M(p[Wt],en,Wt);tn&&wt&&tt(Jt)!==Xt&&wt(Jt,Xt);var an=function(e){if(on(e))return e;throw TypeError("Target is not a typed array")},cn=function(e){if(wt){if(Zt.call(Kt,e))return e}else for(var t in rn)if(x(rn,Wt)){var n=p[t];if(n&&(e===n||Zt.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},un=function(e,t,n){if(h){if(n)for(var r in rn){var o=p[r];o&&x(o.prototype,e)&&delete o.prototype[e]}Qt[e]&&!n||re(Qt,e,n?t:nn&&Ht[e]||t)}},sn=Re("species"),fn=an,ln=cn,pn=[].slice;un("slice",function(e,t){for(var n=pn.call(fn(this),e,t),r=function(e,t){var n,r=F(e).constructor;return void 0===r||null==(n=F(r)[sn])?t:Ge(n)}(this,this.constructor),o=0,i=n.length,a=new(ln(r))(i);i>o;)a[o]=n[o++];return a},d(function(){new Int8Array(1).slice()}));var dn=Re("unscopables"),hn=Array.prototype;null==hn[dn]&&M(hn,dn,lt(null));var yn,vn=ye.includes;Ce({target:"Array",proto:!0},{includes:function(e){return vn(this,e,arguments.length>1?arguments[1]:void 0)}}),yn="includes",hn[dn][yn]=!0;Ve("Array","includes");function mn(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var wn=setTimeout;function gn(e){return Boolean(e&&void 0!==e.length)}function bn(){}function _n(e){if(!(this instanceof _n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],An(e,this)}function En(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,_n._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void Sn(t.promise,e)}Tn(t.promise,r)}else(1===e._state?Tn:Sn)(t.promise,e._value)})):e._deferreds.push(t)}function Tn(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof _n)return e._state=3,e._value=t,void On(e);if("function"==typeof n)return void An((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,On(e)}catch(t){Sn(e,t)}var r,o}function Sn(e,t){e._state=2,e._value=t,On(e)}function On(e){2===e._state&&0===e._deferreds.length&&_n._immediateFn(function(){e._handled||_n._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)En(e,e._deferreds[t]);e._deferreds=null}function kn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function An(e,t){var n=!1;try{e(function(e){n||(n=!0,Tn(t,e))},function(e){n||(n=!0,Sn(t,e))})}catch(e){if(n)return;n=!0,Sn(t,e)}}_n.prototype.catch=function(e){return this.then(null,e)},_n.prototype.then=function(e,t){var n=new this.constructor(bn);return En(this,new kn(e,t,n)),n},_n.prototype.finally=mn,_n.all=function(e){return new _n(function(t,n){if(!gn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(t){i(e,t)},n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},_n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===_n?e:new _n(function(t){t(e)})},_n.reject=function(e){return new _n(function(t,n){n(e)})},_n.race=function(e){return new _n(function(t,n){if(!gn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)_n.resolve(e[r]).then(t,n)})},_n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){wn(e,0)},_n._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var xn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in xn?xn.Promise.prototype.finally||(xn.Promise.prototype.finally=mn):xn.Promise=_n,function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function n(e,t){if(t=void 0===t?{fatal:!1}:t,"utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var n=(e=new Uint8Array(e)).length,r=[];t<n;){var o=e[t++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&e[t++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];r.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:i);var jn=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}u((r=r.apply(e,t||[])).next())})},In=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Pn="browser-tabs-lock-key";function Cn(e){return new Promise(function(t){return setTimeout(t,e)})}function Un(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var Dn=function(){function e(){this.id=Date.now().toString()+Un(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(e,t){return void 0===t&&(t=5e3),jn(this,void 0,void 0,function(){var n,r,o,i,a,c;return In(this,function(u){switch(u.label){case 0:n=Date.now()+Un(4),r=Date.now()+t,o=Pn+"-"+e,i=window.localStorage,u.label=1;case 1:return Date.now()<r?null!==i.getItem(o)?[3,4]:(a=this.id+"-"+e+"-"+n,[4,Cn(Math.floor(25*Math.random()))]):[3,7];case 2:return u.sent(),i.setItem(o,JSON.stringify({id:this.id,iat:n,timeoutKey:a,timeAcquired:Date.now()})),[4,Cn(30)];case 3:return u.sent(),null!==(c=i.getItem(o))&&(c=JSON.parse(c)).id===this.id&&c.iat===n?[2,!0]:[3,6];case 4:return Fn(),[4,this.waitForSomethingToChange(r)];case 5:u.sent(),u.label=6;case 6:return n=Date.now()+Un(4),[3,1];case 7:return[2,!1]}})})},e.prototype.waitForSomethingToChange=function(t){return jn(this,void 0,void 0,function(){return In(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=50,a=!1;function c(){if(a||(window.removeEventListener("storage",c),e.removeFromWaiting(c),clearTimeout(u),a=!0),!r){r=!0;var t=i-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",c),e.addToWaiting(c);var u=setTimeout(c,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return this.releaseLock__private__(e)},e.prototype.releaseLock__private__=function(t,n){void 0===n&&(n=null);var r=window.localStorage,o=Pn+"-"+t,i=r.getItem(o);null!==i&&((i=JSON.parse(i)).id!==this.id||null!==n&&i.iat!==n||(r.removeItem(o),e.notifyWaiters()))},e.waiters=void 0,e}();function Fn(){for(var e=Date.now()-1e4,t=window.localStorage,n=Object.keys(t),r=!1,o=0;o<n.length;o++){var i=n[o];if(i.includes(Pn)){var a=t.getItem(i);null!==a&&(a=JSON.parse(a)).timeAcquired<e&&(t.removeItem(i),r=!0)}}r&&Dn.notifyWaiters()}function Rn(e,t){return t=t||{},new Promise(function(n,r){var o=new XMLHttpRequest,i=[],a=[],c={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var s in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){i.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n}),n(u())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(s,t.headers[s]);o.send(t.body||null)})}var Ln,Mn={timeoutInSeconds:60},zn=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})},Nn={error:"timeout",error_description:"Timeout"},Wn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return zn(n.replace(/\s/g,",").split(",")).join(" ").trim()},qn=function(){var e=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!e)throw new Error("Could not open popup");return e},Bn=function(e,n,r){return e.location.href=n,new Promise(function(n,o){var i=setTimeout(function(){o(t({},Nn,{popup:e}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(t){if(t.data&&"authorization_response"===t.data.type){if(clearTimeout(i),e.close(),t.data.response.error)return o(t.data.response);n(t.data.response)}})})},Jn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Zn().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Gn=function(e){return btoa(e)},Hn=function(e){return Object.keys(e).filter(function(t){return void 0!==e[t]}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Yn=function(e){return r(void 0,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return t=$n().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise(function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},Vn=function(e){return function(e){return decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Kn=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,function(e){return t[e]})}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},Qn=function(e,t){return r(void 0,void 0,void 0,function(){var r,i,a,c,u,s,f;return o(this,function(o){switch(o.label){case 0:return[4,Rn(e,t)];case 1:return[4,(r=o.sent()).json()];case 2:if(i=o.sent(),a=i.error,c=i.error_description,u=n(i,["error","error_description"]),!r.ok)throw s=c||"HTTP error. Unable to fetch "+e,(f=new Error(s)).error=a||"request_error",f.error_description=s,f;return[2,u]}})})},Xn=function(e){return r(void 0,void 0,void 0,function(){var r=e.baseUrl,i=n(e,["baseUrl"]);return o(this,function(e){switch(e.label){case 0:return[4,Qn(r+"/oauth/token",{method:"POST",body:JSON.stringify(t({grant_type:"authorization_code",redirect_uri:window.location.origin},i)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}})})},Zn=function(){return window.crypto||window.msCrypto},$n=function(){var e=Zn();return e.subtle||e.webkitSubtle},er=function(){if(!Zn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===$n())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},tr=function(e){return e.audience+"::"+e.scope},nr=function(){function e(){this.cache={}}return e.prototype.save=function(e){var t=this,n=tr(e);this.cache[n]=e;var r,o,i,a=(r=e.expires_in,o=e.decodedToken.claims.exp,i=(new Date(1e3*o).getTime()-(new Date).getTime())/1e3,1e3*Math.min(r,i)*.8);setTimeout(function(){delete t.cache[n]},a)},e.prototype.get=function(e){return this.cache[tr(e)]},e}(),rr=a(function(e,t){var n=i&&i.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function a(e){for(var t={},n=e?e.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return a(document.cookie)}function u(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=a,t.getAll=c,t.get=function(e){return c()[e]},t.set=u,t.remove=function(e,t){u(e,"",n({},t,{expires:-1}))}});(Ln=rr)&&Ln.__esModule&&Object.prototype.hasOwnProperty.call(Ln,"default")&&Ln.default;rr.encode,rr.parse;var or=rr.getAll,ir=rr.get,ar=rr.set,cr=rr.remove,ur=function(){return Object.keys(or()||{})},sr=function(e){var t=ir(e);if(void 0!==t)return JSON.parse(t)},fr=function(e,t,n){ar(e,JSON.stringify(t),{expires:n.daysUntilExpire})},lr=function(e){cr(e)},pr="a0.spajs.txs.",dr=function(e){return""+pr+e},hr=function(){function e(){var e=this;this.transactions={},ur().filter(function(e){return e.startsWith(pr)}).forEach(function(t){var n=t.replace(pr,"");e.transactions[n]=sr(t)})}return e.prototype.create=function(e,t){this.transactions[e]=t,fr(dr(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],lr(dr(e))},e}(),yr=function(e){return"number"==typeof e},vr=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],mr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(Vn(r)),a={__raw:e},c={};return Object.keys(i).forEach(function(e){a[e]=i[e],vr.includes(e)||(c[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(Vn(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!yr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!yr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!yr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0),c=new Date(0);if(c.setUTCSeconds((parseInt(t.claims.auth_time)+parseInt(e.max_age))/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.iat-n),a.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(r<i)throw new Error("Issued At (iat) claim error in the ID token; current time ("+r+") is before issued at time ("+i+")");if(yr(t.claims.nbf)&&r<a)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+a);if(yr(t.claims.auth_time)&&r>c)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+c);return t},wr=function(t){function n(e,r,o){var i=t.call(this,r)||this;return i.error=e,i.error_description=r,i.state=o,Object.setPrototypeOf(i,n.prototype),i}return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,t),n}(Error),gr=new Dn,br=function(){function e(e){this.options=e,this.DEFAULT_SCOPE="openid profile email",this.cache=new nr,this.transactionManager=new hr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.4.0"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,r,o,i,a){var c=this.options,u=(c.domain,c.leeway,n(c,["domain","leeway"]));return t({},u,e,{scope:Wn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:r,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+Hn(e))},e.prototype._verifyIdToken=function(e,t){return mr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this.options.max_age})},e.prototype.loginWithPopup=function(e,i){return void 0===e&&(e={}),void 0===i&&(i=Mn),r(this,void 0,void 0,function(){var r,a,c,u,s,f,l,p,d,h,y,v,m;return o(this,function(o){switch(o.label){case 0:return[4,qn()];case 1:return r=o.sent(),a=n(e,[]),c=Gn(Jn()),u=Jn(),s=Jn(),[4,Yn(s)];case 2:return f=o.sent(),l=Kn(f),p=this._getParams(a,c,u,l,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(t({},p,{response_mode:"web_message"})),[4,Bn(r,d,i)];case 3:if(h=o.sent(),c!==h.state)throw new Error("Invalid state");return[4,Xn({baseUrl:this.domainUrl,audience:e.audience||this.options.audience,client_id:this.options.client_id,code_verifier:s,code:h.code})];case 4:return y=o.sent(),v=this._verifyIdToken(y.id_token,u),m=t({},y,{decodedToken:v,scope:p.scope,audience:p.audience||"default"}),this.cache.save(m),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var t;return o(this,function(n){return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(e))&&t.decodedToken.user]})})},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var t;return o(this,function(n){return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(e))&&t.decodedToken.claims]})})},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,function(){var t,r,i,a,c,u,s,f,l,p;return o(this,function(o){switch(o.label){case 0:return t=e.redirect_uri,r=e.appState,i=n(e,["redirect_uri","appState"]),a=Gn(Jn()),c=Jn(),u=Jn(),[4,Yn(u)];case 1:return s=o.sent(),f=Kn(s),l=this._getParams(i,a,c,f,t),p=this._authorizeUrl(l),this.transactionManager.create(a,{nonce:c,code_verifier:u,appState:r,scope:l.scope,audience:l.audience||"default"}),window.location.assign(p),[2]}})})},e.prototype.handleRedirectCallback=function(){return r(this,void 0,void 0,function(){var e,n,r,i,a,c,u,s,f,l;return o(this,function(o){switch(o.label){case 0:if(0===(e=window.location.href.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(n=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var n=e.split("&"),r={};return n.forEach(function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)}),t({},r,{expires_in:parseInt(r.expires_in)})}(e.join("")),r=n.state,i=n.code,a=n.error,c=n.error_description,a)throw this.transactionManager.remove(r),new wr(a,c,r);if(!(u=this.transactionManager.get(r)))throw new Error("Invalid state");return this.transactionManager.remove(r),[4,Xn({baseUrl:this.domainUrl,audience:this.options.audience,client_id:this.options.client_id,code_verifier:u.code_verifier,code:i})];case 1:return s=o.sent(),f=this._verifyIdToken(s.id_token,u.nonce),l=t({},s,{decodedToken:f,audience:u.audience,scope:u.scope}),this.cache.save(l),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE,ignoreCache:!1}),r(this,void 0,void 0,function(){var n,r,i,a,c,u,s,f,l,p,d,h,y;return o(this,function(o){switch(o.label){case 0:return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[4,gr.acquireLock("auth0.lock.getTokenSilently",5e3)];case 1:return o.sent(),!e.ignoreCache&&(n=this.cache.get({scope:e.scope,audience:e.audience||"default"}))?(gr.releaseLock("auth0.lock.getTokenSilently"),[2,n.access_token]):(r=Gn(Jn()),i=Jn(),a=Jn(),[4,Yn(a)]);case 2:return c=o.sent(),u=Kn(c),s={audience:e.audience,scope:e.scope},f=this._getParams(s,r,i,u,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(t({},f,{prompt:"none",response_mode:"web_message"})),[4,(v=l,m=this.domainUrl,new Promise(function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){t(Nn),window.document.body.removeChild(n)},6e4),o=function(i){i.origin==m&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",v)}))];case 3:if(p=o.sent(),r!==p.state)throw new Error("Invalid state");return[4,Xn({baseUrl:this.domainUrl,audience:e.audience||this.options.audience,client_id:this.options.client_id,code_verifier:a,code:p.code})];case 4:return d=o.sent(),h=this._verifyIdToken(d.id_token,i),y=t({},d,{decodedToken:h,scope:f.scope,audience:f.audience||"default"}),this.cache.save(y),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),gr.releaseLock("auth0.lock.getTokenSilently"),[2,d.access_token]}var v,m})})},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Mn),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return e.scope=Wn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default"}).access_token]}})})},e.prototype.isAuthenticated=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}})})},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id,lr("auth0.is.authenticated");var t=e.federated,r=n(e,["federated"]),o=t?"&federated":"",i=this._url("/v2/logout?"+Hn(r));window.location.assign(""+i+o)},e}();export default function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:if(er(),t=new br(e),!sr("auth0.is.authenticated"))return[2,t];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.getTokenSilently({audience:e.audience,scope:e.scope,ignoreCache:!0})];case 2:case 3:return n.sent(),[3,4];case 4:return[2,t]}})})}
//# sourceMappingURL=auth0-spa-js.production.esm.js.map

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).createAuth0Client=e()}(this,function(){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};var e=function(){return(e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function n(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function r(t,e,n,r){return new(n||(n=Promise))(function(o,i){function c(t){try{u(r.next(t))}catch(t){i(t)}}function a(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(c,a)}u((r=r.apply(t,e||[])).next())})}function o(t,e){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=e.call(t,c)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var a,u,s,f="object",l=function(t){return t&&t.Math==Math&&t},p=l(typeof globalThis==f&&globalThis)||l(typeof window==f&&window)||l(typeof self==f&&self)||l(typeof i==f&&i)||Function("return this")(),d=function(t){try{return!!t()}catch(t){return!0}},h=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,g={f:v&&!y.call({1:2},1)?function(t){var e=v(this,t);return!!e&&e.enumerable}:y},w=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m={}.toString,_=function(t){return m.call(t).slice(8,-1)},b="".split,O=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==_(t)?b.call(t,""):Object(t)}:Object,E=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},T=function(t){return O(E(t))},S=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=function(t,e){if(!S(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!S(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!S(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,P=function(t,e){return A.call(t,e)},x=p.document,U=S(x)&&S(x.createElement),C=function(t){return U?x.createElement(t):{}},k=!h&&!d(function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a}),I=Object.getOwnPropertyDescriptor,F={f:h?I:function(t,e){if(t=T(t),e=j(e,!0),k)try{return I(t,e)}catch(t){}if(P(t,e))return w(!g.f.call(t,e),t[e])}},R=function(t){if(!S(t))throw TypeError(String(t)+" is not an object");return t},D=Object.defineProperty,L={f:h?D:function(t,e,n){if(R(t),e=j(e,!0),R(n),k)try{return D(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},M=h?function(t,e,n){return L.f(t,e,w(1,n))}:function(t,e,n){return t[e]=n,t},z=function(t,e){try{M(p,t,e)}catch(n){p[t]=e}return e},N=c(function(t){var e=p["__core-js_shared__"]||z("__core-js_shared__",{});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),B=N("native-function-to-string",Function.toString),W=p.WeakMap,q="function"==typeof W&&/native code/.test(B.call(W)),G=0,J=Math.random(),H=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++G+J).toString(36)},Y=N("keys"),V=function(t){return Y[t]||(Y[t]=H(t))},K={},Q=p.WeakMap;if(q){var X=new Q,Z=X.get,$=X.has,tt=X.set;a=function(t,e){return tt.call(X,t,e),e},u=function(t){return Z.call(X,t)||{}},s=function(t){return $.call(X,t)}}else{var et=V("state");K[et]=!0,a=function(t,e){return M(t,et,e),e},u=function(t){return P(t,et)?t[et]:{}},s=function(t){return P(t,et)}}var nt={set:a,get:u,has:s,enforce:function(t){return s(t)?u(t):a(t,{})},getterFor:function(t){return function(e){var n;if(!S(e)||(n=u(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},rt=c(function(t){var e=nt.get,n=nt.enforce,r=String(B).split("toString");N("inspectSource",function(t){return B.call(t)}),(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||P(o,"name")||M(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==p?(c?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=o:M(t,e,o)):a?t[e]=o:z(e,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&e(this).source||B.call(this)})}),ot=p,it=function(t){return"function"==typeof t?t:void 0},ct=function(t,e){return arguments.length<2?it(ot[t])||it(p[t]):ot[t]&&ot[t][e]||p[t]&&p[t][e]},at=Math.ceil,ut=Math.floor,st=function(t){return isNaN(t=+t)?0:(t>0?ut:at)(t)},ft=Math.min,lt=function(t){return t>0?ft(st(t),9007199254740991):0},pt=Math.max,dt=Math.min,ht=function(t){return function(e,n,r){var o,i=T(e),c=lt(i.length),a=function(t,e){var n=st(t);return n<0?pt(n+e,0):dt(n,e)}(r,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},yt={includes:ht(!0),indexOf:ht(!1)},vt=yt.indexOf,gt=function(t,e){var n,r=T(t),o=0,i=[];for(n in r)!P(K,n)&&P(r,n)&&i.push(n);for(;e.length>o;)P(r,n=e[o++])&&(~vt(i,n)||i.push(n));return i},wt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mt=wt.concat("length","prototype"),_t={f:Object.getOwnPropertyNames||function(t){return gt(t,mt)}},bt={f:Object.getOwnPropertySymbols},Ot=ct("Reflect","ownKeys")||function(t){var e=_t.f(R(t)),n=bt.f;return n?e.concat(n(t)):e},Et=function(t,e){for(var n=Ot(e),r=L.f,o=F.f,i=0;i<n.length;i++){var c=n[i];P(t,c)||r(t,c,o(e,c))}},Tt=/#|\.prototype\./,St=function(t,e){var n=At[jt(t)];return n==xt||n!=Pt&&("function"==typeof e?d(e):!!e)},jt=St.normalize=function(t){return String(t).replace(Tt,".").toLowerCase()},At=St.data={},Pt=St.NATIVE="N",xt=St.POLYFILL="P",Ut=St,Ct=F.f,kt=function(t,e){var n,r,o,i,c,a=t.target,u=t.global,s=t.stat;if(n=u?p:s?p[a]||z(a,{}):(p[a]||{}).prototype)for(r in e){if(i=e[r],o=t.noTargetGet?(c=Ct(n,r))&&c.value:n[r],!Ut(u?r:a+(s?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Et(i,o)}(t.sham||o&&o.sham)&&M(i,"sham",!0),rt(n,r,i,t)}},It=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())}),Ft=p.Symbol,Rt=N("wks"),Dt=function(t){return Rt[t]||(Rt[t]=It&&Ft[t]||(It?Ft:H)("Symbol."+t))},Lt=Dt("match"),Mt=function(t){if(function(t){var e;return S(t)&&(void 0!==(e=t[Lt])?!!e:"RegExp"==_(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},zt=Dt("match"),Nt="".startsWith,Bt=Math.min;kt({target:"String",proto:!0,forced:!function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[zt]=!1,"/./"[t](e)}catch(t){}}return!1}("startsWith")},{startsWith:function(t){var e=String(E(this));Mt(t);var n=lt(Bt(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return Nt?Nt.call(e,r,n):e.slice(n,n+r.length)===r}});var Wt,qt,Gt,Jt=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},Ht=function(t,e,n){if(Jt(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},Yt=Function.call,Vt=function(t,e,n){return Ht(Yt,p[t].prototype[e],n)},Kt=(Vt("String","startsWith"),function(t){return function(e,n){var r,o,i=String(E(e)),c=st(n),a=i.length;return c<0||c>=a?t?"":void 0:(r=i.charCodeAt(c))<55296||r>56319||c+1===a||(o=i.charCodeAt(c+1))<56320||o>57343?t?i.charAt(c):r:t?i.slice(c,c+2):o-56320+(r-55296<<10)+65536}}),Qt={codeAt:Kt(!1),charAt:Kt(!0)},Xt=function(t){return Object(E(t))},Zt=!d(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),$t=V("IE_PROTO"),te=Object.prototype,ee=Zt?Object.getPrototypeOf:function(t){return t=Xt(t),P(t,$t)?t[$t]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?te:null},ne=Dt("iterator"),re=!1;[].keys&&("next"in(Gt=[].keys())?(qt=ee(ee(Gt)))!==Object.prototype&&(Wt=qt):re=!0),null==Wt&&(Wt={}),P(Wt,ne)||M(Wt,ne,function(){return this});var oe={IteratorPrototype:Wt,BUGGY_SAFARI_ITERATORS:re},ie=Object.keys||function(t){return gt(t,wt)},ce=h?Object.defineProperties:function(t,e){R(t);for(var n,r=ie(e),o=r.length,i=0;o>i;)L.f(t,n=r[i++],e[n]);return t},ae=ct("document","documentElement"),ue=V("IE_PROTO"),se=function(){},fe=function(){var t,e=C("iframe"),n=wt.length;for(e.style.display="none",ae.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),fe=t.F;n--;)delete fe.prototype[wt[n]];return fe()},le=Object.create||function(t,e){var n;return null!==t?(se.prototype=R(t),n=new se,se.prototype=null,n[ue]=t):n=fe(),void 0===e?n:ce(n,e)};K[ue]=!0;var pe=L.f,de=Dt("toStringTag"),he=function(t,e,n){t&&!P(t=n?t:t.prototype,de)&&pe(t,de,{configurable:!0,value:e})},ye={},ve=oe.IteratorPrototype,ge=function(){return this},we=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return R(n),function(t){if(!S(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),me=oe.IteratorPrototype,_e=oe.BUGGY_SAFARI_ITERATORS,be=Dt("iterator"),Oe=function(){return this},Ee=Qt.charAt,Te=nt.set,Se=nt.getterFor("String Iterator");!function(t,e,n,r,o,i,c){!function(t,e,n){var r=e+" Iterator";t.prototype=le(ve,{next:w(1,n)}),he(t,r,!1),ye[r]=ge}(n,e,r);var a,u,s,f=function(t){if(t===o&&y)return y;if(!_e&&t in d)return d[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",p=!1,d=t.prototype,h=d[be]||d["@@iterator"]||o&&d[o],y=!_e&&h||f(o),v="Array"==e&&d.entries||h;if(v&&(a=ee(v.call(new t)),me!==Object.prototype&&a.next&&(ee(a)!==me&&(we?we(a,me):"function"!=typeof a[be]&&M(a,be,Oe)),he(a,l,!0))),"values"==o&&h&&"values"!==h.name&&(p=!0,y=function(){return h.call(this)}),d[be]!==y&&M(d,be,y),ye[e]=y,o)if(u={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},c)for(s in u)!_e&&!p&&s in d||rt(d,s,u[s]);else kt({target:e,proto:!0,forced:_e||p},u)}(String,"String",function(t){Te(this,{type:"String Iterator",string:String(t),index:0})},function(){var t,e=Se(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=Ee(n,r),e.index+=t.length,{value:t,done:!1})});var je=function(t,e,n,r){try{return r?e(R(n)[0],n[1]):e(n)}catch(e){var o=t.return;throw void 0!==o&&R(o.call(t)),e}},Ae=Dt("iterator"),Pe=Array.prototype,xe=function(t){return void 0!==t&&(ye.Array===t||Pe[Ae]===t)},Ue=function(t,e,n){var r=j(e);r in t?L.f(t,r,w(0,n)):t[r]=n},Ce=Dt("toStringTag"),ke="Arguments"==_(function(){return arguments}()),Ie=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Ce))?n:ke?_(e):"Object"==(r=_(e))&&"function"==typeof e.callee?"Arguments":r},Fe=Dt("iterator"),Re=function(t){if(null!=t)return t[Fe]||t["@@iterator"]||ye[Ie(t)]},De=Dt("iterator"),Le=!1;try{var Me=0,ze={next:function(){return{done:!!Me++}},return:function(){Le=!0}};ze[De]=function(){return this},Array.from(ze,function(){throw 2})}catch(t){}var Ne=!function(t,e){if(!e&&!Le)return!1;var n=!1;try{var r={};r[De]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}(function(t){Array.from(t)});kt({target:"Array",stat:!0,forced:Ne},{from:function(t){var e,n,r,o,i=Xt(t),c="function"==typeof this?this:Array,a=arguments.length,u=a>1?arguments[1]:void 0,s=void 0!==u,f=0,l=Re(i);if(s&&(u=Ht(u,a>2?arguments[2]:void 0,2)),null==l||c==Array&&xe(l))for(n=new c(e=lt(i.length));e>f;f++)Ue(n,f,s?u(i[f],f):i[f]);else for(o=l.call(i),n=new c;!(r=o.next()).done;f++)Ue(n,f,s?je(o,u,[r.value,f],!0):r.value);return n.length=f,n}});ot.Array.from;var Be,We=L.f,qe=p.DataView,Ge=qe&&qe.prototype,Je=p.Int8Array,He=Je&&Je.prototype,Ye=p.Uint8ClampedArray,Ve=Ye&&Ye.prototype,Ke=Je&&ee(Je),Qe=He&&ee(He),Xe=Object.prototype,Ze=Xe.isPrototypeOf,$e=Dt("toStringTag"),tn=H("TYPED_ARRAY_TAG"),en=!(!p.ArrayBuffer||!qe),nn=en&&!!we&&"Opera"!==Ie(p.opera),rn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},on=function(t){return S(t)&&P(rn,Ie(t))};for(Be in rn)p[Be]||(nn=!1);if((!nn||"function"!=typeof Ke||Ke===Function.prototype)&&(Ke=function(){throw TypeError("Incorrect invocation")},nn))for(Be in rn)p[Be]&&we(p[Be],Ke);if((!nn||!Qe||Qe===Xe)&&(Qe=Ke.prototype,nn))for(Be in rn)p[Be]&&we(p[Be].prototype,Qe);if(nn&&ee(Ve)!==Qe&&we(Ve,Qe),h&&!P(Qe,$e))for(Be in!0,We(Qe,$e,{get:function(){return S(this)?this[tn]:void 0}}),rn)p[Be]&&M(p[Be],tn,Be);en&&we&&ee(Ge)!==Xe&&we(Ge,Xe);var cn=function(t){if(on(t))return t;throw TypeError("Target is not a typed array")},an=function(t){if(we){if(Ze.call(Ke,t))return t}else for(var e in rn)if(P(rn,Be)){var n=p[e];if(n&&(t===n||Ze.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},un=function(t,e,n){if(h){if(n)for(var r in rn){var o=p[r];o&&P(o.prototype,t)&&delete o.prototype[t]}Qe[t]&&!n||rt(Qe,t,n?e:nn&&He[t]||e)}},sn=Dt("species"),fn=cn,ln=an,pn=[].slice;un("slice",function(t,e){for(var n=pn.call(fn(this),t,e),r=function(t,e){var n,r=R(t).constructor;return void 0===r||null==(n=R(r)[sn])?e:Jt(n)}(this,this.constructor),o=0,i=n.length,c=new(ln(r))(i);i>o;)c[o]=n[o++];return c},d(function(){new Int8Array(1).slice()}));var dn=Dt("unscopables"),hn=Array.prototype;null==hn[dn]&&M(hn,dn,le(null));var yn,vn=yt.includes;kt({target:"Array",proto:!0},{includes:function(t){return vn(this,t,arguments.length>1?arguments[1]:void 0)}}),yn="includes",hn[dn][yn]=!0;Vt("Array","includes");function gn(t){var e=this.constructor;return this.then(function(n){return e.resolve(t()).then(function(){return n})},function(n){return e.resolve(t()).then(function(){return e.reject(n)})})}var wn=setTimeout;function mn(t){return Boolean(t&&void 0!==t.length)}function _n(){}function bn(t){if(!(this instanceof bn))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],An(t,this)}function On(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,bn._immediateFn(function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(t){return void Tn(e.promise,t)}En(e.promise,r)}else(1===t._state?En:Tn)(e.promise,t._value)})):t._deferreds.push(e)}function En(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof bn)return t._state=3,t._value=e,void Sn(t);if("function"==typeof n)return void An((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,Sn(t)}catch(e){Tn(t,e)}var r,o}function Tn(t,e){t._state=2,t._value=e,Sn(t)}function Sn(t){2===t._state&&0===t._deferreds.length&&bn._immediateFn(function(){t._handled||bn._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)On(t,t._deferreds[e]);t._deferreds=null}function jn(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function An(t,e){var n=!1;try{t(function(t){n||(n=!0,En(e,t))},function(t){n||(n=!0,Tn(e,t))})}catch(t){if(n)return;n=!0,Tn(e,t)}}bn.prototype.catch=function(t){return this.then(null,t)},bn.prototype.then=function(t,e){var n=new this.constructor(_n);return On(this,new jn(t,e,n)),n},bn.prototype.finally=gn,bn.all=function(t){return new bn(function(e,n){if(!mn(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var o=r.length;function i(t,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var a=c.then;if("function"==typeof a)return void a.call(c,function(e){i(t,e)},n)}r[t]=c,0==--o&&e(r)}catch(t){n(t)}}for(var c=0;c<r.length;c++)i(c,r[c])})},bn.resolve=function(t){return t&&"object"==typeof t&&t.constructor===bn?t:new bn(function(e){e(t)})},bn.reject=function(t){return new bn(function(e,n){n(t)})},bn.race=function(t){return new bn(function(e,n){if(!mn(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=t.length;r<o;r++)bn.resolve(t[r]).then(e,n)})},bn._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){wn(t,0)},bn._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var Pn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();function xn(t,e){return e=e||{},new Promise(function(n,r){var o=new XMLHttpRequest,i=[],c=[],a={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return c},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var s in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,n){i.push(e=e.toLowerCase()),c.push([e,n]),a[e]=a[e]?a[e]+","+n:n}),n(u())},o.onerror=r,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(s,e.headers[s]);o.send(e.body||null)})}"Promise"in Pn?Pn.Promise.prototype.finally||(Pn.Promise.prototype.finally=gn):Pn.Promise=bn,function(t){function e(t){if("utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+t+"') is invalid.")}function n(t,e){if(e=void 0===e?{fatal:!1}:e,"utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(t.TextEncoder&&t.TextDecoder)return!1;Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);e<n;){var c=t.charCodeAt(e++);if(55296<=c&&56319>=c){if(e<n){var a=t.charCodeAt(e);56320==(64512&a)&&(++e,c=((1023&c)<<10)+(1023&a)+65536)}if(55296<=c&&56319>=c)continue}if(r+4>i.length&&(o+=8,o=(o*=1+e/t.length*2)>>3<<3,(a=new Uint8Array(o)).set(i),i=a),0==(4294967168&c))i[r++]=c;else{if(0==(4294965248&c))i[r++]=c>>6&31|192;else if(0==(4294901760&c))i[r++]=c>>12&15|224,i[r++]=c>>6&63|128;else{if(0!=(4292870144&c))continue;i[r++]=c>>18&7|240,i[r++]=c>>12&63|128,i[r++]=c>>6&63|128}i[r++]=63&c|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e=0;for(var n=(t=new Uint8Array(t)).length,r=[];e<n;){var o=t[e++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&t[e++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&t[e++];var c=63&t[e++];r.push((31&o)<<12|i<<6|c)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&t[e++])<<12|(c=63&t[e++])<<6|63&t[e++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:i);var Un,Cn={timeoutInSeconds:60},kn=function(t){return t.filter(function(e,n){return t.indexOf(e)===n})},In={error:"timeout",error_description:"Timeout"},Fn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.filter(Boolean).join();return kn(n.replace(/\s/g,",").split(",")).join(" ").trim()},Rn=function(){var t=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!t)throw new Error("Could not open popup");return t},Dn=function(t,n,r){return t.location.href=n,new Promise(function(n,o){var i=setTimeout(function(){o(e({},In,{popup:t}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(e){if(e.data&&"authorization_response"===e.data.type){if(clearTimeout(i),t.close(),e.data.response.error)return o(e.data.response);n(e.data.response)}})})},Ln=function(){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",e="";return Array.from(Jn().getRandomValues(new Uint8Array(43))).forEach(function(n){return e+=t[n%t.length]}),e},Mn=function(t){return btoa(t)},zn=function(t){return Object.keys(t).filter(function(e){return void 0!==t[e]}).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&")},Nn=function(t){return r(void 0,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:return[4,Promise.resolve(Hn().digest({name:"SHA-256"},(new TextEncoder).encode(t)))];case 1:return(e=n.sent()).result?[2,e.result]:[2,e]}})})},Bn=function(t){return function(t){return decodeURIComponent(atob(t).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(t.replace(/_/g,"/").replace(/-/g,"+"))},Wn=function(t){var e=new Uint8Array(t);return function(t){var e={"+":"-","/":"_","=":""};return t.replace(/[\+\/=]/g,function(t){return e[t]})}(window.btoa(String.fromCharCode.apply(String,Array.from(e))))},qn=function(t,e){return r(void 0,void 0,void 0,function(){var r,i,c,a,u,s,f;return o(this,function(o){switch(o.label){case 0:return[4,xn(t,e)];case 1:return[4,(r=o.sent()).json()];case 2:if(i=o.sent(),c=i.error,a=i.error_description,u=n(i,["error","error_description"]),!r.ok)throw s=a||"HTTP error. Unable to fetch "+t,(f=new Error(s)).error=c||"request_error",f.error_description=s,f;return[2,u]}})})},Gn=function(t){return r(void 0,void 0,void 0,function(){var r=t.baseUrl,i=n(t,["baseUrl"]);return o(this,function(t){switch(t.label){case 0:return[4,qn(r+"/oauth/token",{method:"POST",body:JSON.stringify(e({grant_type:"authorization_code",redirect_uri:window.location.origin},i)),headers:{"Content-type":"application/json"}})];case 1:return[2,t.sent()]}})})},Jn=function(){return window.crypto||window.msCrypto},Hn=function(){var t=Jn();return t.subtle||t.webkitSubtle},Yn=function(){if(!Jn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Hn())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},Vn=function(t){return t.audience+"::"+t.scope},Kn=function(){function t(){this.cache={}}return t.prototype.save=function(t){var e=this,n=Vn(t);this.cache[n]=t;var r,o,i,c=(r=t.expires_in,o=t.decodedToken.claims.exp,i=(new Date(1e3*o).getTime()-(new Date).getTime())/1e3,1e3*Math.min(r,i)*.8);setTimeout(function(){delete e.cache[n]},c)},t.prototype.get=function(t){return this.cache[Vn(t)]},t}(),Qn=c(function(t,e){var n=i&&i.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function r(t,e){if(!e)return"";var n="; "+t;return!0===e?n:n+"="+e}function o(t,e,n){return encodeURIComponent(t).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(e).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(t){if("number"==typeof t.expires){var e=new Date;e.setMilliseconds(e.getMilliseconds()+864e5*t.expires),t.expires=e}return r("Expires",t.expires?t.expires.toUTCString():"")+r("Domain",t.domain)+r("Path",t.path)+r("Secure",t.secure)+r("SameSite",t.sameSite)}(n)}function c(t){for(var e={},n=t?t.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),c=i.slice(1).join("=");'"'===c.charAt(0)&&(c=c.slice(1,-1));try{e[i[0].replace(r,decodeURIComponent)]=c.replace(r,decodeURIComponent)}catch(t){}}return e}function a(){return c(document.cookie)}function u(t,e,r){document.cookie=o(t,e,n({path:"/"},r))}e.__esModule=!0,e.encode=o,e.parse=c,e.getAll=a,e.get=function(t){return a()[t]},e.set=u,e.remove=function(t,e){u(t,"",n({},e,{expires:-1}))}});(Un=Qn)&&Un.__esModule&&Object.prototype.hasOwnProperty.call(Un,"default")&&Un.default;Qn.encode,Qn.parse;var Xn=Qn.getAll,Zn=Qn.get,$n=Qn.set,tr=Qn.remove,er=function(){return Object.keys(Xn()||{})},nr=function(t){var e=Zn(t);if(void 0!==e)return JSON.parse(e)},rr=function(t,e,n){$n(t,JSON.stringify(e),{expires:n.daysUntilExpire})},or=function(t){tr(t)},ir="a0.spajs.txs.",cr=function(t){return""+ir+t},ar=function(){function t(){var t=this;this.transactions={},er().filter(function(t){return t.startsWith(ir)}).forEach(function(e){var n=e.replace(ir,"");t.transactions[n]=nr(e)})}return t.prototype.create=function(t,e){this.transactions[t]=e,rr(cr(t),e,{daysUntilExpire:1})},t.prototype.get=function(t){return this.transactions[t]},t.prototype.remove=function(t){delete this.transactions[t],or(cr(t))},t}(),ur=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],sr=function(t){var e,n,r,o,i,c,a,u,s=(e=t.id_token,n=e.split("."),r=n[0],o=n[1],i=n[2],c=JSON.parse(Bn(o)),a={__raw:e},u={},Object.keys(c).forEach(function(t){a[t]=c[t],ur.includes(t)||(u[t]=c[t])}),{encoded:{header:r,payload:o,signature:i},header:JSON.parse(Bn(r)),claims:a,user:u});if(s.claims.iss!==t.iss)throw new Error("Invalid issuer");if(s.claims.aud!==t.aud)throw new Error("Invalid audience");if("RS256"!==s.header.alg)throw new Error("Invalid algorithm");if(s.claims.nonce!==t.nonce)throw new Error("Invalid nonce");var f=new Date,l=new Date(0),p=new Date(0),d=new Date(0),h=t.leeway||60;if(l.setUTCSeconds(s.claims.exp+h),p.setUTCSeconds(s.claims.iat-h),d.setUTCSeconds(s.claims.nbf-h),f>l)throw new Error("id_token expired");if(f<p)throw new Error("id_token was issued in the future (invalid iat)");if(void 0!==s.claims.nbf&&f<d)throw new Error("token is not yet valid (invalid notBefore)");return s},fr=function(e){function n(t,r,o){var i=e.call(this,r)||this;return i.error=t,i.error_description=r,i.state=o,Object.setPrototypeOf(i,n.prototype),i}return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,e),n}(Error),lr=function(){function t(t){this.options=t,this.DEFAULT_SCOPE="openid profile email",this.cache=new Kn,this.transactionManager=new ar,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return t.prototype._url=function(t){var e=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.3.2"})));return""+this.domainUrl+t+"&auth0Client="+e},t.prototype._getParams=function(t,r,o,i,c){var a=this.options,u=(a.domain,a.leeway,n(a,["domain","leeway"]));return e({},u,t,{scope:Fn(this.DEFAULT_SCOPE,this.options.scope,t.scope),response_type:"code",response_mode:"query",state:r,nonce:o,redirect_uri:c||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},t.prototype._authorizeUrl=function(t){return this._url("/authorize?"+zn(t))},t.prototype._verifyIdToken=function(t,e){return sr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:e,leeway:this.options.leeway})},t.prototype.loginWithPopup=function(t,i){return void 0===t&&(t={}),void 0===i&&(i=Cn),r(this,void 0,void 0,function(){var r,c,a,u,s,f,l,p,d,h,y,v,g;return o(this,function(o){switch(o.label){case 0:return[4,Rn()];case 1:return r=o.sent(),c=n(t,[]),a=Mn(Ln()),u=Ln(),s=Ln(),[4,Nn(s)];case 2:return f=o.sent(),l=Wn(f),p=this._getParams(c,a,u,l,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(e({},p,{response_mode:"web_message"})),[4,Dn(r,d,i)];case 3:if(h=o.sent(),a!==h.state)throw new Error("Invalid state");return[4,Gn({baseUrl:this.domainUrl,audience:t.audience||this.options.audience,client_id:this.options.client_id,code_verifier:s,code:h.code})];case 4:return y=o.sent(),v=this._verifyIdToken(y.id_token,u),g=e({},y,{decodedToken:v,scope:p.scope,audience:p.audience||"default"}),this.cache.save(g),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},t.prototype.getUser=function(t){return void 0===t&&(t={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var e;return o(this,function(n){return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),[2,(e=this.cache.get(t))&&e.decodedToken.user]})})},t.prototype.getIdTokenClaims=function(t){return void 0===t&&(t={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var e;return o(this,function(n){return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),[2,(e=this.cache.get(t))&&e.decodedToken.claims]})})},t.prototype.loginWithRedirect=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){var e,r,i,c,a,u,s,f,l,p;return o(this,function(o){switch(o.label){case 0:return e=t.redirect_uri,r=t.appState,i=n(t,["redirect_uri","appState"]),c=Mn(Ln()),a=Ln(),u=Ln(),[4,Nn(u)];case 1:return s=o.sent(),f=Wn(s),l=this._getParams(i,c,a,f,e),p=this._authorizeUrl(l),this.transactionManager.create(c,{nonce:a,code_verifier:u,appState:r,scope:l.scope,audience:l.audience||"default"}),window.location.assign(p),[2]}})})},t.prototype.handleRedirectCallback=function(){return r(this,void 0,void 0,function(){var t,n,r,i,c,a,u,s,f,l;return o(this,function(o){switch(o.label){case 0:if(0===(t=window.location.href.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(n=function(t){t.indexOf("#")>-1&&(t=t.substr(0,t.indexOf("#")));var n=t.split("&"),r={};return n.forEach(function(t){var e=t.split("="),n=e[0],o=e[1];r[n]=decodeURIComponent(o)}),e({},r,{expires_in:parseInt(r.expires_in)})}(t.join("")),r=n.state,i=n.code,c=n.error,a=n.error_description,c)throw new fr(c,a,r);if(!(u=this.transactionManager.get(r)))throw new Error("Invalid state");return this.transactionManager.remove(r),[4,Gn({baseUrl:this.domainUrl,audience:this.options.audience,client_id:this.options.client_id,code_verifier:u.code_verifier,code:i})];case 1:return s=o.sent(),f=this._verifyIdToken(s.id_token,u.nonce),l=e({},s,{decodedToken:f,audience:u.audience,scope:u.scope}),this.cache.save(l),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},t.prototype.getTokenSilently=function(t){return void 0===t&&(t={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE,ignoreCache:!1}),r(this,void 0,void 0,function(){var n,r,i,c,a,u,s,f,l,p,d,h,y;return o(this,function(o){switch(o.label){case 0:return t.scope=Fn(this.DEFAULT_SCOPE,t.scope),!t.ignoreCache&&(n=this.cache.get({scope:t.scope,audience:t.audience||"default"}))?[2,n.access_token]:(r=Mn(Ln()),i=Ln(),c=Ln(),[4,Nn(c)]);case 1:return a=o.sent(),u=Wn(a),s={audience:t.audience,scope:t.scope},f=this._getParams(s,r,i,u,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(e({},f,{prompt:"none",response_mode:"web_message"})),[4,(v=l,g=this.domainUrl,new Promise(function(t,e){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){e(In),window.document.body.removeChild(n)},6e4),o=function(i){i.origin==g&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?e(i.data.response):t(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",v)}))];case 2:if(p=o.sent(),r!==p.state)throw new Error("Invalid state");return[4,Gn({baseUrl:this.domainUrl,audience:t.audience||this.options.audience,client_id:this.options.client_id,code_verifier:c,code:p.code})];case 3:return d=o.sent(),h=this._verifyIdToken(d.id_token,i),y=e({},d,{decodedToken:h,scope:f.scope,audience:f.audience||"default"}),this.cache.save(y),rr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,d.access_token]}var v,g})})},t.prototype.getTokenWithPopup=function(t,e){return void 0===t&&(t={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===e&&(e=Cn),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return t.scope=Fn(this.DEFAULT_SCOPE,this.options.scope,t.scope),[4,this.loginWithPopup(t,e)];case 1:return n.sent(),[2,this.cache.get({scope:t.scope,audience:t.audience||"default"}).access_token]}})})},t.prototype.isAuthenticated=function(){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.getUser()];case 1:return[2,!!t.sent()]}})})},t.prototype.logout=function(t){void 0===t&&(t={}),null!==t.client_id?t.client_id=t.client_id||this.options.client_id:delete t.client_id,or("auth0.is.authenticated");var e=t.federated,r=n(t,["federated"]),o=e?"&federated":"",i=this._url("/v2/logout?"+zn(r));window.location.assign(""+i+o)},t}();return function(t){return r(this,void 0,void 0,function(){var e;return o(this,function(n){switch(n.label){case 0:if(Yn(),e=new lr(t),!nr("auth0.is.authenticated"))return[2,e];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.getTokenSilently({audience:t.audience,scope:t.scope,ignoreCache:!0})];case 2:case 3:return n.sent(),[3,4];case 4:return[2,e]}})})}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).createAuth0Client=t()}(this,function(){"use strict";var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};var t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function n(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function r(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}u((r=r.apply(e,t||[])).next())})}function o(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e,t){return e(t={exports:{}},t.exports),t.exports}var c,u,s,f="object",l=function(e){return e&&e.Math==Math&&e},p=l(typeof globalThis==f&&globalThis)||l(typeof window==f&&window)||l(typeof self==f&&self)||l(typeof i==f&&i)||Function("return this")(),d=function(e){try{return!!e()}catch(e){return!0}},h=!d(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),y={}.propertyIsEnumerable,v=Object.getOwnPropertyDescriptor,m={f:v&&!y.call({1:2},1)?function(e){var t=v(this,e);return!!t&&t.enumerable}:y},w=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g={}.toString,b=function(e){return g.call(e).slice(8,-1)},_="".split,E=d(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==b(e)?_.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},S=function(e){return E(T(e))},O=function(e){return"object"==typeof e?null!==e:"function"==typeof e},k=function(e,t){if(!O(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!O(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!O(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!O(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},A={}.hasOwnProperty,x=function(e,t){return A.call(e,t)},j=p.document,I=O(j)&&O(j.createElement),P=function(e){return I?j.createElement(e):{}},C=!h&&!d(function(){return 7!=Object.defineProperty(P("div"),"a",{get:function(){return 7}}).a}),U=Object.getOwnPropertyDescriptor,D={f:h?U:function(e,t){if(e=S(e),t=k(t,!0),C)try{return U(e,t)}catch(e){}if(x(e,t))return w(!m.f.call(e,t),e[t])}},F=function(e){if(!O(e))throw TypeError(String(e)+" is not an object");return e},R=Object.defineProperty,L={f:h?R:function(e,t,n){if(F(e),t=k(t,!0),F(n),C)try{return R(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},M=h?function(e,t,n){return L.f(e,t,w(1,n))}:function(e,t,n){return e[t]=n,e},z=function(e,t){try{M(p,e,t)}catch(n){p[e]=t}return t},N=a(function(e){var t=p["__core-js_shared__"]||z("__core-js_shared__",{});(e.exports=function(e,n){return t[e]||(t[e]=void 0!==n?n:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),W=N("native-function-to-string",Function.toString),q=p.WeakMap,B="function"==typeof q&&/native code/.test(W.call(q)),J=0,G=Math.random(),H=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++J+G).toString(36)},Y=N("keys"),V=function(e){return Y[e]||(Y[e]=H(e))},K={},Q=p.WeakMap;if(B){var X=new Q,Z=X.get,$=X.has,ee=X.set;c=function(e,t){return ee.call(X,e,t),t},u=function(e){return Z.call(X,e)||{}},s=function(e){return $.call(X,e)}}else{var te=V("state");K[te]=!0,c=function(e,t){return M(e,te,t),t},u=function(e){return x(e,te)?e[te]:{}},s=function(e){return x(e,te)}}var ne={set:c,get:u,has:s,enforce:function(e){return s(e)?u(e):c(e,{})},getterFor:function(e){return function(t){var n;if(!O(t)||(n=u(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},re=a(function(e){var t=ne.get,n=ne.enforce,r=String(W).split("toString");N("inspectSource",function(e){return W.call(e)}),(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,c=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||x(o,"name")||M(o,"name",t),n(o).source=r.join("string"==typeof t?t:"")),e!==p?(a?!u&&e[t]&&(c=!0):delete e[t],c?e[t]=o:M(e,t,o)):c?e[t]=o:z(t,o)})(Function.prototype,"toString",function(){return"function"==typeof this&&t(this).source||W.call(this)})}),oe=p,ie=function(e){return"function"==typeof e?e:void 0},ae=function(e,t){return arguments.length<2?ie(oe[e])||ie(p[e]):oe[e]&&oe[e][t]||p[e]&&p[e][t]},ce=Math.ceil,ue=Math.floor,se=function(e){return isNaN(e=+e)?0:(e>0?ue:ce)(e)},fe=Math.min,le=function(e){return e>0?fe(se(e),9007199254740991):0},pe=Math.max,de=Math.min,he=function(e){return function(t,n,r){var o,i=S(t),a=le(i.length),c=function(e,t){var n=se(e);return n<0?pe(n+t,0):de(n,t)}(r,a);if(e&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((e||c in i)&&i[c]===n)return e||c||0;return!e&&-1}},ye={includes:he(!0),indexOf:he(!1)},ve=ye.indexOf,me=function(e,t){var n,r=S(e),o=0,i=[];for(n in r)!x(K,n)&&x(r,n)&&i.push(n);for(;t.length>o;)x(r,n=t[o++])&&(~ve(i,n)||i.push(n));return i},we=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=we.concat("length","prototype"),be={f:Object.getOwnPropertyNames||function(e){return me(e,ge)}},_e={f:Object.getOwnPropertySymbols},Ee=ae("Reflect","ownKeys")||function(e){var t=be.f(F(e)),n=_e.f;return n?t.concat(n(e)):t},Te=function(e,t){for(var n=Ee(t),r=L.f,o=D.f,i=0;i<n.length;i++){var a=n[i];x(e,a)||r(e,a,o(t,a))}},Se=/#|\.prototype\./,Oe=function(e,t){var n=Ae[ke(e)];return n==je||n!=xe&&("function"==typeof t?d(t):!!t)},ke=Oe.normalize=function(e){return String(e).replace(Se,".").toLowerCase()},Ae=Oe.data={},xe=Oe.NATIVE="N",je=Oe.POLYFILL="P",Ie=Oe,Pe=D.f,Ce=function(e,t){var n,r,o,i,a,c=e.target,u=e.global,s=e.stat;if(n=u?p:s?p[c]||z(c,{}):(p[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=Pe(n,r))&&a.value:n[r],!Ie(u?r:c+(s?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Te(i,o)}(e.sham||o&&o.sham)&&M(i,"sham",!0),re(n,r,i,e)}},Ue=!!Object.getOwnPropertySymbols&&!d(function(){return!String(Symbol())}),De=p.Symbol,Fe=N("wks"),Re=function(e){return Fe[e]||(Fe[e]=Ue&&De[e]||(Ue?De:H)("Symbol."+e))},Le=Re("match"),Me=function(e){if(function(e){var t;return O(e)&&(void 0!==(t=e[Le])?!!t:"RegExp"==b(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},ze=Re("match"),Ne="".startsWith,We=Math.min;Ce({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[ze]=!1,"/./"[e](t)}catch(e){}}return!1}("startsWith")},{startsWith:function(e){var t=String(T(this));Me(e);var n=le(We(arguments.length>1?arguments[1]:void 0,t.length)),r=String(e);return Ne?Ne.call(t,r,n):t.slice(n,n+r.length)===r}});var qe,Be,Je,Ge=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},He=function(e,t,n){if(Ge(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}},Ye=Function.call,Ve=function(e,t,n){return He(Ye,p[e].prototype[t],n)},Ke=(Ve("String","startsWith"),function(e){return function(t,n){var r,o,i=String(T(t)),a=se(n),c=i.length;return a<0||a>=c?e?"":void 0:(r=i.charCodeAt(a))<55296||r>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):r:e?i.slice(a,a+2):o-56320+(r-55296<<10)+65536}}),Qe={codeAt:Ke(!1),charAt:Ke(!0)},Xe=function(e){return Object(T(e))},Ze=!d(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),$e=V("IE_PROTO"),et=Object.prototype,tt=Ze?Object.getPrototypeOf:function(e){return e=Xe(e),x(e,$e)?e[$e]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?et:null},nt=Re("iterator"),rt=!1;[].keys&&("next"in(Je=[].keys())?(Be=tt(tt(Je)))!==Object.prototype&&(qe=Be):rt=!0),null==qe&&(qe={}),x(qe,nt)||M(qe,nt,function(){return this});var ot={IteratorPrototype:qe,BUGGY_SAFARI_ITERATORS:rt},it=Object.keys||function(e){return me(e,we)},at=h?Object.defineProperties:function(e,t){F(e);for(var n,r=it(t),o=r.length,i=0;o>i;)L.f(e,n=r[i++],t[n]);return e},ct=ae("document","documentElement"),ut=V("IE_PROTO"),st=function(){},ft=function(){var e,t=P("iframe"),n=we.length;for(t.style.display="none",ct.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),ft=e.F;n--;)delete ft.prototype[we[n]];return ft()},lt=Object.create||function(e,t){var n;return null!==e?(st.prototype=F(e),n=new st,st.prototype=null,n[ut]=e):n=ft(),void 0===t?n:at(n,t)};K[ut]=!0;var pt=L.f,dt=Re("toStringTag"),ht=function(e,t,n){e&&!x(e=n?e:e.prototype,dt)&&pt(e,dt,{configurable:!0,value:t})},yt={},vt=ot.IteratorPrototype,mt=function(){return this},wt=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return F(n),function(e){if(!O(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),gt=ot.IteratorPrototype,bt=ot.BUGGY_SAFARI_ITERATORS,_t=Re("iterator"),Et=function(){return this},Tt=Qe.charAt,St=ne.set,Ot=ne.getterFor("String Iterator");!function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=lt(vt,{next:w(1,n)}),ht(e,r,!1),yt[r]=mt}(n,t,r);var c,u,s,f=function(e){if(e===o&&y)return y;if(!bt&&e in d)return d[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",p=!1,d=e.prototype,h=d[_t]||d["@@iterator"]||o&&d[o],y=!bt&&h||f(o),v="Array"==t&&d.entries||h;if(v&&(c=tt(v.call(new e)),gt!==Object.prototype&&c.next&&(tt(c)!==gt&&(wt?wt(c,gt):"function"!=typeof c[_t]&&M(c,_t,Et)),ht(c,l,!0))),"values"==o&&h&&"values"!==h.name&&(p=!0,y=function(){return h.call(this)}),d[_t]!==y&&M(d,_t,y),yt[t]=y,o)if(u={values:f("values"),keys:i?y:f("keys"),entries:f("entries")},a)for(s in u)!bt&&!p&&s in d||re(d,s,u[s]);else Ce({target:t,proto:!0,forced:bt||p},u)}(String,"String",function(e){St(this,{type:"String Iterator",string:String(e),index:0})},function(){var e,t=Ot(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Tt(n,r),t.index+=e.length,{value:e,done:!1})});var kt=function(e,t,n,r){try{return r?t(F(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&F(o.call(e)),t}},At=Re("iterator"),xt=Array.prototype,jt=function(e){return void 0!==e&&(yt.Array===e||xt[At]===e)},It=function(e,t,n){var r=k(t);r in e?L.f(e,r,w(0,n)):e[r]=n},Pt=Re("toStringTag"),Ct="Arguments"==b(function(){return arguments}()),Ut=function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Pt))?n:Ct?b(t):"Object"==(r=b(t))&&"function"==typeof t.callee?"Arguments":r},Dt=Re("iterator"),Ft=function(e){if(null!=e)return e[Dt]||e["@@iterator"]||yt[Ut(e)]},Rt=Re("iterator"),Lt=!1;try{var Mt=0,zt={next:function(){return{done:!!Mt++}},return:function(){Lt=!0}};zt[Rt]=function(){return this},Array.from(zt,function(){throw 2})}catch(e){}var Nt=!function(e,t){if(!t&&!Lt)return!1;var n=!1;try{var r={};r[Rt]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}(function(e){Array.from(e)});Ce({target:"Array",stat:!0,forced:Nt},{from:function(e){var t,n,r,o,i=Xe(e),a="function"==typeof this?this:Array,c=arguments.length,u=c>1?arguments[1]:void 0,s=void 0!==u,f=0,l=Ft(i);if(s&&(u=He(u,c>2?arguments[2]:void 0,2)),null==l||a==Array&&jt(l))for(n=new a(t=le(i.length));t>f;f++)It(n,f,s?u(i[f],f):i[f]);else for(o=l.call(i),n=new a;!(r=o.next()).done;f++)It(n,f,s?kt(o,u,[r.value,f],!0):r.value);return n.length=f,n}});oe.Array.from;var Wt,qt=L.f,Bt=p.DataView,Jt=Bt&&Bt.prototype,Gt=p.Int8Array,Ht=Gt&&Gt.prototype,Yt=p.Uint8ClampedArray,Vt=Yt&&Yt.prototype,Kt=Gt&&tt(Gt),Qt=Ht&&tt(Ht),Xt=Object.prototype,Zt=Xt.isPrototypeOf,$t=Re("toStringTag"),en=H("TYPED_ARRAY_TAG"),tn=!(!p.ArrayBuffer||!Bt),nn=tn&&!!wt&&"Opera"!==Ut(p.opera),rn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},on=function(e){return O(e)&&x(rn,Ut(e))};for(Wt in rn)p[Wt]||(nn=!1);if((!nn||"function"!=typeof Kt||Kt===Function.prototype)&&(Kt=function(){throw TypeError("Incorrect invocation")},nn))for(Wt in rn)p[Wt]&&wt(p[Wt],Kt);if((!nn||!Qt||Qt===Xt)&&(Qt=Kt.prototype,nn))for(Wt in rn)p[Wt]&&wt(p[Wt].prototype,Qt);if(nn&&tt(Vt)!==Qt&&wt(Vt,Qt),h&&!x(Qt,$t))for(Wt in!0,qt(Qt,$t,{get:function(){return O(this)?this[en]:void 0}}),rn)p[Wt]&&M(p[Wt],en,Wt);tn&&wt&&tt(Jt)!==Xt&&wt(Jt,Xt);var an=function(e){if(on(e))return e;throw TypeError("Target is not a typed array")},cn=function(e){if(wt){if(Zt.call(Kt,e))return e}else for(var t in rn)if(x(rn,Wt)){var n=p[t];if(n&&(e===n||Zt.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},un=function(e,t,n){if(h){if(n)for(var r in rn){var o=p[r];o&&x(o.prototype,e)&&delete o.prototype[e]}Qt[e]&&!n||re(Qt,e,n?t:nn&&Ht[e]||t)}},sn=Re("species"),fn=an,ln=cn,pn=[].slice;un("slice",function(e,t){for(var n=pn.call(fn(this),e,t),r=function(e,t){var n,r=F(e).constructor;return void 0===r||null==(n=F(r)[sn])?t:Ge(n)}(this,this.constructor),o=0,i=n.length,a=new(ln(r))(i);i>o;)a[o]=n[o++];return a},d(function(){new Int8Array(1).slice()}));var dn=Re("unscopables"),hn=Array.prototype;null==hn[dn]&&M(hn,dn,lt(null));var yn,vn=ye.includes;Ce({target:"Array",proto:!0},{includes:function(e){return vn(this,e,arguments.length>1?arguments[1]:void 0)}}),yn="includes",hn[dn][yn]=!0;Ve("Array","includes");function mn(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}var wn=setTimeout;function gn(e){return Boolean(e&&void 0!==e.length)}function bn(){}function _n(e){if(!(this instanceof _n))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],An(e,this)}function En(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,_n._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void Sn(t.promise,e)}Tn(t.promise,r)}else(1===e._state?Tn:Sn)(t.promise,e._value)})):e._deferreds.push(t)}function Tn(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof _n)return e._state=3,e._value=t,void On(e);if("function"==typeof n)return void An((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,On(e)}catch(t){Sn(e,t)}var r,o}function Sn(e,t){e._state=2,e._value=t,On(e)}function On(e){2===e._state&&0===e._deferreds.length&&_n._immediateFn(function(){e._handled||_n._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)En(e,e._deferreds[t]);e._deferreds=null}function kn(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function An(e,t){var n=!1;try{e(function(e){n||(n=!0,Tn(t,e))},function(e){n||(n=!0,Sn(t,e))})}catch(e){if(n)return;n=!0,Sn(t,e)}}_n.prototype.catch=function(e){return this.then(null,e)},_n.prototype.then=function(e,t){var n=new this.constructor(bn);return En(this,new kn(e,t,n)),n},_n.prototype.finally=mn,_n.all=function(e){return new _n(function(t,n){if(!gn(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void c.call(a,function(t){i(e,t)},n)}r[e]=a,0==--o&&t(r)}catch(e){n(e)}}for(var a=0;a<r.length;a++)i(a,r[a])})},_n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===_n?e:new _n(function(t){t(e)})},_n.reject=function(e){return new _n(function(t,n){n(e)})},_n.race=function(e){return new _n(function(t,n){if(!gn(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)_n.resolve(e[r]).then(t,n)})},_n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){wn(e,0)},_n._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var xn=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in xn?xn.Promise.prototype.finally||(xn.Promise.prototype.finally=mn):xn.Promise=_n,function(e){function t(e){if("utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+e+"') is invalid.")}function n(e,t){if(t=void 0===t?{fatal:!1}:t,"utf-8"!==(e=void 0===e?"utf-8":e))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+e+"') is invalid.");if(t.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(e.TextEncoder&&e.TextDecoder)return!1;Object.defineProperty(t.prototype,"encoding",{value:"utf-8"}),t.prototype.encode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");t=0;for(var n=e.length,r=0,o=Math.max(32,n+(n>>1)+7),i=new Uint8Array(o>>3<<3);t<n;){var a=e.charCodeAt(t++);if(55296<=a&&56319>=a){if(t<n){var c=e.charCodeAt(t);56320==(64512&c)&&(++t,a=((1023&a)<<10)+(1023&c)+65536)}if(55296<=a&&56319>=a)continue}if(r+4>i.length&&(o+=8,o=(o*=1+t/e.length*2)>>3<<3,(c=new Uint8Array(o)).set(i),i=c),0==(4294967168&a))i[r++]=a;else{if(0==(4294965248&a))i[r++]=a>>6&31|192;else if(0==(4294901760&a))i[r++]=a>>12&15|224,i[r++]=a>>6&63|128;else{if(0!=(4292870144&a))continue;i[r++]=a>>18&7|240,i[r++]=a>>12&63|128,i[r++]=a>>6&63|128}i[r++]=63&a|128}}return i.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(e,t){if((t=void 0===t?{stream:!1}:t).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");t=0;for(var n=(e=new Uint8Array(e)).length,r=[];t<n;){var o=e[t++];if(0===o)break;if(0==(128&o))r.push(o);else if(192==(224&o)){var i=63&e[t++];r.push((31&o)<<6|i)}else if(224==(240&o)){i=63&e[t++];var a=63&e[t++];r.push((31&o)<<12|i<<6|a)}else if(240==(248&o)){65535<(o=(7&o)<<18|(i=63&e[t++])<<12|(a=63&e[t++])<<6|63&e[t++])&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}return String.fromCharCode.apply(null,r)},e.TextEncoder=t,e.TextDecoder=n}("undefined"!=typeof window?window:i);var jn=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function c(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,c)}u((r=r.apply(e,t||[])).next())})},In=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}},Pn="browser-tabs-lock-key";function Cn(e){return new Promise(function(t){return setTimeout(t,e)})}function Un(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)]}return n}var Dn=function(){function e(){this.id=Date.now().toString()+Un(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),void 0===e.waiters&&(e.waiters=[])}return e.prototype.acquireLock=function(e,t){return void 0===t&&(t=5e3),jn(this,void 0,void 0,function(){var n,r,o,i,a,c;return In(this,function(u){switch(u.label){case 0:n=Date.now()+Un(4),r=Date.now()+t,o=Pn+"-"+e,i=window.localStorage,u.label=1;case 1:return Date.now()<r?null!==i.getItem(o)?[3,4]:(a=this.id+"-"+e+"-"+n,[4,Cn(Math.floor(25*Math.random()))]):[3,7];case 2:return u.sent(),i.setItem(o,JSON.stringify({id:this.id,iat:n,timeoutKey:a,timeAcquired:Date.now()})),[4,Cn(30)];case 3:return u.sent(),null!==(c=i.getItem(o))&&(c=JSON.parse(c)).id===this.id&&c.iat===n?[2,!0]:[3,6];case 4:return Fn(),[4,this.waitForSomethingToChange(r)];case 5:u.sent(),u.label=6;case 6:return n=Date.now()+Un(4),[3,1];case 7:return[2,!1]}})})},e.prototype.waitForSomethingToChange=function(t){return jn(this,void 0,void 0,function(){return In(this,function(n){switch(n.label){case 0:return[4,new Promise(function(n){var r=!1,o=Date.now(),i=50,a=!1;function c(){if(a||(window.removeEventListener("storage",c),e.removeFromWaiting(c),clearTimeout(u),a=!0),!r){r=!0;var t=i-(Date.now()-o);t>0?setTimeout(n,t):n()}}window.addEventListener("storage",c),e.addToWaiting(c);var u=setTimeout(c,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter(function(e){return e!==t}))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach(function(e){return e()})},e.prototype.releaseLock=function(e){return this.releaseLock__private__(e)},e.prototype.releaseLock__private__=function(t,n){void 0===n&&(n=null);var r=window.localStorage,o=Pn+"-"+t,i=r.getItem(o);null!==i&&((i=JSON.parse(i)).id!==this.id||null!==n&&i.iat!==n||(r.removeItem(o),e.notifyWaiters()))},e.waiters=void 0,e}();function Fn(){for(var e=Date.now()-1e4,t=window.localStorage,n=Object.keys(t),r=!1,o=0;o<n.length;o++){var i=n[o];if(i.includes(Pn)){var a=t.getItem(i);null!==a&&(a=JSON.parse(a)).timeAcquired<e&&(t.removeItem(i),r=!0)}}r&&Dn.notifyWaiters()}function Rn(e,t){return t=t||{},new Promise(function(n,r){var o=new XMLHttpRequest,i=[],a=[],c={},u=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(JSON.parse(o.responseText))},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return a},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var s in o.open(t.method||"get",e,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){i.push(t=t.toLowerCase()),a.push([t,n]),c[t]=c[t]?c[t]+","+n:n}),n(u())},o.onerror=r,o.withCredentials="include"==t.credentials,t.headers)o.setRequestHeader(s,t.headers[s]);o.send(t.body||null)})}var Ln,Mn={timeoutInSeconds:60},zn=function(e){return e.filter(function(t,n){return e.indexOf(t)===n})},Nn={error:"timeout",error_description:"Timeout"},Wn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.filter(Boolean).join();return zn(n.replace(/\s/g,",").split(",")).join(" ").trim()},qn=function(){var e=window.open("","auth0:authorize:popup","left=100,top=100,width=400,height=600,resizable,scrollbars=yes,status=1");if(!e)throw new Error("Could not open popup");return e},Bn=function(e,n,r){return e.location.href=n,new Promise(function(n,o){var i=setTimeout(function(){o(t({},Nn,{popup:e}))},1e3*(r.timeoutInSeconds||60));window.addEventListener("message",function(t){if(t.data&&"authorization_response"===t.data.type){if(clearTimeout(i),e.close(),t.data.response.error)return o(t.data.response);n(t.data.response)}})})},Jn=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Zn().getRandomValues(new Uint8Array(43))).forEach(function(n){return t+=e[n%e.length]}),t},Gn=function(e){return btoa(e)},Hn=function(e){return Object.keys(e).filter(function(t){return void 0!==e[t]}).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")},Yn=function(e){return r(void 0,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return t=$n().digest({name:"SHA-256"},(new TextEncoder).encode(e)),window.msCrypto?[2,new Promise(function(e,n){t.oncomplete=function(t){e(t.target.result)},t.onerror=function(e){n(e.error)},t.onabort=function(){n("The digest operation was aborted")}})]:[4,t];case 1:return[2,n.sent()]}})})},Vn=function(e){return function(e){return decodeURIComponent(atob(e).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(e.replace(/_/g,"/").replace(/-/g,"+"))},Kn=function(e){var t=new Uint8Array(e);return function(e){var t={"+":"-","/":"_","=":""};return e.replace(/[\+\/=]/g,function(e){return t[e]})}(window.btoa(String.fromCharCode.apply(String,Array.from(t))))},Qn=function(e,t){return r(void 0,void 0,void 0,function(){var r,i,a,c,u,s,f;return o(this,function(o){switch(o.label){case 0:return[4,Rn(e,t)];case 1:return[4,(r=o.sent()).json()];case 2:if(i=o.sent(),a=i.error,c=i.error_description,u=n(i,["error","error_description"]),!r.ok)throw s=c||"HTTP error. Unable to fetch "+e,(f=new Error(s)).error=a||"request_error",f.error_description=s,f;return[2,u]}})})},Xn=function(e){return r(void 0,void 0,void 0,function(){var r=e.baseUrl,i=n(e,["baseUrl"]);return o(this,function(e){switch(e.label){case 0:return[4,Qn(r+"/oauth/token",{method:"POST",body:JSON.stringify(t({grant_type:"authorization_code",redirect_uri:window.location.origin},i)),headers:{"Content-type":"application/json"}})];case 1:return[2,e.sent()]}})})},Zn=function(){return window.crypto||window.msCrypto},$n=function(){var e=Zn();return e.subtle||e.webkitSubtle},er=function(){if(!Zn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===$n())throw new Error("\n auth0-spa-js must run on a secure origin.\n See https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin \n for more information.\n ")},tr=function(e){return e.audience+"::"+e.scope},nr=function(){function e(){this.cache={}}return e.prototype.save=function(e){var t=this,n=tr(e);this.cache[n]=e;var r,o,i,a=(r=e.expires_in,o=e.decodedToken.claims.exp,i=(new Date(1e3*o).getTime()-(new Date).getTime())/1e3,1e3*Math.min(r,i)*.8);setTimeout(function(){delete t.cache[n]},a)},e.prototype.get=function(e){return this.cache[tr(e)]},e}(),rr=a(function(e,t){var n=i&&i.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function r(e,t){if(!t)return"";var n="; "+e;return!0===t?n:n+"="+t}function o(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(e){if("number"==typeof e.expires){var t=new Date;t.setMilliseconds(t.getMilliseconds()+864e5*e.expires),e.expires=t}return r("Expires",e.expires?e.expires.toUTCString():"")+r("Domain",e.domain)+r("Path",e.path)+r("Secure",e.secure)+r("SameSite",e.sameSite)}(n)}function a(e){for(var t={},n=e?e.split("; "):[],r=/(%[0-9A-Z]{2})+/g,o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");'"'===a.charAt(0)&&(a=a.slice(1,-1));try{t[i[0].replace(r,decodeURIComponent)]=a.replace(r,decodeURIComponent)}catch(e){}}return t}function c(){return a(document.cookie)}function u(e,t,r){document.cookie=o(e,t,n({path:"/"},r))}t.__esModule=!0,t.encode=o,t.parse=a,t.getAll=c,t.get=function(e){return c()[e]},t.set=u,t.remove=function(e,t){u(e,"",n({},t,{expires:-1}))}});(Ln=rr)&&Ln.__esModule&&Object.prototype.hasOwnProperty.call(Ln,"default")&&Ln.default;rr.encode,rr.parse;var or=rr.getAll,ir=rr.get,ar=rr.set,cr=rr.remove,ur=function(){return Object.keys(or()||{})},sr=function(e){var t=ir(e);if(void 0!==t)return JSON.parse(t)},fr=function(e,t,n){ar(e,JSON.stringify(t),{expires:n.daysUntilExpire})},lr=function(e){cr(e)},pr="a0.spajs.txs.",dr=function(e){return""+pr+e},hr=function(){function e(){var e=this;this.transactions={},ur().filter(function(e){return e.startsWith(pr)}).forEach(function(t){var n=t.replace(pr,"");e.transactions[n]=sr(t)})}return e.prototype.create=function(e,t){this.transactions[e]=t,fr(dr(e),t,{daysUntilExpire:1})},e.prototype.get=function(e){return this.transactions[e]},e.prototype.remove=function(e){delete this.transactions[e],lr(dr(e))},e}(),yr=function(e){return"number"==typeof e},vr=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],mr=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=t[0],r=t[1],o=t[2];if(3!==t.length||!n||!r||!o)throw new Error("ID token could not be decoded");var i=JSON.parse(Vn(r)),a={__raw:e},c={};return Object.keys(i).forEach(function(e){a[e]=i[e],vr.includes(e)||(c[e]=i[e])}),{encoded:{header:n,payload:r,signature:o},header:JSON.parse(Vn(n)),claims:a,user:c}}(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+e.iss+'", found "'+t.claims.iss+'"');if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==t.header.alg)throw new Error('Signature algorithm of "'+t.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!t.claims.aud||"string"!=typeof t.claims.aud&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but was not one of "'+t.claims.aud.join(", ")+'"');if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+e.aud+'", found "'+t.claims.azp+'"')}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+e.aud+'" but found "'+t.claims.aud+'"');if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+e.nonce+'", found "'+t.claims.nonce+'"')}if(e.max_age&&!yr(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(!yr(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!yr(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=e.leeway||60,r=new Date,o=new Date(0),i=new Date(0),a=new Date(0),c=new Date(0);if(c.setUTCSeconds((parseInt(t.claims.auth_time)+parseInt(e.max_age))/1e3+n),o.setUTCSeconds(t.claims.exp+n),i.setUTCSeconds(t.claims.iat-n),a.setUTCSeconds(t.claims.nbf-n),r>o)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+r+") is after expiration time ("+o+")");if(r<i)throw new Error("Issued At (iat) claim error in the ID token; current time ("+r+") is before issued at time ("+i+")");if(yr(t.claims.nbf)&&r<a)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+r+") is before "+a);if(yr(t.claims.auth_time)&&r>c)throw new Error("Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time ("+r+") is after last auth at "+c);return t},wr=function(t){function n(e,r,o){var i=t.call(this,r)||this;return i.error=e,i.error_description=r,i.state=o,Object.setPrototypeOf(i,n.prototype),i}return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,t),n}(Error),gr=new Dn,br=function(){function e(e){this.options=e,this.DEFAULT_SCOPE="openid profile email",this.cache=new nr,this.transactionManager=new hr,this.domainUrl="https://"+this.options.domain,this.tokenIssuer=this.options.issuer?"https://"+this.options.issuer+"/":this.domainUrl+"/"}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify({name:"auth0-spa-js",version:"1.4.0"})));return""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,r,o,i,a){var c=this.options,u=(c.domain,c.leeway,n(c,["domain","leeway"]));return t({},u,e,{scope:Wn(this.DEFAULT_SCOPE,this.options.scope,e.scope),response_type:"code",response_mode:"query",state:r,nonce:o,redirect_uri:a||this.options.redirect_uri,code_challenge:i,code_challenge_method:"S256"})},e.prototype._authorizeUrl=function(e){return this._url("/authorize?"+Hn(e))},e.prototype._verifyIdToken=function(e,t){return mr({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,leeway:this.options.leeway,max_age:this.options.max_age})},e.prototype.loginWithPopup=function(e,i){return void 0===e&&(e={}),void 0===i&&(i=Mn),r(this,void 0,void 0,function(){var r,a,c,u,s,f,l,p,d,h,y,v,m;return o(this,function(o){switch(o.label){case 0:return[4,qn()];case 1:return r=o.sent(),a=n(e,[]),c=Gn(Jn()),u=Jn(),s=Jn(),[4,Yn(s)];case 2:return f=o.sent(),l=Kn(f),p=this._getParams(a,c,u,l,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(t({},p,{response_mode:"web_message"})),[4,Bn(r,d,i)];case 3:if(h=o.sent(),c!==h.state)throw new Error("Invalid state");return[4,Xn({baseUrl:this.domainUrl,audience:e.audience||this.options.audience,client_id:this.options.client_id,code_verifier:s,code:h.code})];case 4:return y=o.sent(),v=this._verifyIdToken(y.id_token,u),m=t({},y,{decodedToken:v,scope:p.scope,audience:p.audience||"default"}),this.cache.save(m),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2]}})})},e.prototype.getUser=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var t;return o(this,function(n){return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(e))&&t.decodedToken.user]})})},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={audience:this.options.audience||"default",scope:this.options.scope||this.DEFAULT_SCOPE}),r(this,void 0,void 0,function(){var t;return o(this,function(n){return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[2,(t=this.cache.get(e))&&t.decodedToken.claims]})})},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),r(this,void 0,void 0,function(){var t,r,i,a,c,u,s,f,l,p;return o(this,function(o){switch(o.label){case 0:return t=e.redirect_uri,r=e.appState,i=n(e,["redirect_uri","appState"]),a=Gn(Jn()),c=Jn(),u=Jn(),[4,Yn(u)];case 1:return s=o.sent(),f=Kn(s),l=this._getParams(i,a,c,f,t),p=this._authorizeUrl(l),this.transactionManager.create(a,{nonce:c,code_verifier:u,appState:r,scope:l.scope,audience:l.audience||"default"}),window.location.assign(p),[2]}})})},e.prototype.handleRedirectCallback=function(){return r(this,void 0,void 0,function(){var e,n,r,i,a,c,u,s,f,l;return o(this,function(o){switch(o.label){case 0:if(0===(e=window.location.href.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(n=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var n=e.split("&"),r={};return n.forEach(function(e){var t=e.split("="),n=t[0],o=t[1];r[n]=decodeURIComponent(o)}),t({},r,{expires_in:parseInt(r.expires_in)})}(e.join("")),r=n.state,i=n.code,a=n.error,c=n.error_description,a)throw this.transactionManager.remove(r),new wr(a,c,r);if(!(u=this.transactionManager.get(r)))throw new Error("Invalid state");return this.transactionManager.remove(r),[4,Xn({baseUrl:this.domainUrl,audience:this.options.audience,client_id:this.options.client_id,code_verifier:u.code_verifier,code:i})];case 1:return s=o.sent(),f=this._verifyIdToken(s.id_token,u.nonce),l=t({},s,{decodedToken:f,audience:u.audience,scope:u.scope}),this.cache.save(l),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),[2,{appState:u.appState}]}})})},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE,ignoreCache:!1}),r(this,void 0,void 0,function(){var n,r,i,a,c,u,s,f,l,p,d,h,y;return o(this,function(o){switch(o.label){case 0:return e.scope=Wn(this.DEFAULT_SCOPE,e.scope),[4,gr.acquireLock("auth0.lock.getTokenSilently",5e3)];case 1:return o.sent(),!e.ignoreCache&&(n=this.cache.get({scope:e.scope,audience:e.audience||"default"}))?(gr.releaseLock("auth0.lock.getTokenSilently"),[2,n.access_token]):(r=Gn(Jn()),i=Jn(),a=Jn(),[4,Yn(a)]);case 2:return c=o.sent(),u=Kn(c),s={audience:e.audience,scope:e.scope},f=this._getParams(s,r,i,u,this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(t({},f,{prompt:"none",response_mode:"web_message"})),[4,(v=l,m=this.domainUrl,new Promise(function(e,t){var n=window.document.createElement("iframe");n.setAttribute("width","0"),n.setAttribute("height","0"),n.style.display="none";var r=setTimeout(function(){t(Nn),window.document.body.removeChild(n)},6e4),o=function(i){i.origin==m&&i.data&&"authorization_response"===i.data.type&&(i.source.close(),i.data.response.error?t(i.data.response):e(i.data.response),clearTimeout(r),window.removeEventListener("message",o,!1),window.document.body.removeChild(n))};window.addEventListener("message",o,!1),window.document.body.appendChild(n),n.setAttribute("src",v)}))];case 3:if(p=o.sent(),r!==p.state)throw new Error("Invalid state");return[4,Xn({baseUrl:this.domainUrl,audience:e.audience||this.options.audience,client_id:this.options.client_id,code_verifier:a,code:p.code})];case 4:return d=o.sent(),h=this._verifyIdToken(d.id_token,i),y=t({},d,{decodedToken:h,scope:f.scope,audience:f.audience||"default"}),this.cache.save(y),fr("auth0.is.authenticated",!0,{daysUntilExpire:1}),gr.releaseLock("auth0.lock.getTokenSilently"),[2,d.access_token]}var v,m})})},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={audience:this.options.audience,scope:this.options.scope||this.DEFAULT_SCOPE}),void 0===t&&(t=Mn),r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return e.scope=Wn(this.DEFAULT_SCOPE,this.options.scope,e.scope),[4,this.loginWithPopup(e,t)];case 1:return n.sent(),[2,this.cache.get({scope:e.scope,audience:e.audience||"default"}).access_token]}})})},e.prototype.isAuthenticated=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,this.getUser()];case 1:return[2,!!e.sent()]}})})},e.prototype.logout=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id,lr("auth0.is.authenticated");var t=e.federated,r=n(e,["federated"]),o=t?"&federated":"",i=this._url("/v2/logout?"+Hn(r));window.location.assign(""+i+o)},e}();return function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:if(er(),t=new br(e),!sr("auth0.is.authenticated"))return[2,t];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,t.getTokenSilently({audience:e.audience,scope:e.scope,ignoreCache:!0})];case 2:case 3:return n.sent(),[3,4];case 4:return[2,t]}})})}});
//# sourceMappingURL=auth0-spa-js.production.js.map

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "1.3.2",
"version": "1.4.0",
"main": "dist/lib/auth0-spa-js.cjs.js",

@@ -48,3 +48,3 @@ "types": "dist/typings/index.d.ts",

"idtoken-verifier": "^1.4.1",
"jest": "^24.8.0",
"jest": "^24.9.0",
"jsonwebtoken": "^8.5.1",

@@ -70,6 +70,7 @@ "pem": "^1.14.2",

"typedoc": "^0.15.0",
"typescript": "^3.5.3",
"typescript": "^3.6.4",
"wait-on": "^3.3.0"
},
"dependencies": {
"browser-tabs-lock": "^1.1.9",
"core-js": "^3.2.1",

@@ -76,0 +77,0 @@ "es-cookie": "^1.2.0",

@@ -0,1 +1,3 @@

import Lock from 'browser-tabs-lock';
import {

@@ -23,2 +25,5 @@ getUniqueScopes,

const lock = new Lock();
const GET_TOKEN_SILENTLY_LOCK_KEY = 'auth0.lock.getTokenSilently';
/**

@@ -87,3 +92,4 @@ * Auth0 SDK for Single Page Applications using [Authorization Code Grant Flow with PKCE](https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce).

nonce,
leeway: this.options.leeway
leeway: this.options.leeway,
max_age: this.options.max_age
});

@@ -245,2 +251,3 @@ }

if (error) {
this.transactionManager.remove(state);
throw new AuthenticationError(error, error_description, state);

@@ -301,2 +308,4 @@ }

options.scope = getUniqueScopes(this.DEFAULT_SCOPE, options.scope);
await lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, 5000);
if (!options.ignoreCache) {

@@ -308,2 +317,3 @@ const cache = this.cache.get({

if (cache) {
lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);
return cache.access_token;

@@ -354,2 +364,3 @@ }

ClientStorage.save('auth0.is.authenticated', true, { daysUntilExpire: 1 });
lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);
return authResult.access_token;

@@ -356,0 +367,0 @@ }

@@ -89,3 +89,4 @@ /**

* The value in seconds used to account for clock skew in JWT expirations.
* Typically, this value is no more than a minute or two at maximum.
* Typically, this value is no more than a minute or two at maximum.
* Defaults to 60s.
*/

@@ -244,2 +245,3 @@ leeway?: number;

leeway?: number;
max_age?: string;
}

@@ -246,0 +248,0 @@

import { urlDecodeB64 } from './utils';
const isNumber = n => typeof n === 'number';
const idTokendecoded = [

@@ -37,6 +39,11 @@ 'iss',

export const decode = (token: string) => {
const [header, payload, signature] = token.split('.');
const parts = token.split('.');
const [header, payload, signature] = parts;
if (parts.length !== 3 || !header || !payload || !signature) {
throw new Error('ID token could not be decoded');
}
const payloadJSON = JSON.parse(urlDecodeB64(payload));
const claims: IdToken = { __raw: token };
const user = {};
const user: any = {};
Object.keys(payloadJSON).forEach(k => {

@@ -57,17 +64,100 @@ claims[k] = payloadJSON[k];

export const verify = (options: JWTVerifyOptions) => {
if (!options.id_token) {
throw new Error('ID token is required but missing');
}
const decoded = decode(options.id_token);
if (!decoded.claims.iss) {
throw new Error(
'Issuer (iss) claim must be a string present in the ID token'
);
}
if (decoded.claims.iss !== options.iss) {
throw new Error('Invalid issuer');
throw new Error(
`Issuer (iss) claim mismatch in the ID token; expected "${options.iss}", found "${decoded.claims.iss}"`
);
}
if (decoded.claims.aud !== options.aud) {
throw new Error('Invalid audience');
if (!decoded.user.sub) {
throw new Error(
'Subject (sub) claim must be a string present in the ID token'
);
}
if (decoded.header.alg !== 'RS256') {
throw new Error('Invalid algorithm');
throw new Error(
`Signature algorithm of "${decoded.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`
);
}
if (decoded.claims.nonce !== options.nonce) {
throw new Error('Invalid nonce');
if (
!decoded.claims.aud ||
!(
typeof decoded.claims.aud === 'string' ||
Array.isArray(decoded.claims.aud)
)
) {
throw new Error(
'Audience (aud) claim must be a string or array of strings present in the ID token'
);
}
if (Array.isArray(decoded.claims.aud)) {
if (!decoded.claims.aud.includes(options.aud)) {
throw new Error(
`Audience (aud) claim mismatch in the ID token; expected "${
options.aud
}" but was not one of "${decoded.claims.aud.join(', ')}"`
);
}
if (decoded.claims.aud.length > 1) {
if (!decoded.claims.azp) {
throw new Error(
'Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values'
);
}
if (decoded.claims.azp !== options.aud) {
throw new Error(
`Authorized Party (azp) claim mismatch in the ID token; expected "${options.aud}", found "${decoded.claims.azp}"`
);
}
}
} else if (decoded.claims.aud !== options.aud) {
throw new Error(
`Audience (aud) claim mismatch in the ID token; expected "${options.aud}" but found "${decoded.claims.aud}"`
);
}
if (options.nonce) {
if (!decoded.claims.nonce) {
throw new Error(
'Nonce (nonce) claim must be a string present in the ID token'
);
}
if (decoded.claims.nonce !== options.nonce) {
throw new Error(
`Nonce (nonce) claim mismatch in the ID token; expected "${options.nonce}", found "${decoded.claims.nonce}"`
);
}
}
if (options.max_age && !isNumber(decoded.claims.auth_time)) {
throw new Error(
'Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified'
);
}
/* istanbul ignore next */
if (!isNumber(decoded.claims.exp)) {
throw new Error(
'Expiration Time (exp) claim must be a number present in the ID token'
);
}
if (!isNumber(decoded.claims.iat)) {
throw new Error(
'Issued At (iat) claim must be a number present in the ID token'
);
}
const leeway = options.leeway || 60;
const now = new Date();

@@ -77,16 +167,32 @@ const expDate = new Date(0);

const nbfDate = new Date(0);
const leeway = options.leeway || 60;
const authTimeDate = new Date(0);
authTimeDate.setUTCSeconds(
(parseInt(decoded.claims.auth_time) + parseInt(options.max_age)) / 1000 +
leeway
);
expDate.setUTCSeconds(decoded.claims.exp + leeway);
iatDate.setUTCSeconds(decoded.claims.iat - leeway);
nbfDate.setUTCSeconds(decoded.claims.nbf - leeway);
if (now > expDate) {
throw new Error('id_token expired');
throw new Error(
`Expiration Time (exp) claim error in the ID token; current time (${now}) is after expiration time (${expDate})`
);
}
if (now < iatDate) {
throw new Error('id_token was issued in the future (invalid iat)');
throw new Error(
`Issued At (iat) claim error in the ID token; current time (${now}) is before issued at time (${iatDate})`
);
}
if (typeof decoded.claims.nbf !== 'undefined' && now < nbfDate) {
throw new Error('token is not yet valid (invalid notBefore)');
if (isNumber(decoded.claims.nbf) && now < nbfDate) {
throw new Error(
`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time (${now}) is before ${nbfDate}`
);
}
if (isNumber(decoded.claims.auth_time) && now > authTimeDate) {
throw new Error(
`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Currrent time (${now}) is after last auth at ${authTimeDate}`
);
}
return decoded;
};

@@ -119,13 +119,31 @@ import fetch from 'unfetch';

export const sha256 = async (s: string) => {
const response = await Promise.resolve(
getCryptoSubtle().digest({ name: 'SHA-256' }, new TextEncoder().encode(s))
const digestOp = getCryptoSubtle().digest(
{ name: 'SHA-256' },
new TextEncoder().encode(s)
);
// msCrypto (IE11) uses the old spec, which is not Promise based
// https://msdn.microsoft.com/en-us/expression/dn904640(v=vs.71)
// Instead of returning a promise, it returns a CryptoOperation
// with a `result` property in it
if ((<any>response).result) {
return (<any>response).result;
// with a result property in it.
// As a result, the various events need to be handled in the event that we're
// working in IE11 (hence the msCrypto check). These events just call resolve
// or reject depending on their intention.
if ((<any>window).msCrypto) {
return new Promise((res, rej) => {
digestOp.oncomplete = e => {
res(e.target.result);
};
digestOp.onerror = (e: ErrorEvent) => {
rej(e.error);
};
digestOp.onabort = () => {
rej('The digest operation was aborted');
};
});
}
return response;
return await digestOp;
};

@@ -132,0 +150,0 @@

@@ -1,1 +0,1 @@

export default '1.3.2';
export default '1.4.0';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc