1/*! For license information please see 1367.build.js.LICENSE.txt */ 2(self.webpackChunktde_webpack_boilerplate=self.webpackChunktde_webpack_boilerplate||[]).push([[1367],{417:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(37158),i=n(68200),o=n(79096),s=n(86033),a=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,s.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,s.isEmptyData)(e)&&!this.error)try{this.hash.update((0,s.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,function(){return(0,r.__generator)(this,function(e){return[2,this.digestSync()]})})},e}();t.Sha256=a},3486:(e,t,n)=>{"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var i=r(n(84058));function o(e,t={}){const n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(!t.doNotParse)try{return JSON.parse(n)}catch(e){}return e}e.exports=class Cookies{constructor(e,t={}){this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.update=()=>{if(!this.HAS_DOCUMENT_COOKIE)return;const e=this.cookies;this.cookies=i.parse(document.cookie),this._checkChanges(e)};const r="undefined"==typeof document?"":document.cookie;this.cookies=function(e){return"string"==typeof e?i.parse(e):"object"==typeof e&&null!==e?e:{}}(e||r),this.defaultSetOptions=t,this.HAS_DOCUMENT_COOKIE=function(){const e=void 0===n.g?void 0:n.g.TEST_HAS_DOCUMENT_COOKIE;return"boolean"==typeof e?e:"object"==typeof document&&"string"==typeof document.cookie}()}_emitChange(e){for(let t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)}_checkChanges(e){new Set(Object.keys(e).concat(Object.keys(this.cookies))).forEach(t=>{e[t]!==this.cookies[t]&&this._emitChange({name:t,value:o(this.cookies[t])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(e,t={}){return t.doNotUpdate||this.update(),o(this.cookies[e],t)}getAll(e={}){e.doNotUpdate||this.update();const t={};for(let n in this.cookies)t[n]=o(this.cookies[n],e);return t}set(e,t,n){n=n?Object.assign(Object.assign({},this.defaultSetOptions),n):this.defaultSetOptions;const r="string"==typeof t?t:JSON.stringify(t);this.cookies=Object.assign(Object.assign({},this.cookies),{[e]:r}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=i.serialize(e,r,n)),this._emitChange({name:e,value:t,options:n})}remove(e,t){const n=t=Object.assign(Object.assign(Object.assign({},this.defaultSetOptions),t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=i.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})}addChangeListener(e){this.changeListeners.push(e),this.HAS_DOCUMENT_COOKIE&&1===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(e){const t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1),this.HAS_DOCUMENT_COOKIE&&0===this.changeListeners.length&&("object"==typeof window&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}},8467:(e,t)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},12520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},17793:()=>{},24329:(e,t,n)=>{"use strict";t.decode=t.parse=n(30875),t.encode=t.stringify=n(65223)},24759:(e,t,n)=>{"use strict";n.r(t),n.d(t,{fromUtf8:()=>r,toUtf8:()=>i});const r=e=>"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):(e=>{const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);if(r<128)t.push(r);else if(r<2048)t.push(r>>6|192,63&r|128);else if(n+1<e.length&&55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))){const i=65536+((1023&r)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(r>>12|224,r>>6&63|128,63&r|128)}return Uint8Array.from(t)})(e),i=e=>"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):(e=>{let t="";for(let n=0,r=e.length;n<r;n++){const r=e[n];if(r<128)t+=String.fromCharCode(r);else if(192<=r&&r<224){const i=e[++n];t+=String.fromCharCode((31&r)<<6|63&i)}else if(240<=r&&r<365){const i="%"+[r,e[++n],e[++n],e[++n]].map(e=>e.toString(16)).join("%");t+=decodeURIComponent(i)}else t+=String.fromCharCode((15&r)<<12|(63&e[++n])<<6|63&e[++n])}return t})(e)},26694:function(e,t,n){var r;e=n.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof n.g&&n.g;i.global!==i&&i.window!==i&&i.self;var o,s=2147483647,a=36,u=/^xn--/,c=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,d=String.fromCharCode;function p(e){throw RangeError(h[e])}function g(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+g((e=e.replace(l,".")).split("."),t).join(".")}function v(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function m(e){return g(e,function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)}).join("")}function w(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,n){var r=0;for(e=n?f(e/700):e>>1,e+=f(e/t);e>455;r+=a)e=f(e/35);return f(r+36*e/(e+38))}function _(e){var t,n,r,i,o,u,c,l,h,d,g=[],y=e.length,v=0,b=128,_=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&p("not-basic"),g.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<y;){for(o=v,u=1,c=a;i>=y&&p("invalid-input"),((l=w(e.charCodeAt(i++)))>=a||l>f((s-v)/u))&&p("overflow"),v+=l*u,!(l<(h=c<=_?1:c>=_+26?26:c-_));c+=a)u>f(s/(d=a-h))&&p("overflow"),u*=d;_=S(v-o,t=g.length+1,0==o),f(v/t)>s-b&&p("overflow"),b+=f(v/t),v%=t,g.splice(v++,0,b)}return m(g)}function A(e){var t,n,r,i,o,u,c,l,h,g,y,m,w,_,A,I=[];for(m=(e=v(e)).length,t=128,n=0,o=72,u=0;u<m;++u)(y=e[u])<128&&I.push(d(y));for(r=i=I.length,i&&I.push("-");r<m;){for(c=s,u=0;u<m;++u)(y=e[u])>=t&&y<c&&(c=y);for(c-t>f((s-n)/(w=r+1))&&p("overflow"),n+=(c-t)*w,t=c,u=0;u<m;++u)if((y=e[u])<t&&++n>s&&p("overflow"),y==t){for(l=n,h=a;!(l<(g=h<=o?1:h>=o+26?26:h-o));
2h+=a)A=l-g,_=a-g,I.push(d(b(g+A%_,0))),l=f(A/_);I.push(d(b(l,0))),o=S(n,w,r==i),n=0,++r}++n,++t}return I.join("")}o={version:"1.3.2",ucs2:{decode:v,encode:m},decode:_,encode:A,toASCII:function(e){return y(e,function(e){return c.test(e)?"xn--"+A(e):e})},toUnicode:function(e){return y(e,function(e){return u.test(e)?_(e.slice(4).toLowerCase()):e})}},void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},30875:e=>{"use strict";function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,r,i){n=n||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(n);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var u=e.length;a>0&&u>a&&(u=a);for(var c=0;c<u;++c){var l,h,f,d,p=e[c].replace(s,"%20"),g=p.indexOf(r);g>=0?(l=p.substr(0,g),h=p.substr(g+1)):(l=p,h=""),f=decodeURIComponent(l),d=decodeURIComponent(h),t(o,f)?Array.isArray(o[f])?o[f].push(d):o[f]=[o[f],d]:o[f]=d}return o}},33845:e=>{"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},35350:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,s,u)),l=0,h=u>0?s-4:s;for(n=0;n<h;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===u&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,u=r-i;a<u;a+=s)o.push(c(e,a,a+s>u?u:a+s));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],r[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(u(r));return i.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},36191:(e,t,n)=>{e.exports=self.fetch||(self.fetch=n(75785).default||n(75785))},37158:(e,t,n)=>{var r,i,o,s,a,u,c,l,h,f,d,p,g,y,v,m,w,b,S,_,A,I,C,E;!function(){var U="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:{};function T(e,t){return e!==U&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(n,r){return e[n]=t?t(n,r):r}}r=function(e){var t,n;t=T(U,T(e)),n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},i=function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},a=function(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},u=function(e,t){return function(n,r){t(n,r,e)}},c=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},l=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}
2return new(n||(n=Promise))(function(n,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?n(e.value):i(e.value).then(s,a)}u((r=r.apply(e,t||[])).next())})},h=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return u([e,t])}}function u(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},E=function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]},f=function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])},d=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},p=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},g=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e},y=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r},v=function(e){return this instanceof v?(this.v=e,this):new v(e)},m=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){o.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{u(i[e](t))}catch(e){h(o[0][3],e)}}function u(e){e.value instanceof v?Promise.resolve(e.value.v).then(c,l):h(o[0][2],e)}function c(e){a("next",e)}function l(e){a("throw",e)}function h(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}},w=function(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:v(e[r](t)),done:"return"===r}:i?i(t):t}:i}},b=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=d(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){i(r,o,(t=e[n](t)).done,t.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},S=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},_=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},A=function(e){return e&&e.__esModule?e:{default:e}},I=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},C=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},t("__extends",i),t("__assign",o),t("__rest",s),t("__decorate",a),t("__param",u),t("__metadata",c),t("__awaiter",l),t("__generator",h),t("__exportStar",f),t("__createBinding",E),t("__values",d),t("__read",p),t("__spread",g),t("__spreadArrays",y
2),t("__await",v),t("__asyncGenerator",m),t("__asyncDelegator",w),t("__asyncValues",b),t("__makeTemplateObject",S),t("__importStar",_),t("__importDefault",A),t("__classPrivateFieldGet",I),t("__classPrivateFieldSet",C)}.apply(t,[t]),void 0===r||(e.exports=r)}()},40973:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(24759),i="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?i(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}},45184:(e,t,n)=>{var r,i;!function(o){if(void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),e.exports=o(),!!0){var s=window.Cookies,a=window.Cookies=o();a.noConflict=function(){return window.Cookies=s,a}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2}
2)+/g,decodeURIComponent)}return function n(r){function i(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var s=JSON.stringify(n);/^[\{\[]/.test(s)&&(n=s)}catch(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in o)o[u]&&(a+="; "+u,!0!==o[u]&&(a+="="+o[u].split(";")[0]));return document.cookie=t+"="+n+a}}function s(e,n){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],s=0;s<o.length;s++){var a=o[s].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var c=t(a[0]);if(u=(r.read||r)(u,c)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(i[c]=u,e===c)break}catch(e){}}return e?i[e]:i}}return i.set=o,i.get=function(e){return s(e,!1)},i.getJSON=function(e){return s(e,!0)},i.remove=function(t,n){o(t,"",e(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}(function(){})})},48868:(e,t,n)=>{"use strict";var r=n(26694),i=n(33845);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.qg=w;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=n(24329);function w(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var w=e=c.join(a);if(w=w.trim(),!n&&1===e.split("#").length){var b=u.exec(w);if(b)return this.path=w,this.href=w,this.pathname=b[1],b[2]?(this.search=b[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var S=s.exec(w);if(S){var _=(S=S[0]).toLowerCase();this.protocol=_,w=w.substr(S.length)}if(n||S||w.match(/^\/\/[^@\/]+@[^@\/]+/)){var A="//"===w.substr(0,2);!A||S&&y[S]||(w=w.substr(2),this.slashes=!0)}if(!y[S]&&(A||S&&!v[S])){for(var I,C,E=-1,U=0;U<f.length;U++){-1!==(T=w.indexOf(f[U]))&&(-1===E||T<E)&&(E=T)}-1!==(C=-1===E?w.lastIndexOf("@"):w.lastIndexOf("@",E))&&(I=w.slice(0,C),w=w.slice(C+1),this.auth=decodeURIComponent(I)),E=-1;for(U=0;U<h.length;U++){var T;-1!==(T=w.indexOf(h[U]))&&(-1===E||T<E)&&(E=T)}-1===E&&(E=w.length),this.host=w.slice(0,E),w=w.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var k=this.hostname.split(/\./),O=(U=0,k.length);U<O;U++){var R=k[U];if(R&&!R.match(d)){for(var D="",x=0,F=R.length;x<F;x++)R.charCodeAt(x)>127?D+="x":D+=R[x];if(!D.match(d)){var N=k.slice(0,U),M=k.slice(U+1),j=R.match(p);j&&(N.push(j[1]),M.unshift(j[2])),M.length&&(w="/"+M.join(".")+w),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+B,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!g[_])for(U=0,O=l.length;U<O;U++){var K=l[U];if(-1!==w.indexOf(K)){var V=encodeURIComponent(K);V===K&&(V=escape(K)),w=w.split(K).join(V)}}var q=w.indexOf("#");-1!==q&&(this.hash=w.substr(q),w=w.slice(0,q));var H=w.indexOf("?");if(-1!==H?(this.search=w.substr(H),this.query=w.substr(H+1),t&&(this.query=m.parse(this.query)),w=w.slice(0,H)):t&&(this.search="",this.query={}),w&&(this.pathname=w),v[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var G=this.search||"";this.path=B+G}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=m.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||v[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(w(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(n[l]=e[l])}return v[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!v[e.protocol]){for(var h=Object.keys(e),f=0;f<h.length;f++){var d=h[f];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||y[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var g=n.pathname||"",m=n.search||"";n.path=g+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var w=n.pathname&&"/"===n.pathname.charAt(0),b=e.host||e.pathname&&"/"===e.pathname.charAt(0),S=b||w||n.host&&e.pathname,_=S,A=n.pathname&&n.pathname.split("/")||[],I=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!v[n.protocol]);if(I&&(n.hostname="",n.port=null,n.host&&(""===A[0]?A[0]=n.host:A.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),S=S&&(""===p[0]||""===A[0])),b)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,A=p;else if(p.length)A||(A=[]),A.pop(),A=A.concat(p),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(I)n.hostname=n.host=A.shift(),(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!A.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var C=A.slice(-1)[0],E=(n.host||e.host||A.length>1)&&("."===C||".."===C)||""===C,U=0,T=A.length;T>=0;T--)"."===(C=A[T])?A.splice(T,1):".."===C?(A.splice(T,1),U++):U&&(A.splice(T,1),U--);if(!S&&!_)for(;U--;U)A.unshift("..");!S||""===A[0]||A[0]&&"/"===A[0].charAt(0)||A.unshift(""),E&&"/"!==A.join("/").substr(-1)&&A.push("");var P,k=""===A[0]||A[0]&&"/"===A[0].charAt(0);I&&(n.hostname=n.host=k?"":A.length?A.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift()));return(S=S||n.host&&A.length)&&!k&&A.unshift(""),A.length?n.pathname=A.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},63969:(e,t,n)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),(0,n(37158).__exportStar)(n(417),t)},65223:e=>{"use strict";var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,n,r,i){return n=n||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(i){var o=encodeURIComponent(t(i))+r;return Array.isArray(e[i])?e[i].map(function(e){return o+encodeURIComponent(t(e))}).join(n):o+encodeURIComponent(t(e[i]))}).join(n):i?encodeURIComponent(t(i))+r+encodeURIComponent(t(e)):""}},68200:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},70934:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},71367:(e,t,n)=>{"use strict";n.d(t,{N:()=>or});var r,i,o,s=n(37158);function a(e){return e&&!!["provider"].find(function(t){return e.hasOwnProperty(t)})}function u(e){return void 0!==e.redirectSignIn}!function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(r||(r={})),function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default",e.DeviceConfig="deviceConfig",e.NetworkError="networkError",e.AutoSignInError="autoSignInError"}(i||(i={})),function(e){e.API_KEY="API_KEY",e.AWS_IAM="AWS_IAM",e.OPENID_CONNECT="OPENID_CONNECT",e.AMAZON_COGNITO_USER_POOLS="AMAZON_COGNITO_USER_POOLS",e.AWS_LAMBDA="AWS_LAMBDA"}(o||(o={}));var c,l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},h=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},f=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},d={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(c||(c={}));var p=function(){function e(e,t){void 0===t&&(t=c.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,r,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var s=this.level;if(e.LOG_LEVEL&&(s=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(s=window.LOG_LEVEL),d[t]>=d[s]){var a=console.log.bind(console);t===c.ERROR&&console.error&&(a=console.error.bind(console)),t===c.WARN&&console.warn&&(a=console.warn.bind(console));var u="[".concat(t,"] ").concat(this._ts()," ").concat(this.name),h="";if(1===i.length&&"string"==typeof i[0])a(h="".concat(u," - ").concat(i[0]));else if(1===i.length)h="".concat(u," ").concat(i[0]),a(u,i[0]);else if("string"==typeof i[0]){var f=i.slice(1);1===f.length&&(f=f[0]),h="".concat(u," - ").concat(i[0]," ").concat(f),a("".concat(u," - ").concat(i[0]),f)}else h="".concat(u," ").concat(i),a(u,i);try{for(var p=l(this._pluggables),g=p.next();!g.done;g=p.next()){var y=g.value,v={message:h,timestamp:Date.now()};y.pushLogs([v])}}catch(e){n={error:e}}finally{try{g&&!g.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.INFO],h(e),!1))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.INFO],h(e),!1))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.WARN],h(e),!1))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.ERROR],h(e),!1))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.DEBUG],h(e),!1))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,f([c.VERBOSE],h(e),!1))},e.prototype.addPluggable=function(e){e&&"Logging"===e.getCategoryName()&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}(),g=function(){return g=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},g.apply(this,arguments)},y=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},v=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},m=new p("Hub"),w="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var b,S=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype._remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find(function(t){return t.pattern.source===e.source});if(!n)return void m.warn("No listeners for ".concat(e));this.patterns=v([],y(this.patterns.filter(function(e){return e!==n})),!1)}else{var r=this.listeners[e];if(!r)return void m.warn("No listeners for ".concat(e));this.listeners[e]=v([],y(r.filter(function(e){return e.callback!==t})),!1)}},e.prototype.remove=function(e,t){this._remove(e,t)},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===w||m.warn("WARNING: ".concat(e," is protected and dispatching on it can have unintended consequences")));var i={channel:e,payload:g({},t),source:n,patternInfo:[]};try{this._toListeners(i)}catch(e){m.error(e)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))m.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:n,callback:r})}return function(){i._remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach(function(r){m.debug("Dispatching to ".concat(t," with "),n);try{r.callback(e)}catch(e){m.error(e)}}),this.patterns.length>0){if(!n.message)return void m.warn("Cannot perform pattern matching without a message
2key");var i=n.message;this.patterns.forEach(function(t){var n=i.match(t.pattern);if(n){var r=y(n).slice(1),o=g(g({},e),{patternInfo:r});try{t.callback(o)}catch(e){m.error(e)}}})}},e}())("__default__"),_={},A=function(){function e(){}return e.setItem=function(e,t){return _[e]=t,_[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(_,e)?_[e]:void 0},e.removeItem=function(e){return delete _[e]},e.clear=function(){return _={}},e}(),I=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=A}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),C=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:"undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node}},E=(b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},b(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),U=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},P=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},k=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},O=new p("Util"),R=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return E(t,e),t}(Error);var D=3e5;function x(e){void 0===e&&(e=D);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var F,N,M,j,B,L,K,V,q,H,G,W,Y,z=function(e,t,n,r){return void 0===n&&(n=D),function(e,t,n,r){return U(this,void 0,void 0,function(){var i=this;return T(this,function(o){if("function"!=typeof e)throw Error("functionToRetry must be a function");return[2,new Promise(function(o,s){return U(i,void 0,void 0,function(){var i,a,u,c,l,h,f;return T(this,function(d){switch(d.label){case 0:i=0,a=!1,c=function(){},r&&r.then(function(){a=!0,clearTimeout(u),c()}),h=function(){var r,h,f,d;return T(this,function(p){switch(p.label){case 0:i++,O.debug("".concat(e.name," attempt #").concat(i," with this vars: ").concat(JSON.stringify(t))),p.label=1;
2case 1:return p.trys.push([1,3,,7]),r={},h=o,[4,e.apply(void 0,k([],P(t),!1))];case 2:return[2,(r.value=h.apply(void 0,[p.sent()]),r)];case 3:return f=p.sent(),l=f,O.debug("error on ".concat(e.name),f),(g=f)&&g.nonRetryable?(O.debug("".concat(e.name," non retryable error"),f),[2,{value:s(f)}]):(d=n(i,t,f),O.debug("".concat(e.name," retrying in ").concat(d," ms")),!1===d||a?[2,{value:s(f)}]:[3,4]);case 4:return[4,new Promise(function(e){c=e,u=setTimeout(c,d)})];case 5:p.sent(),p.label=6;case 6:return[3,7];case 7:return[2]}var g})},d.label=1;case 1:return a?[3,3]:[5,h()];case 2:return"object"==typeof(f=d.sent())?[2,f.value]:[3,1];case 3:return s(l),[2]}})})})]})})}(e,t,x(n),r)},J=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},Z=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},$=new p("CognitoCredentials"),X=new Promise(function(e,t){return C().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?($.debug("google api already loaded"),e()):void setTimeout(function(){return e()},2e3):($.debug("not in the browser, directly resolved"),e())}),Q=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return J(this,void 0,void 0,function(){return Z(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:($.debug("need to wait for the Google SDK loaded"),[4,X]);case 1:e.sent(),this.initialized=!0,$.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}})})},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return C().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise(function(t,n){e.getAuthInstance().then(function(e){e||($.debug("google Auth undefined"),n(new R("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?($.debug("refreshing the google access token"),r.reloadAuthResponse().then(function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})}).catch(function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new R("Failed to reload google auth response"))})):n(new R("User is not signed in with Google"))}).catch(function(e){$.debug("Failed to refresh google token",e),n(new R("Failed to refresh google token"))})}):($.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),ee=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},te=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
2function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ne=new p("CognitoCredentials"),re=new Promise(function(e,t){return C().isBrowser?window.FB?(ne.debug("FB SDK already loaded"),e()):void setTimeout(function(){return e()},2e3):(ne.debug("not in the browser, directly resolved"),e())}),ie=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return ee(this,void 0,void 0,function(){return te(this,function(e){switch(e.label){case 0:return this.initialized?[3,2]:(ne.debug("need to wait for the Facebook SDK loaded"),[4,re]);case 1:e.sent(),this.initialized=!0,ne.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}})})},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(C().isBrowser&&(e=window.FB),!e){var t="no fb sdk available";return ne.debug(t),Promise.reject(new R(t))}return new Promise(function(t,n){e.getLoginStatus(function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,o=1e3*r.expiresIn+(new Date).getTime();if(!i){s="the jwtToken is undefined";ne.debug(s),n(new R(s))}t({token:i,expires_at:o})}else{var s="no response from facebook when refreshing the jwt token";ne.debug(s),n(new R(s))}},{scope:"public_profile,email"})})},e}(),oe=new Q,se=new ie,ae=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},ue=new p("Amplify"),ce=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Notifications=null,this.Logger=p,this.ServiceWorker=null}return e.prototype.register=function(e){ue.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):ue.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),ue.debug("amplify config",this._config),Object.entries(this._modules).forEach(function(e){var n=ae(e,2),r=(n[0],n[1]);Object.keys(r).forEach(function(e){t._modules[e]&&(r[e]=t._modules[e])})}),this._components.map(function(e){e.configure(t._config)}),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map(function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)})},e}()),le={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},he={partitions:[le,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},fe=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);
2if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},de=function(e){var t,n,r=he.partitions;try{for(var i=fe(r),o=i.next();!o.done;o=i.next()){var s=o.value,a=s.regions,u=s.outputs,c=s.regionRegex,l=new RegExp(c);if(a.includes(e)||l.test(e))return u.dnsSuffix}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return le.outputs.dnsSuffix},pe=function(){return pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pe.apply(this,arguments)},ge=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},ye=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ve=function(e,t){if(null==t?void 0:t.aborted)return Promise.resolve();var n,r,i=new Promise(function(t){r=t,n=setTimeout(t,e)});return null==t||t.addEventListener("abort",function e(i){clearTimeout(n),null==t||t.removeEventListener("abort",e),r()}),i},me=function(e,t){var n;"[object Object]"===Object.prototype.toString.call(e)&&(e.$metadata=pe(pe({},null!==(n=e.$metadata)&&void 0!==n?n:{}),{attempts:t}))},we=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},be=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Se=function(e,t){return function(n,r){for(var i={},o=function(t){return e(t,r)},s=t.length-1;s>=0;s--){o=(0,t[s])(r)(o,i)}return o(n)}},_e=(n(36191),function(e){var t;return function(){return t||(t=e()),t}}),Ae=function(){return Ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ae.apply(this,arguments)}
2,Ie=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},Ce=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Ee=function(e){return!["HEAD","GET","DELETE"].includes(e.toUpperCase())},Ue=Se(function(e,t){var n=e.url,r=e.method,i=e.headers,o=e.body,s=t.abortSignal;return Ie(void 0,void 0,void 0,function(){var e,t,a,u,c,l,h;return Ce(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,fetch(n,{method:r,headers:i,body:Ee(r)?o:void 0,signal:s})];case 1:return e=f.sent(),[3,3];case 2:if((t=f.sent())instanceof TypeError)throw new Error("Network error");throw t;case 3:return a={},null===(l=e.headers)||void 0===l||l.forEach(function(e,t){a[t.toLowerCase()]=e}),u={statusCode:e.status,headers:a,body:null},c=Object.assign(null!==(h=e.body)&&void 0!==h?h:{},{text:_e(function(){return e.text()}),blob:_e(function(){return e.blob()}),json:_e(function(){return e.json()})}),[2,Ae(Ae({},u),{body:c})]}})})},[function(e){var t=e.userAgentHeader,n=void 0===t?"x-amz-user-agent":t,r=e.userAgentValue,i=void 0===r?"":r;return function(e){return function(t){return we(this,void 0,void 0,function(){var r;return be(this,function(o){switch(o.label){case 0:return 0!==i.trim().length?[3,2]:[4,e(t)];case 1:return[2,o.sent()];case 2:return r=n.toLowerCase(),t.headers[r]=t.headers[r]?"".concat(t.headers[r]," ").concat(i):i,[4,e(t)];case 3:return[2,o.sent()]}})})}}},function(e){var t=e.maxAttempts,n=void 0===t?3:t,r=e.retryDecider,i=e.computeDelay,o=e.abortSignal;if(n<1)throw new Error("maxAttempts must be greater than 0");return function(e,t){return function(s){var a;return ge(this,void 0,void 0,function(){var u,c,l,h,f,d;return ye(this,function(p){switch(p.label){case 0:c=null!==(a=t.attemptsCount)&&void 0!==a?a:0,h=function(){if(l)return me(l,c),l;throw me(u,c),u},p.label=1;case 1:if((null==o?void 0:o.aborted)||!(c<n))return[3,11];p.label=2;case 2:return p.trys.push([2,4,,5]),[4,e(s)];case 3:return l=p.sent(),u=void 0,[3,5];case 4:return f=p.sent(),u=f,l=void 0,[3,5];case 5:return c=t.attemptsCount>c?t.attemptsCount:c+1,t.attemptsCount=c,[4,r(l,u)];case 6:return p.sent()?!(null==o?void 0:o.aborted)&&c<n?(d=i(c),[4,ve(d,o)]):[3,8]:[3,9];case 7:p.sent(),p.label=8;case 8:return[3,1];case 9:return[2,h()];case 10:return[3,1];case 11:if(null==o?void 0:o.aborted)throw new Error("Request aborted.");return[2,h()]}})})}}}]),Te=function(){return Te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Te.apply(this,arguments)},Pe=function(e){var t,n,r=e.headers,i=e.statusCode;return Te(Te({},ke(e)?e.$metadata:{}),{httpStatusCode:i,requestId:null!==(n=null!==(t=r["x-amzn-requestid"])&&void 0!==t?t:r["x-amzn-request-id"])&&void 0!==n?n:r["x-amz-request-id"],extendedRequestId:r["x-amz-id-2"],cfId:r["x-amz-cf-id"]})},ke=function(e){return"object"==typeof(null==e?void 0:e.$metadata)}
2,Oe=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},Re=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},De=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},xe=function(e){return Oe(void 0,void 0,void 0,function(){var t,n,r,i,o,s,a,u,c;return Re(this,function(l){switch(l.label){case 0:return!e||e.statusCode<300?[2]:[4,Fe(e)];case 1:return t=l.sent(),n=function(e){var t=De(e.toString().split(/[\,\:]+/),1)[0];return t.includes("#")?t.split("#")[1]:t}(null!==(a=null!==(s=null!==(o=e.headers["x-amzn-errortype"])&&void 0!==o?o:t.code)&&void 0!==s?s:t.__type)&&void 0!==a?a:"UnknownError"),r=null!==(c=null!==(u=t.message)&&void 0!==u?u:t.Message)&&void 0!==c?c:"Unknown error",i=new Error(r),[2,Object.assign(i,{name:n,$metadata:Pe(e)})]}})})},Fe=function(e){return Oe(void 0,void 0,void 0,function(){var t;return Re(this,function(n){switch(n.label){case 0:if(!e.body)throw new Error("Missing response payload");return[4,e.body.json()];case 1:return t=n.sent(),[2,Object.assign(t,{$metadata:Pe(e)})]}})})},Ne=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],Me=function(e){return Ne.includes(e)},je=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},Be=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Le=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],Ke=["TimeoutError","RequestTimeout","RequestTimeoutException"],Ve=function(e,t){return 429===e||Le.includes(t)},qe=function(e){return"Network error"===(null==e?void 0:e.name)},He=function(e,t){return[500,502,503,504].includes(e)||Ke.includes(t)},Ge=3e5;!function(e){e.WebUnknown="0",e.React="1",e.NextJs="2",e.Angular="3",e.VueJs="4",e.Nuxt="5",e.Svelte="6",e.ServerSideUnknown="100",e.ReactSSR="101",e.NextJsSSR="102",e.AngularSSR="103",e.VueJsSSR="104",e.NuxtSSR="105",e.SvelteSSR="106",e.ReactNative="201",e.Expo="202"}(F||(F={})),function(e){e.API="api",e.Auth="auth",e.Analytics="analytics",e.DataStore="datastore",e.Geo="geo",e.InAppMessaging="inappmessaging",e.Interactions="interactions",e.Predictions="predictions",e.PubSub="pubsub",e.PushNotification="pushnotification",e.Storage="storage"}(N||(N={})),function(e){e.Record="1",e.UpdateEndpoint="2"}(M||(M={})),function(e){e.GraphQl="1",e.Get="2",e.Post="3",e.Put="4",e.Patch="5",e.Del="6",e.Head="7"}(j||(j={})),function(e){e.FederatedSignIn="30"}(B||(B={})),function(e){e.Subscribe="1",e.GraphQl="2"}(L||(L={})),function(e){e.None="0"}(K||(K={})),function(e){e.None="0"}(V||(V={})),function(e){e.None="0"}(q||(q={})),function(e){e.Convert="1",e.Identify="2",e.Interpret="3"}(H||(H={})),function(e){e.Subscribe="1"}(G||(G={})),function(e){e.None="0"}(W||(W={})),function(e){e.Put="1",e.Get="2",e.List="3",e.Copy="4",e.Remove="5",e.GetProperties="6"}(Y||(Y={}));var We="5.3.26",Ye=function(){return void 0!==n.g},ze=function(){return"undefined"!=typeof window},Je=function(){return"undefined"!=typeof document},Ze=function(){return"undefined"!=typeof process}
2,$e=function(e,t){return!!Object.keys(e).find(function(e){return e.startsWith(t)})};var Xe,Qe=[{platform:F.Expo,detectionMethod:function(){return Ye()&&void 0!==n.g.expo}},{platform:F.ReactNative,detectionMethod:function(){return"undefined"!=typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:F.NextJs,detectionMethod:function(){return ze()&&window.next&&"object"==typeof window.next}},{platform:F.Nuxt,detectionMethod:function(){return ze()&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:F.Angular,detectionMethod:function(){var e=Boolean(Je()&&document.querySelector("[ng-version]")),t=Boolean(ze()&&void 0!==window.ng);return e||t}},{platform:F.React,detectionMethod:function(){var e=function(e){return e.startsWith("_react")||e.startsWith("__react")};return Je()&&Array.from(document.querySelectorAll("[id]")).some(function(t){return Object.keys(t).find(e)})}},{platform:F.VueJs,detectionMethod:function(){return ze()&&$e(window,"__VUE")}},{platform:F.Svelte,detectionMethod:function(){return ze()&&$e(window,"__SVELTE")}},{platform:F.WebUnknown,detectionMethod:function(){return ze()}},{platform:F.NextJsSSR,detectionMethod:function(){return Ye()&&($e(n.g,"__next")||$e(n.g,"__NEXT"))}},{platform:F.NuxtSSR,detectionMethod:function(){return Ye()&&void 0!==n.g.__NUXT_PATHS__}},{platform:F.ReactSSR,detectionMethod:function(){return Ze()&&void 0!==process.env&&!!Object.keys(process.env).find(function(e){return e.includes("react")})}},{platform:F.VueJsSSR,detectionMethod:function(){return Ye()&&$e(n.g,"__VUE")}},{platform:F.AngularSSR,detectionMethod:function(){var e;return Ze()&&"object"==typeof process.env&&(null===(e=process.env.npm_lifecycle_script)||void 0===e?void 0:e.startsWith("ng "))||!1}},{platform:F.SvelteSSR,detectionMethod:function(){return Ze()&&void 0!==process.env&&!!Object.keys(process.env).find(function(e){return e.includes("svelte")})}}];var et=[],tt=!1,nt=function(){if(!Xe){if(Xe=(null===(e=Qe.find(function(e){return e.detectionMethod()}))||void 0===e?void 0:e.platform)||F.ServerSideUnknown,tt)for(;et.length;)et.pop()();else et.forEach(function(e){return e()});it(F.ServerSideUnknown,10),it(F.WebUnknown,10)}var e;return Xe},rt=function(e){tt||et.push(e)};function it(e,t){Xe!==e||tt||setTimeout(function(){Xe=void 0,tt=!0,setTimeout(nt,1e3)},t)}var ot,st=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},at="aws-amplify",ut=new(function(){function e(){this.userAgent="".concat(at,"/").concat(We)}return Object.defineProperty(e.prototype,"framework",{get:function(){return nt()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReactNative",{get:function(){return this.framework===F.ReactNative||this.framework===F.Expo},enumerable:!1,configurable:!0}),e.prototype.observeFrameworkChanges=function(e){rt(e)},e}()),ct=function(e){return function(e){var t=void 0===e?{}:e,n=t.category,r=t.action,i=(t.framework,[[at,We]]);return n&&i.push([n,r]),i.push(["framework",nt()]),i}(e).map(function(e){var t=st(e,2),n=t[0],r=t[1];return"".concat(n,"/").concat(r)}).join(" ")},lt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},ht=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},ft=Se(Ue,[function(){return function(e,t){return function(t){return lt(this,void 0,void 0,function(){return ht(this,function(n){return t.headers["cache-control"]="no-store",[2,e(t)]})})}}}]),dt={service:"cognito-identity",endpointResolver:function(e){var t=e.region;
2return{url:new URL("https://cognito-identity.".concat(t,".").concat(de(t)))}},retryDecider:(ot=xe,function(e,t){return je(void 0,void 0,void 0,function(){var n,r,i,o;return Be(this,function(s){switch(s.label){case 0:return null==t?[3,1]:(r=t,[3,3]);case 1:return[4,ot(e)];case 2:r=s.sent(),s.label=3;case 3:return n=(null!==(o=r)&&void 0!==o?o:{}).name,i=null==e?void 0:e.statusCode,[2,qe(t)||Ve(i,n)||Me(n)||He(i,n)]}})})}),computeDelay:function(e){var t=x(Ge)(e);return!1===t?Ge:t},userAgentValue:ct()};rt(function(){dt.userAgentValue=ct()});var pt=function(e){return{"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.".concat(e)}},gt=function(e,t,n){return{headers:t,url:e.url,body:n,method:"POST"}},yt=function(){return yt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},yt.apply(this,arguments)},vt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},mt=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},wt=function(e,t,n,r){return function(i,o){return vt(void 0,void 0,void 0,function(){var s,a,u,c;return mt(this,function(l){switch(l.label){case 0:return[4,(s=yt(yt({},r),i)).endpointResolver(s,o)];case 1:return a=l.sent(),[4,t(o,a)];case 2:return u=l.sent(),[4,e(u,yt({},s))];case 3:return c=l.sent(),[4,n(c)];case 4:return[2,l.sent()]}})})}},bt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},St=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},_t=wt(ft,function(e,t){var n=pt("GetId"),r=JSON.stringify(e);return gt(t,n,r)},function(e){return bt(void 0,void 0,void 0,function(){return St(this,function(t){switch(t.label){case 0:return e.statusCode>=300?[4,xe(e)]:[3,2];case 1:throw t.sent();case 2:return[4,Fe(e)];case 3:return[2,{IdentityId:t.sent().IdentityId,$metadata:Pe(e)}]}})})}
2,dt),At=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},It=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Ct=function(e){return void 0===e&&(e={}),{AccessKeyId:e.AccessKeyId,SecretKey:e.SecretKey,SessionToken:e.SessionToken,Expiration:new Date(1e3*e.Expiration)}},Et=wt(ft,function(e,t){var n=pt("GetCredentialsForIdentity"),r=JSON.stringify(e);return gt(t,n,r)},function(e){return At(void 0,void 0,void 0,function(){var t;return It(this,function(n){switch(n.label){case 0:return e.statusCode>=300?[4,xe(e)]:[3,2];case 1:throw n.sent();case 2:return[4,Fe(e)];case 3:return[2,{IdentityId:(t=n.sent()).IdentityId,Credentials:Ct(t.Credentials),$metadata:Pe(e)}]}})})},dt),Ut=function(){return Ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ut.apply(this,arguments)},Tt=new p("Parser"),Pt=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in,signUpVerificationMethod:e.aws_cognito_sign_up_verification_method||"code"}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=Ut(Ut({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),Tt.debug("parse config",e,"to amplifyconfig",n),n},kt=function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},kt.apply(this,arguments)},Ot=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}u((r=r.apply(e,t||[])).next())})},Rt=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;
2function a(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}},Dt=new p("Credentials"),xt="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ft=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=oe.refreshGoogleToken,this._refreshHandlers.facebook=se.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t,n,r,i=this._config.refreshHandlers;return i&&(this._refreshHandlers=kt(kt({},this._refreshHandlers),i)),this._storage=this._config.storage,this._storage||(this._storage=(new I).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),t="credentials_configured",n=null,r="Credentials has been configured successfully",S.dispatch("core",{event:t,data:n,message:r},"Credentials",xt),this._config},e.prototype.get=function(){return Dt.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"".concat("CognitoIdentityId-").concat(e)},e.prototype._pickupCredentials=function(){return Dt.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Dt.debug("getting old cred promise"):(Dt.debug("getting new cred promise"),this._gettingCredPromise=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then(function(e){return r=!0,t=!1,e},function(e){throw n=!0,t=!1,e});return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i}(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Ot(this,void 0,void 0,function(){var e,t,n,r,i,o,s;return Rt(this,function(a){switch(a.label){case 0:if(Dt.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return Dt.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(Dt.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?ce.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,this._setCredentialsForGuest()];if(this._isExpired(e)||!this._isPastTTL())return[3,6];Dt.debug("ttl has passed but token is not yet expired"),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=a.sent(),[4,n.currentSession()];case 3:return i=a.sent(),o=i.refreshToken,[4,new Promise(function(e,t){r.refreshSession(o,function(n,r){return n?t(n):e(r)})})];case 4:return a.sent(),[3,6];case 5:return s=a.sent(),Dt.debug("Error attempting to refreshing the session",s),[3,6];case 6:return[2,n.currentUserCredentials()]}})})},e.prototype.refreshFederatedToken=function(e){Dt.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,i=e.identity_id,o=e.expires_at;o=1970===new Date(o).getFullYear()?1e3*o:o;var s=this;return Dt.debug("checking if federated jwt token expired"),o>(new Date).getTime()?(Dt.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):s._refreshHandlers[t]&&"function"==typeof s._refreshHandlers[t]?(Dt.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:s._refreshHandlers[t],provider:t,user:n})):(Dt.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,i=e.user;return z(n,[],1e4).then(function(e){return Dt.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:i,identity_id:e.identity_id,expires_at:e.expires_at})}).catch(function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Dt.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)})},e.prototype._isExpired=function(e){if(!e)return Dt.debug("no credentials for expiration check"),!0;Dt.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){var e;return Ot(this,void 0,void 0,function(){var t,n,r,i,o,s,a,u,c,l,h=this;return Rt(this,function(f){switch(f.label){case 0:return Dt.debug("setting credentials for guest"),(null===(e=this._config)||void 0===e?void 0:e.identityPoolId)||(this._config=Object.assign({},this._config,Pt(this._config||{}).Auth)),t=this._config,n=t.identityPoolId,r=t.region,i=t.mandatorySignIn,o=t.identityPoolRegion,i?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:n?o||r?(a=this,[4,this._getGuestIdentityId()]):(Dt.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(Dt.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);
2case 1:return s=a._identityId=f.sent(),u={region:null!=o?o:r},c=function(){return Ot(h,void 0,void 0,function(){var e,t;return Rt(this,function(r){switch(r.label){case 0:return s?[3,2]:[4,_t(u,{IdentityPoolId:n})];case 1:e=r.sent().IdentityId,this._identityId=e,r.label=2;case 2:return[4,Et(u,{IdentityId:this._identityId})];case 3:return t=r.sent().Credentials,[2,{identityId:this._identityId,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})})},l=c().catch(function(e){return Ot(h,void 0,void 0,function(){return Rt(this,function(t){throw e})})}),[2,this._loadCredentials(l,"guest",!1,null).then(function(e){return e}).catch(function(e){return Ot(h,void 0,void 0,function(){var t,r=this;return Rt(this,function(i){switch(i.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '".concat(s,"' not found.")?[3,2]:(Dt.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return i.sent(),t=function(){return Ot(r,void 0,void 0,function(){var e,t;return Rt(this,function(r){switch(r.label){case 0:return[4,_t(u,{IdentityPoolId:n})];case 1:return e=r.sent().IdentityId,this._identityId=e,[4,Et(u,{IdentityId:e})];case 2:return t=r.sent().Credentials,[2,{identityId:e,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})})},l=t().catch(function(e){return Ot(r,void 0,void 0,function(){return Rt(this,function(t){throw e})})}),[2,this._loadCredentials(l,"guest",!1,null)];case 2:return[2,e]}})})})]}})})},e.prototype._setCredentialsFromFederation=function(e){var t=this,n=e.provider,r=e.token,i=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[n]||n;if(!o)return Promise.reject("You must specify a federated provider");var s={};s[o]=r;var a=this._config,u=a.identityPoolId,c=a.region,l=a.identityPoolRegion;if(!u)return Dt.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!l&&!c)return Dt.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var h={region:null!=l?l:c},f=Ot(t,void 0,void 0,function(){var e,t;return Rt(this,function(n){switch(n.label){case 0:return i?[3,2]:[4,_t(h,{IdentityPoolId:u,Logins:s})];case 1:e=n.sent().IdentityId,i=e,n.label=2;case 2:return[4,Et(h,{IdentityId:i,Logins:s})];case 3:return t=n.sent().Credentials,[2,{identityId:i,accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretKey,sessionToken:t.SessionToken,expiration:t.Expiration}]}})}).catch(function(e){return Ot(t,void 0,void 0,function(){return Rt(this,function(t){throw e})})});return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Dt.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,s=r.identityPoolId,a=r.identityPoolRegion;if(!s)return Dt.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!a&&!i)return Dt.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var u={};u["cognito-idp."+i+".amazonaws.com/"+o]=n;var c={region:null!=a?a:i},l=Ot(t,void 0,void 0,function(){var e,t,n,r,i,o,a,l,h,f;return Rt(this,function(d){switch(d.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=d.sent())?[3,3]:[4,_t(c,{IdentityPoolId:s,Logins:u})];case 2:n=d.sent().IdentityId,t=n,d.label=3;case 3:return[4,Et(c,{IdentityId:e||t,Logins:u})];case 4:return r=d.sent(),i=r.Credentials,o=i.AccessKeyId,a=i.Expiration,l=i.SecretKey,h=i.SessionToken,f=r.IdentityId,this._identityId=f,e?(Dt.debug("The guest identity ".concat(e," has been successfully linked to the logins")),e===f&&Dt.debug("The guest identity ".concat(e," has become the primary identity")),[4,this._removeGuestIdentityId()]):[3,6];case 5:d.sent(),d.label=6;case 6:return[2,{accessKeyId:o,secretAccessKey:l,sessionToken:h,expiration:a,identityId:f}]}})}).catch(function(e){return Ot(t,void 0,void 0,function(){return Rt(this,function(t){throw e})})});return this._loadCredentials(l,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this;return new Promise(function(s,a){e.then(function(e){return Ot(i,void 0,void 0,function(){var i,a,u,c,l;return Rt(this,function(h){switch(h.label){case 0:if(Dt.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),o._credentials=e,o._credentials.authenticated=n,o._credentials_source=t,o._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),a=r.provider,u=r.token,c=r.expires_at,l=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:a,token:u,user:i,expires_at:c,identity_id:l}))}catch(e){Dt.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:h.sent(),h.label=2;case 2:return s(o._credentials),[2]}})})}).catch(function(t){if(t)return Dt.debug("Failed to load credentials",e),Dt.debug("Error loading credentials",t),void a(t)})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Dt.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Ot(this,void 0,void 0,function(){return Rt(this,function(e){return this._credentials=null,this._credentials_source=null,Dt.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]})})},e.prototype._getGuestIdentityId=function(){return Ot(this,void 0,void 0,function(){var e,t;return Rt(this,function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),Dt.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}})})},e.prototype._setGuestIdentityId=function(e){return Ot(this,void 0,void 0,function(){var t,n;return Rt(this,function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),Dt.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}})})},e.prototype._removeGuestIdentityId=function(){return Ot(this,void 0,void 0,function(){var e;return Rt(this,function(t){return e=this._config.identityPoolId,Dt.debug("removing ".concat(this._getCognitoIdentityIdStorageKey(e)," from storage")),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}
2(),Nt=new Ft(null);ce.register(Nt);var Mt=n(3486),jt=n.n(Mt),Bt=function(){return Bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bt.apply(this,arguments)},Lt=C().isBrowser,Kt=function(){function e(e){void 0===e&&(e={}),this.cookies=new(jt()),this.store=Lt?window.localStorage:Object.create(null),this.cookies=e.req?new(jt())(decodeURIComponent(e.req.headers.cookie)):new(jt()),Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!1,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map(function(t,n){return e.key(n)}).forEach(function(t){return e.removeItem(t)})},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){this.setLocalItem(e,t);var n=e.split(".").pop();["LastAuthUser","accessToken","refreshToken","idToken"].includes(null!=n?n:"")&&this.setUniversalItem(e,t,{expires:new Date(Date.now()+31536e6)})},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t,n){void 0===n&&(n={}),this.cookies.set(e,t,Bt(Bt({},n),{path:"/",sameSite:!0,secure:!Lt||"localhost"!==window.location.hostname}))},e}();var Vt,qt=function(){function e(e){var t=e||{},n=t.ValidationData,r=t.Username,i=t.Password,o=t.AuthParameters,s=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=s||{},this.username=r,this.password=i}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),Ht=n(94296);if("undefined"!=typeof window&&window.crypto&&(Vt=window.crypto),!Vt&&"undefined"!=typeof window&&window.msCrypto&&(Vt=window.msCrypto),!Vt&&void 0!==n.g&&n.g.crypto&&(Vt=n.g.crypto),!Vt)try{Vt=n(17793)}catch(e){}function Gt(){if(Vt){if("function"==typeof Vt.getRandomValues)try{return Vt.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof Vt.randomBytes)try{return Vt.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")}var Wt=function(){function e(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length}var t=e.prototype;return t.random=function(t){for(var n=[],r=0;r<t;r+=4)n.push(Gt());return new e(n,t)},t.toString=function(){return function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")}(this)},e}(),Yt=n(63969);const zt=Jt;function Jt(e,t){null!=e&&this.fromString(e,t)}function Zt(){return new Jt(null)}var $t;var Xt="undefined"!=typeof navigator;Xt&&"Microsoft Internet Explorer"==navigator.appName?(Jt.prototype.am=function(e,t,n,r,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,l=a*u+c*s;i=((u=s*u+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},$t=30):Xt&&"Netscape"!=navigator.appName?(Jt.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var s=t*this[e++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},$t=26):(Jt.prototype.am=function(e,t,n,r,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*s;i=((u=s*u+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+a*c,n[r++]=268435455&u}return i},$t=28),Jt.prototype.DB=$t,Jt.prototype.DM=(1<<$t)-1,Jt.prototype.DV=1<<$t;Jt.prototype.FV=Math.pow(2,52),Jt.prototype.F1=52-$t,Jt.prototype.F2=2*$t-52;var Qt,en,tn=new Array;for(Qt="0".charCodeAt(0),en=0;en<=9;++en)tn[Qt++]=en;for(Qt="a".charCodeAt(0),en=10;en<36;++en)tn[Qt++]=en;for(Qt="A".charCodeAt(0),en=10;en<36;++en)tn[Qt++]=en;function nn(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function rn(e,t){var n=tn[e.charCodeAt(t)];return null==n?-1:n}function on(e){var t=Zt();return t.fromInt(e),t}function sn(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function an(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>
vendor: 8,935 bytes, line 2
2>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function un(e){return Ht.hp.from((new Wt).random(e).toString(),"hex")}an.prototype.convert=function(e){var t=Zt();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(Jt.ZERO)>0&&this.m.subTo(t,t),t},an.prototype.revert=function(e){var t=Zt();return e.copyTo(t),this.reduce(t),t},an.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},an.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},an.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},Jt.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},Jt.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},Jt.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var s=rn(e,r);s<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}this.clamp(),i&&Jt.ZERO.subTo(this,this)},Jt.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},Jt.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},Jt.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},Jt.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&o)<<r;for(n=s-1;n>=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},Jt.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)t[s-n-1]|=(this[s]&o)<<i,t[s-n]=this[s]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},Jt.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},Jt.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&Jt.ZERO.subTo(t,t)},Jt.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},Jt.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=Zt());var o=Zt(),s=this.s,a=e.s,u=this.DB-sn(r[r.t-1]);u>0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var c=o.t,l=o[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),f=this.FV/h,d=(1<<this.F1)/h,p=1<<this.F2,g=n.t,y=g-c,v=null==t?Zt():t;for(o.dlShiftTo(y,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),Jt.ONE.dlShiftTo(c,v),v.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--y>=0;){var m=n[--g]==l?this.DM:Math.floor(n[g]*f+(n[g-1]+p)*d);if((n[g]+=o.am(0,m,n,y,0,c))<m)for(o.dlShiftTo(y,v),n.subTo(v,n);n[g]<--m;)n.subTo(v,n)}null!=t&&(n.drShiftTo(c,t),s!=a&&Jt.ZERO.subTo(t,t)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&Jt.ZERO.subTo(n,n)}}},Jt.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},Jt.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},Jt.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(i=!0,o=nn(n));s>=0;)a<t?(n=(this[s]&(1<<a)-1)<<t-a,n|=this[--s]>>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=nn(n));return i?o:"0"},Jt.prototype.negate=function(){var e=Zt();return Jt.ZERO.subTo(this,e),e},Jt.prototype.abs=function(){return this.s<0?this.negate():this},Jt.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},Jt.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+sn(this[this.t-1]^this.s&this.DM)},Jt.prototype.mod=function(e){var t=Zt();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(Jt.ZERO)>0&&e.subTo(t,t),t},Jt.prototype.equals=function(e){return 0==this.compareTo(e)},Jt.prototype.add=function(e){var t=Zt();return this.addTo(e,t),t},Jt.prototype.subtract=function(e){var t=Zt();return this.subTo(e,t),t},Jt.prototype.multiply=function(e){var t=Zt();return this.multiplyTo(e,t),t},Jt.prototype.divide=function(e){var t=Zt();return this.divRemTo(e,t,null),t},Jt.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=on(1),s=new an(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var a=new Array,u=3,c=r-1,l=(1<<r)-1;if(a[1]=s.convert(this),r>1){var h=Zt();for(s.sqrTo(a[1],h);u<=l;)a[u]=Zt(),s.mulTo(h,a[u-2],a[u]),u+=2}var f,d,p=e.t-1,g=!0,y=Zt();for(i=sn(e[p])-1;p>=0;){for(i>=c?f=e[p]>>i-c&l:(f=(e[p]&(1<<i+1)-1)<<c-i,p>0&&(f|=e[p-1]>>this.DB+i-c)),u=r;!(1&f);)f>>=1,--u;if((i-=u)<0&&(i+=this.DB,--p),g)a[f].copyTo(o),g=!1;else{for(;u>1;)s.sqrTo(o,y),s.sqrTo(y,o),u-=2;u>0?s.sqrTo(o,y):(d=o,o=y,y=d),s.mulTo(y,a[f],o)}for(;p>=0&&!(e[p]&1<<i);)s.sqrTo(o,y),d=o,o=y,y=d,--i<0&&(i=this.DB-1,--p)}var v=s.revert(o);return n(null,v),v},Jt.ZERO=on(0),Jt.ONE=on(1);var cn=/^[89a-f]/i,ln=function(){function e(e){this.N=new zt("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",16),this.g=new zt("2",16),this.k=new zt(this.hexHash(""+this.padHex(this.N)+this.padHex(this.g)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=Ht.hp.from("Caldera Derived Key","utf8"),this.poolName=e}var t=e.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,function(n,r){n&&e(n,null),t.largeAValue=r,e(null,t.largeAValue)})},t.generateRandomSmallA=function(){var e=un(128).toString("hex");return new zt(e,16)},t.generateRandomString=function(){return un(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,t,n){var r=this;this.randomPassword=this.generateRandomString();var i=""+e+t+":"+this.randomPassword,o=this.hash(i),s=un(16).toString("hex");this.SaltToHashDevices=this.padHex(new zt(s,16)),this.g.modPow(new zt(this.hexHash(this.SaltToHashDevices+o),16),this.N,function(e,t){e&&n(e,null),r.verifierDevices=r.padHex(t),n(null,null)})},t.calculateA=function(e,t){var n=this;this.g.modPow(e,this.N,function(e,r){e&&t(e,null),r.mod(n.N).equals(zt.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,r)}
2)},t.calculateU=function(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new zt(this.UHexHash,16)},t.hash=function(e){var t=new Yt.Sha256;t.update(e);var n=t.digestSync(),r=Ht.hp.from(n).toString("hex");return new Array(64-r.length).join("0")+r},t.hexHash=function(e){return this.hash(Ht.hp.from(e,"hex"))},t.computehkdf=function(e,t){var n=Ht.hp.concat([this.infoBits,Ht.hp.from(String.fromCharCode(1),"utf8")]),r=new Yt.Sha256(t);r.update(e);var i=r.digestSync(),o=new Yt.Sha256(i);return o.update(n),o.digestSync().slice(0,16)},t.getPasswordAuthenticationKey=function(e,t,n,r,i){var o=this;if(n.mod(this.N).equals(zt.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,n),this.UValue.equals(zt.ZERO))throw new Error("U cannot be zero.");var s=""+this.poolName+e+":"+t,a=this.hash(s),u=new zt(this.hexHash(this.padHex(r)+a),16);this.calculateS(u,n,function(e,t){e&&i(e,null);var n=o.computehkdf(Ht.hp.from(o.padHex(t),"hex"),Ht.hp.from(o.padHex(o.UValue),"hex"));i(null,n)})},t.calculateS=function(e,t,n){var r=this;this.g.modPow(e,this.N,function(i,o){i&&n(i,null),t.subtract(r.k.multiply(o)).modPow(r.smallAValue.add(r.UValue.multiply(e)),r.N,function(e,t){e&&n(e,null),n(null,t.mod(r.N))})})},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},t.padHex=function(e){if(!(e instanceof zt))throw new Error("Not a BigInteger");var t=e.compareTo(zt.ZERO)<0,n=e.abs().toString(16);if(n=n.length%2!=0?"0"+n:n,n=cn.test(n)?"00"+n:n,t){var r=n.split("").map(function(e){var t=15&~parseInt(e,16);return"0123456789ABCDEF".charAt(t)}).join("");(n=new zt(r,16).add(zt.ONE).toString(16)).toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},e}(),hn=function(){function e(e){this.jwtToken=e||"",this.payload=this.decodePayload()}var t=e.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(Ht.hp.from(e,"base64").toString("utf8"))}catch(e){return{}}},e}();function fn(e,t){return fn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fn(e,t)}var dn=function(e){function t(t){var n=(void 0===t?{}:t).AccessToken;return e.call(this,n||"")||this}var n,r;return r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,fn(n,r),t}(hn);function pn(e,t){return pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pn(e,t)}var gn=function(e){function t(t){var n=(void 0===t?{}:t).IdToken;return e.call(this,n||"")||this}var n,r;return r=e,(n=t).prototype=Object.create(r.prototype),n.prototype.constructor=n,pn(n,r),t}(hn),yn=function(){function e(e){var t=(void 0===e?{}:e).RefreshToken;this.token=t||""}return e.prototype.getToken=function(){return this.token},e}(),vn={userAgent:"aws-amplify/5.0.4",isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product};var mn=function(){function e(e){var t=void 0===e?{}:e,n=t.IdToken,r=t.RefreshToken,i=t.AccessToken,o=t.ClockDrift;if(null==i||null==n)throw new Error("Id token and Access Token must be present.");this.idToken=n,this.refreshToken=r,this.accessToken=i,this.clockDrift=void 0===o?this.calculateClockDrift():o}var t=e.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},t.isValid=function(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},e}(),wn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],bn=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Sn=function(){function e(){}return e.prototype.getNowString=function(){var e=new Date,t=bn[e.getUTCDay()],n=wn[e.getUTCMonth()],r=e.getUTCDate(),i=e.getUTCHours();i<10&&(i="0"+i);var o=e.getUTCMinutes();o<10&&(o="0"+o);var s=e.getUTCSeconds();return s<10&&(s="0"+s),t+" "+n+" "+r+" "+i+":"+o+":"+s+" UTC "+e.getUTCFullYear()},e}(),_n=function(){function e(e){var t=void 0===e?{}:e,n=t.Name,r=t.Value;this.Name=n||"",this.Value=r||""}var t=e.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}(),An={},In=function(){function e(){}return e.setItem=function(e,t){return An[e]=t,An[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(An,e)?An[e]:void 0},e.removeItem=function(e){return delete An[e]},e.clear=function(){return An={}}
2,e}(),Cn=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=In}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),En="undefined"!=typeof navigator?vn.isReactNative?"react-native":navigator.userAgent:"nodejs",Un=function(){function e(e){if(null==e||null==e.Username||null==e.Pool)throw new Error("Username and Pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new Cn).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=e.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,t){var n=this,r=e.getAuthParameters();r.USERNAME=this.username;var i=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:i};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",o,function(e,r){if(e)return t.onFailure(e);var i=r.ChallengeName,o=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))})},t.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,t){var n,r,i=this,o=new ln(this.pool.getUserPoolName()),s=new Sn,a={};null!=this.deviceKey&&(a.DEVICE_KEY=this.deviceKey),a.USERNAME=this.username,o.getLargeAValue(function(u,c){u&&t.onFailure(u),a.SRP_A=c.toString(16),"CUSTOM_AUTH"===i.authenticationFlowType&&(a.CHALLENGE_NAME="SRP_A");var l=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),h={AuthFlow:i.authenticationFlowType,ClientId:i.pool.getClientId(),AuthParameters:a,ClientMetadata:l};i.getUserContextData(i.username)&&(h.UserContextData=i.getUserContextData(i.username)),i.client.request("InitiateAuth",h,function(a,u){if(a)return t.onFailure(a);var c=u.ChallengeParameters;i.username=c.USER_ID_FOR_SRP,i.userDataKey=i.keyPrefix+"."+i.username+".userData",n=new zt(c.SRP_B,16),r=new zt(c.SALT,16),i.getCachedDeviceKeyAndPassword(),o.getPasswordAuthenticationKey(i.username,e.getPassword(),n,r,function(e,n){e&&t.onFailure(e);var r=s.getNowString(),a=Ht.hp.concat([Ht.hp.from(i.pool.getUserPoolName(),"utf8"),Ht.hp.from(i.username,"utf8"),Ht.hp.from(c.SECRET_BLOCK,"base64"),Ht.hp.from(r,"utf8")]),h=new Yt.Sha256(n);h.update(a);var f=h.digestSync(),d=Ht.hp.from(f).toString("base64"),p={};p.USERNAME=i.username,p.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,p.TIMESTAMP=r,p.PASSWORD_CLAIM_SIGNATURE=d,null!=i.deviceKey&&(p.DEVICE_KEY=i.deviceKey);var g=function(e,t){return i.client.request("RespondToAuthChallenge",e,function(n,r){return n&&"ResourceNotFoundException"===n.code&&-1!==n.message.toLowerCase().indexOf("device")?(p.DEVICE_KEY=null,i.deviceKey=null,i.randomPassword=null,i.deviceGroupKey=null,i.clearCachedDeviceKeyAndPassword(),g(e,t)):t(n,r)})},y={ChallengeName:"PASSWORD_VERIFIER",ClientId:i.pool.getClientId(),ChallengeResponses:p,Session:u.Session,ClientMetadata:l};i.getUserContextData()&&(y.UserContextData=i.getUserContextData()),g(y,function(e,n){return e?t.onFailure(e):i.authenticateUserInternal(n,o,t)})})})})},t.authenticateUserPlainUsernamePassword=function(e,t){var n=this,r={};if(r.USERNAME=this.username,r.PASSWORD=e.getPassword(),r.PASSWORD){var i=new ln(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var o=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),s={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:o};this.getUserContextData(this.username)&&(s.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",s,function(e,r){return e?t.onFailure(e):n.authenticateUserInternal(r,i,t)}
2)}else t.onFailure(new Error("PASSWORD parameter is required"))},t.authenticateUserInternal=function(e,t,n){var r=this,i=e.ChallengeName,o=e.ChallengeParameters;if("SMS_MFA"===i)return this.Session=e.Session,n.mfaRequired(i,o);if("SELECT_MFA_TYPE"===i)return this.Session=e.Session,n.selectMFAType(i,o);if("MFA_SETUP"===i)return this.Session=e.Session,n.mfaSetup(i,o);if("SOFTWARE_TOKEN_MFA"===i)return this.Session=e.Session,n.totpRequired(i,o);if("CUSTOM_CHALLENGE"===i)return this.Session=e.Session,n.customChallenge(o);if("NEW_PASSWORD_REQUIRED"===i){this.Session=e.Session;var s=null,a=null,u=[],c=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(o&&(s=JSON.parse(e.ChallengeParameters.userAttributes),a=JSON.parse(e.ChallengeParameters.requiredAttributes)),a)for(var l=0;l<a.length;l++)u[l]=a[l].substr(c.length);return n.newPasswordRequired(s,u)}if("DEVICE_SRP_AUTH"===i)return this.Session=e.Session,void this.getDeviceResponse(n);this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=i,this.cacheTokens();var h=e.AuthenticationResult.NewDeviceMetadata;if(null==h)return n.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(i){if(i)return n.onFailure(i);var o={Salt:Ht.hp.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:Ht.hp.from(t.getVerifierDevices(),"hex").toString("base64")};r.verifierDevices=o.PasswordVerifier,r.deviceGroupKey=h.DeviceGroupKey,r.randomPassword=t.getRandomPassword(),r.client.request("ConfirmDevice",{DeviceKey:h.DeviceKey,AccessToken:r.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:En},function(t,i){return t?n.onFailure(t):(r.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,r.cacheDeviceKeyAndPassword(),!0===i.UserConfirmationNecessary?n.onSuccess(r.signInUserSession,i.UserConfirmationNecessary):n.onSuccess(r.signInUserSession))})})},t.completeNewPasswordChallenge=function(e,t,n,r){var i=this;if(!e)return n.onFailure(new Error("New password is required."));var o=new ln(this.pool.getUserPoolName()),s=o.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};t&&Object.keys(t).forEach(function(e){a[s+e]=t[e]}),a.NEW_PASSWORD=e,a.USERNAME=this.username;var u={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:a,Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(e,t){return e?n.onFailure(e):i.authenticateUserInternal(t,o,n)})},t.getDeviceResponse=function(e,t){var n=this,r=new ln(this.deviceGroupKey),i=new Sn,o={};o.USERNAME=this.username,o.DEVICE_KEY=this.deviceKey,r.getLargeAValue(function(s,a){s&&e.onFailure(s),o.SRP_A=a.toString(16);var u={ChallengeName:"DEVICE_SRP_AUTH",ClientId:n.pool.getClientId(),ChallengeResponses:o,ClientMetadata:t,Session:n.Session};n.getUserContextData()&&(u.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",u,function(t,o){if(t)return e.onFailure(t);var s=o.ChallengeParameters,a=new zt(s.SRP_B,16),u=new zt(s.SALT,16);r.getPasswordAuthenticationKey(n.deviceKey,n.randomPassword,a,u,function(t,r){if(t)return e.onFailure(t);var a=i.getNowString(),u=Ht.hp.concat([Ht.hp.from(n.deviceGroupKey,"utf8"),Ht.hp.from(n.deviceKey,"utf8"),Ht.hp.from(s.SECRET_BLOCK,"base64"),Ht.hp.from(a,"utf8")]),c=new Yt.Sha256(r);c.update(u);var l=c.digestSync(),h=Ht.hp.from(l).toString("base64"),f={};f.USERNAME=n.username,f.PASSWORD_CLAIM_SECRET_BLOCK=s.SECRET_BLOCK,f.TIMESTAMP=a,f.PASSWORD_CLAIM_SIGNATURE=h,f.DEVICE_KEY=n.deviceKey;var d={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:f,Session:o.Session};n.getUserContextData()&&(d.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",d,function(t,r){return t?e.onFailure(t):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))})})})})},t.confirmRegistration=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",i,function(e){return e?n(e,null):n(null,"SUCCESS")})},t.sendCustomChallengeAnswer=function(e,t,n){var r=this,i={};i.USERNAME=this.username,i.ANSWER=e;var o=new ln(this.pool.getUserPoolName());this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(i.DEVICE_KEY=this.deviceKey);var s={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:i,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",s,function(e,n){return e?t.onFailure(e):r.authenticateUserInternal(n,o,t)})},t.sendMFACode=function(e,t,n,r){var i=this,o={};o.USERNAME=this.username,o.SMS_MFA_CODE=e;var s=n||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===s&&(o.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(o.DEVICE_KEY=this.deviceKey);var a={ChallengeName:s,ChallengeResponses:o,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,function(e,n){if(e)return t.onFailure(e);
2if("DEVICE_SRP_AUTH"!==n.ChallengeName){if(i.signInUserSession=i.getCognitoUserSession(n.AuthenticationResult),i.cacheTokens(),null==n.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(i.signInUserSession);var r=new ln(i.pool.getUserPoolName());r.generateHashDevice(n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,n.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(e){if(e)return t.onFailure(e);var o={Salt:Ht.hp.from(r.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:Ht.hp.from(r.getVerifierDevices(),"hex").toString("base64")};i.verifierDevices=o.PasswordVerifier,i.deviceGroupKey=n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,i.randomPassword=r.getRandomPassword(),i.client.request("ConfirmDevice",{DeviceKey:n.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:i.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:En},function(e,r){return e?t.onFailure(e):(i.deviceKey=n.AuthenticationResult.NewDeviceMetadata.DeviceKey,i.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?t.onSuccess(i.signInUserSession,r.UserConfirmationNecessary):t.onSuccess(i.signInUserSession))})})}else i.getDeviceResponse(t)})},t.changePassword=function(e,t,n,r){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:r},function(e){return e?n(e,null):n(null,"SUCCESS")})},t.enableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var t=[];t.push({DeliveryMedium:"SMS",AttributeName:"phone_number"}),this.client.request("SetUserSettings",{MFAOptions:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.setUserMfaPreference=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?n(e,null):n(null,"SUCCESS")})},t.disableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("SetUserSettings",{MFAOptions:[],AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},t.deleteUser=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:t},function(t){return t?e(t,null):(n.clearCachedUser(),e(null,"SUCCESS"))})},t.updateAttributes=function(e,t,n){var r=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:n},function(e,n){return e?t(e,null):r.getUserData(function(){return t(null,"SUCCESS",n)},{bypassCache:!0})})},t.getUserAttributes=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,n){if(t)return e(t,null);for(var r=[],i=0;i<n.UserAttributes.length;i++){var o={Name:n.UserAttributes[i].Name,Value:n.UserAttributes[i].Value},s=new _n(o);r.push(s)}return e(null,r)})},t.getMFAOptions=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()}
2,function(t,n){return t?e(t,null):e(null,n.MFAOptions)})},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(e){var t=this;return void 0===e&&(e={}),new Promise(function(n){var r=t.signInUserSession.getRefreshToken();r&&r.getToken()?t.refreshSession(r,n,e.clientMetadata):n()})},t.getUserData=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var r=this.getUserDataFromCache();if(r)if(this.isFetchUserDataAndTokenRequired(t))this.fetchUserData().then(function(e){return n.refreshSessionIfPossible(t).then(function(){return e})}).then(function(t){return e(null,t)}).catch(e);else try{return void e(null,JSON.parse(r))}catch(t){return this.clearCachedUserData(),void e(t,null)}else this.fetchUserData().then(function(t){e(null,t)}).catch(e)},t.getUserDataFromCache=function(){return this.storage.getItem(this.userDataKey)},t.isFetchUserDataAndTokenRequired=function(e){var t=(e||{}).bypassCache;return void 0!==t&&t},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then(function(t){return e.cacheUserData(t),t})},t.deleteAttributes=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?t(e,null):n.getUserData(function(){return t(null,"SUCCESS")},{bypassCache:!0})})},t.resendConfirmationCode=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.client.request("ResendConfirmationCode",n,function(t,n){return t?e(t,null):e(null,n)})},t.getSession=function(e,t){if(void 0===t&&(t={}),null==this.username)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var n="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,r=n+".idToken",i=n+".accessToken",o=n+".refreshToken",s=n+".clockDrift";if(this.storage.getItem(r)){var a=new gn({IdToken:this.storage.getItem(r)}),u=new dn({AccessToken:this.storage.getItem(i)}),c=new yn({RefreshToken:this.storage.getItem(o)}),l=parseInt(this.storage.getItem(s),0)||0,h=new mn({IdToken:a,AccessToken:u,RefreshToken:c,ClockDrift:l});if(h.isValid())return this.signInUserSession=h,e(null,this.signInUserSession);if(!c.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(c,e,t.clientMetadata)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,t,n){var r=this,i=this.pool.wrapRefreshSessionCallback?this.pool.wrapRefreshSessionCallback(t):t,o={};o.REFRESH_TOKEN=e.getToken();var s="CognitoIdentityServiceProvider."+this.pool.getClientId(),a=s+".LastAuthUser";if(this.storage.getItem(a)){this.username=this.storage.getItem(a);var u=s+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(u),o.DEVICE_KEY=this.deviceKey}var c={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:o,ClientMetadata:n};this.getUserContextData()&&(c.UserContextData=this.getUserContextData()),this.client.requestWithRetry("InitiateAuth",c,function(t,n){if(t)return"NotAuthorizedException"===t.code&&r.clearCachedUser(),i(t,null);if(n){var o=n.AuthenticationResult;return Object.prototype.hasOwnProperty.call(o,"RefreshToken")||(o.RefreshToken=e.getToken()),r.signInUserSession=r.getCognitoUserSession(o),r.cacheTokens(),i(null,r.signInUserSession)}})},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+"."+this.username+".clockDrift",o=e+".LastAuthUser";this.storage.setItem(t,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(n,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(r,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(i,""+this.signInUserSession.getClockDrift()),this.storage.setItem(o,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()}
2,t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(n,this.randomPassword),this.storage.setItem(r,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(n),this.deviceGroupKey=this.storage.getItem(r))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+".LastAuthUser",o=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r),this.storage.removeItem(i),this.storage.removeItem(o)},t.getCognitoUserSession=function(e){var t=new gn(e),n=new dn(e),r=new yn(e);return new mn({IdToken:t,AccessToken:n,RefreshToken:r})},t.forgotPassword=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.getUserContextData()&&(n.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",n,function(t,n){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(n):e.onSuccess(n)})},t.confirmPassword=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",i,function(e){return e?n.onFailure(e):n.onSuccess("SUCCESS")})},t.getAttributeVerificationCode=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},function(e,n){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(n):t.onSuccess("SUCCESS")})},t.verifyAttribute=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?n.onFailure(e):n.onSuccess("SUCCESS")})},t.getDevice=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(t,n){return t?e.onFailure(t):e.onSuccess(n)})},t.forgetSpecificDevice=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")})},t.forgetDevice=function(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(n){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(n)}})},t.setDeviceStatusRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.setDeviceStatusNotRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},t.listDevices=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));var r={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};t&&(r.PaginationToken=t),this.client.request("ListDevices",r,function(e,t){return e?n.onFailure(e):n.onSuccess(t)})},t.globalSignOut=function(e){var t=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(n){return n?e.onFailure(n):(t.clearCachedUser(),e.onSuccess("SUCCESS"))})},t.signOut=function(e){var t=this;
2e&&"function"==typeof e?this.getSession(function(n,r){if(n)return e(n);t.revokeTokens(function(n){t.cleanClientData(),e(n)})}):this.cleanClientData()},t.revokeTokens=function(e){if(void 0===e&&(e=function(){}),"function"!=typeof e)throw new Error("Invalid revokeTokenCallback. It should be a function.");if(!this.signInUserSession)return e(new Error("User is not authenticated"));if(!this.signInUserSession.getAccessToken())return e(new Error("No Access token available"));var t=this.signInUserSession.getRefreshToken().getToken(),n=this.signInUserSession.getAccessToken();if(this.isSessionRevocable(n)&&t)return this.revokeToken({token:t,callback:e});e()},t.isSessionRevocable=function(e){if(e&&"function"==typeof e.decodePayload)try{return!!e.decodePayload().origin_jti}catch(e){}return!1},t.cleanClientData=function(){this.signInUserSession=null,this.clearCachedUser()},t.revokeToken=function(e){var t=e.token,n=e.callback;this.client.requestWithRetry("RevokeToken",{Token:t,ClientId:this.pool.getClientId()},function(e){if(e)return n(e);n()})},t.sendMFASelectionAnswer=function(e,t){var n=this,r={};r.USERNAME=this.username,r.ANSWER=e;var i={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",i,function(r,i){return r?t.onFailure(r):(n.Session=i.Session,"SMS_MFA"===e?t.mfaRequired(i.ChallengeName,i.ChallengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(i.ChallengeName,i.ChallengeParameters):void 0)})},t.getUserContextData=function(){return this.pool.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var t=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t,n){return t?e.onFailure(t):e.associateSecretCode(n.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(n,r){return n?e.onFailure(n):(t.Session=r.Session,e.associateSecretCode(r.SecretCode))})},t.verifySoftwareToken=function(e,t,n){var r=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:t},function(e,t){return e?n.onFailure(e):n.onSuccess(t)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:t},function(e,t){if(e)return n.onFailure(e);r.Session=t.Session;var i={};i.USERNAME=r.username;var o={ChallengeName:"MFA_SETUP",ClientId:r.pool.getClientId(),ChallengeResponses:i,Session:r.Session};r.getUserContextData()&&(o.UserContextData=r.getUserContextData()),r.client.request("RespondToAuthChallenge",o,function(e,t){return e?n.onFailure(e):(r.signInUserSession=r.getCognitoUserSession(t.AuthenticationResult),r.cacheTokens(),n.onSuccess(r.signInUserSession))})})},e}();function Tn(){}Tn.prototype.userAgent=vn.userAgent;var Pn=function(e){Tn.framework=e};function kn(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Dn(e,t)}function On(e){var t="function"==typeof Map?new Map:void 0;return On=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Rn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Dn(i,n.prototype),i}(e,arguments,xn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Dn(n,e)},On(e)}function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Rn=function(){return!!e})()}function Dn(e,t){return Dn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dn(e,t)}
2function xn(e){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xn(e)}var Fn=function(e){function t(t,n,r,i){var o;return(o=e.call(this,t)||this).code=n,o.name=r,o.statusCode=i,o}return kn(t,e),t}(On(Error)),Nn=function(){function e(e,t,n){this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/";var r=(n||{}).credentials;this.fetchOptions=r?{credentials:r}:{}}var t=e.prototype;return t.promisifyRequest=function(e,t){var n=this;return new Promise(function(r,i){n.request(e,t,function(e,t){e?i(new Fn(e.message,e.code,e.name,e.statusCode)):r(t)})})},t.requestWithRetry=function(e,t,n){var r=this;(function(e,t,n){void 0===n&&(n=Ln);return Bn(e,t,function(e){var t=100,n=100;return function(r){var i=Math.pow(2,r)*t+n*Math.random();return!(i>e)&&i}}(n))})(function(t){return new Promise(function(n,i){r.request(e,t,function(e,t){e?i(e):n(t)})})},[t],5e3).then(function(e){return n(null,e)}).catch(function(e){return n(e)})},t.request=function(e,t,n){var r,i,o,s={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":(r=Tn.category?" "+Tn.category:"",i=Tn.framework?" framework/"+Tn.framework:"",""+Tn.prototype.userAgent+r+i),"Cache-Control":"no-store"},a=Object.assign({},this.fetchOptions,{headers:s,method:"POST",mode:"cors",body:JSON.stringify(t)});fetch(this.endpoint,a).then(function(e){return o=e,e},function(e){if(e instanceof TypeError)throw new Error("Network error");throw e}).then(function(e){return e.json().catch(function(){return{}})}).then(function(e){if(o.ok)return n(null,e);0;var t=(e.__type||e.code).split("#").pop(),r=new Error(e.message||e.Message||null);return r.name=t,r.code=t,n(r)}).catch(function(e){if(o&&o.headers&&o.headers.get("x-amzn-errortype"))try{var t=o.headers.get("x-amzn-errortype").split(":")[0],r=new Error(o.status?o.status.toString():null);return r.code=t,r.name=t,r.statusCode=o.status,n(r)}catch(t){return n(e)}else e instanceof Error&&"Network error"===e.message&&(e.code="NetworkError");return n(e)})},e}(),Mn={debug:function(){}},jn=function(e){return e&&e.nonRetryable};function Bn(e,t,n,r){if(void 0===r&&(r=1),"function"!=typeof e)throw Error("functionToRetry must be a function");return Mn.debug(e.name+" attempt #"+r+" with args: "+JSON.stringify(t)),e.apply(void 0,t).catch(function(i){if(Mn.debug("error on "+e.name,i),jn(i))throw Mn.debug(e.name+" non retryable error",i),i;var o=n(r,t,i);if(Mn.debug(e.name+" retrying in "+o+" ms"),!1!==o)return new Promise(function(e){return setTimeout(e,o)}).then(function(){return Bn(e,t,n,r+1)});throw i})}var Ln=3e5;var Kn=function(){function e(e,t){var n=e||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,s=n.fetchOptions,a=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(r.length>55||!/^[\w-]+_[0-9a-zA-Z]+$/.test(r))throw new Error("Invalid UserPoolId format.");var u=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new Nn(u,o,s),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=e.Storage||(new Cn).getStorage(),t&&(this.wrapRefreshSessionCallback=t)}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getUserPoolName=function(){return this.getUserPoolId().split("_")[1]},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var s=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,function(t,n){if(t)return i(t,null);var r={Username:e,Pool:s,Storage:s.storage},o={user:new Un(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)})},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new Un(n)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),Vn=n(45184),qn=function(){function e(e){if(void 0===e&&(e={}),e.domain&&(this.domain=e.domain),e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),Vn.set(e,t,n),Vn.get(e)},t.getItem=function(e){return Vn.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),Vn.remove(e,t)},t.clear=function(){for(var e=Vn.get(),t=Object.keys(e).length,n=0;n<t;++n)this.removeItem(Object.keys(e)[n]);return{}},e}(),Hn=n(48868),Gn=function(e){var t=window.open(e,"_self");
2return t?Promise.resolve(t):Promise.reject()},Wn=("undefined"!=typeof Symbol&&"function"==typeof Symbol.for&&Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"),"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default"),Yn=function(e,t,n){S.dispatch("auth",{event:e,data:t,message:n},"Auth",Wn)},zn=new p("OAuth");const Jn=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||Gn,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every(function(e){return"string"==typeof e})},e.prototype.oauthSignIn=function(e,t,n,i,o,a){void 0===e&&(e="code"),void 0===o&&(o=r.Cognito);var u=this._generateState(32),c=a?u+"-"+a.split("").map(function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")}).join(""):u;!function(e){window.sessionStorage.setItem("oauth_state",e)}(c);var l,h=this._generateRandom(128);l=h,window.sessionStorage.setItem("ouath_pkce_key",l);var f=this._generateChallenge(h),d=this._scopes.join(" "),p="https://"+t+"/oauth2/authorize?"+Object.entries((0,s.__assign)((0,s.__assign)({redirect_uri:n,response_type:e,client_id:i,identity_provider:o,scope:d,state:c},"code"===e?{code_challenge:f}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map(function(e){var t=(0,s.__read)(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)}).join("&");zn.debug("Redirecting to "+p),this._urlOpener(p,n)},e.prototype._handleCodeFlow=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,a,c,l,h,f,d,p,g,y,v,m;return(0,s.__generator)(this,function(w){switch(w.label){case 0:return t=((0,Hn.qg)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var n,r=(0,s.__read)(t,2),i=r[0],o=r[1];return(0,s.__assign)((0,s.__assign)({},e),((n={})[i]=o,n))},{code:void 0}).code,n=(0,Hn.qg)(e).pathname||"/",r=(0,Hn.qg)(this._config.redirectSignIn).pathname||"/",t&&n===r?(i="https://"+this._config.domain+"/oauth2/token",Yn("codeFlow",{},"Retrieving tokens from "+i),o=u(this._config)?this._cognitoClientId:this._config.clientID,a=u(this._config)?this._config.redirectSignIn:this._config.redirectUri,b=window.sessionStorage.getItem("ouath_pkce_key"),window.sessionStorage.removeItem("ouath_pkce_key"),c=b,l=(0,s.__assign)({grant_type:"authorization_code",code:t,client_id:o,redirect_uri:a},c?{code_verifier:c}:{}),zn.debug("Calling token endpoint: "+i+" with",l),h=Object.entries(l).map(function(e){var t=(0,s.__read)(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)}).join("&"),f={category:N.Auth,action:B.FederatedSignIn},[4,fetch(i,{method:"POST",headers:(m={"Content-Type":"application/x-www-form-urlencoded"},m["x-amz-user-agent"]=ct(f),m),body:h})]):[2];case 1:return[4,w.sent().json()];case 2:if(d=w.sent(),p=d.access_token,g=d.refresh_token,y=d.id_token,v=d.error)throw new Error(v);return[2,{accessToken:p,refreshToken:g,idToken:y}]}var b})})},e.prototype._handleImplicitFlow=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r;return(0,s.__generator)(this,function(i){return t=((0,Hn.qg)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var n,r=(0,s.__read)(t,2),i=r[0],o=r[1];return(0,s.__assign)((0,s.__assign)({},e),((n={})[i]=o,n))},{id_token:void 0,access_token:void 0}),n=t.id_token,r=t.access_token,Yn("implicitFlow",{},"Got tokens from "+e),zn.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:r,idToken:n,refreshToken:null}]})})},e.prototype.handleAuthResponse=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,a,u;return(0,s.__generator)(this,function(c){switch(c.label){case 0:if(c.trys.push([0,5,,6]),t=e?(0,s.__assign)((0,s.__assign)({},((0,Hn.qg)(e).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var n=(0,s.__read)(t,2),r=n[0],i=n[1];return e[r]=i,e},{})),((0,Hn.qg)(e).query||"").split("&").map(function(e){return e.split("=")}).reduce(function(e,t){var n=(0,s.__read)(t,2),r=n[0],i=n[1];return e[r]=i,e},{})):{},n=t.error,r=t.error_description,n)throw new Error(r);
2return i=this._validateState(t),zn.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,s.__assign.apply(void 0,[s.__assign.apply(void 0,o.concat([c.sent()])),{state:i}])];case 2:return a=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,s.__assign.apply(void 0,[s.__assign.apply(void 0,a.concat([c.sent()])),{state:i}])];case 4:return[3,6];case 5:throw u=c.sent(),zn.debug("Error handling auth response.",u),u;case 6:return[2]}})})},e.prototype._validateState=function(e){if(e){var t,n=(t=window.sessionStorage.getItem("oauth_state"),window.sessionStorage.removeItem("oauth_state"),t),r=e.state;if(n&&n!==r)throw new Error("Invalid state in OAuth flow");return r}},e.prototype.signOut=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t,n;return(0,s.__generator)(this,function(r){return e="https://"+this._config.domain+"/logout?",t=u(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=u(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map(function(e){var t=(0,s.__read)(e,2);return t[0]+"="+t[1]}).join("&"),Yn("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),zn.debug("Signing out from "+e),[2,this._urlOpener(e,n)]})})},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(61*Math.random())];return t},e.prototype._generateChallenge=function(e){var t=new Yt.Sha256;t.update(e);var n=t.digestSync(),r=Ht.hp.from(n).toString("base64");return this._base64URL(r)},e.prototype._base64URL=function(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!=typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var n=0;n<e;n+=1)t[n]=66*Math.random()|0;return this._bufferToString(t)},e.prototype._bufferToString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<e.byteLength;r+=1){var i=e[r]%62;n.push(t[i])}return n.join("")},e}();var Zn;!function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_EMAIL="Email cannot be empty",e.EMPTY_PHONE="Phone number cannot be empty",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty",e.NETWORK_ERROR="Network Error",e.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",e.AUTOSIGNIN_ERROR="Please use your credentials to sign in"}(Zn||(Zn={}));var $n=new p("AuthError"),Xn=function(e){function t(n){var r=this,i=er[n],o=i.message,s=i.log;return(r=e.call(this,o)||this).constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="AuthError",r.log=s||o,$n.error(r.log),r}return(0,s.__extends)(t,e),t}(Error),Qn=function(e){function t(n){var r=e.call(this,n)||this;return r.constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="NoUserPoolError",r}return(0,s.__extends)(t,e),t}(Xn),er={noConfig:{message:Zn.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly.\n This error is typically caused by one of the following scenarios:\n\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n \n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n "},missingAuthConfig:{message:Zn.DEFAULT_MSG,log:"\n Error: Amplify has not been configured correctly. \n The configuration object is missing required auth properties.\n This error is typically caused by one of the following scenarios:\n\n 1. Did you run `amplify push` after adding auth via `amplify add auth`?\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n "},emptyUsername:{message:Zn.EMPTY_USERNAME},invalidUsername:{message:Zn.INVALID_USERNAME},emptyPassword:{message:Zn.EMPTY_PASSWORD},emptyCode:{message:Zn.EMPTY_CODE},signUpError:{message:Zn.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:Zn.NO_MFA},invalidMFA:{message:Zn.INVALID_MFA},emptyChallengeResponse:{message:Zn.EMPTY_CHALLENGE},noUserSession:{message:Zn.NO_USER_SESSION},deviceConfig:{message:Zn.DEVICE_CONFIG}
2,networkError:{message:Zn.NETWORK_ERROR},autoSignInError:{message:Zn.AUTOSIGNIN_ERROR},default:{message:Zn.DEFAULT_MSG}},tr=new p("AuthClass"),nr="aws.cognito.signin.user.admin",rr="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",ir=function(e,t,n){S.dispatch("auth",{event:e,data:t,message:n},"Auth",rr)},or=new(function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.autoSignInInitiated=!1,this.inflightSessionPromise=null,this.inflightSessionPromiseCounter=0,this.Credentials=Nt,this.wrapRefreshSessionCallback=function(e){return function(t,n){return n?ir("tokenRefresh",void 0,"New token retrieved"):ir("tokenRefresh_failure",t,"Failed to retrieve new token"),e(t,n)}},this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),S.listen("auth",function(e){switch(e.payload.event){case"verify":case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}}),Tn.category="auth",Pn(ut.framework),ut.observeFrameworkChanges(function(){Pn(ut.framework)})}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};tr.debug("configure Auth");var n=Object.assign({},this._config,Pt(e).Auth,e);this._config=n;var r=this._config,o=r.userPoolId,s=r.userPoolWebClientId,a=r.cookieStorage,c=r.oauth,l=r.region,h=r.identityPoolId,f=r.mandatorySignIn,d=r.refreshHandlers,p=r.identityPoolRegion,g=r.clientMetadata,y=r.endpoint,v=r.storage;if(v){if(!this._isValidAuthStorage(v))throw tr.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=v}else this._storage=a?new qn(a):e.ssr?new Kt:(new I).getStorage();if(this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),o){var m={UserPoolId:o,ClientId:s,endpoint:y};m.Storage=this._storage,this.userPool=new Kn(m,this.wrapRefreshSessionCallback)}this.Credentials.configure({mandatorySignIn:f,region:l,userPoolId:o,identityPoolId:h,refreshHandlers:d,storage:this._storage,identityPoolRegion:p});var w=c?u(this._config.oauth)?c:c.awsCognito:void 0;if(w){var b=Object.assign({cognitoClientId:s,UserPoolId:o,domain:w.domain,scopes:w.scope,redirectSignIn:w.redirectSignIn,redirectSignOut:w.redirectSignOut,responseType:w.responseType,Storage:this._storage,urlOpener:w.urlOpener,clientMetadata:g},w.options);this._oAuthHandler=new Jn({scopes:b.scopes,config:b,cognitoClientId:b.cognitoClientId});var S={};!function(e){if(C().isBrowser&&window.location)e({url:window.location.href});else if(!C().isNode)throw new Error("Not supported")}(function(e){var n=e.url;S[n]||(S[n]=!0,t._handleAuthResponse(n))})}(ir("configured",null,"The Auth category has been configured successfully"),this.autoSignInInitiated||"function"!=typeof this._storage.getItem)||(this.isTrueStorageValue("amplify-polling-started")&&(ir("autoSignIn_failure",null,i.AutoSignInError),this._storage.removeItem("amplify-auto-sign-in")),this._storage.removeItem("amplify-polling-started"));return this._config},e.prototype.signUp=function(e){for(var t,n,r,o=this,s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];if(!this.userPool)return this.rejectNoUserPool();var u,c=null,l=null,h=[],f=null,d={enabled:!1},p={},g={};if(e&&"string"==typeof e){c=e,l=s?s[0]:null;var y=s?s[1]:null,v=s?s[2]:null;y&&h.push(new _n({Name:"email",Value:y})),v&&h.push(new _n({Name:"phone_number",Value:v}))}else{if(!e||"object"!=typeof e)return this.rejectAuthError(i.SignUpError);c=e.username,l=e.password,e&&e.clientMetadata?u=e.clientMetadata:this._config.clientMetadata&&(u=this._config.clientMetadata);var m=e.attributes;m&&Object.keys(m).map(function(e){h.push(new _n({Name:e,Value:m[e]}))});var w=e.validationData;w&&(f=[],Object.keys(w).map(function(e){f.push(new _n({Name:e,Value:w[e]}))})),(d=null!==(t=e.autoSignIn)&&void 0!==t?t:{enabled:!1}).enabled&&(this._storage.setItem("amplify-auto-sign-in","true"),p=null!==(n=d.validationData)&&void 0!==n?n:{},g=null!==(r=d.clientMetaData)&&void 0!==r?r:{})}return c?l?(tr.debug("signUp attrs:",h),tr.debug("signUp validation data:",f),new Promise(function(e,t){o.userPool.signUp(c,l,h,f,function(n,r){n?(ir("signUp_failure",n,c+" failed to signup"),t(n)):(ir("signUp",r,c+" has signed up successfully"),d.enabled&&o.handleAutoSignIn(c,l,p,g,r),e(r))},u)})):this.rejectAuthError(i.EmptyPassword):this.rejectAuthError(i.EmptyUsername)}
2,e.prototype.handleAutoSignIn=function(e,t,n,r,i){this.autoSignInInitiated=!0;var o=new qt({Username:e,Password:t,ValidationData:n,ClientMetadata:r});i.userConfirmed?this.signInAfterUserConfirmed(o):"link"===this._config.signUpVerificationMethod?this.handleLinkAutoSignIn(o):this.handleCodeAutoSignIn(o)},e.prototype.handleCodeAutoSignIn=function(e){var t=this,n=function(r){"confirmSignUp"===r.payload.event&&t.signInAfterUserConfirmed(e,n)};S.listen("auth",n)},e.prototype.handleLinkAutoSignIn=function(e){var t=this;this._storage.setItem("amplify-polling-started","true");var n=Date.now(),r=setInterval(function(){Date.now()-n>18e4?(clearInterval(r),ir("autoSignIn_failure",null,"Please confirm your account and use your credentials to sign in."),t._storage.removeItem("amplify-auto-sign-in")):t.signInAfterUserConfirmed(e,null,r)},5e3)},e.prototype.signInAfterUserConfirmed=function(e,t,n){return(0,s.__awaiter)(this,void 0,void 0,function(){var r,i,o=this;return(0,s.__generator)(this,function(s){switch(s.label){case 0:r=this.createCognitoUser(e.getUsername()),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r.authenticateUser(e,this.authCallbacks(r,function(r){ir("autoSignIn",r,e.getUsername()+" has signed in successfully"),t&&S.remove("auth",t),n&&(clearInterval(n),o._storage.removeItem("amplify-polling-started")),o._storage.removeItem("amplify-auto-sign-in")},function(e){tr.error(e),o._storage.removeItem("amplify-auto-sign-in")}))];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),tr.error(i),[3,4];case 4:return[2]}})})},e.prototype.confirmSignUp=function(e,t,n){var r=this;if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);var o,s=this.createCognitoUser(e),a=!n||"boolean"!=typeof n.forceAliasCreation||n.forceAliasCreation;return n&&n.clientMetadata?o=n.clientMetadata:this._config.clientMetadata&&(o=this._config.clientMetadata),new Promise(function(n,u){s.confirmRegistration(t,a,function(t,o){t?u(t):(ir("confirmSignUp",o,e+" has been confirmed successfully"),r.isTrueStorageValue("amplify-auto-sign-in")&&!r.autoSignInInitiated&&(ir("autoSignIn_failure",null,i.AutoSignInError),r._storage.removeItem("amplify-auto-sign-in")),n(o))},o)})},e.prototype.isTrueStorageValue=function(e){var t=this._storage.getItem(e);return!!t&&"true"===t},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise(function(e,r){n.resendConfirmationCode(function(t,n){t?r(t):e(n)},t)})},e.prototype.signIn=function(e,t,n){if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var r=null,o=null,s={};if("string"==typeof e)r=e,o=t;else{if(!e.username)return this.rejectAuthError(i.InvalidUsername);void 0!==t&&tr.warn("The password should be defined under the first parameter object!"),r=e.username,o=e.password,s=e.validationData}if(!r)return this.rejectAuthError(i.EmptyUsername);var a=new qt({Username:r,Password:o,ValidationData:s,ClientMetadata:n});return o?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,n){var r=this,i=this;return{onSuccess:function(o){return(0,s.__awaiter)(r,void 0,void 0,function(){var r,a,u,c;return(0,s.__generator)(this,function(s){switch(s.label){case 0:tr.debug(o),delete e.challengeName,delete e.challengeParam,s.label=1;case 1:return s.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return s.sent(),[4,this.Credentials.set(o,"session")];case 3:return r=s.sent(),tr.debug("succeed to get cognito credentials",r),[3,9];case 4:return a=s.sent(),tr.debug("cannot get cognito credentials",a),[3,9];case 5:return s.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return u=s.sent(),i.user=u,ir("signIn",u,"A user "+e.getUsername()+" has been signed in"),t(u),[3,8];case 7:return c=s.sent(),tr.error("Failed to get the signed in user",c),n(c),[3,8];case 8:return[7];case 9:return[2]}})})},onFailure:function(t){tr.debug("signIn failure",t),ir("signIn_failure",t,e.getUsername()+" failed to signin"),n(t)},customChallenge:function(n){tr.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=n,t(e)},mfaRequired:function(n,r){tr.debug("signIn MFA required"),e.challengeName=n,e.challengeParam=r,t(e)},mfaSetup:function(n,r){tr.debug("signIn mfa setup",n),e.challengeName=n,e.challengeParam=r,t(e)},newPasswordRequired:function(n,r){tr.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:n,requiredAttributes:r},t(e)},totpRequired:function(n,r){tr.debug("signIn totpRequired"),e.challengeName=n,e.challengeParam=r,t(e)},selectMFAType:function(n,r){tr.debug("signIn selectMFAType",n),e.challengeName=n,e.challengeParam=r,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this;if(this.pendingSignIn)throw new Error("Pending sign-in attempt already in progress");var n=this.createCognitoUser(e.getUsername());return this.pendingSignIn=new Promise(function(r,i){n.authenticateUser(e,t.authCallbacks(n,function(e){t.pendingSignIn=null,r(e)},function(e){t.pendingSignIn=null,i(e)}))}),this.pendingSignIn},e.prototype.signInWithoutPassword=function(e){var t=this,n=this.createCognitoUser(e.getUsername());return n.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise(function(r,i){n.initiateAuth(e,t.authCallbacks(n,r,i))})},e.prototype.getMFAOptions=function(e){return new Promise(function(t,n){e.getMFAOptions(function(e,r){if(e)return tr.debug("get MFA Options failed",e),void n(e);tr.debug("get MFA options success",r),t(r)})})},e.prototype.getPreferredMFA=function(e,t){var n=this,r=this;return new Promise(function(i,o){var a=n._config.clientMetadata,u=!!t&&t.bypassCache;e.getUserData(function(t,a){return(0,s.__awaiter)(n,void 0,void 0,function(){var n,u;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!t)return[3,5];if(tr.debug("getting preferred mfa failed",t),!this.isSessionInvalid(t))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return s.sent(),[3,4];
2case 3:return n=s.sent(),o(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return o(t),[2];case 5:return(u=r._getMfaTypeFromUserData(a))?(i(u),[2]):(o("invalid MFA Type"),[2])}})})},{bypassCache:u,clientMetadata:a})})},e.prototype._getMfaTypeFromUserData=function(e){var t=null,n=e.PreferredMfaSetting;if(n)t=n;else{var r=e.UserMFASettingList;if(r)0===r.length?t="NOMFA":tr.debug("invalid case for getPreferredMFA",e);else t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){var n=this;return new Promise(function(r,i){e.getUserData(function(t,o){return(0,s.__awaiter)(n,void 0,void 0,function(){var n;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!t)return[3,5];if(tr.debug("getting user data failed",t),!this.isSessionInvalid(t))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return s.sent(),[3,4];case 3:return n=s.sent(),i(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+n.message)),[2];case 4:return i(t),[2];case 5:r(o),s.label=6;case 6:return[2]}})})},t)})},e.prototype.setPreferredMFA=function(e,t){return(0,s.__awaiter)(this,void 0,void 0,function(){var n,r,o,a,u,c,l=this;return(0,s.__generator)(this,function(h){switch(h.label){case 0:return n=this._config.clientMetadata,[4,this._getUserData(e,{bypassCache:!0,clientMetadata:n})];case 1:switch(r=h.sent(),o=null,a=null,t){case"TOTP":case"SOFTWARE_TOKEN_MFA":return[3,2];case"SMS":case"SMS_MFA":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return a={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return u=r.UserMFASettingList,[4,this._getMfaTypeFromUserData(r)];case 5:if("NOMFA"===(c=h.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===c)o={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==c)return[2,this.rejectAuthError(i.InvalidMFA)];a={PreferredMfa:!1,Enabled:!1}}return u&&0!==u.length&&u.forEach(function(e){"SMS_MFA"===e?o={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(a={PreferredMfa:!1,Enabled:!1})}),[3,7];case 6:return tr.debug("no validmfa method provided"),[2,this.rejectAuthError(i.NoMFA)];case 7:return[2,new Promise(function(t,r){e.setUserMfaPreference(o,a,function(i,o){if(i)return tr.debug("Set user mfa preference error",i),r(i);tr.debug("Set user mfa success",o),tr.debug("Caching the latest user data into local"),e.getUserData(function(n,i){return(0,s.__awaiter)(l,void 0,void 0,function(){var i;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!n)return[3,5];if(tr.debug("getting user data failed",n),!this.isSessionInvalid(n))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),r(new Error("Session is invalid due to: "+n.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return[2,r(n)];case 5:return[2,t(o)]}})})},{bypassCache:!0,clientMetadata:n})})})]}})})},e.prototype.disableSMS=function(e){return new Promise(function(t,n){e.disableMFA(function(e,r){if(e)return tr.debug("disable mfa failed",e),void n(e);tr.debug("disable mfa succeed",r),t(r)})})},e.prototype.enableSMS=function(e){return new Promise(function(t,n){e.enableMFA(function(e,r){if(e)return tr.debug("enable mfa failed",e),void n(e);tr.debug("enable mfa succeed",r),t(r)})})},e.prototype.setupTOTP=function(e){return new Promise(function(t,n){e.associateSoftwareToken({onFailure:function(e){tr.debug("associateSoftwareToken failed",e),n(e)},associateSecretCode:function(e){tr.debug("associateSoftwareToken success",e),t(e)}})})},e.prototype.verifyTotpToken=function(e,t){var n;tr.debug("verification totp token",e,t),e&&"function"==typeof e.getSignInUserSession&&(n=e.getSignInUserSession());var r=null==n?void 0:n.isValid();return new Promise(function(n,i){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){tr.debug("verifyTotpToken failed",e),i(e)},onSuccess:function(t){r||ir("signIn",e,"A user "+e.getUsername()+" has been signed in"),ir("verify",e,"A user "+e.getUsername()+" has been verified"),tr.debug("verifyTotpToken success",t),n(t)}})})},e.prototype.confirmSignIn=function(e,t,n,r){var o=this;if(void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyCode);var a=this;return new Promise(function(i,u){e.sendMFACode(t,{onSuccess:function(t){return(0,s.__awaiter)(o,void 0,void 0,function(){var n,r,o,u;return(0,s.__generator)(this,function(s){switch(s.label){case 0:tr.debug(t),s.label=1;case 1:return s.trys.push([1,4,5,10]),[4,this.Credentials.clear()];case 2:return s.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=s.sent(),tr.debug("succeed to get cognito credentials",n),[3,10];case 4:return r=s.sent(),tr.debug("cannot get cognito credentials",r),[3,10];case 5:a.user=e,s.label=6;case 6:return s.trys.push([6,8,,9]),[4,this.currentUserPoolUser()];case 7:return o=s.sent(),e.attributes=o.attributes,[3,9];case 8:return u=s.sent(),tr.debug("cannot get updated Cognito User",u),[3,9];case 9:return ir("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 10:return[2]}})})}
2,onFailure:function(e){tr.debug("confirm signIn failure",e),u(e)}},n,r)})},e.prototype.completeNewPassword=function(e,t,n,r){var o=this;if(void 0===n&&(n={}),void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyPassword);var a=this;return new Promise(function(i,u){e.completeNewPasswordChallenge(t,n,{onSuccess:function(t){return(0,s.__awaiter)(o,void 0,void 0,function(){var n,r;return(0,s.__generator)(this,function(o){switch(o.label){case 0:tr.debug(t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return o.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=o.sent(),tr.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=o.sent(),tr.debug("cannot get cognito credentials",r),[3,6];case 5:return a.user=e,ir("signIn",e,"A user "+e.getUsername()+" has been signed in"),i(e),[7];case 6:return[2]}})})},onFailure:function(e){tr.debug("completeNewPassword failure",e),ir("completeNewPassword_failure",e,o.user+" failed to complete the new password flow"),u(e)},mfaRequired:function(t,n){tr.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=n,i(e)},mfaSetup:function(t,n){tr.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)},totpRequired:function(t,n){tr.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)}},r)})},e.prototype.sendCustomChallengeAnswer=function(e,t,n){var r=this;if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!t)return this.rejectAuthError(i.EmptyChallengeResponse);return new Promise(function(i,o){e.sendCustomChallengeAnswer(t,r.authCallbacks(e,i,o),n)})},e.prototype.deleteUserAttributes=function(e,t){var n=this;return new Promise(function(r,i){n.userSession(e).then(function(n){e.deleteAttributes(t,function(e,t){return e?i(e):r(t)})})})},e.prototype.deleteUser=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t,n=this;return(0,s.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this._storageSync];case 1:return r.sent(),[3,3];case 2:throw e=r.sent(),tr.debug("Failed to sync cache info into memory",e),new Error(e);case 3:return t=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(e,r){return(0,s.__awaiter)(n,void 0,void 0,function(){var n,i=this;return(0,s.__generator)(this,function(o){if(this.userPool){if(!(n=this.userPool.getCurrentUser()))return tr.debug("Failed to get user from user pool"),[2,r(new Error("No current user."))];n.getSession(function(o,a){return(0,s.__awaiter)(i,void 0,void 0,function(){var i,a=this;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!o)return[3,5];if(tr.debug("Failed to get the user session",o),!this.isSessionInvalid(o))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(n)];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),r(new Error("Session is invalid due to: "+o.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return[2,r(o)];case 5:n.deleteUser(function(i,o){if(i)r(i);else{ir("userDeleted",o,"The authenticated user has been deleted."),n.signOut(),a.user=null;try{a.cleanCachedItems()}catch(e){tr.debug("failed to clear cached items")}t?a.oAuthSignOutRedirect(e,r):(ir("signOut",a.user,"A user has been signed out"),e(o))}}),s.label=6;case 6:return[2]}})})})}else tr.debug("no Congito User pool"),r(new Error("Cognito User pool does not exist"));return[2]})})})]}})})},e.prototype.updateUserAttributes=function(e,t,n){var r=this;void 0===n&&(n=this._config.clientMetadata);var i=[],o=this;return new Promise(function(s,a){o.userSession(e).then(function(o){for(var u in t)if("sub"!==u&&u.indexOf("_verified")<0){var c={Name:u,Value:t[u]};i.push(c)}e.updateAttributes(i,function(e,n,i){if(e)return ir("updateUserAttributes_failure",e,"Failed to update attributes"),a(e);var o=r.createUpdateAttributesResultList(t,null==i?void 0:i.CodeDeliveryDetailsList);return ir("updateUserAttributes",o,"Attributes successfully updated"),s(n)},n)})})},e.prototype.createUpdateAttributesResultList=function(e,t){var n={};return Object.keys(e).forEach(function(e){n[e]={isUpdated:!0};var r=null==t?void 0:t.find(function(t){return t.AttributeName===e});r&&(n[e].isUpdated=!1,n[e].codeDeliveryDetails=r)}),n},e.prototype.userAttributes=function(e){var t=this;return new Promise(function(n,r){t.userSession(e).then(function(t){e.getUserAttributes(function(e,t){e?r(e):n(t)})})})},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then(function(e){var n=t.attributesToObject(e),r={},i={};return n.email&&(n.email_verified?i.email=n.email:r.email=n.email),n.phone_number&&(n.phone_number_verified?i.phone_number=n.phone_number:r.phone_number=n.phone_number),{verified:i,unverified:r}})},e.prototype.isErrorWithMessage=function(e){return"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"message")},e.prototype.isTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Access Token has been revoked"===e.message},e.prototype.isRefreshTokenRevokedError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has been revoked"===e.message},e.prototype.isUserDisabledError=function(e){return this.isErrorWithMessage(e)&&"User is disabled."===e.message},e.prototype.isUserDoesNotExistError=function(e){return this.isErrorWithMessage(e)&&"User does not exist."===e.message},e.prototype.isRefreshTokenExpiredError=function(e){return this.isErrorWithMessage(e)&&"Refresh Token has expired"===e.message},e.prototype.isPasswordResetRequiredError=function(e){return this.isErrorWithMessage(e)&&"Password reset required for the user"===e.message},e.prototype.isSignedInHostedUI=function(){return this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI")},e.prototype.isSessionInvalid=function(e){return this.isUserDisabledError(e)||this.isUserDoesNotExistError(e)||this.isTokenRevokedError(e)||this.isRefreshTokenRevokedError(e)||this.isRefreshTokenExpiredError(e)||this.isPasswordResetRequiredError(e)},e.prototype.cleanUpInvalidSession=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t=this;return(0,s.__generator)(this,function(n){switch(n.label){case 0:e.signOut(),this.user=null,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cleanCachedItems()];case 2:return n.sent(),[3,4];case 3:return n.sent(),tr.debug("failed to clear cached items"),[3,4];case 4:return this.isSignedInHostedUI()?[2,new Promise(function(e,n){t.oAuthSignOutRedirect(e,n)})]:(ir("signOut",this.user,"A user has been signed out"),[2])}})})},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise(function(n,r){t._storageSync.then(function(){return(0,s.__awaiter)(t,void 0,void 0,function(){var t,i,o,a,u,c,l=this;return(0,s.__generator)(this,function(h){switch(h.label){case 0:return this.isOAuthInProgress()?(tr.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise(function(e){var t=setTimeout(function(){tr.debug("OAuth signIn in progress timeout"),S.remove("auth",n),e()},1e4);function n(r){var i=r.payload.event;"cognitoHostedUI"!==i&&"cognitoHostedUI_failure"!==i||(tr.debug("OAuth signIn resolved: "+i),clearTimeout(t),S.remove("auth",n),e())}S.listen("auth",n)})]):[3,2];case 1:h.sent(),h.label=2;case 2:if(!(t=this.userPool.getCurrentUser()))return tr.debug("Failed to get user from user pool"),r("No current user"),[2];h.label=3;case 3:return h.trys.push([3,7,,8]),[4,this._userSession(t)];case 4:return i=h.sent(),(o=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,6];case 5:h.sent(),h.label=6;case 6:return a=this._config.clientMetadata,u=i.getAccessToken().decodePayload().scope,(void 0===u?"":u).split(" ").includes(nr)?(t.getUserData(function(e,i){return(0,s.__awaiter)(l,void 0,void 0,function(){var o,a,u,c,l,h,f;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!e)return[3,7];if(tr.debug("getting user data failed",e),!this.isSessionInvalid(e))return[3,5];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return s.sent(),[3,4];
2case 3:return o=s.sent(),r(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+o.message)),[2];case 4:return r(e),[3,6];case 5:n(t),s.label=6;case 6:return[2];case 7:for(a=i.PreferredMfaSetting||"NOMFA",u=[],c=0;c<i.UserAttributes.length;c++)l={Name:i.UserAttributes[c].Name,Value:i.UserAttributes[c].Value},h=new _n(l),u.push(h);return f=this.attributesToObject(u),Object.assign(t,{attributes:f,preferredMFA:a}),[2,n(t)]}})})},{bypassCache:o,clientMetadata:a}),[3,8]):(tr.debug("Unable to get the user data because the "+nr+" is not in the scopes of the access token"),[2,n(t)]);case 7:return c=h.sent(),r(c),[3,8];case 8:return[2]}})})}).catch(function(e){return tr.debug("Failed to sync cache info into memory",e),r(e)})}):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o;return(0,s.__generator)(this,function(a){switch(a.label){case 0:tr.debug("getting current authenticated user"),t=null,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._storageSync];case 2:return a.sent(),[3,4];case 3:throw n=a.sent(),tr.debug("Failed to sync cache info into memory",n),n;case 4:try{(r=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")))&&(t=(0,s.__assign)((0,s.__assign)({},r.user),{token:r.token}))}catch(e){tr.debug("cannot load federated user from auth storage")}return t?(this.user=t,tr.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:tr.debug("get current authenticated userpool user"),i=null,a.label=6;case 6:return a.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return i=a.sent(),[3,9];case 8:return"No userPool"===(o=a.sent())&&tr.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),tr.debug("The user is not authenticated by the error",o),[2,Promise.reject("The user is not authenticated")];case 9:return this.user=i,[2,this.user]}})})},e.prototype.currentSession=function(){var e=this;return tr.debug("Getting current session"),this.userPool?new Promise(function(t,n){e.currentUserPoolUser().then(function(r){e.userSession(r).then(function(e){t(e)}).catch(function(e){tr.debug("Failed to get the current session",e),n(e)})}).catch(function(e){tr.debug("Failed to get the current user",e),n(e)})}):Promise.reject(new Error("No User Pool in the configuration."))},e.prototype._userSession=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r=this;return(0,s.__generator)(this,function(o){switch(o.label){case 0:if(!e)return tr.debug("the user is null"),[2,this.rejectAuthError(i.NoUserSession)];t=this._config.clientMetadata,0===this.inflightSessionPromiseCounter&&(this.inflightSessionPromise=new Promise(function(n,i){e.getSession(function(t,o){return(0,s.__awaiter)(r,void 0,void 0,function(){var r;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!t)return[3,5];if(tr.debug("Failed to get the session from user",e),!this.isSessionInvalid(t))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(e)];case 2:return s.sent(),[3,4];case 3:return r=s.sent(),i(new Error("Session is invalid due to: "+t.message+" and failed to clean up invalid session: "+r.message)),[2];case 4:return i(t),[2];case 5:return tr.debug("Succeed to get the user session",o),n(o),[2]}})})},{clientMetadata:t})})),this.inflightSessionPromiseCounter++,o.label=1;case 1:return o.trys.push([1,,3,4]),[4,this.inflightSessionPromise];case 2:return n=o.sent(),e.signInUserSession=n,[2,n];case 3:return this.inflightSessionPromiseCounter--,[7];case 4:return[2]}})})},e.prototype.userSession=function(e){return this._userSession(e)},e.prototype.currentUserCredentials=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t,n=this;return(0,s.__generator)(this,function(r){switch(r.label){case 0:tr.debug("Getting current user credentials"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),[3,4];case 3:throw e=r.sent(),tr.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(e){tr.debug("failed to get or parse item aws-amplify-federatedInfo",e)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then(function(e){return tr.debug("getting session success",e),n.Credentials.set(e,"session")}
2).catch(function(){return tr.debug("getting guest credentials"),n.Credentials.set(null,"guest")})]}})})},e.prototype.currentCredentials=function(){return tr.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,n){return void 0===n&&(n=this._config.clientMetadata),new Promise(function(r,i){e.getAttributeVerificationCode(t,{onSuccess:function(e){return r(e)},onFailure:function(e){return i(e)}},n)})},e.prototype.verifyUserAttributeSubmit=function(e,t,n){return n?new Promise(function(r,i){e.verifyAttribute(t,n,{onSuccess:function(e){r(e)},onFailure:function(e){i(e)}})}):this.rejectAuthError(i.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then(function(n){return t.verifyUserAttribute(n,e)})},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var n=this;return n.currentUserPoolUser().then(function(r){return n.verifyUserAttributeSubmit(r,e,t)})},e.prototype.cognitoIdentitySignOut=function(e,t){return(0,s.__awaiter)(this,void 0,void 0,function(){var n,r,i=this;return(0,s.__generator)(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._storageSync];case 1:return o.sent(),[3,3];case 2:throw n=o.sent(),tr.debug("Failed to sync cache info into memory",n),n;case 3:return r=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise(function(n,o){if(e&&e.global){tr.debug("user global sign out",t);var a=i._config.clientMetadata;t.getSession(function(e,a){return(0,s.__awaiter)(i,void 0,void 0,function(){var i,a=this;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!e)return[3,5];if(tr.debug("failed to get the user session",e),!this.isSessionInvalid(e))return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.cleanUpInvalidSession(t)];case 2:return s.sent(),[3,4];case 3:return i=s.sent(),o(new Error("Session is invalid due to: "+e.message+" and failed to clean up invalid session: "+i.message)),[2];case 4:return[2,o(e)];case 5:return t.globalSignOut({onSuccess:function(e){if(tr.debug("global sign out success"),!r)return n();a.oAuthSignOutRedirect(n,o)},onFailure:function(e){return tr.debug("global sign out failed",e),o(e)}}),[2]}})})},{clientMetadata:a})}else tr.debug("user sign out",t),t.signOut(function(){if(!r)return n();i.oAuthSignOutRedirect(n,o)})})]}})})},e.prototype.oAuthSignOutRedirect=function(e,t){C().isBrowser?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout(function(){return e(Error("Signout timeout fail"))},3e3)},e.prototype.signOut=function(e){return void 0===e&&(e={}),(0,s.__awaiter)(this,void 0,void 0,function(){var t,n;return(0,s.__generator)(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return r.sent(),[3,3];case 2:return r.sent(),tr.debug("failed to clear cached items"),[3,3];case 3:if(!this.userPool)return[3,11];r.label=4;case 4:return r.trys.push([4,6,,7]),[4,this._storageSync];case 5:return r.sent(),[3,7];case 6:throw t=r.sent(),tr.debug("Failed to sync cache info into memory",t),t;case 7:return(n=this.userPool.getCurrentUser())?[4,this.cognitoIdentitySignOut(e,n)]:[3,9];case 8:return r.sent(),[3,10];case 9:tr.debug("no current Cognito user"),r.label=10;case 10:return[3,12];case 11:tr.debug("no Cognito User pool"),r.label=12;case 12:return ir("signOut",this.user,"A user has been signed out"),this.user=null,[2]}})})},e.prototype.cleanCachedItems=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){return(0,s.__generator)(this,function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}})})},e.prototype.changePassword=function(e,t,n,r){var i=this;return void 0===r&&(r=this._config.clientMetadata),new Promise(function(o,s){i.userSession(e).then(function(i){e.changePassword(t,n,function(e,t){return e?(tr.debug("change password failure",e),s(e)):o(t)},r)})})},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise(function(r,i){n.forgotPassword({onSuccess:function(){r()},onFailure:function(t){tr.debug("forgot password failure",t),ir("forgotPassword_failure",t,e+" forgotPassword failed"),i(t)},inputVerificationCode:function(t){ir("forgotPassword",n,e+" has initiated forgot password flow"),r(t)}},t)})},e.prototype.forgotPasswordSubmit=function(e,t,n,r){if(void 0===r&&(r=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);if(!n)return this.rejectAuthError(i.EmptyPassword);var o=this.createCognitoUser(e);return new Promise(function(i,s){o.confirmPassword(t,n,{onSuccess:function(t){ir("forgotPasswordSubmit",o,e+" forgotPasswordSubmit successful"),i(t)}
2,onFailure:function(t){ir("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),s(t)}},r)})},e.prototype.currentUserInfo=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t,n,r,i,o,a;return(0,s.__generator)(this,function(s){switch(s.label){case 0:return(e=this.Credentials.getCredSource())&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch(function(e){return tr.error(e)})];case 1:if(!(a=s.sent()))return[2,null];s.label=2;case 2:return s.trys.push([2,8,,9]),[4,this.userAttributes(a)];case 3:t=s.sent(),n=this.attributesToObject(t),r=null,s.label=4;case 4:return s.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return r=s.sent(),[3,7];case 6:return i=s.sent(),tr.debug("Failed to retrieve credentials while getting current user info",i),[3,7];case 7:return[2,{id:r?r.identityId:void 0,username:a.getUsername(),attributes:n}];case 8:return o=s.sent(),tr.error("currentUserInfo error",o),[2,{}];case 9:return"federated"===e?[2,(a=this.user)||{}]:[2]}})})},e.prototype.federatedSignIn=function(e,t,n){return(0,s.__awaiter)(this,void 0,void 0,function(){var i,o,c,l,h,f,d,p,g,y,v;return(0,s.__generator)(this,function(s){switch(s.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(void 0===e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return a(e)||(m=e)&&["customProvider"].find(function(e){return m.hasOwnProperty(e)})||function(e){return e&&!!["customState"].find(function(t){return e.hasOwnProperty(t)})}(e)||void 0===e?(i=e||{provider:r.Cognito},h=a(i)?i.provider:i.customProvider,a(i),o=i.customState,this._config.userPoolId&&(c=u(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,l=u(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,l,c,h,o)),[3,4]):[3,1];case 1:h=e;try{(f=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user))&&tr.warn("There is already a signed in user: "+f+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(e){}return d=t.token,p=t.identity_id,g=t.expires_at,[4,this.Credentials.set({provider:h,token:d,identity_id:p,user:n,expires_at:g},"federation")];case 2:return y=s.sent(),[4,this.currentAuthenticatedUser()];case 3:return v=s.sent(),ir("signIn",v,"A user "+v.username+" has been signed in"),tr.debug("federated sign in credentials",y),[2,y];case 4:return[2]}var m})})},e.prototype._handleAuthResponse=function(e){return(0,s.__awaiter)(this,void 0,void 0,function(){var t,n,r,i,o,a,u,c,l,h,f,d,p,g;return(0,s.__generator)(this,function(y){switch(y.label){case 0:if(this.oAuthFlowInProgress)return tr.debug("Skipping URL "+e+" current flow in progress"),[2];y.label=1;case 1:if(y.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(ir("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||(C().isBrowser?window.location.href:""),n=!!((0,Hn.qg)(t).query||"").split("&").map(function(e){return e.split("=")}).find(function(e){var t=(0,s.__read)(e,1)[0];return"code"===t||"error"===t}),r=!!((0,Hn.qg)(t).hash||"#").substr(1).split("&").map(function(e){return e.split("=")}).find(function(e){var t=(0,s.__read)(e,1)[0];return"access_token"===t||"error"===t}),!n&&!r)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),y.label=2;case 2:return y.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return i=y.sent(),o=i.accessToken,a=i.idToken,u=i.refreshToken,c=i.state,l=new mn({IdToken:new gn({IdToken:a}),RefreshToken:new yn({RefreshToken:u}),AccessToken:new dn({AccessToken:o})}),h=void 0,this._config.identityPoolId?[4,this.Credentials.set(l,"session")]:[3,5];case 4:h=y.sent(),tr.debug("AWS credentials",h),y.label=5;case 5:return f=/-/.test(c),(d=this.createCognitoUser(l.getIdToken().decodePayload()["cognito:username"])).setSignInUserSession(l),window&&void 0!==window.history&&window.history.replaceState(window.history.state,"",this._config.oauth.redirectSignIn),ir("signIn",d,"A user "+d.getUsername()+" has been signed in"),ir("cognitoHostedUI",d,"A user "+d.getUsername()+" has been signed in via Cognito Hosted UI"),f&&(p=c.split("-").splice(1).join("-"),ir("customOAuthState",p.match(/.{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""),"State for user "+d.getUsername())),[2,h];case 6:return g=y.sent(),tr.debug("Error in cognito hosted auth response",g),window&&void 0!==window.history&&window.history.replaceState(window.history.state,"",this._config.oauth.redirectSignIn),ir("signIn_failure",g,"The OAuth response flow failed"),ir("cognitoHostedUI_failure",g,"A failure occurred when returning to the Cognito Hosted UI"),ir("customState_failure",g,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}})})},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t=this,n={};return e&&e.map(function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?n[e.Name]=t.isTruthyString(e.Value)||!0===e.Value:n[e.Name]=e.Value}),n},e.prototype.isTruthyString=function(e){return"function"==typeof e.toLowerCase&&"true"===e.toLowerCase()},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var n=this._config.authenticationFlowType,r=new Un(t);return n&&r.setAuthenticationFlowType(n),r},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem&&"function"==typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?i.NoConfig:i.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new Xn(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new Qn(e))},e.prototype.rememberDevice=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:return t=n.sent(),tr.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,n){e.setDeviceStatusRemembered({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?n(new Xn(i.DeviceConfig)):"NetworkError"===e.code?n(new Xn(i.NetworkError)):n(e)}})})]}})})},e.prototype.forgetDevice=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:return t=n.sent(),tr.debug("The user is not authenticated by the error",t),[2,Promise.reject("The user is not authenticated")];case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,n){e.forgetDevice({onSuccess:function(e){t(e)},onFailure:function(e){"InvalidParameterException"===e.code?n(new Xn(i.DeviceConfig)):"NetworkError"===e.code?n(new Xn(i.NetworkError)):n(e)}})})]}})})},e.prototype.fetchDevices=function(){return(0,s.__awaiter)(this,void 0,void 0,function(){var e,t;return(0,s.__generator)(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.currentUserPoolUser()];case 1:return e=n.sent(),[3,3];case 2:throw t=n.sent(),tr.debug("The user is not authenticated by the error",t),new Error("The user is not authenticated");case 3:return e.getCachedDeviceKeyAndPassword(),[2,new Promise(function(t,n){var r={onSuccess:function(e){var n=e.Devices.map(function(e){var t=e.DeviceAttributes.find(function(e){return"device_name"===e.Name})||{};return{id:e.DeviceKey,name:t.Value}});t(n)},onFailure:function(e){"InvalidParameterException"===e.code?n(new Xn(i.DeviceConfig)):"NetworkError"===e.code?n(new Xn(i.NetworkError)):n(e)}};e.listDevices(60,null,r)})]}})})},e}())(null);ce.register(or)},72422:(e,t)=>{"use strict";
2Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},75785:(e,t,n)=>{"use strict";function r(e,t){return t=t||{},new Promise(function(n,r){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){o.push(t=t.toLowerCase()),s.push([t,n]),a[t]=a[t]?a[t]+","+n:n}),n(u())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)})}n.r(t),n.d(t,{default:()=>r})},77947:(e,t)=>{t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=a;l>0;o=256*o+e[t+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),o-=c}return(d?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+d]=255&s,d+=p,s/=256,c-=8);e[n+d-p]|=128*g}},79096:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(68200),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i<r.BLOCK_SIZE;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<r.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(r.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],h=0;h<r.BLOCK_SIZE;h++){if(h<16)this.temp[h]=(255&e[4*h])<<24|(255&e[4*h+1])<<16|(255&e[4*h+2])<<8|255&e[4*h+3];else{var f=this.temp[h-2],d=(f>>>17|f<<15)^(f>>>19|f<<13)^f>>>10,p=((f=this.temp[h-15])>>>7|f<<25)^(f>>>18|f<<14)^f>>>3;this.temp[h]=(d+this.temp[h-7]|0)+(p+this.temp[h-16]|0)}var g=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(l+(r.KEY[h]+this.temp[h]|0)|0)|0,y=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;l=c,c=u,u=a,a=s+g|0,s=o,o=i,i=n,n=g+y|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=l},e}();t.RawSha256=i},84058:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},i=e.length;if(i<2)return n;var o=t&&t.decode||l,s=0,a=0,f=0;do{if(-1===(a=e.indexOf("=",s)))break;if(-1===(f=e.indexOf(";",s)))f=i;else if(a>f){s=e.lastIndexOf(";",a-1)+1;continue}var d=u(e,s,a),p=c(e,a,d),g=e.slice(d,p);if(!r.call(n,g)){var y=u(e,a+1,f),v=c(e,f,y);34===e.charCodeAt(y)&&34===e.charCodeAt(v-1)&&(y++,v--);var m=e.slice(y,v);n[g]=h(m,o)}s=f+1}while(s<i);return n},t.serialize=function(e,t,r){var u=r&&r.encode||encodeURIComponent;if("function"!=typeof u)throw new TypeError("option encode is invali
2d");if(!i.test(e))throw new TypeError("argument name is invalid");var c=u(t);if(!o.test(c))throw new TypeError("argument val is invalid");var l=e+"="+c;if(!r)return l;if(null!=r.maxAge){var h=Math.floor(r.maxAge);if(!isFinite(h))throw new TypeError("option maxAge is invalid");l+="; Max-Age="+h}if(r.domain){if(!s.test(r.domain))throw new TypeError("option domain is invalid");l+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");l+="; Path="+r.path}if(r.expires){var f=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(f)||isNaN(f.valueOf()))throw new TypeError("option expires is invalid");l+="; Expires="+f.toUTCString()}r.httpOnly&&(l+="; HttpOnly");r.secure&&(l+="; Secure");r.partitioned&&(l+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return l};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,i=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,o=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/;function u(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}
vendor: 5,020 bytes, line 2
2function l(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function h(e,t){try{return t(e)}catch(t){return e}}},86033:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(40973);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var i=n(12520);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return i.isEmptyData}});var o=n(72422);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return o.numToUint8}});var s=n(8467);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})},94296:(e,t,n)=>{"use strict";var r=n(35350),i=n(77947),o=n(70934);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n);e=a(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):f(e,t);if("Buffer"===t.type&&o(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(l(t),e=a(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|d(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(r)return K(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var l=-1;for(o=n;o<a;
vendor: 14,436 bytes, line 2
2o++)if(c(e,o)===c(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(e,o+f)!==c(t,f)){h=!1;break}if(h)return o}return-1}function w(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function b(e,t,n,r){return q(K(t,e.length-n),e,n,r)}function S(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return S(e,t,n,r)}function A(e,t,n,r){return q(V(t),e,n,r)}function I(e,t,n,r){return q(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(e){var t=e.length;if(t<=U)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=U));return n}(r)}t.hp=u,t.IS=50,u.TYPED_ARRAY_SUPPORT=void 0!==n.g.TYPED_ARRAY_SUPPORT?n.g.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return h(null,e)},u.allocUnsafeSlow=function(e){return h(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.IS;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(r,i),l=e.slice(t,n),h=0;h<a;++h)if(c[h]!==l[h]){o=c[h],s=l[h];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var U=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function k(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=L(e[o]);return i}function O(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function x(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function F(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||N(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,o){return o||N(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);D(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):x(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):x(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=u.isBuffer(e)?e:K(new u(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function K(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>
vendor: 879 bytes, lines 2-3
2-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}}]); 3//# sourceMappingURL=1367.build.js.map?v=795a16
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.