@corva/dc-platform-shared 0.0.0-9dfc9bebbc → 0.0.0-9ea6c8e

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.
Files changed (77) hide show
  1. package/CLI/components/App/App.css.js +1 -1
  2. package/CLI/components/App/App.js +1 -1
  3. package/CLI/components/App/components/AppBar/AppBar.js +1 -1
  4. package/CLI/constants/index.js +1 -1
  5. package/CLI/context/auth.js +1 -1
  6. package/CLI/hocs/effects/useProvideAuth/api.js +1 -0
  7. package/CLI/hocs/effects/useProvideAuth/constants.js +1 -0
  8. package/CLI/hocs/effects/useProvideAuth/useProvideAuth.js +1 -1
  9. package/CLI/hocs/utils.js +1 -1
  10. package/CLI/hocs/withAppDataProviderHOC.js +1 -1
  11. package/CLI/hocs/withCLIAppSettingsHOC.js +1 -1
  12. package/CLI/hocs/withCorvaMagicHOC.js +1 -1
  13. package/CLI/hocs/withDevCenterRouterHOC.js +1 -1
  14. package/CLI/hocs/withGridLayoutHOC/withGridLayoutHOC.js +1 -1
  15. package/CLI/hocs/withPDFLayoutHOC.js +1 -1
  16. package/CLI/hocs/withReactRouterHOC.js +1 -1
  17. package/CLI/screens/LoginScreen/LoginScreen.js +1 -1
  18. package/CLI/screens/LoginScreen/components/Auth.js +1 -1
  19. package/CLI/screens/LoginScreen/components/AuthStep.js +1 -1
  20. package/CLI/screens/LoginScreen/components/EmailStep.js +1 -1
  21. package/CLI/screens/LoginScreen/components/SSOButton.js +1 -1
  22. package/CLI/screens/OAuthCallbackScreen/index.js +1 -1
  23. package/README.md +64 -15
  24. package/_virtual/arrayLikeToArray.js +1 -0
  25. package/_virtual/arrayWithHoles.js +1 -0
  26. package/_virtual/arrayWithoutHoles.js +1 -0
  27. package/_virtual/iterableToArray.js +1 -0
  28. package/_virtual/iterableToArrayLimit.js +1 -0
  29. package/_virtual/nonIterableRest.js +1 -0
  30. package/_virtual/nonIterableSpread.js +1 -0
  31. package/_virtual/regeneratorRuntime.js +1 -0
  32. package/_virtual/typeof.js +1 -0
  33. package/_virtual/unsupportedIterableToArray.js +1 -0
  34. package/cjs/devcenter/webpack/DevServerEntryPoint.js +1 -1
  35. package/cjs/devcenter/webpack/DevServerIsolatedAppEntryPoint.js +1 -1
  36. package/cjs/devcenter/webpack/constants.js +1 -1
  37. package/cjs/devcenter/webpack/plugins/checkCorvaUIVersion.js +1 -1
  38. package/cjs/devcenter/webpack/utils/middlewares.js +1 -1
  39. package/cjs/devcenter/webpack/utils/serializeDotEnv.js +1 -1
  40. package/cjs/devcenter/webpack/validators/dependencies.js +1 -1
  41. package/cjs/devcenter/webpack/validators/index.js +1 -1
  42. package/cjs/devcenter/webpack/webpack.config.common.js +1 -1
  43. package/cjs/devcenter/webpack/webpack.config.dev.js +1 -1
  44. package/cjs/devcenter/webpack/webpack.config.prod.js +1 -1
  45. package/clients/auth0/index.js +1 -1
  46. package/components/AppsGridDragHandle/AppsGridDragHandle.js +1 -1
  47. package/components/AppsGridDragHandle/AppsGridDragHandle.scss.js +1 -1
  48. package/components/GridLockButton/index.js +1 -1
  49. package/components/Login/components/Chip.js +1 -1
  50. package/components/Login/components/EmailField.js +1 -1
  51. package/components/Login/components/Login.js +1 -1
  52. package/components/Login/components/OrDivider.js +1 -1
  53. package/components/Login/components/PasswordField.js +1 -1
  54. package/components/Login/components/StepContent.js +1 -1
  55. package/components/Login/components/StepFooter.js +1 -1
  56. package/components/Login/components/StepHeader.js +1 -1
  57. package/components/Login/components/VerificationStep.js +1 -0
  58. package/components/Login/index.js +1 -1
  59. package/ext-cjs/@babel/runtime/helpers/arrayLikeToArray.js +1 -0
  60. package/ext-cjs/@babel/runtime/helpers/arrayWithHoles.js +1 -0
  61. package/ext-cjs/@babel/runtime/helpers/arrayWithoutHoles.js +1 -0
  62. package/ext-cjs/@babel/runtime/helpers/asyncToGenerator.js +1 -0
  63. package/ext-cjs/@babel/runtime/helpers/defineProperty.js +1 -0
  64. package/ext-cjs/@babel/runtime/helpers/iterableToArray.js +1 -0
  65. package/ext-cjs/@babel/runtime/helpers/iterableToArrayLimit.js +1 -0
  66. package/ext-cjs/@babel/runtime/helpers/nonIterableRest.js +1 -0
  67. package/ext-cjs/@babel/runtime/helpers/nonIterableSpread.js +1 -0
  68. package/ext-cjs/@babel/runtime/helpers/regeneratorRuntime.js +1 -0
  69. package/ext-cjs/@babel/runtime/helpers/slicedToArray.js +1 -0
  70. package/ext-cjs/@babel/runtime/helpers/toConsumableArray.js +1 -0
  71. package/ext-cjs/@babel/runtime/helpers/typeof.js +1 -0
  72. package/ext-cjs/@babel/runtime/helpers/unsupportedIterableToArray.js +1 -0
  73. package/ext-cjs/@babel/runtime/regenerator/index.js +1 -0
  74. package/ext-esm/auth0-js/dist/auth0.min.esm.js +1 -1
  75. package/package.json +1 -167
  76. package/utils/devcenter.js +1 -1
  77. package/utils/recaptcha.js +1 -1
@@ -1 +1 @@
1
- var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=e((function(e){var r,n;r=t,n=function(){return function(){return function(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=n():r.urljoin=n()})),n="undefined"!=typeof Symbol&&Symbol,o={foo:{}},i=Object,s=Object.prototype.toString,a=Math.max,c=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},u=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==s.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=a(0,e.length-n.length),i=[],u=0;u<o;u++)i[u]="$"+u;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,c(n,arguments));return Object(o)===o?o:this}return e.apply(t,c(n,arguments))})),e.prototype){var p=function(){};p.prototype=e.prototype,r.prototype=new p,p.prototype=null}return r},p=u.call(Function.call,Object.prototype.hasOwnProperty),l=SyntaxError,h=Function,f=TypeError,d=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},y=Object.getOwnPropertyDescriptor;if(y)try{y({},"")}catch(Rr){y=null}var m=function(){throw new f},g=y?function(){try{return m}catch(t){try{return y(arguments,"callee").get}catch(t){return m}}}():m,v="function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("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}(),b={__proto__:o}.foo===o.foo&&!({__proto__:null}instanceof i),w=Object.getPrototypeOf||(b?function(t){return t.__proto__}:null),_={},T="undefined"!=typeof Uint8Array&&w?w(Uint8Array):void 0,O={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":v&&w?w([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":_,"%AsyncGenerator%":_,"%AsyncGeneratorFunction%":_,"%AsyncIteratorPrototype%":_,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?void 0:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":_,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":v&&w?w(w([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&v&&w?w((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&v&&w?w((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":v&&w?w(""[Symbol.iterator]()):void 0,"%Symbol%":v?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":g,"%TypedArray%":T,"%TypeError%":f,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet};if(w)try{null.error}catch(Rr){var k=w(w(Rr));O["%Error.prototype%"]=k}var S={"%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"]},A=u.call(Function.call,Array.prototype.concat),x=u.call(Function.apply,Array.prototype.splice),j=u.call(Function.call,String.prototype.replace),E=u.call(Function.call,String.prototype.slice),C=u.call(Function.call,RegExp.prototype.exec),D=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,P=function(t,e){if("string"!=typeof t||0===t.length)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new f('"allowMissing" argument must be a boolean');if(null===C(/^%?[^%]*%?$/,t))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=E(t,0,1),r=E(t,-1);if("%"===e&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,D,(function(t,e,r,o){n[n.length]=r?j(o,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=function(t,e){var r,n=t;if(p(S,n)&&(n="%"+(r=S[n])[0]+"%"),p(O,n)){var o=O[n];if(o===_&&(o=function t(e){var r;if("%AsyncFunction%"===e)r=d("async function () {}");else if("%GeneratorFunction%"===e)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=d("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&w&&(r=w(o.prototype))}return O[e]=r,r}(n)),void 0===o&&!e)throw new f("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+t+" does not exist!")}("%"+n+"%",e),i=o.name,s=o.value,a=!1,c=o.alias;c&&(n=c[0],x(r,A([0,1],c)));for(var u=1,h=!0;u<r.length;u+=1){var m=r[u],g=E(m,0,1),v=E(m,-1);if(('"'===g||"'"===g||"`"===g||'"'===v||"'"===v||"`"===v)&&g!==v)throw new l("property names with quotes must have matching quotes");if("constructor"!==m&&h||(a=!0),p(O,i="%"+(n+="."+m)+"%"))s=O[i];else if(null!=s){if(!(m in s)){if(!e)throw new f("base intrinsic for "+t+" exists, but the property is not available.");return}if(y&&u+1>=r.length){var b=y(s,m);s=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[m]}else h=p(s,m),s=s[m];h&&!a&&(O[i]=s)}}return s},R=e((function(t){var e=P("%Function.prototype.apply%"),r=P("%Function.prototype.call%"),n=P("%Reflect.apply%",!0)||u.call(r,e),o=P("%Object.getOwnPropertyDescriptor%",!0),i=P("%Object.defineProperty%",!0),s=P("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var e=n(u,r,arguments);o&&i&&(o(e,"length").configurable&&i(e,"length",{value:1+s(0,t.length-(arguments.length-1))}));return e};var a=function(){return n(u,e,arguments)};i?i(t.exports,"apply",{value:a}):t.exports.apply=a})),q=(R.apply,R(P("String.prototype.indexOf"))),U=function(t,e){var r=P(t,!!e);return"function"==typeof r&&q(t,".prototype.")>-1?R(r):r},M=function(t){return t&&t.default||t}(Object.freeze({__proto__:null,default:{}})),L="function"==typeof Map&&Map.prototype,N=Object.getOwnPropertyDescriptor&&L?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,B=L&&N&&"function"==typeof N.get?N.get:null,H=L&&Map.prototype.forEach,F="function"==typeof Set&&Set.prototype,W=Object.getOwnPropertyDescriptor&&F?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,z=F&&W&&"function"==typeof W.get?W.get:null,V=F&&Set.prototype.forEach,$="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,J="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,G="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,X=Boolean.prototype.valueOf,Q=Object.prototype.toString,Z=Function.prototype.toString,K=String.prototype.match,Y=String.prototype.slice,tt=String.prototype.replace,et=String.prototype.toUpperCase,rt=String.prototype.toLowerCase,nt=RegExp.prototype.test,ot=Array.prototype.concat,it=Array.prototype.join,st=Array.prototype.slice,at=Math.floor,ct="function"==typeof BigInt?BigInt.prototype.valueOf:null,ut=Object.getOwnPropertySymbols,pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,lt="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ht="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,ft=Object.prototype.propertyIsEnumerable,dt=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function yt(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||nt.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-at(-t):at(t);if(n!==t){var o=String(n),i=Y.call(e,o.length+1);return tt.call(o,r,"$&_")+"."+tt.call(tt.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return tt.call(e,r,"$&_")}var mt=M.custom,gt=Ot(mt)?mt:null,vt=function t(e,r,n,o){var i=r||{};if(St(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(St(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 s=!St(i,"customInspect")||i.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(St(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(St(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=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 function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return t(Y.call(e,0,r.maxStringLength),r)+o}return bt(tt.call(tt.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,jt),"single",r)}(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var c=String(e);return a?yt(e,c):c}if("bigint"==typeof e){var u=String(e)+"n";return a?yt(e,u):u}var p=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=p&&p>0&&"object"==typeof e)return _t(e)?"[Array]":"[Object]";var l=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=it.call(Array(t.indent+1)," ")}return{base:r,prev:it.call(Array(e+1),r)}}(i,n);if(void 0===o)o=[];else if(xt(o,e)>=0)return"[Circular]";function h(e,r,s){if(r&&(o=st.call(o)).push(r),s){var a={depth:i.depth};return St(i,"quoteStyle")&&(a.quoteStyle=i.quoteStyle),t(e,a,n+1,o)}return t(e,i,n+1,o)}if("function"==typeof e&&!Tt(e)){var f=function(t){if(t.name)return t.name;var e=K.call(Z.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),d=Pt(e,h);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(d.length>0?" { "+it.call(d,", ")+" }":"")}if(Ot(e)){var y=lt?tt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(e);return"object"!=typeof e||lt?y:Et(y)}if(function(t){return!(!t||"object"!=typeof t)&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)}(e)){for(var m="<"+rt.call(String(e.nodeName)),g=e.attributes||[],v=0;v<g.length;v++)m+=" "+g[v].name+"="+bt(wt(g[v].value),"double",i);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+"</"+rt.call(String(e.nodeName))+">"}if(_t(e)){if(0===e.length)return"[]";var b=Pt(e,h);return l&&!function(t){for(var e=0;e<t.length;e++)if(xt(t[e],"\n")>=0)return!1;return!0}(b)?"["+It(b,l)+"]":"[ "+it.call(b,", ")+" ]"}if(function(t){return!("[object Error]"!==At(t)||ht&&"object"==typeof t&&ht in t)}(e)){var w=Pt(e,h);return"cause"in Error.prototype||!("cause"in e)||ft.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+it.call(w,", ")+" }":"{ ["+String(e)+"] "+it.call(ot.call("[cause]: "+h(e.cause),w),", ")+" }"}if("object"==typeof e&&s){if(gt&&"function"==typeof e[gt]&&M)return M(e,{depth:p-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!B||!t||"object"!=typeof t)return!1;try{B.call(t);try{z.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var _=[];return H&&H.call(e,(function(t,r){_.push(h(r,e,!0)+" => "+h(t,e))})),Dt("Map",B.call(e),_,l)}if(function(t){if(!z||!t||"object"!=typeof t)return!1;try{z.call(t);try{B.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var T=[];return V&&V.call(e,(function(t){T.push(h(t,e))})),Dt("Set",z.call(e),T,l)}if(function(t){if(!$||!t||"object"!=typeof t)return!1;try{$.call(t,$);try{J.call(t,J)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Ct("WeakMap");if(function(t){if(!J||!t||"object"!=typeof t)return!1;try{J.call(t,J);try{$.call(t,$)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Ct("WeakSet");if(function(t){if(!G||!t||"object"!=typeof t)return!1;try{return G.call(t),!0}catch(t){}return!1}(e))return Ct("WeakRef");if(function(t){return!("[object Number]"!==At(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(h(Number(e)));if(function(t){if(!t||"object"!=typeof t||!ct)return!1;try{return ct.call(t),!0}catch(t){}return!1}(e))return Et(h(ct.call(e)));if(function(t){return!("[object Boolean]"!==At(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(X.call(e));if(function(t){return!("[object String]"!==At(t)||ht&&"object"==typeof t&&ht in t)}(e))return Et(h(String(e)));if(!function(t){return!("[object Date]"!==At(t)||ht&&"object"==typeof t&&ht in t)}(e)&&!Tt(e)){var O=Pt(e,h),k=dt?dt(e)===Object.prototype:e instanceof Object||e.constructor===Object,S=e instanceof Object?"":"null prototype",A=!k&&ht&&Object(e)===e&&ht in e?Y.call(At(e),8,-1):S?"Object":"",x=(k||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(A||S?"["+it.call(ot.call([],A||[],S||[]),": ")+"] ":"");return 0===O.length?x+"{}":l?x+"{"+It(O,l)+"}":x+"{ "+it.call(O,", ")+" }"}return String(e)};function bt(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function wt(t){return tt.call(String(t),/"/g,"&quot;")}function _t(t){return!("[object Array]"!==At(t)||ht&&"object"==typeof t&&ht in t)}function Tt(t){return!("[object RegExp]"!==At(t)||ht&&"object"==typeof t&&ht in t)}function Ot(t){if(lt)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!pt)return!1;try{return pt.call(t),!0}catch(t){}return!1}var kt=Object.prototype.hasOwnProperty||function(t){return t in this};function St(t,e){return kt.call(t,e)}function At(t){return Q.call(t)}function xt(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 jt(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":"")+et.call(e.toString(16))}function Et(t){return"Object("+t+")"}function Ct(t){return t+" { ? }"}function Dt(t,e,r,n){return t+" ("+e+") {"+(n?It(r,n):it.call(r,", "))+"}"}function It(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+it.call(t,","+r)+"\n"+e.prev}function Pt(t,e){var r=_t(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=St(t,o)?e(t[o],t):""}var i,s="function"==typeof ut?ut(t):[];if(lt){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var c in t)St(t,c)&&(r&&String(Number(c))===c&&c<t.length||lt&&i["$"+c]instanceof Symbol||(nt.call(/[^\w$]/,c)?n.push(e(c,t)+": "+e(t[c],t)):n.push(c+": "+e(t[c],t))));if("function"==typeof ut)for(var u=0;u<s.length;u++)ft.call(t,s[u])&&n.push("["+e(s[u])+"]: "+e(t[s[u]],t));return n}var Rt=P("%TypeError%"),qt=P("%WeakMap%",!0),Ut=P("%Map%",!0),Mt=U("WeakMap.prototype.get",!0),Lt=U("WeakMap.prototype.set",!0),Nt=U("WeakMap.prototype.has",!0),Bt=U("Map.prototype.get",!0),Ht=U("Map.prototype.set",!0),Ft=U("Map.prototype.has",!0),Wt=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},zt=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new Rt("Side channel does not contain "+vt(t))},get:function(n){if(qt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Mt(t,n)}else if(Ut){if(e)return Bt(e,n)}else if(r)return function(t,e){var r=Wt(t,e);return r&&r.value}(r,n)},has:function(n){if(qt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Nt(t,n)}else if(Ut){if(e)return Ft(e,n)}else if(r)return function(t,e){return!!Wt(t,e)}(r,n);return!1},set:function(n,o){qt&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new qt),Lt(t,n,o)):Ut?(e||(e=new Ut),Ht(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=Wt(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n},Vt=String.prototype.replace,$t=/%20/g,Jt="RFC3986",Gt={default:Jt,formatters:{RFC1738:function(t){return Vt.call(t,$t,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:Jt},Xt=Object.prototype.hasOwnProperty,Qt=Array.isArray,Zt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Kt=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},Yt={arrayToObject:Kt,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],s=Object.keys(i),a=0;a<s.length;++a){var c=s[a],u=i[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:i,prop:c}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Qt(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 s="",a=0;a<i.length;++a){var c=i.charCodeAt(a);45===c||46===c||95===c||126===c||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===Gt.RFC1738&&(40===c||41===c)?s+=i.charAt(a):c<128?s+=Zt[c]:c<2048?s+=Zt[192|c>>6]+Zt[128|63&c]:c<55296||c>=57344?s+=Zt[224|c>>12]+Zt[128|c>>6&63]+Zt[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&i.charCodeAt(a)),s+=Zt[240|c>>18]+Zt[128|c>>12&63]+Zt[128|c>>6&63]+Zt[128|63&c])}return s},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(Qt(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(Qt(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!Xt.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return Qt(e)&&!Qt(r)&&(o=Kt(e,n)),Qt(e)&&Qt(r)?(r.forEach((function(r,o){if(Xt.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 Xt.call(e,o)?e[o]=t(e[o],i,n):e[o]=i,e}),o)}},te=Object.prototype.hasOwnProperty,ee={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},re=Array.isArray,ne=Array.prototype.push,oe=function(t,e){ne.apply(t,re(e)?e:[e])},ie=Date.prototype.toISOString,se=Gt.default,ae={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Yt.encode,encodeValuesOnly:!1,format:se,formatter:Gt.formatters[se],indices:!1,serializeDate:function(t){return ie.call(t)},skipNulls:!1,strictNullHandling:!1},ce={},ue=function t(e,r,n,o,i,s,a,c,u,p,l,h,f,d,y,m){for(var g=e,v=m,b=0,w=!1;void 0!==(v=v.get(ce))&&!w;){var _=v.get(e);if(b+=1,void 0!==_){if(_===b)throw new RangeError("Cyclic object value");w=!0}void 0===v.get(ce)&&(b=0)}if("function"==typeof c?g=c(r,g):g instanceof Date?g=l(g):"comma"===n&&re(g)&&(g=Yt.maybeMap(g,(function(t){return t instanceof Date?l(t):t}))),null===g){if(i)return a&&!d?a(r,ae.encoder,y,"key",h):r;g=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(g)||Yt.isBuffer(g))return a?[f(d?r:a(r,ae.encoder,y,"key",h))+"="+f(a(g,ae.encoder,y,"value",h))]:[f(r)+"="+f(String(g))];var T,O=[];if(void 0===g)return O;if("comma"===n&&re(g))d&&a&&(g=Yt.maybeMap(g,a)),T=[{value:g.length>0?g.join(",")||null:void 0}];else if(re(c))T=c;else{var k=Object.keys(g);T=u?k.sort(u):k}for(var S=o&&re(g)&&1===g.length?r+"[]":r,A=0;A<T.length;++A){var x=T[A],j="object"==typeof x&&void 0!==x.value?x.value:g[x];if(!s||null!==j){var E=re(g)?"function"==typeof n?n(S,x):S:S+(p?"."+x:"["+x+"]");m.set(e,b);var C=zt();C.set(ce,m),oe(O,t(j,E,n,o,i,s,"comma"===n&&d&&re(g)?null:a,c,u,p,l,h,f,d,y,C))}}return O},pe=Object.prototype.hasOwnProperty,le=Array.isArray,he={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Yt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},fe=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},de=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},ye=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),a=s?o.slice(0,s.index):o,c=[];if(a){if(!r.plainObjects&&pe.call(Object.prototype,a)&&!r.allowPrototypes)return;c.push(a)}for(var u=0;r.depth>0&&null!==(s=i.exec(o))&&u<r.depth;){if(u+=1,!r.plainObjects&&pe.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(s[1])}return s&&c.push("["+o.slice(s.index)+"]"),function(t,e,r,n){for(var o=n?e:de(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=o:"__proto__"!==c&&(s[c]=o):s={0:o}}o=s}return o}(c,e,r,n)}},me={formats:Gt,parse:function(t,e){var r=function(t){if(!t)return he;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?he.charset:t.charset;return{allowDots:void 0===t.allowDots?he.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:he.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:he.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:he.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:he.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:he.comma,decoder:"function"==typeof t.decoder?t.decoder:he.decoder,delimiter:"string"==typeof t.delimiter||Yt.isRegExp(t.delimiter)?t.delimiter:he.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:he.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:he.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:he.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:he.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:he.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,s=o.split(e.delimiter,i),a=-1,c=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?c="utf-8":"utf8=%26%2310003%3B"===s[r]&&(c="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var u,p,l=s[r],h=l.indexOf("]="),f=-1===h?l.indexOf("="):h+1;-1===f?(u=e.decoder(l,he.decoder,c,"key"),p=e.strictNullHandling?null:""):(u=e.decoder(l.slice(0,f),he.decoder,c,"key"),p=Yt.maybeMap(de(l.slice(f+1),e),(function(t){return e.decoder(t,he.decoder,c,"value")}))),p&&e.interpretNumericEntities&&"iso-8859-1"===c&&(p=fe(p)),l.indexOf("[]=")>-1&&(p=le(p)?[p]:p),pe.call(n,u)?n[u]=Yt.combine(n[u],p):n[u]=p}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s<i.length;++s){var a=i[s],c=ye(a,n[a],r,"string"==typeof t);o=Yt.merge(o,c,r)}return!0===r.allowSparse?o:Yt.compact(o)},stringify:function(t,e){var r,n=t,o=function(t){if(!t)return ae;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||ae.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=Gt.default;if(void 0!==t.format){if(!te.call(Gt.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=Gt.formatters[r],o=ae.filter;return("function"==typeof t.filter||re(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:ae.addQueryPrefix,allowDots:void 0===t.allowDots?ae.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:ae.charsetSentinel,delimiter:void 0===t.delimiter?ae.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:ae.encode,encoder:"function"==typeof t.encoder?t.encoder:ae.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:ae.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:ae.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:ae.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:ae.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):re(o.filter)&&(r=o.filter);var i,s=[];if("object"!=typeof n||null===n)return"";i=e&&e.arrayFormat in ee?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=ee[i];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c="comma"===a&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var u=zt(),p=0;p<r.length;++p){var l=r[p];o.skipNulls&&null===n[l]||oe(s,ue(n[l],l,a,c,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,u))}var h=s.join(o.delimiter),f=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),h.length>0?f+h:""}},ge=e((function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})),ve=Te;Te.default=Te,Te.stable=Se,Te.stableStringify=Se;var be=[],we=[];function _e(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Te(t,e,r,n){var o;void 0===n&&(n=_e()),function t(e,r,n,o,i,s,a){var c;if(s+=1,"object"==typeof e&&null!==e){for(c=0;c<o.length;c++)if(o[c]===e)return void Oe("[Circular]",e,r,i);if(void 0!==a.depthLimit&&s>a.depthLimit)return void Oe("[...]",e,r,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void Oe("[...]",e,r,i);if(o.push(e),Array.isArray(e))for(c=0;c<e.length;c++)t(e[c],c,c,o,e,s,a);else{var u=Object.keys(e);for(c=0;c<u.length;c++){var p=u[c];t(e[p],p,c,o,e,s,a)}}o.pop()}}(t,"",0,[],void 0,0,n);try{o=0===we.length?JSON.stringify(t,e,r):JSON.stringify(t,Ae(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==be.length;){var i=be.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function Oe(t,e,r,n){var o=Object.getOwnPropertyDescriptor(n,r);void 0!==o.get?o.configurable?(Object.defineProperty(n,r,{value:t}),be.push([n,r,e,o])):we.push([e,r,t]):(n[r]=t,be.push([n,r,e]))}function ke(t,e){return t<e?-1:t>e?1:0}function Se(t,e,r,n){void 0===n&&(n=_e());var o,i=function t(e,r,n,o,i,s,a){var c;if(s+=1,"object"==typeof e&&null!==e){for(c=0;c<o.length;c++)if(o[c]===e)return void Oe("[Circular]",e,r,i);try{if("function"==typeof e.toJSON)return}catch(t){return}if(void 0!==a.depthLimit&&s>a.depthLimit)return void Oe("[...]",e,r,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void Oe("[...]",e,r,i);if(o.push(e),Array.isArray(e))for(c=0;c<e.length;c++)t(e[c],c,c,o,e,s,a);else{var u={},p=Object.keys(e).sort(ke);for(c=0;c<p.length;c++){var l=p[c];t(e[l],l,c,o,e,s,a),u[l]=e[l]}if(void 0===i)return u;be.push([i,r,e]),i[r]=u}o.pop()}}(t,"",0,[],void 0,0,n)||t;try{o=0===we.length?JSON.stringify(i,e,r):JSON.stringify(i,Ae(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==be.length;){var s=be.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function Ae(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(we.length>0)for(var n=0;n<we.length;n++){var o=we[n];if(o[1]===e&&o[0]===r){r=o[2],we.splice(n,1);break}}return t.call(this,e,r)}}var xe=e((function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){var e,r={},o=n(t.split(/ *; */));try{for(o.s();!(e=o.n()).done;){var i=e.value.split(/ *= */),s=i.shift(),a=i.shift();s&&a&&(r[s]=a)}}catch(t){o.e(t)}finally{o.f()}return r},e.parseLinks=function(t){var e,r={},o=n(t.split(/ *, */));try{for(o.s();!(e=o.n()).done;){var i=e.value.split(/ *; */),s=i[0].slice(1,-1);r[i[1].split(/ *= */)[1].slice(1,-1)]=s}}catch(t){o.e(t)}finally{o.f()}return r},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t},e.isObject=function(t){return null!==t&&"object"===r(t)},e.hasOwn=Object.hasOwn||function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(new Object(t),e)},e.mixin=function(t,r){for(var n in r)e.hasOwn(r,n)&&(t[n]=r[n])}}));function je(t){return(je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}xe.type,xe.params,xe.parseLinks,xe.cleanHeader,xe.isObject,xe.hasOwn,xe.mixin;var Ee=xe.isObject,Ce=xe.hasOwn,De=Ie;function Ie(){}Ie.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},Ie.prototype.parse=function(t){return this._parser=t,this},Ie.prototype.responseType=function(t){return this._responseType=t,this},Ie.prototype.serialize=function(t){return this._serializer=t,this},Ie.prototype.timeout=function(t){if(!t||"object"!==je(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Ce(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},Ie.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var Pe=new Set(["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"]),Re=new Set([408,413,429,500,502,503,504,521,522,524]);Ie.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&Re.has(e.status))return!0;if(t){if(t.code&&Pe.has(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},Ie.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},Ie.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},Ie.prototype.catch=function(t){return this.then(void 0,t)},Ie.prototype.use=function(t){return t(this),this},Ie.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},Ie.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},Ie.prototype.get=function(t){return this._header[t.toLowerCase()]},Ie.prototype.getHeader=Ie.prototype.get,Ie.prototype.set=function(t,e){if(Ee(t)){for(var r in t)Ce(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},Ie.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},Ie.prototype.field=function(t,e,r){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(Ee(t)){for(var n in t)Ce(t,n)&&this.field(n,t[n]);return this}if(Array.isArray(e)){for(var o in e)Ce(e,o)&&this.field(t,e[o]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),r?this._getFormData().append(t,e,r):this._getFormData().append(t,e),this},Ie.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(M.gte(process.version,"v13.0.0")&&M.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");M.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this},Ie.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},Ie.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},Ie.prototype.redirects=function(t){return this._maxRedirects=t,this},Ie.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},Ie.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},Ie.prototype.send=function(t){var e=Ee(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&Ee(this._data))for(var n in t)Ce(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),(r=this._header["content-type"])&&(r=r.toLowerCase().trim()),this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},Ie.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},Ie.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},Ie.prototype._appendQueryString=function(){console.warn("Unsupported")},Ie.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},Ie.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var qe=Ue;function Ue(){}function Me(t){return function(t){if(Array.isArray(t))return Ne(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Le(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(t,e){if(t){if("string"==typeof t)return Ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ne(t,e):void 0}}function Ne(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Be(){this._defaults=[]}Ue.prototype.get=function(t){return this.header[t.toLowerCase()]},Ue.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=xe.type(e);var r=xe.params(e);for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{t.link&&(this.links=xe.parseLinks(t.link))}catch(t){}},Ue.prototype._setStatusProperties=function(t){var e=Math.trunc(t/100);this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t};for(var He=function(){var t=We[Fe];Be.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}},Fe=0,We=["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"];Fe<We.length;Fe++)He();Be.prototype._setDefaults=function(t){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Le(t))){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw i}}}}(this._defaults);try{for(r.s();!(e=r.n()).done;){var n=e.value;t[n.fn].apply(t,Me(n.args))}}catch(t){r.e(t)}finally{r.f()}};for(var ze=Be,Ve=e((function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;var i=xe.isObject,s=xe.mixin,a=xe.hasOwn;function c(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var u=e=t.exports;e.Request=m,u.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function l(t){if(!i(t))return t;var e=[];for(var r in t)a(t,r)&&h(e,r,t[r]);return e.join("&")}function h(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r)){var o,s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}(r);try{for(s.s();!(o=s.n()).done;)h(t,e,o.value)}catch(t){s.e(t)}finally{s.f()}}else if(i(r))for(var c in r)a(r,c)&&h(t,"".concat(e,"[").concat(c,"]"),r[c]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function f(t){for(var e,r,n={},o=t.split("&"),i=0,s=o.length;i<s;++i)-1===(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function d(t){return/[/+]json($|[^-\w])/i.test(t)}function y(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),s={},a=0,c=i.length;a<c;++a)-1!==(e=(r=i[a]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=p(r.slice(e+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function m(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new y(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}u.serializeObject=l,u.parseString=f,u.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},u.serialize={"application/x-www-form-urlencoded":me.stringify,"application/json":ve},u.parse={"application/x-www-form-urlencoded":f,"application/json":JSON.parse},s(y.prototype,qe.prototype),y.prototype._parseBody=function(t){var e=u.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&d(this.type)&&(e=u.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},y.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},u.Response=y,ge(m.prototype),s(m.prototype,De.prototype),m.prototype.type=function(t){return this.set("Content-Type",u.types[t]||t),this},m.prototype.accept=function(t){return this.set("Accept",u.types[t]||t),this},m.prototype.auth=function(t,e,n){1===arguments.length&&(e=""),"object"===r(e)&&null!==e&&(n=e,e=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var o=n.encoder?n.encoder:function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,n,o)},m.prototype.query=function(t){return"string"!=typeof t&&(t=l(t)),t&&this._query.push(t),this},m.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},m.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},m.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},m.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},m.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},m.prototype.ca=m.prototype.agent,m.prototype.buffer=m.prototype.ca,m.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},m.prototype.pipe=m.prototype.write,m.prototype._isHost=function(t){return t&&"object"===r(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},m.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||c,this._finalizeQueryString(),this._end()},m.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},m.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=u.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.addEventListener("readystatechange",(function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}}));var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||u.serialize[o?o.split(";")[0]:""];!i&&d(o)&&(i=u.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!==this.header[s]&&a(this.header,s)&&e.setRequestHeader(s,this.header[s]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},u.agent=function(){return new ze};for(var g=function(){var t=b[v];ze.prototype[t.toLowerCase()]=function(e,r){var n=new u.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}},v=0,b=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];v<b.length;v++)g();function w(t,e,r){var n=u("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}ze.prototype.del=ze.prototype.delete,u.get=function(t,e,r){var n=u("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},u.head=function(t,e,r){var n=u("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},u.options=function(t,e,r){var n=u("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},u.del=w,u.delete=w,u.patch=function(t,e,r){var n=u("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},u.post=function(t,e,r){var n=u("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},u.put=function(t,e,r){var n=u("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}})),$e=(Ve.Request,[]),Je=[],Ge=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Xe=0;Xe<64;++Xe)$e[Xe]=Ge[Xe],Je[Ge.charCodeAt(Xe)]=Xe;function Qe(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function Ze(t,e,r){for(var n,o,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push($e[(o=n)>>18&63]+$e[o>>12&63]+$e[o>>6&63]+$e[63&o]);return i.join("")}Je["-".charCodeAt(0)]=62,Je["_".charCodeAt(0)]=63;var Ke=function(t){for(var e,r=t.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(Ze(t,i,i+16383>s?s:i+16383));return 1===n?(e=t[r-1],o.push($e[e>>2]+$e[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push($e[e>>10]+$e[e>>4&63]+$e[e<<2&63]+"=")),o.join("")},Ye=function(t){return Ke(function(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}(t)).replace(/\+/g,"-").replace(/\//g,"_")},tr={raw:"9.24.1"},er=Object.prototype.toString;function rr(t,e,r,n){if(r="array"===r?"object":r,t&&typeof t[e]!==r)throw new Error(n)}function nr(t,e,r){if(typeof t!==e)throw new Error(r)}function or(t,e,r){if(-1===e.indexOf(t))throw new Error(r)}var ir={check:function(t,e,r){if(e.optional&&!t||nr(t,e.type,e.message),"object"===e.type&&r)for(var n=Object.keys(r),o=0;o<n.length;o++){var i=n[o];r[i].optional&&!t[i]||r[i].condition&&!r[i].condition(t)||(rr(t,i,r[i].type,r[i].message),r[i].values&&or(t[i],r[i].values,r[i].value_message))}},attribute:rr,variable:nr,value:or,isArray:function(t){return this.supportsIsArray()?Array.isArray(t):"[object Array]"===er.call(t)},supportsIsArray:function(){return null!=Array.isArray}};function sr(t){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var o=Object.keys(Object(n)),i=0,s=o.length;i<s;i++){var a=o[i],c=Object.getOwnPropertyDescriptor(n,a);void 0!==c&&c.enumerable&&(e[a]=n[a])}}return e}var ar={get:function(){return Object.assign?Object.assign:sr},objectAssignPolyfill:sr};function cr(t,e){return e.reduce((function(e,r){return t[r]&&(e[r]=t[r]),e}),{})}function ur(){var t=function(t){var e=[];for(var r in t)e.push(t[r]);return e}(arguments);return t.unshift({}),ar.get().apply(void 0,t)}function pr(t){var e=t.match(/^(https?:|file:|chrome-extension:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);return e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],pathname:e[5],search:e[6],hash:e[7]}}function lr(t,e){var r=ur(t);return t[e]&&(r[e]=t[e].trim()),r}var hr={toSnakeCase:function t(e,r){return"object"!=typeof e||ir.isArray(e)||null===e?e:(r=r||[],Object.keys(e).reduce((function(n,o){return n[-1===r.indexOf(o)?function(t){for(var e,r="",n=0,o=!0,i=!0;n<t.length;)e=t.charCodeAt(n),!i&&e>=65&&e<=90||!o&&e>=48&&e<=57?(r+="_",r+=t[n].toLowerCase()):r+=t[n].toLowerCase(),o=e>=48&&e<=57,i=e>=65&&e<=90,n++;return r}(o):o]=t(e[o]),n}),{}))},toCamelCase:function t(e,r,n){return"object"!=typeof e||ir.isArray(e)||null===e?e:(r=r||[],n=n||{},Object.keys(e).reduce((function(o,i){var s,a=-1===r.indexOf(i)?(s=i.split("_")).reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}),s.shift()):i;return o[a]=t(e[a]||e[i],[],n),n.keepOriginal&&(o[i]=t(e[i],[],n)),o}),{}))},blacklist:function(t,e){return Object.keys(t).reduce((function(r,n){return-1===e.indexOf(n)&&(r[n]=t[n]),r}),{})},merge:function(t,e){return{base:e?cr(t,e):t,with:function(t,e){return t=e?cr(t,e):t,ur(this.base,t)}}},pick:cr,getKeysNotIn:function(t,e){var r=[];for(var n in t)-1===e.indexOf(n)&&r.push(n);return r},extend:ur,getOriginFromUrl:function(t){if(t){var e=pr(t);if(!e)return null;var r=e.protocol+"//"+e.hostname;return e.port&&(r+=":"+e.port),r}},getLocationFromUrl:pr,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(lr,t)}(t)},updatePropertyOn:function t(e,r,n){"string"==typeof r&&(r=r.split("."));var o=r[0];e.hasOwnProperty(o)&&(1===r.length?e[o]=n:t(e[o],r.slice(1),n))}};function fr(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function dr(t){this.request=t}function yr(t){this._sendTelemetry=!1!==t._sendTelemetry||t._sendTelemetry,this._telemetryInfo=t._telemetryInfo||null,this._timesToRetryFailedRequests=t._timesToRetryFailedRequests,this.headers=t.headers||{},this._universalLoginPage=t.universalLoginPage}function mr(){return window}fr.prototype.abort=function(){this.request.abort()},fr.prototype.getMethod=function(){return this.method},fr.prototype.getBody=function(){return this.body},fr.prototype.getUrl=function(){return this.url},fr.prototype.getHeaders=function(){return this.headers},dr.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},dr.prototype.send=function(t){return this.request=this.request.send(hr.trimUserDetails(t)),this},dr.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},dr.prototype.end=function(t){return this.request.end(t),new fr(this.request)},yr.prototype.setCommonConfiguration=function(t,e){if(e=e||{},this._timesToRetryFailedRequests>0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var r=this.headers;t=t.set("Content-Type","application/json"),e.xRequestLanguage&&(t=t.set("X-Request-Language",e.xRequestLanguage));for(var n=Object.keys(this.headers),o=0;o<n.length;o++)t=t.set(n[o],r[n[o]]);return this._sendTelemetry&&(t=t.set("Auth0-Client",this.getTelemetryData())),t},yr.prototype.getTelemetryData=function(){var t=this._universalLoginPage?"auth0.js-ulp":"auth0.js",e={name:t,version:tr.raw};this._telemetryInfo&&((e=hr.extend({},this._telemetryInfo)).env=hr.extend({},this._telemetryInfo.env),e.env[t]=tr.raw);var r=JSON.stringify(e);return Ye(r)},yr.prototype.get=function(t,e){return new dr(this.setCommonConfiguration(Ve.get(t),e))},yr.prototype.post=function(t,e){return new dr(this.setCommonConfiguration(Ve.post(t),e))},yr.prototype.patch=function(t,e){return new dr(this.setCommonConfiguration(Ve.patch(t),e))};var gr={redirect:function(t){mr().location=t},getDocument:function(){return mr().document},getWindow:mr,getOrigin:function(){var t=mr().location,e=t.origin;return e||(e=hr.getOriginFromUrl(t.href)),e}};function vr(){}vr.prototype.getItem=function(){return null},vr.prototype.removeItem=function(){},vr.prototype.setItem=function(){};var br=e((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 s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}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 a="";for(var c in i)i[c]&&(a+="; "+c,!0!==i[c]&&(a+="="+i[c].split(";")[0]));return document.cookie=e+"="+r+a}}function s(t,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var a=i[s].split("="),c=a.slice(1).join("=");r||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var u=e(a[0]);if(c=(n.read||n)(c,u)||e(c),r)try{c=JSON.parse(c)}catch(t){}if(o[u]=c,t===u)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return s(t,!1)},o.getJSON=function(t){return s(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))},t.exports=r()}));function wr(t){return"_"+t+"_compat"}function _r(t){this._options=t||{}}function Tr(t){this.disableWarnings=t.disableWarnings}function Or(t){if(this.warn=new Tr({}),this.storage=new _r(t),!0===t.__tryLocalStorageFirst)try{var e=gr.getWindow().localStorage;e&&(this.storage=e)}catch(t){this.warn.warning(t),this.warn.warning("Can't use localStorage. Using CookieStorage instead.")}}function kr(t){this.handler=new Or(t)}function Sr(t){this.storage=new kr(t)}function Ar(t,e){return{error:t,errorDescription:e}}_r.prototype.getItem=function(t){return br.get(t)||br.get(wr(t))},_r.prototype.removeItem=function(t){var e={};this._options.cookieDomain&&(e.domain=this._options.cookieDomain),br.remove(t,e),br.remove(wr(t),e)},_r.prototype.setItem=function(t,e,r){var n=hr.extend({expires:1},r);if("https:"===gr.getWindow().location.protocol&&(n.secure=!0,n.sameSite="none",this._options.legacySameSiteCookie)){var o=hr.blacklist(n,["sameSite"]);br.set(wr(t),e,o)}this._options.cookieDomain&&(n.domain=this._options.cookieDomain),br.set(t,e,n)},Tr.prototype.warning=function(t){this.disableWarnings||console.warn(t)},Or.prototype.failover=function(){this.storage instanceof vr?this.warn.warning("DummyStorage: ignore failover"):this.storage instanceof _r?(this.warn.warning("CookieStorage: failing over DummyStorage"),this.storage=new vr):(this.warn.warning("LocalStorage: failing over CookieStorage"),this.storage=new _r)},Or.prototype.getItem=function(t){try{return this.storage.getItem(t)}catch(e){return this.warn.warning(e),this.failover(),this.getItem(t)}},Or.prototype.removeItem=function(t){try{return this.storage.removeItem(t)}catch(e){return this.warn.warning(e),this.failover(),this.removeItem(t)}},Or.prototype.setItem=function(t,e,r){try{return this.storage.setItem(t,e,r)}catch(n){return this.warn.warning(n),this.failover(),this.setItem(t,e,r)}},kr.prototype.getItem=function(t){var e=this.handler.getItem(t);try{return JSON.parse(e)}catch(t){return e}},kr.prototype.removeItem=function(t){return this.handler.removeItem(t)},kr.prototype.setItem=function(t,e,r){var n=JSON.stringify(e);return this.handler.setItem(t,n,r)},Sr.prototype.set=function(t,e){var r={lastUsedConnection:t,lastUsedSub:e};this.storage.setItem("auth0.ssodata",JSON.stringify(r))},Sr.prototype.get=function(){var t=this.storage.getItem("auth0.ssodata");if(t)return JSON.parse(t)};var xr={buildResponse:Ar,invalidToken:function(t){return Ar("invalid_token",t)}};function jr(t,e){return(e=e||{}).ignoreCasing=!!e.ignoreCasing&&e.ignoreCasing,function(r,n){var o;return r||n?(!r&&n.err&&(r=n.err,n=null),!r&&n.error&&(r=n,n=null),r?(o={original:r},hr.updatePropertyOn(o,"original.response.req._data.password","*****"),r.response&&r.response.statusCode&&(o.statusCode=r.response.statusCode),r.response&&r.response.statusText&&(o.statusText=r.response.statusText),r.response&&r.response.body&&(r=r.response.body),r.err&&(r=r.err),o.code=r.code||r.error||r.error_code||r.status||null,o.description=r.errorDescription||r.error_description||r.description||r.error||r.details||r.err||null,e.forceLegacyError&&(o.error=o.code,o.error_description=o.description),r.error_codes&&r.error_details&&(o.errorDetails={codes:r.error_codes,details:r.error_details}),r.name&&(o.name=r.name),r.policy&&(o.policy=r.policy),t(o)):!n.type||"text/html"!==n.type&&"text/plain"!==n.type?e.ignoreCasing?t(null,n.body||n):t(null,hr.toCamelCase(n.body||n,[],{keepOriginal:e.keepOriginalCasing})):t(null,n.text)):t(xr.buildResponse("generic_error","Something went wrong"))}}var Er=["realm","audience","otp","client_id","client_secret","redirect_uri","scope","code","grant_type","username","password","refresh_token","assertion","client_assertion","client_assertion_type","code_verifier"],Cr=["connection","connection_scope","auth0Client","owp","device","realm","organization","invitation","protocol","_csrf","_intstate","login_ticket","client_id","response_type","response_mode","redirect_uri","audience","scope","state","nonce","display","prompt","screen_hint","max_age","ui_locales","claims_locales","id_token_hint","login_hint","acr_values","claims","registration","request","request_uri","code_challenge","code_challenge_method","access_type","display"],Dr=function(t,e){return hr.pick(e,Er)},Ir=function(t,e){var r=hr.getKeysNotIn(e,Cr);return r.length>0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+r.join(",")+"]"),e},Pr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Rr(t){var e={exports:{}};return t(e,e.exports),e.exports}var qr=Rr((function(t,e){t.exports=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,n=void 0,o=void 0,i=function(t,e){h[r]=t,h[r+1]=e,2===(r+=2)&&(o?o(f):v())},s="undefined"!=typeof window?window:void 0,a=s||{},c=a.MutationObserver||a.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),p="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var t=setTimeout;return function(){return t(f,1)}}var h=new Array(1e3);function f(){for(var t=0;t<r;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;r=0}var d,y,m,g,v=void 0;function b(t,e){var r=this,n=new this.constructor(T);void 0===n[_]&&P(n);var o=r._state;if(o){var s=arguments[o-1];i((function(){return D(o,n,s,r._result)}))}else E(r,n,t,e);return n}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(T);return S(e,t),e}v=u?function(){return process.nextTick(f)}:c?(y=0,m=new c(f),g=document.createTextNode(""),m.observe(g,{characterData:!0}),function(){g.data=y=++y%2}):p?((d=new MessageChannel).port1.onmessage=f,function(){return d.port2.postMessage(0)}):void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(n=t.runOnLoop||t.runOnContext)?function(){n(f)}:l()}catch(t){return l()}}():l();var _=Math.random().toString(36).substring(2);function T(){}var O=void 0;function k(e,r,n){r.constructor===e.constructor&&n===b&&r.constructor.resolve===w?function(t,e){1===e._state?x(t,e._result):2===e._state?j(t,e._result):E(e,void 0,(function(e){return S(t,e)}),(function(e){return j(t,e)}))}(e,r):void 0===n?x(e,r):t(n)?function(t,e,r){i((function(t){var n=!1,o=function(r,o,i,s){try{r.call(o,(function(r){n||(n=!0,e!==r?S(t,r):x(t,r))}),(function(e){n||(n=!0,j(t,e))}))}catch(t){return t}}(r,e);!n&&o&&(n=!0,j(t,o))}),t)}(e,r,n):x(e,r)}function S(t,e){if(t===e)j(t,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(n=e),null===n||"object"!==o&&"function"!==o)x(t,e);else{var r=void 0;try{r=e.then}catch(e){return void j(t,e)}k(t,e,r)}var n,o}function A(t){t._onerror&&t._onerror(t._result),C(t)}function x(t,e){t._state===O&&(t._result=e,t._state=1,0!==t._subscribers.length&&i(C,t))}function j(t,e){t._state===O&&(t._state=2,t._result=e,i(A,t))}function E(t,e,r,n){var o=t._subscribers,s=o.length;t._onerror=null,o[s]=e,o[s+1]=r,o[s+2]=n,0===s&&t._state&&i(C,t)}function C(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)o=e[s+r],(n=e[s])?D(r,n,o,i):o(i);t._subscribers.length=0}}function D(e,r,n,o){var i=t(n),s=void 0,a=void 0,c=!0;if(i){try{s=n(o)}catch(e){c=!1,a=e}if(r===s)return void j(r,new TypeError("A promises callback cannot return that same promise."))}else s=o;r._state!==O||(i&&c?S(r,s):!1===c?j(r,a):1===e?x(r,s):2===e&&j(r,s))}var I=0;function P(t){t[_]=I++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,r){this._instanceConstructor=t,this.promise=new t(T),this.promise[_]||P(this.promise),e(r)?(this.length=r.length,this._remaining=r.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&x(this.promise,this._result))):j(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===O&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===w){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(t){s=!0,i=t}if(o===b&&t._state!==O)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===q){var a=new r(T);s?j(a,i):k(a,t,o),this._willSettleAt(a,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===O&&(this._remaining--,2===t?j(n,r):this._result[e]=r),0===this._remaining&&x(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;E(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}(),q=function(){function e(t){this[_]=I++,this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){S(t,e)}),(function(e){j(t,e)}))}catch(e){j(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return q.prototype.then=b,q.all=function(t){return new R(this,t).promise},q.race=function(t){var r=this;return e(t)?new r((function(e,n){for(var o=t.length,i=0;i<o;i++)r.resolve(t[i]).then(e,n)})):new r((function(t,e){return e(new TypeError("You must pass an array to race."))}))},q.resolve=w,q.reject=function(t){var e=new this(T);return j(e,t),e},q._setScheduler=function(t){o=t},q._setAsap=function(t){i=t},q._asap=i,q.polyfill=function(){var t=void 0;if(void 0!==Pr)t=Pr;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=q},q.Promise=q,q}()})),Ur={__proto__:null,default:{}},Mr=Rr((function(t,e){var r;t.exports=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==Pr&&Pr.crypto&&(r=Pr.crypto),!r)try{r=Ur}catch(t){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},s=i.lib={},a=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||p).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++)e[n+i>>>2]|=(r[i>>>2]>>>24-i%4*8&255)<<24-(n+i)%4*8;else for(var s=0;s<o;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(n());return new c.init(e,t)}}),u=i.enc={},p=u.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new c.init(r,e/2)}},l=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++)n.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c.init(r,e)}},h=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},f=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,p=t.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(o,l);r=o.splice(0,u),n.sigBytes-=p}return new c.init(r,p)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});s.Hasher=f.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new d.HMAC.init(t,r).finalize(e)}}});var d=i.algo={};return i}(Math)})),Lr=Rr((function(t,e){var r;t.exports=(r=Mr,function(t){var e=r,n=e.lib,o=n.WordArray,i=n.Hasher,s=e.algo,a=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,o=0;o<64;)e(n)&&(o<8&&(a[o]=r(t.pow(n,.5))),c[o]=r(t.pow(n,1/3)),o++),n++}();var u=[],p=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],p=r[5],l=r[6],h=r[7],f=0;f<64;f++){if(f<16)u[f]=0|t[e+f];else{var d=u[f-15],y=u[f-2];u[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+u[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+u[f-16]}var m=n&o^n&i^o&i,g=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&p^~a&l)+c[f]+u[f];h=l,l=p,p=a,a=s+g|0,s=i,i=o,o=n,n=g+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+p|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(p),e.HmacSHA256=i._createHmacHelper(p)}(Math),r.SHA256)})),Nr=Rr((function(t,e){var r,n;t.exports=(n=(r=Mr).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(t){var e=t.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var o=[],i=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,c=r[t.charCodeAt(s)]>>>6-s%4*2;o[i>>>2]|=(a|c)<<24-i%4*8,i++}return n.create(o,i)}(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)})),Br=Rr((function(t,e){t.exports=Mr.enc.Hex})),Hr=Rr((function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function n(){return new r(null)}var o="undefined"!=typeof navigator;o&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,o,i){for(var s=32767&e,a=e>>15;--i>=0;){var c=32767&this[t],u=this[t++]>>15,p=a*c+u*s;o=((c=s*c+((32767&p)<<15)+r[n]+(1073741823&o))>>>30)+(p>>>15)+a*u+(o>>>30),r[n++]=1073741823&c}return o},e=30):o&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,o,i){for(;--i>=0;){var s=e*this[t++]+r[n]+o;o=Math.floor(s/67108864),r[n++]=67108863&s}return o},e=26):(r.prototype.am=function(t,e,r,n,o,i){for(var s=16383&e,a=e>>14;--i>=0;){var c=16383&this[t],u=this[t++]>>14,p=a*c+u*s;o=((c=s*c+((16383&p)<<14)+r[n]+o)>>28)+(p>>14)+a*u,r[n++]=268435455&c}return o},e=28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var i,s,a=new Array;for(i="0".charCodeAt(0),s=0;s<=9;++s)a[i++]=s;for(i="a".charCodeAt(0),s=10;s<36;++s)a[i++]=s;for(i="A".charCodeAt(0),s=10;s<36;++s)a[i++]=s;function c(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function u(t,e){var r=a[t.charCodeAt(e)];return null==r?-1:r}function p(t){var e=n();return e.fromInt(t),e}function l(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function h(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function d(t,e){return t&e}function y(t,e){return t|e}function m(t,e){return t^e}function g(t,e){return t&~e}function v(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function T(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}h.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},h.prototype.revert=function(t){return t},h.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},h.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},h.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},f.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,s=0;--o>=0;){var a=8==n?255&t[o]:u(t,o);a<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,o=this.DB-n,i=(1<<o)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>o|a,a=(this[r]&i)<<n;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,o=this.DB-n,i=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&i)<<o,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&i)<<o),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,o=Math.min(t.t,this.t);r<o;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),o=t.abs(),i=n.t;for(e.t=i+o.t;--i>=0;)e[i]=0;for(i=0;i<o.t;++i)e[i+n.t]=n.am(0,o[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,o){var i=t.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return null!=e&&e.fromInt(0),void(null!=o&&this.copyTo(o));null==o&&(o=n());var a=n(),c=this.s,u=t.s,p=this.DB-l(i[i.t-1]);p>0?(i.lShiftTo(p,a),s.lShiftTo(p,o)):(i.copyTo(a),s.copyTo(o));var h=a.t,f=a[h-1];if(0!=f){var d=f*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),y=this.FV/d,m=(1<<this.F1)/d,g=1<<this.F2,v=o.t,b=v-h,w=null==e?n():e;for(a.dlShiftTo(b,w),o.compareTo(w)>=0&&(o[o.t++]=1,o.subTo(w,o)),r.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--b>=0;){var _=o[--v]==f?this.DM:Math.floor(o[v]*y+(o[v-1]+g)*m);if((o[v]+=a.am(0,_,o,b,0,h))<_)for(a.dlShiftTo(b,w),o.subTo(w,o);o[v]<--_;)o.subTo(w,o)}null!=e&&(o.drShiftTo(h,e),c!=u&&r.ZERO.subTo(e,e)),o.t=h,o.clamp(),p>0&&o.rShiftTo(p,o),c<0&&r.ZERO.subTo(o,o)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var o=n(),i=n(),s=e.convert(this),a=l(t)-1;for(s.copyTo(o);--a>=0;)if(e.sqrTo(o,i),(t&1<<a)>0)e.mulTo(i,s,o);else{var c=o;o=i,i=c}return e.revert(o)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,o=!1,i="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(o=!0,i=c(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(o=!0),o&&(i+=c(r));return o?i:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new h(e):new f(e),this.exp(t,r)},r.ZERO=p(0),r.ONE=p(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O,k,S,A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/A[A.length-1];function j(){var t;t=(new Date).getTime(),k[S++]^=255&t,k[S++]^=t>>8&255,k[S++]^=t>>16&255,k[S++]^=t>>24&255,S>=q&&(S-=q)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),o=p(r),i=n(),s=n(),a="";for(this.divRemTo(o,i,s);i.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,i.divRemTo(o,i,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),o=Math.pow(e,n),i=!1,s=0,a=0,c=0;c<t.length;++c){var p=u(t,c);p<0?"-"==t.charAt(c)&&0==this.signum()&&(i=!0):(a=e*a+p,++s>=n&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var o=new Array,i=7&t;o.length=1+(t>>3),e.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,o,i=Math.min(t.t,this.t);for(n=0;n<i;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(o=t.s&this.DM,n=i;n<this.t;++n)r[n]=e(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<t.t;++n)r[n]=e(o,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,o=Math.min(t.t,this.t);r<o;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,o=Math.min(this.t+t.t,e);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,t[o],r,o,0,this.t);for(n=Math.min(t.t,e);o<n;++o)this.am(0,t[o],r,o,0,e-o);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),o=e.getLowestSetBit();if(o<=0)return!1;var i=e.shiftRight(o);(t=t+1>>1)>A.length&&(t=A.length);for(var s=n(),a=0;a<t;++a){s.fromInt(A[Math.floor(Math.random()*A.length)]);var c=s.modPow(i,this);if(0!=c.compareTo(r.ONE)&&0!=c.compareTo(e)){for(var u=1;u++<o&&0!=c.compareTo(e);)if(0==(c=c.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=c.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,o=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[o++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(e[o++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+v(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=b(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,y)},r.prototype.clearBit=function(t){return this.changeBit(t,g)},r.prototype.flipBit=function(t){return this.changeBit(t,m)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,o,i=t.bitLength(),s=p(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,o=i<8?new h(e):e.isEven()?new T(e):new f(e);var a=new Array,c=3,u=r-1,d=(1<<r)-1;if(a[1]=o.convert(this),r>1){var y=n();for(o.sqrTo(a[1],y);c<=d;)a[c]=n(),o.mulTo(y,a[c-2],a[c]),c+=2}var m,g,v=t.t-1,b=!0,w=n();for(i=l(t[v])-1;v>=0;){for(i>=u?m=t[v]>>i-u&d:(m=(t[v]&(1<<i+1)-1)<<u-i,v>0&&(m|=t[v-1]>>this.DB+i-u)),c=r;0==(1&m);)m>>=1,--c;if((i-=c)<0&&(i+=this.DB,--v),b)a[m].copyTo(s),b=!1;else{for(;c>1;)o.sqrTo(s,w),o.sqrTo(w,s),c-=2;c>0?o.sqrTo(s,w):(g=s,s=w,w=g),o.mulTo(w,a[m],s)}for(;v>=0&&0==(t[v]&1<<i);)o.sqrTo(s,w),g=s,s=w,w=g,--i<0&&(i=this.DB-1,--v)}return o.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),o=this.clone(),i=p(1),s=p(0),a=p(0),c=p(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;o.isEven();)o.rShiftTo(1,o),e?(a.isEven()&&c.isEven()||(a.addTo(this,a),c.subTo(t,c)),a.rShiftTo(1,a)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);n.compareTo(o)>=0?(n.subTo(o,n),e&&i.subTo(a,i),s.subTo(c,s)):(o.subTo(n,o),e&&a.subTo(i,a),c.subTo(s,c))}return 0!=o.compareTo(r.ONE)?r.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var o=e.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return e;for(o<i&&(i=o),i>0&&(e.rShiftTo(i,e),r.rShiftTo(i,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=A[A.length-1]){for(e=0;e<A.length;++e)if(r[0]==A[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<A.length;){for(var n=A[e],o=e+1;o<A.length&&n<x;)n*=A[o++];for(n=r.modInt(n);e<o;)if(n%A[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=T,null==k){var E;if(k=new Array,S=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var C=new Uint8Array(32);for(window.crypto.getRandomValues(C),E=0;E<32;++E)k[S++]=C[E]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var D=window.crypto.random(32);for(E=0;E<D.length;++E)k[S++]=255&D.charCodeAt(E)}for(;S<q;)E=Math.floor(65536*Math.random()),k[S++]=E>>>8,k[S++]=255&E;S=0,j()}function I(){if(null==O){for(j(),(O=new R).init(k),S=0;S<k.length;++S)k[S]=0;S=0}return O.next()}function P(){}function R(){this.i=0,this.j=0,this.S=new Array}P.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=I()},R.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)n=this.S[e],this.S[e]=this.S[r=r+this.S[e]+t[e%t.length]&255],this.S[r]=n;this.i=0,this.j=0},R.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var q=256;t.exports={default:r,BigInteger:r,SecureRandom:P}}).call(Pr)})),Fr={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},Wr={sha256:Lr};function zr(t,e){if(this.n=null,this.e=0,!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid key data");this.n=new Hr.BigInteger(t,16),this.e=parseInt(e,16)}zr.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new Hr.BigInteger(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function(t){for(var e in Fr){var r=Fr[e],n=r.length;if(t.substring(0,n)===r)return{alg:e,hash:t.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===n.length)return!1;if(!Wr.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var o=Wr[n.alg](t).toString();return n.hash===o};for(var Vr=[],$r=[],Jr="undefined"!=typeof Uint8Array?Uint8Array:Array,Gr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xr=0;Xr<64;++Xr)Vr[Xr]=Gr[Xr],$r[Gr.charCodeAt(Xr)]=Xr;$r["-".charCodeAt(0)]=62,$r["_".charCodeAt(0)]=63;var Qr=function(t){var e,r,n=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),o=n[0],i=n[1],s=new Jr(function(t,e,r){return 3*(e+r)/4-r}(0,o,i)),a=0,c=i>0?o-4:o;for(r=0;r<c;r+=4)e=$r[t.charCodeAt(r)]<<18|$r[t.charCodeAt(r+1)]<<12|$r[t.charCodeAt(r+2)]<<6|$r[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===i&&(e=$r[t.charCodeAt(r)]<<2|$r[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===i&&(e=$r[t.charCodeAt(r)]<<10|$r[t.charCodeAt(r+1)]<<4|$r[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function Zr(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function Kr(t){return t=Zr(t).replace(/\-/g,"+").replace(/_/g,"/"),decodeURIComponent(function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}(Qr(t)).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))}function Yr(t){return function(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);e+=2===n.length?n:"0"+n}return e}(Qr(Zr(t)))}var tn=Rr((function(t){var e,r;e=Pr,r=function(){return function(){return function(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0]=t[0].match(/^file:\/\/\//)?t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=o.replace(/[\/]+$/,n<t.length-1?"":"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()}));function en(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],a={},c=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:c,headers:{keys:function(){return i},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var u in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(c())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(u,e.headers[u]);o.send(e.body||null)}))}function rn(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function nn(t){this.name="ConfigurationError",this.message=t||""}function on(t){this.name="TokenValidationError",this.message=t||""}nn.prototype=Error.prototype,on.prototype=Error.prototype;var sn=function(){function t(){}var e=t.prototype;return e.get=function(){return null},e.has=function(){return null},e.set=function(){return null},t}();qr.polyfill();var an="RS256",cn=function(t){return"number"==typeof t},un=function(){return new Date};function pn(t){var e=t||{};if(this.jwksCache=e.jwksCache||new sn,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=0===e.leeway?0:e.leeway||60,this.jwksURI=e.jwksURI,this.maxAge=e.maxAge,this.__clock="function"==typeof e.__clock?e.__clock:un,this.leeway<0||this.leeway>300)throw new nn("The leeway should be positive and lower than five minutes.");if(an!==this.expectedAlg)throw new nn('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "'+an+'".')}function ln(t,e){this.plugins=e;for(var r=0;r<this.plugins.length;r++){if(this.plugins[r].version!==tr.raw){var n="";throw this.plugins[r].constructor&&this.plugins[r].constructor.name&&(n=this.plugins[r].constructor.name),new Error("Plugin "+n+" version ("+this.plugins[r].version+") is not compatible with the SDK version ("+tr.raw+")")}this.plugins[r].setWebAuth(t)}}pn.prototype.verify=function(t,e,r){if(!r&&e&&"function"==typeof e&&(r=e,e=void 0),!t)return r(new on("ID token is required but missing"),null);var n=this.decode(t);if(n instanceof Error)return r(new on("ID token could not be decoded"),null);var o=n.encoded.header+"."+n.encoded.payload,i=Yr(n.encoded.signature),s=n.header.alg,a=n.header.kid,c=n.payload.aud,u=n.payload.sub,p=n.payload.iss,l=n.payload.exp,h=n.payload.nbf,f=n.payload.iat,d=n.payload.azp,y=n.payload.auth_time,m=n.payload.nonce,g=this.__clock(),v=this;if(v.expectedAlg!==s)return r(new on('Signature algorithm of "'+s+'" is not supported. Expected the ID token to be signed with "'+an+'".'),null);this.getRsaVerifier(p,a,(function(t,s){if(t)return r(t,null);if(!s.verify(o,i))return r(new on("Invalid ID token signature."),null);if(!p||"string"!=typeof p)return r(new on("Issuer (iss) claim must be a string present in the ID token"),null);if(v.issuer!==p)return r(new on('Issuer (iss) claim mismatch in the ID token, expected "'+v.issuer+'", found "'+p+'"'),null);if(!u||"string"!=typeof u)return r(new on("Subject (sub) claim must be a string present in the ID token"),null);if(!c||"string"!=typeof c&&!Array.isArray(c))return r(new on("Audience (aud) claim must be a string or array of strings present in the ID token"),null);if(Array.isArray(c)&&!c.includes(v.audience))return r(new on('Audience (aud) claim mismatch in the ID token; expected "'+v.audience+'" but was not one of "'+c.join(", ")+'"'),null);if("string"==typeof c&&v.audience!==c)return r(new on('Audience (aud) claim mismatch in the ID token; expected "'+v.audience+'" but found "'+c+'"'),null);if(e){if(!m||"string"!=typeof m)return r(new on("Nonce (nonce) claim must be a string present in the ID token"),null);if(m!==e)return r(new on('Nonce (nonce) claim value mismatch in the ID token; expected "'+e+'", found "'+m+'"'),null)}if(Array.isArray(c)&&c.length>1){if(!d||"string"!=typeof d)return r(new on("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"),null);if(d!==v.audience)return r(new on('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+d+'"'),null)}if(!l||!cn(l))return r(new on("Expiration Time (exp) claim must be a number present in the ID token"),null);if(!f||!cn(f))return r(new on("Issued At (iat) claim must be a number present in the ID token"),null);var a=l+v.leeway,b=new Date(0);if(b.setUTCSeconds(a),g>b)return r(new on('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"'),null);if(h&&cn(h)){var w=h-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return r(new on('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'),null)}if(v.maxAge){if(!y||!cn(y))return r(new on("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"),null);var T=y+v.maxAge+v.leeway,O=new Date(0);if(O.setUTCSeconds(T),g>O)return r(new on('Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time "'+g+'" is after last auth time at "'+O+'"'),null)}return r(null,n.payload)}))},pn.prototype.getRsaVerifier=function(t,e,r){var n=this,o=t+e;Promise.resolve(this.jwksCache.has(o)).then((function(r){return r?n.jwksCache.get(o):(s=(i={jwksURI:n.jwksURI,iss:t,kid:e}).jwksURI||tn(i.iss,".well-known","jwks.json"),("undefined"==fetch?en:fetch)(s).then(rn).then((function(t){var e,r,n,o=null;for(e=0;e<t.keys.length&&null===o;e++)(r=t.keys[e]).kid===i.kid&&(o=r);if(!o)throw new Error('Could not find a public key for Key ID (kid) "'+i.kid+'"');return{modulus:Yr((n=o).n),exp:Yr(n.e)}})).catch((function(t){throw t})));var i,s})).then((function(t){if(!t||!t.modulus||!t.exp)throw new Error("Empty keyInfo in response");return Promise.resolve(n.jwksCache.set(o,t)).then((function(){r&&r(null,new zr(t.modulus,t.exp))}))})).catch((function(t){r&&r(t)}))},pn.prototype.decode=function(t){var e,r,n=t.split(".");if(3!==n.length)return new on("Cannot decode a malformed JWT");try{e=JSON.parse(Kr(n[0])),r=JSON.parse(Kr(n[1]))}catch(t){return new on("Token header or payload is not valid JSON")}return{header:e,payload:r,encoded:{header:n[0],payload:n[1],signature:n[2]}}},pn.prototype.validateAccessToken=function(t,e,r,n){if(this.expectedAlg!==e)return n(new on('Signature algorithm of "'+e+'" is not supported. Expected "'+this.expectedAlg+'"'));var o,i=Lr(t),s=Br.stringify(i),a=s.substring(0,s.length/2),c=Br.parse(a),u=Nr.stringify(c);return n((o={"+":"-","/":"_","=":""},u.replace(/[+/=]/g,(function(t){return o[t]}))!==r?new on("Invalid access_token"):null))},ln.prototype.get=function(t){for(var e=0;e<this.plugins.length;e++)if(this.plugins[e].supports(t))return this.plugins[e].init();return null};var hn=function(t){var e=new Uint8Array(t),r=[],n="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",o=gr.getWindow().crypto||gr.getWindow().msCrypto;if(!o)return null;for(var i=o.getRandomValues(e),s=0;s<i.length;s++)r.push(n[i[s]%65]);return r.join("")};function fn(t){var e=t.transaction||{};this.namespace=e.namespace||"com.auth0.auth.",this.keyLength=e.keyLength||32,this.stateExpiration=t.stateExpiration?t.stateExpiration/60/24:1/48,this.storage=new kr(t),this.options=t}function dn(t){if(this.url=t.url,this.callback=t.callback,this.timeout=t.timeout||6e4,this.timeoutCallback=t.timeoutCallback||null,this.eventListenerType=t.eventListenerType||"message",this.iframe=null,this.timeoutHandle=null,this._destroyTimeout=null,this.transientMessageEventListener=null,this.proxyEventListener=null,this.eventValidator=t.eventValidator||{isValid:function(){return!0}},"function"!=typeof this.callback)throw new Error("options.callback must be a function")}function yn(t){this.webAuth=t,this.warn=new Tr(t.baseOptions)}function mn(t,e){this.webAuth=t,this.baseOptions=e,this.request=new yr(e),this.webMessageHandler=new yn(t),this.storage=new kr(e)}function gn(t,e){return["co/verifier",encodeURIComponent(t),encodeURIComponent(e)].join("/")}function vn(t,e){this.webAuth=t,this.baseOptions=e,this.crossOriginAuthentication=new mn(t,this.baseOptions),this.warn=new Tr({disableWarnings:!!e._disableDeprecationWarnings})}fn.prototype.process=function(t){if(!t.responseType)throw new Error("responseType is required");var e=t.realm||t.connection,r=-1!==t.responseType.indexOf("id_token"),n=this.generateTransaction(t.appState,t.state,t.nonce,e,r,t.organization);return t.state||(t.state=n.state),r&&!t.nonce&&(t.nonce=n.nonce),t},fn.prototype.generateTransaction=function(t,e,r,n,o,i){if(e=e||hn(this.keyLength),r=r||(o?hn(this.keyLength):null),gr.getWindow().location.host!==this.options.domain){var s={nonce:r,appState:t,state:e,lastUsedConnection:n};i&&(s.organization=i),this.storage.setItem(this.namespace+e,s,{expires:this.stateExpiration})}return{state:e,nonce:r}},fn.prototype.getStoredTransaction=function(t){var e;return e=this.storage.getItem(this.namespace+t),this.clearTransaction(t),e},fn.prototype.clearTransaction=function(t){this.storage.removeItem(this.namespace+t)},dn.prototype.init=function(){var t=this,e=gr.getWindow();switch(this.iframe=e.document.createElement("iframe"),this.iframe.style.display="none",this.proxyEventListener=function(e){t.eventListener(e)},this.eventListenerType){case"message":this.eventSourceObject=e;break;case"load":this.eventSourceObject=this.iframe;break;default:throw new Error("Unsupported event listener type: "+this.eventListenerType)}this.eventSourceObject.addEventListener(this.eventListenerType,this.proxyEventListener,!1),e.document.body.appendChild(this.iframe),this.iframe.src=this.url,this.timeoutHandle=setTimeout((function(){t.timeoutHandler()}),this.timeout)},dn.prototype.eventListener=function(t){var e={event:t,sourceObject:this.eventSourceObject};this.eventValidator.isValid(e)&&(this.destroy(),this.callback(e))},dn.prototype.timeoutHandler=function(){this.destroy(),this.timeoutCallback&&this.timeoutCallback()},dn.prototype.destroy=function(){var t=this;clearTimeout(this.timeoutHandle),this._destroyTimeout=setTimeout((function(){t.eventSourceObject.removeEventListener(t.eventListenerType,t.proxyEventListener,!1),t.iframe.parentNode&&t.iframe.parentNode.removeChild(t.iframe)}),0)},yn.prototype.run=function(t,e){var r=this;t.responseMode="web_message",t.prompt="none";var n=gr.getOrigin(),o=hr.getOriginFromUrl(t.redirectUri);if(o&&n!==o)return e({error:"origin_mismatch",error_description:"The redirectUri's origin ("+o+") should match the window's origin ("+n+")."});!function(t,e,r){new dn({url:t,eventListenerType:"message",callback:function(t){r(null,t)},timeout:e.timeout,eventValidator:{isValid:function(t){return!(!t.event.data||"authorization_response"!==t.event.data.type||e.state!==t.event.data.response.state)}},timeoutCallback:function(){r({error:"timeout",error_description:"Timeout during executing web_message communication",state:e.state})}}).init()}(this.webAuth.client.buildAuthorizeUrl(t),t,(function(n,o){var i=n;if(!n&&o.event.data.response.error&&(i=o.event.data.response),!i){var s=o.event.data.response;return r.webAuth.validateAuthenticationResponse(t,s,e)}return"consent_required"===i.error&&"localhost"===gr.getWindow().location.hostname&&r.warn.warning("Consent Required. Consent can't be skipped on localhost. Read more here: https://auth0.com/docs/api-auth/user-consent#skipping-consent-for-first-party-clients"),r.webAuth.transactionManager.clearTransaction(i.state),e(hr.pick(i,["error","error_description"]))}))},mn.prototype.login=function(t,e){var n=this,o=r(this.baseOptions.rootUrl,"/co/authenticate");t.username=t.username||t.email,delete t.email;var i={client_id:t.clientID||this.baseOptions.clientID,username:t.username};t.password&&(i.password=t.password),t.otp&&(i.otp=t.otp);var s=t.realm||this.baseOptions.realm;if(s){var a=t.credentialType||this.baseOptions.credentialType||"http://auth0.com/oauth/grant-type/password-realm";i.realm=s,i.credential_type=a}else i.credential_type="password";this.request.post(o).withCredentials().send(i).end((function(r,o){if(r){var i=r.response&&r.response.body||{error:"request_error",error_description:JSON.stringify(r)};return jr(e,{forceLegacyError:!0})(i)}function s(){var r=!0===t.popup;t=hr.blacklist(t,["password","credentialType","otp","popup","onRedirecting"]);var i=hr.merge(t).with({loginTicket:o.body.login_ticket}),s=gn(n.baseOptions.rootUrl,o.body.co_id);n.storage.setItem(s,o.body.co_verifier,{expires:1/96}),r?n.webMessageHandler.run(i,jr(e,{forceLegacyError:!0})):n.webAuth.authorize(i)}"function"==typeof t.onRedirecting?t.onRedirecting(s):s()}))},mn.prototype.callback=function(){var t=decodeURIComponent(function(t){var e=("&"+gr.getWindow().location.hash.substring(1)).split("&origin=");if(2===e.length)return e.pop().split("&").shift()}()),e=gr.getWindow(),r=this;e.addEventListener("message",(function(t){if("co_verifier_request"===t.data.type){var e=gn(t.origin,t.data.request.id),n=function(t,e){try{var r=t.getItem(e);return t.removeItem(e),r||""}catch(t){return""}}(r.storage,e);t.source.postMessage({type:"co_verifier_response",response:{verifier:n}},t.origin)}})),e.parent.postMessage({type:"ready"},t)},vn.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,delete t.connection,this.crossOriginAuthentication.login(t,e)},vn.prototype.signupAndLogin=function(t,e){var r=this;return this.webAuth.client.dbConnection.signup(t,(function(n){return n?e(n):(t.realm=t.realm||t.connection,delete t.connection,r.webAuth.login(t,e))}))};var bn=e((function(t){var e=function(){function t(t,e,r){t.attachEvent?t.attachEvent("on"+e,r):t.addEventListener&&t.addEventListener(e,r,!1)}function e(t,e,r){t.detachEvent?t.detachEvent("on"+e,r):t.removeEventListener&&t.removeEventListener(e,r,!1)}function r(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}var n=function(){if("undefined"==typeof navigator)return!1;var t=-1,e=navigator.userAgent;return"Microsoft Internet Explorer"===navigator.appName?null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)):e.indexOf("Trident")>-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(o,i){if(!i)throw"missing required callback argument";var s,a;o.url||(s="missing required 'url' parameter"),o.relay_url||(s="missing required 'relay_url' parameter"),s&&setTimeout((function(){i(s)}),0),o.window_name||(o.window_name=null),o.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(o.window_features=void 0);var c,u=o.origin||r(o.url);if(u!==r(o.relay_url))return setTimeout((function(){i("invalid arguments: origin of url and relay_url must match")}),0);n&&((a=document.createElement("iframe")).setAttribute("src",o.relay_url),a.style.display="none",a.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(a),c=a.contentWindow);var p=o.popup||window.open(o.url,o.window_name,o.window_features);o.popup&&(p.location.href=o.url),c||(c=p);var l=setInterval((function(){p&&p.closed&&(f(),i&&(i("User closed the popup window"),i=null))}),500),h=JSON.stringify({a:"request",d:o.params});function f(){if(a&&document.body.removeChild(a),a=void 0,l&&(l=clearInterval(l)),e(window,"message",d),e(window,"unload",f),p)try{p.close()}catch(t){c.postMessage("die",u)}p=c=void 0}function d(t){if(t.origin===u){try{var e=JSON.parse(t.data)}catch(t){if(i)return i(t);throw t}"ready"===e.a?c.postMessage(h,u):"error"===e.a?(f(),i&&(i(e.d),i=null)):"response"===e.a&&(f(),i&&(i(null,e.d),i=null))}}return t(window,"unload",f),t(window,"message",d),{originalPopup:p,close:f,focus:function(){if(p)try{p.focus()}catch(t){}}}},onOpen:function(r){var o="*",i=n?function(){for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!i)throw"can't find relay frame";function s(t){t=JSON.stringify(t),n?i.doPost(t,o):i.postMessage(t,o)}function a(t){if("die"===t.data)try{window.close()}catch(t){}}t(n?i:window,"message",(function t(n){var i;try{i=JSON.parse(n.data)}catch(t){}i&&"request"===i.a&&(e(window,"message",t),o=n.origin,r&&setTimeout((function(){r(o,i.d,(function(t){r=void 0,s({a:"response",d:t})}))}),0))})),t(n?i:window,"message",a);try{s({a:"ready"})}catch(e){t(i,"load",(function(t){s({a:"ready"})}))}var c=function(){try{e(n?i:window,"message",a)}catch(t){}r&&s({a:"error",d:"client closed window"}),r=void 0;try{window.close()}catch(t){}};return t(window,"unload",c),{detach:function(){e(window,"unload",c)}}}}:{open:function(t,e,r,n){setTimeout((function(){n("unsupported browser")}),0)},onOpen:function(t){setTimeout((function(){t("unsupported browser")}),0)}}}();t.exports&&(t.exports=e)})),wn=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t};function _n(){this._current_popup=null}function Tn(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new fn(this.baseOptions),this.crossOriginAuthentication=new mn(t,this.baseOptions),this.warn=new Tr({disableWarnings:!!e._disableDeprecationWarnings})}function On(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||gr.getWindow().location.origin||gr.getWindow().location.protocol+"//"+gr.getWindow().location.hostname+(gr.getWindow().location.port?":"+gr.getWindow().location.port:"")}function kn(t){this.baseOptions=t,this.request=new yr(t),this.transactionManager=new fn(this.baseOptions)}function Sn(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new yr(this.baseOptions),this.warn=new Tr({disableWarnings:!!e._disableDeprecationWarnings})}_n.prototype.calculatePosition=function(t){var e=t.width||500,r=t.height||600,n=gr.getWindow(),o=void 0!==n.screenX?n.screenX:n.screenLeft,i=void 0!==n.screenY?n.screenY:n.screenTop,s=void 0!==n.outerWidth?n.outerWidth:n.document.body.clientWidth,a=void 0!==n.outerHeight?n.outerHeight:n.document.body.clientHeight;return{width:e,height:r,left:t.left||o+(s-e)/2,top:t.top||i+(a-r)/2}},_n.prototype.preload=function(t){var e=this,r=gr.getWindow(),n=this.calculatePosition(t.popupOptions||{}),o=hr.merge(n).with(t.popupOptions),i=t.url||"about:blank",s=me.stringify(o,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed||(this._current_popup=r.open(i,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null}),this._current_popup},_n.prototype.load=function(t,e,r,n){var o=this,i=this.calculatePosition(r.popupOptions||{}),s=hr.merge(i).with(r.popupOptions),a=hr.merge({url:t,relay_url:e,window_features:me.stringify(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(r),c=bn.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return o._current_popup=null,n(t,e)}));return c.focus(),c},Tn.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new _n},Tn.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},Tn.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},Tn.prototype.callback=function(t){var e=this,r=gr.getWindow(),n=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||gr.getOrigin();r.opener?bn.onOpen((function(r,o,i){if(r!==n)return i({error:"origin_mismatch",error_description:"The popup's origin ("+r+") should match the `popupOrigin` parameter ("+n+")."});e.webAuth.parseHash(t||{},(function(t,e){return i(t||e)}))})):r.doPost=function(t){r.parent&&r.parent.postMessage(t,n)}},Tn.prototype.authorize=function(t,e){var n,o,i={},s=this.baseOptions.plugins.get("popup.authorize"),a=hr.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce","organization","invitation"]).with(hr.blacklist(t,["popupHandler"]));return ir.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),o=r(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(i.origin=wn(a.redirectUri),o=a.redirectUri),t.popupOptions&&(i.popupOptions=hr.pick(t.popupOptions,["width","height","top","left"])),s&&(a=s.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,n=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(n,o,i,jr(e,{keepOriginalCasing:!0}))},Tn.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=hr.merge(this.baseOptions,["redirectUri","responseType","state","nonce","timeout"]).with(hr.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},Tn.prototype.passwordlessVerify=function(t,e){var r=this;return this.client.passwordless.verify(hr.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,r.client.loginWithResourceOwner(t,e)}))},Tn.prototype.signupAndLogin=function(t,e){var r=this;return this.client.dbConnection.signup(t,(function(n){if(n)return e(n);r.loginWithCredentials(t,e)}))},On.create=function(t){return new On(t)},On.prototype.login=function(t,e){this.handler=new dn({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},On.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},On.prototype.getCallbackHandler=function(t,e){return function(r){var n;n=e?"object"==typeof r.event.data&&r.event.data.hash?r.event.data.hash:r.event.data:r.sourceObject.contentWindow.location.hash,t(null,n)}},kn.prototype.login=function(t,e){var n,o;return n=r(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=hr.blacklist(t,["email","onRedirecting"]),o=hr.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),o=this.transactionManager.process(o),o=hr.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(jr(e))},kn.prototype.callback=function(t){var e,r=gr.getDocument();(e=r.createElement("div")).innerHTML=t,r.body.appendChild(e).children[0].submit()},Sn.prototype.login=function(t,e){if(gr.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var r,n=hr.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return ir.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(r=new kn(this.baseOptions)).login(n,(function(n,o){if(n)return e(n);function i(){r.callback(o)}if("function"==typeof t.onRedirecting)return t.onRedirecting((function(){i()}));i()}))},Sn.prototype.signupAndLogin=function(t,e){var r=this;return r.client.client.dbConnection.signup(t,(function(n){return n?e(n):r.login(t,e)}))},Sn.prototype.getSSOData=function(t,e){var n,o="";return"function"==typeof t&&(e=t,t=!1),ir.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(o="?"+me.stringify({ldaps:1,client_id:this.baseOptions.clientID})),n=r(this.baseOptions.rootUrl,"user","ssodata",o),this.request.get(n,{noHeaders:!0}).withCredentials().end(jr(e))};var An=function(){},xn=An,jn={lang:"en",templates:{auth0:function(t){var e="code"===t.type?"Enter the code shown above":"Solve the formula shown above";return'<div class="captcha-challenge">\n <img src="'+t.image+'" />\n <button type="button" class="captcha-reload">↺</button>\n</div>\n<input type="text" name="captcha"\n class="form-control captcha-control"\n placeholder="'+e+'" />'},recaptcha_v2:function(){return'<div class="recaptcha" ></div><input type="hidden" name="captcha" />'},recaptcha_enterprise:function(){return'<div class="recaptcha" ></div><input type="hidden" name="captcha" />'},hcaptcha:function(){return'<div class="hcaptcha" ></div><input type="hidden" name="captcha" />'},friendly_captcha:function(){return'<div class="friendly-captcha" ></div><input type="hidden" name="captcha" />'},arkose:function(){return'<div class="arkose" ></div><input type="hidden" name="captcha" />'},auth0_v2:function(){return'<div class="auth0_v2" ></div><input type="hidden" name="captcha" />'},error:function(){return'<div class="error" style="color: red;">Error getting the bot detection challenge. Please contact the system administrator.</div>'}}};function En(t,e,r,n){t.innerHTML=e.templates[r.provider](r),t.querySelector(".captcha-reload").addEventListener("click",(function(t){t.preventDefault(),n()}))}function Cn(t){switch(t){case"recaptcha_v2":return window.grecaptcha;case"recaptcha_enterprise":return window.grecaptcha.enterprise;case"hcaptcha":return window.hcaptcha;case"friendly_captcha":return window.friendlyChallenge;case"arkose":return window.arkose;case"auth0_v2":return window.turnstile;default:throw new Error("Unknown captcha provider")}}function Dn(t,e){var r=window.document.createElement("script");for(var n in e)n.startsWith("data-")?r.dataset[n.replace("data-","")]=e[n]:r[n]=e[n];r.src=t,window.document.body.appendChild(r)}function In(t){window.document.querySelectorAll('script[src="'+t+'"]').forEach((function(t){t.remove()}))}function Pn(t,e,r){var n,o=t.hasAttribute("data-wid")&&t.getAttribute("data-wid");function i(e){t.querySelector('input[name="captcha"]').value=e||""}if("friendly_captcha"===r.provider&&window.auth0FCInstance)return i(),void window.auth0FCInstance.reset();if("arkose"===r.provider&&Cn(r.provider))return i(),void Cn(r.provider).reset();if(o)return i(),void Cn(r.provider).reset(o);switch(t.innerHTML=e.templates[r.provider](r),r.provider){case"recaptcha_enterprise":case"recaptcha_v2":n=".recaptcha";break;case"hcaptcha":n=".hcaptcha";break;case"friendly_captcha":n=".friendly-captcha";break;case"arkose":n=".arkose";break;case"auth0_v2":n=".auth0_v2"}var s=t.querySelector(n);!function(t,e,r,n){var o=e.provider+"Callback_"+Math.floor(1000001*Math.random()),i={async:!0,defer:!0},s=function(t,e,r,n,o){switch(t){case"recaptcha_v2":return"https://www.recaptcha.net/recaptcha/api.js?hl="+e+"&onload="+r;case"recaptcha_enterprise":return"https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl="+e+"&onload="+r;case"hcaptcha":return"https://js.hcaptcha.com/1/api.js?hl="+e+"&onload="+r;case"friendly_captcha":return"https://cdn.jsdelivr.net/npm/friendly-challenge@0.9.12/widget.min.js";case"arkose":return"https://"+n+".arkoselabs.com/v2/"+o+"/api.js";case"auth0_v2":return"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit&onload="+r;default:throw new Error("Unknown captcha provider")}}(e.provider,e.lang,o,e.clientSubdomain,e.siteKey);if("arkose"===e.provider||"auth0_v2"===e.provider){var a=0;i["data-callback"]=o,i.onerror=function(){if(a<3)return In(s),Dn(s,i),void a++;In(s),n("BYPASS_CAPTCHA")},window[o]=function(t){window.arkose=t,r(t)}}else window[o]=function(){delete window[o],r()},"friendly_captcha"===e.provider&&(i.onload=window[o]);Dn(s,i)}(0,{lang:e.lang,provider:r.provider,clientSubdomain:r.clientSubdomain,siteKey:r.siteKey},(function(n){var a=Cn(r.provider);if("arkose"===r.provider){var c=0;n.setConfig({onCompleted:function(t){i(t.token),xn()},onError:function(){c<3?(i(),n.reset(),setTimeout((function(){n.run()}),500),c++):i("BYPASS_CAPTCHA")}})}else if("friendly_captcha"===r.provider)window.auth0FCInstance=new a.WidgetInstance(s,{sitekey:r.siteKey,language:e.lang,doneCallback:function(t){i(t)},errorCallback:function(){i()}});else{var u={callback:i,"expired-callback":function(){i()},"error-callback":function(){i()},sitekey:r.siteKey};"auth0_v2"===r.provider&&(c=0,u.language=e.lang,u.theme="light",u.retry="never",u["response-field"]=!1,u["error-callback"]=function(){return c<3?(i(),Cn(r.provider).reset(o),c++):i("BYPASS_CAPTCHA"),!0}),o=a.render(s,u),t.setAttribute("data-wid",o)}}),i)}var Rn=function(t,e,r,n){function o(n){n=n||An,t.getChallenge((function(t,i){return t?(e.innerHTML=r.templates.error(t),n(t)):i.required?(e.style.display="","auth0"===i.provider?En(e,r,i,o):"recaptcha_v2"!==i.provider&&"recaptcha_enterprise"!==i.provider&&"hcaptcha"!==i.provider&&"friendly_captcha"!==i.provider&&"arkose"!==i.provider&&"auth0_v2"!==i.provider||Pn(e,r,i),void("arkose"===i.provider?n(null,{triggerCaptcha:function(t){Cn(i.provider).run(),xn=t}}):n())):(e.style.display="none",void(e.innerHTML=""))}))}return r=hr.merge(jn).with(r||{}),o(n),{reload:o,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}},qn=function(t,e,r,n){function o(n){n=n||An,t.passwordless.getChallenge((function(t,i){return t?(e.innerHTML=r.templates.error(t),n(t)):i.required?(e.style.display="","auth0"===i.provider?En(e,r,i,o):"recaptcha_v2"!==i.provider&&"recaptcha_enterprise"!==i.provider&&"hcaptcha"!==i.provider&&"friendly_captcha"!==i.provider&&"arkose"!==i.provider&&"auth0_v2"!==i.provider||Pn(e,r,i),void("arkose"===i.provider?n(null,{triggerCaptcha:function(t){Cn(i.provider).run(),xn=t}}):n())):(e.style.display="none",void(e.innerHTML=""))}))}return r=hr.merge(jn).with(r||{}),o(n),{reload:o,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}};function Un(){return new Date}function Mn(t){ir.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},maxAge:{optional:!0,type:"number",message:"maxAge is not valid"},stateExpiration:{optional:!0,type:"number",message:"stateExpiration is not valid"},legacySameSiteCookie:{optional:!0,type:"boolean",message:"legacySameSiteCookie option is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&&ir.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new ln(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,!1!==t.legacySameSiteCookie&&(this.baseOptions.legacySameSiteCookie=!0),this.transactionManager=new fn(this.baseOptions),this.client=new Bn(this.baseOptions),this.redirect=new vn(this,this.baseOptions),this.popup=new Tn(this,this.baseOptions),this.crossOriginAuthentication=new mn(this,this.baseOptions),this.webMessageHandler=new yn(this),this._universalLogin=new Sn(this,this.baseOptions),this.ssodataStorage=new Sr(this.baseOptions)}function Ln(t,e){this.baseOptions=e,this.request=t}function Nn(t,e){this.baseOptions=e,this.request=t}function Bn(t,e){2===arguments.length?this.auth0=t:e=t,ir.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl=this.baseOptions.domain&&0===this.baseOptions.domain.toLowerCase().indexOf("http")?this.baseOptions.domain:"https://"+this.baseOptions.domain,this.request=new yr(this.baseOptions),this.passwordless=new Ln(this.request,this.baseOptions),this.dbConnection=new Nn(this.request,this.baseOptions),this.warn=new Tr({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new Sr(this.baseOptions)}function Hn(t){ir.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new yr(this.baseOptions),this.baseOptions.rootUrl=r("https://"+this.baseOptions.domain,"api","v2")}Mn.prototype.parseHash=function(t,e){var r,n;e||"function"!=typeof t?t=t||{}:(e=t,t={});var o=void 0===t.hash?gr.getWindow().location.hash:t.hash;if(o=o.replace(/^#?\/?/,""),(r=me.parse(o)).hasOwnProperty("error"))return n=xr.buildResponse(r.error,r.error_description),r.state&&(n.state=r.state),e(n);if(!r.hasOwnProperty("access_token")&&!r.hasOwnProperty("id_token")&&!r.hasOwnProperty("refresh_token"))return e(null,null);var i=(this.baseOptions.responseType||t.responseType||"").split(" ");return i.length>0&&-1!==i.indexOf("token")&&!r.hasOwnProperty("access_token")?e(xr.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):i.length>0&&-1!==i.indexOf("id_token")&&!r.hasOwnProperty("id_token")?e(xr.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,r,e)},Mn.prototype.validateAuthenticationResponse=function(t,e,r){var n=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var o=e.state,i=this.transactionManager.getStoredTransaction(o),s=t.state||i&&i.state||null,a=s===o;if((o||s||!t.__enableIdPInitiatedLogin)&&!a)return r({error:"invalid_token",errorDescription:"`state` does not match."});var c=t.nonce||i&&i.nonce||null,u=i&&i.organization,p=t.state||i&&i.appState||null,l=function(t,o){return t?r(t):(i&&i.lastUsedConnection&&(o&&(s=o.sub),n.ssodataStorage.set(i.lastUsedConnection,s)),r(null,function(t,e,r){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:r||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,p,o)));var s};return e.id_token?this.validateToken(e.id_token,c,(function(t,r){if(!t){if(u)if(0===u.indexOf("org_")){if(!r.org_id)return l(xr.invalidToken("Organization Id (org_id) claim must be a string present in the ID token"));if(r.org_id!==u)return l(xr.invalidToken('Organization Id (org_id) claim value mismatch in the ID token; expected "'+u+'", found "'+r.org_id+'"'))}else{if(!r.org_name)return l(xr.invalidToken("Organization Name (org_name) claim must be a string present in the ID token"));if(r.org_name!==u.toLowerCase())return l(xr.invalidToken('Organization Name (org_name) claim value mismatch in the ID token; expected "'+u+'", found "'+r.org_name+'"'))}return e.access_token&&r.at_hash?(new pn).validateAccessToken(e.access_token,"RS256",r.at_hash,(function(t){return t?l(xr.invalidToken(t.message)):l(null,r)})):l(null,r)}if("invalid_token"!==t.error||t.errorDescription&&t.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token")>-1)return l(t);var o=(new pn).decode(e.id_token);return"HS256"!==o.header.alg?l(t):(o.payload.nonce||null)!==c?l({error:"invalid_token",errorDescription:'Nonce (nonce) claim value mismatch in the ID token; expected "'+c+'", found "'+o.payload.nonce+'"'}):e.access_token?n.client.userInfo(e.access_token,(function(t,e){return t?l(t):l(null,e)})):l({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can’t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"})})):l(null,null)},Mn.prototype.validateToken=function(t,e,r){new pn({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||60,maxAge:this.baseOptions.maxAge,__clock:this.baseOptions.__clock||Un}).verify(t,e,(function(t,e){if(t)return r(xr.invalidToken(t.message));r(null,e)}))},Mn.prototype.renewAuth=function(t,e){var r=!!t.usePostMessage,n=t.postMessageDataType||!1,o=t.postMessageOrigin||gr.getWindow().origin,i=t.timeout,s=this,a=hr.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),ir.check(a,{type:"object",message:"options parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=hr.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),On.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:n,postMessageOrigin:o,timeout:i}).login(r,(function(t,r){if("object"==typeof r)return e(t,r);s.parseHash({hash:r},e)}))},Mn.prototype.checkSession=function(t,e){var r=hr.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===r.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(r=this.transactionManager.process(r)),r.redirectUri?(ir.check(r,{type:"object",message:"options parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),r=hr.blacklist(r,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(r,jr(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},Mn.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},Mn.prototype.passwordlessStart=function(t,e){var r=hr.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(r),this.client.passwordless.start(t,e)},Mn.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},Mn.prototype.authorize=function(t){var e=hr.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce","organization","invitation"]).with(t);ir.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",gr.redirect(this.client.buildAuthorizeUrl(e))},Mn.prototype.signupAndAuthorize=function(t,e){var r=this;return this.client.dbConnection.signup(hr.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.realm=t.connection,t.username||(t.username=t.email),r.client.login(t,e)}))},Mn.prototype.login=function(t,e){var r=hr.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting","organization","invitation"]).with(t);r=this.transactionManager.process(r),gr.getWindow().location.host===this.baseOptions.domain?(r.connection=r.realm,delete r.realm,this._universalLogin.login(r,e)):this.crossOriginAuthentication.login(r,e)},Mn.prototype.passwordlessLogin=function(t,e){var r=hr.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting"]).with(t);if(r=this.transactionManager.process(r),gr.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(r,e);else{var n=hr.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:r.connection,username:r.email||r.phoneNumber,otp:r.verificationCode},hr.blacklist(r,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(n,e)}},Mn.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},Mn.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},Mn.prototype.logout=function(t){gr.redirect(this.client.buildLogoutUrl(t))},Mn.prototype.passwordlessVerify=function(t,e){var r=this,n=hr.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting"]).with(t);return ir.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=this.transactionManager.process(n),this.client.passwordless.verify(n,(function(o){if(o)return e(o);function i(){gr.redirect(r.client.passwordless.buildVerifyUrl(n))}if("function"==typeof t.onRedirecting)return t.onRedirecting((function(){i()}));i()}))},Mn.prototype.renderCaptcha=function(t,e,r){return Rn(this.client,t,e,r)},Mn.prototype.renderPasswordlessCaptcha=function(t,e,r){return qn(this.client,t,e,r)},Ln.prototype.buildVerifyUrl=function(t){var e,n;return ir.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=hr.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=hr.toSnakeCase(e,["auth0Client"]),n=me.stringify(e),r(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},Ln.prototype.start=function(t,e){var n,o;ir.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"passwordless","start");var i=t.xRequestLanguage;delete t.xRequestLanguage,(o=hr.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(o.authParams=o.authParams||{},o.authParams.scope=o.authParams.scope||o.scope),o.redirectUri&&(o.authParams=o.authParams||{},o.authParams.redirect_uri=o.authParams.redirectUri||o.redirectUri),o.responseType&&(o.authParams=o.authParams||{},o.authParams.response_type=o.authParams.responseType||o.responseType),delete o.redirectUri,delete o.responseType,delete o.scope,o=hr.toSnakeCase(o,["auth0Client","authParams"]);var s=i?{xRequestLanguage:i}:void 0;return this.request.post(n,s).send(o).end(jr(e))},Ln.prototype.verify=function(t,e){var n,o;return ir.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),o=hr.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client","clientID"]),o=hr.toSnakeCase(o,["auth0Client"]),n=r(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(o).end(jr(e))},Ln.prototype.getChallenge=function(t){if(ir.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=r(this.baseOptions.rootUrl,"passwordless","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(jr(t,{ignoreCasing:!0}))},Nn.prototype.signup=function(t,e){var n,o,i;return ir.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"dbconnections","signup"),i=(o=hr.merge(this.baseOptions,["clientID","state"]).with(t)).user_metadata||o.userMetadata,o=hr.blacklist(o,["scope","userMetadata","user_metadata"]),o=hr.toSnakeCase(o,["auth0Client"]),i&&(o.user_metadata=i),this.request.post(n).send(o).end(jr(e))},Nn.prototype.changePassword=function(t,e){var n,o;return ir.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"dbconnections","change_password"),o=hr.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),o=hr.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(jr(e))},Bn.prototype.buildAuthorizeUrl=function(t){var e,n;return ir.check(t,{type:"object",message:"options parameter is not valid"}),e=hr.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),ir.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&&ir.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=hr.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=hr.toSnakeCase(e,["auth0Client"]),e=Ir(this.warn,e),n=me.stringify(e),r(this.baseOptions.rootUrl,"authorize","?"+n)},Bn.prototype.buildLogoutUrl=function(t){var e,n;return ir.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=hr.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=hr.toSnakeCase(e,["auth0Client","returnTo"]),n=me.stringify(hr.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(n+="&federated"),r(this.baseOptions.rootUrl,"v2","logout","?"+n)},Bn.prototype.loginWithDefaultDirectory=function(t,e){return ir.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},Bn.prototype.login=function(t,e){return ir.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},Bn.prototype.oauthToken=function(t,e){var n,o;return ir.check(t,{type:"object",message:"options parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"oauth","token"),o=hr.merge(this.baseOptions,["clientID","scope","audience"]).with(t),ir.check(o,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),o=hr.toSnakeCase(o,["auth0Client"]),o=Dr(this.warn,o),this.request.post(n).send(o).end(jr(e))},Bn.prototype.loginWithResourceOwner=function(t,e){var n,o;return ir.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"oauth","ro"),o=hr.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(o=hr.toSnakeCase(o,["auth0Client"])).grant_type=o.grant_type||"password",this.request.post(n).send(o).end(jr(e))},Bn.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new Mn(this.baseOptions)),gr.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),ir.check(e,{type:"function",message:"cb parameter is not valid"});var r=this.baseOptions.clientID,n=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:n.lastUsedConnection,timeout:5e3},(function(t,o){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):n.lastUsedSub&&n.lastUsedSub!==o.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:n.lastUsedConnection},lastUsedUserID:o.idTokenPayload.sub,lastUsedUsername:o.idTokenPayload.email||o.idTokenPayload.name,lastUsedClientID:r,sessionClients:[r],sso:!0})}))},Bn.prototype.userInfo=function(t,e){var n;return ir.check(t,{type:"string",message:"accessToken parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"userinfo"),this.request.get(n).set("Authorization","Bearer "+t).end(jr(e,{ignoreCasing:!0}))},Bn.prototype.getChallenge=function(t){if(ir.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=r(this.baseOptions.rootUrl,"usernamepassword","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(jr(t,{ignoreCasing:!0}))},Bn.prototype.delegation=function(t,e){var n,o;return ir.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"delegation"),o=hr.merge(this.baseOptions,["clientID"]).with(t),o=hr.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(jr(e))},Bn.prototype.getUserCountry=function(t){var e;return ir.check(t,{type:"function",message:"cb parameter is not valid"}),e=r(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(jr(t))},Hn.prototype.getUser=function(t,e){var n;return ir.check(t,{type:"string",message:"userId parameter is not valid"}),ir.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"users",t),this.request.get(n).end(jr(e,{ignoreCasing:!0}))},Hn.prototype.patchUserMetadata=function(t,e,n){var o;return ir.check(t,{type:"string",message:"userId parameter is not valid"}),ir.check(e,{type:"object",message:"userMetadata parameter is not valid"}),ir.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t),this.request.patch(o).send({user_metadata:e}).end(jr(n,{ignoreCasing:!0}))},Hn.prototype.patchUserAttributes=function(t,e,n){var o;return ir.check(t,{type:"string",message:"userId parameter is not valid"}),ir.check(e,{type:"object",message:"user parameter is not valid"}),ir.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t),this.request.patch(o).send(e).end(jr(n,{ignoreCasing:!0}))},Hn.prototype.linkUser=function(t,e,n){var o;return ir.check(t,{type:"string",message:"userId parameter is not valid"}),ir.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),ir.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(o).send({link_with:e}).end(jr(n,{ignoreCasing:!0}))};var Fn={Authentication:Bn,Management:Hn,WebAuth:Mn,version:tr};export{Bn as Authentication,Hn as Management,Mn as WebAuth,Fn as default,tr as version};
1
+ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=e((function(e){var r,n;r=t,n=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0].match(/^file:\/\/\//)?t[0]=t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0]=t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=n<t.length-1?o.replace(/[\/]+$/,""):o.replace(/[\/]+$/,"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=n():r.urljoin=n()})),n="undefined"!=typeof Symbol&&Symbol,o="Function.prototype.bind called on incompatible ",i=Array.prototype.slice,s=Object.prototype.toString,a=Function.prototype.bind||function(t){var e=this;if("function"!=typeof e||"[object Function]"!==s.call(e))throw new TypeError(o+e);for(var r,n=i.call(arguments,1),a=function(){if(this instanceof r){var o=e.apply(this,n.concat(i.call(arguments)));return Object(o)===o?o:this}return e.apply(t,n.concat(i.call(arguments)))},p=Math.max(0,e.length-n.length),u=[],c=0;c<p;c++)u.push("$"+c);if(r=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(a),e.prototype){var l=function(){};l.prototype=e.prototype,r.prototype=new l,l.prototype=null}return r},p=a.call(Function.call,Object.prototype.hasOwnProperty),u=SyntaxError,c=Function,l=TypeError,h=function(t){try{return c('"use strict"; return ('+t+").constructor;")()}catch(t){}},f=Object.getOwnPropertyDescriptor;if(f)try{f({},"")}catch(xr){f=null}var d=function(){throw new l},y=f?function(){try{return d}catch(t){try{return f(arguments,"callee").get}catch(t){return d}}}():d,m="function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("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}(),g=Object.getPrototypeOf||function(t){return t.__proto__},v={},b="undefined"==typeof Uint8Array?void 0:g(Uint8Array),w={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":m?g([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":c,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":m?g(g([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&m?g((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&m?g((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":m?g(""[Symbol.iterator]()):void 0,"%Symbol%":m?Symbol:void 0,"%SyntaxError%":u,"%ThrowTypeError%":y,"%TypedArray%":b,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},_={"%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"]},T=a.call(Function.call,Array.prototype.concat),O=a.call(Function.apply,Array.prototype.splice),S=a.call(Function.call,String.prototype.replace),k=a.call(Function.call,String.prototype.slice),A=a.call(Function.call,RegExp.prototype.exec),x=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,E=function(t){var e=k(t,0,1),r=k(t,-1);if("%"===e&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new u("invalid intrinsic syntax, expected opening `%`");var n=[];return S(t,x,(function(t,e,r,o){n[n.length]=r?S(o,j,"$1"):e||t})),n},C=function(t,e){var r,n=t;if(p(_,n)&&(n="%"+(r=_[n])[0]+"%"),p(w,n)){var o=w[n];if(o===v&&(o=function t(e){var r;if("%AsyncFunction%"===e)r=h("async function () {}");else if("%GeneratorFunction%"===e)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=h("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=g(o.prototype))}return w[e]=r,r}(n)),void 0===o&&!e)throw new l("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new u("intrinsic "+t+" does not exist!")},D=function(t,e){if("string"!=typeof t||0===t.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new l('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/g,t))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=E(t),n=r.length>0?r[0]:"",o=C("%"+n+"%",e),i=o.name,s=o.value,a=!1,c=o.alias;c&&(n=c[0],O(r,T([0,1],c)));for(var h=1,d=!0;h<r.length;h+=1){var y=r[h],m=k(y,0,1),g=k(y,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new u("property names with quotes must have matching quotes");if("constructor"!==y&&d||(a=!0),p(w,i="%"+(n+="."+y)+"%"))s=w[i];else if(null!=s){if(!(y in s)){if(!e)throw new l("base intrinsic for "+t+" exists, but the property is not available.");return}if(f&&h+1>=r.length){var v=f(s,y);s=(d=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:s[y]}else d=p(s,y),s=s[y];d&&!a&&(w[i]=s)}}return s},I=e((function(t){var e=D("%Function.prototype.apply%"),r=D("%Function.prototype.call%"),n=D("%Reflect.apply%",!0)||a.call(r,e),o=D("%Object.getOwnPropertyDescriptor%",!0),i=D("%Object.defineProperty%",!0),s=D("%Math.max%");if(i)try{i({},"a",{value:1})}catch(t){i=null}t.exports=function(t){var e=n(a,r,arguments);if(o&&i){var p=o(e,"length");p.configurable&&i(e,"length",{value:1+s(0,t.length-(arguments.length-1))})}return e};var p=function(){return n(a,e,arguments)};i?i(t.exports,"apply",{value:p}):t.exports.apply=p})),P=(I.apply,I(D("String.prototype.indexOf"))),R=function(t,e){var r=D(t,!!e);return"function"==typeof r&&P(t,".prototype.")>-1?I(r):r},q=function(t){return t&&t.default||t}(Object.freeze({__proto__:null,default:{}})),U="function"==typeof Map&&Map.prototype,M=Object.getOwnPropertyDescriptor&&U?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,L=U&&M&&"function"==typeof M.get?M.get:null,N=U&&Map.prototype.forEach,B="function"==typeof Set&&Set.prototype,H=Object.getOwnPropertyDescriptor&&B?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,F=B&&H&&"function"==typeof H.get?H.get:null,W=B&&Set.prototype.forEach,z="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,V="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,$="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,J=Boolean.prototype.valueOf,G=Object.prototype.toString,X=Function.prototype.toString,Q=String.prototype.match,Z=String.prototype.slice,K=String.prototype.replace,Y=String.prototype.toUpperCase,tt=String.prototype.toLowerCase,et=RegExp.prototype.test,rt=Array.prototype.concat,nt=Array.prototype.join,ot=Array.prototype.slice,it=Math.floor,st="function"==typeof BigInt?BigInt.prototype.valueOf:null,at=Object.getOwnPropertySymbols,pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,ut="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ct="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,lt=Object.prototype.propertyIsEnumerable,ht=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ft(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||et.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=Z.call(e,o.length+1);return K.call(o,r,"$&_")+"."+K.call(K.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return K.call(e,r,"$&_")}var dt=q.custom,yt=_t(dt)?dt:null,mt=function t(e,r,n,o){var i=r||{};if(Ot(i,"quoteStyle")&&"single"!==i.quoteStyle&&"double"!==i.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ot(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 s=!Ot(i,"customInspect")||i.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ot(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(Ot(i,"numericSeparator")&&"boolean"!=typeof i.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=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 function t(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,o="... "+n+" more character"+(n>1?"s":"");return t(Z.call(e,0,r.maxStringLength),r)+o}return gt(K.call(K.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,At),"single",r)}(e,i);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var p=String(e);return a?ft(e,p):p}if("bigint"==typeof e){var u=String(e)+"n";return a?ft(e,u):u}var c=void 0===i.depth?5:i.depth;if(void 0===n&&(n=0),n>=c&&c>0&&"object"==typeof e)return bt(e)?"[Array]":"[Object]";var l=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=nt.call(Array(t.indent+1)," ")}return{base:r,prev:nt.call(Array(e+1),r)}}(i,n);if(void 0===o)o=[];else if(kt(o,e)>=0)return"[Circular]";function h(e,r,s){if(r&&(o=ot.call(o)).push(r),s){var a={depth:i.depth};return Ot(i,"quoteStyle")&&(a.quoteStyle=i.quoteStyle),t(e,a,n+1,o)}return t(e,i,n+1,o)}if("function"==typeof e&&!wt(e)){var f=function(t){if(t.name)return t.name;var e=Q.call(X.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),d=Dt(e,h);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(d.length>0?" { "+nt.call(d,", ")+" }":"")}if(_t(e)){var y=ut?K.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(e);return"object"!=typeof e||ut?y:xt(y)}if(function(t){return!(!t||"object"!=typeof t)&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)}(e)){for(var m="<"+tt.call(String(e.nodeName)),g=e.attributes||[],v=0;v<g.length;v++)m+=" "+g[v].name+"="+gt(vt(g[v].value),"double",i);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+"</"+tt.call(String(e.nodeName))+">"}if(bt(e)){if(0===e.length)return"[]";var b=Dt(e,h);return l&&!function(t){for(var e=0;e<t.length;e++)if(kt(t[e],"\n")>=0)return!1;return!0}(b)?"["+Ct(b,l)+"]":"[ "+nt.call(b,", ")+" ]"}if(function(t){return!("[object Error]"!==St(t)||ct&&"object"==typeof t&&ct in t)}(e)){var w=Dt(e,h);return"cause"in Error.prototype||!("cause"in e)||lt.call(e,"cause")?0===w.length?"["+String(e)+"]":"{ ["+String(e)+"] "+nt.call(w,", ")+" }":"{ ["+String(e)+"] "+nt.call(rt.call("[cause]: "+h(e.cause),w),", ")+" }"}if("object"==typeof e&&s){if(yt&&"function"==typeof e[yt]&&q)return q(e,{depth:c-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!L||!t||"object"!=typeof t)return!1;try{L.call(t);try{F.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var _=[];return N.call(e,(function(t,r){_.push(h(r,e,!0)+" => "+h(t,e))})),Et("Map",L.call(e),_,l)}if(function(t){if(!F||!t||"object"!=typeof t)return!1;try{F.call(t);try{L.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var T=[];return W.call(e,(function(t){T.push(h(t,e))})),Et("Set",F.call(e),T,l)}if(function(t){if(!z||!t||"object"!=typeof t)return!1;try{z.call(t,z);try{V.call(t,V)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return jt("WeakMap");if(function(t){if(!V||!t||"object"!=typeof t)return!1;try{V.call(t,V);try{z.call(t,z)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return jt("WeakSet");if(function(t){if(!$||!t||"object"!=typeof t)return!1;try{return $.call(t),!0}catch(t){}return!1}(e))return jt("WeakRef");if(function(t){return!("[object Number]"!==St(t)||ct&&"object"==typeof t&&ct in t)}(e))return xt(h(Number(e)));if(function(t){if(!t||"object"!=typeof t||!st)return!1;try{return st.call(t),!0}catch(t){}return!1}(e))return xt(h(st.call(e)));if(function(t){return!("[object Boolean]"!==St(t)||ct&&"object"==typeof t&&ct in t)}(e))return xt(J.call(e));if(function(t){return!("[object String]"!==St(t)||ct&&"object"==typeof t&&ct in t)}(e))return xt(h(String(e)));if(!function(t){return!("[object Date]"!==St(t)||ct&&"object"==typeof t&&ct in t)}(e)&&!wt(e)){var O=Dt(e,h),S=ht?ht(e)===Object.prototype:e instanceof Object||e.constructor===Object,k=e instanceof Object?"":"null prototype",A=!S&&ct&&Object(e)===e&&ct in e?Z.call(St(e),8,-1):k?"Object":"",x=(S||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(A||k?"["+nt.call(rt.call([],A||[],k||[]),": ")+"] ":"");return 0===O.length?x+"{}":l?x+"{"+Ct(O,l)+"}":x+"{ "+nt.call(O,", ")+" }"}return String(e)};function gt(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function vt(t){return K.call(String(t),/"/g,"&quot;")}function bt(t){return!("[object Array]"!==St(t)||ct&&"object"==typeof t&&ct in t)}function wt(t){return!("[object RegExp]"!==St(t)||ct&&"object"==typeof t&&ct in t)}function _t(t){if(ut)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!pt)return!1;try{return pt.call(t),!0}catch(t){}return!1}var Tt=Object.prototype.hasOwnProperty||function(t){return t in this};function Ot(t,e){return Tt.call(t,e)}function St(t){return G.call(t)}function kt(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 At(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":"")+Y.call(e.toString(16))}function xt(t){return"Object("+t+")"}function jt(t){return t+" { ? }"}function Et(t,e,r,n){return t+" ("+e+") {"+(n?Ct(r,n):nt.call(r,", "))+"}"}function Ct(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+nt.call(t,","+r)+"\n"+e.prev}function Dt(t,e){var r=bt(t),n=[];if(r){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Ot(t,o)?e(t[o],t):""}var i,s="function"==typeof at?at(t):[];if(ut){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var p in t)Ot(t,p)&&(r&&String(Number(p))===p&&p<t.length||ut&&i["$"+p]instanceof Symbol||(et.call(/[^\w$]/,p)?n.push(e(p,t)+": "+e(t[p],t)):n.push(p+": "+e(t[p],t))));if("function"==typeof at)for(var u=0;u<s.length;u++)lt.call(t,s[u])&&n.push("["+e(s[u])+"]: "+e(t[s[u]],t));return n}var It=D("%TypeError%"),Pt=D("%WeakMap%",!0),Rt=D("%Map%",!0),qt=R("WeakMap.prototype.get",!0),Ut=R("WeakMap.prototype.set",!0),Mt=R("WeakMap.prototype.has",!0),Lt=R("Map.prototype.get",!0),Nt=R("Map.prototype.set",!0),Bt=R("Map.prototype.has",!0),Ht=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},Ft=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new It("Side channel does not contain "+mt(t))},get:function(n){if(Pt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return qt(t,n)}else if(Rt){if(e)return Lt(e,n)}else if(r)return function(t,e){var r=Ht(t,e);return r&&r.value}(r,n)},has:function(n){if(Pt&&n&&("object"==typeof n||"function"==typeof n)){if(t)return Mt(t,n)}else if(Rt){if(e)return Bt(e,n)}else if(r)return function(t,e){return!!Ht(t,e)}(r,n);return!1},set:function(n,o){Pt&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new Pt),Ut(t,n,o)):Rt?(e||(e=new Rt),Nt(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=Ht(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n},Wt=String.prototype.replace,zt=/%20/g,Vt={default:"RFC3986",formatters:{RFC1738:function(t){return Wt.call(t,zt,"+")},RFC3986:function(t){return String(t)}},RFC1738:"RFC1738",RFC3986:"RFC3986"},$t=Object.prototype.hasOwnProperty,Jt=Array.isArray,Gt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Xt=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},Qt={arrayToObject:Xt,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],s=Object.keys(i),a=0;a<s.length;++a){var p=s[a],u=i[p];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(e.push({obj:i,prop:p}),r.push(u))}return function(t){for(;t.length>1;){var e=t.pop(),r=e.obj[e.prop];if(Jt(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 s="",a=0;a<i.length;++a){var p=i.charCodeAt(a);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===Vt.RFC1738&&(40===p||41===p)?s+=i.charAt(a):p<128?s+=Gt[p]:p<2048?s+=Gt[192|p>>6]+Gt[128|63&p]:p<55296||p>=57344?s+=Gt[224|p>>12]+Gt[128|p>>6&63]+Gt[128|63&p]:(a+=1,p=65536+((1023&p)<<10|1023&i.charCodeAt(a)),s+=Gt[240|p>>18]+Gt[128|p>>12&63]+Gt[128|p>>6&63]+Gt[128|63&p])}return s},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(Jt(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(Jt(e))e.push(r);else{if(!e||"object"!=typeof e)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!$t.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e)return[e].concat(r);var o=e;return Jt(e)&&!Jt(r)&&(o=Xt(e,n)),Jt(e)&&Jt(r)?(r.forEach((function(r,o){if($t.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 $t.call(e,o)?e[o]=t(e[o],i,n):e[o]=i,e}),o)}},Zt=Object.prototype.hasOwnProperty,Kt={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},Yt=Array.isArray,te=String.prototype.split,ee=Array.prototype.push,re=function(t,e){ee.apply(t,Yt(e)?e:[e])},ne=Date.prototype.toISOString,oe=Vt.default,ie={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Qt.encode,encodeValuesOnly:!1,format:oe,formatter:Vt.formatters[oe],indices:!1,serializeDate:function(t){return ne.call(t)},skipNulls:!1,strictNullHandling:!1},se={},ae=function t(e,r,n,o,i,s,a,p,u,c,l,h,f,d,y,m){for(var g=e,v=m,b=0,w=!1;void 0!==(v=v.get(se))&&!w;){var _=v.get(e);if(b+=1,void 0!==_){if(_===b)throw new RangeError("Cyclic object value");w=!0}void 0===v.get(se)&&(b=0)}if("function"==typeof p?g=p(r,g):g instanceof Date?g=l(g):"comma"===n&&Yt(g)&&(g=Qt.maybeMap(g,(function(t){return t instanceof Date?l(t):t}))),null===g){if(i)return a&&!d?a(r,ie.encoder,y,"key",h):r;g=""}if(function(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||"symbol"==typeof t||"bigint"==typeof t}(g)||Qt.isBuffer(g)){if(a){var T=d?r:a(r,ie.encoder,y,"key",h);if("comma"===n&&d){for(var O=te.call(String(g),","),S="",k=0;k<O.length;++k)S+=(0===k?"":",")+f(a(O[k],ie.encoder,y,"value",h));return[f(T)+(o&&Yt(g)&&1===O.length?"[]":"")+"="+S]}return[f(T)+"="+f(a(g,ie.encoder,y,"value",h))]}return[f(r)+"="+f(String(g))]}var A,x=[];if(void 0===g)return x;if("comma"===n&&Yt(g))A=[{value:g.length>0?g.join(",")||null:void 0}];else if(Yt(p))A=p;else{var j=Object.keys(g);A=u?j.sort(u):j}for(var E=o&&Yt(g)&&1===g.length?r+"[]":r,C=0;C<A.length;++C){var D=A[C],I="object"==typeof D&&void 0!==D.value?D.value:g[D];if(!s||null!==I){var P=Yt(g)?"function"==typeof n?n(E,D):E:E+(c?"."+D:"["+D+"]");m.set(e,b);var R=Ft();R.set(se,m),re(x,t(I,P,n,o,i,s,a,p,u,c,l,h,f,d,y,R))}}return x},pe=Object.prototype.hasOwnProperty,ue=Array.isArray,ce={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Qt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},le=function(t){return t.replace(/&#(\d+);/g,(function(t,e){return String.fromCharCode(parseInt(e,10))}))},he=function(t,e){return t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1?t.split(","):t},fe=function(t,e,r,n){if(t){var o=r.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(o),a=s?o.slice(0,s.index):o,p=[];if(a){if(!r.plainObjects&&pe.call(Object.prototype,a)&&!r.allowPrototypes)return;p.push(a)}for(var u=0;r.depth>0&&null!==(s=i.exec(o))&&u<r.depth;){if(u+=1,!r.plainObjects&&pe.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;p.push(s[1])}return s&&p.push("["+o.slice(s.index)+"]"),function(t,e,r,n){for(var o=n?e:he(e,r),i=t.length-1;i>=0;--i){var s,a=t[i];if("[]"===a&&r.parseArrays)s=[].concat(o);else{s=r.plainObjects?Object.create(null):{};var p="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,u=parseInt(p,10);r.parseArrays||""!==p?!isNaN(u)&&a!==p&&String(u)===p&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[])[u]=o:"__proto__"!==p&&(s[p]=o):s={0:o}}o=s}return o}(p,e,r,n)}},de=function(t,e){var r,n=t,o=function(t){if(!t)return ie;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||ie.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=Vt.default;if(void 0!==t.format){if(!Zt.call(Vt.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var n=Vt.formatters[r],o=ie.filter;return("function"==typeof t.filter||Yt(t.filter))&&(o=t.filter),{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:ie.addQueryPrefix,allowDots:void 0===t.allowDots?ie.allowDots:!!t.allowDots,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:ie.charsetSentinel,delimiter:void 0===t.delimiter?ie.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:ie.encode,encoder:"function"==typeof t.encoder?t.encoder:ie.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:ie.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:ie.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:ie.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:ie.strictNullHandling}}(e);"function"==typeof o.filter?n=(0,o.filter)("",n):Yt(o.filter)&&(r=o.filter);var i,s=[];if("object"!=typeof n||null===n)return"";i=e&&e.arrayFormat in Kt?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var a=Kt[i];if(e&&"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var p="comma"===a&&e&&e.commaRoundTrip;r||(r=Object.keys(n)),o.sort&&r.sort(o.sort);for(var u=Ft(),c=0;c<r.length;++c){var l=r[c];o.skipNulls&&null===n[l]||re(s,ae(n[l],l,a,p,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,u))}var h=s.join(o.delimiter),f=!0===o.addQueryPrefix?"?":"";return o.charsetSentinel&&("iso-8859-1"===o.charset?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),h.length>0?f+h:""},ye=e((function(t){function e(t){if(t)return function(t){for(var r in e.prototype)t[r]=e.prototype[r];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}})),me=we;we.default=we,we.stable=Oe,we.stableStringify=Oe;var ge=[],ve=[];function be(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function we(t,e,r,n){var o;void 0===n&&(n=be()),function t(e,r,n,o,i,s,a){var p;if(s+=1,"object"==typeof e&&null!==e){for(p=0;p<o.length;p++)if(o[p]===e)return void _e("[Circular]",e,r,i);if(void 0!==a.depthLimit&&s>a.depthLimit)return void _e("[...]",e,r,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void _e("[...]",e,r,i);if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)t(e[p],p,p,o,e,s,a);else{var u=Object.keys(e);for(p=0;p<u.length;p++){var c=u[p];t(e[c],c,p,o,e,s,a)}}o.pop()}}(t,"",0,[],void 0,0,n);try{o=0===ve.length?JSON.stringify(t,e,r):JSON.stringify(t,Se(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ge.length;){var i=ge.pop();4===i.length?Object.defineProperty(i[0],i[1],i[3]):i[0][i[1]]=i[2]}}return o}function _e(t,e,r,n){var o=Object.getOwnPropertyDescriptor(n,r);void 0!==o.get?o.configurable?(Object.defineProperty(n,r,{value:t}),ge.push([n,r,e,o])):ve.push([e,r,t]):(n[r]=t,ge.push([n,r,e]))}function Te(t,e){return t<e?-1:t>e?1:0}function Oe(t,e,r,n){void 0===n&&(n=be());var o,i=function t(e,r,n,o,i,s,a){var p;if(s+=1,"object"==typeof e&&null!==e){for(p=0;p<o.length;p++)if(o[p]===e)return void _e("[Circular]",e,r,i);try{if("function"==typeof e.toJSON)return}catch(t){return}if(void 0!==a.depthLimit&&s>a.depthLimit)return void _e("[...]",e,r,i);if(void 0!==a.edgesLimit&&n+1>a.edgesLimit)return void _e("[...]",e,r,i);if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)t(e[p],p,p,o,e,s,a);else{var u={},c=Object.keys(e).sort(Te);for(p=0;p<c.length;p++){var l=c[p];t(e[l],l,p,o,e,s,a),u[l]=e[l]}if(void 0===i)return u;ge.push([i,r,e]),i[r]=u}o.pop()}}(t,"",0,[],void 0,0,n)||t;try{o=0===ve.length?JSON.stringify(i,e,r):JSON.stringify(i,Se(e),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==ge.length;){var s=ge.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function Se(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(ve.length>0)for(var n=0;n<ve.length;n++){var o=ve[n];if(o[1]===e&&o[0]===r){r=o[2],ve.splice(n,1);break}}return t.call(this,e,r)}}function ke(t){return(ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Ae=function(t){return null!==t&&"object"===ke(t)};function xe(t){return(xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var je=Ee;function Ee(t){if(t)return function(t){for(var e in Ee.prototype)Object.prototype.hasOwnProperty.call(Ee.prototype,e)&&(t[e]=Ee.prototype[e]);return t}(t)}Ee.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},Ee.prototype.parse=function(t){return this._parser=t,this},Ee.prototype.responseType=function(t){return this._responseType=t,this},Ee.prototype.serialize=function(t){return this._serializer=t,this},Ee.prototype.timeout=function(t){if(!t||"object"!==xe(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},Ee.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var Ce=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];Ee.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&Ce.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},Ee.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},Ee.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(!(r._maxRetries&&r._maxRetries>r._retries))if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},Ee.prototype.catch=function(t){return this.then(void 0,t)},Ee.prototype.use=function(t){return t(this),this},Ee.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},Ee.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},Ee.prototype.get=function(t){return this._header[t.toLowerCase()]},Ee.prototype.getHeader=Ee.prototype.get,Ee.prototype.set=function(t,e){if(Ae(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},Ee.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},Ee.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(Ae(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},Ee.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},Ee.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},Ee.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},Ee.prototype.redirects=function(t){return this._maxRedirects=t,this},Ee.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},Ee.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},Ee.prototype.send=function(t){var e=Ae(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&Ae(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},Ee.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},Ee.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},Ee.prototype._appendQueryString=function(){console.warn("Unsupported")},Ee.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},Ee.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))};var De=Ie;function Ie(t){if(t)return function(t){for(var e in Ie.prototype)Object.prototype.hasOwnProperty.call(Ie.prototype,e)&&(t[e]=Ie.prototype[e]);return t}(t)}function Pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Re(){this._defaults=[]}Ie.prototype.get=function(t){return this.header[t.toLowerCase()]},Ie.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=e.split(/ *; */).shift();var r=function(t){return t.split(/ *; */).reduce((function(t,e){var r=e.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(t[n]=o),t}),{})}(e);for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(this[n]=r[n]);this.links={};try{t.link&&(this.links=function(t){return t.split(/ *, */).reduce((function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t}),{})}(t.link))}catch(t){}},Ie.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t},["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){Re.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),Re.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,function(t){return function(t){if(Array.isArray(t))return Pe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Pe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.args))}))};for(var qe=Re,Ue=e((function(t,e){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n;function o(){}"undefined"!=typeof window?n=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),n=void 0):n=self,t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var i=e=t.exports;e.Request=h,i.getXHR=function(){if(n.XMLHttpRequest&&(!n.location||"file:"!==n.location.protocol||!n.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var s="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function a(t){if(!Ae(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&p(e,r,t[r]);return e.join("&")}function p(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){p(t,e,r)}));else if(Ae(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&p(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function u(t){for(var e,r,n={},o=t.split("&"),i=0,s=o.length;i<s;++i)-1===(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function c(t){return/[/+]json($|[^-\w])/.test(t)}function l(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),a={},p=0,u=i.length;p<u;++p)-1!==(e=(r=i[p]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=s(r.slice(e+1)),a[n]=o);return a}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function h(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new l(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function f(t,e,r){var n=i("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}i.serializeObject=a,i.parseString=u,i.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},i.serialize={"application/x-www-form-urlencoded":a,"application/json":me},i.parse={"application/x-www-form-urlencoded":u,"application/json":JSON.parse},De(l.prototype),l.prototype._parseBody=function(t){var e=i.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&c(this.type)&&(e=i.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},l.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},i.Response=l,ye(h.prototype),je(h.prototype),h.prototype.type=function(t){return this.set("Content-Type",i.types[t]||t),this},h.prototype.accept=function(t){return this.set("Accept",i.types[t]||t),this},h.prototype.auth=function(t,e,n){1===arguments.length&&(e=""),"object"===r(e)&&null!==e&&(n=e,e=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var o=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,n,o)},h.prototype.query=function(t){return"string"!=typeof t&&(t=a(t)),t&&this._query.push(t),this},h.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},h.prototype._getFormData=function(){return this._formData||(this._formData=new n.FormData),this._formData},h.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},h.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},h.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},h.prototype.ca=h.prototype.agent,h.prototype.buffer=h.prototype.ca,h.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},h.prototype.pipe=h.prototype.write,h.prototype._isHost=function(t){return t&&"object"===r(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},h.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||o,this._finalizeQueryString(),this._end()},h.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},h.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=i.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],s=this._serializer||i.serialize[o?o.split(";")[0]:""];!s&&c(o)&&(s=i.serialize["application/json"]),s&&(r=s(r))}for(var a in this.header)null!==this.header[a]&&Object.prototype.hasOwnProperty.call(this.header,a)&&e.setRequestHeader(a,this.header[a]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},i.agent=function(){return new qe},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){qe.prototype[t.toLowerCase()]=function(e,r){var n=new i.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),qe.prototype.del=qe.prototype.delete,i.get=function(t,e,r){var n=i("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},i.head=function(t,e,r){var n=i("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},i.options=function(t,e,r){var n=i("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},i.del=f,i.delete=f,i.patch=function(t,e,r){var n=i("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},i.post=function(t,e,r){var n=i("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},i.put=function(t,e,r){var n=i("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}})),Me=(Ue.Request,[]),Le=[],Ne=("undefined"!=typeof Uint8Array&&Uint8Array,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Be=0,He=Ne.length;Be<He;++Be)Me[Be]=Ne[Be],Le[Ne.charCodeAt(Be)]=Be;function Fe(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function We(t,e,r){for(var n,o,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(Me[(o=n)>>18&63]+Me[o>>12&63]+Me[o>>6&63]+Me[63&o]);return i.join("")}Le["-".charCodeAt(0)]=62,Le["_".charCodeAt(0)]=63;var ze=function(t){for(var e,r=t.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(We(t,i,i+16383>s?s:i+16383));return 1===n?(e=t[r-1],o.push(Me[e>>2]+Me[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),o.join("")},Ve=function(t){return ze(function(t){for(var e=new Array(t.length),r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}(t)).replace(/\+/g,"-").replace(/\//g,"_")},$e={raw:"9.20.1"},Je=Object.prototype.toString;function Ge(t,e,r,n){if(r="array"===r?"object":r,t&&typeof t[e]!==r)throw new Error(n)}function Xe(t,e,r){if(typeof t!==e)throw new Error(r)}function Qe(t,e,r){if(-1===e.indexOf(t))throw new Error(r)}var Ze={check:function(t,e,r){if(e.optional&&!t||Xe(t,e.type,e.message),"object"===e.type&&r)for(var n=Object.keys(r),o=0;o<n.length;o++){var i=n[o];r[i].optional&&!t[i]||r[i].condition&&!r[i].condition(t)||(Ge(t,i,r[i].type,r[i].message),r[i].values&&Qe(t[i],r[i].values,r[i].value_message))}},attribute:Ge,variable:Xe,value:Qe,isArray:function(t){return this.supportsIsArray()?Array.isArray(t):"[object Array]"===Je.call(t)},supportsIsArray:function(){return null!=Array.isArray}};function Ke(t){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var o=Object.keys(Object(n)),i=0,s=o.length;i<s;i++){var a=o[i],p=Object.getOwnPropertyDescriptor(n,a);void 0!==p&&p.enumerable&&(e[a]=n[a])}}return e}var Ye=function(){return Object.assign?Object.assign:Ke};function tr(t,e){return e.reduce((function(e,r){return t[r]&&(e[r]=t[r]),e}),{})}function er(t){var e=[];for(var r in t)e.push(t[r]);return e}function rr(){var t=er(arguments);return t.unshift({}),Ye().apply(void 0,t)}function nr(t){var e=t.match(/^(https?:|file:|chrome-extension:)\/\/(([^:/?#]*)(?::([0-9]+))?)([/]{0,1}[^?#]*)(\?[^#]*|)(#.*|)$/);return e&&{href:t,protocol:e[1],host:e[2],hostname:e[3],port:e[4],pathname:e[5],search:e[6],hash:e[7]}}function or(t,e){var r=rr(t);return t[e]&&(r[e]=t[e].trim()),r}var ir={toSnakeCase:function t(e,r){return"object"!=typeof e||Ze.isArray(e)||null===e?e:(r=r||[],Object.keys(e).reduce((function(n,o){return n[-1===r.indexOf(o)?function(t){for(var e,r="",n=0,o=!0,i=!0;n<t.length;)e=t.charCodeAt(n),!i&&e>=65&&e<=90||!o&&e>=48&&e<=57?(r+="_",r+=t[n].toLowerCase()):r+=t[n].toLowerCase(),o=e>=48&&e<=57,i=e>=65&&e<=90,n++;return r}(o):o]=t(e[o]),n}),{}))},toCamelCase:function t(e,r,n){return"object"!=typeof e||Ze.isArray(e)||null===e?e:(r=r||[],n=n||{},Object.keys(e).reduce((function(o,i){var s,a=-1===r.indexOf(i)?(s=i.split("_")).reduce((function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)}),s.shift()):i;return o[a]=t(e[a]||e[i],[],n),n.keepOriginal&&(o[i]=t(e[i],[],n)),o}),{}))},blacklist:function(t,e){return Object.keys(t).reduce((function(r,n){return-1===e.indexOf(n)&&(r[n]=t[n]),r}),{})},merge:function(t,e){return{base:e?tr(t,e):t,with:function(t,e){return t=e?tr(t,e):t,rr(this.base,t)}}},pick:tr,getKeysNotIn:function(t,e){var r=[];for(var n in t)-1===e.indexOf(n)&&r.push(n);return r},extend:rr,getOriginFromUrl:function(t){if(t){var e=nr(t);if(!e)return null;var r=e.protocol+"//"+e.hostname;return e.port&&(r+=":"+e.port),r}},getLocationFromUrl:nr,trimUserDetails:function(t){return function(t,e){return["username","email","phoneNumber"].reduce(or,t)}(t)},updatePropertyOn:function t(e,r,n){"string"==typeof r&&(r=r.split("."));var o=r[0];e.hasOwnProperty(o)&&(1===r.length?e[o]=n:t(e[o],r.slice(1),n))}};function sr(t){this.request=t,this.method=t.method,this.url=t.url,this.body=t._data,this.headers=t._header}function ar(t){this.request=t}function pr(t){this._sendTelemetry=!1!==t._sendTelemetry||t._sendTelemetry,this._telemetryInfo=t._telemetryInfo||null,this._timesToRetryFailedRequests=t._timesToRetryFailedRequests,this.headers=t.headers||{},this._universalLoginPage=t.universalLoginPage}function ur(){return window}sr.prototype.abort=function(){this.request.abort()},sr.prototype.getMethod=function(){return this.method},sr.prototype.getBody=function(){return this.body},sr.prototype.getUrl=function(){return this.url},sr.prototype.getHeaders=function(){return this.headers},ar.prototype.set=function(t,e){return this.request=this.request.set(t,e),this},ar.prototype.send=function(t){return this.request=this.request.send(ir.trimUserDetails(t)),this},ar.prototype.withCredentials=function(){return this.request=this.request.withCredentials(),this},ar.prototype.end=function(t){return this.request.end(t),new sr(this.request)},pr.prototype.setCommonConfiguration=function(t,e){if(e=e||{},this._timesToRetryFailedRequests>0&&(t=t.retry(this._timesToRetryFailedRequests)),e.noHeaders)return t;var r=this.headers;t=t.set("Content-Type","application/json"),e.xRequestLanguage&&(t=t.set("X-Request-Language",e.xRequestLanguage));for(var n=Object.keys(this.headers),o=0;o<n.length;o++)t=t.set(n[o],r[n[o]]);return this._sendTelemetry&&(t=t.set("Auth0-Client",this.getTelemetryData())),t},pr.prototype.getTelemetryData=function(){var t=this._universalLoginPage?"auth0.js-ulp":"auth0.js",e={name:t,version:$e.raw};this._telemetryInfo&&((e=ir.extend({},this._telemetryInfo)).env=ir.extend({},this._telemetryInfo.env),e.env[t]=$e.raw);var r=JSON.stringify(e);return Ve(r)},pr.prototype.get=function(t,e){return new ar(this.setCommonConfiguration(Ue.get(t),e))},pr.prototype.post=function(t,e){return new ar(this.setCommonConfiguration(Ue.post(t),e))},pr.prototype.patch=function(t,e){return new ar(this.setCommonConfiguration(Ue.patch(t),e))};var cr={redirect:function(t){ur().location=t},getDocument:function(){return ur().document},getWindow:ur,getOrigin:function(){var t=ur().location,e=t.origin;return e||(e=ir.getOriginFromUrl(t.href)),e}};function lr(){}lr.prototype.getItem=function(){return null},lr.prototype.removeItem=function(){},lr.prototype.setItem=function(){};var hr=e((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 s=JSON.stringify(r);/^[\{\[]/.test(s)&&(r=s)}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 a="";for(var p in i)i[p]&&(a+="; "+p,!0!==i[p]&&(a+="="+i[p].split(";")[0]));return document.cookie=e+"="+r+a}}function s(t,r){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],s=0;s<i.length;s++){var a=i[s].split("="),p=a.slice(1).join("=");r||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var u=e(a[0]);if(p=(n.read||n)(p,u)||e(p),r)try{p=JSON.parse(p)}catch(t){}if(o[u]=p,t===u)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return s(t,!1)},o.getJSON=function(t){return s(t,!0)},o.remove=function(e,r){i(e,"",t(r,{expires:-1}))},o.defaults={},o.withConverter=r,o}((function(){}))},t.exports=r()}));function fr(t){return"_"+t+"_compat"}function dr(t){this._options=t||{}}function yr(t){this.disableWarnings=t.disableWarnings}function mr(t){if(this.warn=new yr({}),this.storage=new dr(t),!0===t.__tryLocalStorageFirst)try{var e=cr.getWindow().localStorage;e&&(this.storage=e)}catch(t){this.warn.warning(t),this.warn.warning("Can't use localStorage. Using CookieStorage instead.")}}function gr(t){this.handler=new mr(t)}function vr(t){this.storage=new gr(t)}function br(t,e){return{error:t,errorDescription:e}}dr.prototype.getItem=function(t){return hr.get(t)||hr.get(fr(t))},dr.prototype.removeItem=function(t){hr.remove(t),hr.remove(fr(t))},dr.prototype.setItem=function(t,e,r){var n=ir.extend({expires:1},r);if("https:"===cr.getWindow().location.protocol&&(n.secure=!0,n.sameSite="none",this._options.legacySameSiteCookie)){var o=ir.blacklist(n,["sameSite"]);hr.set(fr(t),e,o)}hr.set(t,e,n)},yr.prototype.warning=function(t){this.disableWarnings||console.warn(t)},mr.prototype.failover=function(){this.storage instanceof lr?this.warn.warning("DummyStorage: ignore failover"):this.storage instanceof dr?(this.warn.warning("CookieStorage: failing over DummyStorage"),this.storage=new lr):(this.warn.warning("LocalStorage: failing over CookieStorage"),this.storage=new dr)},mr.prototype.getItem=function(t){try{return this.storage.getItem(t)}catch(e){return this.warn.warning(e),this.failover(),this.getItem(t)}},mr.prototype.removeItem=function(t){try{return this.storage.removeItem(t)}catch(e){return this.warn.warning(e),this.failover(),this.removeItem(t)}},mr.prototype.setItem=function(t,e,r){try{return this.storage.setItem(t,e,r)}catch(n){return this.warn.warning(n),this.failover(),this.setItem(t,e,r)}},gr.prototype.getItem=function(t){var e=this.handler.getItem(t);try{return JSON.parse(e)}catch(t){return e}},gr.prototype.removeItem=function(t){return this.handler.removeItem(t)},gr.prototype.setItem=function(t,e,r){var n=JSON.stringify(e);return this.handler.setItem(t,n,r)},vr.prototype.set=function(t,e){var r={lastUsedConnection:t,lastUsedSub:e};this.storage.setItem("auth0.ssodata",JSON.stringify(r))},vr.prototype.get=function(){var t=this.storage.getItem("auth0.ssodata");if(t)return JSON.parse(t)};var wr={buildResponse:br,invalidToken:function(t){return br("invalid_token",t)}};function _r(t,e){return(e=e||{}).ignoreCasing=!!e.ignoreCasing&&e.ignoreCasing,function(r,n){var o;return r||n?(!r&&n.err&&(r=n.err,n=null),!r&&n.error&&(r=n,n=null),r?(o={original:r},ir.updatePropertyOn(o,"original.response.req._data.password","*****"),r.response&&r.response.statusCode&&(o.statusCode=r.response.statusCode),r.response&&r.response.statusText&&(o.statusText=r.response.statusText),r.response&&r.response.body&&(r=r.response.body),r.err&&(r=r.err),o.code=r.code||r.error||r.error_code||r.status||null,o.description=r.errorDescription||r.error_description||r.description||r.error||r.details||r.err||null,e.forceLegacyError&&(o.error=o.code,o.error_description=o.description),r.error_codes&&r.error_details&&(o.errorDetails={codes:r.error_codes,details:r.error_details}),r.name&&(o.name=r.name),r.policy&&(o.policy=r.policy),t(o)):!n.type||"text/html"!==n.type&&"text/plain"!==n.type?e.ignoreCasing?t(null,n.body||n):t(null,ir.toCamelCase(n.body||n,[],{keepOriginal:e.keepOriginalCasing})):t(null,n.text)):t(wr.buildResponse("generic_error","Something went wrong"))}}var Tr=["realm","audience","otp","client_id","client_secret","redirect_uri","scope","code","grant_type","username","password","refresh_token","assertion","client_assertion","client_assertion_type","code_verifier"],Or=["connection","connection_scope","auth0Client","owp","device","realm","organization","invitation","protocol","_csrf","_intstate","login_ticket","client_id","response_type","response_mode","redirect_uri","audience","scope","state","nonce","display","prompt","screen_hint","max_age","ui_locales","claims_locales","id_token_hint","login_hint","acr_values","claims","registration","request","request_uri","code_challenge","code_challenge_method","access_type","display"],Sr=function(t,e){return ir.pick(e,Tr)},kr=function(t,e){var r=ir.getKeysNotIn(e,Or);return r.length>0&&t.warning("Following parameters are not allowed on the `/authorize` endpoint: ["+r.join(",")+"]"),e},Ar="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function xr(t){var e={exports:{}};return t(e,e.exports),e.exports}var jr=xr((function(t,e){t.exports=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,n=void 0,o=void 0,i=function(t,e){h[r]=t,h[r+1]=e,2===(r+=2)&&(o?o(f):v())},s="undefined"!=typeof window?window:void 0,a=s||{},p=a.MutationObserver||a.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),c="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function l(){var t=setTimeout;return function(){return t(f,1)}}var h=new Array(1e3);function f(){for(var t=0;t<r;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;r=0}var d,y,m,g,v=void 0;function b(t,e){var r=this,n=new this.constructor(T);void 0===n[_]&&P(n);var o=r._state;if(o){var s=arguments[o-1];i((function(){return D(o,n,s,r._result)}))}else E(r,n,t,e);return n}function w(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(T);return k(e,t),e}v=u?function(){return process.nextTick(f)}:p?(y=0,m=new p(f),g=document.createTextNode(""),m.observe(g,{characterData:!0}),function(){g.data=y=++y%2}):c?((d=new MessageChannel).port1.onmessage=f,function(){return d.port2.postMessage(0)}):void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(n=t.runOnLoop||t.runOnContext)?function(){n(f)}:l()}catch(t){return l()}}():l();var _=Math.random().toString(36).substring(2);function T(){}var O=void 0;function S(e,r,n){r.constructor===e.constructor&&n===b&&r.constructor.resolve===w?function(t,e){1===e._state?x(t,e._result):2===e._state?j(t,e._result):E(e,void 0,(function(e){return k(t,e)}),(function(e){return j(t,e)}))}(e,r):void 0===n?x(e,r):t(n)?function(t,e,r){i((function(t){var n=!1,o=function(r,o,i,s){try{r.call(o,(function(r){n||(n=!0,e!==r?k(t,r):x(t,r))}),(function(e){n||(n=!0,j(t,e))}))}catch(t){return t}}(r,e);!n&&o&&(n=!0,j(t,o))}),t)}(e,r,n):x(e,r)}function k(t,e){if(t===e)j(t,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(n=e),null===n||"object"!==o&&"function"!==o)x(t,e);else{var r=void 0;try{r=e.then}catch(e){return void j(t,e)}S(t,e,r)}var n,o}function A(t){t._onerror&&t._onerror(t._result),C(t)}function x(t,e){t._state===O&&(t._result=e,t._state=1,0!==t._subscribers.length&&i(C,t))}function j(t,e){t._state===O&&(t._state=2,t._result=e,i(A,t))}function E(t,e,r,n){var o=t._subscribers,s=o.length;t._onerror=null,o[s]=e,o[s+1]=r,o[s+2]=n,0===s&&t._state&&i(C,t)}function C(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)o=e[s+r],(n=e[s])?D(r,n,o,i):o(i);t._subscribers.length=0}}function D(e,r,n,o){var i=t(n),s=void 0,a=void 0,p=!0;if(i){try{s=n(o)}catch(e){p=!1,a=e}if(r===s)return void j(r,new TypeError("A promises callback cannot return that same promise."))}else s=o;r._state!==O||(i&&p?k(r,s):!1===p?j(r,a):1===e?x(r,s):2===e&&j(r,s))}var I=0;function P(t){t[_]=I++,t._state=void 0,t._result=void 0,t._subscribers=[]}var R=function(){function t(t,r){this._instanceConstructor=t,this.promise=new t(T),this.promise[_]||P(this.promise),e(r)?(this.length=r.length,this._remaining=r.length,this._result=new Array(this.length),0===this.length?x(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&x(this.promise,this._result))):j(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===O&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===w){var o=void 0,i=void 0,s=!1;try{o=t.then}catch(t){s=!0,i=t}if(o===b&&t._state!==O)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===q){var a=new r(T);s?j(a,i):S(a,t,o),this._willSettleAt(a,e)}else this._willSettleAt(new r((function(e){return e(t)})),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===O&&(this._remaining--,2===t?j(n,r):this._result[e]=r),0===this._remaining&&x(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;E(t,void 0,(function(t){return r._settledAt(1,e,t)}),(function(t){return r._settledAt(2,e,t)}))},t}(),q=function(){function e(t){this[_]=I++,this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){k(t,e)}),(function(e){j(t,e)}))}catch(e){j(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();return q.prototype.then=b,q.all=function(t){return new R(this,t).promise},q.race=function(t){var r=this;return e(t)?new r((function(e,n){for(var o=t.length,i=0;i<o;i++)r.resolve(t[i]).then(e,n)})):new r((function(t,e){return e(new TypeError("You must pass an array to race."))}))},q.resolve=w,q.reject=function(t){var e=new this(T);return j(e,t),e},q._setScheduler=function(t){o=t},q._setAsap=function(t){i=t},q._asap=i,q.polyfill=function(){var t=void 0;if(void 0!==Ar)t=Ar;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=q},q.Promise=q,q}()})),Er={__proto__:null,default:{}},Cr=xr((function(t,e){var r;t.exports=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==Ar&&Ar.crypto&&(r=Ar.crypto),!r)try{r=Er}catch(t){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),i={},s=i.lib={},a=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},p=s.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,o=t.sigBytes;if(this.clamp(),n%4)for(var i=0;i<o;i++)e[n+i>>>2]|=(r[i>>>2]>>>24-i%4*8&255)<<24-(n+i)%4*8;else for(var s=0;s<o;s+=4)e[n+s>>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(n());return new p.init(e,t)}}),u=i.enc={},c=u.Hex={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++){var i=e[o>>>2]>>>24-o%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n+=2)r[n>>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new p.init(r,e/2)}},l=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o<r;o++)n.push(String.fromCharCode(e[o>>>2]>>>24-o%4*8&255));return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new p.init(r,e)}},h=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(l.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return l.parse(unescape(encodeURIComponent(t)))}},f=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new p.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,o=n.words,i=n.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,c=t.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(o,l);r=o.splice(0,u),n.sigBytes-=c}return new p.init(r,c)},clone:function(){var t=a.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0});s.Hasher=f.extend({cfg:a.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,r){return new t.init(r).finalize(e)}},_createHmacHelper:function(t){return function(e,r){return new d.HMAC.init(t,r).finalize(e)}}});var d=i.algo={};return i}(Math)})),Dr=xr((function(t,e){var r;t.exports=(r=Cr,function(t){var e=r,n=e.lib,o=n.WordArray,i=n.Hasher,s=e.algo,a=[],p=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var n=2,o=0;o<64;)e(n)&&(o<8&&(a[o]=r(t.pow(n,.5))),p[o]=r(t.pow(n,1/3)),o++),n++}();var u=[],c=s.SHA256=i.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,n=r[0],o=r[1],i=r[2],s=r[3],a=r[4],c=r[5],l=r[6],h=r[7],f=0;f<64;f++){if(f<16)u[f]=0|t[e+f];else{var d=u[f-15],y=u[f-2];u[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+u[f-7]+((y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10)+u[f-16]}var m=n&o^n&i^o&i,g=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&c^~a&l)+p[f]+u[f];h=l,l=c,c=a,a=s+g|0,s=i,i=o,o=n,n=g+(((n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22))+m)|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+i|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+c|0,r[6]=r[6]+l|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=i._createHelper(c),e.HmacSHA256=i._createHmacHelper(c)}(Math),r.SHA256)})),Ir=xr((function(t,e){var r,n;t.exports=(n=(r=Cr).lib.WordArray,r.enc.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var o=[],i=0;i<r;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<r;a++)o.push(n.charAt(s>>>6*(3-a)&63));var p=n.charAt(64);if(p)for(;o.length%4;)o.push(p);return o.join("")},parse:function(t){var e=t.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i<r.length;i++)o[r.charCodeAt(i)]=i}var s=r.charAt(64);if(s){var a=t.indexOf(s);-1!==a&&(e=a)}return function(t,e,r){for(var o=[],i=0,s=0;s<e;s++)if(s%4){var a=r[t.charCodeAt(s-1)]<<s%4*2,p=r[t.charCodeAt(s)]>>>6-s%4*2;o[i>>>2]|=(a|p)<<24-i%4*8,i++}return n.create(o,i)}(t,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)})),Pr=xr((function(t,e){t.exports=Cr.enc.Hex})),Rr=xr((function(t,e){(function(){var e;function r(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):this.fromString(t,null==e&&"string"!=typeof t?256:e))}function n(){return new r(null)}var o="undefined"!=typeof navigator;o&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(t,e,r,n,o,i){for(var s=32767&e,a=e>>15;--i>=0;){var p=32767&this[t],u=this[t++]>>15,c=a*p+u*s;o=((p=s*p+((32767&c)<<15)+r[n]+(1073741823&o))>>>30)+(c>>>15)+a*u+(o>>>30),r[n++]=1073741823&p}return o},e=30):o&&"Netscape"!=navigator.appName?(r.prototype.am=function(t,e,r,n,o,i){for(;--i>=0;){var s=e*this[t++]+r[n]+o;o=Math.floor(s/67108864),r[n++]=67108863&s}return o},e=26):(r.prototype.am=function(t,e,r,n,o,i){for(var s=16383&e,a=e>>14;--i>=0;){var p=16383&this[t],u=this[t++]>>14,c=a*p+u*s;o=((p=s*p+((16383&c)<<14)+r[n]+o)>>28)+(c>>14)+a*u,r[n++]=268435455&p}return o},e=28),r.prototype.DB=e,r.prototype.DM=(1<<e)-1,r.prototype.DV=1<<e,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-e,r.prototype.F2=2*e-52;var i,s,a=new Array;for(i="0".charCodeAt(0),s=0;s<=9;++s)a[i++]=s;for(i="a".charCodeAt(0),s=10;s<36;++s)a[i++]=s;for(i="A".charCodeAt(0),s=10;s<36;++s)a[i++]=s;function p(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function u(t,e){var r=a[t.charCodeAt(e)];return null==r?-1:r}function c(t){var e=n();return e.fromInt(t),e}function l(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function h(t){this.m=t}function f(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function d(t,e){return t&e}function y(t,e){return t|e}function m(t,e){return t^e}function g(t,e){return t&~e}function v(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function b(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function _(t){return t}function T(t){this.r2=n(),this.q3=n(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}h.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},h.prototype.revert=function(t){return t},h.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},h.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},h.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},f.prototype.convert=function(t){var e=n();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e},f.prototype.revert=function(t){var e=n();return t.copyTo(e),this.reduce(e),e},f.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var r=32767&t[e],n=r*this.mpl+((r*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},f.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},f.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var o=t.length,i=!1,s=0;--o>=0;){var a=8==n?255&t[o]:u(t,o);a<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var r=t;r<this.t;++r)e[r-t]=this[r];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){var r,n=t%this.DB,o=this.DB-n,i=(1<<o)-1,s=Math.floor(t/this.DB),a=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)e[r+s+1]=this[r]>>o|a,a=(this[r]&i)<<n;for(r=s-1;r>=0;--r)e[r]=0;e[s]=a,e.t=this.t+s+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,o=this.DB-n,i=(1<<n)-1;e[0]=this[r]>>n;for(var s=r+1;s<this.t;++s)e[s-r-1]|=(this[s]&i)<<o,e[s-r]=this[s]>>n;n>0&&(e[this.t-r-1]|=(this.s&i)<<o),e.t=this.t-r,e.clamp()}},r.prototype.subTo=function(t,e){for(var r=0,n=0,o=Math.min(t.t,this.t);r<o;)n+=this[r]-t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n-=t[r],e[r++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[r++]=this.DV+n:n>0&&(e[r++]=n),e.t=r,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),o=t.abs(),i=n.t;for(e.t=i+o.t;--i>=0;)e[i]=0;for(i=0;i<o.t;++i)e[i+n.t]=n.am(0,o[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),r=t.t=2*e.t;--r>=0;)t[r]=0;for(r=0;r<e.t-1;++r){var n=e.am(r,e[r],t,2*r,0,1);(t[r+e.t]+=e.am(r+1,2*e[r],t,2*r+1,n,e.t-r-1))>=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,o){var i=t.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return null!=e&&e.fromInt(0),void(null!=o&&this.copyTo(o));null==o&&(o=n());var a=n(),p=this.s,u=t.s,c=this.DB-l(i[i.t-1]);c>0?(i.lShiftTo(c,a),s.lShiftTo(c,o)):(i.copyTo(a),s.copyTo(o));var h=a.t,f=a[h-1];if(0!=f){var d=f*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),y=this.FV/d,m=(1<<this.F1)/d,g=1<<this.F2,v=o.t,b=v-h,w=null==e?n():e;for(a.dlShiftTo(b,w),o.compareTo(w)>=0&&(o[o.t++]=1,o.subTo(w,o)),r.ONE.dlShiftTo(h,w),w.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--b>=0;){var _=o[--v]==f?this.DM:Math.floor(o[v]*y+(o[v-1]+g)*m);if((o[v]+=a.am(0,_,o,b,0,h))<_)for(a.dlShiftTo(b,w),o.subTo(w,o);o[v]<--_;)o.subTo(w,o)}null!=e&&(o.drShiftTo(h,e),p!=u&&r.ZERO.subTo(e,e)),o.t=h,o.clamp(),c>0&&o.rShiftTo(c,o),p<0&&r.ZERO.subTo(o,o)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var o=n(),i=n(),s=e.convert(this),a=l(t)-1;for(s.copyTo(o);--a>=0;)if(e.sqrTo(o,i),(t&1<<a)>0)e.mulTo(i,s,o);else{var p=o;o=i,i=p}return e.revert(o)},r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<<e)-1,o=!1,i="",s=this.t,a=this.DB-s*this.DB%e;if(s-- >0)for(a<this.DB&&(r=this[s]>>a)>0&&(o=!0,i=p(r));s>=0;)a<e?(r=(this[s]&(1<<a)-1)<<e-a,r|=this[--s]>>(a+=this.DB-e)):(r=this[s]>>(a-=e)&n,a<=0&&(a+=this.DB,--s)),r>0&&(o=!0),o&&(i+=p(r));return o?i:"0"},r.prototype.negate=function(){var t=n();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+l(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=n();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new h(e):new f(e),this.exp(t,r)},r.ZERO=c(0),r.ONE=c(1),w.prototype.convert=_,w.prototype.revert=_,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=n();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var O,S,k,A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],x=(1<<26)/A[A.length-1];function j(){var t;t=(new Date).getTime(),S[k++]^=255&t,S[k++]^=t>>8&255,S[k++]^=t>>16&255,S[k++]^=t>>24&255,k>=q&&(k-=q)}if(r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),o=c(r),i=n(),s=n(),a="";for(this.divRemTo(o,i,s);i.signum()>0;)a=(r+s.intValue()).toString(t).substr(1)+a,i.divRemTo(o,i,s);return s.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),o=Math.pow(e,n),i=!1,s=0,a=0,p=0;p<t.length;++p){var c=u(t,p);c<0?"-"==t.charAt(p)&&0==this.signum()&&(i=!0):(a=e*a+c,++s>=n&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var o=new Array,i=7&t;o.length=1+(t>>3),e.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},r.prototype.bitwiseTo=function(t,e,r){var n,o,i=Math.min(t.t,this.t);for(n=0;n<i;++n)r[n]=e(this[n],t[n]);if(t.t<this.t){for(o=t.s&this.DM,n=i;n<this.t;++n)r[n]=e(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=i;n<t.t;++n)r[n]=e(o,t[n]);r.t=t.t}r.s=e(this.s,t.s),r.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var r=0,n=0,o=Math.min(t.t,this.t);r<o;)n+=this[r]+t[r],e[r++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;r<this.t;)n+=this[r],e[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<t.t;)n+=t[r],e[r++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[r++]=n:n<-1&&(e[r++]=this.DV+n),e.t=r,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,r){var n,o=Math.min(this.t+t.t,e);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,t[o],r,o,0,this.t);for(n=Math.min(t.t,e);o<n;++o)this.am(0,t[o],r,o,0,e-o);r.clamp()},r.prototype.multiplyUpperTo=function(t,e,r){--e;var n=r.t=this.t+t.t-e;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)r[this.t+n-e]=this.am(e-n,t[n],r,0,0,this.t+n-e);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this[n])%t;return r},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),o=e.getLowestSetBit();if(o<=0)return!1;var i=e.shiftRight(o);(t=t+1>>1)>A.length&&(t=A.length);for(var s=n(),a=0;a<t;++a){s.fromInt(A[Math.floor(Math.random()*A.length)]);var p=s.modPow(i,this);if(0!=p.compareTo(r.ONE)&&0!=p.compareTo(e)){for(var u=1;u++<o&&0!=p.compareTo(e);)if(0==(p=p.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=p.compareTo(e))return!1}}return!0},r.prototype.clone=function(){var t=n();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,o=0;if(t-- >0)for(n<this.DB&&(r=this[t]>>n)!=(this.s&this.DM)>>n&&(e[o++]=r|this.s<<this.DB-n);t>=0;)n<8?(r=(this[t]&(1<<n)-1)<<8-n,r|=this[--t]>>(n+=this.DB-8)):(r=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(e[o++]=r);return e},r.prototype.equals=function(t){return 0==this.compareTo(t)},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=n();return this.bitwiseTo(t,d,e),e},r.prototype.or=function(t){var e=n();return this.bitwiseTo(t,y,e),e},r.prototype.xor=function(t){var e=n();return this.bitwiseTo(t,m,e),e},r.prototype.andNot=function(t){var e=n();return this.bitwiseTo(t,g,e),e},r.prototype.not=function(){for(var t=n(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=n();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=n();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+v(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,r=0;r<this.t;++r)t+=b(this[r]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},r.prototype.setBit=function(t){return this.changeBit(t,y)},r.prototype.clearBit=function(t){return this.changeBit(t,g)},r.prototype.flipBit=function(t){return this.changeBit(t,m)},r.prototype.add=function(t){var e=n();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=n();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=n();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=n();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=n();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=n(),r=n();return this.divRemTo(t,e,r),new Array(e,r)},r.prototype.modPow=function(t,e){var r,o,i=t.bitLength(),s=c(1);if(i<=0)return s;r=i<18?1:i<48?3:i<144?4:i<768?5:6,o=i<8?new h(e):e.isEven()?new T(e):new f(e);var a=new Array,p=3,u=r-1,d=(1<<r)-1;if(a[1]=o.convert(this),r>1){var y=n();for(o.sqrTo(a[1],y);p<=d;)a[p]=n(),o.mulTo(y,a[p-2],a[p]),p+=2}var m,g,v=t.t-1,b=!0,w=n();for(i=l(t[v])-1;v>=0;){for(i>=u?m=t[v]>>i-u&d:(m=(t[v]&(1<<i+1)-1)<<u-i,v>0&&(m|=t[v-1]>>this.DB+i-u)),p=r;0==(1&m);)m>>=1,--p;if((i-=p)<0&&(i+=this.DB,--v),b)a[m].copyTo(s),b=!1;else{for(;p>1;)o.sqrTo(s,w),o.sqrTo(w,s),p-=2;p>0?o.sqrTo(s,w):(g=s,s=w,w=g),o.mulTo(w,a[m],s)}for(;v>=0&&0==(t[v]&1<<i);)o.sqrTo(s,w),g=s,s=w,w=g,--i<0&&(i=this.DB-1,--v)}return o.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return r.ZERO;for(var n=t.clone(),o=this.clone(),i=c(1),s=c(0),a=c(0),p=c(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;o.isEven();)o.rShiftTo(1,o),e?(a.isEven()&&p.isEven()||(a.addTo(this,a),p.subTo(t,p)),a.rShiftTo(1,a)):p.isEven()||p.subTo(t,p),p.rShiftTo(1,p);n.compareTo(o)>=0?(n.subTo(o,n),e&&i.subTo(a,i),s.subTo(p,s)):(o.subTo(n,o),e&&a.subTo(i,a),p.subTo(s,p))}return 0!=o.compareTo(r.ONE)?r.ZERO:p.compareTo(t)>=0?p.subtract(t):p.signum()<0?(p.addTo(t,p),p.signum()<0?p.add(t):p):p},r.prototype.pow=function(t){return this.exp(t,new w)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var o=e.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return e;for(o<i&&(i=o),i>0&&(e.rShiftTo(i,e),r.rShiftTo(i,r));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},r.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=A[A.length-1]){for(e=0;e<A.length;++e)if(r[0]==A[e])return!0;return!1}if(r.isEven())return!1;for(e=1;e<A.length;){for(var n=A[e],o=e+1;o<A.length&&n<x;)n*=A[o++];for(n=r.modInt(n);e<o;)if(n%A[e++]==0)return!1}return r.millerRabin(t)},r.prototype.square=function(){var t=n();return this.squareTo(t),t},r.prototype.Barrett=T,null==S){var E;if(S=new Array,k=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var C=new Uint8Array(32);for(window.crypto.getRandomValues(C),E=0;E<32;++E)S[k++]=C[E]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var D=window.crypto.random(32);for(E=0;E<D.length;++E)S[k++]=255&D.charCodeAt(E)}for(;k<q;)E=Math.floor(65536*Math.random()),S[k++]=E>>>8,S[k++]=255&E;k=0,j()}function I(){if(null==O){for(j(),(O=new R).init(S),k=0;k<S.length;++k)S[k]=0;k=0}return O.next()}function P(){}function R(){this.i=0,this.j=0,this.S=new Array}P.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=I()},R.prototype.init=function(t){var e,r,n;for(e=0;e<256;++e)this.S[e]=e;for(r=0,e=0;e<256;++e)n=this.S[e],this.S[e]=this.S[r=r+this.S[e]+t[e%t.length]&255],this.S[r]=n;this.i=0,this.j=0},R.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var q=256;t.exports={default:r,BigInteger:r,SecureRandom:P}}).call(Ar)})),qr={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},Ur={sha256:Dr};function Mr(t,e){if(this.n=null,this.e=0,!(null!=t&&null!=e&&t.length>0&&e.length>0))throw new Error("Invalid key data");this.n=new Rr.BigInteger(t,16),this.e=parseInt(e,16)}Mr.prototype.verify=function(t,e){e=e.replace(/[^0-9a-f]|[\s\n]]/gi,"");var r=new Rr.BigInteger(e,16);if(r.bitLength()>this.n.bitLength())throw new Error("Signature does not match with the key modulus.");var n=function(t){for(var e in qr){var r=qr[e],n=r.length;if(t.substring(0,n)===r)return{alg:e,hash:t.substring(n)}}return[]}(r.modPowInt(this.e,this.n).toString(16).replace(/^1f+00/,""));if(0===n.length)return!1;if(!Ur.hasOwnProperty(n.alg))throw new Error("Hashing algorithm is not supported.");var o=Ur[n.alg](t).toString();return n.hash===o};for(var Lr=[],Nr=[],Br="undefined"!=typeof Uint8Array?Uint8Array:Array,Hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fr=0,Wr=Hr.length;Fr<Wr;++Fr)Lr[Fr]=Hr[Fr],Nr[Hr.charCodeAt(Fr)]=Fr;Nr["-".charCodeAt(0)]=62,Nr["_".charCodeAt(0)]=63;var zr=function(t){var e,r,n=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),o=n[0],i=n[1],s=new Br(function(t,e,r){return 3*(e+r)/4-r}(0,o,i)),a=0,p=i>0?o-4:o;for(r=0;r<p;r+=4)e=Nr[t.charCodeAt(r)]<<18|Nr[t.charCodeAt(r+1)]<<12|Nr[t.charCodeAt(r+2)]<<6|Nr[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===i&&(e=Nr[t.charCodeAt(r)]<<2|Nr[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===i&&(e=Nr[t.charCodeAt(r)]<<10|Nr[t.charCodeAt(r+1)]<<4|Nr[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s};function Vr(t){var e=t.length%4;return 0===e?t:t+new Array(4-e+1).join("=")}function $r(t){return t=Vr(t).replace(/\-/g,"+").replace(/_/g,"/"),decodeURIComponent(function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}(zr(t)).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))}function Jr(t){return function(t){for(var e="",r=0;r<t.length;r++){var n=t[r].toString(16);e+=2===n.length?n:"0"+n}return e}(zr(Vr(t)))}var Gr=xr((function(t){var e,r;e=Ar,r=function(){function t(t){var e=[];if(0===t.length)return"";if("string"!=typeof t[0])throw new TypeError("Url must be a string. Received "+t[0]);if(t[0].match(/^[^/:]+:\/*$/)&&t.length>1){var r=t.shift();t[0]=r+t[0]}t[0]=t[0].match(/^file:\/\/\//)?t[0].replace(/^([^/:]+):\/*/,"$1:///"):t[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<t.length;n++){var o=t[n];if("string"!=typeof o)throw new TypeError("Url must be a string. Received "+o);""!==o&&(n>0&&(o=o.replace(/^[\/]+/,"")),o=o.replace(/[\/]+$/,n<t.length-1?"":"/"),e.push(o))}var i=e.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}return function(){return t("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},t.exports?t.exports=r():e.urljoin=r()}));function Xr(t,e){return e=e||{},new Promise((function(r,n){var o=new XMLHttpRequest,i=[],s=[],a={},p=function(){return{ok:2==(o.status/100|0),statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:p,headers:{keys:function(){return i},entries:function(){return s},get:function(t){return a[t.toLowerCase()]},has:function(t){return t.toLowerCase()in a}}}};for(var u in o.open(e.method||"get",t,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){i.push(e=e.toLowerCase()),s.push([e,r]),a[e]=a[e]?a[e]+","+r:r})),r(p())},o.onerror=n,o.withCredentials="include"==e.credentials,e.headers)o.setRequestHeader(u,e.headers[u]);o.send(e.body||null)}))}function Qr(t){if(t.ok)return t.json();var e=new Error(t.statusText);return e.response=t,Promise.reject(e)}function Zr(t){this.name="ConfigurationError",this.message=t||""}function Kr(t){this.name="TokenValidationError",this.message=t||""}Zr.prototype=Error.prototype,Kr.prototype=Error.prototype;var Yr=function(){function t(){}var e=t.prototype;return e.get=function(){return null},e.has=function(){return null},e.set=function(){return null},t}();jr.polyfill();var tn=function(t){return"number"==typeof t},en=function(){return new Date};function rn(t){var e=t||{};if(this.jwksCache=e.jwksCache||new Yr,this.expectedAlg=e.expectedAlg||"RS256",this.issuer=e.issuer,this.audience=e.audience,this.leeway=0===e.leeway?0:e.leeway||60,this.jwksURI=e.jwksURI,this.maxAge=e.maxAge,this.__clock="function"==typeof e.__clock?e.__clock:en,this.leeway<0||this.leeway>300)throw new Zr("The leeway should be positive and lower than five minutes.");if("RS256"!==this.expectedAlg)throw new Zr('Signature algorithm of "'+this.expectedAlg+'" is not supported. Expected the ID token to be signed with "RS256".')}function nn(t,e){this.plugins=e;for(var r=0;r<this.plugins.length;r++){if(this.plugins[r].version!==$e.raw){var n="";throw this.plugins[r].constructor&&this.plugins[r].constructor.name&&(n=this.plugins[r].constructor.name),new Error("Plugin "+n+" version ("+this.plugins[r].version+") is not compatible with the SDK version ("+$e.raw+")")}this.plugins[r].setWebAuth(t)}}rn.prototype.verify=function(t,e,r){if(!r&&e&&"function"==typeof e&&(r=e,e=void 0),!t)return r(new Kr("ID token is required but missing"),null);var n=this.decode(t);if(n instanceof Error)return r(new Kr("ID token could not be decoded"),null);var o=n.encoded.header+"."+n.encoded.payload,i=Jr(n.encoded.signature),s=n.header.alg,a=n.header.kid,p=n.payload.aud,u=n.payload.sub,c=n.payload.iss,l=n.payload.exp,h=n.payload.nbf,f=n.payload.iat,d=n.payload.azp,y=n.payload.auth_time,m=n.payload.nonce,g=this.__clock(),v=this;if(v.expectedAlg!==s)return r(new Kr('Signature algorithm of "'+s+'" is not supported. Expected the ID token to be signed with "RS256".'),null);this.getRsaVerifier(c,a,(function(t,s){if(t)return r(t,null);if(!s.verify(o,i))return r(new Kr("Invalid ID token signature."),null);if(!c||"string"!=typeof c)return r(new Kr("Issuer (iss) claim must be a string present in the ID token"),null);if(v.issuer!==c)return r(new Kr('Issuer (iss) claim mismatch in the ID token, expected "'+v.issuer+'", found "'+c+'"'),null);if(!u||"string"!=typeof u)return r(new Kr("Subject (sub) claim must be a string present in the ID token"),null);if(!p||"string"!=typeof p&&!Array.isArray(p))return r(new Kr("Audience (aud) claim must be a string or array of strings present in the ID token"),null);if(Array.isArray(p)&&!p.includes(v.audience))return r(new Kr('Audience (aud) claim mismatch in the ID token; expected "'+v.audience+'" but was not one of "'+p.join(", ")+'"'),null);if("string"==typeof p&&v.audience!==p)return r(new Kr('Audience (aud) claim mismatch in the ID token; expected "'+v.audience+'" but found "'+p+'"'),null);if(e){if(!m||"string"!=typeof m)return r(new Kr("Nonce (nonce) claim must be a string present in the ID token"),null);if(m!==e)return r(new Kr('Nonce (nonce) claim value mismatch in the ID token; expected "'+e+'", found "'+m+'"'),null)}if(Array.isArray(p)&&p.length>1){if(!d||"string"!=typeof d)return r(new Kr("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values"),null);if(d!==v.audience)return r(new Kr('Authorized Party (azp) claim mismatch in the ID token; expected "'+v.audience+'", found "'+d+'"'),null)}if(!l||!tn(l))return r(new Kr("Expiration Time (exp) claim must be a number present in the ID token"),null);if(!f||!tn(f))return r(new Kr("Issued At (iat) claim must be a number present in the ID token"),null);var a=l+v.leeway,b=new Date(0);if(b.setUTCSeconds(a),g>b)return r(new Kr('Expiration Time (exp) claim error in the ID token; current time "'+g+'" is after expiration time "'+b+'"'),null);if(h&&tn(h)){var w=h-v.leeway,_=new Date(0);if(_.setUTCSeconds(w),g<_)return r(new Kr('Not Before Time (nbf) claim error in the ID token; current time "'+g+'" is before the not before time "'+_+'"'),null)}if(v.maxAge){if(!y||!tn(y))return r(new Kr("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified"),null);var T=y+v.maxAge+v.leeway,O=new Date(0);if(O.setUTCSeconds(T),g>O)return r(new Kr('Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time "'+g+'" is after last auth time at "'+O+'"'),null)}return r(null,n.payload)}))},rn.prototype.getRsaVerifier=function(t,e,r){var n=this,o=t+e;Promise.resolve(this.jwksCache.has(o)).then((function(r){return r?n.jwksCache.get(o):(i={jwksURI:n.jwksURI,iss:t,kid:e},("undefined"==typeof fetch?Xr:fetch)(i.jwksURI||Gr(i.iss,".well-known","jwks.json")).then(Qr).then((function(t){var e,r,n,o=null;for(e=0;e<t.keys.length&&null===o;e++)(r=t.keys[e]).kid===i.kid&&(o=r);if(!o)throw new Error('Could not find a public key for Key ID (kid) "'+i.kid+'"');return{modulus:Jr((n=o).n),exp:Jr(n.e)}})).catch((function(t){throw t})));var i})).then((function(t){if(!t||!t.modulus||!t.exp)throw new Error("Empty keyInfo in response");return Promise.resolve(n.jwksCache.set(o,t)).then((function(){r&&r(null,new Mr(t.modulus,t.exp))}))})).catch((function(t){r&&r(t)}))},rn.prototype.decode=function(t){var e,r,n=t.split(".");if(3!==n.length)return new Kr("Cannot decode a malformed JWT");try{e=JSON.parse($r(n[0])),r=JSON.parse($r(n[1]))}catch(t){return new Kr("Token header or payload is not valid JSON")}return{header:e,payload:r,encoded:{header:n[0],payload:n[1],signature:n[2]}}},rn.prototype.validateAccessToken=function(t,e,r,n){if(this.expectedAlg!==e)return n(new Kr('Signature algorithm of "'+e+'" is not supported. Expected "'+this.expectedAlg+'"'));var o,i=Dr(t),s=Pr.stringify(i),a=s.substring(0,s.length/2),p=Pr.parse(a),u=Ir.stringify(p);return n((o={"+":"-","/":"_","=":""},u.replace(/[+/=]/g,(function(t){return o[t]}))!==r?new Kr("Invalid access_token"):null))},nn.prototype.get=function(t){for(var e=0;e<this.plugins.length;e++)if(this.plugins[e].supports(t))return this.plugins[e].init();return null};var on=function(t){var e=new Uint8Array(t),r=[],n="0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~",o=cr.getWindow().crypto||cr.getWindow().msCrypto;if(!o)return null;for(var i=o.getRandomValues(e),s=0;s<i.length;s++)r.push(n[i[s]%n.length]);return r.join("")};function sn(t){var e=t.transaction||{};this.namespace=e.namespace||"com.auth0.auth.",this.keyLength=e.keyLength||32,this.stateExpiration=t.stateExpiration?t.stateExpiration/60/24:1/48,this.storage=new gr(t),this.options=t}function an(t){if(this.url=t.url,this.callback=t.callback,this.timeout=t.timeout||6e4,this.timeoutCallback=t.timeoutCallback||null,this.eventListenerType=t.eventListenerType||"message",this.iframe=null,this.timeoutHandle=null,this._destroyTimeout=null,this.transientMessageEventListener=null,this.proxyEventListener=null,this.eventValidator=t.eventValidator||{isValid:function(){return!0}},"function"!=typeof this.callback)throw new Error("options.callback must be a function")}function pn(t){this.webAuth=t,this.warn=new yr(t.baseOptions)}function un(t,e){this.webAuth=t,this.baseOptions=e,this.request=new pr(e),this.webMessageHandler=new pn(t),this.storage=new gr(e)}function cn(t,e){return["co/verifier",encodeURIComponent(t),encodeURIComponent(e)].join("/")}function ln(t,e){this.webAuth=t,this.baseOptions=e,this.crossOriginAuthentication=new un(t,this.baseOptions),this.warn=new yr({disableWarnings:!!e._disableDeprecationWarnings})}sn.prototype.process=function(t){if(!t.responseType)throw new Error("responseType is required");var e=t.realm||t.connection,r=-1!==t.responseType.indexOf("id_token"),n=this.generateTransaction(t.appState,t.state,t.nonce,e,r,t.organization);return t.state||(t.state=n.state),r&&!t.nonce&&(t.nonce=n.nonce),t},sn.prototype.generateTransaction=function(t,e,r,n,o,i){if(e=e||on(this.keyLength),r=r||(o?on(this.keyLength):null),cr.getWindow().location.host!==this.options.domain){var s={nonce:r,appState:t,state:e,lastUsedConnection:n};i&&(s.organization=i),this.storage.setItem(this.namespace+e,s,{expires:this.stateExpiration})}return{state:e,nonce:r}},sn.prototype.getStoredTransaction=function(t){var e;return e=this.storage.getItem(this.namespace+t),this.clearTransaction(t),e},sn.prototype.clearTransaction=function(t){this.storage.removeItem(this.namespace+t)},an.prototype.init=function(){var t=this,e=cr.getWindow();switch(this.iframe=e.document.createElement("iframe"),this.iframe.style.display="none",this.proxyEventListener=function(e){t.eventListener(e)},this.eventListenerType){case"message":this.eventSourceObject=e;break;case"load":this.eventSourceObject=this.iframe;break;default:throw new Error("Unsupported event listener type: "+this.eventListenerType)}this.eventSourceObject.addEventListener(this.eventListenerType,this.proxyEventListener,!1),e.document.body.appendChild(this.iframe),this.iframe.src=this.url,this.timeoutHandle=setTimeout((function(){t.timeoutHandler()}),this.timeout)},an.prototype.eventListener=function(t){var e={event:t,sourceObject:this.eventSourceObject};this.eventValidator.isValid(e)&&(this.destroy(),this.callback(e))},an.prototype.timeoutHandler=function(){this.destroy(),this.timeoutCallback&&this.timeoutCallback()},an.prototype.destroy=function(){var t=this;clearTimeout(this.timeoutHandle),this._destroyTimeout=setTimeout((function(){t.eventSourceObject.removeEventListener(t.eventListenerType,t.proxyEventListener,!1),t.iframe.parentNode&&t.iframe.parentNode.removeChild(t.iframe)}),0)},pn.prototype.run=function(t,e){var r=this;t.responseMode="web_message",t.prompt="none";var n=cr.getOrigin(),o=ir.getOriginFromUrl(t.redirectUri);if(o&&n!==o)return e({error:"origin_mismatch",error_description:"The redirectUri's origin ("+o+") should match the window's origin ("+n+")."});!function(t,e,r){new an({url:t,eventListenerType:"message",callback:function(t){r(null,t)},timeout:e.timeout,eventValidator:{isValid:function(t){return!(!t.event.data||"authorization_response"!==t.event.data.type||e.state!==t.event.data.response.state)}},timeoutCallback:function(){r({error:"timeout",error_description:"Timeout during executing web_message communication",state:e.state})}}).init()}(this.webAuth.client.buildAuthorizeUrl(t),t,(function(n,o){var i=n;if(!n&&o.event.data.response.error&&(i=o.event.data.response),!i){var s=o.event.data.response;return r.webAuth.validateAuthenticationResponse(t,s,e)}return"consent_required"===i.error&&"localhost"===cr.getWindow().location.hostname&&r.warn.warning("Consent Required. Consent can't be skipped on localhost. Read more here: https://auth0.com/docs/api-auth/user-consent#skipping-consent-for-first-party-clients"),r.webAuth.transactionManager.clearTransaction(i.state),e(ir.pick(i,["error","error_description"]))}))},un.prototype.login=function(t,e){var n=this,o=r(this.baseOptions.rootUrl,"/co/authenticate");t.username=t.username||t.email,delete t.email;var i={client_id:t.clientID||this.baseOptions.clientID,username:t.username};t.password&&(i.password=t.password),t.otp&&(i.otp=t.otp);var s=t.realm||this.baseOptions.realm;if(s){var a=t.credentialType||this.baseOptions.credentialType||"http://auth0.com/oauth/grant-type/password-realm";i.realm=s,i.credential_type=a}else i.credential_type="password";this.request.post(o).withCredentials().send(i).end((function(r,o){if(r){var i=r.response&&r.response.body||{error:"request_error",error_description:JSON.stringify(r)};return _r(e,{forceLegacyError:!0})(i)}function s(){var r=!0===t.popup;t=ir.blacklist(t,["password","credentialType","otp","popup","onRedirecting"]);var i=ir.merge(t).with({loginTicket:o.body.login_ticket}),s=cn(n.baseOptions.rootUrl,o.body.co_id);n.storage.setItem(s,o.body.co_verifier,{expires:1/96}),r?n.webMessageHandler.run(i,_r(e,{forceLegacyError:!0})):n.webAuth.authorize(i)}"function"==typeof t.onRedirecting?t.onRedirecting(s):s()}))},un.prototype.callback=function(){var t=decodeURIComponent(function(t){var e=("&"+cr.getWindow().location.hash.substring(1)).split("&origin=");if(2===e.length)return e.pop().split("&").shift()}()),e=cr.getWindow(),r=this;e.addEventListener("message",(function(t){if("co_verifier_request"===t.data.type){var e=cn(t.origin,t.data.request.id),n=function(t,e){try{var r=t.getItem(e);return t.removeItem(e),r||""}catch(t){return""}}(r.storage,e);t.source.postMessage({type:"co_verifier_response",response:{verifier:n}},t.origin)}})),e.parent.postMessage({type:"ready"},t)},ln.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,delete t.connection,this.crossOriginAuthentication.login(t,e)},ln.prototype.signupAndLogin=function(t,e){var r=this;return this.webAuth.client.dbConnection.signup(t,(function(n){return n?e(n):(t.realm=t.realm||t.connection,delete t.connection,r.webAuth.login(t,e))}))};var hn=e((function(t){var e=function(){function t(t,e,r){t.attachEvent?t.attachEvent("on"+e,r):t.addEventListener&&t.addEventListener(e,r,!1)}function e(t,e,r){t.detachEvent?t.detachEvent("on"+e,r):t.removeEventListener&&t.removeEventListener(e,r,!1)}function r(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}var n=function(){if("undefined"==typeof navigator)return!1;var t=-1,e=navigator.userAgent;return"Microsoft Internet Explorer"===navigator.appName?null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)):e.indexOf("Trident")>-1&&null!==new RegExp("rv:([0-9]{2,2}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1)),t>=8}();return"undefined"!=typeof window&&window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(o,i){if(!i)throw"missing required callback argument";var s,a;o.url||(s="missing required 'url' parameter"),o.relay_url||(s="missing required 'relay_url' parameter"),s&&setTimeout((function(){i(s)}),0),o.window_name||(o.window_name=null),o.window_features&&!function(){try{var t=navigator.userAgent;return-1!=t.indexOf("Fennec/")||-1!=t.indexOf("Firefox/")&&-1!=t.indexOf("Android")}catch(t){}return!1}()||(o.window_features=void 0);var p,u=o.origin||r(o.url);if(u!==r(o.relay_url))return setTimeout((function(){i("invalid arguments: origin of url and relay_url must match")}),0);n&&((a=document.createElement("iframe")).setAttribute("src",o.relay_url),a.style.display="none",a.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(a),p=a.contentWindow);var c=o.popup||window.open(o.url,o.window_name,o.window_features);o.popup&&(c.location.href=o.url),p||(p=c);var l=setInterval((function(){c&&c.closed&&(f(),i&&(i("User closed the popup window"),i=null))}),500),h=JSON.stringify({a:"request",d:o.params});function f(){if(a&&document.body.removeChild(a),a=void 0,l&&(l=clearInterval(l)),e(window,"message",d),e(window,"unload",f),c)try{c.close()}catch(t){p.postMessage("die",u)}c=p=void 0}function d(t){if(t.origin===u){try{var e=JSON.parse(t.data)}catch(t){if(i)return i(t);throw t}"ready"===e.a?p.postMessage(h,u):"error"===e.a?(f(),i&&(i(e.d),i=null)):"response"===e.a&&(f(),i&&(i(null,e.d),i=null))}}return t(window,"unload",f),t(window,"message",d),{originalPopup:c,close:f,focus:function(){if(c)try{c.focus()}catch(t){}}}},onOpen:function(r){var o="*",i=n?function(){for(var t=window.opener.frames,e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(t){}}():window.opener;if(!i)throw"can't find relay frame";function s(t){t=JSON.stringify(t),n?i.doPost(t,o):i.postMessage(t,o)}function a(t){if("die"===t.data)try{window.close()}catch(t){}}t(n?i:window,"message",(function t(n){var i;try{i=JSON.parse(n.data)}catch(t){}i&&"request"===i.a&&(e(window,"message",t),o=n.origin,r&&setTimeout((function(){r(o,i.d,(function(t){r=void 0,s({a:"response",d:t})}))}),0))})),t(n?i:window,"message",a);try{s({a:"ready"})}catch(e){t(i,"load",(function(t){s({a:"ready"})}))}var p=function(){try{e(n?i:window,"message",a)}catch(t){}r&&s({a:"error",d:"client closed window"}),r=void 0;try{window.close()}catch(t){}};return t(window,"unload",p),{detach:function(){e(window,"unload",p)}}}}:{open:function(t,e,r,n){setTimeout((function(){n("unsupported browser")}),0)},onOpen:function(t){setTimeout((function(){t("unsupported browser")}),0)}}}();t.exports&&(t.exports=e)})),fn=function(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[-_a-zA-Z.0-9:]+)/.exec(t);return e?e[1]:t};function dn(){this._current_popup=null}function yn(t,e){this.baseOptions=e,this.baseOptions.popupOrigin=e.popupOrigin,this.client=t.client,this.webAuth=t,this.transactionManager=new sn(this.baseOptions),this.crossOriginAuthentication=new un(t,this.baseOptions),this.warn=new yr({disableWarnings:!!e._disableDeprecationWarnings})}function mn(t){this.authenticationUrl=t.authenticationUrl,this.timeout=t.timeout||6e4,this.handler=null,this.postMessageDataType=t.postMessageDataType||!1,this.postMessageOrigin=t.postMessageOrigin||cr.getWindow().location.origin||cr.getWindow().location.protocol+"//"+cr.getWindow().location.hostname+(cr.getWindow().location.port?":"+cr.getWindow().location.port:"")}function gn(t){this.baseOptions=t,this.request=new pr(t),this.transactionManager=new sn(this.baseOptions)}function vn(t,e){this.baseOptions=e,this.client=t,this.baseOptions.universalLoginPage=!0,this.request=new pr(this.baseOptions),this.warn=new yr({disableWarnings:!!e._disableDeprecationWarnings})}dn.prototype.calculatePosition=function(t){var e=t.width||500,r=t.height||600,n=cr.getWindow(),o=void 0!==n.screenX?n.screenX:n.screenLeft,i=void 0!==n.screenY?n.screenY:n.screenTop,s=void 0!==n.outerWidth?n.outerWidth:n.document.body.clientWidth,a=void 0!==n.outerHeight?n.outerHeight:n.document.body.clientHeight;return{width:e,height:r,left:t.left||o+(s-e)/2,top:t.top||i+(a-r)/2}},dn.prototype.preload=function(t){var e=this,r=cr.getWindow(),n=this.calculatePosition(t.popupOptions||{}),o=ir.merge(n).with(t.popupOptions),i=t.url||"about:blank",s=de(o,{encode:!1,delimiter:","});return this._current_popup&&!this._current_popup.closed||(this._current_popup=r.open(i,"auth0_signup_popup",s),this._current_popup.kill=function(){this.close(),e._current_popup=null}),this._current_popup},dn.prototype.load=function(t,e,r,n){var o=this,i=this.calculatePosition(r.popupOptions||{}),s=ir.merge(i).with(r.popupOptions),a=ir.merge({url:t,relay_url:e,window_features:de(s,{delimiter:",",encode:!1}),popup:this._current_popup}).with(r),p=hn.open(a,(function(t,e){if(!t||"SyntaxError"!==t.name)return o._current_popup=null,n(t,e)}));return p.focus(),p},yn.prototype.buildPopupHandler=function(){var t=this.baseOptions.plugins.get("popup.getPopupHandler");return t?t.getPopupHandler():new dn},yn.prototype.preload=function(t){t=t||{};var e=this.buildPopupHandler();return e.preload(t),e},yn.prototype.getPopupHandler=function(t,e){return t.popupHandler?t.popupHandler:e?this.preload(t):this.buildPopupHandler()},yn.prototype.callback=function(t){var e=this,r=cr.getWindow(),n=(t=t||{}).popupOrigin||this.baseOptions.popupOrigin||cr.getOrigin();r.opener?hn.onOpen((function(r,o,i){if(r!==n)return i({error:"origin_mismatch",error_description:"The popup's origin ("+r+") should match the `popupOrigin` parameter ("+n+")."});e.webAuth.parseHash(t||{},(function(t,e){return i(t||e)}))})):r.doPost=function(t){r.parent&&r.parent.postMessage(t,n)}},yn.prototype.authorize=function(t,e){var n,o,i={},s=this.baseOptions.plugins.get("popup.authorize"),a=ir.merge(this.baseOptions,["clientID","scope","domain","audience","tenant","responseType","redirectUri","_csrf","state","_intstate","nonce","organization","invitation"]).with(ir.blacklist(t,["popupHandler"]));return Ze.check(a,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),o=r(this.baseOptions.rootUrl,"relay.html"),t.owp?a.owp=!0:(i.origin=fn(a.redirectUri),o=a.redirectUri),t.popupOptions&&(i.popupOptions=ir.pick(t.popupOptions,["width","height","top","left"])),s&&(a=s.processParams(a)),(a=this.transactionManager.process(a)).scope=a.scope||"openid profile email",delete a.domain,n=this.client.buildAuthorizeUrl(a),this.getPopupHandler(t).load(n,o,i,_r(e,{keepOriginalCasing:!0}))},yn.prototype.loginWithCredentials=function(t,e){t.realm=t.realm||t.connection,t.popup=!0,t=ir.merge(this.baseOptions,["redirectUri","responseType","state","nonce","timeout"]).with(ir.blacklist(t,["popupHandler","connection"])),t=this.transactionManager.process(t),this.crossOriginAuthentication.login(t,e)},yn.prototype.passwordlessVerify=function(t,e){var r=this;return this.client.passwordless.verify(ir.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.username=t.phoneNumber||t.email,t.password=t.verificationCode,delete t.email,delete t.phoneNumber,delete t.verificationCode,delete t.type,r.client.loginWithResourceOwner(t,e)}))},yn.prototype.signupAndLogin=function(t,e){var r=this;return this.client.dbConnection.signup(t,(function(n){if(n)return e(n);r.loginWithCredentials(t,e)}))},mn.create=function(t){return new mn(t)},mn.prototype.login=function(t,e){this.handler=new an({auth0:this.auth0,url:this.authenticationUrl,eventListenerType:t?"message":"load",callback:this.getCallbackHandler(e,t),timeout:this.timeout,eventValidator:this.getEventValidator(),timeoutCallback:function(){e(null,"#error=timeout&error_description=Timeout+during+authentication+renew.")},usePostMessage:t||!1}),this.handler.init()},mn.prototype.getEventValidator=function(){var t=this;return{isValid:function(e){switch(e.event.type){case"message":return e.event.origin===t.postMessageOrigin&&e.event.source===t.handler.iframe.contentWindow&&(!1===t.postMessageDataType||e.event.data.type&&e.event.data.type===t.postMessageDataType);case"load":if("about:"===e.sourceObject.contentWindow.location.protocol)return!1;default:return!0}}}},mn.prototype.getCallbackHandler=function(t,e){return function(r){var n;n=e?"object"==typeof r.event.data&&r.event.data.hash?r.event.data.hash:r.event.data:r.sourceObject.contentWindow.location.hash,t(null,n)}},gn.prototype.login=function(t,e){var n,o;return n=r(this.baseOptions.rootUrl,"usernamepassword","login"),t.username=t.username||t.email,t=ir.blacklist(t,["email","onRedirecting"]),o=ir.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience"]).with(t),o=this.transactionManager.process(o),o=ir.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(_r(e))},gn.prototype.callback=function(t){var e,r=cr.getDocument();(e=r.createElement("div")).innerHTML=t,r.body.appendChild(e).children[0].submit()},vn.prototype.login=function(t,e){if(cr.getWindow().location.host!==this.baseOptions.domain)throw new Error("This method is meant to be used only inside the Universal Login Page.");var r,n=ir.merge(this.baseOptions,["clientID","redirectUri","tenant","responseType","responseMode","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return Ze.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(r=new gn(this.baseOptions)).login(n,(function(n,o){if(n)return e(n);function i(){r.callback(o)}if("function"==typeof t.onRedirecting)return t.onRedirecting((function(){i()}));i()}))},vn.prototype.signupAndLogin=function(t,e){var r=this;return r.client.client.dbConnection.signup(t,(function(n){return n?e(n):r.login(t,e)}))},vn.prototype.getSSOData=function(t,e){var n,o="";return"function"==typeof t&&(e=t,t=!1),Ze.check(t,{type:"boolean",message:"withActiveDirectories parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),t&&(o="?"+de({ldaps:1,client_id:this.baseOptions.clientID})),n=r(this.baseOptions.rootUrl,"user","ssodata",o),this.request.get(n,{noHeaders:!0}).withCredentials().end(_r(e))};var bn=function(){},wn={lang:"en",templates:{auth0:function(t){var e="code"===t.type?"Enter the code shown above":"Solve the formula shown above";return'<div class="captcha-challenge">\n <img src="'+t.image+'" />\n <button type="button" class="captcha-reload">↺</button>\n</div>\n<input type="text" name="captcha"\n class="form-control captcha-control"\n placeholder="'+e+'" />'},recaptcha_v2:function(){return'<div class="recaptcha" ></div><input type="hidden" name="captcha" />'},recaptcha_enterprise:function(){return'<div class="recaptcha" ></div><input type="hidden" name="captcha" />'},error:function(){return'<div class="error" style="color: red;">Error getting the bot detection challenge. Please contact the system administrator.</div>'}}};function _n(t,e,r,n){t.innerHTML=e.templates[r.provider](r),t.querySelector(".captcha-reload").addEventListener("click",(function(t){t.preventDefault(),n()}))}function Tn(t){switch(t){case"recaptcha_v2":return window.grecaptcha;case"recaptcha_enterprise":return window.grecaptcha.enterprise;default:throw new Error("Unknown captcha provider")}}function On(t,e,r){var n=t.hasAttribute("data-wid")&&t.getAttribute("data-wid");function o(e){t.querySelector('input[name="captcha"]').value=e||""}if(n)return o(),void Tn(r.provider).reset(n);t.innerHTML=e.templates[r.provider](r);var i=t.querySelector(".recaptcha");!function(t,e,r){var n="recaptchaCallback_"+Math.floor(1000001*Math.random());window[n]=function(){delete window[n],r()};var o=window.document.createElement("script");o.src=function(t,e,r){switch(t){case"recaptcha_v2":return"https://www.recaptcha.net/recaptcha/api.js?hl="+e+"&onload="+r;case"recaptcha_enterprise":return"https://www.recaptcha.net/recaptcha/enterprise.js?render=explicit&hl="+e+"&onload="+r;default:throw new Error("Unknown captcha provider")}}(e.provider,e.lang,n),o.async=!0,window.document.body.appendChild(o)}(0,{lang:e.lang,provider:r.provider},(function(){var e=Tn(r.provider);n=e.render(i,{callback:o,"expired-callback":function(){o()},"error-callback":function(){o()},sitekey:r.siteKey}),t.setAttribute("data-wid",n)}))}var Sn=function(t,e,r,n){function o(n){n=n||bn,t.getChallenge((function(t,i){return t?(e.innerHTML=r.templates.error(t),n(t)):i.required?(e.style.display="","auth0"===i.provider?_n(e,r,i,o):"recaptcha_v2"!==i.provider&&"recaptcha_enterprise"!==i.provider||On(e,r,i),void n()):(e.style.display="none",void(e.innerHTML=""))}))}return r=ir.merge(wn).with(r||{}),o(n),{reload:o,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}},kn=function(t,e,r,n){function o(n){n=n||bn,t.passwordless.getChallenge((function(t,i){return t?(e.innerHTML=r.templates.error(t),n(t)):i.required?(e.style.display="","auth0"===i.provider?_n(e,r,i,o):"recaptcha_v2"!==i.provider&&"recaptcha_enterprise"!==i.provider||On(e,r,i),void n()):(e.style.display="none",void(e.innerHTML=""))}))}return r=ir.merge(wn).with(r||{}),o(n),{reload:o,getValue:function(){var t=e.querySelector('input[name="captcha"]');if(t)return t.value}}};function An(){return new Date}function xn(t){Ze.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},popupOrigin:{optional:!0,type:"string",message:"popupOrigin is not valid"},leeway:{optional:!0,type:"number",message:"leeway is not valid"},plugins:{optional:!0,type:"array",message:"plugins is not valid"},maxAge:{optional:!0,type:"number",message:"maxAge is not valid"},stateExpiration:{optional:!0,type:"number",message:"stateExpiration is not valid"},legacySameSiteCookie:{optional:!0,type:"boolean",message:"legacySameSiteCookie option is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"},_timesToRetryFailedRequests:{optional:!0,type:"number",message:"_timesToRetryFailedRequests option is not valid"}}),t.overrides&&Ze.check(t.overrides,{type:"object",message:"overrides option is not valid"},{__tenant:{optional:!0,type:"string",message:"__tenant option is required"},__token_issuer:{optional:!0,type:"string",message:"__token_issuer option is required"},__jwks_uri:{optional:!0,type:"string",message:"__jwks_uri is required"}}),this.baseOptions=t,this.baseOptions.plugins=new nn(this,this.baseOptions.plugins||[]),this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions._timesToRetryFailedRequests=t._timesToRetryFailedRequests?parseInt(t._timesToRetryFailedRequests):0,this.baseOptions.tenant=this.baseOptions.overrides&&this.baseOptions.overrides.__tenant||this.baseOptions.domain.split(".")[0],this.baseOptions.token_issuer=this.baseOptions.overrides&&this.baseOptions.overrides.__token_issuer||"https://"+this.baseOptions.domain+"/",this.baseOptions.jwksURI=this.baseOptions.overrides&&this.baseOptions.overrides.__jwks_uri,!1!==t.legacySameSiteCookie&&(this.baseOptions.legacySameSiteCookie=!0),this.transactionManager=new sn(this.baseOptions),this.client=new Cn(this.baseOptions),this.redirect=new ln(this,this.baseOptions),this.popup=new yn(this,this.baseOptions),this.crossOriginAuthentication=new un(this,this.baseOptions),this.webMessageHandler=new pn(this),this._universalLogin=new vn(this,this.baseOptions),this.ssodataStorage=new vr(this.baseOptions)}function jn(t,e){this.baseOptions=e,this.request=t}function En(t,e){this.baseOptions=e,this.request=t}function Cn(t,e){2===arguments.length?this.auth0=t:e=t,Ze.check(e,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},clientID:{type:"string",message:"clientID option is required"},responseType:{optional:!0,type:"string",message:"responseType is not valid"},responseMode:{optional:!0,type:"string",message:"responseMode is not valid"},redirectUri:{optional:!0,type:"string",message:"redirectUri is not valid"},scope:{optional:!0,type:"string",message:"scope is not valid"},audience:{optional:!0,type:"string",message:"audience is not valid"},_disableDeprecationWarnings:{optional:!0,type:"boolean",message:"_disableDeprecationWarnings option is not valid"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=e,this.baseOptions._sendTelemetry=!1!==this.baseOptions._sendTelemetry||this.baseOptions._sendTelemetry,this.baseOptions.rootUrl=this.baseOptions.domain&&0===this.baseOptions.domain.toLowerCase().indexOf("http")?this.baseOptions.domain:"https://"+this.baseOptions.domain,this.request=new pr(this.baseOptions),this.passwordless=new jn(this.request,this.baseOptions),this.dbConnection=new En(this.request,this.baseOptions),this.warn=new yr({disableWarnings:!!e._disableDeprecationWarnings}),this.ssodataStorage=new vr(this.baseOptions)}function Dn(t){Ze.check(t,{type:"object",message:"options parameter is not valid"},{domain:{type:"string",message:"domain option is required"},token:{type:"string",message:"token option is required"},_sendTelemetry:{optional:!0,type:"boolean",message:"_sendTelemetry option is not valid"},_telemetryInfo:{optional:!0,type:"object",message:"_telemetryInfo option is not valid"}}),this.baseOptions=t,this.baseOptions.headers={Authorization:"Bearer "+this.baseOptions.token},this.request=new pr(this.baseOptions),this.baseOptions.rootUrl=r("https://"+this.baseOptions.domain,"api","v2")}xn.prototype.parseHash=function(t,e){var r,n;e||"function"!=typeof t?t=t||{}:(e=t,t={});var o=void 0===t.hash?cr.getWindow().location.hash:t.hash;if((r=function(t,e){var r=function(t){if(!t)return ce;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?ce.charset:t.charset;return{allowDots:void 0===t.allowDots?ce.allowDots:!!t.allowDots,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:ce.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:ce.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:ce.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:ce.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:ce.comma,decoder:"function"==typeof t.decoder?t.decoder:ce.decoder,delimiter:"string"==typeof t.delimiter||Qt.isRegExp(t.delimiter)?t.delimiter:ce.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:ce.depth,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:ce.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:ce.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:ce.plainObjects,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:ce.strictNullHandling}}(e);if(""===t||null==t)return r.plainObjects?Object.create(null):{};for(var n="string"==typeof t?function(t,e){var r,n={},o=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,i=e.parameterLimit===1/0?void 0:e.parameterLimit,s=o.split(e.delimiter,i),a=-1,p=e.charset;if(e.charsetSentinel)for(r=0;r<s.length;++r)0===s[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===s[r]?p="utf-8":"utf8=%26%2310003%3B"===s[r]&&(p="iso-8859-1"),a=r,r=s.length);for(r=0;r<s.length;++r)if(r!==a){var u,c,l=s[r],h=l.indexOf("]="),f=-1===h?l.indexOf("="):h+1;-1===f?(u=e.decoder(l,ce.decoder,p,"key"),c=e.strictNullHandling?null:""):(u=e.decoder(l.slice(0,f),ce.decoder,p,"key"),c=Qt.maybeMap(he(l.slice(f+1),e),(function(t){return e.decoder(t,ce.decoder,p,"value")}))),c&&e.interpretNumericEntities&&"iso-8859-1"===p&&(c=le(c)),l.indexOf("[]=")>-1&&(c=ue(c)?[c]:c),pe.call(n,u)?n[u]=Qt.combine(n[u],c):n[u]=c}return n}(t,r):t,o=r.plainObjects?Object.create(null):{},i=Object.keys(n),s=0;s<i.length;++s){var a=i[s],p=fe(a,n[a],r,"string"==typeof t);o=Qt.merge(o,p,r)}return!0===r.allowSparse?o:Qt.compact(o)}(o=o.replace(/^#?\/?/,""))).hasOwnProperty("error"))return n=wr.buildResponse(r.error,r.error_description),r.state&&(n.state=r.state),e(n);if(!r.hasOwnProperty("access_token")&&!r.hasOwnProperty("id_token")&&!r.hasOwnProperty("refresh_token"))return e(null,null);var i=(this.baseOptions.responseType||t.responseType||"").split(" ");return i.length>0&&-1!==i.indexOf("token")&&!r.hasOwnProperty("access_token")?e(wr.buildResponse("invalid_hash","response_type contains `token`, but the parsed hash does not contain an `access_token` property")):i.length>0&&-1!==i.indexOf("id_token")&&!r.hasOwnProperty("id_token")?e(wr.buildResponse("invalid_hash","response_type contains `id_token`, but the parsed hash does not contain an `id_token` property")):this.validateAuthenticationResponse(t,r,e)},xn.prototype.validateAuthenticationResponse=function(t,e,r){var n=this;t.__enableIdPInitiatedLogin=t.__enableIdPInitiatedLogin||t.__enableImpersonation;var o=e.state,i=this.transactionManager.getStoredTransaction(o),s=t.state||i&&i.state||null,a=s===o;if((o||s||!t.__enableIdPInitiatedLogin)&&!a)return r({error:"invalid_token",errorDescription:"`state` does not match."});var p=t.nonce||i&&i.nonce||null,u=i&&i.organization,c=t.state||i&&i.appState||null,l=function(t,o){return t?r(t):(i&&i.lastUsedConnection&&(o&&(s=o.sub),n.ssodataStorage.set(i.lastUsedConnection,s)),r(null,function(t,e,r){return{accessToken:t.access_token||null,idToken:t.id_token||null,idTokenPayload:r||null,appState:e||null,refreshToken:t.refresh_token||null,state:t.state||null,expiresIn:t.expires_in?parseInt(t.expires_in,10):null,tokenType:t.token_type||null,scope:t.scope||null}}(e,c,o)));var s};return e.id_token?this.validateToken(e.id_token,p,(function(t,r){if(!t){if(u){if(!r.org_id)return l(wr.invalidToken("Organization Id (org_id) claim must be a string present in the ID token"));if(r.org_id!==u)return l(wr.invalidToken('Organization Id (org_id) claim value mismatch in the ID token; expected "'+u+'", found "'+r.org_id+'"'))}return e.access_token&&r.at_hash?(new rn).validateAccessToken(e.access_token,"RS256",r.at_hash,(function(t){return t?l(wr.invalidToken(t.message)):l(null,r)})):l(null,r)}if("invalid_token"!==t.error||t.errorDescription&&t.errorDescription.indexOf("Nonce (nonce) claim value mismatch in the ID token")>-1)return l(t);var o=(new rn).decode(e.id_token);return"HS256"!==o.header.alg?l(t):(o.payload.nonce||null)!==p?l({error:"invalid_token",errorDescription:'Nonce (nonce) claim value mismatch in the ID token; expected "'+p+'", found "'+o.payload.nonce+'"'}):e.access_token?n.client.userInfo(e.access_token,(function(t,e){return t?l(t):l(null,e)})):l({error:"invalid_token",description:"The id_token cannot be validated because it was signed with the HS256 algorithm and public clients (like a browser) can’t store secrets. Please read the associated doc for possible ways to fix this. Read more: https://auth0.com/docs/errors/libraries/auth0-js/invalid-token#parsing-an-hs256-signed-id-token-without-an-access-token"})})):l(null,null)},xn.prototype.validateToken=function(t,e,r){new rn({issuer:this.baseOptions.token_issuer,jwksURI:this.baseOptions.jwksURI,audience:this.baseOptions.clientID,leeway:this.baseOptions.leeway||60,maxAge:this.baseOptions.maxAge,__clock:this.baseOptions.__clock||An}).verify(t,e,(function(t,e){if(t)return r(wr.invalidToken(t.message));r(null,e)}))},xn.prototype.renewAuth=function(t,e){var r=!!t.usePostMessage,n=t.postMessageDataType||!1,o=t.postMessageOrigin||cr.getWindow().origin,i=t.timeout,s=this,a=ir.merge(this.baseOptions,["clientID","redirectUri","responseType","scope","audience","_csrf","state","_intstate","nonce"]).with(t);a.responseType=a.responseType||"token",a.responseMode=a.responseMode||"fragment",a=this.transactionManager.process(a),Ze.check(a,{type:"object",message:"options parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),a.prompt="none",a=ir.blacklist(a,["usePostMessage","tenant","postMessageDataType","postMessageOrigin"]),mn.create({authenticationUrl:this.client.buildAuthorizeUrl(a),postMessageDataType:n,postMessageOrigin:o,timeout:i}).login(r,(function(t,r){if("object"==typeof r)return e(t,r);s.parseHash({hash:r},e)}))},xn.prototype.checkSession=function(t,e){var r=ir.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t);return"code"===r.responseType?e({error:"error",error_description:"responseType can't be `code`"}):(t.nonce||(r=this.transactionManager.process(r)),r.redirectUri?(Ze.check(r,{type:"object",message:"options parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),r=ir.blacklist(r,["usePostMessage","tenant","postMessageDataType"]),void this.webMessageHandler.run(r,_r(e,{forceLegacyError:!0,ignoreCasing:!0}))):e({error:"error",error_description:"redirectUri can't be empty"}))},xn.prototype.changePassword=function(t,e){return this.client.dbConnection.changePassword(t,e)},xn.prototype.passwordlessStart=function(t,e){var r=ir.merge(this.baseOptions,["responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce"]).with(t.authParams);return t.authParams=this.transactionManager.process(r),this.client.passwordless.start(t,e)},xn.prototype.signup=function(t,e){return this.client.dbConnection.signup(t,e)},xn.prototype.authorize=function(t){var e=ir.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce","organization","invitation"]).with(t);Ze.check(e,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),(e=this.transactionManager.process(e)).scope=e.scope||"openid profile email",cr.redirect(this.client.buildAuthorizeUrl(e))},xn.prototype.signupAndAuthorize=function(t,e){var r=this;return this.client.dbConnection.signup(ir.blacklist(t,["popupHandler"]),(function(n){if(n)return e(n);t.realm=t.connection,t.username||(t.username=t.email),r.client.login(t,e)}))},xn.prototype.login=function(t,e){var r=ir.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting","organization","invitation"]).with(t);r=this.transactionManager.process(r),cr.getWindow().location.host===this.baseOptions.domain?(r.connection=r.realm,delete r.realm,this._universalLogin.login(r,e)):this.crossOriginAuthentication.login(r,e)},xn.prototype.passwordlessLogin=function(t,e){var r=ir.merge(this.baseOptions,["clientID","responseType","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting"]).with(t);if(r=this.transactionManager.process(r),cr.getWindow().location.host===this.baseOptions.domain)this.passwordlessVerify(r,e);else{var n=ir.extend({credentialType:"http://auth0.com/oauth/grant-type/passwordless/otp",realm:r.connection,username:r.email||r.phoneNumber,otp:r.verificationCode},ir.blacklist(r,["connection","email","phoneNumber","verificationCode"]));this.crossOriginAuthentication.login(n,e)}},xn.prototype.crossOriginAuthenticationCallback=function(){this.crossOriginVerification()},xn.prototype.crossOriginVerification=function(){this.crossOriginAuthentication.callback()},xn.prototype.logout=function(t){cr.redirect(this.client.buildLogoutUrl(t))},xn.prototype.passwordlessVerify=function(t,e){var r=this,n=ir.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","nonce","onRedirecting"]).with(t);return Ze.check(n,{type:"object",message:"options parameter is not valid"},{responseType:{type:"string",message:"responseType option is required"}}),n=this.transactionManager.process(n),this.client.passwordless.verify(n,(function(o){if(o)return e(o);function i(){cr.redirect(r.client.passwordless.buildVerifyUrl(n))}if("function"==typeof t.onRedirecting)return t.onRedirecting((function(){i()}));i()}))},xn.prototype.renderCaptcha=function(t,e,r){return Sn(this.client,t,e,r)},xn.prototype.renderPasswordlessCaptcha=function(t,e,r){return kn(this.client,t,e,r)},jn.prototype.buildVerifyUrl=function(t){var e,n;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),e=ir.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience","_csrf","state","_intstate","protocol","nonce"]).with(t),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=ir.toSnakeCase(e,["auth0Client"]),n=de(e),r(this.baseOptions.rootUrl,"passwordless","verify_redirect","?"+n)},jn.prototype.start=function(t,e){var n,o;Ze.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},send:{type:"string",message:"send option is required",values:["link","code"],value_message:"send is not valid ([link, code])"},phoneNumber:{optional:!0,type:"string",message:"phoneNumber option is required",condition:function(t){return"code"===t.send||!t.email}},email:{optional:!0,type:"string",message:"email option is required",condition:function(t){return"link"===t.send||!t.phoneNumber}},authParams:{optional:!0,type:"object",message:"authParams option is required"}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"passwordless","start");var i=t.xRequestLanguage;delete t.xRequestLanguage,(o=ir.merge(this.baseOptions,["clientID","responseType","redirectUri","scope"]).with(t)).scope&&(o.authParams=o.authParams||{},o.authParams.scope=o.authParams.scope||o.scope),o.redirectUri&&(o.authParams=o.authParams||{},o.authParams.redirect_uri=o.authParams.redirectUri||o.redirectUri),o.responseType&&(o.authParams=o.authParams||{},o.authParams.response_type=o.authParams.responseType||o.responseType),delete o.redirectUri,delete o.responseType,delete o.scope,o=ir.toSnakeCase(o,["auth0Client","authParams"]);var s=i?{xRequestLanguage:i}:void 0;return this.request.post(n,s).send(o).end(_r(e))},jn.prototype.verify=function(t,e){var n,o;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},verificationCode:{type:"string",message:"verificationCode option is required"},phoneNumber:{optional:!1,type:"string",message:"phoneNumber option is required",condition:function(t){return!t.email}},email:{optional:!1,type:"string",message:"email option is required",condition:function(t){return!t.phoneNumber}}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),o=ir.pick(t,["connection","verificationCode","phoneNumber","email","auth0Client","clientID"]),o=ir.toSnakeCase(o,["auth0Client"]),n=r(this.baseOptions.rootUrl,"passwordless","verify"),this.request.post(n).send(o).end(_r(e))},jn.prototype.getChallenge=function(t){if(Ze.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=r(this.baseOptions.rootUrl,"passwordless","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(_r(t,{ignoreCasing:!0}))},En.prototype.signup=function(t,e){var n,o,i;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"},password:{type:"string",message:"password option is required"}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"dbconnections","signup"),i=(o=ir.merge(this.baseOptions,["clientID","state"]).with(t)).user_metadata||o.userMetadata,o=ir.blacklist(o,["scope","userMetadata","user_metadata"]),o=ir.toSnakeCase(o,["auth0Client"]),i&&(o.user_metadata=i),this.request.post(n).send(o).end(_r(e))},En.prototype.changePassword=function(t,e){var n,o;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{connection:{type:"string",message:"connection option is required"},email:{type:"string",message:"email option is required"}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"dbconnections","change_password"),o=ir.merge(this.baseOptions,["clientID"]).with(t,["email","connection"]),o=ir.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(_r(e))},Cn.prototype.buildAuthorizeUrl=function(t){var e,n;return Ze.check(t,{type:"object",message:"options parameter is not valid"}),e=ir.merge(this.baseOptions,["clientID","responseType","responseMode","redirectUri","scope","audience"]).with(t),Ze.check(e,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},redirectUri:{optional:!0,type:"string",message:"redirectUri option is required"},responseType:{type:"string",message:"responseType option is required"},nonce:{type:"string",message:"nonce option is required",condition:function(t){return-1===t.responseType.indexOf("code")&&-1!==t.responseType.indexOf("id_token")}},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e.connection_scope&&Ze.isArray(e.connection_scope)&&(e.connection_scope=e.connection_scope.join(",")),e=ir.blacklist(e,["username","popupOptions","domain","tenant","timeout","appState"]),e=ir.toSnakeCase(e,["auth0Client"]),e=kr(this.warn,e),n=de(e),r(this.baseOptions.rootUrl,"authorize","?"+n)},Cn.prototype.buildLogoutUrl=function(t){var e,n;return Ze.check(t,{optional:!0,type:"object",message:"options parameter is not valid"}),e=ir.merge(this.baseOptions,["clientID"]).with(t||{}),this.baseOptions._sendTelemetry&&(e.auth0Client=this.request.getTelemetryData()),e=ir.toSnakeCase(e,["auth0Client","returnTo"]),n=de(ir.blacklist(e,["federated"])),t&&void 0!==t.federated&&!1!==t.federated&&"false"!==t.federated&&(n+="&federated"),r(this.baseOptions.rootUrl,"v2","logout","?"+n)},Cn.prototype.loginWithDefaultDirectory=function(t,e){return Ze.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="password",this.oauthToken(t,e)},Cn.prototype.login=function(t,e){return Ze.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},realm:{type:"string",message:"realm option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),t.grantType="http://auth0.com/oauth/grant-type/password-realm",this.oauthToken(t,e)},Cn.prototype.oauthToken=function(t,e){var n,o;return Ze.check(t,{type:"object",message:"options parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"oauth","token"),o=ir.merge(this.baseOptions,["clientID","scope","audience"]).with(t),Ze.check(o,{type:"object",message:"options parameter is not valid"},{clientID:{type:"string",message:"clientID option is required"},grantType:{type:"string",message:"grantType option is required"},scope:{optional:!0,type:"string",message:"scope option is required"},audience:{optional:!0,type:"string",message:"audience option is required"}}),o=ir.toSnakeCase(o,["auth0Client"]),o=Sr(this.warn,o),this.request.post(n).send(o).end(_r(e))},Cn.prototype.loginWithResourceOwner=function(t,e){var n,o;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{username:{type:"string",message:"username option is required"},password:{type:"string",message:"password option is required"},connection:{type:"string",message:"connection option is required"},scope:{optional:!0,type:"string",message:"scope option is required"}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"oauth","ro"),o=ir.merge(this.baseOptions,["clientID","scope"]).with(t,["username","password","scope","connection","device"]),(o=ir.toSnakeCase(o,["auth0Client"])).grant_type=o.grant_type||"password",this.request.post(n).send(o).end(_r(e))},Cn.prototype.getSSOData=function(t,e){if(this.auth0||(this.auth0=new xn(this.baseOptions)),cr.getWindow().location.host===this.baseOptions.domain)return this.auth0._universalLogin.getSSOData(t,e);"function"==typeof t&&(e=t),Ze.check(e,{type:"function",message:"cb parameter is not valid"});var r=this.baseOptions.clientID,n=this.ssodataStorage.get()||{};this.auth0.checkSession({responseType:"token id_token",scope:"openid profile email",connection:n.lastUsedConnection,timeout:5e3},(function(t,o){return t?"login_required"===t.error?e(null,{sso:!1}):("consent_required"===t.error&&(t.error_description="Consent required. When using `getSSOData`, the user has to be authenticated with the following scope: `openid profile email`."),e(t,{sso:!1})):n.lastUsedSub&&n.lastUsedSub!==o.idTokenPayload.sub?e(t,{sso:!1}):e(null,{lastUsedConnection:{name:n.lastUsedConnection},lastUsedUserID:o.idTokenPayload.sub,lastUsedUsername:o.idTokenPayload.email||o.idTokenPayload.name,lastUsedClientID:r,sessionClients:[r],sso:!0})}))},Cn.prototype.userInfo=function(t,e){var n;return Ze.check(t,{type:"string",message:"accessToken parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"userinfo"),this.request.get(n).set("Authorization","Bearer "+t).end(_r(e,{ignoreCasing:!0}))},Cn.prototype.getChallenge=function(t){if(Ze.check(t,{type:"function",message:"cb parameter is not valid"}),!this.baseOptions.state)return t();var e=r(this.baseOptions.rootUrl,"usernamepassword","challenge");return this.request.post(e).send({state:this.baseOptions.state}).end(_r(t,{ignoreCasing:!0}))},Cn.prototype.delegation=function(t,e){var n,o;return Ze.check(t,{type:"object",message:"options parameter is not valid"},{grant_type:{type:"string",message:"grant_type option is required"}}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"delegation"),o=ir.merge(this.baseOptions,["clientID"]).with(t),o=ir.toSnakeCase(o,["auth0Client"]),this.request.post(n).send(o).end(_r(e))},Cn.prototype.getUserCountry=function(t){var e;return Ze.check(t,{type:"function",message:"cb parameter is not valid"}),e=r(this.baseOptions.rootUrl,"user","geoloc","country"),this.request.get(e).end(_r(t))},Dn.prototype.getUser=function(t,e){var n;return Ze.check(t,{type:"string",message:"userId parameter is not valid"}),Ze.check(e,{type:"function",message:"cb parameter is not valid"}),n=r(this.baseOptions.rootUrl,"users",t),this.request.get(n).end(_r(e,{ignoreCasing:!0}))},Dn.prototype.patchUserMetadata=function(t,e,n){var o;return Ze.check(t,{type:"string",message:"userId parameter is not valid"}),Ze.check(e,{type:"object",message:"userMetadata parameter is not valid"}),Ze.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t),this.request.patch(o).send({user_metadata:e}).end(_r(n,{ignoreCasing:!0}))},Dn.prototype.patchUserAttributes=function(t,e,n){var o;return Ze.check(t,{type:"string",message:"userId parameter is not valid"}),Ze.check(e,{type:"object",message:"user parameter is not valid"}),Ze.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t),this.request.patch(o).send(e).end(_r(n,{ignoreCasing:!0}))},Dn.prototype.linkUser=function(t,e,n){var o;return Ze.check(t,{type:"string",message:"userId parameter is not valid"}),Ze.check(e,{type:"string",message:"secondaryUserToken parameter is not valid"}),Ze.check(n,{type:"function",message:"cb parameter is not valid"}),o=r(this.baseOptions.rootUrl,"users",t,"identities"),this.request.post(o).send({link_with:e}).end(_r(n,{ignoreCasing:!0}))};var In={Authentication:Cn,Management:Dn,WebAuth:xn,version:$e};export{Cn as Authentication,Dn as Management,xn as WebAuth,In as default,$e as version};