@auth0/auth0-react 1.4.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,20 +97,20 @@
97
97
  }
98
98
 
99
99
  /*! *****************************************************************************
100
- Copyright (c) Microsoft Corporation. All rights reserved.
101
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
102
- this file except in compliance with the License. You may obtain a copy of the
103
- License at http://www.apache.org/licenses/LICENSE-2.0
100
+ Copyright (c) Microsoft Corporation.
104
101
 
105
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
106
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
107
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
108
- MERCHANTABLITY OR NON-INFRINGEMENT.
102
+ Permission to use, copy, modify, and/or distribute this software for any
103
+ purpose with or without fee is hereby granted.
109
104
 
110
- See the Apache Version 2.0 License for specific language governing permissions
111
- and limitations under the License.
105
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
106
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
107
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
108
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
109
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
110
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
111
+ PERFORMANCE OF THIS SOFTWARE.
112
112
  ***************************************************************************** */
113
- 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)};function e(e,n){function i(){this.constructor=e;}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i);}var n=function(){return (n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function i(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]]);}return n}function r(t,e,n,i){return new(n||(n=Promise))((function(r,o){function c(t){try{a(i.next(t));}catch(t){o(t);}}function s(t){try{a(i.throw(t));}catch(t){o(t);}}function a(t){t.done?r(t.value):new n((function(e){e(t.value);})).then(c,s);}a((i=i.apply(t,e||[])).next());}))}function o(t,e){var n,i,r,o,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,i=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){c.label=o[1];break}if(6===o[0]&&c.label<r[1]){c.label=r[1],r=o;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(o);break}r[2]&&c.ops.pop(),c.trys.pop();continue}o=e.call(t,c);}catch(t){o=[6,t],i=0;}finally{n=r=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u=function(t){return t&&t.Math==Math&&t},l=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof c&&c)||function(){return this}()||Function("return this")(),d=function(t){try{return !!t()}catch(t){return !0}},g=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),f={}.propertyIsEnumerable,I=Object.getOwnPropertyDescriptor,p={f:I&&!f.call({1:2},1)?function(t){var e=I(this,t);return !!e&&e.enumerable}:f},h=function(t,e){return {enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,b=function(t){return y.call(t).slice(8,-1)},m="".split,v=d((function(){return !Object("z").propertyIsEnumerable(0)}))?function(t){return "String"==b(t)?m.call(t,""):Object(t)}:Object,B=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},C=function(t){return v(B(t))},F=function(t){return "object"==typeof t?null!==t:"function"==typeof t},U=function(t,e){if(!F(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!F(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!F(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!F(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},S={}.hasOwnProperty,Z=function(t,e){return S.call(t,e)},V=l.document,G=F(V)&&F(V.createElement),X=function(t){return G?V.createElement(t):{}},w=!g&&!d((function(){return 7!=Object.defineProperty(X("div"),"a",{get:function(){return 7}}).a})),x=Object.getOwnPropertyDescriptor,A={f:g?x:function(t,e){if(t=C(t),e=U(e,!0),w)try{return x(t,e)}catch(t){}if(Z(t,e))return h(!p.f.call(t,e),t[e])}},R=function(t){if(!F(t))throw TypeError(String(t)+" is not an object");return t},Q=Object.defineProperty,J={f:g?Q:function(t,e,n){if(R(t),e=U(e,!0),R(n),w)try{return Q(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}},W=g?function(t,e,n){return J.f(t,e,h(1,n))}:function(t,e,n){return t[e]=n,t},H=function(t,e){try{W(l,t,e);}catch(n){l[t]=e;}return e},k=l["__core-js_shared__"]||H("__core-js_shared__",{}),L=Function.toString;"function"!=typeof k.inspectSource&&(k.inspectSource=function(t){return L.call(t)});var E,T,Y,N=k.inspectSource,K=l.WeakMap,O="function"==typeof K&&/native code/.test(N(K)),z=a((function(t){(t.exports=function(t,e){return k[t]||(k[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.8.0",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});})),j=0,_=Math.random(),D=function(t){return "Symbol("+String(void 0===t?"":t)+")_"+(++j+_).toString(36)},P=z("keys"),M=function(t){return P[t]||(P[t]=D(t))},q={},$=l.WeakMap;if(O){var tt=k.state||(k.state=new $),et=tt.get,nt=tt.has,it=tt.set;E=function(t,e){return e.facade=t,it.call(tt,t,e),e},T=function(t){return et.call(tt,t)||{}},Y=function(t){return nt.call(tt,t)};}else {var rt=M("state");q[rt]=!0,E=function(t,e){return e.facade=t,W(t,rt,e),e},T=function(t){return Z(t,rt)?t[rt]:{}},Y=function(t){return Z(t,rt)};}var ot,ct={set:E,get:T,has:Y,enforce:function(t){return Y(t)?T(t):E(t,{})},getterFor:function(t){return function(e){var n;if(!F(e)||(n=T(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},st=a((function(t){var e=ct.get,n=ct.enforce,i=String(String).split("String");(t.exports=function(t,e,r,o){var c,s=!!o&&!!o.unsafe,a=!!o&&!!o.enumerable,u=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof e||Z(r,"name")||W(r,"name",e),(c=n(r)).source||(c.source=i.join("string"==typeof e?e:""))),t!==l?(s?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:W(t,e,r)):a?t[e]=r:H(e,r);})(Function.prototype,"toString",(function(){return "function"==typeof this&&e(this).source||N(this)}));})),at=l,ut=function(t){return "function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?ut(at[t])||ut(l[t]):at[t]&&at[t][e]||l[t]&&l[t][e]},dt=Math.ceil,gt=Math.floor,ft=function(t){return isNaN(t=+t)?0:(t>0?gt:dt)(t)},It=Math.min,pt=function(t){return t>0?It(ft(t),9007199254740991):0},ht=Math.max,yt=Math.min,bt=function(t){return function(e,n,i){var r,o=C(e),c=pt(o.length),s=function(t,e){var n=ft(t);return n<0?ht(n+e,0):yt(n,e)}(i,c);if(t&&n!=n){for(;c>s;)if((r=o[s++])!=r)return !0}else for(;c>s;s++)if((t||s in o)&&o[s]===n)return t||s||0;return !t&&-1}},mt={includes:bt(!0),indexOf:bt(!1)},vt=mt.indexOf,Bt=function(t,e){var n,i=C(t),r=0,o=[];for(n in i)!Z(q,n)&&Z(i,n)&&o.push(n);for(;e.length>r;)Z(i,n=e[r++])&&(~vt(o,n)||o.push(n));return o},Ct=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ft=Ct.concat("length","prototype"),Ut={f:Object.getOwnPropertyNames||function(t){return Bt(t,Ft)}},St={f:Object.getOwnPropertySymbols},Zt=lt("Reflect","ownKeys")||function(t){var e=Ut.f(R(t)),n=St.f;return n?e.concat(n(t)):e},Vt=function(t,e){for(var n=Zt(e),i=J.f,r=A.f,o=0;o<n.length;o++){var c=n[o];Z(t,c)||i(t,c,r(e,c));}},Gt=/#|\.prototype\./,Xt=function(t,e){var n=xt[wt(t)];return n==Rt||n!=At&&("function"==typeof e?d(e):!!e)},wt=Xt.normalize=function(t){return String(t).replace(Gt,".").toLowerCase()},xt=Xt.data={},At=Xt.NATIVE="N",Rt=Xt.POLYFILL="P",Qt=Xt,Jt=A.f,Wt=function(t,e){var n,i,r,o,c,s=t.target,a=t.global,u=t.stat;if(n=a?l:u?l[s]||H(s,{}):(l[s]||{}).prototype)for(i in e){if(o=e[i],r=t.noTargetGet?(c=Jt(n,i))&&c.value:n[i],!Qt(a?i:s+(u?".":"#")+i,t.forced)&&void 0!==r){if(typeof o==typeof r)continue;Vt(o,r);}(t.sham||r&&r.sham)&&W(o,"sham",!0),st(n,i,o,t);}},Ht=!!Object.getOwnPropertySymbols&&!d((function(){return !String(Symbol())})),kt=Ht&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Lt=z("wks"),Et=l.Symbol,Tt=kt?Et:Et&&Et.withoutSetter||D,Yt=function(t){return Z(Lt,t)||(Ht&&Z(Et,t)?Lt[t]=Et[t]:Lt[t]=Tt("Symbol."+t)),Lt[t]},Nt=Yt("match"),Kt=function(t){if(function(t){var e;return F(t)&&(void 0!==(e=t[Nt])?!!e:"RegExp"==b(t))}(t))throw TypeError("The method doesn't accept regular expressions");return t},Ot=Yt("match"),zt=function(t){var e=/./;try{"/./"[t](e);}catch(n){try{return e[Ot]=!1,"/./"[t](e)}catch(t){}}return !1},jt=A.f,_t="".startsWith,Dt=Math.min,Pt=zt("startsWith"),Mt=!(Pt||(ot=jt(String.prototype,"startsWith"),!ot||ot.writable));Wt({target:"String",proto:!0,forced:!Mt&&!Pt},{startsWith:function(t){var e=String(B(this));Kt(t);var n=pt(Dt(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return _t?_t.call(e,i,n):e.slice(n,n+i.length)===i}});var qt,$t,te=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},ee=function(t,e,n){if(te(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,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}},ne=Function.call,ie=function(t,e,n){return ee(ne,l[t].prototype[e],n)},re=(ie("String","startsWith"),Array.isArray||function(t){return "Array"==b(t)}),oe=function(t){return Object(B(t))},ce=function(t,e,n){var i=U(e);i in t?J.f(t,i,h(0,n)):t[i]=n;},se=Yt("species"),ae=function(t,e){var n;return re(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!re(n.prototype)?F(n)&&null===(n=n[se])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},ue=lt("navigator","userAgent")||"",le=l.process,de=le&&le.versions,ge=de&&de.v8;ge?$t=(qt=ge.split("."))[0]+qt[1]:ue&&(!(qt=ue.match(/Edge\/(\d+)/))||qt[1]>=74)&&(qt=ue.match(/Chrome\/(\d+)/))&&($t=qt[1]);var fe=$t&&+$t,Ie=Yt("species"),pe=Yt("isConcatSpreadable"),he=fe>=51||!d((function(){var t=[];return t[pe]=!1,t.concat()[0]!==t})),ye=function(t){return fe>=51||!d((function(){var e=[];return (e.constructor={})[Ie]=function(){return {foo:1}},1!==e[t](Boolean).foo}))}("concat"),be=function(t){if(!F(t))return !1;var e=t[pe];return void 0!==e?!!e:re(t)};Wt({target:"Array",proto:!0,forced:!he||!ye},{concat:function(t){var e,n,i,r,o,c=oe(this),s=ae(c,0),a=0;for(e=-1,i=arguments.length;e<i;e++)if(be(o=-1===e?c:arguments[e])){if(a+(r=pt(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<r;n++,a++)n in o&&ce(s,a,o[n]);}else {if(a>=9007199254740991)throw TypeError("Maximum allowed index exceeded");ce(s,a++,o);}return s.length=a,s}});var me={};me[Yt("toStringTag")]="z";var ve="[object z]"===String(me),Be=Yt("toStringTag"),Ce="Arguments"==b(function(){return arguments}()),Fe=ve?b:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Be))?n:Ce?b(e):"Object"==(i=b(e))&&"function"==typeof e.callee?"Arguments":i},Ue=ve?{}.toString:function(){return "[object "+Fe(this)+"]"};ve||st(Object.prototype,"toString",Ue,{unsafe:!0});var Se,Ze=Object.keys||function(t){return Bt(t,Ct)},Ve=g?Object.defineProperties:function(t,e){R(t);for(var n,i=Ze(e),r=i.length,o=0;r>o;)J.f(t,n=i[o++],e[n]);return t},Ge=lt("document","documentElement"),Xe=M("IE_PROTO"),we=function(){},xe=function(t){return "<script>"+t+"<\/script>"},Ae=function(){try{Se=document.domain&&new ActiveXObject("htmlfile");}catch(t){}var t,e;Ae=Se?function(t){t.write(xe("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Se):((e=X("iframe")).style.display="none",Ge.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(xe("document.F=Object")),t.close(),t.F);for(var n=Ct.length;n--;)delete Ae.prototype[Ct[n]];return Ae()};q[Xe]=!0;var Re=Object.create||function(t,e){var n;return null!==t?(we.prototype=R(t),n=new we,we.prototype=null,n[Xe]=t):n=Ae(),void 0===e?n:Ve(n,e)},Qe=Ut.f,Je={}.toString,We="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],He={f:function(t){return We&&"[object Window]"==Je.call(t)?function(t){try{return Qe(t)}catch(t){return We.slice()}}(t):Qe(C(t))}},ke={f:Yt},Le=J.f,Ee=function(t){var e=at.Symbol||(at.Symbol={});Z(e,t)||Le(e,t,{value:ke.f(t)});},Te=J.f,Ye=Yt("toStringTag"),Ne=function(t,e,n){t&&!Z(t=n?t:t.prototype,Ye)&&Te(t,Ye,{configurable:!0,value:e});},Ke=[].push,Oe=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,o=6==t,c=7==t,s=5==t||o;return function(a,u,l,d){for(var g,f,I=oe(a),p=v(I),h=ee(u,l,3),y=pt(p.length),b=0,m=d||ae,B=e?m(a,y):n||c?m(a,0):void 0;y>b;b++)if((s||b in p)&&(f=h(g=p[b],b,I),t))if(e)B[b]=f;else if(f)switch(t){case 3:return !0;case 5:return g;case 6:return b;case 2:Ke.call(B,g);}else switch(t){case 4:return !1;case 7:Ke.call(B,g);}return o?-1:i||r?r:B}},ze={forEach:Oe(0),map:Oe(1),filter:Oe(2),some:Oe(3),every:Oe(4),find:Oe(5),findIndex:Oe(6),filterOut:Oe(7)}.forEach,je=M("hidden"),_e=Yt("toPrimitive"),De=ct.set,Pe=ct.getterFor("Symbol"),Me=Object.prototype,qe=l.Symbol,$e=lt("JSON","stringify"),tn=A.f,en=J.f,nn=He.f,rn=p.f,on=z("symbols"),cn=z("op-symbols"),sn=z("string-to-symbol-registry"),an=z("symbol-to-string-registry"),un=z("wks"),ln=l.QObject,dn=!ln||!ln.prototype||!ln.prototype.findChild,gn=g&&d((function(){return 7!=Re(en({},"a",{get:function(){return en(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=tn(Me,e);i&&delete Me[e],en(t,e,n),i&&t!==Me&&en(Me,e,i);}:en,fn=function(t,e){var n=on[t]=Re(qe.prototype);return De(n,{type:"Symbol",tag:t,description:e}),g||(n.description=e),n},In=kt?function(t){return "symbol"==typeof t}:function(t){return Object(t)instanceof qe},pn=function(t,e,n){t===Me&&pn(cn,e,n),R(t);var i=U(e,!0);return R(n),Z(on,i)?(n.enumerable?(Z(t,je)&&t[je][i]&&(t[je][i]=!1),n=Re(n,{enumerable:h(0,!1)})):(Z(t,je)||en(t,je,h(1,{})),t[je][i]=!0),gn(t,i,n)):en(t,i,n)},hn=function(t,e){R(t);var n=C(e),i=Ze(n).concat(vn(n));return ze(i,(function(e){g&&!yn.call(n,e)||pn(t,e,n[e]);})),t},yn=function(t){var e=U(t,!0),n=rn.call(this,e);return !(this===Me&&Z(on,e)&&!Z(cn,e))&&(!(n||!Z(this,e)||!Z(on,e)||Z(this,je)&&this[je][e])||n)},bn=function(t,e){var n=C(t),i=U(e,!0);if(n!==Me||!Z(on,i)||Z(cn,i)){var r=tn(n,i);return !r||!Z(on,i)||Z(n,je)&&n[je][i]||(r.enumerable=!0),r}},mn=function(t){var e=nn(C(t)),n=[];return ze(e,(function(t){Z(on,t)||Z(q,t)||n.push(t);})),n},vn=function(t){var e=t===Me,n=nn(e?cn:C(t)),i=[];return ze(n,(function(t){!Z(on,t)||e&&!Z(Me,t)||i.push(on[t]);})),i};if(Ht||(st((qe=function(){if(this instanceof qe)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=D(t),n=function(t){this===Me&&n.call(cn,t),Z(this,je)&&Z(this[je],e)&&(this[je][e]=!1),gn(this,e,h(1,t));};return g&&dn&&gn(Me,e,{configurable:!0,set:n}),fn(e,t)}).prototype,"toString",(function(){return Pe(this).tag})),st(qe,"withoutSetter",(function(t){return fn(D(t),t)})),p.f=yn,J.f=pn,A.f=bn,Ut.f=He.f=mn,St.f=vn,ke.f=function(t){return fn(Yt(t),t)},g&&(en(qe.prototype,"description",{configurable:!0,get:function(){return Pe(this).description}}),st(Me,"propertyIsEnumerable",yn,{unsafe:!0}))),Wt({global:!0,wrap:!0,forced:!Ht,sham:!Ht},{Symbol:qe}),ze(Ze(un),(function(t){Ee(t);})),Wt({target:"Symbol",stat:!0,forced:!Ht},{for:function(t){var e=String(t);if(Z(sn,e))return sn[e];var n=qe(e);return sn[e]=n,an[n]=e,n},keyFor:function(t){if(!In(t))throw TypeError(t+" is not a symbol");if(Z(an,t))return an[t]},useSetter:function(){dn=!0;},useSimple:function(){dn=!1;}}),Wt({target:"Object",stat:!0,forced:!Ht,sham:!g},{create:function(t,e){return void 0===e?Re(t):hn(Re(t),e)},defineProperty:pn,defineProperties:hn,getOwnPropertyDescriptor:bn}),Wt({target:"Object",stat:!0,forced:!Ht},{getOwnPropertyNames:mn,getOwnPropertySymbols:vn}),Wt({target:"Object",stat:!0,forced:d((function(){St.f(1);}))},{getOwnPropertySymbols:function(t){return St.f(oe(t))}}),$e){var Bn=!Ht||d((function(){var t=qe();return "[null]"!=$e([t])||"{}"!=$e({a:t})||"{}"!=$e(Object(t))}));Wt({target:"JSON",stat:!0,forced:Bn},{stringify:function(t,e,n){for(var i,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=e,(F(e)||void 0!==t)&&!In(t))return re(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!In(e))return e}),r[1]=e,$e.apply(null,r)}});}qe.prototype[_e]||W(qe.prototype,_e,qe.prototype.valueOf),Ne(qe,"Symbol"),q[je]=!0,Ee("asyncIterator");var Cn=J.f,Fn=l.Symbol;if(g&&"function"==typeof Fn&&(!("description"in Fn.prototype)||void 0!==Fn().description)){var Un={},Sn=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof Sn?new Fn(t):void 0===t?Fn():Fn(t);return ""===t&&(Un[e]=!0),e};Vt(Sn,Fn);var Zn=Sn.prototype=Fn.prototype;Zn.constructor=Sn;var Vn=Zn.toString,Gn="Symbol(test)"==String(Fn("test")),Xn=/^Symbol\((.*)\)[^)]+$/;Cn(Zn,"description",{configurable:!0,get:function(){var t=F(this)?this.valueOf():this,e=Vn.call(t);if(Z(Un,t))return "";var n=Gn?e.slice(7,-1):e.replace(Xn,"$1");return ""===n?void 0:n}}),Wt({global:!0,forced:!0},{Symbol:Sn});}Ee("hasInstance"),Ee("isConcatSpreadable"),Ee("iterator"),Ee("match"),Ee("matchAll"),Ee("replace"),Ee("search"),Ee("species"),Ee("split"),Ee("toPrimitive"),Ee("toStringTag"),Ee("unscopables"),Ne(l.JSON,"JSON",!0),Ne(Math,"Math",!0),Wt({global:!0},{Reflect:{}}),Ne(l.Reflect,"Reflect",!0);at.Symbol;var wn,xn,An,Rn=function(t){return function(e,n){var i,r,o=String(B(e)),c=ft(n),s=o.length;return c<0||c>=s?t?"":void 0:(i=o.charCodeAt(c))<55296||i>56319||c+1===s||(r=o.charCodeAt(c+1))<56320||r>57343?t?o.charAt(c):i:t?o.slice(c,c+2):r-56320+(i-55296<<10)+65536}},Qn={codeAt:Rn(!1),charAt:Rn(!0)},Jn=!d((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Wn=M("IE_PROTO"),Hn=Object.prototype,kn=Jn?Object.getPrototypeOf:function(t){return t=oe(t),Z(t,Wn)?t[Wn]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Hn:null},Ln=Yt("iterator"),En=!1;[].keys&&("next"in(An=[].keys())?(xn=kn(kn(An)))!==Object.prototype&&(wn=xn):En=!0),null==wn&&(wn={}),Z(wn,Ln)||W(wn,Ln,(function(){return this}));var Tn={IteratorPrototype:wn,BUGGY_SAFARI_ITERATORS:En},Yn={},Nn=Tn.IteratorPrototype,Kn=function(){return this},On=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,i){return R(n),function(t){if(!F(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(i),e?t.call(n,i):n.__proto__=i,n}}():void 0),zn=Tn.IteratorPrototype,jn=Tn.BUGGY_SAFARI_ITERATORS,_n=Yt("iterator"),Dn=function(){return this},Pn=function(t,e,n,i,r,o,c){!function(t,e,n){var i=e+" Iterator";t.prototype=Re(Nn,{next:h(1,n)}),Ne(t,i,!1),Yn[i]=Kn;}(n,e,i);var s,a,u,l=function(t){if(t===r&&p)return p;if(!jn&&t in f)return f[t];switch(t){case"keys":case"values":case"entries":return function(){return new n(this,t)}}return function(){return new n(this)}},d=e+" Iterator",g=!1,f=t.prototype,I=f[_n]||f["@@iterator"]||r&&f[r],p=!jn&&I||l(r),y="Array"==e&&f.entries||I;if(y&&(s=kn(y.call(new t)),zn!==Object.prototype&&s.next&&(kn(s)!==zn&&(On?On(s,zn):"function"!=typeof s[_n]&&W(s,_n,Dn)),Ne(s,d,!0))),"values"==r&&I&&"values"!==I.name&&(g=!0,p=function(){return I.call(this)}),f[_n]!==p&&W(f,_n,p),Yn[e]=p,r)if(a={values:l("values"),keys:o?p:l("keys"),entries:l("entries")},c)for(u in a)(jn||g||!(u in f))&&st(f,u,a[u]);else Wt({target:e,proto:!0,forced:jn||g},a);return a},Mn=Qn.charAt,qn=ct.set,$n=ct.getterFor("String Iterator");Pn(String,"String",(function(t){qn(this,{type:"String Iterator",string:String(t),index:0});}),(function(){var t,e=$n(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=Mn(n,i),e.index+=t.length,{value:t,done:!1})}));var ti=function(t){var e=t.return;if(void 0!==e)return R(e.call(t)).value},ei=function(t,e,n,i){try{return i?e(R(n)[0],n[1]):e(n)}catch(e){throw ti(t),e}},ni=Yt("iterator"),ii=Array.prototype,ri=function(t){return void 0!==t&&(Yn.Array===t||ii[ni]===t)},oi=Yt("iterator"),ci=function(t){if(null!=t)return t[oi]||t["@@iterator"]||Yn[Fe(t)]},si=Yt("iterator"),ai=!1;try{var ui=0,li={next:function(){return {done:!!ui++}},return:function(){ai=!0;}};li[si]=function(){return this},Array.from(li,(function(){throw 2}));}catch(t){}var di=function(t,e){if(!e&&!ai)return !1;var n=!1;try{var i={};i[si]=function(){return {next:function(){return {done:n=!0}}}},t(i);}catch(t){}return n},gi=!di((function(t){Array.from(t);}));Wt({target:"Array",stat:!0,forced:gi},{from:function(t){var e,n,i,r,o,c,s=oe(t),a="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,d=void 0!==l,g=ci(s),f=0;if(d&&(l=ee(l,u>2?arguments[2]:void 0,2)),null==g||a==Array&&ri(g))for(n=new a(e=pt(s.length));e>f;f++)c=d?l(s[f],f):s[f],ce(n,f,c);else for(o=(r=g.call(s)).next,n=new a;!(i=o.call(r)).done;f++)c=d?ei(r,l,[i.value,f],!0):i.value,ce(n,f,c);return n.length=f,n}});at.Array.from;var fi,Ii="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,pi=J.f,hi=l.Int8Array,yi=hi&&hi.prototype,bi=l.Uint8ClampedArray,mi=bi&&bi.prototype,vi=hi&&kn(hi),Bi=yi&&kn(yi),Ci=Object.prototype,Fi=Ci.isPrototypeOf,Ui=Yt("toStringTag"),Si=D("TYPED_ARRAY_TAG"),Zi=Ii&&!!On&&"Opera"!==Fe(l.opera),Vi={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Gi=function(t){return F(t)&&Z(Vi,Fe(t))};for(fi in Vi)l[fi]||(Zi=!1);if((!Zi||"function"!=typeof vi||vi===Function.prototype)&&(vi=function(){throw TypeError("Incorrect invocation")},Zi))for(fi in Vi)l[fi]&&On(l[fi],vi);if((!Zi||!Bi||Bi===Ci)&&(Bi=vi.prototype,Zi))for(fi in Vi)l[fi]&&On(l[fi].prototype,Bi);if(Zi&&kn(mi)!==Bi&&On(mi,Bi),g&&!Z(Bi,Ui))for(fi in pi(Bi,Ui,{get:function(){return F(this)?this[Si]:void 0}}),Vi)l[fi]&&W(l[fi],Si,fi);var Xi=function(t){if(Gi(t))return t;throw TypeError("Target is not a typed array")},wi=function(t){if(On){if(Fi.call(vi,t))return t}else for(var e in Vi)if(Z(Vi,fi)){var n=l[e];if(n&&(t===n||Fi.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},xi=function(t,e,n){if(g){if(n)for(var i in Vi){var r=l[i];r&&Z(r.prototype,t)&&delete r.prototype[t];}Bi[t]&&!n||st(Bi,t,n?e:Zi&&yi[t]||e);}},Ai=Yt("species"),Ri=Xi,Qi=wi,Ji=[].slice;xi("slice",(function(t,e){for(var n=Ji.call(Ri(this),t,e),i=function(t,e){var n,i=R(t).constructor;return void 0===i||null==(n=R(i)[Ai])?e:te(n)}(this,this.constructor),r=0,o=n.length,c=new(Qi(i))(o);o>r;)c[r]=n[r++];return c}),d((function(){new Int8Array(1).slice();})));var Wi=Yt("unscopables"),Hi=Array.prototype;null==Hi[Wi]&&J.f(Hi,Wi,{configurable:!0,value:Re(null)});var ki=function(t){Hi[Wi][t]=!0;},Li=Object.defineProperty,Ei={},Ti=function(t){throw t},Yi=mt.includes,Ni=function(t,e){if(Z(Ei,t))return Ei[t];e||(e={});var n=[][t],i=!!Z(e,"ACCESSORS")&&e.ACCESSORS,r=Z(e,0)?e[0]:Ti,o=Z(e,1)?e[1]:void 0;return Ei[t]=!!n&&!d((function(){if(i&&!g)return !0;var t={length:-1};i?Li(t,1,{enumerable:!0,get:Ti}):t[1]=1,n.call(t,r,o);}))}("indexOf",{ACCESSORS:!0,1:0});Wt({target:"Array",proto:!0,forced:!Ni},{includes:function(t){return Yi(this,t,arguments.length>1?arguments[1]:void 0)}}),ki("includes");ie("Array","includes");Wt({target:"String",proto:!0,forced:!zt("includes")},{includes:function(t){return !!~String(B(this)).indexOf(Kt(t),arguments.length>1?arguments[1]:void 0)}});ie("String","includes");var Ki=!d((function(){return Object.isExtensible(Object.preventExtensions({}))})),Oi=a((function(t){var e=J.f,n=D("meta"),i=0,r=Object.isExtensible||function(){return !0},o=function(t){e(t,n,{value:{objectID:"O"+ ++i,weakData:{}}});},c=t.exports={REQUIRED:!1,fastKey:function(t,e){if(!F(t))return "symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Z(t,n)){if(!r(t))return "F";if(!e)return "E";o(t);}return t[n].objectID},getWeakData:function(t,e){if(!Z(t,n)){if(!r(t))return !0;if(!e)return !1;o(t);}return t[n].weakData},onFreeze:function(t){return Ki&&c.REQUIRED&&r(t)&&!Z(t,n)&&o(t),t}};q[n]=!0;})),zi=(Oi.REQUIRED,Oi.fastKey,Oi.getWeakData,Oi.onFreeze,function(t,e){this.stopped=t,this.result=e;}),ji=function(t,e,n){var i,r,o,c,s,a,u,l=n&&n.that,d=!(!n||!n.AS_ENTRIES),g=!(!n||!n.IS_ITERATOR),f=!(!n||!n.INTERRUPTED),I=ee(e,l,1+d+f),p=function(t){return i&&ti(i),new zi(!0,t)},h=function(t){return d?(R(t),f?I(t[0],t[1],p):I(t[0],t[1])):f?I(t,p):I(t)};if(g)i=t;else {if("function"!=typeof(r=ci(t)))throw TypeError("Target is not iterable");if(ri(r)){for(o=0,c=pt(t.length);c>o;o++)if((s=h(t[o]))&&s instanceof zi)return s;return new zi(!1)}i=r.call(t);}for(a=i.next;!(u=a.call(i)).done;){try{s=h(u.value);}catch(t){throw ti(i),t}if("object"==typeof s&&s&&s instanceof zi)return s}return new zi(!1)},_i=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},Di=function(t,e,n){for(var i in e)st(t,i,e[i],n);return t},Pi=Yt("species"),Mi=J.f,qi=Oi.fastKey,$i=ct.set,tr=ct.getterFor,er=(function(t,e,n){var i=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),o=i?"set":"add",c=l[t],s=c&&c.prototype,a=c,u={},g=function(t){var e=s[t];st(s,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return !(r&&!F(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return r&&!F(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return !(r&&!F(t))&&e.call(this,0===t?0:t)}:function(t,n){return e.call(this,0===t?0:t,n),this});};if(Qt(t,"function"!=typeof c||!(r||s.forEach&&!d((function(){(new c).entries().next();})))))a=n.getConstructor(e,t,i,o),Oi.REQUIRED=!0;else if(Qt(t,!0)){var f=new a,I=f[o](r?{}:-0,1)!=f,p=d((function(){f.has(1);})),h=di((function(t){new c(t);})),y=!r&&d((function(){for(var t=new c,e=5;e--;)t[o](e,e);return !t.has(-0)}));h||((a=e((function(e,n){_i(e,a,t);var r=function(t,e,n){var i,r;return On&&"function"==typeof(i=e.constructor)&&i!==n&&F(r=i.prototype)&&r!==n.prototype&&On(t,r),t}(new c,e,a);return null!=n&&ji(n,r[o],{that:r,AS_ENTRIES:i}),r}))).prototype=s,s.constructor=a),(p||y)&&(g("delete"),g("has"),i&&g("get")),(y||I)&&g(o),r&&s.clear&&delete s.clear;}u[t]=a,Wt({global:!0,forced:a!=c},u),Ne(a,t),r||n.setStrong(a,t,i);}("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,e,n,i){var r=t((function(t,o){_i(t,r,e),$i(t,{type:e,index:Re(null),first:void 0,last:void 0,size:0}),g||(t.size=0),null!=o&&ji(o,t[i],{that:t,AS_ENTRIES:n});})),o=tr(e),c=function(t,e,n){var i,r,c=o(t),a=s(t,e);return a?a.value=n:(c.last=a={index:r=qi(e,!0),key:e,value:n,previous:i=c.last,next:void 0,removed:!1},c.first||(c.first=a),i&&(i.next=a),g?c.size++:t.size++,"F"!==r&&(c.index[r]=a)),t},s=function(t,e){var n,i=o(t),r=qi(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return Di(r.prototype,{clear:function(){for(var t=o(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,g?t.size=0:this.size=0;},delete:function(t){var e=this,n=o(e),i=s(e,t);if(i){var r=i.next,c=i.previous;delete n.index[i.index],i.removed=!0,c&&(c.next=r),r&&(r.previous=c),n.first==i&&(n.first=r),n.last==i&&(n.last=c),g?n.size--:e.size--;}return !!i},forEach:function(t){for(var e,n=o(this),i=ee(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:n.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous;},has:function(t){return !!s(this,t)}}),Di(r.prototype,n?{get:function(t){var e=s(this,t);return e&&e.value},set:function(t,e){return c(this,0===t?0:t,e)}}:{add:function(t){return c(this,t=0===t?0:t,t)}}),g&&Mi(r.prototype,"size",{get:function(){return o(this).size}}),r},setStrong:function(t,e,n){var i=e+" Iterator",r=tr(e),o=tr(i);Pn(t,e,(function(t,e){$i(this,{type:i,target:t,state:r(t),kind:e,last:void 0});}),(function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),function(t){var e=lt(t),n=J.f;g&&e&&!e[Pi]&&n(e,Pi,{configurable:!0,get:function(){return this}});}(e);}}),{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),nr=ct.set,ir=ct.getterFor("Array Iterator"),rr=Pn(Array,"Array",(function(t,e){nr(this,{type:"Array Iterator",target:C(t),index:0,kind:e});}),(function(){var t=ir(this),e=t.target,n=t.kind,i=t.index++;return !e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");Yn.Arguments=Yn.Array,ki("keys"),ki("values"),ki("entries");var or=Yt("iterator"),cr=Yt("toStringTag"),sr=rr.values;for(var ar in er){var ur=l[ar],lr=ur&&ur.prototype;if(lr){if(lr[or]!==sr)try{W(lr,or,sr);}catch(t){lr[or]=sr;}if(lr[cr]||W(lr,cr,ar),er[ar])for(var dr in rr)if(lr[dr]!==rr[dr])try{W(lr,dr,rr[dr]);}catch(t){lr[dr]=rr[dr];}}}at.Set;function gr(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)}))}))}function fr(t){return new this((function(e,n){if(!t||void 0===t.length)return n(new TypeError(typeof t+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var r=i.length;function o(t,n){if(n&&("object"==typeof n||"function"==typeof n)){var c=n.then;if("function"==typeof c)return void c.call(n,(function(e){o(t,e);}),(function(n){i[t]={status:"rejected",reason:n},0==--r&&e(i);}))}i[t]={status:"fulfilled",value:n},0==--r&&e(i);}for(var c=0;c<i.length;c++)o(c,i[c]);}))}var Ir=setTimeout;function pr(t){return Boolean(t&&void 0!==t.length)}function hr(){}function yr(t){if(!(this instanceof yr))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=[],Fr(t,this);}function br(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,yr._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var i;try{i=n(t._value);}catch(t){return void vr(e.promise,t)}mr(e.promise,i);}else (1===t._state?mr:vr)(e.promise,t._value);}))):t._deferreds.push(e);}function mr(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 yr)return t._state=3,t._value=e,void Br(t);if("function"==typeof n)return void Fr((i=n,r=e,function(){i.apply(r,arguments);}),t)}t._state=1,t._value=e,Br(t);}catch(e){vr(t,e);}var i,r;}function vr(t,e){t._state=2,t._value=e,Br(t);}function Br(t){2===t._state&&0===t._deferreds.length&&yr._immediateFn((function(){t._handled||yr._unhandledRejectionFn(t._value);}));for(var e=0,n=t._deferreds.length;e<n;e++)br(t,t._deferreds[e]);t._deferreds=null;}function Cr(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n;}function Fr(t,e){var n=!1;try{t((function(t){n||(n=!0,mr(e,t));}),(function(t){n||(n=!0,vr(e,t));}));}catch(t){if(n)return;n=!0,vr(e,t);}}yr.prototype.catch=function(t){return this.then(null,t)},yr.prototype.then=function(t,e){var n=new this.constructor(hr);return br(this,new Cr(t,e,n)),n},yr.prototype.finally=gr,yr.all=function(t){return new yr((function(e,n){if(!pr(t))return n(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var r=i.length;function o(t,c){try{if(c&&("object"==typeof c||"function"==typeof c)){var s=c.then;if("function"==typeof s)return void s.call(c,(function(e){o(t,e);}),n)}i[t]=c,0==--r&&e(i);}catch(t){n(t);}}for(var c=0;c<i.length;c++)o(c,i[c]);}))},yr.allSettled=fr,yr.resolve=function(t){return t&&"object"==typeof t&&t.constructor===yr?t:new yr((function(e){e(t);}))},yr.reject=function(t){return new yr((function(e,n){n(t);}))},yr.race=function(t){return new yr((function(e,n){if(!pr(t))return n(new TypeError("Promise.race accepts an array"));for(var i=0,r=t.length;i<r;i++)yr.resolve(t[i]).then(e,n);}))},yr._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t);}||function(t){Ir(t,0);},yr._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t);};var Ur=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"!=typeof Ur.Promise?Ur.Promise=yr:Ur.Promise.prototype.finally?Ur.Promise.allSettled||(Ur.Promise.allSettled=fr):Ur.Promise.prototype.finally=gr,function(t){function e(){}function n(t,e){if(t=void 0===t?"utf-8":t,e=void 0===e?{fatal:!1}:e,-1===r.indexOf(t.toLowerCase()))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.")}function i(t){for(var e=0,n=Math.min(65536,t.length+1),i=new Uint16Array(n),r=[],o=0;;){var c=e<t.length;if(!c||o>=n-1){if(r.push(String.fromCharCode.apply(null,i.subarray(0,o))),!c)return r.join("");t=t.subarray(e),o=e=0;}if(0==(128&(c=t[e++])))i[o++]=c;else if(192==(224&c)){var s=63&t[e++];i[o++]=(31&c)<<6|s;}else if(224==(240&c)){s=63&t[e++];var a=63&t[e++];i[o++]=(31&c)<<12|s<<6|a;}else if(240==(248&c)){65535<(c=(7&c)<<18|(s=63&t[e++])<<12|(a=63&t[e++])<<6|63&t[e++])&&(c-=65536,i[o++]=c>>>10&1023|55296,c=56320|1023&c),i[o++]=c;}}}if(t.TextEncoder&&t.TextDecoder)return !1;var r=["utf-8","utf8","unicode-1-1-utf-8"];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,i=0,r=Math.max(32,n+(n>>>1)+7),o=new Uint8Array(r>>>3<<3);e<n;){var c=t.charCodeAt(e++);if(55296<=c&&56319>=c){if(e<n){var s=t.charCodeAt(e);56320==(64512&s)&&(++e,c=((1023&c)<<10)+(1023&s)+65536);}if(55296<=c&&56319>=c)continue}if(i+4>o.length&&(r+=8,r=(r*=1+e/t.length*2)>>>3<<3,(s=new Uint8Array(r)).set(o),o=s),0==(4294967168&c))o[i++]=c;else {if(0==(4294965248&c))o[i++]=c>>>6&31|192;else if(0==(4294901760&c))o[i++]=c>>>12&15|224,o[i++]=c>>>6&63|128;else {if(0!=(4292870144&c))continue;o[i++]=c>>>18&7|240,o[i++]=c>>>12&63|128,o[i++]=c>>>6&63|128;}o[i++]=63&c|128;}}return o.slice?o.slice(0,i):o.subarray(0,i)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1});var o=i;"function"==typeof Buffer&&Buffer.from?o=function(t){return Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(o=function(t){var e=URL.createObjectURL(new Blob([t],{type:"text/plain;charset=UTF-8"}));try{var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(),n.responseText}catch(e){return i(t)}finally{URL.revokeObjectURL(e);}}),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.");return t=t instanceof Uint8Array?t:t.buffer instanceof ArrayBuffer?new Uint8Array(t.buffer):new Uint8Array(t),o(t)},t.TextEncoder=e,t.TextDecoder=n;}("undefined"!=typeof window?window:c),function(){function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i);}}function n(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e);}function r(t){return (r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function o(t,e){return (o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return !1}}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return !e||"object"!=typeof e&&"function"!=typeof e?a(t):e}function l(t){var e=s();return function(){var n,i=r(t);if(e){var o=r(this).constructor;n=Reflect.construct(i,arguments,o);}else n=i.apply(this,arguments);return u(this,n)}}function d(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}function g(t,e,n){return (g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=d(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}var f=function(){function e(){t(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0});}return n(e,[{key:"addEventListener",value:function(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e);}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var n=this.listeners[t],i=0,r=n.length;i<r;i++)if(n[i]===e)return void n.splice(i,1)}},{key:"dispatchEvent",value:function(t){var e=this;if(t.type in this.listeners){for(var n=function(n){setTimeout((function(){return n.call(e,t)}));},i=this.listeners[t.type],r=0,o=i.length;r<o;r++)n(i[r]);return !t.defaultPrevented}}}]),e}(),I=function(e){i(c,e);var o=l(c);function c(){var e;return t(this,c),(e=o.call(this)).listeners||f.call(a(e)),Object.defineProperty(a(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return n(c,[{key:"toString",value:function(){return "[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),g(r(c.prototype),"dispatchEvent",this).call(this,t);}}]),c}(f),p=function(){function e(){t(this,e),Object.defineProperty(this,"signal",{value:new I,writable:!0,configurable:!0});}return n(e,[{key:"abort",value:function(){var t;try{t=new Event("abort");}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1};}this.signal.dispatchEvent(t);}},{key:"toString",value:function(){return "[object AbortController]"}}]),e}();function h(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",I.prototype[Symbol.toStringTag]="AbortSignal"),function(t){h(t)&&(t.AbortController=p,t.AbortSignal=I);}("undefined"!=typeof self?self:c);}();var Sr=a((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){var t=this;this.locked=new Map,this.addToLocked=function(e,n){var i=t.locked.get(e);void 0===i?void 0===n?t.locked.set(e,[]):t.locked.set(e,[n]):void 0!==n&&(i.unshift(n),t.locked.set(e,i));},this.isLocked=function(e){return t.locked.has(e)},this.lock=function(e){return new Promise((function(n,i){t.isLocked(e)?t.addToLocked(e,n):(t.addToLocked(e),n());}))},this.unlock=function(e){var n=t.locked.get(e);if(void 0!==n&&0!==n.length){var i=n.pop();t.locked.set(e,n),void 0!==i&&setTimeout(i,0);}else t.locked.delete(e);};}return t.getInstance=function(){return void 0===t.instance&&(t.instance=new t),t.instance},t}();e.default=function(){return n.getInstance()};}));s(Sr);var Zr=s(a((function(t,e){var n=c&&c.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function c(t){try{a(i.next(t));}catch(t){o(t);}}function s(t){try{a(i.throw(t));}catch(t){o(t);}}function a(t){t.done?r(t.value):new n((function(e){e(t.value);})).then(c,s);}a((i=i.apply(t,e||[])).next());}))},i=c&&c.__generator||function(t,e){var n,i,r,o,c={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return c.label++,{value:o[1],done:!1};case 5:c.label++,i=o[1],o=[0];continue;case 7:o=c.ops.pop(),c.trys.pop();continue;default:if(!(r=c.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){c=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){c.label=o[1];break}if(6===o[0]&&c.label<r[1]){c.label=r[1],r=o;break}if(r&&c.label<r[2]){c.label=r[2],c.ops.push(o);break}r[2]&&c.ops.pop(),c.trys.pop();continue}o=e.call(t,c);}catch(t){o=[6,t],i=0;}finally{n=r=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};Object.defineProperty(e,"__esModule",{value:!0});var r="browser-tabs-lock-key";function o(t){return new Promise((function(e){return setTimeout(e,t)}))}function s(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",i=0;i<t;i++){n+=e[Math.floor(Math.random()*e.length)];}return n}var a=function(){function t(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+s(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),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===t.waiters&&(t.waiters=[]);}return t.prototype.acquireLock=function(e,c){return void 0===c&&(c=5e3),n(this,void 0,void 0,(function(){var n,a,u,l,d,g;return i(this,(function(i){switch(i.label){case 0:n=Date.now()+s(4),a=Date.now()+c,u=r+"-"+e,l=window.localStorage,i.label=1;case 1:return Date.now()<a?[4,o(30)]:[3,8];case 2:return i.sent(),null!==l.getItem(u)?[3,5]:(d=this.id+"-"+e+"-"+n,[4,o(Math.floor(25*Math.random()))]);case 3:return i.sent(),l.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:d,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,o(30)];case 4:return i.sent(),null!==(g=l.getItem(u))&&(g=JSON.parse(g)).id===this.id&&g.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return t.lockCorrector(),[4,this.waitForSomethingToChange(a)];case 6:i.sent(),i.label=7;case 7:return n=Date.now()+s(4),[3,1];case 8:return [2,!1]}}))}))},t.prototype.refreshLockWhileAcquired=function(t,e){return n(this,void 0,void 0,(function(){var r=this;return i(this,(function(o){return setTimeout((function(){return n(r,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return [4,Sr.default().lock(e)];case 1:return i.sent(),this.acquiredIatSet.has(e)?(n=window.localStorage,null===(r=n.getItem(t))?(Sr.default().unlock(e),[2]):((r=JSON.parse(r)).timeRefreshed=Date.now(),n.setItem(t,JSON.stringify(r)),Sr.default().unlock(e),this.refreshLockWhileAcquired(t,e),[2])):(Sr.default().unlock(e),[2])}}))}))}),1e3),[2]}))}))},t.prototype.waitForSomethingToChange=function(e){return n(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return [4,new Promise((function(n){var i=!1,r=Date.now(),o=!1;function c(){if(o||(window.removeEventListener("storage",c),t.removeFromWaiting(c),clearTimeout(s),o=!0),!i){i=!0;var e=50-(Date.now()-r);e>0?setTimeout(n,e):n();}}window.addEventListener("storage",c),t.addToWaiting(c);var s=setTimeout(c,Math.max(0,e-Date.now()));}))];case 1:return n.sent(),[2]}}))}))},t.addToWaiting=function(e){this.removeFromWaiting(e),void 0!==t.waiters&&t.waiters.push(e);},t.removeFromWaiting=function(e){void 0!==t.waiters&&(t.waiters=t.waiters.filter((function(t){return t!==e})));},t.notifyWaiters=function(){void 0!==t.waiters&&t.waiters.slice().forEach((function(t){return t()}));},t.prototype.releaseLock=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this.releaseLock__private__(t)];case 1:return [2,e.sent()]}}))}))},t.prototype.releaseLock__private__=function(e){return n(this,void 0,void 0,(function(){var n,o,c;return i(this,(function(i){switch(i.label){case 0:return n=window.localStorage,o=r+"-"+e,null===(c=n.getItem(o))?[2]:(c=JSON.parse(c)).id!==this.id?[3,2]:[4,Sr.default().lock(c.iat)];case 1:i.sent(),this.acquiredIatSet.delete(c.iat),n.removeItem(o),Sr.default().unlock(c.iat),t.notifyWaiters(),i.label=2;case 2:return [2]}}))}))},t.lockCorrector=function(){for(var e=Date.now()-5e3,n=window.localStorage,i=Object.keys(n),o=!1,c=0;c<i.length;c++){var s=i[c];if(s.includes(r)){var a=n.getItem(s);null!==a&&(void 0===(a=JSON.parse(a)).timeRefreshed&&a.timeAcquired<e||void 0!==a.timeRefreshed&&a.timeRefreshed<e)&&(n.removeItem(s),o=!0);}}o&&t.notifyWaiters();},t.waiters=void 0,t}();e.default=a;}))),Vr={timeoutInSeconds:60},Gr=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],Xr={name:"auth0-spa-js",version:"1.14.0"},wr=function(t){function n(e,i){var r=t.call(this,i)||this;return r.error=e,r.error_description=i,Object.setPrototypeOf(r,n.prototype),r}return e(n,t),n.fromPayload=function(t){return new n(t.error,t.error_description)},n}(Error),xr=function(t){function n(e,i,r,o){void 0===o&&(o=null);var c=t.call(this,e,i)||this;return c.state=r,c.appState=o,Object.setPrototypeOf(c,n.prototype),c}return e(n,t),n}(wr),Ar=function(t){function n(){var e=t.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(e,n.prototype),e}return e(n,t),n}(wr),Rr=function(t){function n(e){var i=t.call(this)||this;return i.popup=e,Object.setPrototypeOf(i,n.prototype),i}return e(n,t),n}(Ar),Qr=function(t,e,n){return void 0===n&&(n=60),new Promise((function(i,r){var o=window.document.createElement("iframe");o.setAttribute("width","0"),o.setAttribute("height","0"),o.style.display="none";var c,s=function(){window.document.body.contains(o)&&(window.document.body.removeChild(o),window.removeEventListener("message",c,!1));},a=setTimeout((function(){r(new Ar),s();}),1e3*n);c=function(t){if(t.origin==e&&t.data&&"authorization_response"===t.data.type){var n=t.source;n&&n.close(),t.data.response.error?r(wr.fromPayload(t.data.response)):i(t.data.response),clearTimeout(a),window.removeEventListener("message",c,!1),setTimeout(s,2e3);}},window.addEventListener("message",c,!1),window.document.body.appendChild(o),o.setAttribute("src",t);}))},Jr=function(t,e){var n,i,r,o=e.popup;if(o?o.location.href=t:(n=t,i=window.screenX+(window.innerWidth-400)/2,r=window.screenY+(window.innerHeight-600)/2,o=window.open(n,"auth0:authorize:popup","left="+i+",top="+r+",width=400,height=600,resizable,scrollbars=yes,status=1")),!o)throw new Error("Could not open popup");return new Promise((function(t,n){var i,r=setTimeout((function(){n(new Rr(o)),window.removeEventListener("message",i,!1);}),1e3*(e.timeoutInSeconds||60));i=function(e){if(e.data&&"authorization_response"===e.data.type){if(clearTimeout(r),window.removeEventListener("message",i,!1),o.close(),e.data.response.error)return n(wr.fromPayload(e.data.response));t(e.data.response);}},window.addEventListener("message",i);}))},Wr=function(){return window.crypto||window.msCrypto},Hr=function(){var t=Wr();return t.subtle||t.webkitSubtle},kr=function(){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",e="";return Array.from(Wr().getRandomValues(new Uint8Array(43))).forEach((function(n){return e+=t[n%t.length]})),e},Lr=function(t){return btoa(t)},Er=function(t){return Object.keys(t).filter((function(e){return void 0!==t[e]})).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},Tr=function(t){return r(void 0,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return e=Hr().digest({name:"SHA-256"},(new TextEncoder).encode(t)),window.msCrypto?[2,new Promise((function(t,n){e.oncomplete=function(e){t(e.target.result);},e.onerror=function(t){n(t.error);},e.onabort=function(){n("The digest operation was aborted");};}))]:[4,e];case 1:return [2,n.sent()]}}))}))},Yr=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,"+"))},Nr=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))))};var Kr=function(t,e){return r(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(r){switch(r.label){case 0:return [4,(o=t,c=e,c=c||{},new Promise((function(t,e){var n=new XMLHttpRequest,i=[],r=[],s={},a=function(){return {ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:a,headers:{keys:function(){return i},entries:function(){return r},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var u in n.open(c.method||"get",o,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){i.push(e=e.toLowerCase()),r.push([e,n]),s[e]=s[e]?s[e]+","+n:n;})),t(a());},n.onerror=e,n.withCredentials="include"==c.credentials,c.headers)n.setRequestHeader(u,c.headers[u]);n.send(c.body||null);})))];case 1:return n=r.sent(),i={ok:n.ok},[4,n.json()];case 2:return [2,(i.json=r.sent(),i)]}var o,c;}))}))},Or=function(t,e,n){return r(void 0,void 0,void 0,(function(){var i,r;return o(this,(function(o){return i=new AbortController,e.signal=i.signal,[2,Promise.race([Kr(t,e),new Promise((function(t,e){r=setTimeout((function(){i.abort(),e(new Error("Timeout when executing 'fetch'"));}),n);}))]).finally((function(){clearTimeout(r);}))]}))}))},zr=function(t,e,n,i,c,s){return r(void 0,void 0,void 0,(function(){return o(this,(function(r){return [2,(o={auth:{audience:e,scope:n},timeout:c,fetchUrl:t,fetchOptions:i},a=s,new Promise((function(t,e){var n=new MessageChannel;n.port1.onmessage=function(n){n.data.error?e(new Error(n.data.error)):t(n.data);},a.postMessage(o,[n.port2]);})))];var o,a;}))}))},jr=function(t,e,n,i,c,s){return void 0===s&&(s=1e4),r(void 0,void 0,void 0,(function(){return o(this,(function(r){return c?[2,zr(t,e,n,i,s,c)]:[2,Or(t,i,s)]}))}))};function _r(t,e,n,c,s,a){return r(this,void 0,void 0,(function(){var r,u,l,d,g,f,I,p;return o(this,(function(o){switch(o.label){case 0:r=null,l=0,o.label=1;case 1:if(!(l<3))return [3,6];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,jr(t,n,c,s,a,e)];case 3:return u=o.sent(),r=null,[3,6];case 4:return d=o.sent(),r=d,[3,5];case 5:return l++,[3,1];case 6:if(r)throw r.message=r.message||"Failed to fetch",r;if(g=u.json,f=g.error,I=g.error_description,p=i(g,["error","error_description"]),!u.ok)throw new wr(f||"request_error",I||"HTTP error. Unable to fetch "+t);return [2,p]}}))}))}function Dr(t,e){var n=t.baseUrl,c=t.timeout,s=t.audience,a=t.scope,u=t.auth0Client,l=i(t,["baseUrl","timeout","audience","scope","auth0Client"]);return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return [4,_r(n+"/oauth/token",c,s||"default",a,{method:"POST",body:JSON.stringify(l),headers:{"Content-type":"application/json","Auth0-Client":btoa(JSON.stringify(u||Xr))}},e)];case 1:return [2,t.sent()]}}))}))}var Pr=function(t){return Array.from(new Set(t))},Mr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Pr(t.join(" ").trim().split(/\s+/)).join(" ")},qr=function(){function t(t,e){void 0===e&&(e=$r),this.prefix=e,this.client_id=t.client_id,this.scope=t.scope,this.audience=t.audience;}return t.prototype.toKey=function(){return this.prefix+"::"+this.client_id+"::"+this.audience+"::"+this.scope},t.fromKey=function(e){var n=e.split("::"),i=n[0],r=n[1],o=n[2];return new t({client_id:r,scope:n[3],audience:o},i)},t}(),$r="@@auth0spajs@@",to=function(t){var e=Math.floor(Date.now()/1e3)+t.expires_in;return {body:t,expiresAt:Math.min(e,t.decodedToken.claims.exp)}},eo=function(t,e){var n=t.client_id,i=t.audience,r=t.scope;return e.filter((function(t){var e=qr.fromKey(t),o=e.prefix,c=e.client_id,s=e.audience,a=e.scope,u=a&&a.split(" "),l=a&&r.split(" ").reduce((function(t,e){return t&&u.includes(e)}),!0);return o===$r&&c===n&&s===i&&l}))[0]},no=function(){function t(){}return t.prototype.save=function(t){var e=new qr({client_id:t.client_id,scope:t.scope,audience:t.audience}),n=to(t);window.localStorage.setItem(e.toKey(),JSON.stringify(n));},t.prototype.get=function(t,e){void 0===e&&(e=0);var n=this.readJson(t),i=Math.floor(Date.now()/1e3);if(n){if(!(n.expiresAt-e<i))return n.body;if(n.body.refresh_token){var r=this.stripData(n);return this.writeJson(t.toKey(),r),r.body}localStorage.removeItem(t.toKey());}},t.prototype.clear=function(){for(var t=localStorage.length-1;t>=0;t--)localStorage.key(t).startsWith($r)&&localStorage.removeItem(localStorage.key(t));},t.prototype.readJson=function(t){var e,n=eo(t,Object.keys(window.localStorage)),i=n&&window.localStorage.getItem(n);if(i&&(e=JSON.parse(i)))return e},t.prototype.writeJson=function(t,e){localStorage.setItem(t,JSON.stringify(e));},t.prototype.stripData=function(t){return {body:{refresh_token:t.body.refresh_token},expiresAt:t.expiresAt}},t}(),io=function(){this.enclosedCache=function(){var t={};return {save:function(e){var n=new qr({client_id:e.client_id,scope:e.scope,audience:e.audience}),i=to(e);t[n.toKey()]=i;},get:function(e,n){void 0===n&&(n=0);var i=eo(e,Object.keys(t)),r=t[i],o=Math.floor(Date.now()/1e3);if(r)return r.expiresAt-n<o?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},r.body):void delete t[e.toKey()]:r.body},clear:function(){t={};}}}();},ro=function(){function t(t){this.storage=t,this.transaction=this.storage.get("a0.spajs.txs");}return t.prototype.create=function(t){this.transaction=t,this.storage.save("a0.spajs.txs",t,{daysUntilExpire:1});},t.prototype.get=function(){return this.transaction},t.prototype.remove=function(){delete this.transaction,this.storage.remove("a0.spajs.txs");},t}(),oo=function(t){return "number"==typeof t},co=["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"],so=function(t){if(!t.id_token)throw new Error("ID token is required but missing");var e=function(t){var e=t.split("."),n=e[0],i=e[1],r=e[2];if(3!==e.length||!n||!i||!r)throw new Error("ID token could not be decoded");var o=JSON.parse(Yr(i)),c={__raw:t},s={};return Object.keys(o).forEach((function(t){c[t]=o[t],co.includes(t)||(s[t]=o[t]);})),{encoded:{header:n,payload:i,signature:r},header:JSON.parse(Yr(n)),claims:c,user:s}}(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'+t.iss+'", found "'+e.claims.iss+'"');if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if("RS256"!==e.header.alg)throw new Error('Signature algorithm of "'+e.header.alg+'" is not supported. Expected the ID token to be signed with "RS256".');if(!e.claims.aud||"string"!=typeof e.claims.aud&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+t.aud+'" but was not one of "'+e.claims.aud.join(", ")+'"');if(e.claims.aud.length>1){if(!e.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(e.claims.azp!==t.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'+t.aud+'", found "'+e.claims.azp+'"')}}else if(e.claims.aud!==t.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'+t.aud+'" but found "'+e.claims.aud+'"');if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'+t.nonce+'", found "'+e.claims.nonce+'"')}if(t.max_age&&!oo(e.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(!oo(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!oo(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");var n=t.leeway||60,i=new Date(Date.now()),r=new Date(0),o=new Date(0),c=new Date(0);if(c.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+n),r.setUTCSeconds(e.claims.exp+n),o.setUTCSeconds(e.claims.nbf-n),i>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time ("+i+") is after expiration time ("+r+")");if(oo(e.claims.nbf)&&i<o)throw new Error("Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Currrent time ("+i+") is before "+o);if(oo(e.claims.auth_time)&&i>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 ("+i+") is after last auth at "+c);if(t.organizationId){if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(t.organizationId!==e.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'+t.organizationId+'", found "'+e.claims.org_id+'"')}return e},ao=a((function(t,e){var n=c&&c.__assign||function(){return (n=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function i(t,e){if(!e)return "";var n="; "+t;return !0===e?n:n+"="+e}function r(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 i("Expires",t.expires?t.expires.toUTCString():"")+i("Domain",t.domain)+i("Path",t.path)+i("Secure",t.secure)+i("SameSite",t.sameSite)}(n)}function o(t){for(var e={},n=t?t.split("; "):[],i=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var o=n[r].split("="),c=o.slice(1).join("=");'"'===c.charAt(0)&&(c=c.slice(1,-1));try{e[o[0].replace(i,decodeURIComponent)]=c.replace(i,decodeURIComponent);}catch(t){}}return e}function s(){return o(document.cookie)}function a(t,e,i){document.cookie=r(t,e,n({path:"/"},i));}e.__esModule=!0,e.encode=r,e.parse=o,e.getAll=s,e.get=function(t){return s()[t]},e.set=a,e.remove=function(t,e){a(t,"",n(n({},e),{expires:-1}));};}));s(ao);ao.encode,ao.parse,ao.getAll;var uo=ao.get,lo=ao.set,go=ao.remove,fo={get:function(t){var e=uo(t);if(void 0!==e)return JSON.parse(e)},save:function(t,e,n){var i={};"https:"===window.location.protocol&&(i={secure:!0,sameSite:"none"}),i.expires=n.daysUntilExpire,lo(t,JSON.stringify(e),i);},remove:function(t){go(t);}},Io={get:function(t){var e=fo.get(t);return e||fo.get("_legacy_"+t)},save:function(t,e,n){var i={};"https:"===window.location.protocol&&(i={secure:!0}),i.expires=n.daysUntilExpire,lo("_legacy_"+t,JSON.stringify(e),i),fo.save(t,e,n);},remove:function(t){fo.remove(t),fo.remove("_legacy_"+t);}},po={get:function(t){if("undefined"!=typeof sessionStorage){var e=sessionStorage.getItem(t);if(void 0!==e)return JSON.parse(e)}},save:function(t,e){sessionStorage.setItem(t,JSON.stringify(e));},remove:function(t){sessionStorage.removeItem(t);}};function ho(t,e,n){var i=void 0===e?null:e,r=function(t,e){var n=atob(t);if(e){for(var i=new Uint8Array(n.length),r=0,o=n.length;r<o;++r)i[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return n}(t,void 0!==n&&n),o=r.indexOf("\n",10)+1,c=r.substring(o)+(i?"//# sourceMappingURL="+i:""),s=new Blob([c],{type:"application/javascript"});return URL.createObjectURL(s)}var yo,bo,mo,vo,Bo=(yo="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Ci8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgQ29weXJpZ2h0IChjKSBNaWNyb3NvZnQgQ29ycG9yYXRpb24uIEFsbCByaWdodHMgcmVzZXJ2ZWQuCiAgICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsgeW91IG1heSBub3QgdXNlCiAgICB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4gWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZQogICAgTGljZW5zZSBhdCBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKCiAgICBUSElTIENPREUgSVMgUFJPVklERUQgT04gQU4gKkFTIElTKiBCQVNJUywgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZCiAgICBLSU5ELCBFSVRIRVIgRVhQUkVTUyBPUiBJTVBMSUVELCBJTkNMVURJTkcgV0lUSE9VVCBMSU1JVEFUSU9OIEFOWSBJTVBMSUVECiAgICBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgVElUTEUsIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLAogICAgTUVSQ0hBTlRBQkxJVFkgT1IgTk9OLUlORlJJTkdFTUVOVC4KCiAgICBTZWUgdGhlIEFwYWNoZSBWZXJzaW9uIDIuMCBMaWNlbnNlIGZvciBzcGVjaWZ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F0gPSBzW3BdO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdDtcclxuICAgIH1cclxuICAgIHJldHVybiBfX2Fzc2lnbi5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19yZXN0KHMsIGUpIHtcclxuICAgIHZhciB0ID0ge307XHJcbiAgICBmb3IgKHZhciBwIGluIHMpIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocywgcCkgJiYgZS5pbmRleE9mKHApIDwgMClcclxuICAgICAgICB0W3BdID0gc1twXTtcclxuICAgIGlmIChzICE9IG51bGwgJiYgdHlwZW9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMgPT09IFwiZnVuY3Rpb25cIilcclxuICAgICAgICBmb3IgKHZhciBpID0gMCwgcCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMocyk7IGkgPCBwLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGlmIChlLmluZGV4T2YocFtpXSkgPCAwICYmIE9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChzLCBwW2ldKSlcclxuICAgICAgICAgICAgICAgIHRbcFtpXV0gPSBzW3BbaV1dO1xyXG4gICAgICAgIH1cclxuICAgIHJldHVybiB0O1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gX19kZWNvcmF0ZShkZWNvcmF0b3JzLCB0YXJnZXQsIGtleSwgZGVzYykge1xyXG4gICAgdmFyIGMgPSBhcmd1bWVudHMubGVuZ3RoLCByID0gYyA8IDMgPyB0YXJnZXQgOiBkZXNjID09PSBudWxsID8gZGVzYyA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGFyZ2V0LCBrZXkpIDogZGVzYywgZDtcclxuICAgIGlmICh0eXBlb2YgUmVmbGVjdCA9PT0gXCJvYmplY3Rc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B9KSwgZztcclxuICAgIGZ1bmN0aW9uIHZlcmIobikgeyByZXR1cm4gZnVuY3Rpb24gKHYpIHsgcmV0dXJuIHN0ZXAoW24sIHZdKTsgfTsgfVxyXG4gICAgZnVuY3Rpb24gc3RlcChvcCkge1xyXG4gICAgICAgIGlmIChmKSB0aHJvdyBuZXcgVHlwZUVycm9yKFwiR2VuZXJhdG9yIGlzIGFscmVhZHkgZXhlY3V0aW5nLlwiKTtcclxuICAgICAgICB3aGlsZSAoXykgdHJ5IHtcclxuICAgICAgICAgICAgaWYgKGYgPSAxLCB5ICYmICh0ID0gb3BbMF0gJiAyID8geVtcInJldHVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07XHJcbiAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gM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G8pIHtcclxuICAgIHZhciBtID0gdHlwZW9mIFN5bWJvbCA9PT0gXCJmdW5jdGlvblwiICYmIG9bU3ltYm9sLml0ZXJhdG9yXSwgaSA9IDA7XHJcbiAgICBpZiAobSkgcmV0dXJuIG0uY2FsbChvKTtcclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgbmV4dDogZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICBpZiAobyAmJiBpID49IG8ubGVuZ3RoKSBvID0gdm9pZCAwO1xyXG4gICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogbyAmJiBvW2krK10sIGRvbmU6ICFvIH07XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxufVxyXG5cclxuZXhwb3J0IGZ1bmN0aW9uIF9fcmVhZChvLCBuKSB7XHJcbiAgICB2YXIgbSA9IHR5cGVvZiBTeW1ib2wgPT09IFwiZnVuY3Rpb25cIiAmJiBvW1N5bWJvbC5pdGVyYXRvcl07XHJcbiAgICBpZiAoIW0pIHJldHVybiBvO1xyXG4gICAgdmFyIGkgPSBtLmNhbGwobyksIHIsIGFyID0gW10sIGU7XHJcbiAgICB0cnkge1xyXG4gICAgICAgIHdoaWxlICgobiA9PT0gdm9pZCAwIHx8IG4tLSA+IDApICYmICEociA9IGkubmV4dCgpKS5kb25lKSBhci5wdXNoKHIudmFsdWUpO1xyXG4gICAgfVxyXG4gICAgY2F0Y2ggKGVycm9yKSB7IGUgPSB7IGVycm9yOiBlcnJvciB9OyB9XHJcbiAgICBmaW5hbGx5IHtcclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICBpZiAociAmJiAhci5kb25lICYmIChtID0gaVtcInJldHVyblwiXSkpIG0uY2FsbChpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZmluYWxseSB7IGlmIChlKSB0aHJvdyBlLmVycm9yOyB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gYXI7XHJcbn1cclxuXHJcbmV4cG9ydCBmdW5jdGlvbiBfX3NwcmVhZ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}),Co={},Fo=new Zr,Uo={memory:function(){return (new io).enclosedCache},localstorage:function(){return new no}},So=function(t){return Uo[t]},Zo=function(){return !/Trident.*rv:11\.0/.test(navigator.userAgent)},Vo=function(){function t(t){var e,n;if(this.options=t,"undefined"!=typeof window&&function(){if(!Wr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Hr())throw new Error("\n auth0-spa-js must run on a secure origin. 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 for more information.\n ")}(),this.cacheLocation=t.cacheLocation||"memory",this.cookieStorage=!1===t.legacySameSiteCookie?fo:Io,this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1,!So(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');var r,o,c=t.useCookiesForTransactions?this.cookieStorage:po;this.cache=So(this.cacheLocation)(),this.scope=this.options.scope,this.transactionManager=new ro(c),this.domainUrl="https://"+this.options.domain,this.tokenIssuer=(r=this.options.issuer,o=this.domainUrl,r?r.startsWith("https://")?r:"https://"+r+"/":o+"/"),this.defaultScope=Mr("openid",void 0!==(null===(n=null===(e=this.options)||void 0===e?void 0:e.advancedOptions)||void 0===n?void 0:n.defaultScope)?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=Mr(this.scope,"offline_access")),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===this.cacheLocation&&Zo()&&(this.worker=new Bo),this.customOptions=function(t){return t.advancedOptions,t.audience,t.auth0Client,t.authorizeTimeoutInSeconds,t.cacheLocation,t.client_id,t.domain,t.issuer,t.leeway,t.max_age,t.redirect_uri,t.scope,t.useRefreshTokens,i(t,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","client_id","domain","issuer","leeway","max_age","redirect_uri","scope","useRefreshTokens"])}(t);}return t.prototype._url=function(t){var e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Xr)));return ""+this.domainUrl+t+"&auth0Client="+e},t.prototype._getParams=function(t,e,r,o,c){var s=this.options,a=(s.domain,s.leeway,s.useRefreshTokens,s.useCookiesForTransactions,s.auth0Client,s.cacheLocation,s.advancedOptions,i(s,["domain","leeway","useRefreshTokens","useCookiesForTransactions","auth0Client","cacheLocation","advancedOptions"]));return n(n(n({},a),t),{scope:Mr(this.defaultScope,this.scope,t.scope),response_type:"code",response_mode:"query",state:e,nonce:r,redirect_uri:c||this.options.redirect_uri,code_challenge:o,code_challenge_method:"S256"})},t.prototype._authorizeUrl=function(t){return this._url("/authorize?"+Er(t))},t.prototype._verifyIdToken=function(t,e,n){return so({iss:this.tokenIssuer,aud:this.options.client_id,id_token:t,nonce:e,organizationId:n,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},t.prototype._parseNumber=function(t){return "string"!=typeof t?t:parseInt(t,10)||void 0},t.prototype.buildAuthorizeUrl=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,r,c,s,a,u,l,d,g,f,I,p;return o(this,(function(o){switch(o.label){case 0:return e=t.redirect_uri,r=t.appState,c=i(t,["redirect_uri","appState"]),s=Lr(kr()),a=Lr(kr()),u=kr(),[4,Tr(u)];case 1:return l=o.sent(),d=Nr(l),g=t.fragment?"#"+t.fragment:"",f=this._getParams(c,s,a,d,e),I=this._authorizeUrl(f),p=t.organization||this.options.organization,this.transactionManager.create(n({nonce:a,code_verifier:u,appState:r,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri},p&&{organizationId:p})),[2,I+g]}}))}))},t.prototype.loginWithPopup=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),r(this,void 0,void 0,(function(){var r,c,s,a,u,l,d,g,f,I,p,h,y;return o(this,(function(o){switch(o.label){case 0:return r=i(t,[]),c=Lr(kr()),s=Lr(kr()),a=kr(),[4,Tr(a)];case 1:return u=o.sent(),l=Nr(u),d=this._getParams(r,c,s,l,this.options.redirect_uri||window.location.origin),g=this._authorizeUrl(n(n({},d),{response_mode:"web_message"})),[4,Jr(g,n(n({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(f=o.sent(),c!==f.state)throw new Error("Invalid state");return [4,Dr({audience:d.audience,scope:d.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:a,code:f.code,grant_type:"authorization_code",redirect_uri:d.redirect_uri,auth0Client:this.options.auth0Client},this.worker)];case 3:return I=o.sent(),p=t.organization||this.options.organization,h=this._verifyIdToken(I.id_token,s,p),y=n(n({},I),{decodedToken:h,scope:d.scope,audience:d.audience||"default",client_id:this.options.client_id}),this.cache.save(y),this.cookieStorage.save("auth0.is.authenticated",!0,{daysUntilExpire:this.sessionCheckExpiryDays}),[2]}}))}))},t.prototype.getUser=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){return e=t.audience||this.options.audience||"default",n=Mr(this.defaultScope,this.scope,t.scope),[2,(i=this.cache.get(new qr({client_id:this.options.client_id,audience:e,scope:n})))&&i.decodedToken&&i.decodedToken.user]}))}))},t.prototype.getIdTokenClaims=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,n,i;return o(this,(function(r){return e=t.audience||this.options.audience||"default",n=Mr(this.defaultScope,this.scope,t.scope),[2,(i=this.cache.get(new qr({client_id:this.options.client_id,audience:e,scope:n})))&&i.decodedToken&&i.decodedToken.claims]}))}))},t.prototype.loginWithRedirect=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,n,r;return o(this,(function(o){switch(o.label){case 0:return e=t.redirectMethod,n=i(t,["redirectMethod"]),[4,this.buildAuthorizeUrl(n)];case 1:return r=o.sent(),window.location[e||"assign"](r),[2]}}))}))},t.prototype.handleRedirectCallback=function(t){return void 0===t&&(t=window.location.href),r(this,void 0,void 0,(function(){var e,i,r,c,s,a,u,l,d,g,f;return o(this,(function(o){switch(o.label){case 0:if(0===(e=t.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(i=function(t){t.indexOf("#")>-1&&(t=t.substr(0,t.indexOf("#")));var e=t.split("&"),i={};return e.forEach((function(t){var e=t.split("="),n=e[0],r=e[1];i[n]=decodeURIComponent(r);})),n(n({},i),{expires_in:parseInt(i.expires_in)})}(e.join("")),r=i.state,c=i.code,s=i.error,a=i.error_description,!(u=this.transactionManager.get())||!u.code_verifier)throw new Error("Invalid state");if(this.transactionManager.remove(),s)throw new xr(s,a,r,u.appState);return l={audience:u.audience,scope:u.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:u.code_verifier,grant_type:"authorization_code",code:c,auth0Client:this.options.auth0Client},void 0!==u.redirect_uri&&(l.redirect_uri=u.redirect_uri),[4,Dr(l,this.worker)];case 1:return d=o.sent(),g=this._verifyIdToken(d.id_token,u.nonce,u.organizationId),f=n(n({},d),{decodedToken:g,audience:u.audience,scope:u.scope,client_id:this.options.client_id}),this.cache.save(f),this.cookieStorage.save("auth0.is.authenticated",!0,{daysUntilExpire:this.sessionCheckExpiryDays}),[2,{appState:u.appState}]}}))}))},t.prototype.checkSession=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:if(!this.cookieStorage.get("auth0.is.authenticated"))return [2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getTokenSilently(t)];case 2:return n.sent(),[3,4];case 3:if(e=n.sent(),!Gr.includes(e.error))throw e;return [3,4];case 4:return [2]}}))}))},t.prototype.getTokenSilently=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,r,c,s=this;return o(this,(function(o){return e=n(n({audience:this.options.audience,ignoreCache:!1},t),{scope:Mr(this.defaultScope,this.scope,t.scope)}),r=e.ignoreCache,c=i(e,["ignoreCache"]),[2,(a=function(){return s._getTokenSilently(n({ignoreCache:r},c))},u=this.options.client_id+"::"+c.audience+"::"+c.scope,l=Co[u],l||(l=a().finally((function(){delete Co[u],l=null;})),Co[u]=l),l)];var a,u,l;}))}))},t.prototype._getTokenSilently=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var e,c,s,a,u,l,d=this;return o(this,(function(g){switch(g.label){case 0:return e=t.ignoreCache,c=i(t,["ignoreCache"]),s=function(){var t=d.cache.get(new qr({scope:c.scope,audience:c.audience||"default",client_id:d.options.client_id}),60);return t&&t.access_token},!e&&(a=s())?[2,a]:[4,(f=function(){return Fo.acquireLock("auth0.lock.getTokenSilently",5e3)},I=10,void 0===I&&(I=3),r(void 0,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<I?[4,f()]:[3,4];case 2:if(e.sent())return [2,!0];e.label=3;case 3:return t++,[3,1];case 4:return [2,!1]}}))})))];case 1:if(!g.sent())return [3,10];g.label=2;case 2:return g.trys.push([2,,7,9]),!e&&(a=s())?[2,a]:this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(c)]:[3,4];case 3:return l=g.sent(),[3,6];case 4:return [4,this._getTokenFromIFrame(c)];case 5:l=g.sent(),g.label=6;case 6:return u=l,this.cache.save(n({client_id:this.options.client_id},u)),this.cookieStorage.save("auth0.is.authenticated",!0,{daysUntilExpire:this.sessionCheckExpiryDays}),[2,u.access_token];case 7:return [4,Fo.releaseLock("auth0.lock.getTokenSilently")];case 8:return g.sent(),[7];case 9:return [3,11];case 10:throw new Ar;case 11:return [2]}var f,I;}))}))},t.prototype.getTokenWithPopup=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),r(this,void 0,void 0,(function(){return o(this,(function(i){switch(i.label){case 0:return t.audience=t.audience||this.options.audience,t.scope=Mr(this.defaultScope,this.scope,t.scope),e=n(n({},Vr),e),[4,this.loginWithPopup(t,e)];case 1:return i.sent(),[2,this.cache.get(new qr({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id})).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.buildLogoutUrl=function(t){void 0===t&&(t={}),null!==t.client_id?t.client_id=t.client_id||this.options.client_id:delete t.client_id;var e=t.federated,n=i(t,["federated"]),r=e?"&federated":"";return this._url("/v2/logout?"+Er(n))+r},t.prototype.logout=function(t){void 0===t&&(t={});var e=t.localOnly,n=i(t,["localOnly"]);if(e&&n.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");if(this.cache.clear(),this.cookieStorage.remove("auth0.is.authenticated"),!e){var r=this.buildLogoutUrl(n);window.location.assign(r);}},t.prototype._getTokenFromIFrame=function(t){return r(this,void 0,void 0,(function(){var e,r,c,s,a,u,l,d,g,f,I,p,h,y,b;return o(this,(function(o){switch(o.label){case 0:return e=Lr(kr()),r=Lr(kr()),c=kr(),[4,Tr(c)];case 1:s=o.sent(),a=Nr(s),u=this._getParams(t,e,r,a,t.redirect_uri||this.options.redirect_uri||window.location.origin),l=this._authorizeUrl(n(n({},u),{prompt:"none",response_mode:"web_message"})),d=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,o.label=2;case 2:return o.trys.push([2,5,,6]),[4,Qr(l,this.domainUrl,d)];case 3:if(g=o.sent(),e!==g.state)throw new Error("Invalid state");return f=t.scope,I=t.audience,t.redirect_uri,t.ignoreCache,t.timeoutInSeconds,p=i(t,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds"]),[4,Dr(n(n(n({},this.customOptions),p),{scope:f,audience:I,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:c,code:g.code,grant_type:"authorization_code",redirect_uri:u.redirect_uri,auth0Client:this.options.auth0Client}),this.worker)];case 4:return h=o.sent(),y=this._verifyIdToken(h.id_token,r),[2,n(n({},h),{decodedToken:y,scope:u.scope,audience:u.audience||"default"})];case 5:throw "login_required"===(b=o.sent()).error&&this.logout({localOnly:!0}),b;case 6:return [2]}}))}))},t.prototype._getTokenUsingRefreshToken=function(t){return r(this,void 0,void 0,(function(){var e,r,c,s,a,u,l,d,g;return o(this,(function(o){switch(o.label){case 0:return t.scope=Mr(this.defaultScope,this.options.scope,t.scope),(e=this.cache.get(new qr({scope:t.scope,audience:t.audience||"default",client_id:this.options.client_id})))&&e.refresh_token||this.worker?[3,2]:[4,this._getTokenFromIFrame(t)];case 1:return [2,o.sent()];case 2:r=t.redirect_uri||this.options.redirect_uri||window.location.origin,s=t.scope,a=t.audience,t.ignoreCache,t.timeoutInSeconds,u=i(t,["scope","audience","ignoreCache","timeoutInSeconds"]),l="number"==typeof t.timeoutInSeconds?1e3*t.timeoutInSeconds:null,o.label=3;case 3:return o.trys.push([3,5,,8]),[4,Dr(n(n(n(n(n({},this.customOptions),u),{audience:a,scope:s,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:r}),l&&{timeout:l}),{auth0Client:this.options.auth0Client}),this.worker)];case 4:return c=o.sent(),[3,8];case 5:return "The web worker is missing the refresh token"===(d=o.sent()).message||d.message&&d.message.indexOf("invalid refresh token")>-1?[4,this._getTokenFromIFrame(t)]:[3,7];case 6:return [2,o.sent()];case 7:throw d;case 8:return g=this._verifyIdToken(c.id_token),[2,n(n({},c),{decodedToken:g,scope:t.scope,audience:t.audience||"default"})]}}))}))},t}();
113
+ 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)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);})(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t;}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}var n=function(){return (n=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 r(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 o(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e));}catch(e){i(e);}}function c(e){try{s(r.throw(e));}catch(e){i(e);}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t);}))).then(a,c);}s((r=r.apply(e,t||[])).next());}))}function i(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=a.trys,(o=o.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])}}}function a(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value);}catch(e){o={error:e};}finally{try{r&&!r.done&&(n=i.return)&&n.call(i);}finally{if(o)throw o.error}}return a}function c(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||t)}var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function l(e,t){return e(t={exports:{}},t.exports),t.exports}var f,d,h=function(e){return e&&e.Math==Math&&e},p=h("object"==typeof globalThis&&globalThis)||h("object"==typeof window&&window)||h("object"==typeof self&&self)||h("object"==typeof s&&s)||function(){return this}()||Function("return this")(),y=function(e){try{return !!e()}catch(e){return !0}},v=!y((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),m={}.propertyIsEnumerable,g=Object.getOwnPropertyDescriptor,b={f:g&&!m.call({1:2},1)?function(e){var t=g(this,e);return !!t&&t.enumerable}:m},w=function(e,t){return {enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},S={}.toString,_=function(e){return S.call(e).slice(8,-1)},k="".split,I=y((function(){return !Object("z").propertyIsEnumerable(0)}))?function(e){return "String"==_(e)?k.call(e,""):Object(e)}:Object,T=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},O=function(e){return I(T(e))},E=function(e){return "object"==typeof e?null!==e:"function"==typeof e},x=function(e){return "function"==typeof e?e:void 0},C=function(e,t){return arguments.length<2?x(p[e]):p[e]&&p[e][t]},R=C("navigator","userAgent")||"",j=p.process,A=p.Deno,F=j&&j.versions||A&&A.version,K=F&&F.v8;K?d=(f=K.split("."))[0]<4?1:f[0]+f[1]:R&&(!(f=R.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=R.match(/Chrome\/(\d+)/))&&(d=f[1]);var U=d&&+d,L=!!Object.getOwnPropertySymbols&&!y((function(){var e=Symbol();return !String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&U&&U<41})),P=L&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,W=P?function(e){return "symbol"==typeof e}:function(e){var t=C("Symbol");return "function"==typeof t&&Object(e)instanceof t},Z=function(e,t){try{Object.defineProperty(p,e,{value:t,configurable:!0,writable:!0});}catch(n){p[e]=t;}return t},V=p["__core-js_shared__"]||Z("__core-js_shared__",{}),N=l((function(e){(e.exports=function(e,t){return V[e]||(V[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.16.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});})),X=function(e){return Object(T(e))},Y={}.hasOwnProperty,z=Object.hasOwn||function(e,t){return Y.call(X(e),t)},D=0,J=Math.random(),B=function(e){return "Symbol("+String(void 0===e?"":e)+")_"+(++D+J).toString(36)},G=N("wks"),M=p.Symbol,H=P?M:M&&M.withoutSetter||B,q=function(e){return z(G,e)&&(L||"string"==typeof G[e])||(L&&z(M,e)?G[e]=M[e]:G[e]=H("Symbol."+e)),G[e]},Q=q("toPrimitive"),$=function(e,t){if(!E(e)||W(e))return e;var n,r=e[Q];if(void 0!==r){if(void 0===t&&(t="default"),n=r.call(e,t),!E(n)||W(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&"function"==typeof(n=e.toString)&&!E(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!E(r=n.call(e)))return r;if("string"!==t&&"function"==typeof(n=e.toString)&&!E(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}(e,t)},ee=function(e){var t=$(e,"string");return W(t)?t:String(t)},te=p.document,ne=E(te)&&E(te.createElement),re=function(e){return ne?te.createElement(e):{}},oe=!v&&!y((function(){return 7!=Object.defineProperty(re("div"),"a",{get:function(){return 7}}).a})),ie=Object.getOwnPropertyDescriptor,ae={f:v?ie:function(e,t){if(e=O(e),t=ee(t),oe)try{return ie(e,t)}catch(e){}if(z(e,t))return w(!b.f.call(e,t),e[t])}},ce=function(e){if(!E(e))throw TypeError(String(e)+" is not an object");return e},se=Object.defineProperty,ue={f:v?se:function(e,t,n){if(ce(e),t=ee(t),ce(n),oe)try{return se(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}},le=v?function(e,t,n){return ue.f(e,t,w(1,n))}:function(e,t,n){return e[t]=n,e},fe=Function.toString;"function"!=typeof V.inspectSource&&(V.inspectSource=function(e){return fe.call(e)});var de,he,pe,ye=V.inspectSource,ve=p.WeakMap,me="function"==typeof ve&&/native code/.test(ye(ve)),ge=N("keys"),be=function(e){return ge[e]||(ge[e]=B(e))},we={},Se=p.WeakMap;if(me||V.state){var _e=V.state||(V.state=new Se),ke=_e.get,Ie=_e.has,Te=_e.set;de=function(e,t){if(Ie.call(_e,e))throw new TypeError("Object already initialized");return t.facade=e,Te.call(_e,e,t),t},he=function(e){return ke.call(_e,e)||{}},pe=function(e){return Ie.call(_e,e)};}else {var Oe=be("state");we[Oe]=!0,de=function(e,t){if(z(e,Oe))throw new TypeError("Object already initialized");return t.facade=e,le(e,Oe,t),t},he=function(e){return z(e,Oe)?e[Oe]:{}},pe=function(e){return z(e,Oe)};}var Ee,xe={set:de,get:he,has:pe,enforce:function(e){return pe(e)?he(e):de(e,{})},getterFor:function(e){return function(t){var n;if(!E(t)||(n=he(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Ce=l((function(e){var t=xe.get,n=xe.enforce,r=String(String).split("String");(e.exports=function(e,t,o,i){var a,c=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||z(o,"name")||le(o,"name",t),(a=n(o)).source||(a.source=r.join("string"==typeof t?t:""))),e!==p?(c?!u&&e[t]&&(s=!0):delete e[t],s?e[t]=o:le(e,t,o)):s?e[t]=o:Z(t,o);})(Function.prototype,"toString",(function(){return "function"==typeof this&&t(this).source||ye(this)}));})),Re=Math.ceil,je=Math.floor,Ae=function(e){return isNaN(e=+e)?0:(e>0?je:Re)(e)},Fe=Math.min,Ke=function(e){return e>0?Fe(Ae(e),9007199254740991):0},Ue=Math.max,Le=Math.min,Pe=function(e){return function(t,n,r){var o,i=O(t),a=Ke(i.length),c=function(e,t){var n=Ae(e);return n<0?Ue(n+t,0):Le(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}},We={includes:Pe(!0),indexOf:Pe(!1)},Ze=We.indexOf,Ve=function(e,t){var n,r=O(e),o=0,i=[];for(n in r)!z(we,n)&&z(r,n)&&i.push(n);for(;t.length>o;)z(r,n=t[o++])&&(~Ze(i,n)||i.push(n));return i},Ne=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Xe=Ne.concat("length","prototype"),Ye={f:Object.getOwnPropertyNames||function(e){return Ve(e,Xe)}},ze={f:Object.getOwnPropertySymbols},De=C("Reflect","ownKeys")||function(e){var t=Ye.f(ce(e)),n=ze.f;return n?t.concat(n(e)):t},Je=function(e,t){for(var n=De(t),r=ue.f,o=ae.f,i=0;i<n.length;i++){var a=n[i];z(e,a)||r(e,a,o(t,a));}},Be=/#|\.prototype\./,Ge=function(e,t){var n=He[Me(e)];return n==Qe||n!=qe&&("function"==typeof t?y(t):!!t)},Me=Ge.normalize=function(e){return String(e).replace(Be,".").toLowerCase()},He=Ge.data={},qe=Ge.NATIVE="N",Qe=Ge.POLYFILL="P",$e=Ge,et=ae.f,tt=function(e,t){var n,r,o,i,a,c=e.target,s=e.global,u=e.stat;if(n=s?p:u?p[c]||Z(c,{}):(p[c]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=et(n,r))&&a.value:n[r],!$e(s?r:c+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Je(i,o);}(e.sham||o&&o.sham)&&le(i,"sham",!0),Ce(n,r,i,e);}},nt=function(e){if(W(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},rt=q("match"),ot=function(e){if(function(e){var t;return E(e)&&(void 0!==(t=e[rt])?!!t:"RegExp"==_(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},it=q("match"),at=function(e){var t=/./;try{"/./"[e](t);}catch(n){try{return t[it]=!1,"/./"[e](t)}catch(e){}}return !1},ct=ae.f,st="".startsWith,ut=Math.min,lt=at("startsWith"),ft=!(lt||(Ee=ct(String.prototype,"startsWith"),!Ee||Ee.writable));tt({target:"String",proto:!0,forced:!ft&&!lt},{startsWith:function(e){var t=nt(T(this));ot(e);var n=Ke(ut(arguments.length>1?arguments[1]:void 0,t.length)),r=nt(e);return st?st.call(t,r,n):t.slice(n,n+r.length)===r}});var dt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},ht=function(e,t,n){if(dt(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)}},pt=Function.call,yt=function(e,t,n){return ht(pt,p[e].prototype[t],n)};yt("String","startsWith");var vt,mt=Array.isArray||function(e){return "Array"==_(e)},gt=function(e,t,n){var r=ee(t);r in e?ue.f(e,r,w(0,n)):e[r]=n;},bt=q("species"),wt=function(e,t){return new(function(e){var t;return mt(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!mt(t.prototype)?E(t)&&null===(t=t[bt])&&(t=void 0):t=void 0),void 0===t?Array:t}(e))(0===t?0:t)},St=q("species"),_t=q("isConcatSpreadable"),kt=U>=51||!y((function(){var e=[];return e[_t]=!1,e.concat()[0]!==e})),It=(vt="concat",U>=51||!y((function(){var e=[];return (e.constructor={})[St]=function(){return {foo:1}},1!==e[vt](Boolean).foo}))),Tt=function(e){if(!E(e))return !1;var t=e[_t];return void 0!==t?!!t:mt(e)};tt({target:"Array",proto:!0,forced:!kt||!It},{concat:function(e){var t,n,r,o,i,a=X(this),c=wt(a,0),s=0;for(t=-1,r=arguments.length;t<r;t++)if(Tt(i=-1===t?a:arguments[t])){if(s+(o=Ke(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<o;n++,s++)n in i&&gt(c,s,i[n]);}else {if(s>=9007199254740991)throw TypeError("Maximum allowed index exceeded");gt(c,s++,i);}return c.length=s,c}});var Ot={};Ot[q("toStringTag")]="z";var Et="[object z]"===String(Ot),xt=q("toStringTag"),Ct="Arguments"==_(function(){return arguments}()),Rt=Et?_: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),xt))?n:Ct?_(t):"Object"==(r=_(t))&&"function"==typeof t.callee?"Arguments":r},jt=Et?{}.toString:function(){return "[object "+Rt(this)+"]"};Et||Ce(Object.prototype,"toString",jt,{unsafe:!0});var At,Ft=Object.keys||function(e){return Ve(e,Ne)},Kt=v?Object.defineProperties:function(e,t){ce(e);for(var n,r=Ft(t),o=r.length,i=0;o>i;)ue.f(e,n=r[i++],t[n]);return e},Ut=C("document","documentElement"),Lt=be("IE_PROTO"),Pt=function(){},Wt=function(e){return "<script>"+e+"<\/script>"},Zt=function(e){e.write(Wt("")),e.close();var t=e.parentWindow.Object;return e=null,t},Vt=function(){try{At=new ActiveXObject("htmlfile");}catch(e){}var e,t;Vt="undefined"!=typeof document?document.domain&&At?Zt(At):((t=re("iframe")).style.display="none",Ut.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Wt("document.F=Object")),e.close(),e.F):Zt(At);for(var n=Ne.length;n--;)delete Vt.prototype[Ne[n]];return Vt()};we[Lt]=!0;var Nt=Object.create||function(e,t){var n;return null!==e?(Pt.prototype=ce(e),n=new Pt,Pt.prototype=null,n[Lt]=e):n=Vt(),void 0===t?n:Kt(n,t)},Xt=Ye.f,Yt={}.toString,zt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Dt={f:function(e){return zt&&"[object Window]"==Yt.call(e)?function(e){try{return Xt(e)}catch(e){return zt.slice()}}(e):Xt(O(e))}},Jt={f:q},Bt=p,Gt=ue.f,Mt=function(e){var t=Bt.Symbol||(Bt.Symbol={});z(t,e)||Gt(t,e,{value:Jt.f(e)});},Ht=ue.f,qt=q("toStringTag"),Qt=function(e,t,n){e&&!z(e=n?e:e.prototype,qt)&&Ht(e,qt,{configurable:!0,value:t});},$t=[].push,en=function(e){var t=1==e,n=2==e,r=3==e,o=4==e,i=6==e,a=7==e,c=5==e||i;return function(s,u,l,f){for(var d,h,p=X(s),y=I(p),v=ht(u,l,3),m=Ke(y.length),g=0,b=f||wt,w=t?b(s,m):n||a?b(s,0):void 0;m>g;g++)if((c||g in y)&&(h=v(d=y[g],g,p),e))if(t)w[g]=h;else if(h)switch(e){case 3:return !0;case 5:return d;case 6:return g;case 2:$t.call(w,d);}else switch(e){case 4:return !1;case 7:$t.call(w,d);}return i?-1:r||o?o:w}},tn={forEach:en(0),map:en(1),filter:en(2),some:en(3),every:en(4),find:en(5),findIndex:en(6),filterReject:en(7)}.forEach,nn=be("hidden"),rn=q("toPrimitive"),on=xe.set,an=xe.getterFor("Symbol"),cn=Object.prototype,sn=p.Symbol,un=C("JSON","stringify"),ln=ae.f,fn=ue.f,dn=Dt.f,hn=b.f,pn=N("symbols"),yn=N("op-symbols"),vn=N("string-to-symbol-registry"),mn=N("symbol-to-string-registry"),gn=N("wks"),bn=p.QObject,wn=!bn||!bn.prototype||!bn.prototype.findChild,Sn=v&&y((function(){return 7!=Nt(fn({},"a",{get:function(){return fn(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=ln(cn,t);r&&delete cn[t],fn(e,t,n),r&&e!==cn&&fn(cn,t,r);}:fn,_n=function(e,t){var n=pn[e]=Nt(sn.prototype);return on(n,{type:"Symbol",tag:e,description:t}),v||(n.description=t),n},kn=function(e,t,n){e===cn&&kn(yn,t,n),ce(e);var r=ee(t);return ce(n),z(pn,r)?(n.enumerable?(z(e,nn)&&e[nn][r]&&(e[nn][r]=!1),n=Nt(n,{enumerable:w(0,!1)})):(z(e,nn)||fn(e,nn,w(1,{})),e[nn][r]=!0),Sn(e,r,n)):fn(e,r,n)},In=function(e,t){ce(e);var n=O(t),r=Ft(n).concat(xn(n));return tn(r,(function(t){v&&!Tn.call(n,t)||kn(e,t,n[t]);})),e},Tn=function(e){var t=ee(e),n=hn.call(this,t);return !(this===cn&&z(pn,t)&&!z(yn,t))&&(!(n||!z(this,t)||!z(pn,t)||z(this,nn)&&this[nn][t])||n)},On=function(e,t){var n=O(e),r=ee(t);if(n!==cn||!z(pn,r)||z(yn,r)){var o=ln(n,r);return !o||!z(pn,r)||z(n,nn)&&n[nn][r]||(o.enumerable=!0),o}},En=function(e){var t=dn(O(e)),n=[];return tn(t,(function(e){z(pn,e)||z(we,e)||n.push(e);})),n},xn=function(e){var t=e===cn,n=dn(t?yn:O(e)),r=[];return tn(n,(function(e){!z(pn,e)||t&&!z(cn,e)||r.push(pn[e]);})),r};if(L||(Ce((sn=function(){if(this instanceof sn)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?nt(arguments[0]):void 0,t=B(e),n=function(e){this===cn&&n.call(yn,e),z(this,nn)&&z(this[nn],t)&&(this[nn][t]=!1),Sn(this,t,w(1,e));};return v&&wn&&Sn(cn,t,{configurable:!0,set:n}),_n(t,e)}).prototype,"toString",(function(){return an(this).tag})),Ce(sn,"withoutSetter",(function(e){return _n(B(e),e)})),b.f=Tn,ue.f=kn,ae.f=On,Ye.f=Dt.f=En,ze.f=xn,Jt.f=function(e){return _n(q(e),e)},v&&(fn(sn.prototype,"description",{configurable:!0,get:function(){return an(this).description}}),Ce(cn,"propertyIsEnumerable",Tn,{unsafe:!0}))),tt({global:!0,wrap:!0,forced:!L,sham:!L},{Symbol:sn}),tn(Ft(gn),(function(e){Mt(e);})),tt({target:"Symbol",stat:!0,forced:!L},{for:function(e){var t=nt(e);if(z(vn,t))return vn[t];var n=sn(t);return vn[t]=n,mn[n]=t,n},keyFor:function(e){if(!W(e))throw TypeError(e+" is not a symbol");if(z(mn,e))return mn[e]},useSetter:function(){wn=!0;},useSimple:function(){wn=!1;}}),tt({target:"Object",stat:!0,forced:!L,sham:!v},{create:function(e,t){return void 0===t?Nt(e):In(Nt(e),t)},defineProperty:kn,defineProperties:In,getOwnPropertyDescriptor:On}),tt({target:"Object",stat:!0,forced:!L},{getOwnPropertyNames:En,getOwnPropertySymbols:xn}),tt({target:"Object",stat:!0,forced:y((function(){ze.f(1);}))},{getOwnPropertySymbols:function(e){return ze.f(X(e))}}),un){var Cn=!L||y((function(){var e=sn();return "[null]"!=un([e])||"{}"!=un({a:e})||"{}"!=un(Object(e))}));tt({target:"JSON",stat:!0,forced:Cn},{stringify:function(e,t,n){for(var r,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(r=t,(E(t)||void 0!==e)&&!W(e))return mt(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!W(t))return t}),o[1]=t,un.apply(null,o)}});}sn.prototype[rn]||le(sn.prototype,rn,sn.prototype.valueOf),Qt(sn,"Symbol"),we[nn]=!0,Mt("asyncIterator");var Rn=ue.f,jn=p.Symbol;if(v&&"function"==typeof jn&&(!("description"in jn.prototype)||void 0!==jn().description)){var An={},Fn=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Fn?new jn(e):void 0===e?jn():jn(e);return ""===e&&(An[t]=!0),t};Je(Fn,jn);var Kn=Fn.prototype=jn.prototype;Kn.constructor=Fn;var Un=Kn.toString,Ln="Symbol(test)"==String(jn("test")),Pn=/^Symbol\((.*)\)[^)]+$/;Rn(Kn,"description",{configurable:!0,get:function(){var e=E(this)?this.valueOf():this,t=Un.call(e);if(z(An,e))return "";var n=Ln?t.slice(7,-1):t.replace(Pn,"$1");return ""===n?void 0:n}}),tt({global:!0,forced:!0},{Symbol:Fn});}Mt("hasInstance"),Mt("isConcatSpreadable"),Mt("iterator"),Mt("match"),Mt("matchAll"),Mt("replace"),Mt("search"),Mt("species"),Mt("split"),Mt("toPrimitive"),Mt("toStringTag"),Mt("unscopables"),Qt(p.JSON,"JSON",!0),Qt(Math,"Math",!0),tt({global:!0},{Reflect:{}}),Qt(p.Reflect,"Reflect",!0),Bt.Symbol;var Wn,Zn,Vn,Nn=function(e){return function(t,n){var r,o,i=nt(T(t)),a=Ae(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}},Xn={codeAt:Nn(!1),charAt:Nn(!0)},Yn=!y((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),zn=be("IE_PROTO"),Dn=Object.prototype,Jn=Yn?Object.getPrototypeOf:function(e){return e=X(e),z(e,zn)?e[zn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Dn:null},Bn=q("iterator"),Gn=!1;[].keys&&("next"in(Vn=[].keys())?(Zn=Jn(Jn(Vn)))!==Object.prototype&&(Wn=Zn):Gn=!0),(null==Wn||y((function(){var e={};return Wn[Bn].call(e)!==e})))&&(Wn={}),z(Wn,Bn)||le(Wn,Bn,(function(){return this}));var Mn={IteratorPrototype:Wn,BUGGY_SAFARI_ITERATORS:Gn},Hn={},qn=Mn.IteratorPrototype,Qn=function(){return this},$n=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 ce(n),function(e){if(!E(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),er=Mn.IteratorPrototype,tr=Mn.BUGGY_SAFARI_ITERATORS,nr=q("iterator"),rr=function(){return this},or=function(e,t,n,r,o,i,a){!function(e,t,n){var r=t+" Iterator";e.prototype=Nt(qn,{next:w(1,n)}),Qt(e,r,!1),Hn[r]=Qn;}(n,t,r);var c,s,u,l=function(e){if(e===o&&y)return y;if(!tr&&e in h)return h[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",d=!1,h=e.prototype,p=h[nr]||h["@@iterator"]||o&&h[o],y=!tr&&p||l(o),v="Array"==t&&h.entries||p;if(v&&(c=Jn(v.call(new e)),er!==Object.prototype&&c.next&&(Jn(c)!==er&&($n?$n(c,er):"function"!=typeof c[nr]&&le(c,nr,rr)),Qt(c,f,!0))),"values"==o&&p&&"values"!==p.name&&(d=!0,y=function(){return p.call(this)}),h[nr]!==y&&le(h,nr,y),Hn[t]=y,o)if(s={values:l("values"),keys:i?y:l("keys"),entries:l("entries")},a)for(u in s)(tr||d||!(u in h))&&Ce(h,u,s[u]);else tt({target:t,proto:!0,forced:tr||d},s);return s},ir=Xn.charAt,ar=xe.set,cr=xe.getterFor("String Iterator");or(String,"String",(function(e){ar(this,{type:"String Iterator",string:nt(e),index:0});}),(function(){var e,t=cr(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=ir(n,r),t.index+=e.length,{value:e,done:!1})}));var sr=function(e){var t=e.return;if(void 0!==t)return ce(t.call(e)).value},ur=function(e,t,n,r){try{return r?t(ce(n)[0],n[1]):t(n)}catch(t){throw sr(e),t}},lr=q("iterator"),fr=Array.prototype,dr=function(e){return void 0!==e&&(Hn.Array===e||fr[lr]===e)},hr=q("iterator"),pr=function(e){if(null!=e)return e[hr]||e["@@iterator"]||Hn[Rt(e)]},yr=q("iterator"),vr=!1;try{var mr=0,gr={next:function(){return {done:!!mr++}},return:function(){vr=!0;}};gr[yr]=function(){return this},Array.from(gr,(function(){throw 2}));}catch(e){}var br=function(e,t){if(!t&&!vr)return !1;var n=!1;try{var r={};r[yr]=function(){return {next:function(){return {done:n=!0}}}},e(r);}catch(e){}return n},wr=!br((function(e){Array.from(e);}));tt({target:"Array",stat:!0,forced:wr},{from:function(e){var t,n,r,o,i,a,c=X(e),s="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,d=pr(c),h=0;if(f&&(l=ht(l,u>2?arguments[2]:void 0,2)),null==d||s==Array&&dr(d))for(n=new s(t=Ke(c.length));t>h;h++)a=f?l(c[h],h):c[h],gt(n,h,a);else for(i=(o=d.call(c)).next,n=new s;!(r=i.call(o)).done;h++)a=f?ur(o,l,[r.value,h],!0):r.value,gt(n,h,a);return n.length=h,n}}),Bt.Array.from;var Sr,_r,kr,Ir="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Tr=ue.f,Or=p.Int8Array,Er=Or&&Or.prototype,xr=p.Uint8ClampedArray,Cr=xr&&xr.prototype,Rr=Or&&Jn(Or),jr=Er&&Jn(Er),Ar=Object.prototype,Fr=Ar.isPrototypeOf,Kr=q("toStringTag"),Ur=B("TYPED_ARRAY_TAG"),Lr=B("TYPED_ARRAY_CONSTRUCTOR"),Pr=Ir&&!!$n&&"Opera"!==Rt(p.opera),Wr=!1,Zr={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Vr={BigInt64Array:8,BigUint64Array:8},Nr=function(e){if(!E(e))return !1;var t=Rt(e);return z(Zr,t)||z(Vr,t)};for(Sr in Zr)(kr=(_r=p[Sr])&&_r.prototype)?le(kr,Lr,_r):Pr=!1;for(Sr in Vr)(kr=(_r=p[Sr])&&_r.prototype)&&le(kr,Lr,_r);if((!Pr||"function"!=typeof Rr||Rr===Function.prototype)&&(Rr=function(){throw TypeError("Incorrect invocation")},Pr))for(Sr in Zr)p[Sr]&&$n(p[Sr],Rr);if((!Pr||!jr||jr===Ar)&&(jr=Rr.prototype,Pr))for(Sr in Zr)p[Sr]&&$n(p[Sr].prototype,jr);if(Pr&&Jn(Cr)!==jr&&$n(Cr,jr),v&&!z(jr,Kr))for(Sr in Wr=!0,Tr(jr,Kr,{get:function(){return E(this)?this[Ur]:void 0}}),Zr)p[Sr]&&le(p[Sr],Ur,Sr);var Xr={NATIVE_ARRAY_BUFFER_VIEWS:Pr,TYPED_ARRAY_CONSTRUCTOR:Lr,TYPED_ARRAY_TAG:Wr&&Ur,aTypedArray:function(e){if(Nr(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if($n&&!Fr.call(Rr,e))throw TypeError("Target is not a typed array constructor");return e},exportTypedArrayMethod:function(e,t,n){if(v){if(n)for(var r in Zr){var o=p[r];if(o&&z(o.prototype,e))try{delete o.prototype[e];}catch(e){}}jr[e]&&!n||Ce(jr,e,n?t:Pr&&Er[e]||t);}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(v){if($n){if(n)for(r in Zr)if((o=p[r])&&z(o,e))try{delete o[e];}catch(e){}if(Rr[e]&&!n)return;try{return Ce(Rr,e,n?t:Pr&&Rr[e]||t)}catch(e){}}for(r in Zr)!(o=p[r])||o[e]&&!n||Ce(o,e,t);}},isView:function(e){if(!E(e))return !1;var t=Rt(e);return "DataView"===t||z(Zr,t)||z(Vr,t)},isTypedArray:Nr,TypedArray:Rr,TypedArrayPrototype:jr},Yr=q("species"),zr=Xr.TYPED_ARRAY_CONSTRUCTOR,Dr=Xr.aTypedArrayConstructor,Jr=function(e){return Dr((t=e,n=e[zr],void 0===(o=ce(t).constructor)||null==(r=ce(o)[Yr])?n:dt(r)));var t,n,r,o;},Br=Xr.aTypedArray,Gr=[].slice;(0, Xr.exportTypedArrayMethod)("slice",(function(e,t){for(var n=Gr.call(Br(this),e,t),r=Jr(this),o=0,i=n.length,a=new r(i);i>o;)a[o]=n[o++];return a}),y((function(){new Int8Array(1).slice();})));var Mr=q("unscopables"),Hr=Array.prototype;null==Hr[Mr]&&ue.f(Hr,Mr,{configurable:!0,value:Nt(null)});var qr=function(e){Hr[Mr][e]=!0;},Qr=We.includes;tt({target:"Array",proto:!0},{includes:function(e){return Qr(this,e,arguments.length>1?arguments[1]:void 0)}}),qr("includes"),yt("Array","includes"),tt({target:"String",proto:!0,forced:!at("includes")},{includes:function(e){return !!~nt(T(this)).indexOf(nt(ot(e)),arguments.length>1?arguments[1]:void 0)}}),yt("String","includes");var $r=xe.set,eo=xe.getterFor("Array Iterator");or(Array,"Array",(function(e,t){$r(this,{type:"Array Iterator",target:O(e),index:0,kind:t});}),(function(){var e=eo(this),t=e.target,n=e.kind,r=e.index++;return !t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),Hn.Arguments=Hn.Array,qr("keys"),qr("values"),qr("entries");var to=!y((function(){return Object.isExtensible(Object.preventExtensions({}))})),no=l((function(e){var t=ue.f,n=!1,r=B("meta"),o=0,i=Object.isExtensible||function(){return !0},a=function(e){t(e,r,{value:{objectID:"O"+o++,weakData:{}}});},c=e.exports={enable:function(){c.enable=function(){},n=!0;var e=Ye.f,t=[].splice,o={};o[r]=1,e(o).length&&(Ye.f=function(n){for(var o=e(n),i=0,a=o.length;i<a;i++)if(o[i]===r){t.call(o,i,1);break}return o},tt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Dt.f}));},fastKey:function(e,t){if(!E(e))return "symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!z(e,r)){if(!i(e))return "F";if(!t)return "E";a(e);}return e[r].objectID},getWeakData:function(e,t){if(!z(e,r)){if(!i(e))return !0;if(!t)return !1;a(e);}return e[r].weakData},onFreeze:function(e){return to&&n&&i(e)&&!z(e,r)&&a(e),e}};we[r]=!0;}));no.enable,no.fastKey,no.getWeakData,no.onFreeze;var ro=function(e,t){this.stopped=e,this.result=t;},oo=function(e,t,n){var r,o,i,a,c,s,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),p=ht(t,l,1+f+h),y=function(e){return r&&sr(r),new ro(!0,e)},v=function(e){return f?(ce(e),h?p(e[0],e[1],y):p(e[0],e[1])):h?p(e,y):p(e)};if(d)r=e;else {if("function"!=typeof(o=pr(e)))throw TypeError("Target is not iterable");if(dr(o)){for(i=0,a=Ke(e.length);a>i;i++)if((c=v(e[i]))&&c instanceof ro)return c;return new ro(!1)}r=o.call(e);}for(s=r.next;!(u=s.call(r)).done;){try{c=v(u.value);}catch(e){throw sr(r),e}if("object"==typeof c&&c&&c instanceof ro)return c}return new ro(!1)},io=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},ao=function(e,t,n){for(var r in t)Ce(e,r,t[r],n);return e},co=q("species"),so=ue.f,uo=no.fastKey,lo=xe.set,fo=xe.getterFor,ho={getConstructor:function(e,t,n,r){var o=e((function(e,i){io(e,o,t),lo(e,{type:t,index:Nt(null),first:void 0,last:void 0,size:0}),v||(e.size=0),null!=i&&oo(i,e[r],{that:e,AS_ENTRIES:n});})),i=fo(t),a=function(e,t,n){var r,o,a=i(e),s=c(e,t);return s?s.value=n:(a.last=s={index:o=uo(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=s),r&&(r.next=s),v?a.size++:e.size++,"F"!==o&&(a.index[o]=s)),e},c=function(e,t){var n,r=i(e),o=uo(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return ao(o.prototype,{clear:function(){for(var e=i(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,v?e.size=0:this.size=0;},delete:function(e){var t=this,n=i(t),r=c(t,e);if(r){var o=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=o),o&&(o.previous=a),n.first==r&&(n.first=o),n.last==r&&(n.last=a),v?n.size--:t.size--;}return !!r},forEach:function(e){for(var t,n=i(this),r=ht(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous;},has:function(e){return !!c(this,e)}}),ao(o.prototype,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),v&&so(o.prototype,"size",{get:function(){return i(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=fo(t),i=fo(r);or(e,t,(function(e,t){lo(this,{type:r,target:e,state:o(e),kind:t,last:void 0});}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),function(e){var t=C(e),n=ue.f;v&&t&&!t[co]&&n(t,co,{configurable:!0,get:function(){return this}});}(t);}};function po(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)}))}))}function yo(e){return new this((function(t,n){if(!e||void 0===e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var o=r.length;function i(e,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(t){i(e,t);}),(function(n){r[e]={status:"rejected",reason:n},0==--o&&t(r);}))}r[e]={status:"fulfilled",value:n},0==--o&&t(r);}for(var a=0;a<r.length;a++)i(a,r[a]);}))}!function(e,t,n){var r=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),i=r?"set":"add",a=p[e],c=a&&a.prototype,s=a,u={},l=function(e){var t=c[e];Ce(c,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return !(o&&!E(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return o&&!E(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return !(o&&!E(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this});};if($e(e,"function"!=typeof a||!(o||c.forEach&&!y((function(){(new a).entries().next();})))))s=n.getConstructor(t,e,r,i),no.enable();else if($e(e,!0)){var f=new s,d=f[i](o?{}:-0,1)!=f,h=y((function(){f.has(1);})),v=br((function(e){new a(e);})),m=!o&&y((function(){for(var e=new a,t=5;t--;)e[i](t,t);return !e.has(-0)}));v||((s=t((function(t,n){io(t,s,e);var o=function(e,t,n){var r,o;return $n&&"function"==typeof(r=t.constructor)&&r!==n&&E(o=r.prototype)&&o!==n.prototype&&$n(e,o),e}(new a,t,s);return null!=n&&oo(n,o[i],{that:o,AS_ENTRIES:r}),o}))).prototype=c,c.constructor=s),(h||m)&&(l("delete"),l("has"),r&&l("get")),(m||d)&&l(i),o&&c.clear&&delete c.clear;}u[e]=s,tt({global:!0,forced:s!=a},u),Qt(s,e),o||n.setStrong(s,e,r);}("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ho),Bt.Set;var vo=setTimeout;function mo(e){return Boolean(e&&void 0!==e.length)}function go(){}function bo(e){if(!(this instanceof bo))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=[],To(e,this);}function wo(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,bo._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 _o(t.promise,e)}So(t.promise,r);}else (1===e._state?So:_o)(t.promise,e._value);}))):e._deferreds.push(t);}function So(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 bo)return e._state=3,e._value=t,void ko(e);if("function"==typeof n)return void To((r=n,o=t,function(){r.apply(o,arguments);}),e)}e._state=1,e._value=t,ko(e);}catch(t){_o(e,t);}var r,o;}function _o(e,t){e._state=2,e._value=t,ko(e);}function ko(e){2===e._state&&0===e._deferreds.length&&bo._immediateFn((function(){e._handled||bo._unhandledRejectionFn(e._value);}));for(var t=0,n=e._deferreds.length;t<n;t++)wo(e,e._deferreds[t]);e._deferreds=null;}function Io(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n;}function To(e,t){var n=!1;try{e((function(e){n||(n=!0,So(t,e));}),(function(e){n||(n=!0,_o(t,e));}));}catch(e){if(n)return;n=!0,_o(t,e);}}bo.prototype.catch=function(e){return this.then(null,e)},bo.prototype.then=function(e,t){var n=new this.constructor(go);return wo(this,new Io(e,t,n)),n},bo.prototype.finally=po,bo.all=function(e){return new bo((function(t,n){if(!mo(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]);}))},bo.allSettled=yo,bo.resolve=function(e){return e&&"object"==typeof e&&e.constructor===bo?e:new bo((function(t){t(e);}))},bo.reject=function(e){return new bo((function(t,n){n(e);}))},bo.race=function(e){return new bo((function(t,n){if(!mo(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,o=e.length;r<o;r++)bo.resolve(e[r]).then(t,n);}))},bo._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e);}||function(e){vo(e,0);},bo._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e);};var Oo=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"!=typeof Oo.Promise?Oo.Promise=bo:Oo.Promise.prototype.finally?Oo.Promise.allSettled||(Oo.Promise.allSettled=yo):Oo.Promise.prototype.finally=po,function(e){function t(){}function n(e,t){if(e=void 0===e?"utf-8":e,t=void 0===t?{fatal:!1}:t,-1===o.indexOf(e.toLowerCase()))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.")}function r(e){for(var t=0,n=Math.min(65536,e.length+1),r=new Uint16Array(n),o=[],i=0;;){var a=t<e.length;if(!a||i>=n-1){if(o.push(String.fromCharCode.apply(null,r.subarray(0,i))),!a)return o.join("");e=e.subarray(t),i=t=0;}if(0==(128&(a=e[t++])))r[i++]=a;else if(192==(224&a)){var c=63&e[t++];r[i++]=(31&a)<<6|c;}else if(224==(240&a)){c=63&e[t++];var s=63&e[t++];r[i++]=(31&a)<<12|c<<6|s;}else if(240==(248&a)){65535<(a=(7&a)<<18|(c=63&e[t++])<<12|(s=63&e[t++])<<6|63&e[t++])&&(a-=65536,r[i++]=a>>>10&1023|55296,a=56320|1023&a),r[i++]=a;}}}if(e.TextEncoder&&e.TextDecoder)return !1;var o=["utf-8","utf8","unicode-1-1-utf-8"];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?i.slice(0,r):i.subarray(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1});var i=r;"function"==typeof Buffer&&Buffer.from?i=function(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf-8")}:"function"==typeof Blob&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&(i=function(e){var t=URL.createObjectURL(new Blob([e],{type:"text/plain;charset=UTF-8"}));try{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(),n.responseText}catch(t){return r(e)}finally{URL.revokeObjectURL(t);}}),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.");return e=e instanceof Uint8Array?e:e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer):new Uint8Array(e),i(e)},e.TextEncoder=t,e.TextDecoder=n;}("undefined"!=typeof window?window:s),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t);}function o(e){return (o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return (i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return !1}}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){return !t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function l(e){var t=a();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i);}else n=r.apply(this,arguments);return u(this,n)}}function f(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e}function d(e,t,n){return (d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=f(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var h=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0});}return n(t,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n});}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r].callback===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),n=0,r=t.length;n<r;n++){var o=t[n];try{o.callback.call(this,e);}catch(e){Promise.resolve().then((function(){throw e}));}o.options&&o.options.once&&this.removeEventListener(e.type,o.callback);}return !e.defaultPrevented}}}]),t}(),p=function(t){r(a,t);var i=l(a);function a(){var t;return e(this,a),(t=i.call(this)).listeners||h.call(c(t)),Object.defineProperty(c(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(c(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return n(a,[{key:"toString",value:function(){return "[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),d(o(a.prototype),"dispatchEvent",this).call(this,e);}}]),a}(h),y=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new p,writable:!0,configurable:!0});}return n(t,[{key:"abort",value:function(){var e;try{e=new Event("abort");}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1};}this.signal.dispatchEvent(e);}},{key:"toString",value:function(){return "[object AbortController]"}}]),t}();function v(e){return e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController}"undefined"!=typeof Symbol&&Symbol.toStringTag&&(y.prototype[Symbol.toStringTag]="AbortController",p.prototype[Symbol.toStringTag]="AbortSignal"),function(e){v(e)&&(e.AbortController=y,e.AbortSignal=p);}("undefined"!=typeof self?self:s);}();var Eo=l((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r));},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n());}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0);}else e.locked.delete(t);};}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()};}));u(Eo);var xo=u(l((function(e,t){var n=s&&s.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e));}catch(e){i(e);}}function c(e){try{s(r.throw(e));}catch(e){i(e);}}function s(e){e.done?o(e.value):new n((function(t){t(e.value);})).then(a,c);}s((r=r.apply(e,t||[])).next());}))},r=s&&s.__generator||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=a.trys,(o=o.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])}}};Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key";function i(e){return new Promise((function(t){return setTimeout(t,e)}))}function a(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",r=0;r<e;r++){n+=t[Math.floor(Math.random()*t.length)];}return n}var c=function(){function e(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+a(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),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),void 0===e.waiters&&(e.waiters=[]);}return e.prototype.acquireLock=function(t,c){return void 0===c&&(c=5e3),n(this,void 0,void 0,(function(){var n,s,u,l,f,d;return r(this,(function(r){switch(r.label){case 0:n=Date.now()+a(4),s=Date.now()+c,u=o+"-"+t,l=window.localStorage,r.label=1;case 1:return Date.now()<s?[4,i(30)]:[3,8];case 2:return r.sent(),null!==l.getItem(u)?[3,5]:(f=this.id+"-"+t+"-"+n,[4,i(Math.floor(25*Math.random()))]);case 3:return r.sent(),l.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:f,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,i(30)];case 4:return r.sent(),null!==(d=l.getItem(u))&&(d=JSON.parse(d)).id===this.id&&d.iat===n?(this.acquiredIatSet.add(n),this.refreshLockWhileAcquired(u,n),[2,!0]):[3,7];case 5:return e.lockCorrector(),[4,this.waitForSomethingToChange(s)];case 6:r.sent(),r.label=7;case 7:return n=Date.now()+a(4),[3,1];case 8:return [2,!1]}}))}))},e.prototype.refreshLockWhileAcquired=function(e,t){return n(this,void 0,void 0,(function(){var o=this;return r(this,(function(i){return setTimeout((function(){return n(o,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return [4,Eo.default().lock(t)];case 1:return r.sent(),this.acquiredIatSet.has(t)?(n=window.localStorage,null===(o=n.getItem(e))?(Eo.default().unlock(t),[2]):((o=JSON.parse(o)).timeRefreshed=Date.now(),n.setItem(e,JSON.stringify(o)),Eo.default().unlock(t),this.refreshLockWhileAcquired(e,t),[2])):(Eo.default().unlock(t),[2])}}))}))}),1e3),[2]}))}))},e.prototype.waitForSomethingToChange=function(t){return n(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return [4,new Promise((function(n){var r=!1,o=Date.now(),i=!1;function a(){if(i||(window.removeEventListener("storage",a),e.removeFromWaiting(a),clearTimeout(c),i=!0),!r){r=!0;var t=50-(Date.now()-o);t>0?setTimeout(n,t):n();}}window.addEventListener("storage",a),e.addToWaiting(a);var c=setTimeout(a,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 n(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return [4,this.releaseLock__private__(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return n(this,void 0,void 0,(function(){var n,i,a;return r(this,(function(r){switch(r.label){case 0:return n=window.localStorage,i=o+"-"+t,null===(a=n.getItem(i))?[2]:(a=JSON.parse(a)).id!==this.id?[3,2]:[4,Eo.default().lock(a.iat)];case 1:r.sent(),this.acquiredIatSet.delete(a.iat),n.removeItem(i),Eo.default().unlock(a.iat),e.notifyWaiters(),r.label=2;case 2:return [2]}}))}))},e.lockCorrector=function(){for(var t=Date.now()-5e3,n=window.localStorage,r=Object.keys(n),i=!1,a=0;a<r.length;a++){var c=r[a];if(c.includes(o)){var s=n.getItem(c);null!==s&&(void 0===(s=JSON.parse(s)).timeRefreshed&&s.timeAcquired<t||void 0!==s.timeRefreshed&&s.timeRefreshed<t)&&(n.removeItem(c),i=!0);}}i&&e.notifyWaiters();},e.waiters=void 0,e}();t.default=c;}))),Co={timeoutInSeconds:60},Ro=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],jo={name:"auth0-spa-js",version:"1.18.0"},Ao=function(e){function n(t,r){var o=e.call(this,r)||this;return o.error=t,o.error_description=r,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),n.fromPayload=function(e){return new n(e.error,e.error_description)},n}(Error),Fo=function(e){function n(t,r,o,i){void 0===i&&(i=null);var a=e.call(this,t,r)||this;return a.state=o,a.appState=i,Object.setPrototypeOf(a,n.prototype),a}return t(n,e),n}(Ao),Ko=function(e){function n(){var t=e.call(this,"timeout","Timeout")||this;return Object.setPrototypeOf(t,n.prototype),t}return t(n,e),n}(Ao),Uo=function(e){function n(t){var r=e.call(this)||this;return r.popup=t,Object.setPrototypeOf(r,n.prototype),r}return t(n,e),n}(Ko),Lo=function(e){function n(t){var r=e.call(this,"cancelled","Popup closed")||this;return r.popup=t,Object.setPrototypeOf(r,n.prototype),r}return t(n,e),n}(Ao),Po=function(e){function n(t,r,o){var i=e.call(this,t,r)||this;return i.mfa_token=o,Object.setPrototypeOf(i,n.prototype),i}return t(n,e),n}(Ao),Wo=function(e){return new Promise((function(t,n){var r,o=setInterval((function(){e.popup&&e.popup.closed&&(clearInterval(o),clearTimeout(i),window.removeEventListener("message",r,!1),n(new Lo(e.popup)));}),1e3),i=setTimeout((function(){clearInterval(o),n(new Uo(e.popup)),window.removeEventListener("message",r,!1);}),1e3*(e.timeoutInSeconds||60));r=function(a){if(a.data&&"authorization_response"===a.data.type){if(clearTimeout(i),clearInterval(o),window.removeEventListener("message",r,!1),e.popup.close(),a.data.response.error)return n(Ao.fromPayload(a.data.response));t(a.data.response);}},window.addEventListener("message",r);}))},Zo=function(){return window.crypto||window.msCrypto},Vo=function(){var e=Zo();return e.subtle||e.webkitSubtle},No=function(){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",t="";return Array.from(Zo().getRandomValues(new Uint8Array(43))).forEach((function(n){return t+=e[n%e.length]})),t},Xo=function(e){return btoa(e)},Yo=function(e){return Object.keys(e).filter((function(t){return void 0!==e[t]})).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")},zo=function(e){return o(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return t=Vo().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()]}}))}))},Do=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,"+"))},Jo=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,c([],a(Array.from(t))))))};var Bo=function(e,t){return o(void 0,void 0,void 0,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return [4,(i=e,a=t,a=a||{},new Promise((function(e,t){var n=new XMLHttpRequest,r=[],o=[],c={},s=function(){return {ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:s,headers:{keys:function(){return r},entries:function(){return o},get:function(e){return c[e.toLowerCase()]},has:function(e){return e.toLowerCase()in c}}}};for(var u in n.open(a.method||"get",i,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){r.push(t=t.toLowerCase()),o.push([t,n]),c[t]=c[t]?c[t]+","+n:n;})),e(s());},n.onerror=t,n.withCredentials="include"==a.credentials,a.headers)n.setRequestHeader(u,a.headers[u]);n.send(a.body||null);})))];case 1:return n=o.sent(),r={ok:n.ok},[4,n.json()];case 2:return [2,(r.json=o.sent(),r)]}var i,a;}))}))},Go=function(e,t,n){return o(void 0,void 0,void 0,(function(){var r,o;return i(this,(function(i){return r=new AbortController,t.signal=r.signal,[2,Promise.race([Bo(e,t),new Promise((function(e,t){o=setTimeout((function(){r.abort(),t(new Error("Timeout when executing 'fetch'"));}),n);}))]).finally((function(){clearTimeout(o);}))]}))}))},Mo=function(e,t,n,r,a,c,s){return o(void 0,void 0,void 0,(function(){return i(this,(function(o){return [2,(i={auth:{audience:t,scope:n},timeout:a,fetchUrl:e,fetchOptions:r,useFormData:s},u=c,new Promise((function(e,t){var n=new MessageChannel;n.port1.onmessage=function(n){n.data.error?t(new Error(n.data.error)):e(n.data);},u.postMessage(i,[n.port2]);})))];var i,u;}))}))},Ho=function(e,t,n,r,a,c,s){return void 0===s&&(s=1e4),o(void 0,void 0,void 0,(function(){return i(this,(function(o){return a?[2,Mo(e,t,n,r,s,a,c)]:[2,Go(e,r,s)]}))}))};function qo(e,t,n,a,c,s,u){return o(this,void 0,void 0,(function(){var o,l,f,d,h,p,y,v,m;return i(this,(function(i){switch(i.label){case 0:o=null,f=0,i.label=1;case 1:if(!(f<3))return [3,6];i.label=2;case 2:return i.trys.push([2,4,,5]),[4,Ho(e,n,a,c,s,u,t)];case 3:return l=i.sent(),o=null,[3,6];case 4:return d=i.sent(),o=d,[3,5];case 5:return f++,[3,1];case 6:if(o)throw o.message=o.message||"Failed to fetch",o;if(h=l.json,p=h.error,y=h.error_description,v=r(h,["error","error_description"]),!l.ok){if(m=y||"HTTP error. Unable to fetch "+e,"mfa_required"===p)throw new Po(p,m,v.mfa_token);throw new Ao(p||"request_error",m)}return [2,v]}}))}))}function Qo(e,t){var n=e.baseUrl,a=e.timeout,c=e.audience,s=e.scope,u=e.auth0Client,l=e.useFormData,f=r(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);return o(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return e=l?Yo(f):JSON.stringify(f),[4,qo(n+"/oauth/token",a,c||"default",s,{method:"POST",body:e,headers:{"Content-Type":l?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(u||jo))}},t,l)];case 1:return [2,r.sent()]}}))}))}var $o=function(e){return Array.from(new Set(e))},ei=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return $o(e.join(" ").trim().split(/\s+/)).join(" ")},ti=function(){function e(e,t){void 0===t&&(t="@@auth0spajs@@"),this.prefix=t,this.client_id=e.client_id,this.scope=e.scope,this.audience=e.audience;}return e.prototype.toKey=function(){return this.prefix+"::"+this.client_id+"::"+this.audience+"::"+this.scope},e.fromKey=function(t){var n=a(t.split("::"),4),r=n[0],o=n[1],i=n[2];return new e({client_id:o,scope:n[3],audience:i},r)},e.fromCacheEntry=function(t){return new e({scope:t.scope,audience:t.audience,client_id:t.client_id})},e}(),ni=function(){function e(){}return e.prototype.set=function(e,t){localStorage.setItem(e,JSON.stringify(t));},e.prototype.get=function(e){var t=window.localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}},e.prototype.remove=function(e){localStorage.removeItem(e);},e.prototype.allKeys=function(){return Object.keys(window.localStorage).filter((function(e){return e.startsWith("@@auth0spajs@@")}))},e}(),ri=function(){var e;this.enclosedCache=(e={},{set:function(t,n){e[t]=n;},get:function(t){var n=e[t];if(n)return n},remove:function(t){delete e[t];},allKeys:function(){return Object.keys(e)}});},oi=function(){function e(e,t){this.cache=e,this.keyManifest=t;}return e.prototype.get=function(e,t){var n;return void 0===t&&(t=0),o(this,void 0,void 0,(function(){var r,o,a,c;return i(this,(function(i){switch(i.label){case 0:return [4,this.cache.get(e.toKey())];case 1:return (r=i.sent())?[3,4]:[4,this.getCacheKeys()];case 2:return (o=i.sent())?(a=this.matchExistingCacheKey(e,o),[4,this.cache.get(a)]):[2];case 3:r=i.sent(),i.label=4;case 4:return r?(c=Math.floor(Date.now()/1e3),r.expiresAt-t<c?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},[4,this.cache.set(e.toKey(),r)]):[3,6]:[3,9]):[2];case 5:return i.sent(),[2,r.body];case 6:return [4,this.cache.remove(e.toKey())];case 7:return i.sent(),[4,null===(n=this.keyManifest)||void 0===n?void 0:n.remove(e.toKey())];case 8:return i.sent(),[2];case 9:return [2,r.body]}}))}))},e.prototype.set=function(e){var t;return o(this,void 0,void 0,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return n=new ti({client_id:e.client_id,scope:e.scope,audience:e.audience}),r=this.wrapCacheEntry(e),[4,this.cache.set(n.toKey(),r)];case 1:return o.sent(),[4,null===(t=this.keyManifest)||void 0===t?void 0:t.add(n.toKey())];case 2:return o.sent(),[2]}}))}))},e.prototype.clear=function(e){var t;return o(this,void 0,void 0,(function(){var n,r=this;return i(this,(function(a){switch(a.label){case 0:return [4,this.getCacheKeys()];case 1:return (n=a.sent())?[4,n.filter((function(t){return !e||t.includes(e)})).reduce((function(e,t){return o(r,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return [4,e];case 1:return n.sent(),[4,this.cache.remove(t)];case 2:return n.sent(),[2]}}))}))}),Promise.resolve())]:[2];case 2:return a.sent(),[4,null===(t=this.keyManifest)||void 0===t?void 0:t.clear()];case 3:return a.sent(),[2]}}))}))},e.prototype.clearSync=function(e){var t=this,n=this.cache.allKeys();n&&n.filter((function(t){return !e||t.includes(e)})).forEach((function(e){t.cache.remove(e);}));},e.prototype.wrapCacheEntry=function(e){var t=Math.floor(Date.now()/1e3)+e.expires_in;return {body:e,expiresAt:Math.min(t,e.decodedToken.claims.exp)}},e.prototype.getCacheKeys=function(){var e;return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return this.keyManifest?[4,this.keyManifest.get()]:[3,2];case 1:return t=null===(e=n.sent())||void 0===e?void 0:e.keys,[3,4];case 2:return [4,this.cache.allKeys()];case 3:t=n.sent(),n.label=4;case 4:return [2,t]}}))}))},e.prototype.matchExistingCacheKey=function(e,t){return t.filter((function(t){var n=ti.fromKey(t),r=new Set(n.scope&&n.scope.split(" ")),o=e.scope.split(" "),i=n.scope&&o.reduce((function(e,t){return e&&r.has(t)}),!0);return "@@auth0spajs@@"===n.prefix&&n.client_id===e.client_id&&n.audience===e.audience&&i}))[0]},e}(),ii=function(){function e(e,t){this.storage=e,this.clientId=t,this.storageKey="a0.spajs.txs."+t,this.transaction=this.storage.get(this.storageKey);}return e.prototype.create=function(e){this.transaction=e,this.storage.save(this.storageKey,e,{daysUntilExpire:1});},e.prototype.get=function(){return this.transaction},e.prototype.remove=function(){delete this.transaction,this.storage.remove(this.storageKey);},e}(),ai=function(e){return "number"==typeof e},ci=["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"],si=function(e){if(!e.id_token)throw new Error("ID token is required but missing");var t=function(e){var t=e.split("."),n=a(t,3),r=n[0],o=n[1],i=n[2];if(3!==t.length||!r||!o||!i)throw new Error("ID token could not be decoded");var c=JSON.parse(Do(o)),s={__raw:e},u={};return Object.keys(c).forEach((function(e){s[e]=c[e],ci.includes(e)||(u[e]=c[e]);})),{encoded:{header:r,payload:o,signature:i},header:JSON.parse(Do(r)),claims:s,user:u}}(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&&!ai(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(!ai(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ai(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(Date.now()),o=new Date(0),i=new Date(0),c=new Date(0);if(c.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),o.setUTCSeconds(t.claims.exp+n),i.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(ai(t.claims.nbf)&&r<i)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 "+i);if(ai(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);if(e.organizationId){if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(e.organizationId!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'+e.organizationId+'", found "'+t.claims.org_id+'"')}return t},ui=l((function(e,t){var n=s&&s.__assign||function(){return (n=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 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 i(e){for(var t={},n=e?e.split("; "):[],r=/(%[\dA-F]{2})+/gi,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 a(){return i(document.cookie)}function c(e,t,r){document.cookie=o(e,t,n({path:"/"},r));}t.__esModule=!0,t.encode=o,t.parse=i,t.getAll=a,t.get=function(e){return a()[e]},t.set=c,t.remove=function(e,t){c(e,"",n(n({},t),{expires:-1}));};}));u(ui),ui.encode,ui.parse,ui.getAll;var li=ui.get,fi=ui.set,di=ui.remove,hi={get:function(e){var t=li(e);if(void 0!==t)return JSON.parse(t)},save:function(e,t,n){var r={};"https:"===window.location.protocol&&(r={secure:!0,sameSite:"none"}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),fi(e,JSON.stringify(t),r);},remove:function(e){di(e);}},pi={get:function(e){var t=hi.get(e);return t||hi.get("_legacy_"+e)},save:function(e,t,n){var r={};"https:"===window.location.protocol&&(r={secure:!0}),(null==n?void 0:n.daysUntilExpire)&&(r.expires=n.daysUntilExpire),fi("_legacy_"+e,JSON.stringify(t),r),hi.save(e,t,n);},remove:function(e){hi.remove(e),hi.remove("_legacy_"+e);}},yi={get:function(e){if("undefined"!=typeof sessionStorage){var t=sessionStorage.getItem(e);if(void 0!==t)return JSON.parse(t)}},save:function(e,t){sessionStorage.setItem(e,JSON.stringify(t));},remove:function(e){sessionStorage.removeItem(e);}};function vi(e,t,n){var r=void 0===t?null:t,o=function(e,t){var n=atob(e);if(t){for(var r=new Uint8Array(n.length),o=0,i=n.length;o<i;++o)r[o]=n.charCodeAt(o);return String.fromCharCode.apply(null,new Uint16Array(r.buffer))}return n}(e,void 0!==n&&n),i=o.indexOf("\n",10)+1,a=o.substring(i)+(r?"//# sourceMappingURL="+r:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}var mi,gi,bi,wi,Si=(mi="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Ci8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogICAgQ29weXJpZ2h0IChjKSBNaWNyb3NvZnQgQ29ycG9yYXRpb24uCgogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55CiAgICBwdXJwb3NlIHdpdGggb3Igd2l0aG91dCBmZWUgaXMgaGVyZWJ5IGdyYW50ZWQuCgogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgKICAgIFJFR0FSRCBUTyBUSElTIFNPRlRXQVJFIElOQ0xVRElORyBBTEwgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWQogICAgQU5EIEZJVE5FU1MuIElOIE5PIEVWRU5UIFNIQUxMIFRIRSBBVVRIT1IgQkUgTElBQkxFIEZPUiBBTlkgU1BFQ0lBTCwgRElSRUNULAogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiB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di5qc29uKCldOihkJiZkLmFib3J0KCksaC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KSxbMl0pO2Nhc2UgNjpyZXR1cm4ocj10LnNlbnQoKSkucmVmcmVzaF90b2tlbj8oZnVuY3Rpb24oZSxyLHQpe25bbyhyLHQpXT1lfShyLnJlZnJlc2hfdG9rZW4scyxwKSxkZWxldGUgci5yZWZyZXNoX3Rva2VuKTpmdW5jdGlvbihlLHIpe2RlbGV0ZSBuW28oZSxyKV19KHMscCksaC5wb3N0TWVzc2FnZSh7b2s6di5vayxqc29uOnJ9KSxbMyw4XTtjYXNlIDc6cmV0dXJuIGc9dC5zZW50KCksaC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3JfZGVzY3JpcHRpb246Zy5tZXNzYWdlfX0pLFszLDhdO2Nhc2UgODpyZXR1cm5bMl19dmFyIG0sayxTLF99KSl9KSl9KSl9KCk7Cgo=",gi=null,bi=!1,function(e){return wi=wi||vi(mi,gi,bi),new Worker(wi,e)}),_i={},ki=function(){function e(e,t){this.cache=e,this.clientId=t,this.manifestKey=this.createManifestKeyFrom(this.clientId);}return e.prototype.add=function(e){var t;return o(this,void 0,void 0,(function(){var n,r;return i(this,(function(o){switch(o.label){case 0:return r=Set.bind,[4,this.cache.get(this.manifestKey)];case 1:return (n=new(r.apply(Set,[void 0,(null===(t=o.sent())||void 0===t?void 0:t.keys)||[]]))).add(e),[4,this.cache.set(this.manifestKey,{keys:c([],a(n))})];case 2:return o.sent(),[2]}}))}))},e.prototype.remove=function(e){return o(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return [4,this.cache.get(this.manifestKey)];case 1:return (t=r.sent())?((n=new Set(t.keys)).delete(e),n.size>0?[4,this.cache.set(this.manifestKey,{keys:c([],a(n))})]:[3,3]):[3,5];case 2:return [2,r.sent()];case 3:return [4,this.cache.remove(this.manifestKey)];case 4:return [2,r.sent()];case 5:return [2]}}))}))},e.prototype.get=function(){return this.cache.get(this.manifestKey)},e.prototype.clear=function(){return this.cache.remove(this.manifestKey)},e.prototype.createManifestKeyFrom=function(e){return "@@auth0spajs@@::"+e},e}(),Ii=new xo,Ti={memory:function(){return (new ri).enclosedCache},localstorage:function(){return new ni}},Oi=function(e){return Ti[e]},Ei=function(){return !/Trident.*rv:11\.0/.test(navigator.userAgent)},xi=function(){function e(e){var t,n,o;if(this.options=e,"undefined"!=typeof window&&function(){if(!Zo())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(void 0===Vo())throw new Error("\n auth0-spa-js must run on a secure origin. 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 for more information.\n ")}(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)o=e.cache;else {if(this.cacheLocation=e.cacheLocation||"memory",!Oi(this.cacheLocation))throw new Error('Invalid cache location "'+this.cacheLocation+'"');o=Oi(this.cacheLocation)();}this.cookieStorage=!1===e.legacySameSiteCookie?hi:pi,this.orgHintCookieName="auth0."+this.options.client_id+".organization_hint",this.isAuthenticatedCookieName=function(e){return "auth0."+e+".is.authenticated"}(this.options.client_id),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;var i,a=e.useCookiesForTransactions?this.cookieStorage:yi;this.scope=this.options.scope,this.transactionManager=new ii(a,this.options.client_id),this.cacheManager=new oi(o,o.allKeys?null:new ki(o,this.options.client_id)),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:"https://"+i),this.tokenIssuer=function(e,t){return e?e.startsWith("https://")?e:"https://"+e+"/":t+"/"}(this.options.issuer,this.domainUrl),this.defaultScope=ei("openid",void 0!==(null===(n=null===(t=this.options)||void 0===t?void 0:t.advancedOptions)||void 0===n?void 0:n.defaultScope)?this.options.advancedOptions.defaultScope:"openid profile email"),this.options.useRefreshTokens&&(this.scope=ei(this.scope,"offline_access")),"undefined"!=typeof window&&window.Worker&&this.options.useRefreshTokens&&"memory"===this.cacheLocation&&Ei()&&(this.worker=new Si),this.customOptions=function(e){return e.advancedOptions,e.audience,e.auth0Client,e.authorizeTimeoutInSeconds,e.cacheLocation,e.client_id,e.domain,e.issuer,e.leeway,e.max_age,e.redirect_uri,e.scope,e.useRefreshTokens,e.useCookiesForTransactions,e.useFormData,r(e,["advancedOptions","audience","auth0Client","authorizeTimeoutInSeconds","cacheLocation","client_id","domain","issuer","leeway","max_age","redirect_uri","scope","useRefreshTokens","useCookiesForTransactions","useFormData"])}(e);}return e.prototype._url=function(e){var t=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||jo)));return ""+this.domainUrl+e+"&auth0Client="+t},e.prototype._getParams=function(e,t,o,i,a){var c=this.options;c.domain,c.leeway,c.useRefreshTokens,c.useCookiesForTransactions,c.useFormData,c.auth0Client,c.cacheLocation,c.advancedOptions;var s=r(c,["domain","leeway","useRefreshTokens","useCookiesForTransactions","useFormData","auth0Client","cacheLocation","advancedOptions"]);return n(n(n({},s),e),{scope:ei(this.defaultScope,this.scope,e.scope),response_type:"code",response_mode:"query",state:t,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?"+Yo(e))},e.prototype._verifyIdToken=function(e,t,n){return si({iss:this.tokenIssuer,aud:this.options.client_id,id_token:e,nonce:t,organizationId:n,leeway:this.options.leeway,max_age:this._parseNumber(this.options.max_age)})},e.prototype._parseNumber=function(e){return "string"!=typeof e?e:parseInt(e,10)||void 0},e.prototype._processOrgIdHint=function(e){e?this.cookieStorage.save(this.orgHintCookieName,e):this.cookieStorage.remove(this.orgHintCookieName);},e.prototype.buildAuthorizeUrl=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o,a,c,s,u,l,f,d,h,p,y;return i(this,(function(i){switch(i.label){case 0:return t=e.redirect_uri,o=e.appState,a=r(e,["redirect_uri","appState"]),c=Xo(No()),s=Xo(No()),u=No(),[4,zo(u)];case 1:return l=i.sent(),f=Jo(l),d=e.fragment?"#"+e.fragment:"",h=this._getParams(a,c,s,f,t),p=this._authorizeUrl(h),y=e.organization||this.options.organization,this.transactionManager.create(n({nonce:s,code_verifier:u,appState:o,scope:h.scope,audience:h.audience||"default",redirect_uri:h.redirect_uri},y&&{organizationId:y})),[2,p+d]}}))}))},e.prototype.loginWithPopup=function(e,t){return o(this,void 0,void 0,(function(){var o,a,c,s,u,l,f,d,h,p,y,v,m;return i(this,(function(i){switch(i.label){case 0:return e=e||{},(t=t||{}).popup||(t.popup=function(e){var t=window.screenX+(window.innerWidth-400)/2,n=window.screenY+(window.innerHeight-600)/2;return window.open(e,"auth0:authorize:popup","left="+t+",top="+n+",width=400,height=600,resizable,scrollbars=yes,status=1")}("")),o=r(e,[]),a=Xo(No()),c=Xo(No()),s=No(),[4,zo(s)];case 1:return u=i.sent(),l=Jo(u),f=this._getParams(o,a,c,l,this.options.redirect_uri||window.location.origin),d=this._authorizeUrl(n(n({},f),{response_mode:"web_message"})),t.popup.location.href=d,[4,Wo(n(n({},t),{timeoutInSeconds:t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}))];case 2:if(h=i.sent(),a!==h.state)throw new Error("Invalid state");return [4,Qo({audience:f.audience,scope:f.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:s,code:h.code,grant_type:"authorization_code",redirect_uri:f.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData},this.worker)];case 3:return p=i.sent(),y=e.organization||this.options.organization,v=this._verifyIdToken(p.id_token,c,y),m=n(n({},p),{decodedToken:v,scope:f.scope,audience:f.audience||"default",client_id:this.options.client_id}),[4,this.cacheManager.set(m)];case 4:return i.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays}),this._processOrgIdHint(v.claims.org_id),[2]}}))}))},e.prototype.getUser=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return t=e.audience||this.options.audience||"default",n=ei(this.defaultScope,this.scope,e.scope),[4,this.cacheManager.get(new ti({client_id:this.options.client_id,audience:t,scope:n}))];case 1:return [2,(r=o.sent())&&r.decodedToken&&r.decodedToken.user]}}))}))},e.prototype.getIdTokenClaims=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(o){switch(o.label){case 0:return t=e.audience||this.options.audience||"default",n=ei(this.defaultScope,this.scope,e.scope),[4,this.cacheManager.get(new ti({client_id:this.options.client_id,audience:t,scope:n}))];case 1:return [2,(r=o.sent())&&r.decodedToken&&r.decodedToken.claims]}}))}))},e.prototype.loginWithRedirect=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,n,o;return i(this,(function(i){switch(i.label){case 0:return t=e.redirectMethod,n=r(e,["redirectMethod"]),[4,this.buildAuthorizeUrl(n)];case 1:return o=i.sent(),window.location[t||"assign"](o),[2]}}))}))},e.prototype.handleRedirectCallback=function(e){return void 0===e&&(e=window.location.href),o(this,void 0,void 0,(function(){var t,r,o,c,s,u,l,f,d,h,p;return i(this,(function(i){switch(i.label){case 0:if(0===(t=e.split("?").slice(1)).length)throw new Error("There are no query params available for parsing.");if(r=function(e){e.indexOf("#")>-1&&(e=e.substr(0,e.indexOf("#")));var t=e.split("&"),n={};return t.forEach((function(e){var t=a(e.split("="),2),r=t[0],o=t[1];n[r]=decodeURIComponent(o);})),n.expires_in&&(n.expires_in=parseInt(n.expires_in)),n}(t.join("")),o=r.state,c=r.code,s=r.error,u=r.error_description,!(l=this.transactionManager.get())||!l.code_verifier)throw new Error("Invalid state");if(this.transactionManager.remove(),s)throw new Fo(s,u,o,l.appState);return f={audience:l.audience,scope:l.scope,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:l.code_verifier,grant_type:"authorization_code",code:c,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData},void 0!==l.redirect_uri&&(f.redirect_uri=l.redirect_uri),[4,Qo(f,this.worker)];case 1:return d=i.sent(),h=this._verifyIdToken(d.id_token,l.nonce,l.organizationId),p=n(n({},d),{decodedToken:h,audience:l.audience,scope:l.scope,client_id:this.options.client_id}),[4,this.cacheManager.set(p)];case 2:return i.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays}),this._processOrgIdHint(h.claims.org_id),[2,{appState:l.appState}]}}))}))},e.prototype.checkSession=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return [2];this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays}),this.cookieStorage.remove("auth0.is.authenticated");}n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.getTokenSilently(e)];case 2:return n.sent(),[3,4];case 3:if(t=n.sent(),!Ro.includes(t.error))throw t;return [3,4];case 4:return [2]}}))}))},e.prototype.getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,o,a,c=this;return i(this,(function(i){return t=n(n({audience:this.options.audience,ignoreCache:!1},e),{scope:ei(this.defaultScope,this.scope,e.scope)}),o=t.ignoreCache,a=r(t,["ignoreCache"]),[2,(s=function(){return c._getTokenSilently(n({ignoreCache:o},a))},u=this.options.client_id+"::"+a.audience+"::"+a.scope,l=_i[u],l||(l=s().finally((function(){delete _i[u],l=null;})),_i[u]=l),l)];var s,u,l;}))}))},e.prototype._getTokenSilently=function(e){return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var t,a,c,s,u,l,f=this;return i(this,(function(d){switch(d.label){case 0:return t=e.ignoreCache,a=r(e,["ignoreCache"]),c=function(){return o(f,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return [4,this.cacheManager.get(new ti({scope:a.scope,audience:a.audience||"default",client_id:this.options.client_id}),60)];case 1:return [2,(e=t.sent())&&e.access_token]}}))}))},t?[3,2]:[4,c()];case 1:if(s=d.sent())return [2,s];d.label=2;case 2:return [4,(h=function(){return Ii.acquireLock("auth0.lock.getTokenSilently",5e3)},p=10,void 0===p&&(p=3),o(void 0,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<p?[4,h()]:[3,4];case 2:if(t.sent())return [2,!0];t.label=3;case 3:return e++,[3,1];case 4:return [2,!1]}}))})))];case 3:if(!d.sent())return [3,15];d.label=4;case 4:return d.trys.push([4,,12,14]),t?[3,6]:[4,c()];case 5:if(s=d.sent())return [2,s];d.label=6;case 6:return this.options.useRefreshTokens?[4,this._getTokenUsingRefreshToken(a)]:[3,8];case 7:return l=d.sent(),[3,10];case 8:return [4,this._getTokenFromIFrame(a)];case 9:l=d.sent(),d.label=10;case 10:return u=l,[4,this.cacheManager.set(n({client_id:this.options.client_id},u))];case 11:return d.sent(),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays}),[2,u.access_token];case 12:return [4,Ii.releaseLock("auth0.lock.getTokenSilently")];case 13:return d.sent(),[7];case 14:return [3,16];case 15:throw new Ko;case 16:return [2]}var h,p;}))}))},e.prototype.getTokenWithPopup=function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),o(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return e.audience=e.audience||this.options.audience,e.scope=ei(this.defaultScope,this.scope,e.scope),t=n(n({},Co),t),[4,this.loginWithPopup(e,t)];case 1:return r.sent(),[4,this.cacheManager.get(new ti({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))];case 2:return [2,r.sent().access_token]}}))}))},e.prototype.isAuthenticated=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this.getUser()];case 1:return [2,!!e.sent()]}}))}))},e.prototype.buildLogoutUrl=function(e){void 0===e&&(e={}),null!==e.client_id?e.client_id=e.client_id||this.options.client_id:delete e.client_id;var t=e.federated,n=r(e,["federated"]),o=t?"&federated":"";return this._url("/v2/logout?"+Yo(n))+o},e.prototype.logout=function(e){var t=this;void 0===e&&(e={});var n=e.localOnly,o=r(e,["localOnly"]);if(n&&o.federated)throw new Error("It is invalid to set both the `federated` and `localOnly` options to `true`");var i=function(){if(t.cookieStorage.remove(t.orgHintCookieName),t.cookieStorage.remove(t.isAuthenticatedCookieName),!n){var e=t.buildLogoutUrl(o);window.location.assign(e);}};if(this.options.cache)return this.cacheManager.clear().then((function(){return i()}));this.cacheManager.clearSync(),i();},e.prototype._getTokenFromIFrame=function(e){return o(this,void 0,void 0,(function(){var t,o,a,c,s,u,l,f,d,h,p,y,v,m,g,b;return i(this,(function(i){switch(i.label){case 0:return t=Xo(No()),o=Xo(No()),a=No(),[4,zo(a)];case 1:c=i.sent(),s=Jo(c),u=this._getParams(e,t,o,s,e.redirect_uri||this.options.redirect_uri||window.location.origin),(l=this.cookieStorage.get(this.orgHintCookieName))&&!u.organization&&(u.organization=l),f=this._authorizeUrl(n(n({},u),{prompt:"none",response_mode:"web_message"})),d=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,i.label=2;case 2:if(i.trys.push([2,5,,6]),window.crossOriginIsolated)throw new Ao("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");return [4,(w=f,S=this.domainUrl,_=d,void 0===_&&(_=60),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,o=function(){window.document.body.contains(n)&&(window.document.body.removeChild(n),window.removeEventListener("message",r,!1));},i=setTimeout((function(){t(new Ko),o();}),1e3*_);r=function(n){if(n.origin==S&&n.data&&"authorization_response"===n.data.type){var a=n.source;a&&a.close(),n.data.response.error?t(Ao.fromPayload(n.data.response)):e(n.data.response),clearTimeout(i),window.removeEventListener("message",r,!1),setTimeout(o,2e3);}},window.addEventListener("message",r,!1),window.document.body.appendChild(n),n.setAttribute("src",w);})))];case 3:if(h=i.sent(),t!==h.state)throw new Error("Invalid state");return p=e.scope,y=e.audience,v=r(e,["scope","audience","redirect_uri","ignoreCache","timeoutInSeconds"]),[4,Qo(n(n(n({},this.customOptions),v),{scope:p,audience:y,baseUrl:this.domainUrl,client_id:this.options.client_id,code_verifier:a,code:h.code,grant_type:"authorization_code",redirect_uri:u.redirect_uri,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData}),this.worker)];case 4:return m=i.sent(),g=this._verifyIdToken(m.id_token,o),this._processOrgIdHint(g.claims.org_id),[2,n(n({},m),{decodedToken:g,scope:u.scope,audience:u.audience||"default"})];case 5:throw "login_required"===(b=i.sent()).error&&this.logout({localOnly:!0}),b;case 6:return [2]}var w,S,_;}))}))},e.prototype._getTokenUsingRefreshToken=function(e){return o(this,void 0,void 0,(function(){var t,o,a,c,s,u,l,f,d;return i(this,(function(i){switch(i.label){case 0:return e.scope=ei(this.defaultScope,this.options.scope,e.scope),[4,this.cacheManager.get(new ti({scope:e.scope,audience:e.audience||"default",client_id:this.options.client_id}))];case 1:return (t=i.sent())&&t.refresh_token||this.worker?[3,3]:[4,this._getTokenFromIFrame(e)];case 2:return [2,i.sent()];case 3:o=e.redirect_uri||this.options.redirect_uri||window.location.origin,c=e.scope,s=e.audience,u=r(e,["scope","audience","ignoreCache","timeoutInSeconds"]),l="number"==typeof e.timeoutInSeconds?1e3*e.timeoutInSeconds:null,i.label=4;case 4:return i.trys.push([4,6,,9]),[4,Qo(n(n(n(n(n({},this.customOptions),u),{audience:s,scope:c,baseUrl:this.domainUrl,client_id:this.options.client_id,grant_type:"refresh_token",refresh_token:t&&t.refresh_token,redirect_uri:o}),l&&{timeout:l}),{auth0Client:this.options.auth0Client,useFormData:this.options.useFormData}),this.worker)];case 5:return a=i.sent(),[3,9];case 6:return "The web worker is missing the refresh token"===(f=i.sent()).message||f.message&&f.message.indexOf("invalid refresh token")>-1?[4,this._getTokenFromIFrame(e)]:[3,8];case 7:return [2,i.sent()];case 8:throw f;case 9:return d=this._verifyIdToken(a.id_token),[2,n(n({},a),{decodedToken:d,scope:e.scope,audience:e.audience||"default"})]}}))}))},e}(),Ci=function(){};
114
114
 
115
115
  /**
116
116
  * The initial auth state.
@@ -129,7 +129,7 @@
129
129
  /**
130
130
  * @ignore
131
131
  */
132
- var initialContext = __assign(__assign({}, initialAuthState), { buildAuthorizeUrl: stub, buildLogoutUrl: stub, getAccessTokenSilently: stub, getAccessTokenWithPopup: stub, getIdTokenClaims: stub, loginWithRedirect: stub, loginWithPopup: stub, logout: stub });
132
+ var initialContext = __assign(__assign({}, initialAuthState), { buildAuthorizeUrl: stub, buildLogoutUrl: stub, getAccessTokenSilently: stub, getAccessTokenWithPopup: stub, getIdTokenClaims: stub, loginWithRedirect: stub, loginWithPopup: stub, logout: stub, handleRedirectCallback: stub });
133
133
  /**
134
134
  * The Auth0 Context
135
135
  */
@@ -157,8 +157,8 @@
157
157
  var ERROR_RE = /[?&]error=[^&]+/;
158
158
  var hasAuthParams = function (searchParams) {
159
159
  if (searchParams === void 0) { searchParams = window.location.search; }
160
- return (CODE_RE.test(searchParams) && STATE_RE.test(searchParams)) ||
161
- ERROR_RE.test(searchParams);
160
+ return (CODE_RE.test(searchParams) || ERROR_RE.test(searchParams)) &&
161
+ STATE_RE.test(searchParams);
162
162
  };
163
163
  var normalizeErrorFn = function (fallbackMessage) { return function (error) {
164
164
  if ('error' in error) {
@@ -183,6 +183,7 @@
183
183
  case 'LOGIN_POPUP_COMPLETE':
184
184
  case 'INITIALISED':
185
185
  return __assign(__assign({}, state), { isAuthenticated: !!action.user, user: action.user, isLoading: false, error: undefined });
186
+ case 'HANDLE_REDIRECT_COMPLETE':
186
187
  case 'GET_ACCESS_TOKEN_COMPLETE':
187
188
  if (((_a = state.user) === null || _a === void 0 ? void 0 : _a.updated_at) === ((_b = action.user) === null || _b === void 0 ? void 0 : _b.updated_at)) {
188
189
  return state;
@@ -202,7 +203,7 @@
202
203
  var clientId = opts.clientId, redirectUri = opts.redirectUri, maxAge = opts.maxAge, validOpts = __rest(opts, ["clientId", "redirectUri", "maxAge"]);
203
204
  return __assign(__assign({}, validOpts), { client_id: clientId, redirect_uri: redirectUri, max_age: maxAge, auth0Client: {
204
205
  name: 'auth0-react',
205
- version: '1.4.0',
206
+ version: '1.8.0',
206
207
  } });
207
208
  };
208
209
  /**
@@ -235,7 +236,7 @@
235
236
  */
236
237
  var Auth0Provider = function (opts) {
237
238
  var children = opts.children, skipRedirectCallback = opts.skipRedirectCallback, _a = opts.onRedirectCallback, onRedirectCallback = _a === void 0 ? defaultOnRedirectCallback : _a, clientOpts = __rest(opts, ["children", "skipRedirectCallback", "onRedirectCallback"]);
238
- var client = React.useState(function () { return new Vo(toAuth0ClientOptions(clientOpts)); })[0];
239
+ var client = React.useState(function () { return new xi(toAuth0ClientOptions(clientOpts)); })[0];
239
240
  var _b = React.useReducer(reducer, initialAuthState), state = _b[0], dispatch = _b[1];
240
241
  React.useEffect(function () {
241
242
  (function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -302,10 +303,14 @@
302
303
  }); }, [client]);
303
304
  var logout = React.useCallback(function (opts) {
304
305
  if (opts === void 0) { opts = {}; }
305
- client.logout(opts);
306
+ var maybePromise = client.logout(opts);
306
307
  if (opts.localOnly) {
308
+ if (maybePromise && typeof maybePromise.then === 'function') {
309
+ return maybePromise.then(function () { return dispatch({ type: 'LOGOUT' }); });
310
+ }
307
311
  dispatch({ type: 'LOGOUT' });
308
312
  }
313
+ return maybePromise;
309
314
  }, [client]);
310
315
  var getAccessTokenSilently = React.useCallback(function (opts) { return __awaiter(void 0, void 0, void 0, function () {
311
316
  var token, error_3, _a, _b;
@@ -364,6 +369,31 @@
364
369
  var getIdTokenClaims = React.useCallback(function (opts) {
365
370
  return client.getIdTokenClaims(opts);
366
371
  }, [client]);
372
+ var handleRedirectCallback = React.useCallback(function (url) { return __awaiter(void 0, void 0, void 0, function () {
373
+ var error_5, _a, _b;
374
+ return __generator(this, function (_c) {
375
+ switch (_c.label) {
376
+ case 0:
377
+ _c.trys.push([0, 2, 3, 5]);
378
+ return [4 /*yield*/, client.handleRedirectCallback(url)];
379
+ case 1: return [2 /*return*/, _c.sent()];
380
+ case 2:
381
+ error_5 = _c.sent();
382
+ throw tokenError(error_5);
383
+ case 3:
384
+ _a = dispatch;
385
+ _b = {
386
+ type: 'HANDLE_REDIRECT_COMPLETE'
387
+ };
388
+ return [4 /*yield*/, client.getUser()];
389
+ case 4:
390
+ _a.apply(void 0, [(_b.user = _c.sent(),
391
+ _b)]);
392
+ return [7 /*endfinally*/];
393
+ case 5: return [2 /*return*/];
394
+ }
395
+ });
396
+ }); }, [client]);
367
397
  return (React__default.createElement(Auth0Context.Provider, { value: __assign(__assign({}, state), { buildAuthorizeUrl: buildAuthorizeUrl,
368
398
  buildLogoutUrl: buildLogoutUrl,
369
399
  getAccessTokenSilently: getAccessTokenSilently,
@@ -371,7 +401,8 @@
371
401
  getIdTokenClaims: getIdTokenClaims,
372
402
  loginWithRedirect: loginWithRedirect,
373
403
  loginWithPopup: loginWithPopup,
374
- logout: logout }) }, children));
404
+ logout: logout,
405
+ handleRedirectCallback: handleRedirectCallback }) }, children));
375
406
  };
376
407
 
377
408
  /**
@@ -389,12 +420,16 @@
389
420
  * loginWithRedirect,
390
421
  * loginWithPopup,
391
422
  * logout,
392
- * } = useAuth0();
423
+ * } = useAuth0<TUser>();
393
424
  * ```
394
425
  *
395
426
  * Use the `useAuth0` hook in your components to access the auth state and methods.
427
+ *
428
+ * TUser is an optional type param to provide a type to the `user` field.
396
429
  */
397
- var useAuth0 = function () { return React.useContext(Auth0Context); };
430
+ var useAuth0 = function () {
431
+ return React.useContext(Auth0Context);
432
+ };
398
433
 
399
434
  /**
400
435
  * ```jsx
@@ -435,10 +470,15 @@
435
470
  if (options === void 0) { options = {}; }
436
471
  return function WithAuthenticationRequired(props) {
437
472
  var _this = this;
438
- var _a = useAuth0(), isAuthenticated = _a.isAuthenticated, isLoading = _a.isLoading, loginWithRedirect = _a.loginWithRedirect;
439
- var _b = options.returnTo, returnTo = _b === void 0 ? defaultReturnTo : _b, _c = options.onRedirecting, onRedirecting = _c === void 0 ? defaultOnRedirecting : _c, _d = options.loginOptions, loginOptions = _d === void 0 ? {} : _d;
473
+ var _a = useAuth0(), user = _a.user, isAuthenticated = _a.isAuthenticated, isLoading = _a.isLoading, loginWithRedirect = _a.loginWithRedirect;
474
+ var _b = options.returnTo, returnTo = _b === void 0 ? defaultReturnTo : _b, _c = options.onRedirecting, onRedirecting = _c === void 0 ? defaultOnRedirecting : _c, _d = options.loginOptions, loginOptions = _d === void 0 ? {} : _d, _e = options.claimCheck, claimCheck = _e === void 0 ? function () { return true; } : _e;
475
+ /**
476
+ * The route is authenticated if the user has valid auth and there are no
477
+ * JWT claim mismatches.
478
+ */
479
+ var routeIsAuthenticated = isAuthenticated && claimCheck(user);
440
480
  React.useEffect(function () {
441
- if (isLoading || isAuthenticated) {
481
+ if (isLoading || routeIsAuthenticated) {
442
482
  return;
443
483
  }
444
484
  var opts = __assign(__assign({}, loginOptions), { appState: __assign(__assign({}, loginOptions.appState), { returnTo: typeof returnTo === 'function' ? returnTo() : returnTo }) });
@@ -452,14 +492,23 @@
452
492
  }
453
493
  });
454
494
  }); })();
455
- }, [isLoading, isAuthenticated, loginWithRedirect, loginOptions, returnTo]);
456
- return isAuthenticated ? React__default.createElement(Component, __assign({}, props)) : onRedirecting();
495
+ }, [
496
+ isLoading,
497
+ routeIsAuthenticated,
498
+ loginWithRedirect,
499
+ loginOptions,
500
+ returnTo,
501
+ ]);
502
+ return routeIsAuthenticated ? React__default.createElement(Component, __assign({}, props)) : onRedirecting();
457
503
  };
458
504
  };
459
505
 
460
506
  exports.Auth0Context = Auth0Context;
461
507
  exports.Auth0Provider = Auth0Provider;
508
+ exports.InMemoryCache = ri;
509
+ exports.LocalStorageCache = ni;
462
510
  exports.OAuthError = OAuthError;
511
+ exports.User = Ci;
463
512
  exports.useAuth0 = useAuth0;
464
513
  exports.withAuth0 = withAuth0;
465
514
  exports.withAuthenticationRequired = withAuthenticationRequired;