@livechat/accounts-sdk 2.0.10 → 2.1.1

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.
@@ -1,15 +1,15 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("util")):"function"==typeof define&&define.amd?define(["util"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).AccountsSDK=e(t.require$$0)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(t),n={extend:function(t){return t.oauth_exception&&this.oauth_exception[t.oauth_exception]?Object.assign(t,{description:this.oauth_exception[t.oauth_exception]}):t.identity_exception&&this.identity_exception[t.identity_exception]?Object.assign(t,{description:this.identity_exception[t.identity_exception]}):t},oauth_exception:{invalid_request:"You may be loading accounts-sdk on a domain that is not whitelisted.",unauthorized_client:"Client not found, not provided or incorectly configured.",access_denied:"Probably this application is installed on a different account and you do not have access to it.",unsupported_response_type:"Provided response type is incorrect or unavailable for a given client."},identity_exception:{unauthorized:"Resource owner identity is not known or consent is missing."}};class o{constructor(t={}){this.options=t,this.listening=!1,this.receiveMessage=this.receiveMessage.bind(this)}start(t,e){this._listenerInited||(this.listening=!0,this.callback=e,t&&(this.tid=setTimeout((()=>{this.stop(),e("timeout",null)}),t)),window.addEventListener("message",this.receiveMessage))}stop(){this.listening=!1,clearTimeout(this.tid),window.removeEventListener("message",this.receiveMessage,!1)}receiveMessage(t){t.origin!==this.options.server_url&&t.origin!==this.options.server_url.replace(/livechat\.com$/,"livechatinc.com")||(t.data.data||t.data.error)&&(this.stop(),t.data.error?this.callback(n.extend(t.data.error),null):(t.data.data.scopes&&(t.data.data.scope=t.data.data.scopes,delete t.data.data.scopes),t.data.data.expires_in&&(t.data.data.expires_in=parseInt(t.data.data.expires_in)||0),this.callback(null,t.data.data)))}}class i{constructor(t,e){this.options=e,this.sdk=t}authorize(){return new Promise(((t,e)=>{const r=this.sdk.authorizeURL(this.options,"button"),n=window.screen.width/2-250,i=window.screen.height/2-325;new o(this.options).start(null,((r,n)=>{if(r)return e(r);t(n)}));var a=function(){window.open(r,"livechat-login-popup","resizable,scrollbars,width=".concat(500,",height=").concat(650,",left=").concat(n,",top=").concat(i))};document.requestStorageAccess?document.requestStorageAccess().then(a,a):a()}))}}var a,c="undefined"!=typeof Symbol&&Symbol,s={foo:{}},l=Object,p=Object.prototype.toString,u=Math.max,f=function(t,e){for(var r=[],n=0;n<t.length;n+=1)r[n]=t[n];for(var o=0;o<e.length;o+=1)r[o+t.length]=e[o];return r},y=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==p.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,n=function(t,e){for(var r=[],n=e||0,o=0;n<t.length;n+=1,o+=1)r[o]=t[n];return r}(arguments,1),o=u(0,e.length-n.length),i=[],a=0;a<o;a++)i[a]="$"+a;if(r=Function("binder","return function ("+function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r}(i,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var o=e.apply(this,f(n,arguments));return Object(o)===o?o:this}return e.apply(t,f(n,arguments))})),e.prototype){var c=function(){};c.prototype=e.prototype,r.prototype=new c,c.prototype=null}return r},h=Function.prototype.call,d=Object.prototype.hasOwnProperty,g=y.call(h,d),m=SyntaxError,b=Function,v=TypeError,w=function(t){try{return b('"use strict"; return ('+t+").constructor;")()}catch(t){}},S=Object.getOwnPropertyDescriptor;if(S)try{S({},"")}catch(t){S=null}var _=function(){throw new v},A=S?function(){try{return _}catch(t){try{return S(arguments,"callee").get}catch(t){return _}}}():_,j="function"==typeof c&&"function"==typeof Symbol&&"symbol"==typeof c("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}(),O={__proto__:s}.foo===s.foo&&!({__proto__:null}instanceof l),P=Object.getPrototypeOf||(O?function(t){return t.__proto__}:null),x={},k="undefined"!=typeof Uint8Array&&P?P(Uint8Array):a,I={"%AggregateError%":"undefined"==typeof AggregateError?a:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?a:ArrayBuffer,"%ArrayIteratorPrototype%":j&&P?P([][Symbol.iterator]()):a,"%AsyncFromSyncIteratorPrototype%":a,"%AsyncFunction%":x,"%AsyncGenerator%":x,"%AsyncGeneratorFunction%":x,"%AsyncIteratorPrototype%":x,"%Atomics%":"undefined"==typeof Atomics?a:Atomics,"%BigInt%":"undefined"==typeof BigInt?a:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?a:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?a:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?a:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?a:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?a:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?a:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":x,"%Int8Array%":"undefined"==typeof Int8Array?a:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?a:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?a:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":j&&P?P(P([][Symbol.iterator]())):a,"%JSON%":"object"==typeof JSON?JSON:a,"%Map%":"undefined"==typeof Map?a:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&j&&P?P((new Map)[Symbol.iterator]()):a,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?a:Promise,"%Proxy%":"undefined"==typeof Proxy?a:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?a:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?a:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&j&&P?P((new Set)[Symbol.iterator]()):a,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?a:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":j&&P?P(""[Symbol.iterator]()):a,"%Symbol%":j?Symbol:a,"%SyntaxError%":m,"%ThrowTypeError%":A,"%TypedArray%":k,"%TypeError%":v,"%Uint8Array%":"undefined"==typeof Uint8Array?a:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?a:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?a:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?a:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?a:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?a:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?a:WeakSet};if(P)try{null.error}catch(t){var E=P(P(t));I["%Error.prototype%"]=E}var R=function t(e){var r;if("%AsyncFunction%"===e)r=w("async function () {}");else if("%GeneratorFunction%"===e)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&P&&(r=P(o.prototype))}return I[e]=r,r},U={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=y.call(Function.call,Array.prototype.concat),F=y.call(Function.apply,Array.prototype.splice),M=y.call(Function.call,String.prototype.replace),D=y.call(Function.call,String.prototype.slice),C=y.call(Function.call,RegExp.prototype.exec),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,B=/\\(\\)?/g,L=function(t,e){var r,n=t;if(g(U,n)&&(n="%"+(r=U[n])[0]+"%"),g(I,n)){var o=I[n];if(o===x&&(o=R(n)),void 0===o&&!e)throw new v("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new m("intrinsic "+t+" does not exist!")},W=function(t,e){if("string"!=typeof t||0===t.length)throw new v("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new v('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,t))throw new m("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=D(t,0,1),r=D(t,-1);if("%"===e&&"%"!==r)throw new m("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new m("invalid intrinsic syntax, expected opening `%`");var n=[];return M(t,T,(function(t,e,r,o){n[n.length]=r?M(o,B,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=L("%"+n+"%",e),i=o.name,a=o.value,c=!1,s=o.alias;s&&(n=s[0],F(r,N([0,1],s)));for(var l=1,p=!0;l<r.length;l+=1){var u=r[l],f=D(u,0,1),y=D(u,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new m("property names with quotes must have matching quotes");if("constructor"!==u&&p||(c=!0),g(I,i="%"+(n+="."+u)+"%"))a=I[i];else if(null!=a){if(!(u in a)){if(!e)throw new v("base intrinsic for "+t+" exists, but the property is not available.");return}if(S&&l+1>=r.length){var h=S(a,u);a=(p=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[u]}else p=g(a,u),a=a[u];p&&!c&&(I[i]=a)}}return a},z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function q(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var $=W("%Object.defineProperty%",!0),G=function(){if($)try{return $({},"a",{value:1}),!0}catch(t){return!1}return!1};G.hasArrayLengthDefineBug=function(){if(!G())return null;try{return 1!==$([],"length",{value:1}).length}catch(t){return!0}};var H=G,V=W("%Object.getOwnPropertyDescriptor%",!0);if(V)try{V([],"length")}catch(t){V=null}var J=V,Q=H()&&W("%Object.defineProperty%",!0);if(Q)try{Q({},"a",{value:1})}catch(t){Q=!1}var Y=W("%SyntaxError%"),K=W("%TypeError%"),Z=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new K("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new K("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new K("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new K("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new K("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new K("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6&&arguments[6],c=!!J&&J(t,e);if(Q)Q(t,e,{configurable:null===i&&c?c.configurable:!i,enumerable:null===n&&c?c.enumerable:!n,value:r,writable:null===o&&c?c.writable:!o});else{if(!a&&(n||o||i))throw new Y("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}},X=H(),tt=W("%TypeError%"),et=W("%Math.floor%"),rt=q((function(t){var e=W("%TypeError%"),r=W("%Function.prototype.apply%"),n=W("%Function.prototype.call%"),o=W("%Reflect.apply%",!0)||y.call(n,r),i=W("%Object.defineProperty%",!0),a=W("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){if("function"!=typeof t)throw new e("a function is required");return function(t,e){if("function"!=typeof t)throw new tt("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||et(e)!==e)throw new tt("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&J){var i=J(t,"length");i&&!i.configurable&&(n=!1),i&&!i.writable&&(o=!1)}return(n||o||!r)&&(X?Z(t,"length",e,!0,!0):Z(t,"length",e)),t}(o(y,n,arguments),1+a(0,t.length-(arguments.length-1)),!0)};var c=function(){return o(y,r,arguments)};i?i(t.exports,"apply",{value:c}):t.exports.apply=c})),nt=rt(W("String.prototype.indexOf")),ot=function(t,e){var r=W(t,!!e);return"function"==typeof r&&nt(t,".prototype.")>-1?rt(r):r},it=r.default.inspect,at="function"==typeof Map&&Map.prototype,ct=Object.getOwnPropertyDescriptor&&at?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,st=at&&ct&&"function"==typeof ct.get?ct.get:null,lt=at&&Map.prototype.forEach,pt="function"==typeof Set&&Set.prototype,ut=Object.getOwnPropertyDescriptor&&pt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ft=pt&&ut&&"function"==typeof ut.get?ut.get:null,yt=pt&&Set.prototype.forEach,ht="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,dt="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,gt="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,mt=Boolean.prototype.valueOf,bt=Object.prototype.toString,vt=Function.prototype.toString,wt=String.prototype.match,St=String.prototype.slice,_t=String.prototype.replace,At=String.prototype.toUpperCase,jt=String.prototype.toLowerCase,Ot=RegExp.prototype.test,Pt=Array.prototype.concat,xt=Array.prototype.join,kt=Array.prototype.slice,It=Math.floor,Et="function"==typeof BigInt?BigInt.prototype.valueOf:null,Rt=Object.getOwnPropertySymbols,Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Nt="function"==typeof Symbol&&"object"==typeof Symbol.iterator,Ft="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Nt||"symbol")?Symbol.toStringTag:null,Mt=Object.prototype.propertyIsEnumerable,Dt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Ct(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||Ot.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-It(-t):It(t);if(n!==t){var o=String(n),i=St.call(e,o.length+1);return _t.call(o,r,"$&_")+"."+_t.call(_t.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _t.call(e,r,"$&_")}var Tt=it.custom,Bt=Gt(Tt)?Tt:null,Lt=function t(e,r,n,o){var i=r||{};if(Vt(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Vt(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!Vt(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Vt(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Vt(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=i.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Yt(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var s=String(e);return c?Ct(e,s):s}if("bigint"==typeof e){var l=String(e)+"n";return c?Ct(e,l):l}var p=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=p&&p>0&&"object"==typeof e)return qt(e)?"[Array]":"[Object]";var u=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=xt.call(Array(t.indent+1)," ")}return{base:r,prev:xt.call(Array(e+1),r)}}(i,n);if(void 0===o)o=[];else if(Qt(o,e)>=0)return"[Circular]";function f(e,r,a){if(r&&(o=kt.call(o)).push(r),a){var c={depth:i.depth};return Vt(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),t(e,c,n+1,o)}return t(e,i,n+1,o)}if("function"==typeof e&&!$t(e)){var y=function(t){if(t.name)return t.name;var e=wt.call(vt.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),h=re(e,f);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(h.length>0?" { "+xt.call(h,", ")+" }":"")}if(Gt(e)){var d=Nt?_t.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ut.call(e);return"object"!=typeof e||Nt?d:Zt(d)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var g="<"+jt.call(String(e.nodeName)),m=e.attributes||[],b=0;b<m.length;b++)g+=" "+m[b].name+"="+Wt(zt(m[b].value),"double",i);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+jt.call(String(e.nodeName))+">"}if(qt(e)){if(0===e.length)return"[]";var v=re(e,f);return u&&!function(t){for(var e=0;e<t.length;e++)if(Qt(t[e],"\n")>=0)return!1;return!0}(v)?"["+ee(v,u)+"]":"[ "+xt.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}(e)){var w=re(e,f);return"cause"in Error.prototype||!("cause"in e)||Mt.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+xt.call(w,", ")+" }":"{ ["+String(e)+"] "+xt.call(Pt.call("[cause]: "+f(e.cause),w),", ")+" }"}if("object"==typeof e&&a){if(Bt&&"function"==typeof e[Bt]&&it)return it(e,{depth:p-n});if("symbol"!==a&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!st||!t||"object"!=typeof t)return!1;try{st.call(t);try{ft.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var S=[];return lt&&lt.call(e,(function(t,r){S.push(f(r,e,!0)+" => "+f(t,e))})),te("Map",st.call(e),S,u)}if(function(t){if(!ft||!t||"object"!=typeof t)return!1;try{ft.call(t);try{st.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var _=[];return yt&&yt.call(e,(function(t){_.push(f(t,e))})),te("Set",ft.call(e),_,u)}if(function(t){if(!ht||!t||"object"!=typeof t)return!1;try{ht.call(t,ht);try{dt.call(t,dt)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Xt("WeakMap");if(function(t){if(!dt||!t||"object"!=typeof t)return!1;try{dt.call(t,dt);try{ht.call(t,ht)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Xt("WeakSet");if(function(t){if(!gt||!t||"object"!=typeof t)return!1;try{return gt.call(t),!0}catch(t){}return!1}(e))return Xt("WeakRef");if(function(t){return!("[object Number]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}(e))return Zt(f(Number(e)));if(function(t){if(!t||"object"!=typeof t||!Et)return!1;try{return Et.call(t),!0}catch(t){}return!1}(e))return Zt(f(Et.call(e)));if(function(t){return!("[object Boolean]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}(e))return Zt(mt.call(e));if(function(t){return!("[object String]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}(e))return Zt(f(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===z)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}(e)&&!$t(e)){var A=re(e,f),j=Dt?Dt(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",P=!j&&Ft&&Object(e)===e&&Ft in e?St.call(Jt(e),8,-1):O?"Object":"",x=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(P||O?"["+xt.call(Pt.call([],P||[],O||[]),": ")+"] ":"");return 0===A.length?x+"{}":u?x+"{"+ee(A,u)+"}":x+"{ "+xt.call(A,", ")+" }"}return String(e)};function Wt(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function zt(t){return _t.call(String(t),/"/g,"&quot;")}function qt(t){return!("[object Array]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}function $t(t){return!("[object RegExp]"!==Jt(t)||Ft&&"object"==typeof t&&Ft in t)}function Gt(t){if(Nt)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!Ut)return!1;try{return Ut.call(t),!0}catch(t){}return!1}var Ht=Object.prototype.hasOwnProperty||function(t){return t in this};function Vt(t,e){return Ht.call(t,e)}function Jt(t){return bt.call(t)}function Qt(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Yt(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Yt(St.call(t,0,e.maxStringLength),e)+n}return Wt(_t.call(_t.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Kt),"single",e)}function Kt(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+At.call(e.toString(16))}function Zt(t){return"Object("+t+")"}function Xt(t){return t+" { ? }"}function te(t,e,r,n){return t+" ("+e+") {"+(n?ee(r,n):xt.call(r,", "))+"}"}function ee(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+xt.call(t,","+r)+"\n"+e.prev}function re(t,e){var r=qt(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Vt(t,o)?e(t[o],t):""}var i,a="function"==typeof Rt?Rt(t):[];if(Nt){i={};for(var c=0;c<a.length;c++)i["$"+a[c]]=a[c]}for(var s in t)Vt(t,s)&&(r&&String(Number(s))===s&&s<t.length||Nt&&i["$"+s]instanceof Symbol||(Ot.call(/[^\w$]/,s)?n.push(e(s,t)+": "+e(t[s],t)):n.push(s+": "+e(t[s],t))));if("function"==typeof Rt)for(var l=0;l<a.length;l++)Mt.call(t,a[l])&&n.push("["+e(a[l])+"]: "+e(t[a[l]],t));return n}var ne=W("%TypeError%"),oe=W("%WeakMap%",!0),ie=W("%Map%",!0),ae=ot("WeakMap.prototype.get",!0),ce=ot("WeakMap.prototype.set",!0),se=ot("WeakMap.prototype.has",!0),le=ot("Map.prototype.get",!0),pe=ot("Map.prototype.set",!0),ue=ot("Map.prototype.has",!0),fe=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},ye=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new ne("Side channel does not contain "+Lt(t))},get:function(n){if(oe&&n&&("object"==typeof n||"function"==typeof n)){if(t)return ae(t,n)}else if(ie){if(e)return le(e,n)}else if(r)return function(t,e){var r=fe(t,e);return r&&r.value}(r,n)},has:function(n){if(oe&&n&&("object"==typeof n||"function"==typeof n)){if(t)return se(t,n)}else if(ie){if(e)return ue(e,n)}else if(r)return function(t,e){return!!fe(t,e)}(r,n);return!1},set:function(n,o){oe&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new oe),ce(t,n,o)):ie?(e||(e=new ie),pe(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=fe(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n},he=String.prototype.replace,de=/%20/g,ge="RFC3986",me={default:ge,formatters:{RFC1738:function(t){return he.call(t,de,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:ge},be=Object.prototype.hasOwnProperty,ve=Array.isArray,we=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Se=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},n=0;n<t.length;++n)void 0!==t[n]&&(r[n]=t[n]);return r},_e={arrayToObject:Se,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],n=0;n<e.length;++n)for(var o=e[n],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var s=a[c],l=i[s];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(e.push({obj:i,prop:s}),r.push(l))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(ve(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&n.push(r[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,r){var n=t.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,r,n,o){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",c=0;c<i.length;++c){var s=i.charCodeAt(c);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||o===me.RFC1738&&(40===s||41===s)?a+=i.charAt(c):s<128?a+=we[s]:s<2048?a+=we[192|s>>6]+we[128|63&s]:s<55296||s>=57344?a+=we[224|s>>12]+we[128|s>>6&63]+we[128|63&s]:(c+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(c)),a+=we[240|s>>18]+we[128|s>>12&63]+we[128|s>>6&63]+we[128|63&s])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(ve(t)){for(var r=[],n=0;n<t.length;n+=1)r.push(e(t[n]));return r}return e(t)},merge:function t(e,r,n){if(!r)return e;if("object"!=typeof r){if(ve(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!be.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return ve(e)&&!ve(r)&&(o=Se(e,n)),ve(e)&&ve(r)?(r.forEach((function(r,o){if(be.call(e,o)){var i=e[o];i&&"object"==typeof i&&r&&"object"==typeof r?e[o]=t(i,r,n):e.push(r)}else e[o]=r})),e):Object.keys(r).reduce((function(e,o){var i=r[o];return be.call(e,o)?e[o]=t(e[o],i,n):e[o]=i,e}),o)}},Ae=Object.prototype.hasOwnProperty,je={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},Oe=Array.isArray,Pe=Array.prototype.push,xe=function(t,e){Pe.apply(t,Oe(e)?e:[e])},ke=Date.prototype.toISOString,Ie=me.default,Ee={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:_e.encode,encodeValuesOnly:!1,format:Ie,formatter:me.formatters[Ie],indices:!1,serializeDate:function(t){return ke.call(t)},skipNulls:!1,strictNullHandling:!1},Re={},Ue=function t(e,r,n,o,i,a,c,s,l,p,u,f,y,h,d,g){for(var m,b=e,v=g,w=0,S=!1;void 0!==(v=v.get(Re))&&!S;){var _=v.get(e);if(w+=1,void 0!==_){if(_===w)throw new RangeError("Cyclic object value");S=!0}void 0===v.get(Re)&&(w=0)}if("function"==typeof s?b=s(r,b):b instanceof Date?b=u(b):"comma"===n&&Oe(b)&&(b=_e.maybeMap(b,(function(t){return t instanceof Date?u(t):t}))),null===b){if(i)return c&&!h?c(r,Ee.encoder,d,"key",f):r;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||_e.isBuffer(b))return c?[y(h?r:c(r,Ee.encoder,d,"key",f))+"="+y(c(b,Ee.encoder,d,"value",f))]:[y(r)+"="+y(String(b))];var A,j=[];if(void 0===b)return j;if("comma"===n&&Oe(b))h&&c&&(b=_e.maybeMap(b,c)),A=[{value:b.length>0?b.join(",")||null:void 0}];else if(Oe(s))A=s;else{var O=Object.keys(b);A=l?O.sort(l):O}for(var P=o&&Oe(b)&&1===b.length?r+"[]":r,x=0;x<A.length;++x){var k=A[x],I="object"==typeof k&&void 0!==k.value?k.value:b[k];if(!a||null!==I){var E=Oe(b)?"function"==typeof n?n(P,k):P:P+(p?"."+k:"["+k+"]");g.set(e,w);var R=ye();R.set(Re,g),xe(j,t(I,E,n,o,i,a,"comma"===n&&h&&Oe(b)?null:c,s,l,p,u,f,y,h,d,R))}}return j},Ne=Object.prototype.hasOwnProperty,Fe=Array.isArray,Me={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:_e.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},De=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},Ce=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Te=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(o),c=a?o.slice(0,a.index):o,s=[];if(c){if(!r.plainObjects&&Ne.call(Object.prototype,c)&&!r.allowPrototypes)return;s.push(c)}for(var l=0;r.depth>0&&null!==(a=i.exec(o))&&l<r.depth;){if(l+=1,!r.plainObjects&&Ne.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+o.slice(a.index)+"]"),function(t,e,r,n){for(var o=n?e:Ce(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(s,10);r.parseArrays||""!==s?!isNaN(l)&&c!==s&&String(l)===s&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=o:"__proto__"!==s&&(a[s]=o):a={0:o}}o=a}return o}(s,e,r,n)}},Be=function(t,e){var r=function(t){if(!t)return Me;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?Me.charset:t.charset;return{allowDots:void 0===t.allowDots?Me.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:Me.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:Me.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:Me.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Me.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:Me.comma,decoder:"function"==typeof t.decoder?t.decoder:Me.decoder,delimiter:"string"==typeof t.delimiter||_e.isRegExp(t.delimiter)?t.delimiter:Me.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:Me.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:Me.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:Me.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:Me.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Me.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={__proto__:null},o=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,a=o.split(e.delimiter,i),c=-1,s=e.charset;if(e.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?s="utf-8":"utf8=%26%2310003%3B"===a[r]&&(s="iso-8859-1"),c=r,r=a.length);for(r=0;r<a.length;++r)if(r!==c){var l,p,u=a[r],f=u.indexOf("]="),y=-1===f?u.indexOf("="):f+1;-1===y?(l=e.decoder(u,Me.decoder,s,"key"),p=e.strictNullHandling?null:""):(l=e.decoder(u.slice(0,y),Me.decoder,s,"key"),p=_e.maybeMap(Ce(u.slice(y+1),e),(function(t){return e.decoder(t,Me.decoder,s,"value")}))),p&&e.interpretNumericEntities&&"iso-8859-1"===s&&(p=De(p)),u.indexOf("[]=")>-1&&(p=Fe(p)?[p]:p),Ne.call(n,l)?n[l]=_e.combine(n[l],p):n[l]=p}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),a=0;a<i.length;++a){var c=i[a],s=Te(c,n[c],r,"string"==typeof t);o=_e.merge(o,s,r)}return!0===r.allowSparse?o:_e.compact(o)},Le=function(t,e){var r,n=t,o=function(t){if(!t)return Ee;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||Ee.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=me.default;if(void 0!==t.format){if(!Ae.call(me.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=me.formatters[r],o=Ee.filter;return("function"==typeof t.filter||Oe(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:Ee.addQueryPrefix,allowDots:void 0===t.allowDots?Ee.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:Ee.charsetSentinel,delimiter:void 0===t.delimiter?Ee.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:Ee.encode,encoder:"function"==typeof t.encoder?t.encoder:Ee.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:Ee.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:Ee.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:Ee.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:Ee.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):Oe(o.filter)&&(r=o.filter);var i,a=[];if("object"!=typeof n||null===n)return"";i=e&&e.arrayFormat in je?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var c=je[i];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var s="comma"===c&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var l=ye(),p=0;p<r.length;++p){var u=r[p];o.skipNulls&&null===n[u]||xe(a,Ue(n[u],u,c,s,o.strictNullHandling,o.skipNulls,o.encode?o.encoder:null,o.filter,o.sort,o.allowDots,o.serializeDate,o.format,o.formatter,o.encodeValuesOnly,o.charset,l))}var f=a.join(o.delimiter),y=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),f.length>0?y+f:""};
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("util")):"function"==typeof define&&define.amd?define(["util"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).AccountsSDK=e(t.require$$0$2)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(t),o={extend:function(t){return t.oauth_exception&&this.oauth_exception[t.oauth_exception]?Object.assign(t,{description:this.oauth_exception[t.oauth_exception]}):t.identity_exception&&this.identity_exception[t.identity_exception]?Object.assign(t,{description:this.identity_exception[t.identity_exception]}):t},oauth_exception:{invalid_request:"You may be loading accounts-sdk on a domain that is not whitelisted.",unauthorized_client:"Client not found, not provided or incorectly configured.",access_denied:"Probably this application is installed on a different account and you do not have access to it.",unsupported_response_type:"Provided response type is incorrect or unavailable for a given client."},identity_exception:{unauthorized:"Resource owner identity is not known or consent is missing."}};class n{constructor(t={}){this.options=t,this.listening=!1,this.receiveMessage=this.receiveMessage.bind(this)}start(t,e){this._listenerInited||(this.listening=!0,this.callback=e,t&&(this.tid=setTimeout((()=>{this.stop(),e("timeout",null)}),t)),window.addEventListener("message",this.receiveMessage))}stop(){this.listening=!1,clearTimeout(this.tid),window.removeEventListener("message",this.receiveMessage,!1)}receiveMessage(t){t.origin!==this.options.server_url&&t.origin!==this.options.server_url.replace(/livechat\.com$/,"livechatinc.com")||(t.data.data||t.data.error)&&(this.stop(),t.data.error?this.callback(o.extend(t.data.error),null):(t.data.data.scopes&&(t.data.data.scope=t.data.data.scopes,delete t.data.data.scopes),t.data.data.expires_in&&(t.data.data.expires_in=parseInt(t.data.data.expires_in)||0),this.callback(null,t.data.data)))}}class i{constructor(t,e){this.options=e,this.sdk=t}authorize(){return new Promise(((t,e)=>{const r=this.sdk.authorizeURL(this.options,"button"),o=window.screen.width/2-250,i=window.screen.height/2-325;new n(this.options).start(null,((r,o)=>{if(r)return e(r);t(o)}));var a=function(){window.open(r,"livechat-login-popup","resizable,scrollbars,width=".concat(500,",height=").concat(650,",left=").concat(o,",top=").concat(i))};document.requestStorageAccess?document.requestStorageAccess().then(a,a):a()}))}}var a=Object,c=Error,s=EvalError,l=RangeError,p=ReferenceError,u=SyntaxError,f=TypeError,y=URIError,h=Math.abs,d=Math.floor,g=Math.max,m=Math.min,b=Math.pow,v=Math.round,w=Number.isNaN||function(t){return t!=t},S=Object.getOwnPropertyDescriptor;if(S)try{S([],"length")}catch(t){S=null}var _=S,A=Object.defineProperty||!1;if(A)try{A({},"a",{value:1})}catch(t){A=!1}var j,O=A,P="undefined"!=typeof Symbol&&Symbol,x="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null,k=a,I=k.getPrototypeOf||null,E=Object.prototype.toString,R=Math.max,M=function(t,e){for(var r=[],o=0;o<t.length;o+=1)r[o]=t[o];for(var n=0;n<e.length;n+=1)r[n+t.length]=e[n];return r},U=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==E.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var r,o=function(t,e){for(var r=[],o=e||0,n=0;o<t.length;o+=1,n+=1)r[n]=t[o];return r}(arguments,1),n=R(0,e.length-o.length),i=[],a=0;a<n;a++)i[a]="$"+a;if(r=Function("binder","return function ("+function(t,e){for(var r="",o=0;o<t.length;o+=1)r+=t[o],o+1<t.length&&(r+=e);return r}(i,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof r){var n=e.apply(this,M(o,arguments));return Object(n)===n?n:this}return e.apply(t,M(o,arguments))})),e.prototype){var c=function(){};c.prototype=e.prototype,r.prototype=new c,c.prototype=null}return r},N=Function.prototype.call,F=Function.prototype.apply,C="undefined"!=typeof Reflect&&Reflect&&Reflect.apply||U.call(N,F),D=f,T=_;try{j=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var B,L=!!j&&T&&T(Object.prototype,"__proto__"),W=Object,z=W.getPrototypeOf,q=L&&"function"==typeof L.get?function(t){if(t.length<1||"function"!=typeof t[0])throw new D("a function is required");return C(U,N,t)}([L.get]):"function"==typeof z&&function(t){return z(null==t?t:W(t))},$=x?function(t){return x(t)}:I?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return I(t)}:q?function(t){return q(t)}:null,G=Function.prototype.call,V=Object.prototype.hasOwnProperty,H=U.call(G,V),J=c,Q=s,Y=l,K=p,Z=u,X=y,tt=h,et=d,rt=g,ot=m,nt=b,it=v,at=function(t){return w(t)||0===t?t:t<0?-1:1},ct=O,st=H,lt=Function,pt=function(t){try{return lt('"use strict"; return ('+t+").constructor;")()}catch(t){}},ut=function(){throw new D},ft=T?function(){try{return ut}catch(t){try{return T(arguments,"callee").get}catch(t){return ut}}}():ut,yt="function"==typeof P&&"function"==typeof Symbol&&"symbol"==typeof P("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var o in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}(),ht={},dt="undefined"!=typeof Uint8Array&&$?$(Uint8Array):B,gt={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?B:ArrayBuffer,"%ArrayIteratorPrototype%":yt&&$?$([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":ht,"%AsyncGenerator%":ht,"%AsyncGeneratorFunction%":ht,"%AsyncIteratorPrototype%":ht,"%Atomics%":"undefined"==typeof Atomics?B:Atomics,"%BigInt%":"undefined"==typeof BigInt?B:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?B:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":J,"%eval%":eval,"%EvalError%":Q,"%Float16Array%":"undefined"==typeof Float16Array?B:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?B:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?B:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?B:FinalizationRegistry,"%Function%":lt,"%GeneratorFunction%":ht,"%Int8Array%":"undefined"==typeof Int8Array?B:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?B:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":yt&&$?$($([][Symbol.iterator]())):B,"%JSON%":"object"==typeof JSON?JSON:B,"%Map%":"undefined"==typeof Map?B:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&yt&&$?$((new Map)[Symbol.iterator]()):B,"%Math%":Math,"%Number%":Number,"%Object%":k,"%Object.getOwnPropertyDescriptor%":T,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?B:Promise,"%Proxy%":"undefined"==typeof Proxy?B:Proxy,"%RangeError%":Y,"%ReferenceError%":K,"%Reflect%":"undefined"==typeof Reflect?B:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?B:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&yt&&$?$((new Set)[Symbol.iterator]()):B,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":yt&&$?$(""[Symbol.iterator]()):B,"%Symbol%":yt?Symbol:B,"%SyntaxError%":Z,"%ThrowTypeError%":ft,"%TypedArray%":dt,"%TypeError%":D,"%Uint8Array%":"undefined"==typeof Uint8Array?B:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?B:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?B:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?B:Uint32Array,"%URIError%":X,"%WeakMap%":"undefined"==typeof WeakMap?B:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?B:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?B:WeakSet,"%Function.prototype.call%":N,"%Function.prototype.apply%":F,"%Object.defineProperty%":ct,"%Object.getPrototypeOf%":I,"%Math.abs%":tt,"%Math.floor%":et,"%Math.max%":rt,"%Math.min%":ot,"%Math.pow%":nt,"%Math.round%":it,"%Math.sign%":at,"%Reflect.getPrototypeOf%":x};if($)try{null.error}catch(t){var mt=$($(t));gt["%Error.prototype%"]=mt}var bt=function t(e){var r;if("%AsyncFunction%"===e)r=pt("async function () {}");else if("%GeneratorFunction%"===e)r=pt("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=pt("async function* () {}");else if("%AsyncGenerator%"===e){var o=t("%AsyncGeneratorFunction%");o&&(r=o.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=t("%AsyncGenerator%");n&&$&&(r=$(n.prototype))}return gt[e]=r,r},vt={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},wt=U.call(N,Array.prototype.concat),St=U.call(F,Array.prototype.splice),_t=U.call(N,String.prototype.replace),At=U.call(N,String.prototype.slice),jt=U.call(N,RegExp.prototype.exec),Ot=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Pt=/\\(\\)?/g,xt=function(t,e){var r,o=t;if(st(vt,o)&&(o="%"+(r=vt[o])[0]+"%"),st(gt,o)){var n=gt[o];if(n===ht&&(n=bt(o)),void 0===n&&!e)throw new D("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:n}}throw new Z("intrinsic "+t+" does not exist!")},kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function It(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var Et=function(t,e){if("string"!=typeof t||0===t.length)throw new D("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new D('"allowMissing" argument must be a boolean');if(null===jt(/^%?[^%]*%?$/,t))throw new Z("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=At(t,0,1),r=At(t,-1);if("%"===e&&"%"!==r)throw new Z("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new Z("invalid intrinsic syntax, expected opening `%`");var o=[];return _t(t,Ot,(function(t,e,r,n){o[o.length]=r?_t(n,Pt,"$1"):e||t})),o}(t),o=r.length>0?r[0]:"",n=xt("%"+o+"%",e),i=n.name,a=n.value,c=!1,s=n.alias;s&&(o=s[0],St(r,wt([0,1],s)));for(var l=1,p=!0;l<r.length;l+=1){var u=r[l],f=At(u,0,1),y=At(u,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new Z("property names with quotes must have matching quotes");if("constructor"!==u&&p||(c=!0),st(gt,i="%"+(o+="."+u)+"%"))a=gt[i];else if(null!=a){if(!(u in a)){if(!e)throw new D("base intrinsic for "+t+" exists, but the property is not available.");return}if(T&&l+1>=r.length){var h=T(a,u);a=(p=!!h)&&"get"in h&&!("originalValue"in h.get)?h.get:a[u]}else p=st(a,u),a=a[u];p&&!c&&(gt[i]=a)}}return a},Rt=Et("%Object.defineProperty%",!0),Mt=function(){if(Rt)try{return Rt({},"a",{value:1}),!0}catch(t){return!1}return!1};Mt.hasArrayLengthDefineBug=function(){if(!Mt())return null;try{return 1!==Rt([],"length",{value:1}).length}catch(t){return!0}};var Ut=Mt,Nt=Ut()&&Et("%Object.defineProperty%",!0);if(Nt)try{Nt({},"a",{value:1})}catch(t){Nt=!1}var Ft=Et("%SyntaxError%"),Ct=Et("%TypeError%"),Dt=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new Ct("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new Ct("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new Ct("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new Ct("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new Ct("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new Ct("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,a=arguments.length>6&&arguments[6],c=!!T&&T(t,e);if(Nt)Nt(t,e,{configurable:null===i&&c?c.configurable:!i,enumerable:null===o&&c?c.enumerable:!o,value:r,writable:null===n&&c?c.writable:!n});else{if(!a&&(o||n||i))throw new Ft("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}},Tt=Ut(),Bt=Et("%TypeError%"),Lt=Et("%Math.floor%"),Wt=It((function(t){var e=Et("%TypeError%"),r=Et("%Function.prototype.apply%"),o=Et("%Function.prototype.call%"),n=Et("%Reflect.apply%",!0)||U.call(o,r),i=Et("%Object.defineProperty%",!0),a=Et("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){if("function"!=typeof t)throw new e("a function is required");return function(t,e){if("function"!=typeof t)throw new Bt("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||Lt(e)!==e)throw new Bt("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],o=!0,n=!0;if("length"in t&&T){var i=T(t,"length");i&&!i.configurable&&(o=!1),i&&!i.writable&&(n=!1)}return(o||n||!r)&&(Tt?Dt(t,"length",e,!0,!0):Dt(t,"length",e)),t}(n(U,o,arguments),1+a(0,t.length-(arguments.length-1)),!0)};var c=function(){return n(U,r,arguments)};i?i(t.exports,"apply",{value:c}):t.exports.apply=c})),zt=Wt(Et("String.prototype.indexOf")),qt=function(t,e){var r=Et(t,!!e);return"function"==typeof r&&zt(t,".prototype.")>-1?Wt(r):r},$t=r.default.inspect,Gt="function"==typeof Map&&Map.prototype,Vt=Object.getOwnPropertyDescriptor&&Gt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ht=Gt&&Vt&&"function"==typeof Vt.get?Vt.get:null,Jt=Gt&&Map.prototype.forEach,Qt="function"==typeof Set&&Set.prototype,Yt=Object.getOwnPropertyDescriptor&&Qt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Kt=Qt&&Yt&&"function"==typeof Yt.get?Yt.get:null,Zt=Qt&&Set.prototype.forEach,Xt="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,te="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,ee="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,re=Boolean.prototype.valueOf,oe=Object.prototype.toString,ne=Function.prototype.toString,ie=String.prototype.match,ae=String.prototype.slice,ce=String.prototype.replace,se=String.prototype.toUpperCase,le=String.prototype.toLowerCase,pe=RegExp.prototype.test,ue=Array.prototype.concat,fe=Array.prototype.join,ye=Array.prototype.slice,he=Math.floor,de="function"==typeof BigInt?BigInt.prototype.valueOf:null,ge=Object.getOwnPropertySymbols,me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,be="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ve="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===be||"symbol")?Symbol.toStringTag:null,we=Object.prototype.propertyIsEnumerable,Se=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function _e(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||pe.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var o=t<0?-he(-t):he(t);if(o!==t){var n=String(o),i=ae.call(e,n.length+1);return ce.call(n,r,"$&_")+"."+ce.call(ce.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ce.call(e,r,"$&_")}var Ae=$t.custom,je=Ie(Ae)?Ae:null;function Oe(t,e,r){var o="double"===(r.quoteStyle||e)?'"':"'";return o+t+o}function Pe(t){return ce.call(String(t),/"/g,"&quot;")}function xe(t){return!("[object Array]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}function ke(t){return!("[object RegExp]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}function Ie(t){if(be)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!me)return!1;try{return me.call(t),!0}catch(t){}return!1}var Ee=Object.prototype.hasOwnProperty||function(t){return t in this};function Re(t,e){return Ee.call(t,e)}function Me(t){return oe.call(t)}function Ue(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,o=t.length;r<o;r++)if(t[r]===e)return r;return-1}function Ne(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,o="... "+r+" more character"+(r>1?"s":"");return Ne(ae.call(t,0,e.maxStringLength),e)+o}return Oe(ce.call(ce.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Fe),"single",e)}function Fe(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+se.call(e.toString(16))}function Ce(t){return"Object("+t+")"}function De(t){return t+" { ? }"}function Te(t,e,r,o){return t+" ("+e+") {"+(o?Be(r,o):fe.call(r,", "))+"}"}function Be(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+fe.call(t,","+r)+"\n"+e.prev}function Le(t,e){var r=xe(t),o=[];if(r){o.length=t.length;for(var n=0;n<t.length;n++)o[n]=Re(t,n)?e(t[n],t):""}var i,a="function"==typeof ge?ge(t):[];if(be){i={};for(var c=0;c<a.length;c++)i["$"+a[c]]=a[c]}for(var s in t)Re(t,s)&&(r&&String(Number(s))===s&&s<t.length||be&&i["$"+s]instanceof Symbol||(pe.call(/[^\w$]/,s)?o.push(e(s,t)+": "+e(t[s],t)):o.push(s+": "+e(t[s],t))));if("function"==typeof ge)for(var l=0;l<a.length;l++)we.call(t,a[l])&&o.push("["+e(a[l])+"]: "+e(t[a[l]],t));return o}var We=function t(e,r,o,n){var i=r||{};if(Re(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(i,"maxStringLength")&&("number"==typeof i.maxStringLength?i.maxStringLength<0&&i.maxStringLength!==1/0:null!==i.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!Re(i,"customInspect")||i.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(i,"indent")&&null!==i.indent&&"\t"!==i.indent&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=i.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Ne(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var s=String(e);return c?_e(e,s):s}if("bigint"==typeof e){var l=String(e)+"n";return c?_e(e,l):l}var p=void 0===i.depth?5:i.depth;if(void 0===o&&(o=0),o>=p&&p>0&&"object"==typeof e)return xe(e)?"[Array]":"[Object]";var u=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=fe.call(Array(t.indent+1)," ")}return{base:r,prev:fe.call(Array(e+1),r)}}(i,o);if(void 0===n)n=[];else if(Ue(n,e)>=0)return"[Circular]";function f(e,r,a){if(r&&(n=ye.call(n)).push(r),a){var c={depth:i.depth};return Re(i,"quoteStyle")&&(c.quoteStyle=i.quoteStyle),t(e,c,o+1,n)}return t(e,i,o+1,n)}if("function"==typeof e&&!ke(e)){var y=function(t){if(t.name)return t.name;var e=ie.call(ne.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),h=Le(e,f);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(h.length>0?" { "+fe.call(h,", ")+" }":"")}if(Ie(e)){var d=be?ce.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):me.call(e);return"object"!=typeof e||be?d:Ce(d)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var g="<"+le.call(String(e.nodeName)),m=e.attributes||[],b=0;b<m.length;b++)g+=" "+m[b].name+"="+Oe(Pe(m[b].value),"double",i);return g+=">",e.childNodes&&e.childNodes.length&&(g+="..."),g+="</"+le.call(String(e.nodeName))+">"}if(xe(e)){if(0===e.length)return"[]";var v=Le(e,f);return u&&!function(t){for(var e=0;e<t.length;e++)if(Ue(t[e],"\n")>=0)return!1;return!0}(v)?"["+Be(v,u)+"]":"[ "+fe.call(v,", ")+" ]"}if(function(t){return!("[object Error]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}(e)){var w=Le(e,f);return"cause"in Error.prototype||!("cause"in e)||we.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+fe.call(w,", ")+" }":"{ ["+String(e)+"] "+fe.call(ue.call("[cause]: "+f(e.cause),w),", ")+" }"}if("object"==typeof e&&a){if(je&&"function"==typeof e[je]&&$t)return $t(e,{depth:p-o});if("symbol"!==a&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!Ht||!t||"object"!=typeof t)return!1;try{Ht.call(t);try{Kt.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var S=[];return Jt&&Jt.call(e,(function(t,r){S.push(f(r,e,!0)+" => "+f(t,e))})),Te("Map",Ht.call(e),S,u)}if(function(t){if(!Kt||!t||"object"!=typeof t)return!1;try{Kt.call(t);try{Ht.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var _=[];return Zt&&Zt.call(e,(function(t){_.push(f(t,e))})),Te("Set",Kt.call(e),_,u)}if(function(t){if(!Xt||!t||"object"!=typeof t)return!1;try{Xt.call(t,Xt);try{te.call(t,te)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return De("WeakMap");if(function(t){if(!te||!t||"object"!=typeof t)return!1;try{te.call(t,te);try{Xt.call(t,Xt)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return De("WeakSet");if(function(t){if(!ee||!t||"object"!=typeof t)return!1;try{return ee.call(t),!0}catch(t){}return!1}(e))return De("WeakRef");if(function(t){return!("[object Number]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}(e))return Ce(f(Number(e)));if(function(t){if(!t||"object"!=typeof t||!de)return!1;try{return de.call(t),!0}catch(t){}return!1}(e))return Ce(f(de.call(e)));if(function(t){return!("[object Boolean]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}(e))return Ce(re.call(e));if(function(t){return!("[object String]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}(e))return Ce(f(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if(e===kt)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==Me(t)||ve&&"object"==typeof t&&ve in t)}(e)&&!ke(e)){var A=Le(e,f),j=Se?Se(e)===Object.prototype:e instanceof Object||e.constructor===Object,O=e instanceof Object?"":"null prototype",P=!j&&ve&&Object(e)===e&&ve in e?ae.call(Me(e),8,-1):O?"Object":"",x=(j||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(P||O?"["+fe.call(ue.call([],P||[],O||[]),": ")+"] ":"");return 0===A.length?x+"{}":u?x+"{"+Be(A,u)+"}":x+"{ "+fe.call(A,", ")+" }"}return String(e)},ze=Et("%TypeError%"),qe=Et("%WeakMap%",!0),$e=Et("%Map%",!0),Ge=qt("WeakMap.prototype.get",!0),Ve=qt("WeakMap.prototype.set",!0),He=qt("WeakMap.prototype.has",!0),Je=qt("Map.prototype.get",!0),Qe=qt("Map.prototype.set",!0),Ye=qt("Map.prototype.has",!0),Ke=function(t,e){for(var r,o=t;null!==(r=o.next);o=r)if(r.key===e)return o.next=r.next,r.next=t.next,t.next=r,r},Ze=function(){var t,e,r,o={assert:function(t){if(!o.has(t))throw new ze("Side channel does not contain "+We(t))},get:function(o){if(qe&&o&&("object"==typeof o||"function"==typeof o)){if(t)return Ge(t,o)}else if($e){if(e)return Je(e,o)}else if(r)return function(t,e){var r=Ke(t,e);return r&&r.value}(r,o)},has:function(o){if(qe&&o&&("object"==typeof o||"function"==typeof o)){if(t)return He(t,o)}else if($e){if(e)return Ye(e,o)}else if(r)return function(t,e){return!!Ke(t,e)}(r,o);return!1},set:function(o,n){qe&&o&&("object"==typeof o||"function"==typeof o)?(t||(t=new qe),Ve(t,o,n)):$e?(e||(e=new $e),Qe(e,o,n)):(r||(r={key:{},next:null}),function(t,e,r){var o=Ke(t,e);o?o.value=r:t.next={key:e,next:t.next,value:r}}(r,o,n))}};return o},Xe=String.prototype.replace,tr=/%20/g,er="RFC3986",rr={default:er,formatters:{RFC1738:function(t){return Xe.call(t,tr,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:er},or=Object.prototype.hasOwnProperty,nr=Array.isArray,ir=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ar=function(t,e){for(var r=e&&e.plainObjects?Object.create(null):{},o=0;o<t.length;++o)void 0!==t[o]&&(r[o]=t[o]);return r},cr={arrayToObject:ar,assign:function(t,e){return Object.keys(e).reduce((function(t,r){return t[r]=e[r],t}),t)},combine:function(t,e){return[].concat(t,e)},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],r=[],o=0;o<e.length;++o)for(var n=e[o],i=n.obj[n.prop],a=Object.keys(i),c=0;c<a.length;++c){var s=a[c],l=i[s];"object"==typeof l&&null!==l&&-1===r.indexOf(l)&&(e.push({obj:i,prop:s}),r.push(l))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(nr(r)){for(var o=[],n=0;n<r.length;++n)void 0!==r[n]&&o.push(r[n]);e.obj[e.prop]=o}}}(e),t},decode:function(t,e,r){var o=t.replace(/\+/g," ");if("iso-8859-1"===r)return o.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(o)}catch(t){return o}},encode:function(t,e,r,o,n){if(0===t.length)return t;var i=t;if("symbol"==typeof t?i=Symbol.prototype.toString.call(t):"string"!=typeof t&&(i=String(t)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,(function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"}));for(var a="",c=0;c<i.length;++c){var s=i.charCodeAt(c);45===s||46===s||95===s||126===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||n===rr.RFC1738&&(40===s||41===s)?a+=i.charAt(c):s<128?a+=ir[s]:s<2048?a+=ir[192|s>>6]+ir[128|63&s]:s<55296||s>=57344?a+=ir[224|s>>12]+ir[128|s>>6&63]+ir[128|63&s]:(c+=1,s=65536+((1023&s)<<10|1023&i.charCodeAt(c)),a+=ir[240|s>>18]+ir[128|s>>12&63]+ir[128|s>>6&63]+ir[128|63&s])}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},maybeMap:function(t,e){if(nr(t)){for(var r=[],o=0;o<t.length;o+=1)r.push(e(t[o]));return r}return e(t)},merge:function t(e,r,o){if(!r)return e;if("object"!=typeof r){if(nr(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(o&&(o.plainObjects||o.allowPrototypes)||!or.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var n=e;return nr(e)&&!nr(r)&&(n=ar(e,o)),nr(e)&&nr(r)?(r.forEach((function(r,n){if(or.call(e,n)){var i=e[n];i&&"object"==typeof i&&r&&"object"==typeof r?e[n]=t(i,r,o):e.push(r)}else e[n]=r})),e):Object.keys(r).reduce((function(e,n){var i=r[n];return or.call(e,n)?e[n]=t(e[n],i,o):e[n]=i,e}),n)}},sr=Object.prototype.hasOwnProperty,lr={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},pr=Array.isArray,ur=Array.prototype.push,fr=function(t,e){ur.apply(t,pr(e)?e:[e])},yr=Date.prototype.toISOString,hr=rr.default,dr={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:cr.encode,encodeValuesOnly:!1,format:hr,formatter:rr.formatters[hr],indices:!1,serializeDate:function(t){return yr.call(t)},skipNulls:!1,strictNullHandling:!1},gr={},mr=function t(e,r,o,n,i,a,c,s,l,p,u,f,y,h,d,g){for(var m,b=e,v=g,w=0,S=!1;void 0!==(v=v.get(gr))&&!S;){var _=v.get(e);if(w+=1,void 0!==_){if(_===w)throw new RangeError("Cyclic object value");S=!0}void 0===v.get(gr)&&(w=0)}if("function"==typeof s?b=s(r,b):b instanceof Date?b=u(b):"comma"===o&&pr(b)&&(b=cr.maybeMap(b,(function(t){return t instanceof Date?u(t):t}))),null===b){if(i)return c&&!h?c(r,dr.encoder,d,"key",f):r;b=""}if("string"==typeof(m=b)||"number"==typeof m||"boolean"==typeof m||"symbol"==typeof m||"bigint"==typeof m||cr.isBuffer(b))return c?[y(h?r:c(r,dr.encoder,d,"key",f))+"="+y(c(b,dr.encoder,d,"value",f))]:[y(r)+"="+y(String(b))];var A,j=[];if(void 0===b)return j;if("comma"===o&&pr(b))h&&c&&(b=cr.maybeMap(b,c)),A=[{value:b.length>0?b.join(",")||null:void 0}];else if(pr(s))A=s;else{var O=Object.keys(b);A=l?O.sort(l):O}for(var P=n&&pr(b)&&1===b.length?r+"[]":r,x=0;x<A.length;++x){var k=A[x],I="object"==typeof k&&void 0!==k.value?k.value:b[k];if(!a||null!==I){var E=pr(b)?"function"==typeof o?o(P,k):P:P+(p?"."+k:"["+k+"]");g.set(e,w);var R=Ze();R.set(gr,g),fr(j,t(I,E,o,n,i,a,"comma"===o&&h&&pr(b)?null:c,s,l,p,u,f,y,h,d,R))}}return j},br=Object.prototype.hasOwnProperty,vr=Array.isArray,wr={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:cr.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Sr=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},_r=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ar=function(t,e,r,o){if(t){var n=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,s=[];if(c){if(!r.plainObjects&&br.call(Object.prototype,c)&&!r.allowPrototypes)return;s.push(c)}for(var l=0;r.depth>0&&null!==(a=i.exec(n))&&l<r.depth;){if(l+=1,!r.plainObjects&&br.call(Object.prototype,a[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(a[1])}return a&&s.push("["+n.slice(a.index)+"]"),function(t,e,r,o){for(var n=o?e:_r(e,r),i=t.length-1;i>=0;--i){var a,c=t[i];if("[]"===c&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var s="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,l=parseInt(s,10);r.parseArrays||""!==s?!isNaN(l)&&c!==s&&String(l)===s&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=n:"__proto__"!==s&&(a[s]=n):a={0:n}}n=a}return n}(s,e,r,o)}},jr=function(t,e){var r=function(t){if(!t)return wr;if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=void 0===t.charset?wr.charset:t.charset;return{allowDots:void 0===t.allowDots?wr.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:wr.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:wr.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:wr.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:wr.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:wr.comma,decoder:"function"==typeof t.decoder?t.decoder:wr.decoder,delimiter:"string"==typeof t.delimiter||cr.isRegExp(t.delimiter)?t.delimiter:wr.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:wr.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:wr.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:wr.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:wr.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:wr.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var o="string"==typeof t?function(t,e){var r,o={__proto__:null},n=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,a=n.split(e.delimiter,i),c=-1,s=e.charset;if(e.charsetSentinel)for(r=0;r<a.length;++r)0===a[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===a[r]?s="utf-8":"utf8=%26%2310003%3B"===a[r]&&(s="iso-8859-1"),c=r,r=a.length);for(r=0;r<a.length;++r)if(r!==c){var l,p,u=a[r],f=u.indexOf("]="),y=-1===f?u.indexOf("="):f+1;-1===y?(l=e.decoder(u,wr.decoder,s,"key"),p=e.strictNullHandling?null:""):(l=e.decoder(u.slice(0,y),wr.decoder,s,"key"),p=cr.maybeMap(_r(u.slice(y+1),e),(function(t){return e.decoder(t,wr.decoder,s,"value")}))),p&&e.interpretNumericEntities&&"iso-8859-1"===s&&(p=Sr(p)),u.indexOf("[]=")>-1&&(p=vr(p)?[p]:p),br.call(o,l)?o[l]=cr.combine(o[l],p):o[l]=p}return o}(t,r):t,n=r.plainObjects?Object.create(null):{},i=Object.keys(o),a=0;a<i.length;++a){var c=i[a],s=Ar(c,o[c],r,"string"==typeof t);n=cr.merge(n,s,r)}return!0===r.allowSparse?n:cr.compact(n)},Or=function(t,e){var r,o=t,n=function(t){if(!t)return dr;if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||dr.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=rr.default;if(void 0!==t.format){if(!sr.call(rr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var o=rr.formatters[r],n=dr.filter;return("function"==typeof t.filter||pr(t.filter))&&(n=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:dr.addQueryPrefix,allowDots:void 0===t.allowDots?dr.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:dr.charsetSentinel,delimiter:void 0===t.delimiter?dr.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:dr.encode,encoder:"function"==typeof t.encoder?t.encoder:dr.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:dr.encodeValuesOnly,filter:n,format:r,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:dr.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:dr.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:dr.strictNullHandling}}(e);"function"==typeof n.filter?o=(0,n.filter)("",o):pr(n.filter)&&(r=n.filter);var i,a=[];if("object"!=typeof o||null===o)return"";i=e&&e.arrayFormat in lr?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var c=lr[i];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var s="comma"===c&&e&&e.commaRoundTrip;r||(r=Object.keys(o)),n.sort&&r.sort(n.sort);for(var l=Ze(),p=0;p<r.length;++p){var u=r[p];n.skipNulls&&null===o[u]||fr(a,mr(o[u],u,c,s,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var f=a.join(n.delimiter),y=!0===n.addQueryPrefix?"?":"";return n.charsetSentinel&&("iso-8859-1"===n.charset?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),f.length>0?y+f:""};
2
2
  /** @fileOverview
3
3
  * @author Auth0 https://github.com/auth0/auth0.js
4
4
  * @license MIT
5
5
  */
6
- function We(t,e){return e.reduce(((e,r)=>(t[r]&&(e[r]=t[r]),e)),{})}class ze{constructor(t,e){this.options=e,this.sdk=t}authorize(){const t=this.sdk.authorizeURL(this.options);window.location=t}authorizeData(){return new Promise(((t,e)=>{let r={},o=[];switch(this.options.response_type){case"token":if(o=["access_token","expires_in","token_type"],r=Be(window.location.hash.substring(1)),r=We(r,["access_token","expires_in","state","scope","token_type"]),!o.every((t=>r.hasOwnProperty(t))))return void e(n.extend({identity_exception:"unauthorized"}));r.expires_in=parseInt(r.expires_in);break;case"code":if(o=["code"],r=Be(window.location.search,{ignoreQueryPrefix:!0}),r=We(r,["state","code"]),!o.every((t=>r.hasOwnProperty(t))))return void e(n.extend({identity_exception:"unauthorized"}))}this.sdk.redirectUriParamsPersister.retrieve(r.state),t(r)}))}}class qe{constructor(t,e){this.options=e,this.sdk=t}authorize(){return new Promise(((t,e)=>{const r=this.sdk.authorizeURL(this.options,"button");new o(this.options).start(5e3,((r,n)=>{if(this.removeIframe(),r)return e(r);t(n)}));const n=document.createElement("iframe");n.setAttribute("src",r),n.setAttribute("id",this.iframeID()),n.style.width="1px",n.style.height="1px",n.style.position="fixed",n.style.top="0",n.style.right="0",n.style.opacity="0",n.style.visibility="none",document.body.appendChild(n)}))}iframeID(){return this.options.client_id+this.options.response_type}removeIframe(){const t=document.getElementById(this.iframeID());t&&t.parentNode&&t.parentNode.removeChild(t)}}
6
+ function Pr(t,e){return e.reduce(((e,r)=>(t[r]&&(e[r]=t[r]),e)),{})}class xr{constructor(t,e){this.options=e,this.sdk=t}authorize(){const t=this.sdk.authorizeURL(this.options);window.location=t}authorizeData(){return new Promise(((t,e)=>{let r={},n=[];switch(this.options.response_type){case"token":if(n=["access_token","expires_in","token_type"],r=jr(window.location.hash.substring(1)),r=Pr(r,["access_token","expires_in","state","scope","token_type"]),!n.every((t=>r.hasOwnProperty(t))))return void e(o.extend({identity_exception:"unauthorized"}));r.expires_in=parseInt(r.expires_in);break;case"code":if(n=["code"],r=jr(window.location.search,{ignoreQueryPrefix:!0}),r=Pr(r,["state","code"]),!n.every((t=>r.hasOwnProperty(t))))return void e(o.extend({identity_exception:"unauthorized"}))}this.sdk.redirectUriParamsPersister.retrieve(r.state),t(r)}))}}class kr{constructor(t,e){this.options=e,this.sdk=t}authorize(){return new Promise(((t,e)=>{const r=this.sdk.authorizeURL(this.options,"button");new n(this.options).start(5e3,((r,o)=>{if(this.removeIframe(),r)return e(r);t(o)}));const o=document.createElement("iframe");o.setAttribute("src",r),o.setAttribute("id",this.iframeID()),o.style.width="1px",o.style.height="1px",o.style.position="fixed",o.style.top="0",o.style.right="0",o.style.opacity="0",o.style.visibility="none",document.body.appendChild(o)}))}iframeID(){return this.options.client_id+this.options.response_type}removeIframe(){const t=document.getElementById(this.iframeID());t&&t.parentNode&&t.parentNode.removeChild(t)}}
7
7
  /** @fileOverview
8
8
  * @author Auth0 https://github.com/auth0/auth0.js
9
9
  * @license MIT
10
- */function $e(){}$e.prototype.getItem=function(){return null},$e.prototype.removeItem=function(){},$e.prototype.setItem=function(){};var Ge=q((function(t,e){var r;r=function(){function t(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var n in r)e[n]=r[n]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(n){function o(){}function i(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=t({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(t){}r=n.write?n.write(r,e):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var c="";for(var s in i)i[s]&&(c+="; "+s,!0!==i[s]&&(c+="="+i[s].split(";")[0]));return document.cookie=e+"="+r+c}}function a(t,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var c=i[a].split("="),s=c.slice(1).join("=");r||'"'!==s.charAt(0)||(s=s.slice(1,-1));try{var l=e(c[0]);if(s=(n.read||n)(s,l)||e(s),r)try{s=JSON.parse(s)}catch(t){}if(o[l]=s,t===l)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return a(t,!1)},o.getJSON=function(t){return a(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))},t.exports=r()}));function He(){}function Ve(t){if(this.storage=new He,!0===t.force_local_storage)try{const t=window.localStorage;t&&(this.storage=t)}catch(t){console.warn(t),console.warn("Cant use localStorage. Using CookieStorage instead.")}}function Je(t){this.handler=new Ve(t)}He.prototype.getItem=function(t){return Ge.get(t)},He.prototype.removeItem=function(t){Ge.remove(t)},He.prototype.setItem=function(t,e,r){const n=Object.assign({expires:1,SameSite:"none",Secure:!0},r);Ge.set(t,e,n)},Ve.prototype.failover=function(){this.storage instanceof $e?console.warn("DummyStorage: ignore failover"):this.storage instanceof He?(console.warn("CookieStorage: failing over DummyStorage"),this.storage=new $e):(console.warn("LocalStorage: failing over CookieStorage"),this.storage=new He)},Ve.prototype.getItem=function(t){try{return this.storage.getItem(t)}catch(e){return console.warn(e),this.failover(),this.getItem(t)}},Ve.prototype.removeItem=function(t){try{return this.storage.removeItem(t)}catch(e){return console.warn(e),this.failover(),this.removeItem(t)}},Ve.prototype.setItem=function(t,e,r){try{return this.storage.setItem(t,e,r)}catch(n){return console.warn(n),this.failover(),this.setItem(t,e,r)}},Je.prototype.getItem=function(t){const e=this.handler.getItem(t);try{return JSON.parse(e)}catch(t){return e}},Je.prototype.removeItem=function(t){return this.handler.removeItem(t)},Je.prototype.setItem=function(t,e,r){const n=JSON.stringify(e);return this.handler.setItem(t,n,r)};class Qe{constructor(t){this.options=t.transaction,this.storage=new Je(this.options)}generate(t){this.storage.setItem(this.options.namespace+t.state,{state:t.state,code_verifier:t.code_verifier},{expires:1/48})}get(t){const e=this.storage.getItem(this.options.namespace+t);return this.clear(t),e||{}}clear(t){this.storage.removeItem(this.options.namespace+t)}}var Ye={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};Ye.bitArray={bitSlice:function(t,e,r){return t=Ye.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===r?t:Ye.bitArray.clamp(t,r-e)},extract:function(t,e,r){var n=Math.floor(-e-r&31);return(-32&(e+r-1^e)?t[e/32|0]<<32-n^t[e/32+1|0]>>>n:t[e/32|0]>>>n)&(1<<r)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var r=t[t.length-1],n=Ye.bitArray.getPartial(r);return 32===n?t.concat(e):Ye.bitArray._shiftRight(e,n,0|r,t.slice(0,t.length-1))},bitLength:function(t){var e,r=t.length;return 0===r?0:(e=t[r-1],32*(r-1)+Ye.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;var r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=Ye.bitArray.partial(e,t[r-1]&2147483648>>e-1,1)),t},partial:function(t,e,r){return 32===t?e:(r?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(Ye.bitArray.bitLength(t)!==Ye.bitArray.bitLength(e))return!1;var r,n=0;for(r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n},_shiftRight:function(t,e,r,n){var o,i,a;for(void 0===n&&(n=[]);e>=32;e-=32)n.push(r),r=0;if(0===e)return n.concat(t);for(o=0;o<t.length;o++)n.push(r|t[o]>>>e),r=t[o]<<32-e;return i=t.length?t[t.length-1]:0,a=Ye.bitArray.getPartial(i),n.push(Ye.bitArray.partial(e+a&31,e+a>32?r:n.pop(),1)),n},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,r;for(e=0;e<t.length;++e)r=t[e],t[e]=r>>>24|r>>>8&65280|(65280&r)<<8|r<<24;return t}},Ye.codec.utf8String={fromBits:function(t){var e,r,n="",o=Ye.bitArray.bitLength(t);for(e=0;e<o/8;e++)0==(3&e)&&(r=t[e/4]),n+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(n))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,r=[],n=0;for(e=0;e<t.length;e++)n=n<<8|t.charCodeAt(e),3==(3&e)&&(r.push(n),n=0);return 3&e&&r.push(Ye.bitArray.partial(8*(3&e),n)),r}},Ye.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},Ye.hash.sha256.hash=function(t){return(new Ye.hash.sha256).update(t).finalize()},Ye.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=Ye.codec.utf8String.toBits(t));var e,r=this._buffer=Ye.bitArray.concat(this._buffer,t),n=this._length,o=this._length=n+Ye.bitArray.bitLength(t);if(o>9007199254740991)throw new Ye.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var i=new Uint32Array(r),a=0;for(e=512+n-(512+n&511);e<=o;e+=512)this._block(i.subarray(16*a,16*(a+1))),a+=1;r.splice(0,16*a)}else for(e=512+n-(512+n&511);e<=o;e+=512)this._block(r.splice(0,16));return this},finalize:function(){var t,e=this._buffer,r=this._h;for(t=(e=Ye.bitArray.concat(e,[Ye.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),r},_init:[],_key:[],_precompute:function(){var t,e,r=0,n=2;function o(t){return 4294967296*(t-Math.floor(t))|0}for(;r<64;n++){for(e=!0,t=2;t*t<=n;t++)if(n%t==0){e=!1;break}e&&(r<8&&(this._init[r]=o(Math.pow(n,.5))),this._key[r]=o(Math.pow(n,1/3)),r++)}},_block:function(t){var e,r,n,o,i=this._h,a=this._key,c=i[0],s=i[1],l=i[2],p=i[3],u=i[4],f=i[5],y=i[6],h=i[7];for(e=0;e<64;e++)e<16?r=t[e]:(n=t[e+1&15],o=t[e+14&15],r=t[15&e]=(n>>>7^n>>>18^n>>>3^n<<25^n<<14)+(o>>>17^o>>>19^o>>>10^o<<15^o<<13)+t[15&e]+t[e+9&15]|0),r=r+h+(u>>>6^u>>>11^u>>>25^u<<26^u<<21^u<<7)+(y^u&(f^y))+a[e],h=y,y=f,f=u,u=p+r|0,p=l,l=s,c=r+((s=c)&l^p&(s^l))+(s>>>2^s>>>13^s>>>22^s<<30^s<<19^s<<10)|0;i[0]=i[0]+c|0,i[1]=i[1]+s|0,i[2]=i[2]+l|0,i[3]=i[3]+p|0,i[4]=i[4]+u|0,i[5]=i[5]+f|0,i[6]=i[6]+y|0,i[7]=i[7]+h|0}};var Ke={base64URLEncode:function(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}};class Ze{constructor(t,e){this.options={namespace:t.transaction.namespace+e},this.storage=new Je(this.options)}set(t,e){this.storage.setItem(this.options.namespace+t,e,{expires:1/48})}get(t){const e=this.storage.getItem(this.options.namespace+t);return this.clear(t),e||{}}clear(t){this.storage.removeItem(this.options.namespace+t)}}class Xe{constructor(t){this.persister=new Ze(t,"redirect_uri_params")}persist(t){const e=new URL(t.redirect_uri),r=Be(e.search.substring(1)),n=Be(e.hash.substring(1));this.persister.set(t.state,{query_params:r,hash_params:n}),t.redirect_uri=e.origin+e.pathname}retrieve(t){var e,r;const n=this.persister.get(t,!1);if(!n)return;const o={...null!==(e=n.query_params)&&void 0!==e?e:{},...Be(window.location.search.substring(1))},i={...null!==(r=n.hash_params)&&void 0!==r?r:{},...Be(window.location.hash.substring(1))};let a=window.location.origin+window.location.pathname;o&&(a+="?"+Le(o)),i&&(a+="#"+Le(i)),window.history.replaceState({},document.title,a)}}
10
+ */function Ir(){}Ir.prototype.getItem=function(){return null},Ir.prototype.removeItem=function(){},Ir.prototype.setItem=function(){};var Er=It((function(t,e){var r;r=function(){function t(){for(var t=0,e={};t<arguments.length;t++){var r=arguments[t];for(var o in r)e[o]=r[o]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function r(o){function n(){}function i(e,r,i){if("undefined"!=typeof document){"number"==typeof(i=t({path:"/"},n.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var a=JSON.stringify(r);/^[\{\[]/.test(a)&&(r=a)}catch(t){}r=o.write?o.write(r,e):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var c="";for(var s in i)i[s]&&(c+="; "+s,!0!==i[s]&&(c+="="+i[s].split(";")[0]));return document.cookie=e+"="+r+c}}function a(t,r){if("undefined"!=typeof document){for(var n={},i=document.cookie?document.cookie.split("; "):[],a=0;a<i.length;a++){var c=i[a].split("="),s=c.slice(1).join("=");r||'"'!==s.charAt(0)||(s=s.slice(1,-1));try{var l=e(c[0]);if(s=(o.read||o)(s,l)||e(s),r)try{s=JSON.parse(s)}catch(t){}if(n[l]=s,t===l)break}catch(t){}}return t?n[t]:n}}return n.set=i,n.get=function(t){return a(t,!1)},n.getJSON=function(t){return a(t,!0)},n.remove=function(e,r){i(e,"",t(r,{expires:-1}))},n.defaults={},n.withConverter=r,n}((function(){}))},t.exports=r()}));function Rr(){}function Mr(t){if(this.storage=new Rr,!0===t.force_local_storage)try{const t=window.localStorage;t&&(this.storage=t)}catch(t){console.warn(t),console.warn("Cant use localStorage. Using CookieStorage instead.")}}function Ur(t){this.handler=new Mr(t)}Rr.prototype.getItem=function(t){return Er.get(t)},Rr.prototype.removeItem=function(t){Er.remove(t)},Rr.prototype.setItem=function(t,e,r){const o=Object.assign({expires:1,SameSite:"none",Secure:!0},r);Er.set(t,e,o)},Mr.prototype.failover=function(){this.storage instanceof Ir?console.warn("DummyStorage: ignore failover"):this.storage instanceof Rr?(console.warn("CookieStorage: failing over DummyStorage"),this.storage=new Ir):(console.warn("LocalStorage: failing over CookieStorage"),this.storage=new Rr)},Mr.prototype.getItem=function(t){try{return this.storage.getItem(t)}catch(e){return console.warn(e),this.failover(),this.getItem(t)}},Mr.prototype.removeItem=function(t){try{return this.storage.removeItem(t)}catch(e){return console.warn(e),this.failover(),this.removeItem(t)}},Mr.prototype.setItem=function(t,e,r){try{return this.storage.setItem(t,e,r)}catch(o){return console.warn(o),this.failover(),this.setItem(t,e,r)}},Ur.prototype.getItem=function(t){const e=this.handler.getItem(t);try{return JSON.parse(e)}catch(t){return e}},Ur.prototype.removeItem=function(t){return this.handler.removeItem(t)},Ur.prototype.setItem=function(t,e,r){const o=JSON.stringify(e);return this.handler.setItem(t,o,r)};class Nr{constructor(t){this.options=t.transaction,this.storage=new Ur(this.options)}generate(t){this.storage.setItem(this.options.namespace+t.state,{state:t.state,code_verifier:t.code_verifier},{expires:1/48})}get(t){const e=this.storage.getItem(this.options.namespace+t);return this.clear(t),e||{}}clear(t){this.storage.removeItem(this.options.namespace+t)}}var Fr={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};Fr.bitArray={bitSlice:function(t,e,r){return t=Fr.bitArray._shiftRight(t.slice(e/32),32-(31&e)).slice(1),void 0===r?t:Fr.bitArray.clamp(t,r-e)},extract:function(t,e,r){var o=Math.floor(-e-r&31);return(-32&(e+r-1^e)?t[e/32|0]<<32-o^t[e/32+1|0]>>>o:t[e/32|0]>>>o)&(1<<r)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var r=t[t.length-1],o=Fr.bitArray.getPartial(r);return 32===o?t.concat(e):Fr.bitArray._shiftRight(e,o,0|r,t.slice(0,t.length-1))},bitLength:function(t){var e,r=t.length;return 0===r?0:(e=t[r-1],32*(r-1)+Fr.bitArray.getPartial(e))},clamp:function(t,e){if(32*t.length<e)return t;var r=(t=t.slice(0,Math.ceil(e/32))).length;return e&=31,r>0&&e&&(t[r-1]=Fr.bitArray.partial(e,t[r-1]&2147483648>>e-1,1)),t},partial:function(t,e,r){return 32===t?e:(r?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(Fr.bitArray.bitLength(t)!==Fr.bitArray.bitLength(e))return!1;var r,o=0;for(r=0;r<t.length;r++)o|=t[r]^e[r];return 0===o},_shiftRight:function(t,e,r,o){var n,i,a;for(void 0===o&&(o=[]);e>=32;e-=32)o.push(r),r=0;if(0===e)return o.concat(t);for(n=0;n<t.length;n++)o.push(r|t[n]>>>e),r=t[n]<<32-e;return i=t.length?t[t.length-1]:0,a=Fr.bitArray.getPartial(i),o.push(Fr.bitArray.partial(e+a&31,e+a>32?r:o.pop(),1)),o},_xor4:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,r;for(e=0;e<t.length;++e)r=t[e],t[e]=r>>>24|r>>>8&65280|(65280&r)<<8|r<<24;return t}},Fr.codec.utf8String={fromBits:function(t){var e,r,o="",n=Fr.bitArray.bitLength(t);for(e=0;e<n/8;e++)0==(3&e)&&(r=t[e/4]),o+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(o))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,r=[],o=0;for(e=0;e<t.length;e++)o=o<<8|t.charCodeAt(e),3==(3&e)&&(r.push(o),o=0);return 3&e&&r.push(Fr.bitArray.partial(8*(3&e),o)),r}},Fr.hash.sha256=function(t){this._key[0]||this._precompute(),t?(this._h=t._h.slice(0),this._buffer=t._buffer.slice(0),this._length=t._length):this.reset()},Fr.hash.sha256.hash=function(t){return(new Fr.hash.sha256).update(t).finalize()},Fr.hash.sha256.prototype={blockSize:512,reset:function(){return this._h=this._init.slice(0),this._buffer=[],this._length=0,this},update:function(t){"string"==typeof t&&(t=Fr.codec.utf8String.toBits(t));var e,r=this._buffer=Fr.bitArray.concat(this._buffer,t),o=this._length,n=this._length=o+Fr.bitArray.bitLength(t);if(n>9007199254740991)throw new Fr.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var i=new Uint32Array(r),a=0;for(e=512+o-(512+o&511);e<=n;e+=512)this._block(i.subarray(16*a,16*(a+1))),a+=1;r.splice(0,16*a)}else for(e=512+o-(512+o&511);e<=n;e+=512)this._block(r.splice(0,16));return this},finalize:function(){var t,e=this._buffer,r=this._h;for(t=(e=Fr.bitArray.concat(e,[Fr.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this._length/4294967296)),e.push(0|this._length);e.length;)this._block(e.splice(0,16));return this.reset(),r},_init:[],_key:[],_precompute:function(){var t,e,r=0,o=2;function n(t){return 4294967296*(t-Math.floor(t))|0}for(;r<64;o++){for(e=!0,t=2;t*t<=o;t++)if(o%t==0){e=!1;break}e&&(r<8&&(this._init[r]=n(Math.pow(o,.5))),this._key[r]=n(Math.pow(o,1/3)),r++)}},_block:function(t){var e,r,o,n,i=this._h,a=this._key,c=i[0],s=i[1],l=i[2],p=i[3],u=i[4],f=i[5],y=i[6],h=i[7];for(e=0;e<64;e++)e<16?r=t[e]:(o=t[e+1&15],n=t[e+14&15],r=t[15&e]=(o>>>7^o>>>18^o>>>3^o<<25^o<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+t[15&e]+t[e+9&15]|0),r=r+h+(u>>>6^u>>>11^u>>>25^u<<26^u<<21^u<<7)+(y^u&(f^y))+a[e],h=y,y=f,f=u,u=p+r|0,p=l,l=s,c=r+((s=c)&l^p&(s^l))+(s>>>2^s>>>13^s>>>22^s<<30^s<<19^s<<10)|0;i[0]=i[0]+c|0,i[1]=i[1]+s|0,i[2]=i[2]+l|0,i[3]=i[3]+p|0,i[4]=i[4]+u|0,i[5]=i[5]+f|0,i[6]=i[6]+y|0,i[7]=i[7]+h|0}};var Cr={base64URLEncode:function(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}};class Dr{constructor(t,e){this.options={namespace:t.transaction.namespace+e},this.storage=new Ur(this.options)}set(t,e){this.storage.setItem(this.options.namespace+t,e,{expires:1/48})}get(t){const e=this.storage.getItem(this.options.namespace+t);return this.clear(t),e||{}}clear(t){this.storage.removeItem(this.options.namespace+t)}}class Tr{constructor(t){this.persister=new Dr(t,"redirect_uri_params")}persist(t){const e=new URL(t.redirect_uri),r=jr(e.search.substring(1)),o=jr(e.hash.substring(1));this.persister.set(t.state,{query_params:r,hash_params:o}),t.redirect_uri=e.origin+e.pathname}retrieve(t){var e,r;const o=this.persister.get(t,!1);if(!o)return;const n={...null!==(e=o.query_params)&&void 0!==e?e:{},...jr(window.location.search.substring(1))},i={...null!==(r=o.hash_params)&&void 0!==r?r:{},...jr(window.location.hash.substring(1))};let a=window.location.origin+window.location.pathname;n&&(a+="?"+Or(n)),i&&(a+="#"+Or(i)),window.history.replaceState({},document.title,a)}}
11
11
  /** @fileOverview
12
12
  * @author Auth0 https://github.com/auth0/auth0.js
13
13
  * @license MIT
14
- */var tr={string:function(t){const e=new Uint8Array(t),r=[],n="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",o=window.crypto||window.msCrypto;let i="";if(o)i=o.getRandomValues(e);else for(let e=0;e<t;e++)i+=n.charAt(Math.floor(65*Math.random()));for(let t=0;t<i.length;t++)r.push(n[i[t]%65]);return r.join("")}};return class{constructor(t={}){if(null==t.client_id)throw new Error("client id not provided");this.options=Object.assign({},{organization_id:"",prompt:"",response_type:"token",popup_flow:"auto",state:"",verify_state:!0,verify_callback:!0,scope:null,redirect_uri:"",email_hint:null,server_url:"https://accounts.livechat.com",tracking:{utm_source:"accounts.livechat.com",utm_medium:"accounts-sdk"},transaction:{namespace:"com.livechat.accounts",key_length:32,force_local_storage:!1},pkce:{enabled:!0,code_verifier_length:128,code_challange_method:"S256"}},t),this.transaction=new Qe(this.options),this.redirectUriParamsPersister=new Xe(this.options)}iframe(t={}){const e=Object.assign({},this.options,t);return new qe(this,e)}popup(t={}){const e=Object.assign({},this.options,t);return new i(this,e)}redirect(t={}){const e=Object.assign({},this.options,t);return new ze(this,e)}authorizeURL(t={},e=""){const r=Object.assign({},this.options,t);r.state||(r.state=tr.string(r.key_length)),r.redirect_uri||(r.redirect_uri=window.location.href);const n=We(r,["client_id","organization_id","redirect_uri","state","response_type","scope","prompt"]);Object.assign(n,r.tracking),null===n.scope&&delete n.scope,null!=e&&(n.flow=e),r.email_hint&&(n.email=r.email_hint);let o=r.server_url;if("manual"===r.popup_flow&&(o+="/signin"),r.path&&(o+=r.path),"code"===r.response_type&&r.pkce.enabled){const t=r.pkce.code_verifier||tr.string(r.pkce.code_verifier_length);if("S256"===r.pkce.code_challange_method){const e=Ye.hash.sha256.hash(t);Object.assign(n,{code_verifier:t,code_challenge:Ke.base64URLEncode(e),code_challenge_method:r.pkce.code_challange_method})}else Object.assign(n,{code_verifier:t,code_challenge:t,code_challenge_method:r.pkce.code_challange_method})}return this.transaction.generate(n),this.redirectUriParamsPersister.persist(n),delete n.code_verifier,o+"?"+Le(n)}verify(t){const e=this.transaction.get(t.state);return t.state&&this.options.verify_state&&e.state!=t.state?null:e}}}));
14
+ */function Br(t,e,r){let o="";for(let n=0;n<t;n++){const t=Math.floor(Math.random()*r);o+=e.charAt(t)}return o}var Lr={string:function(t){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",r=window.crypto||window.msCrypto;if(!(r&&"function"==typeof r.getRandomValues))return Br(t,e,65);const o=65*Math.floor(256/65);if(0===o)return Br(t,e,65);const n=[];for(;n.length<t;){const i=t-n.length,a=new Uint8Array(i);r.getRandomValues(a);for(let r=0;r<a.length&&n.length<t;r++){const t=a[r];t>=o||n.push(e.charAt(t%65))}}return n.join("")}};return class{constructor(t={}){if(null==t.client_id)throw new Error("client id not provided");this.options=Object.assign({},{organization_id:"",prompt:"",response_type:"token",popup_flow:"auto",state:"",verify_state:!0,verify_callback:!0,scope:null,redirect_uri:"",email_hint:null,server_url:"https://accounts.livechat.com",tracking:{utm_source:"accounts.livechat.com",utm_medium:"accounts-sdk"},transaction:{namespace:"com.livechat.accounts",key_length:32,force_local_storage:!1},pkce:{enabled:!0,code_verifier_length:128,code_challange_method:"S256"}},t),this.transaction=new Nr(this.options),this.redirectUriParamsPersister=new Tr(this.options)}iframe(t={}){const e=Object.assign({},this.options,t);return new kr(this,e)}popup(t={}){const e=Object.assign({},this.options,t);return new i(this,e)}redirect(t={}){const e=Object.assign({},this.options,t);return new xr(this,e)}authorizeURL(t={},e=""){const r=Object.assign({},this.options,t);r.state||(r.state=Lr.string(r.key_length)),r.redirect_uri||(r.redirect_uri=window.location.href);const o=Pr(r,["client_id","organization_id","redirect_uri","state","response_type","scope","prompt"]);Object.assign(o,r.tracking),null===o.scope&&delete o.scope,null!=e&&(o.flow=e),r.email_hint&&(o.email=r.email_hint);let n=r.server_url;if("manual"===r.popup_flow&&(n+="/signin"),r.path&&(n+=r.path),"code"===r.response_type&&r.pkce.enabled){const t=r.pkce.code_verifier||Lr.string(r.pkce.code_verifier_length);if("S256"===r.pkce.code_challange_method){const e=Fr.hash.sha256.hash(t);Object.assign(o,{code_verifier:t,code_challenge:Cr.base64URLEncode(e),code_challenge_method:r.pkce.code_challange_method})}else Object.assign(o,{code_verifier:t,code_challenge:t,code_challenge_method:r.pkce.code_challange_method})}return this.transaction.generate(o),this.redirectUriParamsPersister.persist(o),delete o.code_verifier,n+"?"+Or(o)}verify(t){const e=this.transaction.get(t.state);return t.state&&this.options.verify_state&&e.state!=t.state?null:e}}}));
15
15
  //# sourceMappingURL=accounts-sdk.min.js.map