UNPKG

@knapsack/app

Version:

Build Design Systems on top of knapsack, by Basalt

188 lines • 61.7 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([["vendors~App-7KZ9F~propose-change-page-FI1f0~store-XBI5Y~user-page-DUsdt~9b1fde68"],{"../node_modules/@babel/runtime/helpers/interopRequireDefault.js":function(e,t){e.exports=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}},"../node_modules/@babel/runtime/helpers/taggedTemplateLiteral.js":function(e,t){e.exports=function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},"../node_modules/amazon-cognito-identity-js/es/index.js":function(e,t,n){n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return y})),n.d(t,"c",(function(){return I})),n.d(t,"d",(function(){return D})),n.d(t,"e",(function(){return M})),n.d(t,"f",(function(){return F})),n.d(t,"g",(function(){return V})),n.d(t,"h",(function(){return E})),n.d(t,"i",(function(){return O}));
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var i,s=function(){function AuthenticationDetails(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,AuthenticationDetails);var t=e||{},n=t.ValidationData,i=t.Username,s=t.Password,o=t.AuthParameters,r=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=r||{},this.username=i,this.password=s}return AuthenticationDetails.prototype.getUsername=function getUsername(){return this.username},AuthenticationDetails.prototype.getPassword=function getPassword(){return this.password},AuthenticationDetails.prototype.getValidationData=function getValidationData(){return this.validationData},AuthenticationDetails.prototype.getAuthParameters=function getAuthParameters(){return this.authParameters},AuthenticationDetails.prototype.getClientMetadata=function getClientMetadata(){return this.clientMetadata},AuthenticationDetails}(),o=n("../node_modules/node-libs-browser/node_modules/buffer/index.js"),r=n("../node_modules/crypto-js/core.js"),a=n.n(r),u=(n("../node_modules/crypto-js/lib-typedarrays.js"),n("../node_modules/crypto-js/sha256.js")),c=n.n(u),l=n("../node_modules/crypto-js/hmac-sha256.js"),h=n.n(l),g=BigInteger_BigInteger;function BigInteger_BigInteger(e,t){null!=e&&this.fromString(e,t)}function nbi(){return new BigInteger_BigInteger(null)}var f="undefined"!=typeof navigator;f&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger_BigInteger.prototype.am=function am2(e,t,n,i,s,o){for(var r=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,l=a*u+c*r;s=((u=r*u+((32767&l)<<15)+n[i]+(1073741823&s))>>>30)+(l>>>15)+a*c+(s>>>30),n[i++]=1073741823&u}return s},i=30):f&&"Netscape"!=navigator.appName?(BigInteger_BigInteger.prototype.am=function am1(e,t,n,i,s,o){for(;--o>=0;){var r=t*this[e++]+n[i]+s;s=Math.floor(r/67108864),n[i++]=67108863&r}return s},i=26):(BigInteger_BigInteger.prototype.am=function am3(e,t,n,i,s,o){for(var r=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,l=a*u+c*r;s=((u=r*u+((16383&l)<<14)+n[i]+s)>>28)+(l>>14)+a*c,n[i++]=268435455&u}return s},i=28),BigInteger_BigInteger.prototype.DB=i,BigInteger_BigInteger.prototype.DM=(1<<i)-1,BigInteger_BigInteger.prototype.DV=1<<i;BigInteger_BigInteger.prototype.FV=Math.pow(2,52),BigInteger_BigInteger.prototype.F1=52-i,BigInteger_BigInteger.prototype.F2=2*i-52;var d,p,C="0123456789abcdefghijklmnopqrstuvwxyz",S=new Array;for(d="0".charCodeAt(0),p=0;p<=9;++p)S[d++]=p;for(d="a".charCodeAt(0),p=10;p<36;++p)S[d++]=p;for(d="A".charCodeAt(0),p=10;p<36;++p)S[d++]=p;function int2char(e){return C.charAt(e)}function intAt(e,t){var n=S[e.charCodeAt(t)];return null==n?-1:n}function nbv(e){var t=nbi();return t.fromInt(e),t}function nbits(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 Montgomery(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}Montgomery.prototype.convert=function montConvert(e){var t=nbi();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(BigInteger_BigInteger.ZERO)>0&&this.m.subTo(t,t),t},Montgomery.prototype.revert=function montRevert(e){var t=nbi();return e.copyTo(t),this.reduce(t),t},Montgomery.prototype.reduce=function montReduce(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],i=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,i,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)},Montgomery.prototype.mulTo=function montMulTo(e,t,n){e.multiplyTo(t,n),this.reduce(n)},Montgomery.prototype.sqrTo=function montSqrTo(e,t){e.squareTo(t),this.reduce(t)},BigInteger_BigInteger.prototype.copyTo=function bnpCopyTo(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},BigInteger_BigInteger.prototype.fromInt=function bnpFromInt(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},BigInteger_BigInteger.prototype.fromString=function bnpFromString(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 i=e.length,s=!1,o=0;--i>=0;){var r=intAt(e,i);r<0?"-"==e.charAt(i)&&(s=!0):(s=!1,0==o?this[this.t++]=r:o+n>this.DB?(this[this.t-1]|=(r&(1<<this.DB-o)-1)<<o,this[this.t++]=r>>this.DB-o):this[this.t-1]|=r<<o,(o+=n)>=this.DB&&(o-=this.DB))}this.clamp(),s&&BigInteger_BigInteger.ZERO.subTo(this,this)},BigInteger_BigInteger.prototype.clamp=function bnpClamp(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},BigInteger_BigInteger.prototype.dlShiftTo=function bnpDLShiftTo(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},BigInteger_BigInteger.prototype.drShiftTo=function bnpDRShiftTo(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},BigInteger_BigInteger.prototype.lShiftTo=function bnpLShiftTo(e,t){var n,i=e%this.DB,s=this.DB-i,o=(1<<s)-1,r=Math.floor(e/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+r+1]=this[n]>>s|a,a=(this[n]&o)<<i;for(n=r-1;n>=0;--n)t[n]=0;t[r]=a,t.t=this.t+r+1,t.s=this.s,t.clamp()},BigInteger_BigInteger.prototype.rShiftTo=function bnpRShiftTo(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var i=e%this.DB,s=this.DB-i,o=(1<<i)-1;t[0]=this[n]>>i;for(var r=n+1;r<this.t;++r)t[r-n-1]|=(this[r]&o)<<s,t[r-n]=this[r]>>i;i>0&&(t[this.t-n-1]|=(this.s&o)<<s),t.t=this.t-n,t.clamp()}},BigInteger_BigInteger.prototype.subTo=function bnpSubTo(e,t){for(var n=0,i=0,s=Math.min(e.t,this.t);n<s;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()},BigInteger_BigInteger.prototype.multiplyTo=function bnpMultiplyTo(e,t){var n=this.abs(),i=e.abs(),s=n.t;for(t.t=s+i.t;--s>=0;)t[s]=0;for(s=0;s<i.t;++s)t[s+n.t]=n.am(0,i[s],t,s,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&BigInteger_BigInteger.ZERO.subTo(t,t)},BigInteger_BigInteger.prototype.squareTo=function bnpSquareTo(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 i=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,i,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()},BigInteger_BigInteger.prototype.divRemTo=function bnpDivRemTo(e,t,n){var i=e.abs();if(!(i.t<=0)){var s=this.abs();if(s.t<i.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=nbi());var o=nbi(),r=this.s,a=e.s,u=this.DB-nbits(i[i.t-1]);u>0?(i.lShiftTo(u,o),s.lShiftTo(u,n)):(i.copyTo(o),s.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),g=this.FV/h,f=(1<<this.F1)/h,d=1<<this.F2,p=n.t,C=p-c,S=null==t?nbi():t;for(o.dlShiftTo(C,S),n.compareTo(S)>=0&&(n[n.t++]=1,n.subTo(S,n)),BigInteger_BigInteger.ONE.dlShiftTo(c,S),S.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--C>=0;){var m=n[--p]==l?this.DM:Math.floor(n[p]*g+(n[p-1]+d)*f);if((n[p]+=o.am(0,m,n,C,0,c))<m)for(o.dlShiftTo(C,S),n.subTo(S,n);n[p]<--m;)n.subTo(S,n)}null!=t&&(n.drShiftTo(c,t),r!=a&&BigInteger_BigInteger.ZERO.subTo(t,t)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),r<0&&BigInteger_BigInteger.ZERO.subTo(n,n)}}},BigInteger_BigInteger.prototype.invDigit=function bnpInvDigit(){if(this.t<1)return 0;var e=this[0];if(0==(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},BigInteger_BigInteger.prototype.addTo=function bnpAddTo(e,t){for(var n=0,i=0,s=Math.min(e.t,this.t);n<s;)i+=this[n]+e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i+=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i+=e[n],t[n++]=i&this.DM,i>>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[n++]=i:i<-1&&(t[n++]=this.DV+i),t.t=n,t.clamp()},BigInteger_BigInteger.prototype.toString=function bnToString(e){if(this.s<0)return"-"+this.negate().toString();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,i=(1<<t)-1,s=!1,o="",r=this.t,a=this.DB-r*this.DB%t;if(r-- >0)for(a<this.DB&&(n=this[r]>>a)>0&&(s=!0,o=int2char(n));r>=0;)a<t?(n=(this[r]&(1<<a)-1)<<t-a,n|=this[--r]>>(a+=this.DB-t)):(n=this[r]>>(a-=t)&i,a<=0&&(a+=this.DB,--r)),n>0&&(s=!0),s&&(o+=int2char(n));return s?o:"0"},BigInteger_BigInteger.prototype.negate=function bnNegate(){var e=nbi();return BigInteger_BigInteger.ZERO.subTo(this,e),e},BigInteger_BigInteger.prototype.abs=function bnAbs(){return this.s<0?this.negate():this},BigInteger_BigInteger.prototype.compareTo=function bnCompareTo(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},BigInteger_BigInteger.prototype.bitLength=function bnBitLength(){return this.t<=0?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)},BigInteger_BigInteger.prototype.mod=function bnMod(e){var t=nbi();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(BigInteger_BigInteger.ZERO)>0&&e.subTo(t,t),t},BigInteger_BigInteger.prototype.equals=function bnEquals(e){return 0==this.compareTo(e)},BigInteger_BigInteger.prototype.add=function bnAdd(e){var t=nbi();return this.addTo(e,t),t},BigInteger_BigInteger.prototype.subtract=function bnSubtract(e){var t=nbi();return this.subTo(e,t),t},BigInteger_BigInteger.prototype.multiply=function bnMultiply(e){var t=nbi();return this.multiplyTo(e,t),t},BigInteger_BigInteger.prototype.divide=function bnDivide(e){var t=nbi();return this.divRemTo(e,t,null),t},BigInteger_BigInteger.prototype.modPow=function bnModPow(e,t,n){var i,s=e.bitLength(),o=nbv(1),r=new Montgomery(t);if(s<=0)return o;i=s<18?1:s<48?3:s<144?4:s<768?5:6;var a=new Array,u=3,c=i-1,l=(1<<i)-1;if(a[1]=r.convert(this),i>1){var h=nbi();for(r.sqrTo(a[1],h);u<=l;)a[u]=nbi(),r.mulTo(h,a[u-2],a[u]),u+=2}var g,f,d=e.t-1,p=!0,C=nbi();for(s=nbits(e[d])-1;d>=0;){for(s>=c?g=e[d]>>s-c&l:(g=(e[d]&(1<<s+1)-1)<<c-s,d>0&&(g|=e[d-1]>>this.DB+s-c)),u=i;0==(1&g);)g>>=1,--u;if((s-=u)<0&&(s+=this.DB,--d),p)a[g].copyTo(o),p=!1;else{for(;u>1;)r.sqrTo(o,C),r.sqrTo(C,o),u-=2;u>0?r.sqrTo(o,C):(f=o,o=C,C=f),r.mulTo(C,a[g],o)}for(;d>=0&&0==(e[d]&1<<s);)r.sqrTo(o,C),f=o,o=C,C=f,--s<0&&(s=this.DB-1,--d)}var S=r.revert(o);return n(null,S),S},BigInteger_BigInteger.ZERO=nbv(0),BigInteger_BigInteger.ONE=nbv(1);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var m=function randomBytes(e){return o.Buffer.from(a.a.lib.WordArray.random(e).toString(),"hex")},U="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",A=function(){function AuthenticationHelper(e){!function AuthenticationHelper_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,AuthenticationHelper),this.N=new g(U,16),this.g=new g("2",16),this.k=new g(this.hexHash("00"+this.N.toString(16)+"0"+this.g.toString(16)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue((function(){})),this.infoBits=o.Buffer.from("Caldera Derived Key","utf8"),this.poolName=e}return AuthenticationHelper.prototype.getSmallAValue=function getSmallAValue(){return this.smallAValue},AuthenticationHelper.prototype.getLargeAValue=function getLargeAValue(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,(function(n,i){n&&e(n,null),t.largeAValue=i,e(null,t.largeAValue)}))},AuthenticationHelper.prototype.generateRandomSmallA=function generateRandomSmallA(){var e=m(128).toString("hex");return new g(e,16).mod(this.N)},AuthenticationHelper.prototype.generateRandomString=function generateRandomString(){return m(40).toString("base64")},AuthenticationHelper.prototype.getRandomPassword=function getRandomPassword(){return this.randomPassword},AuthenticationHelper.prototype.getSaltDevices=function getSaltDevices(){return this.SaltToHashDevices},AuthenticationHelper.prototype.getVerifierDevices=function getVerifierDevices(){return this.verifierDevices},AuthenticationHelper.prototype.generateHashDevice=function generateHashDevice(e,t,n){var i=this;this.randomPassword=this.generateRandomString();var s=""+e+t+":"+this.randomPassword,o=this.hash(s),r=m(16).toString("hex");this.SaltToHashDevices=this.padHex(new g(r,16)),this.g.modPow(new g(this.hexHash(this.SaltToHashDevices+o),16),this.N,(function(e,t){e&&n(e,null),i.verifierDevices=i.padHex(t),n(null,null)}))},AuthenticationHelper.prototype.calculateA=function calculateA(e,t){var n=this;this.g.modPow(e,this.N,(function(e,i){e&&t(e,null),i.mod(n.N).equals(g.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,i)}))},AuthenticationHelper.prototype.calculateU=function calculateU(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new g(this.UHexHash,16)},AuthenticationHelper.prototype.hash=function hash(e){var t=e instanceof o.Buffer?a.a.lib.WordArray.create(e):e,n=c()(t).toString();return new Array(64-n.length).join("0")+n},AuthenticationHelper.prototype.hexHash=function hexHash(e){return this.hash(o.Buffer.from(e,"hex"))},AuthenticationHelper.prototype.computehkdf=function computehkdf(e,t){var n=a.a.lib.WordArray.create(o.Buffer.concat([this.infoBits,o.Buffer.from(String.fromCharCode(1),"utf8")])),i=e instanceof o.Buffer?a.a.lib.WordArray.create(e):e,s=t instanceof o.Buffer?a.a.lib.WordArray.create(t):t,r=h()(i,s),u=h()(n,r);return o.Buffer.from(u.toString(),"hex").slice(0,16)},AuthenticationHelper.prototype.getPasswordAuthenticationKey=function getPasswordAuthenticationKey(e,t,n,i,s){var r=this;if(n.mod(this.N).equals(g.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,n),this.UValue.equals(g.ZERO))throw new Error("U cannot be zero.");var a=""+this.poolName+e+":"+t,u=this.hash(a),c=new g(this.hexHash(this.padHex(i)+u),16);this.calculateS(c,n,(function(e,t){e&&s(e,null);var n=r.computehkdf(o.Buffer.from(r.padHex(t),"hex"),o.Buffer.from(r.padHex(r.UValue.toString(16)),"hex"));s(null,n)}))},AuthenticationHelper.prototype.calculateS=function calculateS(e,t,n){var i=this;this.g.modPow(e,this.N,(function(s,o){s&&n(s,null),t.subtract(i.k.multiply(o)).modPow(i.smallAValue.add(i.UValue.multiply(e)),i.N,(function(e,t){e&&n(e,null),n(null,t.mod(i.N))}))}))},AuthenticationHelper.prototype.getNewPasswordRequiredChallengeUserAttributePrefix=function getNewPasswordRequiredChallengeUserAttributePrefix(){return"userAttributes."},AuthenticationHelper.prototype.padHex=function padHex(e){var t=e.toString(16);return t.length%2==1?t="0"+t:-1!=="89ABCDEFabcdef".indexOf(t[0])&&(t="00"+t),t},AuthenticationHelper}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var v=function(){function CognitoJwtToken(e){!function CognitoJwtToken_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoJwtToken),this.jwtToken=e||"",this.payload=this.decodePayload()}return CognitoJwtToken.prototype.getJwtToken=function getJwtToken(){return this.jwtToken},CognitoJwtToken.prototype.getExpiration=function getExpiration(){return this.payload.exp},CognitoJwtToken.prototype.getIssuedAt=function getIssuedAt(){return this.payload.iat},CognitoJwtToken.prototype.decodePayload=function decodePayload(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(o.Buffer.from(e,"base64").toString("utf8"))}catch(e){return{}}},CognitoJwtToken}();var y=function(e){function CognitoAccessToken(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).AccessToken;return function CognitoAccessToken_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoAccessToken),function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,t||""))}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(CognitoAccessToken,e),CognitoAccessToken}(v);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var I=function(e){function CognitoIdToken(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).IdToken;return function CognitoIdToken_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoIdToken),function CognitoIdToken_possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,t||""))}return function CognitoIdToken_inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(CognitoIdToken,e),CognitoIdToken}(v);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var D=function(){function CognitoRefreshToken(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).RefreshToken;!function CognitoRefreshToken_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoRefreshToken),this.token=e||""}return CognitoRefreshToken.prototype.getToken=function getToken(){return this.token},CognitoRefreshToken}(),T=n("../node_modules/crypto-js/enc-base64.js"),w=n.n(T);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var E=function(){function CognitoUserSession(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.IdToken,n=e.RefreshToken,i=e.AccessToken,s=e.ClockDrift;if(function CognitoUserSession_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoUserSession),null==i||null==t)throw new Error("Id token and Access Token must be present.");this.idToken=t,this.refreshToken=n,this.accessToken=i,this.clockDrift=void 0===s?this.calculateClockDrift():s}return CognitoUserSession.prototype.getIdToken=function getIdToken(){return this.idToken},CognitoUserSession.prototype.getRefreshToken=function getRefreshToken(){return this.refreshToken},CognitoUserSession.prototype.getAccessToken=function getAccessToken(){return this.accessToken},CognitoUserSession.prototype.getClockDrift=function getClockDrift(){return this.clockDrift},CognitoUserSession.prototype.calculateClockDrift=function calculateClockDrift(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},CognitoUserSession.prototype.isValid=function isValid(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},CognitoUserSession}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],b=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],B=function(){function DateHelper(){!function DateHelper_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,DateHelper)}return DateHelper.prototype.getNowString=function getNowString(){var e=new Date,t=b[e.getUTCDay()],n=k[e.getUTCMonth()],i=e.getUTCDate(),s=e.getUTCHours();s<10&&(s="0"+s);var o=e.getUTCMinutes();o<10&&(o="0"+o);var r=e.getUTCSeconds();return r<10&&(r="0"+r),t+" "+n+" "+i+" "+s+":"+o+":"+r+" UTC "+e.getUTCFullYear()},DateHelper}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var F=function(){function CognitoUserAttribute(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.Name,n=e.Value;!function CognitoUserAttribute_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoUserAttribute),this.Name=t||"",this.Value=n||""}return CognitoUserAttribute.prototype.getValue=function getValue(){return this.Value},CognitoUserAttribute.prototype.setValue=function setValue(e){return this.Value=e,this},CognitoUserAttribute.prototype.getName=function getName(){return this.Name},CognitoUserAttribute.prototype.setName=function setName(e){return this.Name=e,this},CognitoUserAttribute.prototype.toString=function toString(){return JSON.stringify(this)},CognitoUserAttribute.prototype.toJSON=function toJSON(){return{Name:this.Name,Value:this.Value}},CognitoUserAttribute}();function StorageHelper_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */var P={},_=function(){function MemoryStorage(){StorageHelper_classCallCheck(this,MemoryStorage)}return MemoryStorage.setItem=function setItem(e,t){return P[e]=t,P[e]},MemoryStorage.getItem=function getItem(e){return Object.prototype.hasOwnProperty.call(P,e)?P[e]:void 0},MemoryStorage.removeItem=function removeItem(e){return delete P[e]},MemoryStorage.clear=function clear(){return P={}},MemoryStorage}(),R=function(){function StorageHelper(){StorageHelper_classCallCheck(this,StorageHelper);try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=_}}return StorageHelper.prototype.getStorage=function getStorage(){return this.storageWindow},StorageHelper}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var M=function(){function CognitoUser(e){if(function CognitoUser_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoUser),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 R).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}return CognitoUser.prototype.setSignInUserSession=function setSignInUserSession(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},CognitoUser.prototype.getSignInUserSession=function getSignInUserSession(){return this.signInUserSession},CognitoUser.prototype.getUsername=function getUsername(){return this.username},CognitoUser.prototype.getAuthenticationFlowType=function getAuthenticationFlowType(){return this.authenticationFlowType},CognitoUser.prototype.setAuthenticationFlowType=function setAuthenticationFlowType(e){this.authenticationFlowType=e},CognitoUser.prototype.initiateAuth=function initiateAuth(e,t){var n=this,i=e.getAuthParameters();i.USERNAME=this.username;var s=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:i,ClientMetadata:s};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",o,(function(e,i){if(e)return t.onFailure(e);var s=i.ChallengeName,o=i.ChallengeParameters;return"CUSTOM_CHALLENGE"===s?(n.Session=i.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(i.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))}))},CognitoUser.prototype.authenticateUser=function authenticateUser(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."))},CognitoUser.prototype.authenticateUserDefaultAuth=function authenticateUserDefaultAuth(e,t){var n=this,i=new A(this.pool.getUserPoolId().split("_")[1]),s=new B,r=void 0,u=void 0,c={};null!=this.deviceKey&&(c.DEVICE_KEY=this.deviceKey),c.USERNAME=this.username,i.getLargeAValue((function(l,f){l&&t.onFailure(l),c.SRP_A=f.toString(16),"CUSTOM_AUTH"===n.authenticationFlowType&&(c.CHALLENGE_NAME="SRP_A");var d=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),p={AuthFlow:n.authenticationFlowType,ClientId:n.pool.getClientId(),AuthParameters:c,ClientMetadata:d};n.getUserContextData(n.username)&&(p.UserContextData=n.getUserContextData(n.username)),n.client.request("InitiateAuth",p,(function(c,l){if(c)return t.onFailure(c);var f=l.ChallengeParameters;n.username=f.USER_ID_FOR_SRP,r=new g(f.SRP_B,16),u=new g(f.SALT,16),n.getCachedDeviceKeyAndPassword(),i.getPasswordAuthenticationKey(n.username,e.getPassword(),r,u,(function(e,r){e&&t.onFailure(e);var u=s.getNowString(),c=a.a.lib.WordArray.create(o.Buffer.concat([o.Buffer.from(n.pool.getUserPoolId().split("_")[1],"utf8"),o.Buffer.from(n.username,"utf8"),o.Buffer.from(f.SECRET_BLOCK,"base64"),o.Buffer.from(u,"utf8")])),g=a.a.lib.WordArray.create(r),p=w.a.stringify(h()(c,g)),C={};C.USERNAME=n.username,C.PASSWORD_CLAIM_SECRET_BLOCK=f.SECRET_BLOCK,C.TIMESTAMP=u,C.PASSWORD_CLAIM_SIGNATURE=p,null!=n.deviceKey&&(C.DEVICE_KEY=n.deviceKey);var S={ChallengeName:"PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:C,Session:l.Session,ClientMetadata:d};n.getUserContextData()&&(S.UserContextData=n.getUserContextData()),function respondToAuthChallenge(e,t){return n.client.request("RespondToAuthChallenge",e,(function(i,s){return i&&"ResourceNotFoundException"===i.code&&-1!==i.message.toLowerCase().indexOf("device")?(C.DEVICE_KEY=null,n.deviceKey=null,n.randomPassword=null,n.deviceGroupKey=null,n.clearCachedDeviceKeyAndPassword(),respondToAuthChallenge(e,t)):t(i,s)}))}(S,(function(e,s){return e?t.onFailure(e):n.authenticateUserInternal(s,i,t)}))}))}))}))},CognitoUser.prototype.authenticateUserPlainUsernamePassword=function authenticateUserPlainUsernamePassword(e,t){var n=this,i={};if(i.USERNAME=this.username,i.PASSWORD=e.getPassword(),i.PASSWORD){var s=new A(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(i.DEVICE_KEY=this.deviceKey);var o=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),r={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:i,ClientMetadata:o};this.getUserContextData(this.username)&&(r.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",r,(function(e,i){return e?t.onFailure(e):n.authenticateUserInternal(i,s,t)}))}else t.onFailure(new Error("PASSWORD parameter is required"))},CognitoUser.prototype.authenticateUserInternal=function authenticateUserInternal(e,t,n){var i=this,s=e.ChallengeName,r=e.ChallengeParameters;if("SMS_MFA"===s)return this.Session=e.Session,n.mfaRequired(s,r);if("SELECT_MFA_TYPE"===s)return this.Session=e.Session,n.selectMFAType(s,r);if("MFA_SETUP"===s)return this.Session=e.Session,n.mfaSetup(s,r);if("SOFTWARE_TOKEN_MFA"===s)return this.Session=e.Session,n.totpRequired(s,r);if("CUSTOM_CHALLENGE"===s)return this.Session=e.Session,n.customChallenge(r);if("NEW_PASSWORD_REQUIRED"===s){this.Session=e.Session;var a=null,u=null,c=[],l=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(r&&(a=JSON.parse(e.ChallengeParameters.userAttributes),u=JSON.parse(e.ChallengeParameters.requiredAttributes)),u)for(var h=0;h<u.length;h++)c[h]=u[h].substr(l.length);return n.newPasswordRequired(a,c)}if("DEVICE_SRP_AUTH"!==s){this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=s,this.cacheTokens();var g=e.AuthenticationResult.NewDeviceMetadata;if(null==g)return n.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(s){if(s)return n.onFailure(s);var r={Salt:o.Buffer.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:o.Buffer.from(t.getVerifierDevices(),"hex").toString("base64")};i.verifierDevices=r.PasswordVerifier,i.deviceGroupKey=g.DeviceGroupKey,i.randomPassword=t.getRandomPassword(),i.client.request("ConfirmDevice",{DeviceKey:g.DeviceKey,AccessToken:i.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:r,DeviceName:navigator.userAgent},(function(t,s){return t?n.onFailure(t):(i.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,i.cacheDeviceKeyAndPassword(),!0===s.UserConfirmationNecessary?n.onSuccess(i.signInUserSession,s.UserConfirmationNecessary):n.onSuccess(i.signInUserSession))}))}))}else this.getDeviceResponse(n)},CognitoUser.prototype.completeNewPasswordChallenge=function completeNewPasswordChallenge(e,t,n,i){var s=this;if(!e)return n.onFailure(new Error("New password is required."));var o=new A(this.pool.getUserPoolId().split("_")[1]),r=o.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};t&&Object.keys(t).forEach((function(e){a[r+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:i};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,(function(e,t){return e?n.onFailure(e):s.authenticateUserInternal(t,o,n)}))},CognitoUser.prototype.getDeviceResponse=function getDeviceResponse(e,t){var n=this,i=new A(this.deviceGroupKey),s=new B,r={};r.USERNAME=this.username,r.DEVICE_KEY=this.deviceKey,i.getLargeAValue((function(u,c){u&&e.onFailure(u),r.SRP_A=c.toString(16);var l={ChallengeName:"DEVICE_SRP_AUTH",ClientId:n.pool.getClientId(),ChallengeResponses:r,ClientMetadata:t};n.getUserContextData()&&(l.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",l,(function(t,r){if(t)return e.onFailure(t);var u=r.ChallengeParameters,c=new g(u.SRP_B,16),l=new g(u.SALT,16);i.getPasswordAuthenticationKey(n.deviceKey,n.randomPassword,c,l,(function(t,i){if(t)return e.onFailure(t);var c=s.getNowString(),l=a.a.lib.WordArray.create(o.Buffer.concat([o.Buffer.from(n.deviceGroupKey,"utf8"),o.Buffer.from(n.deviceKey,"utf8"),o.Buffer.from(u.SECRET_BLOCK,"base64"),o.Buffer.from(c,"utf8")])),g=a.a.lib.WordArray.create(i),f=w.a.stringify(h()(l,g)),d={};d.USERNAME=n.username,d.PASSWORD_CLAIM_SECRET_BLOCK=u.SECRET_BLOCK,d.TIMESTAMP=c,d.PASSWORD_CLAIM_SIGNATURE=f,d.DEVICE_KEY=n.deviceKey;var p={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:d,Session:r.Session};n.getUserContextData()&&(p.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",p,(function(t,i){return t?e.onFailure(t):(n.signInUserSession=n.getCognitoUserSession(i.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))}))}))}))}))},CognitoUser.prototype.confirmRegistration=function confirmRegistration(e,t,n,i){var s={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:i};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",s,(function(e){return e?n(e,null):n(null,"SUCCESS")}))},CognitoUser.prototype.sendCustomChallengeAnswer=function sendCustomChallengeAnswer(e,t,n){var i=this,s={};s.USERNAME=this.username,s.ANSWER=e;var o=new A(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(s.DEVICE_KEY=this.deviceKey);var r={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:s,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(r.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",r,(function(e,n){return e?t.onFailure(e):i.authenticateUserInternal(n,o,t)}))},CognitoUser.prototype.sendMFACode=function sendMFACode(e,t,n,i){var s=this,r={};r.USERNAME=this.username,r.SMS_MFA_CODE=e;var a=n||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===a&&(r.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var u={ChallengeName:a,ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:i};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,(function(e,n){if(e)return t.onFailure(e);if("DEVICE_SRP_AUTH"!==n.ChallengeName){if(s.signInUserSession=s.getCognitoUserSession(n.AuthenticationResult),s.cacheTokens(),null==n.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(s.signInUserSession);var i=new A(s.pool.getUserPoolId().split("_")[1]);i.generateHashDevice(n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,n.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(e){if(e)return t.onFailure(e);var r={Salt:o.Buffer.from(i.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:o.Buffer.from(i.getVerifierDevices(),"hex").toString("base64")};s.verifierDevices=r.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:r,DeviceName:navigator.userAgent},(function(e,i){return e?t.onFailure(e):(s.deviceKey=n.AuthenticationResult.NewDeviceMetadata.DeviceKey,s.cacheDeviceKeyAndPassword(),!0===i.UserConfirmationNecessary?t.onSuccess(s.signInUserSession,i.UserConfirmationNecessary):t.onSuccess(s.signInUserSession))}))}))}else s.getDeviceResponse(t)}))},CognitoUser.prototype.changePassword=function changePassword(e,t,n,i){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:i},(function(e){return e?n(e,null):n(null,"SUCCESS")}))},CognitoUser.prototype.enableMFA=function enableMFA(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")}))},CognitoUser.prototype.setUserMfaPreference=function setUserMfaPreference(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")}))},CognitoUser.prototype.disableMFA=function disableMFA(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")}))},CognitoUser.prototype.deleteUser=function deleteUser(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"))}))},CognitoUser.prototype.updateAttributes=function updateAttributes(e,t,n){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){return e?t(e,null):t(null,"SUCCESS")}))},CognitoUser.prototype.getUserAttributes=function getUserAttributes(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 i=[],s=0;s<n.UserAttributes.length;s++){var o={Name:n.UserAttributes[s].Name,Value:n.UserAttributes[s].Value},r=new F(o);i.push(r)}return e(null,i)}))},CognitoUser.prototype.getMFAOptions=function getMFAOptions(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){return t?e(t,null):e(null,n.MFAOptions)}))},CognitoUser.prototype.getUserData=function getUserData(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var i=!!t&&t.bypassCache,s=this.storage.getItem(this.userDataKey);if(!s||i)this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,i){if(t)return e(t,null);n.cacheUserData(i);var s=n.signInUserSession.getRefreshToken();if(!s||!s.getToken())return e(null,i);n.refreshSession(s,(function(t,n){return t?e(t,null):e(null,i)}))}));else try{return e(null,JSON.parse(s))}catch(t){return this.clearCachedUserData(),e(t,null)}},CognitoUser.prototype.deleteAttributes=function deleteAttributes(e,t){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):t(null,"SUCCESS")}))},CognitoUser.prototype.resendConfirmationCode=function resendConfirmationCode(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)}))},CognitoUser.prototype.getSession=function getSession(e){if(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 t="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=t+".idToken",i=t+".accessToken",s=t+".refreshToken",o=t+".clockDrift";if(this.storage.getItem(n)){var r=new I({IdToken:this.storage.getItem(n)}),a=new y({AccessToken:this.storage.getItem(i)}),u=new D({RefreshToken:this.storage.getItem(s)}),c=parseInt(this.storage.getItem(o),0)||0,l=new E({IdToken:r,AccessToken:a,RefreshToken:u,ClockDrift:c});if(l.isValid())return this.signInUserSession=l,e(null,this.signInUserSession);if(!u.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(u,e)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},CognitoUser.prototype.refreshSession=function refreshSession(e,t,n){var i=this,s={};s.REFRESH_TOKEN=e.getToken();var o="CognitoIdentityServiceProvider."+this.pool.getClientId(),r=o+".LastAuthUser";if(this.storage.getItem(r)){this.username=this.storage.getItem(r);var a=o+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(a),s.DEVICE_KEY=this.deviceKey}var u={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:s,ClientMetadata:n};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",u,(function(n,s){if(n)return"NotAuthorizedException"===n.code&&i.clearCachedUser(),t(n,null);if(s){var o=s.AuthenticationResult;return Object.prototype.hasOwnProperty.call(o,"RefreshToken")||(o.RefreshToken=e.getToken()),i.signInUserSession=i.getCognitoUserSession(o),i.cacheTokens(),t(null,i.signInUserSession)}}))},CognitoUser.prototype.cacheTokens=function cacheTokens(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",i=e+"."+this.username+".refreshToken",s=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(i,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(s,""+this.signInUserSession.getClockDrift()),this.storage.setItem(o,this.username)},CognitoUser.prototype.cacheUserData=function cacheUserData(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},CognitoUser.prototype.clearCachedUserData=function clearCachedUserData(){this.storage.removeItem(this.userDataKey)},CognitoUser.prototype.clearCachedUser=function clearCachedUser(){this.clearCachedTokens(),this.clearCachedUserData()},CognitoUser.prototype.cacheDeviceKeyAndPassword=function cacheDeviceKeyAndPassword(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",i=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(n,this.randomPassword),this.storage.setItem(i,this.deviceGroupKey)},CognitoUser.prototype.getCachedDeviceKeyAndPassword=function getCachedDeviceKeyAndPassword(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",i=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(n),this.deviceGroupKey=this.storage.getItem(i))},CognitoUser.prototype.clearCachedDeviceKeyAndPassword=function clearCachedDeviceKeyAndPassword(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",i=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(i)},CognitoUser.prototype.clearCachedTokens=function clearCachedTokens(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",i=e+"."+this.username+".refreshToken",s=e+".LastAuthUser",o=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(i),this.storage.removeItem(s),this.storage.removeItem(o)},CognitoUser.prototype.getCognitoUserSession=function getCognitoUserSession(e){var t=new I(e),n=new y(e),i=new D(e);return new E({IdToken:t,AccessToken:n,RefreshToken:i})},CognitoUser.prototype.forgotPassword=function forgotPassword(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)}))},CognitoUser.prototype.confirmPassword=function confirmPassword(e,t,n,i){var s={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:i};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",s,(function(e){return e?n.onFailure(e):n.onSuccess()}))},CognitoUser.prototype.getAttributeVerificationCode=function getAttributeVerificationCode(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()}))},CognitoUser.prototype.verifyAttribute=function verifyAttribute(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")}))},CognitoUser.prototype.getDevice=function getDevice(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)}))},CognitoUser.prototype.forgetSpecificDevice=function forgetSpecificDevice(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")}))},CognitoUser.prototype.forgetDevice=function forgetDevice(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function onSuccess(n){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(n)}})},CognitoUser.prototype.setDeviceStatusRemembered=function setDeviceStatusRemembered(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")}))},CognitoUser.prototype.setDeviceStatusNotRemembered=function setDeviceStatusNotRemembered(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")}))},CognitoUser.prototype.listDevices=function listDevices(e,t,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:e,PaginationToken:t},(function(e,t){return e?n.onFailure(e):n.onSuccess(t)}))},CognitoUser.prototype.globalSignOut=function globalSignOut(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"))}))},CognitoUser.prototype.signOut=function signOut(){this.signInUserSession=null,this.clearCachedUser()},CognitoUser.prototype.sendMFASelectionAnswer=function sendMFASelectionAnswer(e,t){var n=this,i={};i.USERNAME=this.username,i.ANSWER=e;var s={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:i,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",s,(function(i,s){return i?t.onFailure(i):(n.Session=s.Session,"SMS_MFA"===e?t.mfaRequired(s.challengeName,s.challengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(s.challengeName,s.challengeParameters):void 0)}))},CognitoUser.prototype.getUserContextData=function getUserContextData(){return this.pool.getUserContextData(this.username)},CognitoUser.prototype.associateSoftwareToken=function associateSoftwareToken(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,i){return n?e.onFailure(n):(t.Session=i.Session,e.associateSecretCode(i.SecretCode))}))},CognitoUser.prototype.verifySoftwareToken=function verifySoftwareToken(e,t,n){var i=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);i.Session=t.Session;var s={};s.USERNAME=i.username;var o={ChallengeName:"MFA_SETUP",ClientId:i.pool.getClientId(),ChallengeResponses:s,Session:i.Session};i.getUserContextData()&&(o.UserContextData=i.getUserContextData()),i.client.request("RespondToAuthChallenge",o,(function(e,t){return e?n.onFailure(e):(i.signInUserSession=i.getCognitoUserSession(t.AuthenticationResult),i.cacheTokens(),n.onSuccess(i.signInUserSession))}))}))},CognitoUser}(),N=UserAgent_UserAgent;function UserAgent_UserAgent(){}UserAgent_UserAgent.prototype.userAgent="aws-amplify/0.1.x js";var x=function(){function Client(e,t){!function Client_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Client),this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/",this.userAgent=N.prototype.userAgent||"aws-amplify/0.1.x js"}return Client.prototype.request=function request(e,t,n){var i={headers:{"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":this.userAgent},method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(t)},s=void 0;fetch(this.endpoint,i).then((function(e){return s=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(s.ok)return n(null,e);e;var t=(e.__type||e.code).split("#").pop(),i={code:t,name:t,message:e.message||e.Message||null};return n(i)})).catch((function(e){if(!(s&&s.headers&&s.headers.get("x-amzn-errortype"))){if(e instanceof Error&&"Network error"===e.message){var t={code:"NetworkError",name:e.name,message:e.message};return n(t)}return n(e)}try{var i=s.headers.get("x-amzn-errortype").split(":")[0],o={code:i,name:i,statusCode:s.status,message:s.status?s.status.toString():null};return n(o)}catch(t){return n(e)}}))},Client}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var V=function(){function CognitoUserPool(e){!function CognitoUserPool_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CognitoUserPool);var t=e||{},n=t.UserPoolId,i=t.ClientId,s=t.endpoint,o=t.AdvancedSecurityDataCollectionFlag;if(!n||!i)throw new Error("Both UserPoolId and ClientId are required.");if(!/^[\w-]+_.+$/.test(n))throw new Error("Invalid UserPoolId format.");var r=n.split("_")[0];this.userPoolId=n,this.clientId=i,this.client=new x(r,s),this.advancedSecurityDataCollectionFlag=!1!==o,this.storage=e.Storage||(new R).getStorage()}return CognitoUserPool.prototype.getUserPoolId=function getUserPoolId(){return this.userPoolId},CognitoUserPool.prototype.getClientId=function getClientId(){return this.clientId},CognitoUserPool.prototype.signUp=function signUp(e,t,n,i,s,o){var r=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:i,ClientMetadata:o};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,(function(t,n){if(t)return s(t,null);var i={Username:e,Pool:r,Storage:r.storage},o={user:new M(i),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return s(null,o)}))},CognitoUserPool.prototype.getCurrentUser=function getCurrentUser(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new M(n)}return null},CognitoUserPool.prototype.getUserContextData=function getUserContextData(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{}}},CognitoUserPool}(),K=n("../node_modules/js-cookie/src/js.cookie.js");var O=function(){function CookieStorage(e){if(function CookieStorage_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,CookieStorage),!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");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}return CookieStorage.prototype.setItem=function setItem(e,t){return K.set(e,t,{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure}),K.get(e)},CookieStorage.prototype.getItem=function getItem(e){return K.get(e)},CookieStorage.prototype.removeItem=function removeItem(e){return K.remove(e,{path:this.path,domain:this.domain,secure:this.secure})},CookieStorage.prototype.clear=function clear(){var e=K.get(),t=void 0;for(t=0;t<e.length;++t)K.remove(e[t]);return{}},CookieStorage}()}}]);
//# sourceMappingURL=vendors~App-7KZ9F~propose-change-page-FI1f0~store-XBI5Y~user-page-DUsdt~9b1fde68.chunk.eaa5497fb7f7db0479e3.js.map