@upbond/auth-spa-js
Version:
Auth SDK for Single Page Applications using Authorization Code Grant Flow with PKCE
15 lines (13 loc) • 95.1 kB
JavaScript
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
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{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(c,s)}u((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 u(t,e){return t(e={exports:{}},e.exports),e.exports}var a=function(t){return t&&t.Math==Math&&t},l=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof c&&c)||Function("return this")(),d=function(t){try{return!!t()}catch(t){return!0}},I=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),g={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p={f:f&&!g.call({1:2},1)?function(t){var e=f(this,t);return!!e&&e.enumerable}:g},y=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,b=function(t){return h.call(t).slice(8,-1)},m="".split,B=d((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==b(t)?m.call(t,""):Object(t)}:Object,F=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},U=function(t){return B(F(t))},C=function(t){return"object"==typeof t?null!==t:"function"==typeof t},v=function(t,e){if(!C(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!C(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!C(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!C(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},S={}.hasOwnProperty,V=function(t,e){return S.call(t,e)},X=l.document,Z=C(X)&&C(X.createElement),G=function(t){return Z?X.createElement(t):{}},w=!I&&!d((function(){return 7!=Object.defineProperty(G("div"),"a",{get:function(){return 7}}).a})),R=Object.getOwnPropertyDescriptor,A={f:I?R:function(t,e){if(t=U(t),e=v(e,!0),w)try{return R(t,e)}catch(t){}if(V(t,e))return y(!p.f.call(t,e),t[e])}},Q=function(t){if(!C(t))throw TypeError(String(t)+" is not an object");return t},x=Object.defineProperty,J={f:I?x:function(t,e,n){if(Q(t),e=v(e,!0),Q(n),w)try{return x(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=I?function(t,e,n){return J.f(t,e,y(1,n))}:function(t,e,n){return t[e]=n,t},L=function(t,e){try{W(l,t,e)}catch(n){l[t]=e}return e},H=l["__core-js_shared__"]||L("__core-js_shared__",{}),k=Function.toString;"function"!=typeof H.inspectSource&&(H.inspectSource=function(t){return k.call(t)});var T,E,Y,N=H.inspectSource,K=l.WeakMap,O="function"==typeof K&&/native code/.test(N(K)),_=u((function(t){(t.exports=function(t,e){return H[t]||(H[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),P=0,z=Math.random(),D=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++P+z).toString(36)},j=_("keys"),M=function(t){return j[t]||(j[t]=D(t))},q={},$=l.WeakMap;if(O){var tt=new $,et=tt.get,nt=tt.has,it=tt.set;T=function(t,e){return it.call(tt,t,e),e},E=function(t){return et.call(tt,t)||{}},Y=function(t){return nt.call(tt,t)}}else{var rt=M("state");q[rt]=!0,T=function(t,e){return W(t,rt,e),e},E=function(t){return V(t,rt)?t[rt]:{}},Y=function(t){return V(t,rt)}}var ot,ct={set:T,get:E,has:Y,enforce:function(t){return Y(t)?E(t):T(t,{})},getterFor:function(t){return function(e){var n;if(!C(e)||(n=E(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},st=u((function(t){var e=ct.get,n=ct.enforce,i=String(String).split("String");(t.exports=function(t,e,r,o){var c=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable,u=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof e||V(r,"name")||W(r,"name",e),n(r).source=i.join("string"==typeof e?e:"")),t!==l?(c?!u&&t[e]&&(s=!0):delete t[e],s?t[e]=r:W(t,e,r)):s?t[e]=r:L(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||N(this)}))})),ut=l,at=function(t){return"function"==typeof t?t:void 0},lt=function(t,e){return arguments.length<2?at(ut[t])||at(l[t]):ut[t]&&ut[t][e]||l[t]&&l[t][e]},dt=Math.ceil,It=Math.floor,gt=function(t){return isNaN(t=+t)?0:(t>0?It:dt)(t)},ft=Math.min,pt=function(t){return t>0?ft(gt(t),9007199254740991):0},yt=Math.max,ht=Math.min,bt=function(t){return function(e,n,i){var r,o=U(e),c=pt(o.length),s=function(t,e){var n=gt(t);return n<0?yt(n+e,0):ht(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)},Bt=mt.indexOf,Ft=function(t,e){var n,i=U(t),r=0,o=[];for(n in i)!V(q,n)&&V(i,n)&&o.push(n);for(;e.length>r;)V(i,n=e[r++])&&(~Bt(o,n)||o.push(n));return o},Ut=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ct=Ut.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(t){return Ft(t,Ct)}},St={f:Object.getOwnPropertySymbols},Vt=lt("Reflect","ownKeys")||function(t){var e=vt.f(Q(t)),n=St.f;return n?e.concat(n(t)):e},Xt=function(t,e){for(var n=Vt(e),i=J.f,r=A.f,o=0;o<n.length;o++){var c=n[o];V(t,c)||i(t,c,r(e,c))}},Zt=/#|\.prototype\./,Gt=function(t,e){var n=Rt[wt(t)];return n==Qt||n!=At&&("function"==typeof e?d(e):!!e)},wt=Gt.normalize=function(t){return String(t).replace(Zt,".").toLowerCase()},Rt=Gt.data={},At=Gt.NATIVE="N",Qt=Gt.POLYFILL="P",xt=Gt,Jt=A.f,Wt=function(t,e){var n,i,r,o,c,s=t.target,u=t.global,a=t.stat;if(n=u?l:a?l[s]||L(s,{}):(l[s]||{}).prototype)for(i in e){if(o=e[i],r=t.noTargetGet?(c=Jt(n,i))&&c.value:n[i],!xt(u?i:s+(a?".":"#")+i,t.forced)&&void 0!==r){if(typeof o==typeof r)continue;Xt(o,r)}(t.sham||r&&r.sham)&&W(o,"sham",!0),st(n,i,o,t)}},Lt=!!Object.getOwnPropertySymbols&&!d((function(){return!String(Symbol())})),Ht=Lt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,kt=_("wks"),Tt=l.Symbol,Et=Ht?Tt:Tt&&Tt.withoutSetter||D,Yt=function(t){return V(kt,t)||(Lt&&V(Tt,t)?kt[t]=Tt[t]:kt[t]=Et("Symbol."+t)),kt[t]},Nt=Yt("match"),Kt=function(t){if(function(t){var e;return C(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"),_t=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Ot]=!1,"/./"[t](e)}catch(t){}}return!1},Pt=A.f,zt="".startsWith,Dt=Math.min,jt=_t("startsWith"),Mt=!(jt||(ot=Pt(String.prototype,"startsWith"),!ot||ot.writable));Wt({target:"String",proto:!0,forced:!Mt&&!jt},{startsWith:function(t){var e=String(F(this));Kt(t);var n=pt(Dt(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return zt?zt.call(e,i,n):e.slice(n,n+i.length)===i}});var qt,$t,te,ee=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},ne=function(t,e,n){if(ee(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)}},ie=Function.call,re=function(t,e,n){return ne(ie,l[t].prototype[e],n)},oe=(re("String","startsWith"),function(t){return function(e,n){var i,r,o=String(F(e)),c=gt(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}}),ce={codeAt:oe(!1),charAt:oe(!0)},se=function(t){return Object(F(t))},ue=!d((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),ae=M("IE_PROTO"),le=Object.prototype,de=ue?Object.getPrototypeOf:function(t){return t=se(t),V(t,ae)?t[ae]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?le:null},Ie=Yt("iterator"),ge=!1;[].keys&&("next"in(te=[].keys())?($t=de(de(te)))!==Object.prototype&&(qt=$t):ge=!0),null==qt&&(qt={}),V(qt,Ie)||W(qt,Ie,(function(){return this}));var fe,pe={IteratorPrototype:qt,BUGGY_SAFARI_ITERATORS:ge},ye=Object.keys||function(t){return Ft(t,Ut)},he=I?Object.defineProperties:function(t,e){Q(t);for(var n,i=ye(e),r=i.length,o=0;r>o;)J.f(t,n=i[o++],e[n]);return t},be=lt("document","documentElement"),me=M("IE_PROTO"),Be=function(){},Fe=function(t){return"<script>"+t+"<\/script>"},Ue=function(){try{fe=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;Ue=fe?function(t){t.write(Fe("")),t.close();var e=t.parentWindow.Object;return t=null,e}(fe):((e=G("iframe")).style.display="none",be.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Fe("document.F=Object")),t.close(),t.F);for(var n=Ut.length;n--;)delete Ue.prototype[Ut[n]];return Ue()};q[me]=!0;var Ce=Object.create||function(t,e){var n;return null!==t?(Be.prototype=Q(t),n=new Be,Be.prototype=null,n[me]=t):n=Ue(),void 0===e?n:he(n,e)},ve=J.f,Se=Yt("toStringTag"),Ve=function(t,e,n){t&&!V(t=n?t:t.prototype,Se)&&ve(t,Se,{configurable:!0,value:e})},Xe={},Ze=pe.IteratorPrototype,Ge=function(){return this},we=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return Q(n),function(t){if(!C(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),Re=pe.IteratorPrototype,Ae=pe.BUGGY_SAFARI_ITERATORS,Qe=Yt("iterator"),xe=function(){return this},Je=function(t,e,n,i,r,o,c){!function(t,e,n){var i=e+" Iterator";t.prototype=Ce(Ze,{next:y(1,n)}),Ve(t,i,!1),Xe[i]=Ge}(n,e,i);var s,u,a,l=function(t){if(t===r&&p)return p;if(!Ae&&t in g)return g[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",I=!1,g=t.prototype,f=g[Qe]||g["@@iterator"]||r&&g[r],p=!Ae&&f||l(r),h="Array"==e&&g.entries||f;if(h&&(s=de(h.call(new t)),Re!==Object.prototype&&s.next&&(de(s)!==Re&&(we?we(s,Re):"function"!=typeof s[Qe]&&W(s,Qe,xe)),Ve(s,d,!0))),"values"==r&&f&&"values"!==f.name&&(I=!0,p=function(){return f.call(this)}),g[Qe]!==p&&W(g,Qe,p),Xe[e]=p,r)if(u={values:l("values"),keys:o?p:l("keys"),entries:l("entries")},c)for(a in u)(Ae||I||!(a in g))&&st(g,a,u[a]);else Wt({target:e,proto:!0,forced:Ae||I},u);return u},We=ce.charAt,Le=ct.set,He=ct.getterFor("String Iterator");Je(String,"String",(function(t){Le(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=He(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=We(n,i),e.index+=t.length,{value:t,done:!1})}));var ke=function(t,e,n,i){try{return i?e(Q(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&Q(r.call(t)),e}},Te=Yt("iterator"),Ee=Array.prototype,Ye=function(t){return void 0!==t&&(Xe.Array===t||Ee[Te]===t)},Ne=function(t,e,n){var i=v(e);i in t?J.f(t,i,y(0,n)):t[i]=n},Ke={};Ke[Yt("toStringTag")]="z";var Oe="[object z]"===String(Ke),_e=Yt("toStringTag"),Pe="Arguments"==b(function(){return arguments}()),ze=Oe?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),_e))?n:Pe?b(e):"Object"==(i=b(e))&&"function"==typeof e.callee?"Arguments":i},De=Yt("iterator"),je=function(t){if(null!=t)return t[De]||t["@@iterator"]||Xe[ze(t)]},Me=Yt("iterator"),qe=!1;try{var $e=0,tn={next:function(){return{done:!!$e++}},return:function(){qe=!0}};tn[Me]=function(){return this},Array.from(tn,(function(){throw 2}))}catch(t){}var en=function(t,e){if(!e&&!qe)return!1;var n=!1;try{var i={};i[Me]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n},nn=!en((function(t){Array.from(t)}));Wt({target:"Array",stat:!0,forced:nn},{from:function(t){var e,n,i,r,o,c,s=se(t),u="function"==typeof this?this:Array,a=arguments.length,l=a>1?arguments[1]:void 0,d=void 0!==l,I=je(s),g=0;if(d&&(l=ne(l,a>2?arguments[2]:void 0,2)),null==I||u==Array&&Ye(I))for(n=new u(e=pt(s.length));e>g;g++)c=d?l(s[g],g):s[g],Ne(n,g,c);else for(o=(r=I.call(s)).next,n=new u;!(i=o.call(r)).done;g++)c=d?ke(r,l,[i.value,g],!0):i.value,Ne(n,g,c);return n.length=g,n}});ut.Array.from;var rn,on="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,cn=J.f,sn=l.Int8Array,un=sn&&sn.prototype,an=l.Uint8ClampedArray,ln=an&&an.prototype,dn=sn&&de(sn),In=un&&de(un),gn=Object.prototype,fn=gn.isPrototypeOf,pn=Yt("toStringTag"),yn=D("TYPED_ARRAY_TAG"),hn=on&&!!we&&"Opera"!==ze(l.opera),bn={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},mn=function(t){return C(t)&&V(bn,ze(t))};for(rn in bn)l[rn]||(hn=!1);if((!hn||"function"!=typeof dn||dn===Function.prototype)&&(dn=function(){throw TypeError("Incorrect invocation")},hn))for(rn in bn)l[rn]&&we(l[rn],dn);if((!hn||!In||In===gn)&&(In=dn.prototype,hn))for(rn in bn)l[rn]&&we(l[rn].prototype,In);if(hn&&de(ln)!==In&&we(ln,In),I&&!V(In,pn))for(rn in!0,cn(In,pn,{get:function(){return C(this)?this[yn]:void 0}}),bn)l[rn]&&W(l[rn],yn,rn);var Bn=function(t){if(mn(t))return t;throw TypeError("Target is not a typed array")},Fn=function(t){if(we){if(fn.call(dn,t))return t}else for(var e in bn)if(V(bn,rn)){var n=l[e];if(n&&(t===n||fn.call(n,t)))return t}throw TypeError("Target is not a typed array constructor")},Un=function(t,e,n){if(I){if(n)for(var i in bn){var r=l[i];r&&V(r.prototype,t)&&delete r.prototype[t]}In[t]&&!n||st(In,t,n?e:hn&&un[t]||e)}},Cn=Yt("species"),vn=Bn,Sn=Fn,Vn=[].slice;Un("slice",(function(t,e){for(var n=Vn.call(vn(this),t,e),i=function(t,e){var n,i=Q(t).constructor;return void 0===i||null==(n=Q(i)[Cn])?e:ee(n)}(this,this.constructor),r=0,o=n.length,c=new(Sn(i))(o);o>r;)c[r]=n[r++];return c}),d((function(){new Int8Array(1).slice()})));var Xn=Yt("unscopables"),Zn=Array.prototype;null==Zn[Xn]&&J.f(Zn,Xn,{configurable:!0,value:Ce(null)});var Gn=function(t){Zn[Xn][t]=!0},wn=Object.defineProperty,Rn={},An=function(t){throw t},Qn=mt.includes,xn=function(t,e){if(V(Rn,t))return Rn[t];e||(e={});var n=[][t],i=!!V(e,"ACCESSORS")&&e.ACCESSORS,r=V(e,0)?e[0]:An,o=V(e,1)?e[1]:void 0;return Rn[t]=!!n&&!d((function(){if(i&&!I)return!0;var t={length:-1};i?wn(t,1,{enumerable:!0,get:An}):t[1]=1,n.call(t,r,o)}))}("indexOf",{ACCESSORS:!0,1:0});Wt({target:"Array",proto:!0,forced:!xn},{includes:function(t){return Qn(this,t,arguments.length>1?arguments[1]:void 0)}}),Gn("includes");re("Array","includes");Wt({target:"String",proto:!0,forced:!_t("includes")},{includes:function(t){return!!~String(F(this)).indexOf(Kt(t),arguments.length>1?arguments[1]:void 0)}});re("String","includes");var Jn=!d((function(){return Object.isExtensible(Object.preventExtensions({}))})),Wn=u((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(!C(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!V(t,n)){if(!r(t))return"F";if(!e)return"E";o(t)}return t[n].objectID},getWeakData:function(t,e){if(!V(t,n)){if(!r(t))return!0;if(!e)return!1;o(t)}return t[n].weakData},onFreeze:function(t){return Jn&&c.REQUIRED&&r(t)&&!V(t,n)&&o(t),t}};q[n]=!0})),Ln=(Wn.REQUIRED,Wn.fastKey,Wn.getWeakData,Wn.onFreeze,u((function(t){var e=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,n,i,r,o){var c,s,u,a,l,d,I,g=ne(n,i,r?2:1);if(o)c=t;else{if("function"!=typeof(s=je(t)))throw TypeError("Target is not iterable");if(Ye(s)){for(u=0,a=pt(t.length);a>u;u++)if((l=r?g(Q(I=t[u])[0],I[1]):g(t[u]))&&l instanceof e)return l;return new e(!1)}c=s.call(t)}for(d=c.next;!(I=d.call(c)).done;)if("object"==typeof(l=ke(c,g,I.value,r))&&l&&l instanceof e)return l;return new e(!1)}).stop=function(t){return new e(!0,t)}}))),Hn=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},kn=function(t,e,n){for(var i in e)st(t,i,e[i],n);return t},Tn=Yt("species"),En=J.f,Yn=Wn.fastKey,Nn=ct.set,Kn=ct.getterFor,On=(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,u=c,a={},I=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&&!C(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return r&&!C(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!C(t))&&e.call(this,0===t?0:t)}:function(t,n){return e.call(this,0===t?0:t,n),this})};if(xt(t,"function"!=typeof c||!(r||s.forEach&&!d((function(){(new c).entries().next()})))))u=n.getConstructor(e,t,i,o),Wn.REQUIRED=!0;else if(xt(t,!0)){var g=new u,f=g[o](r?{}:-0,1)!=g,p=d((function(){g.has(1)})),y=en((function(t){new c(t)})),h=!r&&d((function(){for(var t=new c,e=5;e--;)t[o](e,e);return!t.has(-0)}));y||((u=e((function(e,n){Hn(e,u,t);var r=function(t,e,n){var i,r;return we&&"function"==typeof(i=e.constructor)&&i!==n&&C(r=i.prototype)&&r!==n.prototype&&we(t,r),t}(new c,e,u);return null!=n&&Ln(n,r[o],r,i),r}))).prototype=s,s.constructor=u),(p||h)&&(I("delete"),I("has"),i&&I("get")),(h||f)&&I(o),r&&s.clear&&delete s.clear}a[t]=u,Wt({global:!0,forced:u!=c},a),Ve(u,t),r||n.setStrong(u,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){Hn(t,r,e),Nn(t,{type:e,index:Ce(null),first:void 0,last:void 0,size:0}),I||(t.size=0),null!=o&&Ln(o,t[i],t,n)})),o=Kn(e),c=function(t,e,n){var i,r,c=o(t),u=s(t,e);return u?u.value=n:(c.last=u={index:r=Yn(e,!0),key:e,value:n,previous:i=c.last,next:void 0,removed:!1},c.first||(c.first=u),i&&(i.next=u),I?c.size++:t.size++,"F"!==r&&(c.index[r]=u)),t},s=function(t,e){var n,i=o(t),r=Yn(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return kn(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,I?t.size=0:this.size=0},delete:function(t){var e=o(this),n=s(this,t);if(n){var i=n.next,r=n.previous;delete e.index[n.index],n.removed=!0,r&&(r.next=i),i&&(i.previous=r),e.first==n&&(e.first=i),e.last==n&&(e.last=r),I?e.size--:this.size--}return!!n},forEach:function(t){for(var e,n=o(this),i=ne(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)}}),kn(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)}}),I&&En(r.prototype,"size",{get:function(){return o(this).size}}),r},setStrong:function(t,e,n){var i=e+" Iterator",r=Kn(e),o=Kn(i);Je(t,e,(function(t,e){Nn(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;I&&e&&!e[Tn]&&n(e,Tn,{configurable:!0,get:function(){return this}})}(e)}}),Oe?{}.toString:function(){return"[object "+ze(this)+"]"});Oe||st(Object.prototype,"toString",On,{unsafe:!0});var _n={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},Pn=ct.set,zn=ct.getterFor("Array Iterator"),Dn=Je(Array,"Array",(function(t,e){Pn(this,{type:"Array Iterator",target:U(t),index:0,kind:e})}),(function(){var t=zn(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");Xe.Arguments=Xe.Array,Gn("keys"),Gn("values"),Gn("entries");var jn=Yt("iterator"),Mn=Yt("toStringTag"),qn=Dn.values;for(var $n in _n){var ti=l[$n],ei=ti&&ti.prototype;if(ei){if(ei[jn]!==qn)try{W(ei,jn,qn)}catch(t){ei[jn]=qn}if(ei[Mn]||W(ei,Mn,$n),_n[$n])for(var ni in Dn)if(ei[ni]!==Dn[ni])try{W(ei,ni,Dn[ni])}catch(t){ei[ni]=Dn[ni]}}}ut.Set;function ii(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))}var ri=setTimeout;function oi(t){return Boolean(t&&void 0!==t.length)}function ci(){}function si(t){if(!(this instanceof si))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=[],gi(t,this)}function ui(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,si._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 li(e.promise,t)}ai(e.promise,i)}else(1===t._state?ai:li)(e.promise,t._value)}))):t._deferreds.push(e)}function ai(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 si)return t._state=3,t._value=e,void di(t);if("function"==typeof n)return void gi((i=n,r=e,function(){i.apply(r,arguments)}),t)}t._state=1,t._value=e,di(t)}catch(e){li(t,e)}var i,r}function li(t,e){t._state=2,t._value=e,di(t)}function di(t){2===t._state&&0===t._deferreds.length&&si._immediateFn((function(){t._handled||si._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)ui(t,t._deferreds[e]);t._deferreds=null}function Ii(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function gi(t,e){var n=!1;try{t((function(t){n||(n=!0,ai(e,t))}),(function(t){n||(n=!0,li(e,t))}))}catch(t){if(n)return;n=!0,li(e,t)}}si.prototype.catch=function(t){return this.then(null,t)},si.prototype.then=function(t,e){var n=new this.constructor(ci);return ui(this,new Ii(t,e,n)),n},si.prototype.finally=ii,si.all=function(t){return new si((function(e,n){if(!oi(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])}))},si.resolve=function(t){return t&&"object"==typeof t&&t.constructor===si?t:new si((function(e){e(t)}))},si.reject=function(t){return new si((function(e,n){n(t)}))},si.race=function(t){return new si((function(e,n){if(!oi(t))return n(new TypeError("Promise.race accepts an array"));for(var i=0,r=t.length;i<r;i++)si.resolve(t[i]).then(e,n)}))},si._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){ri(t,0)},si._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var fi=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();"Promise"in fi?fi.Promise.prototype.finally||(fi.Promise.prototype.finally=ii):fi.Promise=si,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 u=63&t[e++];i[o++]=(31&c)<<12|s<<6|u}else if(240==(248&c)){65535<(c=(7&c)<<18|(s=63&t[e++])<<12|(u=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){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e,n){return(s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=i(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}var u=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}(),a=function(e){function c(){var e;return t(this,c),(e=function(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?o(t):e}(this,i(c).call(this))).listeners||u.call(o(e)),Object.defineProperty(o(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(o(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return function(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&&r(t,e)}(c,e),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)),s(i(c.prototype),"dispatchEvent",this).call(this,t)}}]),c}(u),l=function(){function e(){t(this,e),Object.defineProperty(this,"signal",{value:new a,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}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(l.prototype[Symbol.toStringTag]="AbortController",a.prototype[Symbol.toStringTag]="AbortSignal"),function(t){(function(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})(t)&&(t.AbortController=l,t.AbortSignal=a)}("undefined"!=typeof self?self:c)}();var pi=u((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(pi);var yi=s(u((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{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){t.done?r(t.value):new n((function(e){e(t.value)})).then(c,s)}u((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});function r(t){return new Promise((function(e){return setTimeout(e,t)}))}function o(t){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",i=0;i<t;i++){n+=e[Math.floor(Math.random()*e.length)]}return n}var s=function(){function t(){this.acquiredIatSet=new Set,this.id=Date.now().toString()+o(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,s,u,a,l,d;return i(this,(function(i){switch(i.label){case 0:n=Date.now()+o(4),s=Date.now()+c,u="browser-tabs-lock-key-"+e,a=window.localStorage,i.label=1;case 1:return Date.now()<s?[4,r(30)]:[3,8];case 2:return i.sent(),null!==a.getItem(u)?[3,5]:(l=this.id+"-"+e+"-"+n,[4,r(Math.floor(25*Math.random()))]);case 3:return i.sent(),a.setItem(u,JSON.stringify({id:this.id,iat:n,timeoutKey:l,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,r(30)];case 4:return i.sent(),null!==(d=a.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 t.lockCorrector(),[4,this.waitForSomethingToChange(s)];case 6:i.sent(),i.label=7;case 7:return n=Date.now()+o(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,pi.default().lock(e)];case 1:return i.sent(),this.acquiredIatSet.has(e)?(n=window.localStorage,null===(r=n.getItem(t))?(pi.default().unlock(e),[2]):((r=JSON.parse(r)).timeRefreshed=Date.now(),n.setItem(t,JSON.stringify(r)),pi.default().unlock(e),this.refreshLockWhileAcquired(t,e),[2])):(pi.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,r,o;return i(this,(function(i){switch(i.label){case 0:return n=window.localStorage,r="browser-tabs-lock-key-"+e,null===(o=n.getItem(r))?[2]:(o=JSON.parse(o)).id!==this.id?[3,2]:[4,pi.default().lock(o.iat)];case 1:i.sent(),this.acquiredIatSet.delete(o.iat),n.removeItem(r),pi.default().unlock(o.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),r=!1,o=0;o<i.length;o++){var c=i[o];if(c.includes("browser-tabs-lock-key")){var s=n.getItem(c);null!==s&&(void 0===(s=JSON.parse(s)).timeRefreshed&&s.timeAcquired<e||void 0!==s.timeRefreshed&&s.timeRefreshed<e)&&(n.removeItem(c),r=!0)}}r&&t.notifyWaiters()},t.waiters=void 0,t}();e.default=s})));var hi={timeoutInSeconds:60},bi=["login_required","consent_required","interaction_required","account_selection_required","access_denied"],mi={error:"timeout",error_description:"Timeout"},Bi=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=function(){window.document.body.contains(o)&&window.document.body.removeChild(o)},s=setTimeout((function(){r(mi),c()}),1e3*n),u=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(t.data.response):i(t.data.response),clearTimeout(s),window.removeEventListener("message",u,!1),setTimeout(c,2e3)}};window.addEventListener("message",u,!1),window.document.body.appendChild(o),o.setAttribute("src",t)}))},Fi=function(t,e){var i,r,o,c=e.popup;if(c?c.location.href=t:(i=t,r=window.screenX+(window.innerWidth-400)/2,o=window.screenY+(window.innerHeight-600)/2,c=window.open(i,"auth:authorize:popup","left="+r+",top="+o+",width=400,height=600,resizable,scrollbars=yes,status=1")),!c)throw new Error("Could not open popup");return new Promise((function(t,i){var r=setTimeout((function(){i(n(n({},mi),{popup:c}))}),1e3*(e.timeoutInSeconds||60));window.addEventListener("message",(function(e){if(e.data&&"authorization_response"===e.data.type){if(clearTimeout(r),c.close(),e.data.response.error)return i(e.data.response);t(e.data.response)}}))}))},Ui=function(){var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.",e="";return Array.from(Ai().getRandomValues(new Uint8Array(43))).forEach((function(n){return e+=t[n%t.length]})),e},Ci=function(t){return btoa(t)},vi=function(t){return Object.keys(t).filter((function(e){return void 0!==t[e]})).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")},Si=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=Qi().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()]}}))}))},Vi=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,"+"))},Xi=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))))},Zi=function(t,e,i,c){return r(void 0,void 0,void 0,(function(){var r,s;return o(this,(function(o){switch(o.label){case 0:return c?(delete e.signal,[2,(l=n({url:t,timeout:i},e),d=c,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)},d.postMessage(l,[n.port2])})))]):[3,1];case 1:return[4,(u=t,a=e,a=a||{},new Promise((function(t,e){var n=new XMLHttpRequest,i=[],r=[],o={},c=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(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:c,headers:{keys:function(){return i},entries:function(){return r},get:function(t){return o[t.toLowerCase()]},has:function(t){return t.toLowerCase()in o}}}};for(var s in n.open(a.method||"get",u,!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]),o[e]=o[e]?o[e]+","+n:n})),t(c())},n.onerror=e,n.withCredentials="include"==a.credentials,a.headers)n.setRequestHeader(s,a.headers[s]);n.send(a.body||null)})))];case 2:return r=o.sent(),s={ok:r.ok},[4,r.json()];case 3:return[2,(s.json=o.sent(),s)]}var u,a,l,d}))}))},Gi=function(t,e,i,r){void 0===r&&(r=1e4);var o,c=new AbortController,s=c.signal,u=n(n({},e),{signal:s});return Promise.race([Zi(t,u,r,i),new Promise((function(t,e){o=setTimeout((function(){c.abort(),e(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((function(){clearTimeout(o)}))},wi=function(t,e,n,c){return r(void 0,void 0,void 0,(function(){var r,s,u,a,l,d,I,g,f,p;return o(this,(function(o){switch(o.label){case 0:u=0,o.label=1;case 1:if(!(u<3))return[3,6];o.label=2;case 2:return o.trys.push([2,4,,5]),[4,Gi(t,n,c,e)];case 3:return s=o.sent(),r=null,[3,6];case 4:return a=o.sent(),r=a,[3,5];case 5:return u++,[3,1];case 6:if(r)throw r;if(l=s.json,d=l.error,I=l.error_description,g=i(l,["error","error_description"]),!s.ok)throw f=I||"HTTP error. Unable to fetch "+t,(p=new Error(f)).error=d||"request_error",p.error_description=f,p;return[2,g]}}))}))},Ri=function(t,e){return r(void 0,void 0,void 0,(function(){var r=t.baseUrl,c=t.timeout,s=i(t,["baseUrl","timeout"]);return o(this,(function(t){switch(t.label){case 0:return[4,wi(r+"/authenticate/oauth/token",c,{method:"POST",body:JSON.stringify(n({redirect_uri:window.location.origin},s)),headers:{"Content-type":"application/json"}},e)];case 1:return[2,t.sent()]}}))}))},Ai=function(){return window.crypto||window.msCrypto},Qi=function(){var t=Ai();return t.subtle||t.webkitSubtle},xi=function(t){return Array.from(new Set(t))},Ji=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xi(t.join(" ").trim().split(/\s+/)).join(" ")},Wi=function(t){return"@@authspajs@@::"+t.client_id+"::"+t.audience+"::"+t.scope},Li=function(t){return{body:t,expiresAt:Math.floor(Date.now()/1e3)+t.expires_in}},Hi=function(){function t(){}return t.prototype.save=function(t){var e=Wi(t),n=Li(t);window.localStorage.setItem(e,JSON.stringify(n))},t.prototype.get=function(t,e){void 0===e&&(e=0);var n=Wi(t),i=this.readJson(n),r=Math.floor(Date.now()/1e3);if(i){if(!(i.expiresAt-e<r))return i.body;if(i.body.refresh_token){var o=this.stripData(i);return this.writeJson(n,o),o.body}localStorage.removeItem(n)}},t.prototype.clear=function(){for(var t=localStorage.length-1;t>=0;t--)localStorage.key(t).startsWith("@@authspajs@@")&&localStorage.removeItem(localStorage.key(t))},t.prototype.readJson=function(t){var e,n=window.localStorage.getItem(t);if(n&&(e=JSON.parse(n)))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}(),ki=function(){this.enclosedCache=function(){var t={body:{},expiresAt:0};return{save:function(e){var n=Wi(e),i=Li(e);t[n]=i},get:function(e,n){void 0===n&&(n=0);var i=Wi(e),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[i]:r.body},clear:function(){t={body:{},expiresAt:0}}}}()},Ti=u((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 u(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=u,e.remove=function(t,e){u(t,"",n(n({},e),{expires:-1}))}}));s(Ti);Ti.encode,Ti.parse;var Ei=Ti.getAll,Yi=Ti.get,Ni=Ti.set,Ki=Ti.remove,Oi=function(t){var e=Yi(t);if(void 0!==e)return JSON.parse(e)},_i=function(t,e,n){var i={};"https:"===window.location.protocol&&(i={secure:!0,sameSite:"none"}),i.expires=n.daysUntilExpire,Ni(t,JSON.stringify(e),i)},Pi=function(t){Ki(t)},zi=function(t){return"uauth.spajs.txs."+t},Di=function(){function t(){var t=this;this.transactions={},"undefined"!=typeof window&&Object.keys(Ei()||{}).filter((function(t){return t.startsWith("uauth.spajs.txs.")})).forEach((function(e){var n=e.replace("uauth.spajs.txs.","");t.transactions[n]=Oi(e)}))}return t.prototype.create=function(t,e){this.transactions[t]=e,_i(zi(t),e,{daysUntilExpire:1})},t.prototype.get=function(t){return this.transactions[t]},t.prototype.remove=function(t){delete this.transactions[t],Pi(zi(t))},t}(),ji=function(t){return"number"==typeof t},Mi=["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"],qi=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(Vi(i)),c={__raw:t},s={};return Object.keys(o).forEach((function(t){c[t]=o[t],Mi.includes(t)||(s[t]=o[t])})),{encoded:{header:n,payload:i,signature:r},header:JSON.parse(Vi(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 (a