UNPKG

84.9 kBJavaScriptView Raw
1/*!
2 * Copyright 2016 Amazon.com,
3 * Inc. or its affiliates. All Rights Reserved.
4 *
5 * Licensed under the Amazon Software License (the "License").
6 * You may not use this file except in compliance with the
7 * License. A copy of the License is located at
8 *
9 * http://aws.amazon.com/asl/
10 *
11 * or in the "license" file accompanying this file. This file is
12 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
13 * CONDITIONS OF ANY KIND, express or implied. See the License
14 * for the specific language governing permissions and
15 * limitations under the License.
16 */
17!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AmazonCognitoIdentity=e():t.AmazonCognitoIdentity=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=17)}([function(t,e,n){!function(n,r){t.exports=e=r()}(0,function(){var t=t||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},s=i.Base=function(){return{extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=void 0!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(var s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],i=0;i<e;i+=4){var s=function(e){var e=e,n=987654321,r=4294967295;return function(){n=36969*(65535&n)+(n>>16)&r,e=18e3*(65535&e)+(e>>16)&r;var i=(n<<16)+e&r;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}}(4294967296*(n||t.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,e)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},h=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},f=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=h.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,s=this.blockSize,a=4*s,u=i/a;u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0);var c=u*s,h=t.min(4*c,i);if(c){for(var f=0;f<c;f+=s)this._doProcessBlock(r,f);var l=r.splice(0,c);n.sigBytes-=h}return new o.init(l,h)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),l=(i.Hasher=f.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new l.HMAC.init(t,n).finalize(e)}}}),r.algo={});return r}(Math);return t})},function(t,e,n){"use strict";(function(t){function r(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=s.prototype):(null===t&&(t=new s(e)),t.length=e),t}function s(t,e,n){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return o(this,t,e,n)}function o(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?l(t,e,n,r):"string"==typeof e?h(t,e,n):g(t,e)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e,n,r){return a(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}function c(t,e){if(a(e),t=i(t,e<0?0:0|d(e)),!s.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function h(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!s.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(e,n);t=i(t,r);var o=t.write(e,n);return o!==r&&(t=t.slice(0,o)),t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function l(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),s.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=s.prototype):t=f(t,e),t}function g(t,e){if(s.isBuffer(e)){var n=0|d(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||G(e.length)?i(t,0):f(t,e);if("Buffer"===e.type&&Q(e.data))return f(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),s.alloc(+t)}function v(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Y(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(t).length;default:if(r)return Y(t).length;e=(""+e).toLowerCase(),r=!0}}function y(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return R(this,e,n);case"ascii":return P(this,e,n);case"latin1":case"binary":return b(this,e,n);case"base64":return I(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function S(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.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:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:A(t,e,n,r,i);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):A(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function A(t,e,n,r,i){function s(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}var c;if(i){var h=-1;for(c=n;c<a;c++)if(s(t,c)===s(e,-1===h?0:c-h)){if(-1===h&&(h=c),c-h+1===u)return h*o}else-1!==h&&(c-=c-h),h=-1}else for(n+u>a&&(n=a-u),c=n;c>=0;c--){for(var f=!0,l=0;l<u;l++)if(s(t,c+l)!==s(e,l)){f=!1;break}if(f)return c}return-1}function C(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[n+o]=a}return o}function w(t,e,n,r){return z(Y(e,t.length-n),t,n,r)}function U(t,e,n,r){return z(j(e),t,n,r)}function D(t,e,n,r){return U(t,e,n,r)}function E(t,e,n,r){return z(J(e),t,n,r)}function T(t,e,n,r){return z(W(e,t.length-n),t,n,r)}function I(t,e,n){return 0===e&&n===t.length?Z.fromByteArray(t):Z.fromByteArray(t.slice(e,n))}function R(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var s=t[i],o=null,a=s>239?4:s>223?3:s>191?2:1;if(i+a<=n){var u,c,h,f;switch(a){case 1:s<128&&(o=s);break;case 2:u=t[i+1],128==(192&u)&&(f=(31&s)<<6|63&u)>127&&(o=f);break;case 3:u=t[i+1],c=t[i+2],128==(192&u)&&128==(192&c)&&(f=(15&s)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:u=t[i+1],c=t[i+2],h=t[i+3],128==(192&u)&&128==(192&c)&&128==(192&h)&&(f=(15&s)<<18|(63&u)<<12|(63&c)<<6|63&h)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=a}return _(r)}function _(t){var e=t.length;if(e<=$)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=$));return n}function P(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function b(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function B(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=e;s<n;++s)i+=H(t[s]);return i}function k(t,e,n){for(var r=t.slice(e,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function F(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function x(t,e,n,r,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function M(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i<s;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function O(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i<s;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function N(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,r,i){return i||N(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(t,e,n,r,23,4),n+4}function K(t,e,n,r,i){return i||N(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(t,e,n,r,52,8),n+8}function q(t){if(t=L(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function L(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function Y(t,e){e=e||1/0;for(var n,r=t.length,i=null,s=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function j(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function W(t,e){for(var n,r,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}function J(t){return Z.toByteArray(q(t))}function z(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function G(t){return t!==t}/*!
18 * The buffer module from node.js, for the browser.
19 *
20 * @author Feross Aboukhadijeh <http://feross.org>
21 * @license MIT
22 */
23var Z=n(20),X=n(21),Q=n(22);e.Buffer=s,e.SlowBuffer=p,e.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,n){return o(null,t,e,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,n){return u(null,t,e,n)},s.allocUnsafe=function(t){return c(null,t)},s.allocUnsafeSlow=function(t){return c(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},s.isEncoding=function(t){switch(String(t).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}},s.concat=function(t,e){if(!Q(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=s.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},s.byteLength=v,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)S(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)S(this,e,e+3),S(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)S(this,e,e+7),S(this,e+1,e+6),S(this,e+2,e+5),S(this,e+3,e+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?R(this,0,t):y.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},s.prototype.compare=function(t,e,n,r,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,a=n-e,u=Math.min(o,a),c=this.slice(r,i),h=t.slice(e,n),f=0;f<u;++f)if(c[f]!==h[f]){o=c[f],a=h[f];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},s.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},s.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},s.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return C(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return U(this,t,e,n);case"latin1":case"binary":return D(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;s.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r;if(s.TYPED_ARRAY_SUPPORT)r=this.subarray(t,e),r.__proto__=s.prototype;else{var i=e-t;r=new s(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},s.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r},s.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUInt8=function(t,e){return e||F(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||F(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||F(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||F(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||F(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||F(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*e)),s},s.prototype.readInt8=function(t,e){return e||F(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||F(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||F(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||F(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||F(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||F(t,4,this.length),X.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||F(t,4,this.length),X.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||F(t,8,this.length),X.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||F(t,8,this.length),X.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){x(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},s.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){x(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):O(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);x(this,t,e,n,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<n&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);x(this,t,e,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):M(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):M(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):O(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||x(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):O(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return K(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return K(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},s.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!s.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=s.isBuffer(t)?t:Y(new s(t,r).toString()),u=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%u]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,n(19))},function(t,e,n){"use strict";n.d(e,"a",function(){return d});var r=n(1),i=(n.n(r),n(0)),s=n.n(i),o=n(3),a=(n.n(o),n(4)),u=n.n(a),c=n(5),h=n.n(c),f=n(6),l=function(t){return r.Buffer.from(s.a.lib.WordArray.random(t).toString(),"hex")},g="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",d=function(){function t(t){this.N=new f.a(g,16),this.g=new f.a("2",16),this.k=new f.a(this.hexHash("00"+this.N.toString(16)+"0"+this.g.toString(16)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue(function(){}),this.infoBits=r.Buffer.from("Caldera Derived Key","utf8"),this.poolName=t}var e=t.prototype;return e.getSmallAValue=function(){return this.smallAValue},e.getLargeAValue=function(t){var e=this;this.largeAValue?t(null,this.largeAValue):this.calculateA(this.smallAValue,function(n,r){n&&t(n,null),e.largeAValue=r,t(null,e.largeAValue)})},e.generateRandomSmallA=function(){var t=l(128).toString("hex");return new f.a(t,16).mod(this.N)},e.generateRandomString=function(){return l(40).toString("base64")},e.getRandomPassword=function(){return this.randomPassword},e.getSaltDevices=function(){return this.SaltToHashDevices},e.getVerifierDevices=function(){return this.verifierDevices},e.generateHashDevice=function(t,e,n){var r=this;this.randomPassword=this.generateRandomString();var i=""+t+e+":"+this.randomPassword,s=this.hash(i),o=l(16).toString("hex");this.SaltToHashDevices=this.padHex(new f.a(o,16)),this.g.modPow(new f.a(this.hexHash(this.SaltToHashDevices+s),16),this.N,function(t,e){t&&n(t,null),r.verifierDevices=r.padHex(e),n(null,null)})},e.calculateA=function(t,e){var n=this;this.g.modPow(t,this.N,function(t,r){t&&e(t,null),r.mod(n.N).equals(f.a.ZERO)&&e(new Error("Illegal paramater. A mod N cannot be 0."),null),e(null,r)})},e.calculateU=function(t,e){return this.UHexHash=this.hexHash(this.padHex(t)+this.padHex(e)),new f.a(this.UHexHash,16)},e.hash=function(t){var e=t instanceof r.Buffer?s.a.lib.WordArray.create(t):t,n=u()(e).toString();return new Array(64-n.length).join("0")+n},e.hexHash=function(t){return this.hash(r.Buffer.from(t,"hex"))},e.computehkdf=function(t,e){var n=s.a.lib.WordArray.create(r.Buffer.concat([this.infoBits,r.Buffer.from(String.fromCharCode(1),"utf8")])),i=t instanceof r.Buffer?s.a.lib.WordArray.create(t):t,o=e instanceof r.Buffer?s.a.lib.WordArray.create(e):e,a=h()(i,o),u=h()(n,a);return r.Buffer.from(u.toString(),"hex").slice(0,16)},e.getPasswordAuthenticationKey=function(t,e,n,i,s){var o=this;if(n.mod(this.N).equals(f.a.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,n),this.UValue.equals(f.a.ZERO))throw new Error("U cannot be zero.");var a=""+this.poolName+t+":"+e,u=this.hash(a),c=new f.a(this.hexHash(this.padHex(i)+u),16);this.calculateS(c,n,function(t,e){t&&s(t,null);var n=o.computehkdf(r.Buffer.from(o.padHex(e),"hex"),r.Buffer.from(o.padHex(o.UValue.toString(16)),"hex"));s(null,n)})},e.calculateS=function(t,e,n){var r=this;this.g.modPow(t,this.N,function(i,s){i&&n(i,null),e.subtract(r.k.multiply(s)).modPow(r.smallAValue.add(r.UValue.multiply(t)),r.N,function(t,e){t&&n(t,null),n(null,e.mod(r.N))})})},e.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},e.padHex=function(t){var e=t.toString(16);return e.length%2==1?e="0"+e:-1!=="89ABCDEFabcdef".indexOf(e[0])&&(e="00"+e),e},t}()},function(t,e,n){!function(r,i){t.exports=e=i(n(0))}(0,function(t){return function(){if("function"==typeof ArrayBuffer){var e=t,n=e.lib,r=n.WordArray,i=r.init;(r.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,n=[],r=0;r<e;r++)n[r>>>2]|=t[r]<<24-r%4*8;i.call(this,n,e)}else i.apply(this,arguments)}).prototype=r}}(),t.lib.WordArray})},function(t,e,n){!function(r,i){t.exports=e=i(n(0))}(0,function(t){return function(e){var n=t,r=n.lib,i=r.WordArray,s=r.Hasher,o=n.algo,a=[],u=[];!function(){function t(t){return 4294967296*(t-(0|t))|0}for(var n=2,r=0;r<64;)(function(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0})(n)&&(r<8&&(a[r]=t(e.pow(n,.5))),u[r]=t(e.pow(n,1/3)),r++),n++}();var c=[],h=o.SHA256=s.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],o=n[3],a=n[4],h=n[5],f=n[6],l=n[7],g=0;g<64;g++){if(g<16)c[g]=0|t[e+g];else{var d=c[g-15],p=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,v=c[g-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[g]=p+c[g-7]+y+c[g-16]}var S=a&h^~a&f,m=r&i^r&s^i&s,A=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),C=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),w=l+C+S+u[g]+c[g],U=A+m;l=f,f=h,h=a,a=o+w|0,o=s,s=i,i=r,r=w+U|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+o|0,n[4]=n[4]+a|0,n[5]=n[5]+h|0,n[6]=n[6]+f|0,n[7]=n[7]+l|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=s._createHelper(h),n.HmacSHA256=s._createHmacHelper(h)}(Math),t.SHA256})},function(t,e,n){!function(r,i,s){t.exports=e=i(n(0),n(4),n(23))}(0,function(t){return t.HmacSHA256})},function(t,e,n){"use strict";function r(t,e){null!=t&&this.fromString(t,e)}function i(){return new r(null)}function s(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i}function o(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,h=a*u+c*o;u=o*u+((32767&h)<<15)+n[r]+(1073741823&i),i=(u>>>30)+(h>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i}function a(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,h=a*u+c*o;u=o*u+((16383&h)<<14)+n[r]+i,i=(u>>28)+(h>>14)+a*c,n[r++]=268435455&u}return i}function u(t){return z.charAt(t)}function c(t,e){var n=G[t.charCodeAt(e)];return null==n?-1:n}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function f(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function l(t){var e=i();return e.fromInt(t),e}function g(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var i=t.length,s=!1,o=0;--i>=0;){var a=c(t,i);a<0?"-"==t.charAt(i)&&(s=!0):(s=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}this.clamp(),s&&r.ZERO.subTo(this,this)}function d(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function p(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");e=2}var n,r=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(i=!0,s=u(n));o>=0;)a<e?(n=(this[o]&(1<<a)-1)<<e-a,n|=this[--o]>>(a+=this.DB-e)):(n=this[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=u(n));return i?s:"0"}function v(){var t=i();return r.ZERO.subTo(this,t),t}function y(){return this.s<0?this.negate():this}function S(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0}function m(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function A(){return this.t<=0?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)}function C(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s}function w(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s}function U(t,e){var n,r=t%this.DB,i=this.DB-r,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<<r;for(n=o-1;n>=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function D(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)return void(e.t=0);var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}function E(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()}function T(t,e){var n=this.abs(),i=t.abs(),s=n.t;for(e.t=s+i.t;--s>=0;)e[s]=0;for(s=0;s<i.t;++s)e[s+n.t]=n.am(0,i[s],e,s,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)}function I(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()}function R(t,e,n){var s=t.abs();if(!(s.t<=0)){var o=this.abs();if(o.t<s.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=i());var a=i(),u=this.s,c=t.s,h=this.DB-m(s[s.t-1]);h>0?(s.lShiftTo(h,a),o.lShiftTo(h,n)):(s.copyTo(a),o.copyTo(n));var f=a.t,l=a[f-1];if(0!=l){var g=l*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),d=this.FV/g,p=(1<<this.F1)/g,v=1<<this.F2,y=n.t,S=y-f,A=null==e?i():e;for(a.dlShiftTo(S,A),n.compareTo(A)>=0&&(n[n.t++]=1,n.subTo(A,n)),r.ONE.dlShiftTo(f,A),A.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--S>=0;){var C=n[--y]==l?this.DM:Math.floor(n[y]*d+(n[y-1]+v)*p);if((n[y]+=a.am(0,C,n,S,0,f))<C)for(a.dlShiftTo(S,A),n.subTo(A,n);n[y]<--C;)n.subTo(A,n)}null!=e&&(n.drShiftTo(f,e),u!=c&&r.ZERO.subTo(e,e)),n.t=f,n.clamp(),h>0&&n.rShiftTo(h,n),u<0&&r.ZERO.subTo(n,n)}}}function _(t){var e=i();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e}function P(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function b(t){return 0==this.compareTo(t)}function B(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()}function k(t){var e=i();return this.addTo(t,e),e}function F(t){var e=i();return this.subTo(t,e),e}function x(t){var e=i();return this.multiplyTo(t,e),e}function M(t){var e=i();return this.divRemTo(t,e,null),e}function O(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function N(t){var e=i();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e}function V(t){var e=i();return t.copyTo(e),this.reduce(e),e}function K(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function q(t,e){t.squareTo(e),this.reduce(e)}function L(t,e,n){t.multiplyTo(e,n),this.reduce(n)}function H(t,e,n){var r,s=t.bitLength(),o=l(1),a=new O(e);if(s<=0)return o;r=s<18?1:s<48?3:s<144?4:s<768?5:6;var u=new Array,c=3,h=r-1,f=(1<<r)-1;if(u[1]=a.convert(this),r>1){var g=i();for(a.sqrTo(u[1],g);c<=f;)u[c]=i(),a.mulTo(g,u[c-2],u[c]),c+=2}var d,p,v=t.t-1,y=!0,S=i();for(s=m(t[v])-1;v>=0;){for(s>=h?d=t[v]>>s-h&f:(d=(t[v]&(1<<s+1)-1)<<h-s,v>0&&(d|=t[v-1]>>this.DB+s-h)),c=r;0==(1&d);)d>>=1,--c;if((s-=c)<0&&(s+=this.DB,--v),y)u[d].copyTo(o),y=!1;else{for(;c>1;)a.sqrTo(o,S),a.sqrTo(S,o),c-=2;c>0?a.sqrTo(o,S):(p=o,o=S,S=p),a.mulTo(S,u[d],o)}for(;v>=0&&0==(t[v]&1<<s);)a.sqrTo(o,S),p=o,o=S,S=p,--s<0&&(s=this.DB-1,--v)}var A=a.revert(o);return n(null,A),A}e.a=r;var Y,j="undefined"!=typeof navigator;j&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=o,Y=30):j&&"Netscape"!=navigator.appName?(r.prototype.am=s,Y=26):(r.prototype.am=a,Y=28),r.prototype.DB=Y,r.prototype.DM=(1<<Y)-1,r.prototype.DV=1<<Y;r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-Y,r.prototype.F2=2*Y-52;var W,J,z="0123456789abcdefghijklmnopqrstuvwxyz",G=new Array;for(W="0".charCodeAt(0),J=0;J<=9;++J)G[W++]=J;for(W="a".charCodeAt(0),J=10;J<36;++J)G[W++]=J;for(W="A".charCodeAt(0),J=10;J<36;++J)G[W++]=J;O.prototype.convert=N,O.prototype.revert=V,O.prototype.reduce=K,O.prototype.mulTo=L,O.prototype.sqrTo=q,r.prototype.copyTo=h,r.prototype.fromInt=f,r.prototype.fromString=g,r.prototype.clamp=d,r.prototype.dlShiftTo=C,r.prototype.drShiftTo=w,r.prototype.lShiftTo=U,r.prototype.rShiftTo=D,r.prototype.subTo=E,r.prototype.multiplyTo=T,r.prototype.squareTo=I,r.prototype.divRemTo=R,r.prototype.invDigit=P,r.prototype.addTo=B,r.prototype.toString=p,r.prototype.negate=v,r.prototype.abs=y,r.prototype.compareTo=S,r.prototype.bitLength=A,r.prototype.mod=_,r.prototype.equals=b,r.prototype.add=k,r.prototype.subtract=F,r.prototype.multiply=x,r.prototype.divide=M,r.prototype.modPow=H,r.ZERO=l(0),r.ONE=l(1)},function(t,e,n){"use strict";function r(t){return function(){var e,n=a(t);if(o()){var r=a(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return i(this,e)}}function i(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return h});var c=n(8),h=function(t){function e(e){var n=void 0===e?{}:e,r=n.AccessToken;return t.call(this,r||"")||this}u(e,t);r(e);return e}(c.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(1),i=(n.n(r),function(){function t(t){this.jwtToken=t||"",this.payload=this.decodePayload()}var e=t.prototype;return e.getJwtToken=function(){return this.jwtToken},e.getExpiration=function(){return this.payload.exp},e.getIssuedAt=function(){return this.payload.iat},e.decodePayload=function(){var t=this.jwtToken.split(".")[1];try{return JSON.parse(r.Buffer.from(t,"base64").toString("utf8"))}catch(t){return{}}},t}())},function(t,e,n){"use strict";function r(t){return function(){var e,n=a(t);if(o()){var r=a(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return i(this,e)}}function i(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",function(){return h});var c=n(8),h=function(t){function e(e){var n=void 0===e?{}:e,r=n.IdToken;return t.call(this,r||"")||this}u(e,t);r(e);return e}(c.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r});/*!
24 * Copyright 2016 Amazon.com,
25 * Inc. or its affiliates. All Rights Reserved.
26 *
27 * Licensed under the Amazon Software License (the "License").
28 * You may not use this file except in compliance with the
29 * License. A copy of the License is located at
30 *
31 * http://aws.amazon.com/asl/
32 *
33 * or in the "license" file accompanying this file. This file is
34 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
35 * CONDITIONS OF ANY KIND, express or implied. See the License
36 * for the specific language governing permissions and
37 * limitations under the License.
38 */
39var r=function(){function t(t){var e=void 0===t?{}:t,n=e.RefreshToken;this.token=n||""}return t.prototype.getToken=function(){return this.token},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return w});var r=n(1),i=(n.n(r),n(0)),s=n.n(i),o=n(3),a=(n.n(o),n(24)),u=n.n(a),c=n(5),h=n.n(c),f=n(6),l=n(2),g=n(7),d=n(9),p=n(10),v=n(12),y=n(13),S=n(14),m=n(15),A="undefined"!=typeof navigator,C=A?navigator.userAgent:"nodejs",w=function(){function t(t){if(null==t||null==t.Username||null==t.Pool)throw new Error("Username and pool information are required.");this.username=t.Username||"",this.pool=t.Pool,this.Session=null,this.client=t.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=t.Storage||(new m.a).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var e=t.prototype;return e.setSignInUserSession=function(t){this.clearCachedUserData(),this.signInUserSession=t,this.cacheTokens()},e.getSignInUserSession=function(){return this.signInUserSession},e.getUsername=function(){return this.username},e.getAuthenticationFlowType=function(){return this.authenticationFlowType},e.setAuthenticationFlowType=function(t){this.authenticationFlowType=t},e.initiateAuth=function(t,e){var n=this,r=t.getAuthParameters();r.USERNAME=this.username;var i=0!==Object.keys(t.getValidationData()).length?t.getValidationData():t.getClientMetadata(),s={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:i};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",s,function(t,r){if(t)return e.onFailure(t);var i=r.ChallengeName,s=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,e.customChallenge(s)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))})},e.authenticateUser=function(t,e){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(t,e):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(t,e):e.onFailure(new Error("Authentication flow type is invalid."))},e.authenticateUserDefaultAuth=function(t,e){var n,i,o=this,a=new l.a(this.pool.getUserPoolId().split("_")[1]),c=new y.a,g={};null!=this.deviceKey&&(g.DEVICE_KEY=this.deviceKey),g.USERNAME=this.username,a.getLargeAValue(function(l,d){l&&e.onFailure(l),g.SRP_A=d.toString(16),"CUSTOM_AUTH"===o.authenticationFlowType&&(g.CHALLENGE_NAME="SRP_A");var p=0!==Object.keys(t.getValidationData()).length?t.getValidationData():t.getClientMetadata(),v={AuthFlow:o.authenticationFlowType,ClientId:o.pool.getClientId(),AuthParameters:g,ClientMetadata:p};o.getUserContextData(o.username)&&(v.UserContextData=o.getUserContextData(o.username)),o.client.request("InitiateAuth",v,function(l,g){if(l)return e.onFailure(l);var d=g.ChallengeParameters;o.username=d.USER_ID_FOR_SRP,n=new f.a(d.SRP_B,16),i=new f.a(d.SALT,16),o.getCachedDeviceKeyAndPassword(),a.getPasswordAuthenticationKey(o.username,t.getPassword(),n,i,function(t,n){t&&e.onFailure(t);var i=c.getNowString(),f=s.a.lib.WordArray.create(r.Buffer.concat([r.Buffer.from(o.pool.getUserPoolId().split("_")[1],"utf8"),r.Buffer.from(o.username,"utf8"),r.Buffer.from(d.SECRET_BLOCK,"base64"),r.Buffer.from(i,"utf8")])),l=s.a.lib.WordArray.create(n),v=u.a.stringify(h()(f,l)),y={};y.USERNAME=o.username,y.PASSWORD_CLAIM_SECRET_BLOCK=d.SECRET_BLOCK,y.TIMESTAMP=i,y.PASSWORD_CLAIM_SIGNATURE=v,null!=o.deviceKey&&(y.DEVICE_KEY=o.deviceKey);var S={ChallengeName:"PASSWORD_VERIFIER",ClientId:o.pool.getClientId(),ChallengeResponses:y,Session:g.Session,ClientMetadata:p};o.getUserContextData()&&(S.UserContextData=o.getUserContextData()),function t(e,n){return o.client.request("RespondToAuthChallenge",e,function(r,i){return r&&"ResourceNotFoundException"===r.code&&-1!==r.message.toLowerCase().indexOf("device")?(y.DEVICE_KEY=null,o.deviceKey=null,o.randomPassword=null,o.deviceGroupKey=null,o.clearCachedDeviceKeyAndPassword(),t(e,n)):n(r,i)})}(S,function(t,n){return t?e.onFailure(t):o.authenticateUserInternal(n,a,e)})})})})},e.authenticateUserPlainUsernamePassword=function(t,e){var n=this,r={};if(r.USERNAME=this.username,r.PASSWORD=t.getPassword(),!r.PASSWORD)return void e.onFailure(new Error("PASSWORD parameter is required"));var i=new l.a(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var s=0!==Object.keys(t.getValidationData()).length?t.getValidationData():t.getClientMetadata(),o={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:s};this.getUserContextData(this.username)&&(o.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",o,function(t,r){return t?e.onFailure(t):n.authenticateUserInternal(r,i,e)})},e.authenticateUserInternal=function(t,e,n){var i=this,s=t.ChallengeName,o=t.ChallengeParameters;if("SMS_MFA"===s)return this.Session=t.Session,n.mfaRequired(s,o);if("SELECT_MFA_TYPE"===s)return this.Session=t.Session,n.selectMFAType(s,o);if("MFA_SETUP"===s)return this.Session=t.Session,n.mfaSetup(s,o);if("SOFTWARE_TOKEN_MFA"===s)return this.Session=t.Session,n.totpRequired(s,o);if("CUSTOM_CHALLENGE"===s)return this.Session=t.Session,n.customChallenge(o);if("NEW_PASSWORD_REQUIRED"===s){this.Session=t.Session;var a=null,u=null,c=[],h=e.getNewPasswordRequiredChallengeUserAttributePrefix();if(o&&(a=JSON.parse(t.ChallengeParameters.userAttributes),u=JSON.parse(t.ChallengeParameters.requiredAttributes)),u)for(var f=0;f<u.length;f++)c[f]=u[f].substr(h.length);return n.newPasswordRequired(a,c)}if("DEVICE_SRP_AUTH"===s)return void this.getDeviceResponse(n);this.signInUserSession=this.getCognitoUserSession(t.AuthenticationResult),this.challengeName=s,this.cacheTokens();var l=t.AuthenticationResult.NewDeviceMetadata;if(null==l)return n.onSuccess(this.signInUserSession);e.generateHashDevice(t.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,t.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(s){if(s)return n.onFailure(s);var o={Salt:r.Buffer.from(e.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:r.Buffer.from(e.getVerifierDevices(),"hex").toString("base64")};i.verifierDevices=o.PasswordVerifier,i.deviceGroupKey=l.DeviceGroupKey,i.randomPassword=e.getRandomPassword(),i.client.request("ConfirmDevice",{DeviceKey:l.DeviceKey,AccessToken:i.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:C},function(e,r){return e?n.onFailure(e):(i.deviceKey=t.AuthenticationResult.NewDeviceMetadata.DeviceKey,i.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?n.onSuccess(i.signInUserSession,r.UserConfirmationNecessary):n.onSuccess(i.signInUserSession))})})},e.completeNewPasswordChallenge=function(t,e,n,r){var i=this;if(!t)return n.onFailure(new Error("New password is required."));var s=new l.a(this.pool.getUserPoolId().split("_")[1]),o=s.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};e&&Object.keys(e).forEach(function(t){a[o+t]=e[t]}),a.NEW_PASSWORD=t,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(t,e){return t?n.onFailure(t):i.authenticateUserInternal(e,s,n)})},e.getDeviceResponse=function(t,e){var n=this,i=new l.a(this.deviceGroupKey),o=new y.a,a={};a.USERNAME=this.username,a.DEVICE_KEY=this.deviceKey,i.getLargeAValue(function(c,l){c&&t.onFailure(c),a.SRP_A=l.toString(16);var g={ChallengeName:"DEVICE_SRP_AUTH",ClientId:n.pool.getClientId(),ChallengeResponses:a,ClientMetadata:e};n.getUserContextData()&&(g.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",g,function(e,a){if(e)return t.onFailure(e);var c=a.ChallengeParameters,l=new f.a(c.SRP_B,16),g=new f.a(c.SALT,16);i.getPasswordAuthenticationKey(n.deviceKey,n.randomPassword,l,g,function(e,i){if(e)return t.onFailure(e);var f=o.getNowString(),l=s.a.lib.WordArray.create(r.Buffer.concat([r.Buffer.from(n.deviceGroupKey,"utf8"),r.Buffer.from(n.deviceKey,"utf8"),r.Buffer.from(c.SECRET_BLOCK,"base64"),r.Buffer.from(f,"utf8")])),g=s.a.lib.WordArray.create(i),d=u.a.stringify(h()(l,g)),p={};p.USERNAME=n.username,p.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,p.TIMESTAMP=f,p.PASSWORD_CLAIM_SIGNATURE=d,p.DEVICE_KEY=n.deviceKey;var v={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:p,Session:a.Session};n.getUserContextData()&&(v.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",v,function(e,r){return e?t.onFailure(e):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))})})})})},e.confirmRegistration=function(t,e,n,r){var i={ClientId:this.pool.getClientId(),ConfirmationCode:t,Username:this.username,ForceAliasCreation:e,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",i,function(t){return t?n(t,null):n(null,"SUCCESS")})},e.sendCustomChallengeAnswer=function(t,e,n){var r=this,i={};i.USERNAME=this.username,i.ANSWER=t;var s=new l.a(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(i.DEVICE_KEY=this.deviceKey);var o={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:i,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",o,function(t,n){return t?e.onFailure(t):r.authenticateUserInternal(n,s,e)})},e.sendMFACode=function(t,e,n,i){var s=this,o={};o.USERNAME=this.username,o.SMS_MFA_CODE=t;var a=n||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===a&&(o.SOFTWARE_TOKEN_MFA_CODE=t),null!=this.deviceKey&&(o.DEVICE_KEY=this.deviceKey);var u={ChallengeName:a,ChallengeResponses:o,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:i};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,function(t,n){if(t)return e.onFailure(t);if("DEVICE_SRP_AUTH"===n.ChallengeName)return void s.getDeviceResponse(e);if(s.signInUserSession=s.getCognitoUserSession(n.AuthenticationResult),s.cacheTokens(),null==n.AuthenticationResult.NewDeviceMetadata)return e.onSuccess(s.signInUserSession);var i=new l.a(s.pool.getUserPoolId().split("_")[1]);i.generateHashDevice(n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,n.AuthenticationResult.NewDeviceMetadata.DeviceKey,function(t){if(t)return e.onFailure(t);var o={Salt:r.Buffer.from(i.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:r.Buffer.from(i.getVerifierDevices(),"hex").toString("base64")};s.verifierDevices=o.PasswordVerifier,s.deviceGroupKey=n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,s.randomPassword=i.getRandomPassword(),s.client.request("ConfirmDevice",{DeviceKey:n.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:s.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:C},function(t,r){return t?e.onFailure(t):(s.deviceKey=n.AuthenticationResult.NewDeviceMetadata.DeviceKey,s.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?e.onSuccess(s.signInUserSession,r.UserConfirmationNecessary):e.onSuccess(s.signInUserSession))})})})},e.changePassword=function(t,e,n,r){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:t,ProposedPassword:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:r},function(t){return t?n(t,null):n(null,"SUCCESS")})},e.enableMFA=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);var e=[],n={DeliveryMedium:"SMS",AttributeName:"phone_number"};e.push(n),this.client.request("SetUserSettings",{MFAOptions:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?t(e,null):t(null,"SUCCESS")})},e.setUserMfaPreference=function(t,e,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:t,SoftwareTokenMfaSettings:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?n(t,null):n(null,"SUCCESS")})},e.disableMFA=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);var e=[];this.client.request("SetUserSettings",{MFAOptions:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e){return e?t(e,null):t(null,"SUCCESS")})},e.deleteUser=function(t,e){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:e},function(e){return e?t(e,null):(n.clearCachedUser(),t(null,"SUCCESS"))})},e.updateAttributes=function(t,e,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:t,ClientMetadata:n},function(t){return t?e(t,null):e(null,"SUCCESS")})},e.getUserAttributes=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e,n){if(e)return t(e,null);for(var r=[],i=0;i<n.UserAttributes.length;i++){var s={Name:n.UserAttributes[i].Name,Value:n.UserAttributes[i].Value},o=new S.a(s);r.push(o)}return t(null,r)})},e.getMFAOptions=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e,n){return e?t(e,null):t(null,n.MFAOptions)})},e.getUserData=function(t,e){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),t(new Error("User is not authenticated"),null);var r=!!e&&e.bypassCache,i=this.storage.getItem(this.userDataKey);if(!i||r)this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e,r){if(e)return t(e,null);n.cacheUserData(r);var i=n.signInUserSession.getRefreshToken();if(!i||!i.getToken())return t(null,r);n.refreshSession(i,function(e,n){return e?t(e,null):t(null,r)})});else try{return t(null,JSON.parse(i))}catch(e){return this.clearCachedUserData(),t(e,null)}},e.deleteAttributes=function(t,e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?e(t,null):e(null,"SUCCESS")})},e.resendConfirmationCode=function(t,e){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:e};this.client.request("ResendConfirmationCode",n,function(e,n){return e?t(e,null):t(null,n)})},e.getSession=function(t){if(null==this.username)return t(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return t(null,this.signInUserSession);var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=e+".idToken",r=e+".accessToken",i=e+".refreshToken",s=e+".clockDrift";if(this.storage.getItem(n)){var o=new d.a({IdToken:this.storage.getItem(n)}),a=new g.a({AccessToken:this.storage.getItem(r)}),u=new p.a({RefreshToken:this.storage.getItem(i)}),c=parseInt(this.storage.getItem(s),0)||0,h={IdToken:o,AccessToken:a,RefreshToken:u,ClockDrift:c},f=new v.a(h);if(f.isValid())return this.signInUserSession=f,t(null,this.signInUserSession);if(!u.getToken())return t(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(u,t)}else t(new Error("Local storage is missing an ID Token, Please authenticate"),null)},e.refreshSession=function(t,e,n){var r=this,i={};i.REFRESH_TOKEN=t.getToken();var s="CognitoIdentityServiceProvider."+this.pool.getClientId(),o=s+".LastAuthUser";if(this.storage.getItem(o)){this.username=this.storage.getItem(o);var a=s+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(a),i.DEVICE_KEY=this.deviceKey}var u={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:i,ClientMetadata:n};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",u,function(n,i){if(n)return"NotAuthorizedException"===n.code&&r.clearCachedUser(),e(n,null);if(i){var s=i.AuthenticationResult;return Object.prototype.hasOwnProperty.call(s,"RefreshToken")||(s.RefreshToken=t.getToken()),r.signInUserSession=r.getCognitoUserSession(s),r.cacheTokens(),e(null,r.signInUserSession)}})},e.cacheTokens=function(){var t="CognitoIdentityServiceProvider."+this.pool.getClientId(),e=t+"."+this.username+".idToken",n=t+"."+this.username+".accessToken",r=t+"."+this.username+".refreshToken",i=t+"."+this.username+".clockDrift",s=t+".LastAuthUser";this.storage.setItem(e,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(s,this.username)},e.cacheUserData=function(t){this.storage.setItem(this.userDataKey,JSON.stringify(t))},e.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},e.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},e.cacheDeviceKeyAndPassword=function(){var t="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,e=t+".deviceKey",n=t+".randomPasswordKey",r=t+".deviceGroupKey";this.storage.setItem(e,this.deviceKey),this.storage.setItem(n,this.randomPassword),this.storage.setItem(r,this.deviceGroupKey)},e.getCachedDeviceKeyAndPassword=function(){var t="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,e=t+".deviceKey",n=t+".randomPasswordKey",r=t+".deviceGroupKey";this.storage.getItem(e)&&(this.deviceKey=this.storage.getItem(e),this.randomPassword=this.storage.getItem(n),this.deviceGroupKey=this.storage.getItem(r))},e.clearCachedDeviceKeyAndPassword=function(){var t="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,e=t+".deviceKey",n=t+".randomPasswordKey",r=t+".deviceGroupKey";this.storage.removeItem(e),this.storage.removeItem(n),this.storage.removeItem(r)},e.clearCachedTokens=function(){var t="CognitoIdentityServiceProvider."+this.pool.getClientId(),e=t+"."+this.username+".idToken",n=t+"."+this.username+".accessToken",r=t+"."+this.username+".refreshToken",i=t+".LastAuthUser",s=t+"."+this.username+".clockDrift";this.storage.removeItem(e),this.storage.removeItem(n),this.storage.removeItem(r),this.storage.removeItem(i),this.storage.removeItem(s)},e.getCognitoUserSession=function(t){var e=new d.a(t),n=new g.a(t),r=new p.a(t),i={IdToken:e,AccessToken:n,RefreshToken:r};return new v.a(i)},e.forgotPassword=function(t,e){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:e};this.getUserContextData()&&(n.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",n,function(e,n){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(n):t.onSuccess(n)})},e.confirmPassword=function(t,e,n,r){var i={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:t,Password:e,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",i,function(t){return t?n.onFailure(t):n.onSuccess()})},e.getAttributeVerificationCode=function(t,e,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},function(t,n){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(n):e.onSuccess()})},e.verifyAttribute=function(t,e,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:t,Code:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(t){return t?n.onFailure(t):n.onSuccess("SUCCESS")})},e.getDevice=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},function(e,n){return e?t.onFailure(e):t.onSuccess(n)})},e.forgetSpecificDevice=function(t,e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:t},function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")})},e.forgetDevice=function(t){var e=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:t.onFailure,onSuccess:function(n){return e.deviceKey=null,e.deviceGroupKey=null,e.randomPassword=null,e.clearCachedDeviceKeyAndPassword(),t.onSuccess(n)}})},e.setDeviceStatusRemembered=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")})},e.setDeviceStatusNotRemembered=function(t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")})},e.listDevices=function(t,e,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("ListDevices",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:t,PaginationToken:e},function(t,e){return t?n.onFailure(t):n.onSuccess(e)})},e.globalSignOut=function(t){var e=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(n){return n?t.onFailure(n):(e.clearCachedUser(),t.onSuccess("SUCCESS"))})},e.signOut=function(){this.signInUserSession=null,this.clearCachedUser()},e.sendMFASelectionAnswer=function(t,e){var n=this,r={};r.USERNAME=this.username,r.ANSWER=t;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?e.onFailure(r):(n.Session=i.Session,"SMS_MFA"===t?e.mfaRequired(i.challengeName,i.challengeParameters):"SOFTWARE_TOKEN_MFA"===t?e.totpRequired(i.challengeName,i.challengeParameters):void 0)})},e.getUserContextData=function(){return this.pool.getUserContextData(this.username)},e.associateSoftwareToken=function(t){var e=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},function(e,n){return e?t.onFailure(e):t.associateSecretCode(n.SecretCode)}):this.client.request("AssociateSoftwareToken",{Session:this.Session},function(n,r){return n?t.onFailure(n):(e.Session=r.Session,t.associateSecretCode(r.SecretCode))})},e.verifySoftwareToken=function(t,e,n){var r=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:t,FriendlyDeviceName:e},function(t,e){return t?n.onFailure(t):n.onSuccess(e)}):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:t,FriendlyDeviceName:e},function(t,e){if(t)return n.onFailure(t);r.Session=e.Session;var i={};i.USERNAME=r.username;var s={ChallengeName:"MFA_SETUP",ClientId:r.pool.getClientId(),ChallengeResponses:i,Session:r.Session};r.getUserContextData()&&(s.UserContextData=r.getUserContextData()),r.client.request("RespondToAuthChallenge",s,function(t,e){return t?n.onFailure(t):(r.signInUserSession=r.getCognitoUserSession(e.AuthenticationResult),r.cacheTokens(),n.onSuccess(r.signInUserSession))})})},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});/*!
40 * Copyright 2016 Amazon.com,
41 * Inc. or its affiliates. All Rights Reserved.
42 *
43 * Licensed under the Amazon Software License (the "License").
44 * You may not use this file except in compliance with the
45 * License. A copy of the License is located at
46 *
47 * http://aws.amazon.com/asl/
48 *
49 * or in the "license" file accompanying this file. This file is
50 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
51 * CONDITIONS OF ANY KIND, express or implied. See the License
52 * for the specific language governing permissions and
53 * limitations under the License.
54 */
55var r=function(){function t(t){var e=void 0===t?{}:t,n=e.IdToken,r=e.RefreshToken,i=e.AccessToken,s=e.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===s?this.calculateClockDrift():s}var e=t.prototype;return e.getIdToken=function(){return this.idToken},e.getRefreshToken=function(){return this.refreshToken},e.getAccessToken=function(){return this.accessToken},e.getClockDrift=function(){return this.clockDrift},e.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},e.isValid=function(){var t=Math.floor(new Date/1e3),e=t-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return s});/*!
56 * Copyright 2016 Amazon.com,
57 * Inc. or its affiliates. All Rights Reserved.
58 *
59 * Licensed under the Amazon Software License (the "License").
60 * You may not use this file except in compliance with the
61 * License. A copy of the License is located at
62 *
63 * http://aws.amazon.com/asl/
64 *
65 * or in the "license" file accompanying this file. This file is
66 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
67 * CONDITIONS OF ANY KIND, express or implied. See the License
68 * for the specific language governing permissions and
69 * limitations under the License.
70 */
71var r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],s=function(){function t(){}return t.prototype.getNowString=function(){var t=new Date,e=i[t.getUTCDay()],n=r[t.getUTCMonth()],s=t.getUTCDate(),o=t.getUTCHours();o<10&&(o="0"+o);var a=t.getUTCMinutes();a<10&&(a="0"+a);var u=t.getUTCSeconds();return u<10&&(u="0"+u),e+" "+n+" "+s+" "+o+":"+a+":"+u+" UTC "+t.getUTCFullYear()},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});/*!
72 * Copyright 2016 Amazon.com,
73 * Inc. or its affiliates. All Rights Reserved.
74 *
75 * Licensed under the Amazon Software License (the "License").
76 * You may not use this file except in compliance with the
77 * License. A copy of the License is located at
78 *
79 * http://aws.amazon.com/asl/
80 *
81 * or in the "license" file accompanying this file. This file is
82 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
83 * CONDITIONS OF ANY KIND, express or implied. See the License
84 * for the specific language governing permissions and
85 * limitations under the License.
86 */
87var r=function(){function t(t){var e=void 0===t?{}:t,n=e.Name,r=e.Value;this.Name=n||"",this.Value=r||""}var e=t.prototype;return e.getValue=function(){return this.Value},e.setValue=function(t){return this.Value=t,this},e.getName=function(){return this.Name},e.setName=function(t){return this.Name=t,this},e.toString=function(){return JSON.stringify(this)},e.toJSON=function(){return{Name:this.Name,Value:this.Value}},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return s});/*!
88 * Copyright 2016 Amazon.com,
89 * Inc. or its affiliates. All Rights Reserved.
90 *
91 * Licensed under the Amazon Software License (the "License").
92 * You may not use this file except in compliance with the
93 * License. A copy of the License is located at
94 *
95 * http://aws.amazon.com/asl/
96 *
97 * or in the "license" file accompanying this file. This file is
98 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
99 * CONDITIONS OF ANY KIND, express or implied. See the License
100 * for the specific language governing permissions and
101 * limitations under the License.
102 */
103var r={},i=function(){function t(){}return t.setItem=function(t,e){return r[t]=e,r[t]},t.getItem=function(t){return Object.prototype.hasOwnProperty.call(r,t)?r[t]:void 0},t.removeItem=function(t){return delete r[t]},t.clear=function(){return r={}},t}(),s=function(){function t(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(t){this.storageWindow=i}}return t.prototype.getStorage=function(){return this.storageWindow},t}()},function(t,e,n){"use strict";function r(){}n.d(e,"a",function(){return i}),r.prototype.userAgent="aws-amplify/0.1.x js";var i=function(t){t&&(r.prototype.userAgent&&!r.prototype.userAgent.includes(t)&&(r.prototype.userAgent=r.prototype.userAgent.concat(" ",t)),r.prototype.userAgent&&""!==r.prototype.userAgent||(r.prototype.userAgent=t))};e.b=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(18);n.d(e,"AuthenticationDetails",function(){return r.a});var i=n(2);n.d(e,"AuthenticationHelper",function(){return i.a});var s=n(7);n.d(e,"CognitoAccessToken",function(){return s.a});var o=n(9);n.d(e,"CognitoIdToken",function(){return o.a});var a=n(10);n.d(e,"CognitoRefreshToken",function(){return a.a});var u=n(11);n.d(e,"CognitoUser",function(){return u.a});var c=n(14);n.d(e,"CognitoUserAttribute",function(){return c.a});var h=n(25);n.d(e,"CognitoUserPool",function(){return h.a});var f=n(12);n.d(e,"CognitoUserSession",function(){return f.a});var l=n(27);n.d(e,"CookieStorage",function(){return l.a});var g=n(13);n.d(e,"DateHelper",function(){return g.a});var d=n(16);n.d(e,"appendToCognitoUserAgent",function(){return d.a})},function(t,e,n){"use strict";n.d(e,"a",function(){return r});/*!
104 * Copyright 2016 Amazon.com,
105 * Inc. or its affiliates. All Rights Reserved.
106 *
107 * Licensed under the Amazon Software License (the "License").
108 * You may not use this file except in compliance with the
109 * License. A copy of the License is located at
110 *
111 * http://aws.amazon.com/asl/
112 *
113 * or in the "license" file accompanying this file. This file is
114 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
115 * CONDITIONS OF ANY KIND, express or implied. See the License
116 * for the specific language governing permissions and
117 * limitations under the License.
118 */
119var r=function(){function t(t){var e=t||{},n=e.ValidationData,r=e.Username,i=e.Password,s=e.AuthParameters,o=e.ClientMetadata;this.validationData=n||{},this.authParameters=s||{},this.clientMetadata=o||{},this.username=r,this.password=i}var e=t.prototype;return e.getUsername=function(){return this.username},e.getPassword=function(){return this.password},e.getValidationData=function(){return this.validationData},e.getAuthParameters=function(){return this.authParameters},e.getClientMetadata=function(){return this.clientMetadata},t}()},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";function r(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function i(t){var e=r(t),n=e[0],i=e[1];return 3*(n+i)/4-i}function s(t,e,n){return 3*(e+n)/4-n}function o(t){var e,n,i=r(t),o=i[0],a=i[1],u=new l(s(t,o,a)),c=0,h=a>0?o-4:o;for(n=0;n<h;n+=4)e=f[t.charCodeAt(n)]<<18|f[t.charCodeAt(n+1)]<<12|f[t.charCodeAt(n+2)]<<6|f[t.charCodeAt(n+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;return 2===a&&(e=f[t.charCodeAt(n)]<<2|f[t.charCodeAt(n+1)]>>4,u[c++]=255&e),1===a&&(e=f[t.charCodeAt(n)]<<10|f[t.charCodeAt(n+1)]<<4|f[t.charCodeAt(n+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e),u}function a(t){return h[t>>18&63]+h[t>>12&63]+h[t>>6&63]+h[63&t]}function u(t,e,n){for(var r,i=[],s=e;s<n;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),i.push(a(r));return i.join("")}function c(t){for(var e,n=t.length,r=n%3,i=[],s=0,o=n-r;s<o;s+=16383)i.push(u(t,s,s+16383>o?o:s+16383));return 1===r?(e=t[n-1],i.push(h[e>>2]+h[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],i.push(h[e>>10]+h[e>>4&63]+h[e<<2&63]+"=")),i.join("")}e.byteLength=i,e.toByteArray=o,e.fromByteArray=c;for(var h=[],f=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=g.length;d<p;++d)h[d]=g[d],f[g.charCodeAt(d)]=d;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,c=u>>1,h=-7,f=n?i-1:0,l=n?-1:1,g=t[e+f];for(f+=l,s=g&(1<<-h)-1,g>>=-h,h+=a;h>0;s=256*s+t[e+f],f+=l,h-=8);for(o=s&(1<<-h)-1,s>>=-h,h+=r;h>0;o=256*o+t[e+f],f+=l,h-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,r),s-=c}return(g?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,u,c=8*s-i-1,h=(1<<c)-1,f=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,d=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=h):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),e+=o+f>=1?l/u:l*Math.pow(2,1-f),e*u>=2&&(o++,u/=2),o+f>=h?(a=0,o=h):o+f>=1?(a=(e*u-1)*Math.pow(2,i),o+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[n+g]=255&a,g+=d,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;t[n+g]=255&o,g+=d,o/=256,c-=8);t[n+g-d]|=128*p}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){!function(r,i){t.exports=e=i(n(0))}(0,function(t){!function(){var e=t,n=e.lib,r=n.Base,i=e.enc,s=i.Utf8,o=e.algo;o.HMAC=r.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var n=t.blockSize,r=4*n;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),o=this._iKey=e.clone(),a=i.words,u=o.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;i.sigBytes=o.sigBytes=r,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}})}()})},function(t,e,n){!function(r,i){t.exports=e=i(n(0))}(0,function(t){return function(){function e(t,e,n){for(var r=[],s=0,o=0;o<e;o++)if(o%4){var a=n[t.charCodeAt(o-1)]<<o%4*2,u=n[t.charCodeAt(o)]>>>6-o%4*2;r[s>>>2]|=(a|u)<<24-s%4*8,s++}return i.create(r,s)}var n=t,r=n.lib,i=r.WordArray,s=n.enc;s.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],s=0;s<n;s+=3)for(var o=e[s>>>2]>>>24-s%4*8&255,a=e[s+1>>>2]>>>24-(s+1)%4*8&255,u=e[s+2>>>2]>>>24-(s+2)%4*8&255,c=o<<16|a<<8|u,h=0;h<4&&s+.75*h<n;h++)i.push(r.charAt(c>>>6*(3-h)&63));var f=r.charAt(64);if(f)for(;i.length%4;)i.push(f);return i.join("")},parse:function(t){var n=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var s=0;s<r.length;s++)i[r.charCodeAt(s)]=s}var o=r.charAt(64);if(o){var a=t.indexOf(o);-1!==a&&(n=a)}return e(t,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64})},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(26),i=n(11),s=n(15),o=function(){function t(t){var e=t||{},n=e.UserPoolId,i=e.ClientId,o=e.endpoint,a=e.AdvancedSecurityDataCollectionFlag;if(!n||!i)throw new Error("Both UserPoolId and ClientId are required.");if(!/^[\w-]+_.+$/.test(n))throw new Error("Invalid UserPoolId format.");var u=n.split("_")[0];this.userPoolId=n,this.clientId=i,this.client=new r.a(u,o),this.advancedSecurityDataCollectionFlag=!1!==a,this.storage=t.Storage||(new s.a).getStorage()}var e=t.prototype;return e.getUserPoolId=function(){return this.userPoolId},e.getClientId=function(){return this.clientId},e.signUp=function(t,e,n,r,s,o){var a=this,u={ClientId:this.clientId,Username:t,Password:e,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(t)&&(u.UserContextData=this.getUserContextData(t)),this.client.request("SignUp",u,function(e,n){if(e)return s(e,null);var r={Username:t,Pool:a,Storage:a.storage},o={user:new i.a(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return s(null,o)})},e.getCurrentUser=function(){var t="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",e=this.storage.getItem(t);if(e){var n={Username:e,Pool:this,Storage:this.storage};return new i.a(n)}return null},e.getUserContextData=function(t){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var e=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=e.getData(t,this.userPoolId,this.clientId);if(n){return{EncodedData:n}}}return{}}},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(16),i=function(){function t(t,e){this.endpoint=e||"https://cognito-idp."+t+".amazonaws.com/"}return t.prototype.request=function(t,e,n){var i,s,o={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+t,"X-Amz-User-Agent":r.b.prototype.userAgent},a={headers:o,method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(e)};fetch(this.endpoint,a).then(function(t){return i=t,t},function(t){if(t instanceof TypeError)throw new Error("Network error");throw t}).then(function(t){return t.json().catch(function(){return{}})}).then(function(t){if(i.ok)return n(null,t);s=t;var e=(t.__type||t.code).split("#").pop(),r={code:e,name:e,message:t.message||t.Message||null};return n(r)}).catch(function(t){if(!(i&&i.headers&&i.headers.get("x-amzn-errortype"))){if(t instanceof Error&&"Network error"===t.message){var e={code:"NetworkError",name:t.name,message:t.message};return n(e)}return n(t)}try{var r=i.headers.get("x-amzn-errortype").split(":")[0],s={code:r,name:r,statusCode:i.status,message:i.status?i.status.toString():null};return n(s)}catch(e){return n(t)}})},t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(28),i=(n.n(r),function(){function t(t){if(!t.domain)throw new Error("The domain of cookieStorage can not be undefined.");this.domain=t.domain,t.path?this.path=t.path:this.path="/",Object.prototype.hasOwnProperty.call(t,"expires")?this.expires=t.expires:this.expires=365,Object.prototype.hasOwnProperty.call(t,"secure")?this.secure=t.secure:this.secure=!0}var e=t.prototype;return e.setItem=function(t,e){return r.set(t,e,{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure}),r.get(t)},e.getItem=function(t){return r.get(t)},e.removeItem=function(t){return r.remove(t,{path:this.path,domain:this.domain,secure:this.secure})},e.clear=function(){var t,e=r.get();for(t=0;t<e.length;++t)r.remove(e[t]);return{}},t}())},function(t,e,n){var r,i;!function(s){var o;if(r=s,void 0!==(i="function"==typeof r?r.call(e,n,e,t):r)&&(t.exports=i),o=!0,t.exports=s(),o=!0,!o){var a=window.Cookies,u=window.Cookies=s();u.noConflict=function(){return window.Cookies=a,u}}}(function(){function t(){for(var t=0,e={};t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}function n(r){function i(){}function s(e,n,s){if("undefined"!=typeof document){s=t({path:"/"},i.defaults,s),"number"==typeof s.expires&&(s.expires=new Date(1*new Date+864e5*s.expires)),s.expires=s.expires?s.expires.toUTCString():"";try{var o=JSON.stringify(n);/^[\{\[]/.test(o)&&(n=o)}catch(t){}n=r.write?r.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in s)s[u]&&(a+="; "+u,!0!==s[u]&&(a+="="+s[u].split(";")[0]));return document.cookie=e+"="+n+a}}function o(t,n){if("undefined"!=typeof document){for(var i={},s=document.cookie?document.cookie.split("; "):[],o=0;o<s.length;o++){var a=s[o].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var c=e(a[0]);if(u=(r.read||r)(u,c)||e(u),n)try{u=JSON.parse(u)}catch(t){}if(i[c]=u,t===c)break}catch(t){}}return t?i[t]:i}}return i.set=s,i.get=function(t){return o(t,!1)},i.getJSON=function(t){return o(t,!0)},i.remove=function(e,n){s(e,"",t(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}return n(function(){})})}])});
\No newline at end of file