@aws-amplify/core 4.5.7 → 4.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.5.8](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/core@4.5.7...@aws-amplify/core@4.5.8) (2022-06-18)
7
+
8
+ **Note:** Version bump only for package @aws-amplify/core
9
+
10
+
11
+
12
+
13
+
6
14
  ## [4.5.7](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/core@4.5.6...@aws-amplify/core@4.5.7) (2022-06-15)
7
15
 
8
16
  **Note:** Version bump only for package @aws-amplify/core
@@ -32745,7 +32745,7 @@ var getAmplifyUserAgent = function getAmplifyUserAgent() {
32745
32745
  __webpack_require__.r(__webpack_exports__);
32746
32746
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version", function() { return version; });
32747
32747
  // generated by genversion
32748
- var version = '4.5.6';
32748
+ var version = '4.5.7';
32749
32749
 
32750
32750
  /***/ }),
32751
32751
 
@@ -28,5 +28,5 @@ var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
28
28
  */
29
29
  var r=n(39),o=n(40),i=n(41);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|h(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):d(e,t);if("Buffer"===t.type&&i(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=s(e,t<0?0:0|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|h(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var f=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*a}else-1!==f&&(i-=i-f),f=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var l=!0,d=0;d<u;d++)if(c(e,i+d)!==c(t,d)){l=!1;break}if(l)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return q(F(t,e.length-n),e,n,r)}function _(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return _(e,t,n,r)}function E(e,t,n,r){return q(D(t),e,n,r)}function x(e,t,n,r){return q(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function A(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function O(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),o+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return f(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),f=e.slice(t,n),l=0;l<s;++l)if(c[l]!==f[l]){i=c[l],a=f[l];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function I(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=U(e[i]);return o}function C(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,i){return i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function z(e,t,n,r,i){return i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||T(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||T(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);T(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);T(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return z(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return z(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:F(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function D(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(10))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),f=0,l=s>0?a-4:a;for(n=0;n<l;n+=4)t=o[e.charCodeAt(n)]<<18|o[e.charCodeAt(n+1)]<<12|o[e.charCodeAt(n+2)]<<6|o[e.charCodeAt(n+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[f++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(f(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function f(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){
30
30
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
31
- t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(0).__exportStar)(n(46),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),o=n(17),i=n(47),a=n(16),s=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(17),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(f+(r.KEY[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;f=c,c=u,u=s,s=a+g|0,a=i,i=o,o=n,n=g+v|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(49),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(0),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);r.__exportStar(n(51),t),r.__exportStar(n(52),t),r.__exportStar(n(53),t),r.__exportStar(n(54),t),r.__exportStar(n(55),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var a=function(){return"function"==typeof Symbol},s=function(e){return a()&&Boolean(Symbol[e])},u=function(e){return s(e)?Symbol[e]:"@@"+e};a()&&!s("observable")&&(Symbol.observable=Symbol("observable"));var c=u("iterator"),f=u("observable"),l=u("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function g(e){g.log?g.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){g(e)}}))}function m(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){g(e)}}function y(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function b(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(y(e),!o)throw n;o.call(r,n);break;case"complete":y(e),o&&o.call(r)}}catch(e){g(e)}"closed"===e._state?m(e):"running"===e._state&&(e._state="ready")}function w(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(b(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void b(e,t,n);e._queue.push({type:t,value:n})}}var _=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new S(this);try{this._cleanup=n.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(y(this),m(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){w(this._subscription,"next",e)}},{key:"error",value:function(e){w(this._subscription,"error",e)}},{key:"complete",value:function(){w(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new _(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=h(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))}},{key:f,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,f);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(s("iterator")&&(r=d(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:f,hostReportError:g},configurable:!0})},function(e,t,n){"use strict";n.r(t),n.d(t,"AmplifyClass",(function(){return y})),n.d(t,"ClientDevice",(function(){return x})),n.d(t,"ConsoleLogger",(function(){return g})),n.d(t,"Logger",(function(){return g})),n.d(t,"missingConfig",(function(){return A})),n.d(t,"invalidParameter",(function(){return O})),n.d(t,"Hub",(function(){return T})),n.d(t,"I18n",(function(){return B})),n.d(t,"isEmpty",(function(){return U.e})),n.d(t,"sortByField",(function(){return U.k})),n.d(t,"objectLessAttributes",(function(){return U.j})),n.d(t,"filenameToContentType",(function(){return U.c})),n.d(t,"isTextFile",(function(){return U.g})),n.d(t,"generateRandomString",(function(){return U.d})),n.d(t,"makeQuerablePromise",(function(){return U.i})),n.d(t,"isWebWorker",(function(){return U.h})),n.d(t,"browserOrNode",(function(){return U.b})),n.d(t,"transferKeyToLowerCase",(function(){return U.l})),n.d(t,"transferKeyToUpperCase",(function(){return U.m})),n.d(t,"isStrictObject",(function(){return U.f})),n.d(t,"JS",(function(){return U.a})),n.d(t,"Signer",(function(){return ue})),n.d(t,"parseMobileHubConfig",(function(){return le})),n.d(t,"Parser",(function(){return de})),n.d(t,"AWSCloudWatchProvider",(function(){return Dc})),n.d(t,"FacebookOAuth",(function(){return Bi})),n.d(t,"GoogleOAuth",(function(){return zi})),n.d(t,"Linking",(function(){return qc})),n.d(t,"AppState",(function(){return Gc})),n.d(t,"AsyncStorage",(function(){return Hc})),n.d(t,"Credentials",(function(){return Mc})),n.d(t,"CredentialsClass",(function(){return Rc})),n.d(t,"ServiceWorker",(function(){return $c})),n.d(t,"StorageHelper",(function(){return vi})),n.d(t,"MemoryStorage",(function(){return gi})),n.d(t,"UniversalStorage",(function(){return Xc})),n.d(t,"Platform",(function(){return w})),n.d(t,"getAmplifyUserAgent",(function(){return _})),n.d(t,"INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",(function(){return ef})),n.d(t,"INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",(function(){return tf})),n.d(t,"USER_AGENT_HEADER",(function(){return nf})),n.d(t,"Constants",(function(){return lf})),n.d(t,"NonRetryableError",(function(){return Ei})),n.d(t,"retry",(function(){return xi})),n.d(t,"jitteredBackoff",(function(){return Ai})),n.d(t,"jitteredExponentialRetry",(function(){return Oi})),n.d(t,"Mutex",(function(){return rf})),n.d(t,"Reachability",(function(){return uf})),n.d(t,"DateUtils",(function(){return V})),n.d(t,"urlSafeEncode",(function(){return cf})),n.d(t,"urlSafeDecode",(function(){return ff})),n.d(t,"AWS_CLOUDWATCH_BASE_BUFFER_SIZE",(function(){return o})),n.d(t,"AWS_CLOUDWATCH_CATEGORY",(function(){return s})),n.d(t,"AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE",(function(){return i})),n.d(t,"AWS_CLOUDWATCH_MAX_EVENT_SIZE",(function(){return a})),n.d(t,"AWS_CLOUDWATCH_PROVIDER_NAME",(function(){return u})),n.d(t,"NO_CREDS_ERROR_STRING",(function(){return c})),n.d(t,"RETRY_ERROR_CODES",(function(){return f})),n.d(t,"Amplify",(function(){return b}));var r,o=26,i=1048576,a=256e3,s="Logging",u="AWSCloudWatch",c="No credentials",f=["ResourceNotFoundException","InvalidSequenceTokenException"],l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},p={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var g=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=this.level;e.LOG_LEVEL&&(s=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(s=window.LOG_LEVEL);var u=p[s],c=p[t];if(c>=u){var f=console.log.bind(console);t===r.ERROR&&console.error&&(f=console.error.bind(console)),t===r.WARN&&console.warn&&(f=console.warn.bind(console));var d="["+t+"] "+this._ts()+" "+this.name,h="";if(1===i.length&&"string"==typeof i[0])f(h=d+" - "+i[0]);else if(1===i.length)h=d+" "+i[0],f(d,i[0]);else if("string"==typeof i[0]){var g=i.slice(1);1===g.length&&(g=g[0]),h=d+" - "+i[0]+" "+g,f(d+" - "+i[0],g)}else h=d+" "+i,f(d,i);try{for(var v=l(this._pluggables),m=v.next();!m.done;m=v.next()){var y=m.value,b={message:h,timestamp:Date.now()};y.pushLogs([b])}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&e.getCategoryName()===s&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}(),v=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=new g("Amplify"),y=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=g,this.ServiceWorker=null}return e.prototype.register=function(e){m.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):m.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),m.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=v(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}(),b=new y,w={userAgent:"aws-amplify/4.5.6 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(w.product=navigator.product||"",w.navigator=navigator||null,navigator.product){case"ReactNative":w.userAgent="aws-amplify/4.5.6 react-native",w.isReactNative=!0;break;default:w.userAgent="aws-amplify/4.5.6 js",w.isReactNative=!1}var _=function(){return w.userAgent},S=new g("ClientDevice_Browser");function E(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return S.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return S.warn("No navigator object available to get browser client info"),{};var t=e.platform,n=e.product,r=e.vendor,o=e.userAgent,i=e.language,a=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var n=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var r=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var o=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(o)return{type:o[1],version:o[2]};var i=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var a=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);if(a)return{type:a[1],version:a[2]};return{type:"",version:""}}(o),s=(u=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),u&&u[1]||"");var u;return{platform:t,make:n||r,model:a.type,version:a.version,appVersion:[a.type,a.version].join("/"),language:i,timezone:s}}()}var x=function(){function e(){}return e.clientInfo=function(){return E()},e.dimension=function(){return"undefined"==typeof window?(S.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}();function A(e){return new Error("Missing config value of "+e)}function O(e){return new Error("Invalid parameter value of "+e)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},I=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(L(arguments[t]));return e},C=new g("Hub"),P="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var T=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void C.warn("No listeners for "+e);this.patterns=I(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void C.warn("No listeners for "+e);this.listeners[e]=I(r.filter((function(e){return e.callback!==t})))}},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===P||C.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var o={channel:e,payload:k({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(e){C.error(e)}},e.prototype.listen=function(e,t,n){var r,o=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))C.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var i=this.listeners[e];i||(i=[],this.listeners[e]=i),i.push({name:n,callback:r})}return function(){o.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){C.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(e){C.error(e)}})),this.patterns.length>0){if(!n.message)return void C.warn("Cannot perform pattern matching without a message key");var o=n.message;this.patterns.forEach((function(t){var n=o.match(t.pattern);if(n){var r=L(n).slice(1),i=k(k({},e),{patternInfo:r});try{t.callback(i)}catch(e){C.error(e)}}}))}},e}())("__default__"),j=new g("I18n"),R=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!=typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),j.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return void 0!==t?t:e;var n=this._lang,r=this.getByLanguage(e,n);return r||(n.indexOf("-")>0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),M=new g("I18n"),N=null,z=null,B=function(){function e(){}return e.configure=function(t){return M.debug("configure I18n"),t?(N=Object.assign({},N,t.I18n||t),e.createInstance(),N):N},e.getModuleName=function(){return"I18n"},e.createInstance=function(){M.debug("create I18n instance"),z||(z=new R(N))},e.setLanguage=function(t){return e.checkConfig(),z.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?z.get(t,n):void 0===n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),z.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),z.putVocabularies(t)},e.checkConfig=function(){return z||(z=new R(N)),!0},e}();b.register(B);for(var U=n(1),F=n(8),D={},q={},G=0;G<256;G++){var H=G.toString(16).toLowerCase();1===H.length&&(H="0"+H),D[G]=H,q[H]=G}function W(e){for(var t="",n=0;n<e.byteLength;n++)t+=D[e[n]];return t}var $=n(3),K=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},V={clockOffset:0,getDateWithClockOffset:function(){return V.clockOffset?new Date((new Date).getTime()+V.clockOffset):new Date},getClockOffset:function(){return V.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=V.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=K(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6];return new Date(Date.UTC(Number(n),Number(r)-1,Number(o),Number(i),Number(a),Number(s)))},isClockSkewed:function(e){return Math.abs(e.getTime()-V.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){V.clockOffset=e}};function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Z=function(){return(Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},J=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},X=new g("Signer"),Q=function(e,t){var n=new F.Sha256(e);return n.update(t),n.digestSync()},ee=function(e){var t=e||"",n=new F.Sha256;return n.update(t),W(n.digestSync())},te=function(e){return Object.keys(e).map((function(e){return e.toLowerCase()})).sort().join(";")},ne=function(e){var t,n,r=Object($.parse)(e.url);return[e.method||"/",encodeURIComponent(r.pathname).replace(/%2F/gi,"/"),(n=r.query,n&&0!==n.length?n.split("&").map((function(e){var t=e.split("=");if(1===t.length)return e;var n=t[1].replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}));return t[0]+"="+n})).sort((function(e,t){var n=e.split("=")[0],r=t.split("=")[0];return n===r?e<t?-1:1:n<r?-1:1})).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map((function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}})).sort((function(e,t){return e.key<t.key?-1:1})).map((function(e){return e.key+":"+e.value})).join("\n")+"\n":""),te(e.headers),ee(e.data)].join("\n")},re=function(e){var t=(Object($.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},oe=function(e,t,n){return[e,t,n,"aws4_request"].join("/")},ie=function(e,t,n,r){return[e,n,r,ee(t)].join("\n")},ae=function(e,t,n){X.debug(n);var r=Q("AWS4"+e,t),o=Q(r,n.region),i=Q(o,n.service);return Q(i,"aws4_request")},se=function(e,t){return W(Q(e,t))},ue=function(){function e(){}return e.sign=function(e,t,n){void 0===n&&(n=null),e.headers=e.headers||{};var r=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),o=r.substr(0,8),i=Object($.parse)(e.url);e.headers.host=i.host,e.headers["x-amz-date"]=r,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var a=ne(e);X.debug(a);var s=n||re(e),u=oe(o,s.region,s.service),c=ie("AWS4-HMAC-SHA256",a,r,u),f=ae(t.secret_key,o,s),l=se(f,c),d=function(e,t,n,r,o){return[e+" Credential="+t+"/"+n,"SignedHeaders="+r,"Signature="+o].join(", ")}("AWS4-HMAC-SHA256",t.access_key,u,te(e.headers),l);return e.headers.Authorization=d,e},e.signUrl=function(e,t,n,r){var o="object"===Y(e)?e.url:e,i="object"===Y(e)?e.method:"GET",a="object"===Y(e)?e.body:void 0,s=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),u=s.substr(0,8),c=Object($.parse)(o,!0,!0),f=(c.search,J(c,["search"])),l={host:f.host},d=n||re({url:Object($.format)(f)}),h=d.region,p=d.service,g=oe(u,h,p),v=t.session_token&&"iotdevicegateway"!==p,m=Z(Z(Z({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":[t.access_key,g].join("/"),"X-Amz-Date":s.substr(0,16)},v?{"X-Amz-Security-Token":""+t.session_token}:{}),r?{"X-Amz-Expires":""+r}:{}),{"X-Amz-SignedHeaders":Object.keys(l).join(",")}),y=ne({method:i,url:Object($.format)(Z(Z({},f),{query:Z(Z({},f.query),m)})),headers:l,data:a}),b=ie("AWS4-HMAC-SHA256",y,s,g),w=ae(t.secret_key,u,{region:h,service:p}),_=se(w,b),S=Z({"X-Amz-Signature":_},t.session_token&&{"X-Amz-Security-Token":t.session_token});return Object($.format)({protocol:f.protocol,slashes:!0,hostname:f.hostname,port:f.port,pathname:f.pathname,query:Z(Z(Z({},f.query),m),S)})},e}(),ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fe=new g("Parser"),le=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=ce(ce({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),fe.debug("parse config",e,"to amplifyconfig",n),n},de=function(){function e(){}return e.parseMobilehubConfig=le,e}(),he=function(e,t){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function pe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ge=function(){return(ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ve(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function me(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function ye(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var be,we,_e,Se,Ee,xe,Ae,Oe,ke,Le,Ie,Ce,Pe,Te,je,Re,Me,Ne,ze,Be,Ue,Fe,De,qe,Ge,He,We,$e,Ke,Ve,Ye,Ze,Je,Xe,Qe,et,tt,nt,rt,ot,it,at,st,ut,ct,ft,lt,dt,ht,pt,gt,vt,mt,yt,bt,wt,_t,St,Et,xt,At,Ot,kt,Lt,It,Ct,Pt,Tt,jt,Rt,Mt,Nt,zt,Bt,Ut,Ft,Dt,qt,Gt,Ht,Wt,$t,Kt,Vt,Yt,Zt,Jt,Xt,Qt,en,tn,nn,rn,on,an,sn,un,cn,fn,ln,dn,hn,pn,gn;Object.create;(be||(be={})).filterSensitiveLog=function(e){return ge({},e)},(we||(we={})).filterSensitiveLog=function(e){return ge({},e)},(_e||(_e={})).filterSensitiveLog=function(e){return ge({},e)},(Se||(Se={})).filterSensitiveLog=function(e){return ge({},e)},(Ee||(Ee={})).filterSensitiveLog=function(e){return ge({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return ge({},e)},(Ae||(Ae={})).filterSensitiveLog=function(e){return ge({},e)},(Oe||(Oe={})).filterSensitiveLog=function(e){return ge({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return ge({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return ge({},e)},(Ie||(Ie={})).filterSensitiveLog=function(e){return ge({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return ge({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return ge({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return ge({},e)},(je||(je={})).filterSensitiveLog=function(e){return ge({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return ge({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return ge({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return ge({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return ge({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return ge({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return ge({},e)},(Fe||(Fe={})).filterSensitiveLog=function(e){return ge({},e)},(De||(De={})).filterSensitiveLog=function(e){return ge({},e)},(qe||(qe={})).filterSensitiveLog=function(e){return ge({},e)},(Ge||(Ge={})).filterSensitiveLog=function(e){return ge({},e)},(He||(He={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.PENDING="PENDING",e.PENDING_CANCEL="PENDING_CANCEL",e.RUNNING="RUNNING"}(We||(We={})),($e||($e={})).filterSensitiveLog=function(e){return ge({},e)},(Ke||(Ke={})).filterSensitiveLog=function(e){return ge({},e)},(Ve||(Ve={})).filterSensitiveLog=function(e){return ge({},e)},(Ye||(Ye={})).filterSensitiveLog=function(e){return ge({},e)},(Ze||(Ze={})).filterSensitiveLog=function(e){return ge({},e)},(Je||(Je={})).filterSensitiveLog=function(e){return ge({},e)},(Xe||(Xe={})).filterSensitiveLog=function(e){return ge({},e)},(Qe||(Qe={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.LastEventTime="LastEventTime",e.LogStreamName="LogStreamName"}(et||(et={})),(tt||(tt={})).filterSensitiveLog=function(e){return ge({},e)},(nt||(nt={})).filterSensitiveLog=function(e){return ge({},e)},(rt||(rt={})).filterSensitiveLog=function(e){return ge({},e)},(ot||(ot={})).filterSensitiveLog=function(e){return ge({},e)},(it||(it={})).filterSensitiveLog=function(e){return ge({},e)},(at||(at={})).filterSensitiveLog=function(e){return ge({},e)},(st||(st={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.Cancelled="Cancelled",e.Complete="Complete",e.Failed="Failed",e.Running="Running",e.Scheduled="Scheduled"}(ut||(ut={})),(ct||(ct={})).filterSensitiveLog=function(e){return ge({},e)},(ft||(ft={})).filterSensitiveLog=function(e){return ge({},e)},(lt||(lt={})).filterSensitiveLog=function(e){return ge({},e)},(dt||(dt={})).filterSensitiveLog=function(e){return ge({},e)},(ht||(ht={})).filterSensitiveLog=function(e){return ge({},e)},(pt||(pt={})).filterSensitiveLog=function(e){return ge({},e)},(gt||(gt={})).filterSensitiveLog=function(e){return ge({},e)},(vt||(vt={})).filterSensitiveLog=function(e){return ge({},e)},(mt||(mt={})).filterSensitiveLog=function(e){return ge({},e)},(yt||(yt={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.ByLogStream="ByLogStream",e.Random="Random"}(bt||(bt={})),(wt||(wt={})).filterSensitiveLog=function(e){return ge({},e)},(_t||(_t={})).filterSensitiveLog=function(e){return ge({},e)},(St||(St={})).filterSensitiveLog=function(e){return ge({},e)},(Et||(Et={})).filterSensitiveLog=function(e){return ge({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return ge({},e)},(At||(At={})).filterSensitiveLog=function(e){return ge({},e)},(Ot||(Ot={})).filterSensitiveLog=function(e){return ge({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return ge({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return ge({},e)},(It||(It={})).filterSensitiveLog=function(e){return ge({},e)},(Ct||(Ct={})).filterSensitiveLog=function(e){return ge({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return ge({},e)},(Tt||(Tt={})).filterSensitiveLog=function(e){return ge({},e)},(jt||(jt={})).filterSensitiveLog=function(e){return ge({},e)},(Rt||(Rt={})).filterSensitiveLog=function(e){return ge({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return ge({},e)},(Nt||(Nt={})).filterSensitiveLog=function(e){return ge({},e)},(zt||(zt={})).filterSensitiveLog=function(e){return ge({},e)},(Bt||(Bt={})).filterSensitiveLog=function(e){return ge({},e)},(Ut||(Ut={})).filterSensitiveLog=function(e){return ge({},e)},(Ft||(Ft={})).filterSensitiveLog=function(e){return ge({},e)},(Dt||(Dt={})).filterSensitiveLog=function(e){return ge({},e)},(qt||(qt={})).filterSensitiveLog=function(e){return ge({},e)},(Gt||(Gt={})).filterSensitiveLog=function(e){return ge({},e)},(Ht||(Ht={})).filterSensitiveLog=function(e){return ge({},e)},(Wt||(Wt={})).filterSensitiveLog=function(e){return ge({},e)},($t||($t={})).filterSensitiveLog=function(e){return ge({},e)},(Kt||(Kt={})).filterSensitiveLog=function(e){return ge({},e)},(Vt||(Vt={})).filterSensitiveLog=function(e){return ge({},e)},(Yt||(Yt={})).filterSensitiveLog=function(e){return ge({},e)},(Zt||(Zt={})).filterSensitiveLog=function(e){return ge({},e)},(Jt||(Jt={})).filterSensitiveLog=function(e){return ge({},e)},(Xt||(Xt={})).filterSensitiveLog=function(e){return ge({},e)},(Qt||(Qt={})).filterSensitiveLog=function(e){return ge({},e)},(en||(en={})).filterSensitiveLog=function(e){return ge({},e)},(tn||(tn={})).filterSensitiveLog=function(e){return ge({},e)},(nn||(nn={})).filterSensitiveLog=function(e){return ge({},e)},(rn||(rn={})).filterSensitiveLog=function(e){return ge({},e)},(on||(on={})).filterSensitiveLog=function(e){return ge({},e)},(an||(an={})).filterSensitiveLog=function(e){return ge({},e)},(sn||(sn={})).filterSensitiveLog=function(e){return ge({},e)},(un||(un={})).filterSensitiveLog=function(e){return ge({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return ge({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return ge({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return ge({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return ge({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return ge({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return ge({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return ge({},e)};var vn=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),mn=n(0),yn=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(mn.__assign)(Object(mn.__assign)({},this),{headers:Object(mn.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Object(mn.__assign)(Object(mn.__assign)({},e),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{}))),n},e}();var bn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h;return me(this,(function(p){switch(p.label){case 0:return r=[ge({},e)],h={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(h.body=p.sent(),h)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"LimitExceededException":case"com.amazonaws.cloudwatchlogs#LimitExceededException":return[3,4];case"OperationAbortedException":case"com.amazonaws.cloudwatchlogs#OperationAbortedException":return[3,6];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10]}return[3,12];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 4:return s=[{}],[4,Ln(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 6:return u=[{}],[4,In(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 8:return c=[{}],[4,Cn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 12:l=n.body,i=l.code||l.Code||i,o=ge(ge({},l),{name:""+i,message:l.message||l.Message||i,$fault:"client",$metadata:ir(e)}),p.label=13;case 13:return d=o.message||o.Message||i,o.message=d,delete o.Message,[2,Promise.reject(Object.assign(new Error(d),o))]}}))}))},wn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d;return me(this,(function(h){switch(h.label){case 0:return r=[ge({},e)],d={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(d.body=h.sent(),d)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,6];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,8]}return[3,10];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 6:return u=[{}],[4,Pn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 8:return c=[{}],[4,Tn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 10:f=n.body,i=f.code||f.Code||i,o=ge(ge({},f),{name:""+i,message:f.message||f.Message||i,$fault:"client",$metadata:ir(e)}),h.label=11;case 11:return l=o.message||o.Message||i,o.message=l,delete o.Message,[2,Promise.reject(Object.assign(new Error(l),o))]}}))}))},_n=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return r=[ge({},e)],f={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(f.body=l.sent(),f)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,4]}return[3,6];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 4:return s=[{}],[4,Tn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 6:u=n.body,i=u.code||u.Code||i,o=ge(ge({},u),{name:""+i,message:u.message||u.Message||i,$fault:"client",$metadata:ir(e)}),l.label=7;case 7:return c=o.message||o.Message||i,o.message=c,delete o.Message,[2,Promise.reject(Object.assign(new Error(c),o))]}}))}))},Sn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},En=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},xn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p;return me(this,(function(g){switch(g.label){case 0:return r=[ge({},e)],p={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(p.body=g.sent(),p)])),i="UnknownError",i=cr(e,n.body),i){case"DataAlreadyAcceptedException":case"com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException":return[3,2];case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,4];case"InvalidSequenceTokenException":case"com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException":return[3,6];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10];case"UnrecognizedClientException":case"com.amazonaws.cloudwatchlogs#UnrecognizedClientException":return[3,12]}return[3,14];case 2:return a=[{}],[4,An(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 4:return s=[{}],[4,On(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 6:return u=[{}],[4,kn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 8:return c=[{}],[4,Pn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 12:return l=[{}],[4,jn(n,t)];case 13:return o=ge.apply(void 0,[ge.apply(void 0,l.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 14:d=n.body,i=d.code||d.Code||i,o=ge(ge({},d),{name:""+i,message:d.message||d.Message||i,$fault:"client",$metadata:ir(e)}),g.label=15;case 15:return h=o.message||o.Message||i,o.message=h,delete o.Message,[2,Promise.reject(Object.assign(new Error(h),o))]}}))}))},An=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=qn(n,t),[2,ge({name:"DataAlreadyAcceptedException",$fault:"client",$metadata:ir(e)},r)]}))}))},On=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=$n(n,t),[2,ge({name:"InvalidParameterException",$fault:"client",$metadata:ir(e)},r)]}))}))},kn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Kn(n,t),[2,ge({name:"InvalidSequenceTokenException",$fault:"client",$metadata:ir(e)},r)]}))}))},Ln=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Vn(n,t),[2,ge({name:"LimitExceededException",$fault:"client",$metadata:ir(e)},r)]}))}))},In=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Jn(n,t),[2,ge({name:"OperationAbortedException",$fault:"client",$metadata:ir(e)},r)]}))}))},Cn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=tr(n,t),[2,ge({name:"ResourceAlreadyExistsException",$fault:"client",$metadata:ir(e)},r)]}))}))},Pn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=nr(n,t),[2,ge({name:"ResourceNotFoundException",$fault:"client",$metadata:ir(e)},r)]}))}))},Tn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=rr(n,t),[2,ge({name:"ServiceUnavailableException",$fault:"server",$metadata:ir(e)},r)]}))}))},jn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=or(n,t),[2,ge({name:"UnrecognizedClientException",$fault:"client",$metadata:ir(e)},r)]}))}))},Rn=function(e,t){return ge(ge(ge({},void 0!==e.kmsKeyId&&null!==e.kmsKeyId&&{kmsKeyId:e.kmsKeyId}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.tags&&null!==e.tags&&{tags:Dn(e.tags,t)})},Mn=function(e,t){return ge(ge({},void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName})},Nn=function(e,t){return ge(ge(ge({},void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupNamePrefix&&null!==e.logGroupNamePrefix&&{logGroupNamePrefix:e.logGroupNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken})},zn=function(e,t){return ge(ge(ge(ge(ge(ge({},void 0!==e.descending&&null!==e.descending&&{descending:e.descending}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamNamePrefix&&null!==e.logStreamNamePrefix&&{logStreamNamePrefix:e.logStreamNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.orderBy&&null!==e.orderBy&&{orderBy:e.orderBy})},Bn=function(e,t){return ge(ge(ge(ge(ge(ge(ge({},void 0!==e.endTime&&null!==e.endTime&&{endTime:e.endTime}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.startFromHead&&null!==e.startFromHead&&{startFromHead:e.startFromHead}),void 0!==e.startTime&&null!==e.startTime&&{startTime:e.startTime})},Un=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return ge(ge({},void 0!==e.message&&null!==e.message&&{message:e.message}),void 0!==e.timestamp&&null!==e.timestamp&&{timestamp:e.timestamp})}(e)}))},Fn=function(e,t){return ge(ge(ge(ge({},void 0!==e.logEvents&&null!==e.logEvents&&{logEvents:Un(e.logEvents)}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.sequenceToken&&null!==e.sequenceToken&&{sequenceToken:e.sequenceToken})},Dn=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=ye(t,2),o=r[0],i=r[1];return null===i?e:ge(ge({},e),((n={})[o]=i,n))}),{})},qn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Gn=function(e,t){return{logGroups:void 0!==e.logGroups&&null!==e.logGroups?Yn(e.logGroups,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Hn=function(e,t){return{logStreams:void 0!==e.logStreams&&null!==e.logStreams?Zn(e.logStreams,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Wn=function(e,t){return{events:void 0!==e.events&&null!==e.events?Xn(e.events,t):void 0,nextBackwardToken:void 0!==e.nextBackwardToken&&null!==e.nextBackwardToken?e.nextBackwardToken:void 0,nextForwardToken:void 0!==e.nextForwardToken&&null!==e.nextForwardToken?e.nextForwardToken:void 0}},$n=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Kn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Vn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Yn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,kmsKeyId:void 0!==e.kmsKeyId&&null!==e.kmsKeyId?e.kmsKeyId:void 0,logGroupName:void 0!==e.logGroupName&&null!==e.logGroupName?e.logGroupName:void 0,metricFilterCount:void 0!==e.metricFilterCount&&null!==e.metricFilterCount?e.metricFilterCount:void 0,retentionInDays:void 0!==e.retentionInDays&&null!==e.retentionInDays?e.retentionInDays:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0}}(e)}))},Zn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,firstEventTimestamp:void 0!==e.firstEventTimestamp&&null!==e.firstEventTimestamp?e.firstEventTimestamp:void 0,lastEventTimestamp:void 0!==e.lastEventTimestamp&&null!==e.lastEventTimestamp?e.lastEventTimestamp:void 0,lastIngestionTime:void 0!==e.lastIngestionTime&&null!==e.lastIngestionTime?e.lastIngestionTime:void 0,logStreamName:void 0!==e.logStreamName&&null!==e.logStreamName?e.logStreamName:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0,uploadSequenceToken:void 0!==e.uploadSequenceToken&&null!==e.uploadSequenceToken?e.uploadSequenceToken:void 0}}(e)}))},Jn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ingestionTime:void 0!==e.ingestionTime&&null!==e.ingestionTime?e.ingestionTime:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0,timestamp:void 0!==e.timestamp&&null!==e.timestamp?e.timestamp:void 0}}(e)}))},Qn=function(e,t){return{nextSequenceToken:void 0!==e.nextSequenceToken&&null!==e.nextSequenceToken?e.nextSequenceToken:void 0,rejectedLogEventsInfo:void 0!==e.rejectedLogEventsInfo&&null!==e.rejectedLogEventsInfo?er(e.rejectedLogEventsInfo,t):void 0}},er=function(e,t){return{expiredLogEventEndIndex:void 0!==e.expiredLogEventEndIndex&&null!==e.expiredLogEventEndIndex?e.expiredLogEventEndIndex:void 0,tooNewLogEventStartIndex:void 0!==e.tooNewLogEventStartIndex&&null!==e.tooNewLogEventStartIndex?e.tooNewLogEventStartIndex:void 0,tooOldLogEventEndIndex:void 0!==e.tooOldLogEventEndIndex&&null!==e.tooOldLogEventEndIndex?e.tooOldLogEventEndIndex:void 0}},tr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},nr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},rr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},or=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ir=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},ar=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},sr=function(e,t,n,r,o){return ve(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},ur=function(e,t){return function(e,t){return ar(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},cr=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},fr={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},lr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function dr(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:return o=a.sent().response,[4,t(o,e)];case 2:return i=a.sent(),[2,{response:o,output:i}]}}))}))}}}(e,n),fr),r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return[4,t(r.input,e)];case 1:return o=i.sent(),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}}(e,t),lr)}}}var hr=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(mn.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(mn.__assign)({},e))})),n},o=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t},i=function(){var n,r=[],i=[],a={};return e.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),i.push(t)})),i.forEach((function(e){if(e.toMiddleware){var t=a[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return pr[t.step]-pr[e.step]||gr[t.priority||"normal"]-gr[e.priority||"normal"]}))).map(o).reduce((function(e,t){return e.push.apply(e,Object(mn.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},a={add:function(t,r){void 0===r&&(r={});var o=r.name,i=r.override,a=Object(mn.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=e.findIndex((function(e){return e.name===o})),u=e[s];if(u.step!==a.step||u.priority!==a.priority)throw new Error('"'+o+'" middleware with '+u.priority+" priority in "+u.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(s,1)}n.add(o)}e.push(a)},addRelativeTo:function(e,r){var o=r.name,i=r.override,a=Object(mn.__assign)({middleware:e},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=t.findIndex((function(e){return e.name===o})),u=t[s];if(u.toMiddleware!==a.toMiddleware||u.relation!==a.relation)throw new Error('"'+o+'" middleware '+u.relation+' "'+u.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(s,1)}n.add(o)}t.push(a)},clone:function(){return r(hr())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=r(hr());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var o=Object(mn.__values)(i().reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}};return a},pr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gr={high:3,normal:2,low:1},vr=function(){function e(e){this.middlewareStack=hr(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),mr=function(){this.middlewareStack=hr()};var yr=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(mn.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};yr.prototype=Object.create(String.prototype,{constructor:{value:yr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(yr,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(mn.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(yr);var br=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogGroupCommand",inputFilterSensitiveLog:Ce.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogGroup"},r=JSON.stringify(Rn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,bn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),wr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogGroupsCommand",inputFilterSensitiveLog:Je.filterSensitiveLog,outputFilterSensitiveLog:Qe.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogGroups"},r=JSON.stringify(Nn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,_n(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Gn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),_r=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogStreamCommand",inputFilterSensitiveLog:Pe.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogStream"},r=JSON.stringify(Mn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,wn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),Sr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogStreamsCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:rt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogStreams"},r=JSON.stringify(zn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Sn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Hn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Er=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"GetLogEventsCommand",inputFilterSensitiveLog:kt.filterSensitiveLog,outputFilterSensitiveLog:It.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.GetLogEvents"},r=JSON.stringify(Bn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,En(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Wn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),xr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"PutLogEventsCommand",inputFilterSensitiveLog:$t.filterSensitiveLog,outputFilterSensitiveLog:Vt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.PutLogEvents"},r=JSON.stringify(Fn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,xn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Qn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ar=n(20),Or=n(6),kr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Lr)},Lr=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Ir=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var o=new Error("Request aborted");return o.name="AbortError",Promise.reject(o)}var i=e.path;if(e.query){var a=function(e){var t,n,r=[];try{for(var o=Object(mn.__values)(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,s=e[a];if(a=kr(a),Array.isArray(s))for(var u=0,c=s.length;u<c;u++)r.push(a+"="+kr(s[u]));else{var f=a;(s||"string"==typeof s)&&(f+="="+kr(s)),r.push(f)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query);a&&(i+="?"+a)}var s=e.port,u=e.method,c=e.protocol+"//"+e.hostname+(s?":"+s:"")+i,f={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(f.signal=n);var l,d=new Request(c,f),h=[fetch(d).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Object(mn.__values)(r.entries()),a=i.next();!a.done;a=i.next()){var s=a.value;o[s[0]]=s[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new vn({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new vn({headers:o,statusCode:e.status,body:t})}}))})),(l=r,void 0===l&&(l=0),new Promise((function(e,t){l&&setTimeout((function(){var e=new Error("Request did not complete within "+l+" ms");e.name="TimeoutError",t(e)}),l)})))];return n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(h)},e}(),Cr={},Pr=new Array(64),Tr=0,jr="A".charCodeAt(0),Rr="Z".charCodeAt(0);Tr+jr<=Rr;Tr++){var Mr=String.fromCharCode(Tr+jr);Cr[Mr]=Tr,Pr[Tr]=Mr}for(Tr=0,jr="a".charCodeAt(0),Rr="z".charCodeAt(0);Tr+jr<=Rr;Tr++){Mr=String.fromCharCode(Tr+jr);var Nr=Tr+26;Cr[Mr]=Nr,Pr[Nr]=Mr}for(Tr=0;Tr<10;Tr++){Cr[Tr.toString(10)]=Tr+52;Mr=Tr.toString(10),Nr=Tr+52;Cr[Mr]=Nr,Pr[Nr]=Mr}Cr["+"]=62,Pr[62]="+",Cr["/"]=63,Pr[63]="/";function zr(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,s=o,u=o+3;s<=u;s++)"="!==e[s]?(i|=Cr[e[s]]<<6*(u-s),a+=6):i>>=6;var c=o/4*3;i>>=a%8;for(var f=Math.floor(a/8),l=0;l<f;l++){var d=8*(f-l-1);r.setUint8(c+l,(i&255<<d)>>d)}}return new Uint8Array(n)}function Br(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var s=Math.ceil(o/6);r<<=6*s-o;for(var u=1;u<=s;u++){var c=6*(s-u);t+=Pr[(r&63<<c)>>c]}t+="==".slice(0,4-s)}return t}var Ur=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(mn.__generator)(this,(function(r){switch(r.label){case 0:return[4,Fr(e)];case 1:return t=r.sent(),n=zr(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return Object(mn.__generator)(this,(function(u){switch(u.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=u.sent(),i=o.done,(a=o.value)&&(s=t,(t=new Uint8Array(s.length+a.length)).set(s),t.set(a,s.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Fr(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Dr=function(e){return function(){return Promise.reject(e)}},qr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Gr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){return(null===(o=null==e?void 0:e.retryStrategy)||void 0===o?void 0:o.mode)&&(n.userAgent=Object(mn.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),qr)}}},Hr=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Wr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$r=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Kr=[500,502,503,504],Vr=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||Wr.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},Yr=n(18),Zr=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Jr=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return Hr.includes(e.name)}(e)||Vr(e)||function(e){var t;return $r.includes(e.name)||Kr.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},Xr=function(){function e(e,t){var n,r,o,i,a,s,u,c;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Jr,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Zr,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:(a=i=500,s=i,u=function(e){return"TimeoutError"===e.name?10:5},c=function(e){return u(e)<=s},Object.freeze({hasRetryTokens:c,retrieveRetryTokens:function(e){if(!c(e))throw new Error("No retry token available");var t=u(e);return s-=t,t},releaseRetryTokens:function(e){s+=null!=e?e:1,s=Math.min(s,a)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e;return Object(mn.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:return r=0,o=0,[4,this.getMaxAttempts()];case 1:i=f.sent(),a=t.request,yn.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=Object(Yr.v4)()),s=function(){var s,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,5]),yn.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+i),[4,e(t)];case 1:return s=h.sent(),c=s.response,f=s.output,u.retryQuota.releaseRetryTokens(n),f.$metadata.attempts=r+1,f.$metadata.totalRetryDelay=o,[2,{value:{response:c,output:f}}];case 2:return l=h.sent(),r++,u.shouldRetry(l,r,i)?(n=u.retryQuota.retrieveRetryTokens(l),d=u.delayDecider(Vr(l)?500:100,r),o+=d,[4,new Promise((function(e){return setTimeout(e,d)}))]):[3,4];case 3:return h.sent(),[2,"continue"];case 4:throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=r,l.$metadata.totalRetryDelay=o,l;case 5:return[2]}}))},u=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(c=f.sent())?[2,c.value]:[3,2];case 4:return[2]}}))}))},e}(),Qr=function(e){var t=eo(e.maxAttempts);return Object(mn.__assign)(Object(mn.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new Xr(t)})},eo=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function to(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var no=n(19),ro=n.n(no),oo=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var e,r,o,i,a,s,u,c,f;return Object(mn.__generator)(this,(function(l){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?ro.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser",(null!==(u=null===(s=null==e?void 0:e.browser)||void 0===s?void 0:s.name)&&void 0!==u?u:"unknown")+"_"+(null!==(f=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==f?f:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}},io=n(4),ao=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),so=new Set(["cn-north-1","cn-northwest-1"]),uo=new Set(["us-iso-east-1"]),co=new Set(["us-isob-east-1"]),fo=new Set(["us-gov-east-1","us-gov-west-1"]);var lo=function(e){var t,n=new URL(e),r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,s=n.search;return s&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Object(mn.__values)(e.split("&")),i=o.next();!i.done;i=o.next()){var a=i.value,s=Object(mn.__read)(a.split("="),2),u=s[0],c=s[1],f=void 0===c?null:c;u=decodeURIComponent(u),f&&(f=decodeURIComponent(f)),u in r?Array.isArray(r[u])?r[u].push(f):r[u]=[r[u],f]:r[u]=f}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(s)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},ho={apiVersion:"2014-03-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"logs.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"logs.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"logs.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"logs.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"logs.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"logs.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"logs.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"logs.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"logs.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"logs.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"logs.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"logs.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"logs.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"logs.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"logs.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"logs.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"logs-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"logs-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"logs-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"logs-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"logs.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"logs.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"logs.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"logs.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"logs.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"logs.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"logs.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"logs.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"logs.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"logs.us-west-2.amazonaws.com",partition:"aws"};break;default:ao.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),so.has(e)&&(n={hostname:"logs.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),uo.has(e)&&(n={hostname:"logs.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),co.has(e)&&(n={hostname:"logs.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),fo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(ge({signingService:"logs"},n))},serviceId:"CloudWatch Logs",urlParser:lo},po=ge(ge({},ho),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:ho.serviceId,clientVersion:Ar.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),go=function(e){var t;return Object(mn.__assign)(Object(mn.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?vo(e):function(){return mo(e)},isCustomEndpoint:!!e.endpoint})},vo=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var o=Promise.resolve(t);return function(){return o}}return t},mo=function(e){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=a.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(o=(null!==(i=a.sent())&&void 0!==i?i:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},yo=function(e){if(!e.region)throw new Error("Region is missing");return Object(mn.__assign)(Object(mn.__assign)({},e),{region:bo(e.region)})},bo=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var wo={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},_o=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,o,i,a,s;return Object(mn.__generator)(this,(function(u){return t=r.request,yn.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(a=e(o))&&(t.headers=Object(mn.__assign)(Object(mn.__assign)({},t.headers),((s={})["content-length"]=String(a),s)))),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),wo)}}};for(var So={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Eo=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){return yn.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),So)}}},xo={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Ao=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return u=d.sent(),a?("function"==typeof a.info&&(c=u.output,f=c.$metadata,l=Object(mn.__rest)(c,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:s(l),metadata:f})),[2,u]):[2,u]}}))}))}}),xo)}}},Oo={},ko={},Lo=0;Lo<256;Lo++){var Io=Lo.toString(16).toLowerCase();1===Io.length&&(Io="0"+Io),Oo[Lo]=Io,ko[Io]=Lo}function Co(e){for(var t="",n=0;n<e.byteLength;n++)t+=Oo[e[n]];return t}var Po="X-Amz-Date".toLowerCase(),To=["authorization",Po,"date"],jo="X-Amz-Signature".toLowerCase(),Ro="X-Amz-Security-Token".toLowerCase(),Mo={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},No=/^proxy-/,zo=/^sec-/,Bo="AWS4-HMAC-SHA256-PAYLOAD",Uo={},Fo=[];function Do(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function qo(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Go(e,t,n){var r,o,i=e.headers,a={};try{for(var s=Object(mn.__values)(Object.keys(i).sort()),u=s.next();!u.done;u=s.next()){var c=u.value,f=c.toLowerCase();(f in Mo||(null==t?void 0:t.has(f))||No.test(f)||zo.test(f))&&(!n||n&&!n.has(f))||(a[f]=i[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var Ho=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Wo)},Wo=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function $o(e,t){var n=e.headers,r=e.body;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(mn.__values)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){u={error:e}}finally{try{o&&!o.done&&(c=e.return)&&c.call(e)}finally{if(u)throw u.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(l=r,"function"==typeof ArrayBuffer&&l instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(l))?((a=new t).update(r),s=Co,[4,a.digest()]):[3,3];case 2:return[2,s.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var l}))}))}function Ko(e){var t=e.headers,n=e.query,r=Object(mn.__rest)(e,["headers","query"]);return Object(mn.__assign)(Object(mn.__assign)({},r),{headers:Object(mn.__assign)({},t),query:n?Vo(n):void 0})}function Vo(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Object(mn.__assign)(Object(mn.__assign)({},t),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{})}function Yo(e){var t,n;e="function"==typeof e.clone?e.clone():Ko(e);try{for(var r=Object(mn.__values)(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;To.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function Zo(e){return function(e){if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var Jo=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=ei(r),this.credentialProvider=ti(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v,m,y,b,w,_,S,E,x,A;return Object(mn.__generator)(this,(function(O){switch(O.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,s=t.unhoistableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return l=O.sent(),null==c?[3,2]:(h=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=O.sent(),O.label=4;case 4:return d=h,p=Xo(r),g=p.longDate,v=p.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=Do(v,d,null!=f?f:this.service),y=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():Ko(e),a=i.headers,s=i.query,u=void 0===s?{}:s;try{for(var c=Object(mn.__values)(Object.keys(a)),f=c.next();!f.done;f=c.next()){var l=f.value,d=l.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(u[l]=a[l],delete a[l])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(mn.__assign)(Object(mn.__assign)({},e),{headers:a,query:u})}(Yo(e),{unhoistableHeaders:s}),l.sessionToken&&(y.query["X-Amz-Security-Token"]=l.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=l.accessKeyId+"/"+m,y.query["X-Amz-Date"]=g,y.query["X-Amz-Expires"]=i.toString(10),b=Go(y,a,u),y.query["X-Amz-SignedHeaders"]=Qo(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[g,m,this.getSigningKey(l,d,v,f)],x=this.createCanonicalRequest,A=[y,b],[4,$o(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([x.apply(this,A.concat([O.sent()]))]))];case 6:return w[_]=O.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,s=t.signingRegion,u=t.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,t,o,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return null==s?[3,1]:(t=s,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,o=Xo(i),c=o.shortDate,f=o.longDate,l=Do(c,e,null!=u?u:this.service),[4,$o({headers:{},body:r},this.sha256)];case 4:return d=m.sent(),(h=new this.sha256).update(n),g=Co,[4,h.digest()];case 5:return p=g.apply(void 0,[m.sent()]),v=[Bo,f,l,a,p,d].join("\n"),[2,this.signString(v,{signingDate:i,signingRegion:e,signingService:u})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,s=Xo(o).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,s,a)];case 5:return(u=new(f.apply(c,[void 0,d.sent()]))).update(e),l=Co,[4,u.digest()];case 6:return[2,l.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,s=n.signingRegion,u=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==s?[3,2]:(r=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,c=Yo(e),f=Xo(o),l=f.longDate,d=f.shortDate,h=Do(d,n,null!=u?u:this.service),c.headers[Po]=l,t.sessionToken&&(c.headers[Ro]=t.sessionToken),[4,$o(c,this.sha256)];case 5:return p=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Object(mn.__values)(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=p),g=Go(c,a,i),[4,this.getSignature(l,h,this.getSigningKey(t,n,d,u),this.createCanonicalRequest(c,g,p))];case 6:return v=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+h+", SignedHeaders="+Qo(g)+", Signature="+v,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},s=function(e){if(e.toLowerCase()===jo)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]=Ho(e)+"="+Ho(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Ho(e)+"="+Ho(n)])}),[]).join("&"))};try{for(var u=Object(mn.__values)(Object.keys(o).sort()),c=u.next();!c.done;c=u.next()){s(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Co(o)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u;return Object(mn.__generator)(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=c.sent(),s=(a=this.sha256).bind,[4,n];case 2:return(i=new(s.apply(a,[void 0,c.sent()]))).update(o),u=Co,[4,i.digest()];case 3:return[2,u.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return[4,qo(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=p.sent(),(a=n+":"+r+":"+o+":"+Co(i)+":"+t.sessionToken)in Uo)return[2,Uo[a]];for(Fo.push(a);Fo.length>50;)delete Uo[Fo.shift()];s="AWS4"+t.secretAccessKey,p.label=2;case 2:p.trys.push([2,7,8,9]),u=Object(mn.__values)([n,r,o,"aws4_request"]),c=u.next(),p.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,qo(e,s,f)]);case 4:s=p.sent(),p.label=5;case 5:return c=u.next(),[3,3];case 6:return[3,9];case 7:return l=p.sent(),d={error:l},[3,9];case 8:try{c&&!c.done&&(h=u.return)&&h.call(u)}finally{if(d)throw d.error}return[7];case 9:return[2,Uo[a]=s]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Xo=function(e){var t=Zo(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},Qo=function(e){return Object.keys(e).sort().join(";")},ei=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ti=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ni(e){var t,n=this,r=ri(e.credentials||e.credentialDefaultProvider(e)),o=e.signingEscapePath,i=void 0===o||o,a=e.systemClockOffset,s=void 0===a?e.systemClockOffset||0:a,u=e.sha256;return t=e.signer?ri(e.signer):function(){return ri(e.region)().then((function(t){return Object(mn.__awaiter)(n,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=Object(mn.__read)(t,2),o=n[0],a=n[1],s=o.signingRegion,c=o.signingService;return e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||c||e.serviceId,new Jo({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:i})}))},Object(mn.__assign)(Object(mn.__assign)({},e),{systemClockOffset:s,signingEscapePath:i,credentials:r,signer:t})}function ri(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var oi=function(e){return new Date(Date.now()+e)};function ii(e){return function(t,n){return function(r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return yn.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return i=h.sent(),[3,3];case 2:i=e.signer,h.label=3;case 3:return o=i,s=t,u=[Object(mn.__assign)({},r)],d={},[4,o.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,s.apply(void 0,[mn.__assign.apply(void 0,u.concat([(d.request=h.sent(),d)]))])];case 5:return a=h.sent(),c=a.response.headers,(f=c&&(c.date||c.Date))&&(l=Date.parse(f),p=l,g=e.systemClockOffset,Math.abs(oi(g).getTime()-p)>=3e5&&(e.systemClockOffset=l-Date.now())),[2,a]}var p,g}))}))}}}var ai={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0};function si(e){return Object(mn.__assign)(Object(mn.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var ui,ci=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,fi=function(e){var t=Object(mn.__read)(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(ci,"_")})).join("/")},li={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},di=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return o=r.request,yn.isInstance(o)?(i=o.headers,a=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(fi))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return s=d.sent().map(fi),u=(null===(l=null==n?void 0:n.customUserAgent)||void 0===l?void 0:l.map(fi))||[],i["x-amz-user-agent"]=Object(mn.__spread)(s,a,u).join(" "),c=Object(mn.__spread)(s.filter((function(e){return e.startsWith("aws-sdk-")})),u).join(" "),"browser"!==n.runtime&&c&&(i["user-agent"]=i["user-agent"]?i["user-agent"]+" "+c:c),[2,e(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}),li)}}},hi=function(e){function t(t){var n,r=this,o=ge(ge({},po),t),i=yo(o),a=ni(go(i)),s=si(Qr(a));return(r=e.call(this,s)||this).config=s,r.middlewareStack.use((n=r.config,{applyToStack:function(e){e.addRelativeTo(ii(n),ai)}})),r.middlewareStack.use(Gr(r.config)),r.middlewareStack.use(_o(r.config)),r.middlewareStack.use(Eo(r.config)),r.middlewareStack.use(Ao(r.config)),r.middlewareStack.use(di(r.config)),r}return pe(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr),pi={},gi=function(){function e(){}return e.setItem=function(e,t){return pi[e]=t,pi[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(pi,e)?pi[e]:void 0},e.removeItem=function(e){return delete pi[e]},e.clear=function(){return pi={}},e}(),vi=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=gi}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),mi=(ui=function(e,t){return(ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},bi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wi=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wi(arguments[t]));return e},Si=new g("Util"),Ei=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return mi(t,e),t}(Error);function xi(e,t,n,r){return void 0===r&&(r=1),yi(this,void 0,void 0,(function(){var o,i;return bi(this,(function(a){switch(a.label){case 0:if("function"!=typeof e)throw Error("functionToRetry must be a function");Si.debug(e.name+" attempt #"+r+" with this vars: "+JSON.stringify(t)),a.label=1;case 1:return a.trys.push([1,3,,8]),[4,e.apply(void 0,_i(t))];case 2:return[2,a.sent()];case 3:if(o=a.sent(),Si.debug("error on "+e.name,o),(s=o)&&s.nonRetryable)throw Si.debug(e.name+" non retryable error",o),o;return i=n(r,t,o),Si.debug(e.name+" retrying in "+i+" ms"),!1===i?[3,6]:[4,new Promise((function(e){return setTimeout(e,i)}))];case 4:return a.sent(),[4,xi(e,t,n,r+1)];case 5:return[2,a.sent()];case 6:throw o;case 7:return[3,8];case 8:return[2]}var s}))}))}function Ai(e){void 0===e&&(e=3e5);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var Oi=function(e,t,n){return void 0===n&&(n=3e5),xi(e,t,Ai(n))},ki=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Li=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ii=new g("CognitoCredentials"),Ci=new Promise((function(e,t){return Object(U.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(Ii.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ii.debug("not in the browser, directly resolved"),e())})),Pi=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return ki(this,void 0,void 0,(function(){return Li(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ii.debug("need to wait for the Google SDK loaded"),[4,Ci]);case 1:e.sent(),this.initialized=!0,Ii.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(U.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(Ii.debug("google Auth undefined"),n(new Ei("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(Ii.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new Ei("Failed to reload google auth response"))}))):n(new Ei("User is not signed in with Google"))})).catch((function(e){Ii.debug("Failed to refresh google token",e),n(new Ei("Failed to refresh google token"))}))})):(Ii.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),Ti=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ji=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ri=new g("CognitoCredentials"),Mi=new Promise((function(e,t){return Object(U.b)().isBrowser?window.FB?(Ri.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ri.debug("not in the browser, directly resolved"),e())})),Ni=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return Ti(this,void 0,void 0,(function(){return ji(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ri.debug("need to wait for the Facebook SDK loaded"),[4,Mi]);case 1:e.sent(),this.initialized=!0,Ri.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(U.b)().isBrowser&&(e=window.FB),!e){return Ri.debug("no fb sdk available"),Promise.reject(new Ei("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,o=r.accessToken,i=1e3*r.expiresIn+(new Date).getTime();if(!o){a="the jwtToken is undefined";Ri.debug(a),n(new Ei(a))}t({token:o,expires_at:i})}else{var a="no response from facebook when refreshing the jwt token";Ri.debug(a),n(new Ei(a))}}),{scope:"public_profile,email"})}))},e}(),zi=new Pi,Bi=new Ni,Ui=function(e,t){return(Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Fi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Di=function(){return(Di=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function qi(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Gi(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Hi(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Wi,$i,Ki,Vi,Yi,Zi,Ji,Xi,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,ca,fa,la,da,ha,pa,ga,va,ma,ya,ba,wa,_a,Sa,Ea,xa,Aa,Oa,ka,La,Ia,Ca,Pa,Ta,ja,Ra,Ma,Na,za,Ba,Ua,Fa,Da,qa,Ga,Ha,Wa,$a,Ka;Object.create;!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Wi||(Wi={})),($i||($i={})).filterSensitiveLog=function(e){return Di({},e)},(Ki||(Ki={})).filterSensitiveLog=function(e){return Di({},e)},(Vi||(Vi={})).filterSensitiveLog=function(e){return Di({},e)},(Yi||(Yi={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(Zi||(Zi={})),function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(Ji||(Ji={})),(Xi||(Xi={})).filterSensitiveLog=function(e){return Di({},e)},(Qi||(Qi={})).filterSensitiveLog=function(e){return Di({},e)},(ea||(ea={})).filterSensitiveLog=function(e){return Di({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(na||(na={})),(ra||(ra={})).filterSensitiveLog=function(e){return Di({},e)},(oa||(oa={})).filterSensitiveLog=function(e){return Di({},e)},(ia||(ia={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(aa||(aa={})),(sa||(sa={})).filterSensitiveLog=function(e){return Di({},e)},(ua||(ua={})).filterSensitiveLog=function(e){return Di({},e)},(ca||(ca={})).filterSensitiveLog=function(e){return Di({},e)},(fa||(fa={})).filterSensitiveLog=function(e){return Di({},e)},(la||(la={})).filterSensitiveLog=function(e){return Di({},e)},(da||(da={})).filterSensitiveLog=function(e){return Di({},e)},(ha||(ha={})).filterSensitiveLog=function(e){return Di({},e)},(pa||(pa={})).filterSensitiveLog=function(e){return Di({},e)},(ga||(ga={})).filterSensitiveLog=function(e){return Di({},e)},(va||(va={})).filterSensitiveLog=function(e){return Di({},e)},(ma||(ma={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(ya||(ya={})),(ba||(ba={})).filterSensitiveLog=function(e){return Di({},e)},(wa||(wa={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.RULES="Rules",e.TOKEN="Token"}(_a||(_a={})),(Sa||(Sa={})).filterSensitiveLog=function(e){return Di({},e)},(Ea||(Ea={})).filterSensitiveLog=function(e){return Di({},e)},(xa||(xa={})).filterSensitiveLog=function(e){return Di({},e)},(Aa||(Aa={})).filterSensitiveLog=function(e){return Di({},e)},(Oa||(Oa={})).filterSensitiveLog=function(e){return Di({},e)},(ka||(ka={})).filterSensitiveLog=function(e){return Di({},e)},(La||(La={})).filterSensitiveLog=function(e){return Di({},e)},(Ia||(Ia={})).filterSensitiveLog=function(e){return Di({},e)},(Ca||(Ca={})).filterSensitiveLog=function(e){return Di({},e)},(Pa||(Pa={})).filterSensitiveLog=function(e){return Di({},e)},(Ta||(Ta={})).filterSensitiveLog=function(e){return Di({},e)},(ja||(ja={})).filterSensitiveLog=function(e){return Di({},e)},(Ra||(Ra={})).filterSensitiveLog=function(e){return Di({},e)},(Ma||(Ma={})).filterSensitiveLog=function(e){return Di({},e)},(Na||(Na={})).filterSensitiveLog=function(e){return Di({},e)},(za||(za={})).filterSensitiveLog=function(e){return Di({},e)},(Ba||(Ba={})).filterSensitiveLog=function(e){return Di({},e)},(Ua||(Ua={})).filterSensitiveLog=function(e){return Di({},e)},(Fa||(Fa={})).filterSensitiveLog=function(e){return Di({},e)},(Da||(Da={})).filterSensitiveLog=function(e){return Di({},e)},(qa||(qa={})).filterSensitiveLog=function(e){return Di({},e)},(Ga||(Ga={})).filterSensitiveLog=function(e){return Di({},e)},(Ha||(Ha={})).filterSensitiveLog=function(e){return Di({},e)},(Wa||(Wa={})).filterSensitiveLog=function(e){return Di({},e)},($a||($a={})).filterSensitiveLog=function(e){return Di({},e)},(Ka||(Ka={})).filterSensitiveLog=function(e){return Di({},e)};var Va=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Gi(this,(function(m){switch(m.label){case 0:return r=[Di({},e)],v={},[4,Es(e.body,t)];case 1:switch(n=Di.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=xs(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Za(n,t)];case 3:return o=Di.apply(void 0,[Di.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 4:return s=[{}],[4,Ja(n,t)];case 5:return o=Di.apply(void 0,[Di.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 6:return u=[{}],[4,Xa(n,t)];case 7:return o=Di.apply(void 0,[Di.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 8:return c=[{}],[4,Qa(n,t)];case 9:return o=Di.apply(void 0,[Di.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 10:return f=[{}],[4,ts(n,t)];case 11:return o=Di.apply(void 0,[Di.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 12:return l=[{}],[4,ns(n,t)];case 13:return o=Di.apply(void 0,[Di.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 14:return d=[{}],[4,rs(n,t)];case 15:return o=Di.apply(void 0,[Di.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 16:return h=[{}],[4,os(n,t)];case 17:return o=Di.apply(void 0,[Di.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Di(Di({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:ws(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ya=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Gi(this,(function(m){switch(m.label){case 0:return r=[Di({},e)],v={},[4,Es(e.body,t)];case 1:switch(n=Di.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=xs(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Za(n,t)];case 3:return o=Di.apply(void 0,[Di.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 4:return s=[{}],[4,Ja(n,t)];case 5:return o=Di.apply(void 0,[Di.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 6:return u=[{}],[4,Qa(n,t)];case 7:return o=Di.apply(void 0,[Di.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 8:return c=[{}],[4,es(n,t)];case 9:return o=Di.apply(void 0,[Di.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 10:return f=[{}],[4,ts(n,t)];case 11:return o=Di.apply(void 0,[Di.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 12:return l=[{}],[4,ns(n,t)];case 13:return o=Di.apply(void 0,[Di.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 14:return d=[{}],[4,rs(n,t)];case 15:return o=Di.apply(void 0,[Di.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 16:return h=[{}],[4,os(n,t)];case 17:return o=Di.apply(void 0,[Di.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Di(Di({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:ws(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Za=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=cs(n,t),[2,Di({name:"ExternalServiceException",$fault:"client",$metadata:ws(e)},r)]}))}))},Ja=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ds(n,t),[2,Di({name:"InternalErrorException",$fault:"server",$metadata:ws(e)},r)]}))}))},Xa=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=hs(n,t),[2,Di({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:ws(e)},r)]}))}))},Qa=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ps(n,t),[2,Di({name:"InvalidParameterException",$fault:"client",$metadata:ws(e)},r)]}))}))},es=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=gs(n,t),[2,Di({name:"LimitExceededException",$fault:"client",$metadata:ws(e)},r)]}))}))},ts=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=vs(n,t),[2,Di({name:"NotAuthorizedException",$fault:"client",$metadata:ws(e)},r)]}))}))},ns=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ms(n,t),[2,Di({name:"ResourceConflictException",$fault:"client",$metadata:ws(e)},r)]}))}))},rs=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ys(n,t),[2,Di({name:"ResourceNotFoundException",$fault:"client",$metadata:ws(e)},r)]}))}))},os=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=bs(n,t),[2,Di({name:"TooManyRequestsException",$fault:"client",$metadata:ws(e)},r)]}))}))},is=function(e,t){return Di(Di(Di({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:ss(e.Logins,t)})},as=function(e,t){return Di(Di(Di({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:ss(e.Logins,t)})},ss=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Hi(t,2),o=r[0],i=r[1];return null===i?e:Di(Di({},e),((n={})[o]=i,n))}),{})},us=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},cs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},fs=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?us(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ls=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ds=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},hs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ps=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ms=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ys=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ws=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},_s=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ss=function(e,t,n,r,o){return qi(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Gi(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Es=function(e,t){return function(e,t){return _s(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},xs=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},As=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Fi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:la.filterSensitiveLog,outputFilterSensitiveLog:ha.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(is(e,t)),[2,Ss(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o;return Gi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Va(e,t)]:[4,Es(e.body,t)];case 1:return n=i.sent(),{},r=fs(n,t),o=Di({$metadata:ws(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Os=function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}return Object(mn.__extends)(t,e),t}(Error);function ks(e){return Promise.all(Object.keys(e).reduce((function(t,n){var r=e[n];return"string"==typeof r?t.push([n,r]):t.push(r().then((function(e){return[n,e]}))),t}),[])).then((function(e){return e.reduce((function(e,t){var n=Object(mn.__read)(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}))}function Ls(e){var t=this;return function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return f=(c=e.client).send,l=As.bind,h={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,ks(e.logins)]:[3,2];case 1:return d=p.sent(),[3,3];case 2:d=void 0,p.label=3;case 3:return[4,f.apply(c,[new(l.apply(As,[void 0,(h.Logins=d,h)]))])];case 4:return t=p.sent().Credentials,n=void 0===t?function(){throw new Os("Response from Amazon Cognito contained no credentials")}():t,r=n.AccessKeyId,o=void 0===r?function(){throw new Os("Response from Amazon Cognito contained no access key ID")}():r,i=n.Expiration,a=n.SecretKey,s=void 0===a?function(){throw new Os("Response from Amazon Cognito contained no secret key")}():a,u=n.SessionToken,[2,{identityId:e.identityId,accessKeyId:o,secretAccessKey:s,sessionToken:u,expiration:i}]}}))}))}}var Is=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Fi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:ga.filterSensitiveLog,outputFilterSensitiveLog:va.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(as(e,t)),[2,Ss(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o;return Gi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ya(e,t)]:[4,Es(e.body,t)];case 1:return n=i.sent(),{},r=ls(n,t),o=Di({$metadata:ws(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cs=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",(function(t){var n=t.get(e);return new Promise((function(e){n.onerror=function(){return e(null)},n.onsuccess=function(){return e(n.result?n.result.value:null)}}))})).catch((function(){return null}))},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",(function(t){var n=t.delete(e);return new Promise((function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}}))}))},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",(function(n){var r=n.put({id:e,value:t});return new Promise((function(e,t){r.onerror=function(){return t(r.error)},r.onsuccess=function(){return e()}}))}))},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)},e.onblocked=function(){n(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){n(new Error("Failed to create object store"))},t.createObjectStore("IdentityIds",{keyPath:"id"})}}))},e.prototype.withObjectStore=function(e,t){return this.getDb().then((function(n){var r=n.transaction("IdentityIds",e);return r.oncomplete=function(){return n.close()},new Promise((function(e,n){r.onerror=function(){return n(r.error)},e(t(r.objectStore("IdentityIds")))})).catch((function(e){throw n.close(),e}))}))},e}(),Ps=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());function Ts(e){var t=this,n=e.accountId,r=e.cache,o=void 0===r?"object"==typeof self&&self.indexedDB?new Cs:"object"==typeof window&&window.localStorage?window.localStorage:Ps:r,i=e.client,a=e.customRoleArn,s=e.identityPoolId,u=e.logins,c=e.userIdentifier,f=void 0===c?u&&0!==Object.keys(u).length?void 0:"ANONYMOUS":c,l=f?"aws:cognito-identity-credentials:"+s+":"+f:void 0,d=function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var e,t,r,c,f,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return(t=l)?[4,o.getItem(l)]:[3,2];case 1:t=m.sent(),m.label=2;case 2:return(e=t)?[3,7]:(h=(f=i).send,p=Is.bind,v={AccountId:n,IdentityPoolId:s},u?[4,ks(u)]:[3,4]);case 3:return g=m.sent(),[3,5];case 4:g=void 0,m.label=5;case 5:return[4,h.apply(f,[new(p.apply(Is,[void 0,(v.Logins=g,v)]))])];case 6:r=m.sent().IdentityId,c=void 0===r?function(){throw new Os("Response from Amazon Cognito contained no identity ID")}():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=Ls({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var js=function(e,t){return(js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Rs(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}js(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ms=function(){return(Ms=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ns(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function zs(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Bs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var Us,Fs,Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Cu,Pu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du,qu=n(21),Gu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Hu=new Set(["cn-north-1","cn-northwest-1"]),Wu=new Set(["us-iso-east-1"]),$u=new Set(["us-isob-east-1"]),Ku=new Set(["us-gov-east-1","us-gov-west-1"]),Vu={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:Gu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Hu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Wu.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Ku.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(Ms({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:lo},Yu=Ms(Ms({},Vu),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Vu.serviceId,clientVersion:qu.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),Zu=function(e){function t(t){var n=this,r=Ms(Ms({},Yu),t),o=yo(r),i=ni(go(o)),a=si(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(_o(n.config)),n.middlewareStack.use(Eo(n.config)),n.middlewareStack.use(Ao(n.config)),n.middlewareStack.use(di(n.config)),n}return Rs(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Us||(Us={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Fs||(Fs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Vs||(Vs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ys||(Ys={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Js||(Js={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(fu||(fu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(lu||(lu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(hu||(hu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(pu||(pu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(vu||(vu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Fu||(Fu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Du||(Du={}));var Ju=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return zs(this,(function(m){switch(m.label){case 0:return r=[Ms({},e)],v={},[4,Oc(e.body,t)];case 1:switch(n=Ms.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=kc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Qu(n,t)];case 3:return o=Ms.apply(void 0,[Ms.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 4:return s=[{}],[4,ec(n,t)];case 5:return o=Ms.apply(void 0,[Ms.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 6:return u=[{}],[4,tc(n,t)];case 7:return o=Ms.apply(void 0,[Ms.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 8:return c=[{}],[4,nc(n,t)];case 9:return o=Ms.apply(void 0,[Ms.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 10:return f=[{}],[4,oc(n,t)];case 11:return o=Ms.apply(void 0,[Ms.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 12:return l=[{}],[4,ic(n,t)];case 13:return o=Ms.apply(void 0,[Ms.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 14:return d=[{}],[4,ac(n,t)];case 15:return o=Ms.apply(void 0,[Ms.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 16:return h=[{}],[4,sc(n,t)];case 17:return o=Ms.apply(void 0,[Ms.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Ms(Ms({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ec(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xu=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return zs(this,(function(m){switch(m.label){case 0:return r=[Ms({},e)],v={},[4,Oc(e.body,t)];case 1:switch(n=Ms.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=kc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Qu(n,t)];case 3:return o=Ms.apply(void 0,[Ms.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 4:return s=[{}],[4,ec(n,t)];case 5:return o=Ms.apply(void 0,[Ms.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 6:return u=[{}],[4,nc(n,t)];case 7:return o=Ms.apply(void 0,[Ms.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 8:return c=[{}],[4,rc(n,t)];case 9:return o=Ms.apply(void 0,[Ms.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 10:return f=[{}],[4,oc(n,t)];case 11:return o=Ms.apply(void 0,[Ms.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 12:return l=[{}],[4,ic(n,t)];case 13:return o=Ms.apply(void 0,[Ms.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 14:return d=[{}],[4,ac(n,t)];case 15:return o=Ms.apply(void 0,[Ms.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 16:return h=[{}],[4,sc(n,t)];case 17:return o=Ms.apply(void 0,[Ms.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Ms(Ms({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ec(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Qu=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=dc(n,t),[2,Ms({name:"ExternalServiceException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ec=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=gc(n,t),[2,Ms({name:"InternalErrorException",$fault:"server",$metadata:Ec(e)},r)]}))}))},tc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=vc(n,t),[2,Ms({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ec(e)},r)]}))}))},nc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=mc(n,t),[2,Ms({name:"InvalidParameterException",$fault:"client",$metadata:Ec(e)},r)]}))}))},rc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=yc(n,t),[2,Ms({name:"LimitExceededException",$fault:"client",$metadata:Ec(e)},r)]}))}))},oc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=bc(n,t),[2,Ms({name:"NotAuthorizedException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ic=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=wc(n,t),[2,Ms({name:"ResourceConflictException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ac=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=_c(n,t),[2,Ms({name:"ResourceNotFoundException",$fault:"client",$metadata:Ec(e)},r)]}))}))},sc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=Sc(n,t),[2,Ms({name:"TooManyRequestsException",$fault:"client",$metadata:Ec(e)},r)]}))}))},uc=function(e,t){return Ms(Ms(Ms({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:fc(e.Logins,t)})},cc=function(e,t){return Ms(Ms(Ms({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:fc(e.Logins,t)})},fc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Bs(t,2),o=r[0],i=r[1];return null===i?e:Ms(Ms({},e),((n={})[o]=i,n))}),{})},lc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},dc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},hc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?lc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},pc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},gc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ec=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},xc=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ac=function(e,t,n,r,o){return Ns(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return zs(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Oc=function(e,t){return function(e,t){return xc(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},kc=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},Lc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Rs(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:cu.filterSensitiveLog,outputFilterSensitiveLog:fu.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(cc(e,t)),[2,Ac(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o;return zs(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Xu(e,t)]:[4,Oc(e.body,t)];case 1:return n=i.sent(),{},r=pc(n,t),o=Ms({$metadata:Ec(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ic=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Rs(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:iu.filterSensitiveLog,outputFilterSensitiveLog:su.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(uc(e,t)),[2,Ac(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o;return zs(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ju(e,t)]:[4,Oc(e.body,t)];case 1:return n=i.sent(),{},r=hc(n,t),o=Ms({$metadata:Ec(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cc=function(){return(Cc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Pc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Tc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},jc=new g("Credentials"),Rc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=zi.refreshGoogleToken,this._refreshHandlers.facebook=Bi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Cc(Cc({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return jc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return jc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?jc.debug("getting old cred promise"):(jc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Pc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Tc(this,(function(s){switch(s.label){case 0:if(jc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return jc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(jc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];jc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),jc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){jc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return jc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(jc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(jc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(jc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Oi(n,[],1e4).then((function(e){return jc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),jc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return jc.debug("no credentials for expiration check"),!0;jc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Pc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Tc(this,(function(u){switch(u.label){case 0:return jc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(jc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(jc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Zu({region:n,customUserAgent:_()}),a=void 0,a=r?Ls({identityId:r,client:i})():function(){return Pc(s,void 0,void 0,(function(){var e;return Tc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Lc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ls({client:i,identityId:e})()]}}))}))}().catch((function(e){return Pc(s,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return Pc(s,void 0,void 0,(function(){var n=this;return Tc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(jc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return Pc(n,void 0,void 0,(function(){var e;return Tc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Lc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ls({client:i,identityId:e})()]}}))}))}().catch((function(e){return Pc(n,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return jc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return jc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Zu({region:u,customUserAgent:_()}),f=void 0;r?f=Ls({identityId:r,logins:i,client:c})():f=Ts({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;jc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return jc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return jc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Zu({region:o,customUserAgent:_()}),c=Pc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Tc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new Lc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Ic({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(jc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&jc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return Pc(t,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return Pc(o,void 0,void 0,(function(){var o,s,u,c,f;return Tc(this,(function(l){switch(l.label){case 0:if(jc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){jc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return jc.debug("Failed to load credentials",e),jc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(jc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Pc(this,void 0,void 0,(function(){return Tc(this,(function(e){return this._credentials=null,this._credentials_source=null,jc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return Pc(this,void 0,void 0,(function(){var e,t;return Tc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),jc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return Pc(this,void 0,void 0,(function(){var t,n;return Tc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),jc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return Pc(this,void 0,void 0,(function(){var e;return Tc(this,(function(t){return e=this._config.identityPoolId,jc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),Mc=new Rc(null);b.register(Mc);var Nc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},zc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Bc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Uc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Bc(arguments[t]));return e},Fc=new g("AWSCloudWatch"),Dc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){Fc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Uc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r,o;return zc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,Fc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Nc(this,void 0,void 0,(function(){var n,r,o,i;return zc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,Fc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r;return zc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return Fc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,Fc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Nc(this,void 0,void 0,(function(){var e=this;return zc(this,(function(t){switch(t.label){case 0:return[4,Mc.get().then((function(t){if(!t)return!1;var n=Mc.shear(t);return Fc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return Fc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Nc(this,void 0,void 0,(function(){var e,t;return zc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),Fc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Nc(this,void 0,void 0,(function(){var e,t,n,r,o;return zc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),Fc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";Fc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r;return zc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),Fc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Nc(e,void 0,void 0,(function(){var e;return zc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),Fc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),qc={},Gc={addEventListener:function(e,t){}},Hc=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Wc(e){return(Wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var $c=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Wc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),Kc=n(5);function Vc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Yc=function(){return(Yc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?Kc.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=Kc.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Vc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Vc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Yc(Yc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Kc.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Yc(Yc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Yc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Kc.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Jc=Object(U.b)().isBrowser,Xc=function(){function e(e){void 0===e&&(e={}),this.cookies=new Zc,this.store=Jc?window.localStorage:Object.create(null),this.cookies=e.req?new Zc(e.req.headers.cookie):new Zc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Jc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),Qc="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,ef=Qc?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",tf=Qc?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",nf="x-amz-user-agent",rf=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),of=n(22),af=n.n(of).a,sf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uf=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return af.from([{online:!0}]);var n=Object(U.h)()?self:window;return new af((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=sf(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function cf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function ff(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var lf={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}])}));
31
+ t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,f=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+l],l+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+e[t+l],l+=d,f-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=c}return(h?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(a++,u/=2),a+l>=f?(s=0,a=f):a+l>=1?(s=(t*u-1)*Math.pow(2,o),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=p,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(0).__exportStar)(n(46),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),o=n(17),i=n(47),a=n(16),s=function(){function e(e){if(this.hash=new i.RawSha256,e){this.outer=new i.RawSha256;var t=function(e){var t=(0,a.convertToBuffer)(e);if(t.byteLength>o.BLOCK_SIZE){var n=new i.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(o.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(o.BLOCK_SIZE);n.set(t);for(var r=0;r<o.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,a.isEmptyData)(e)&&!this.error)try{this.hash.update((0,a.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(17),o=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var o=this.bufferLength;o<r.BLOCK_SIZE;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<r.BLOCK_SIZE-8;o++)t.setUint8(o,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(r.DIGEST_LENGTH);for(o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],i=t[2],a=t[3],s=t[4],u=t[5],c=t[6],f=t[7],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+(s&u^~s&c)|0)+(f+(r.KEY[l]+this.temp[l]|0)|0)|0,v=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&i^o&i)|0;f=c,c=u,u=s,s=a+g|0,a=i,i=o,o=n,n=g+v|0}t[0]+=n,t[1]+=o,t[2]+=i,t[3]+=a,t[4]+=s,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(49),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportsZeroByteGCM=t.supportsSubtleCrypto=t.supportsSecureRandom=t.supportsWebCrypto=void 0;var r=n(0),o=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function i(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function a(e){return e&&o.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!i(e)||"object"!=typeof e.crypto.subtle)&&a(e.crypto.subtle)},t.supportsSecureRandom=i,t.supportsSubtleCrypto=a,t.supportsZeroByteGCM=function(e){return r.__awaiter(this,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:if(!a(e))return[2,!1];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,e.generateKey({name:"AES-GCM",length:128},!1,["encrypt"])];case 2:return t=n.sent(),[4,e.encrypt({name:"AES-GCM",iv:new Uint8Array(Array(12)),additionalData:new Uint8Array(Array(16)),tagLength:128},t,new Uint8Array(0))];case 3:return[2,16===n.sent().byteLength];case 4:return n.sent(),[2,!1];case 5:return[2]}}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);r.__exportStar(n(51),t),r.__exportStar(n(52),t),r.__exportStar(n(53),t),r.__exportStar(n(54),t),r.__exportStar(n(55),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMsWindow=void 0;var r=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];t.isMsWindow=function(e){if(function(e){return"MSInputMethodContext"in e&&"msCrypto"in e}(e)&&void 0!==e.msCrypto.subtle){var t=e.msCrypto,n=t.getRandomValues,o=t.subtle;return r.map((function(e){return o[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Observable=void 0;var a=function(){return"function"==typeof Symbol},s=function(e){return a()&&Boolean(Symbol[e])},u=function(e){return s(e)?Symbol[e]:"@@"+e};a()&&!s("observable")&&(Symbol.observable=Symbol("observable"));var c=u("iterator"),f=u("observable"),l=u("species");function d(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:E}function p(e){return e instanceof E}function g(e){g.log?g.log(e):setTimeout((function(){throw e}))}function v(e){Promise.resolve().then((function(){try{e()}catch(e){g(e)}}))}function m(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=d(t,"unsubscribe");n&&n.call(t)}}catch(e){g(e)}}function y(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function b(e,t,n){e._state="running";var r=e._observer;try{var o=d(r,t);switch(t){case"next":o&&o.call(r,n);break;case"error":if(y(e),!o)throw n;o.call(r,n);break;case"complete":y(e),o&&o.call(r)}}catch(e){g(e)}"closed"===e._state?m(e):"running"===e._state&&(e._state="ready")}function w(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void v((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(b(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void b(e,t,n);e._queue.push({type:t,value:n})}}var _=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var o=new S(this);try{this._cleanup=n.call(void 0,o)}catch(e){o.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(y(this),m(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){w(this._subscription,"next",e)}},{key:"error",value:function(e){w(this._subscription,"error",e)}},{key:"complete",value:function(){w(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),E=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new _(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var o=t.subscribe({next:function(t){try{e(t,i)}catch(e){r(e),o.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function i(){o.unsubscribe(),n()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this),r=arguments.length>1,o=!1,i=arguments[1],a=i;return new n((function(n){return t.subscribe({next:function(t){var i=!o;if(o=!0,!i||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!o&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=h(this);return new o((function(t){var r,i=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){i===n.length?(r=void 0,t.complete()):e(o.from(n[i++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=h(this);return new n((function(r){var o=[],i=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var i=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=o.indexOf(i);e>=0&&o.splice(e,1),a()}});o.push(i)},error:function(e){r.error(e)},complete:function(){a()}});function a(){i.closed&&0===o.length&&r.complete()}return function(){o.forEach((function(e){return e.unsubscribe()})),i.unsubscribe()}}))}},{key:f,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=d(t,f);if(r){var o=r.call(t);if(Object(o)!==o)throw new TypeError(o+" is not an object");return p(o)&&o.constructor===n?o:new n((function(e){return o.subscribe(e)}))}if(s("iterator")&&(r=d(t,c)))return new n((function(e){v((function(){if(!e.closed){var n=!0,o=!1,i=void 0;try{for(var a,s=r.call(t)[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(e.next(u),e.closed)return}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){v((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="function"==typeof this?this:e;return new o((function(e){v((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=E,a()&&Object.defineProperty(E,Symbol("extensions"),{value:{symbol:f,hostReportError:g},configurable:!0})},function(e,t,n){"use strict";n.r(t),n.d(t,"AmplifyClass",(function(){return y})),n.d(t,"ClientDevice",(function(){return x})),n.d(t,"ConsoleLogger",(function(){return g})),n.d(t,"Logger",(function(){return g})),n.d(t,"missingConfig",(function(){return A})),n.d(t,"invalidParameter",(function(){return O})),n.d(t,"Hub",(function(){return T})),n.d(t,"I18n",(function(){return B})),n.d(t,"isEmpty",(function(){return U.e})),n.d(t,"sortByField",(function(){return U.k})),n.d(t,"objectLessAttributes",(function(){return U.j})),n.d(t,"filenameToContentType",(function(){return U.c})),n.d(t,"isTextFile",(function(){return U.g})),n.d(t,"generateRandomString",(function(){return U.d})),n.d(t,"makeQuerablePromise",(function(){return U.i})),n.d(t,"isWebWorker",(function(){return U.h})),n.d(t,"browserOrNode",(function(){return U.b})),n.d(t,"transferKeyToLowerCase",(function(){return U.l})),n.d(t,"transferKeyToUpperCase",(function(){return U.m})),n.d(t,"isStrictObject",(function(){return U.f})),n.d(t,"JS",(function(){return U.a})),n.d(t,"Signer",(function(){return ue})),n.d(t,"parseMobileHubConfig",(function(){return le})),n.d(t,"Parser",(function(){return de})),n.d(t,"AWSCloudWatchProvider",(function(){return Dc})),n.d(t,"FacebookOAuth",(function(){return Bi})),n.d(t,"GoogleOAuth",(function(){return zi})),n.d(t,"Linking",(function(){return qc})),n.d(t,"AppState",(function(){return Gc})),n.d(t,"AsyncStorage",(function(){return Hc})),n.d(t,"Credentials",(function(){return Mc})),n.d(t,"CredentialsClass",(function(){return Rc})),n.d(t,"ServiceWorker",(function(){return $c})),n.d(t,"StorageHelper",(function(){return vi})),n.d(t,"MemoryStorage",(function(){return gi})),n.d(t,"UniversalStorage",(function(){return Xc})),n.d(t,"Platform",(function(){return w})),n.d(t,"getAmplifyUserAgent",(function(){return _})),n.d(t,"INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",(function(){return ef})),n.d(t,"INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",(function(){return tf})),n.d(t,"USER_AGENT_HEADER",(function(){return nf})),n.d(t,"Constants",(function(){return lf})),n.d(t,"NonRetryableError",(function(){return Ei})),n.d(t,"retry",(function(){return xi})),n.d(t,"jitteredBackoff",(function(){return Ai})),n.d(t,"jitteredExponentialRetry",(function(){return Oi})),n.d(t,"Mutex",(function(){return rf})),n.d(t,"Reachability",(function(){return uf})),n.d(t,"DateUtils",(function(){return V})),n.d(t,"urlSafeEncode",(function(){return cf})),n.d(t,"urlSafeDecode",(function(){return ff})),n.d(t,"AWS_CLOUDWATCH_BASE_BUFFER_SIZE",(function(){return o})),n.d(t,"AWS_CLOUDWATCH_CATEGORY",(function(){return s})),n.d(t,"AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE",(function(){return i})),n.d(t,"AWS_CLOUDWATCH_MAX_EVENT_SIZE",(function(){return a})),n.d(t,"AWS_CLOUDWATCH_PROVIDER_NAME",(function(){return u})),n.d(t,"NO_CREDS_ERROR_STRING",(function(){return c})),n.d(t,"RETRY_ERROR_CODES",(function(){return f})),n.d(t,"Amplify",(function(){return b}));var r,o=26,i=1048576,a=256e3,s="Logging",u="AWSCloudWatch",c="No credentials",f=["ResourceNotFoundException","InvalidSequenceTokenException"],l=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},d=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},h=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e},p={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5};!function(e){e.DEBUG="DEBUG",e.ERROR="ERROR",e.INFO="INFO",e.WARN="WARN",e.VERBOSE="VERBOSE"}(r||(r={}));var g=function(){function e(e,t){void 0===t&&(t=r.WARN),this.name=e,this.level=t,this._pluggables=[]}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype.configure=function(e){return e?(this._config=e,this._config):this._config},e.prototype._log=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=this.level;e.LOG_LEVEL&&(s=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(s=window.LOG_LEVEL);var u=p[s],c=p[t];if(c>=u){var f=console.log.bind(console);t===r.ERROR&&console.error&&(f=console.error.bind(console)),t===r.WARN&&console.warn&&(f=console.warn.bind(console));var d="["+t+"] "+this._ts()+" "+this.name,h="";if(1===i.length&&"string"==typeof i[0])f(h=d+" - "+i[0]);else if(1===i.length)h=d+" "+i[0],f(d,i[0]);else if("string"==typeof i[0]){var g=i.slice(1);1===g.length&&(g=g[0]),h=d+" - "+i[0]+" "+g,f(d+" - "+i[0],g)}else h=d+" "+i,f(d,i);try{for(var v=l(this._pluggables),m=v.next();!m.done;m=v.next()){var y=m.value,b={message:h,timestamp:Date.now()};y.pushLogs([b])}}catch(e){n={error:e}}finally{try{m&&!m.done&&(o=v.return)&&o.call(v)}finally{if(n)throw n.error}}}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.INFO],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.WARN],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.ERROR],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.DEBUG],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,h([r.VERBOSE],e))},e.prototype.addPluggable=function(e){e&&e.getCategoryName()===s&&(this._pluggables.push(e),e.configure(this._config))},e.prototype.listPluggables=function(){return this._pluggables},e.LOG_LEVEL=null,e}(),v=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},m=new g("Amplify"),y=function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Geo=null,this.Logger=g,this.ServiceWorker=null}return e.prototype.register=function(e){m.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):m.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),m.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=v(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}(),b=new y,w={userAgent:"aws-amplify/4.5.7 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(w.product=navigator.product||"",w.navigator=navigator||null,navigator.product){case"ReactNative":w.userAgent="aws-amplify/4.5.7 react-native",w.isReactNative=!0;break;default:w.userAgent="aws-amplify/4.5.7 js",w.isReactNative=!1}var _=function(){return w.userAgent},S=new g("ClientDevice_Browser");function E(){return"undefined"==typeof window?{}:function(){if("undefined"==typeof window)return S.warn("No window object available to get browser client info"),{};var e=window.navigator;if(!e)return S.warn("No navigator object available to get browser client info"),{};var t=e.platform,n=e.product,r=e.vendor,o=e.userAgent,i=e.language,a=function(e){var t=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(e);if(t)return{type:t[1],version:t[2]};var n=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(e);if(n)return{type:n[1],version:n[2]};var r=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(e);if(r)return{type:r[1],version:r[2]};var o=/.+(Safari)\/([0-9\.]+).*/i.exec(e);if(o)return{type:o[1],version:o[2]};var i=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(e);if(i)return{type:i[1],version:i[2]};var a=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(e);if(a)return{type:a[1],version:a[2]};return{type:"",version:""}}(o),s=(u=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),u&&u[1]||"");var u;return{platform:t,make:n||r,model:a.type,version:a.version,appVersion:[a.type,a.version].join("/"),language:i,timezone:s}}()}var x=function(){function e(){}return e.clientInfo=function(){return E()},e.dimension=function(){return"undefined"==typeof window?(S.warn("No window object available to get browser client info"),{width:320,height:320}):{width:window.innerWidth,height:window.innerHeight}},e}();function A(e){return new Error("Missing config value of "+e)}function O(e){return new Error("Invalid parameter value of "+e)}var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},L=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},I=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(L(arguments[t]));return e},C=new g("Hub"),P="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var T=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void C.warn("No listeners for "+e);this.patterns=I(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void C.warn("No listeners for "+e);this.listeners[e]=I(r.filter((function(e){return e.callback!==t})))}},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===P||C.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var o={channel:e,payload:k({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(e){C.error(e)}},e.prototype.listen=function(e,t,n){var r,o=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))C.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var i=this.listeners[e];i||(i=[],this.listeners[e]=i),i.push({name:n,callback:r})}return function(){o.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){C.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(e){C.error(e)}})),this.patterns.length>0){if(!n.message)return void C.warn("Cannot perform pattern matching without a message key");var o=n.message;this.patterns.forEach((function(t){var n=o.match(t.pattern);if(n){var r=L(n).slice(1),i=k(k({},e),{patternInfo:r});try{t.callback(i)}catch(e){C.error(e)}}}))}},e}())("__default__"),j=new g("I18n"),R=function(){function e(e){this._options=null,this._lang=null,this._dict={},this._options=Object.assign({},e),this._lang=this._options.language,!this._lang&&"undefined"!=typeof window&&window&&window.navigator&&(this._lang=window.navigator.language),j.debug(this._lang)}return e.prototype.setLanguage=function(e){this._lang=e},e.prototype.get=function(e,t){if(void 0===t&&(t=void 0),!this._lang)return void 0!==t?t:e;var n=this._lang,r=this.getByLanguage(e,n);return r||(n.indexOf("-")>0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map((function(n){t.putVocabulariesForLanguage(n,e[n])}))},e}(),M=new g("I18n"),N=null,z=null,B=function(){function e(){}return e.configure=function(t){return M.debug("configure I18n"),t?(N=Object.assign({},N,t.I18n||t),e.createInstance(),N):N},e.getModuleName=function(){return"I18n"},e.createInstance=function(){M.debug("create I18n instance"),z||(z=new R(N))},e.setLanguage=function(t){return e.checkConfig(),z.setLanguage(t)},e.get=function(t,n){return e.checkConfig()?z.get(t,n):void 0===n?t:n},e.putVocabulariesForLanguage=function(t,n){return e.checkConfig(),z.putVocabulariesForLanguage(t,n)},e.putVocabularies=function(t){return e.checkConfig(),z.putVocabularies(t)},e.checkConfig=function(){return z||(z=new R(N)),!0},e}();b.register(B);for(var U=n(1),F=n(8),D={},q={},G=0;G<256;G++){var H=G.toString(16).toLowerCase();1===H.length&&(H="0"+H),D[G]=H,q[H]=G}function W(e){for(var t="",n=0;n<e.byteLength;n++)t+=D[e[n]];return t}var $=n(3),K=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},V={clockOffset:0,getDateWithClockOffset:function(){return V.clockOffset?new Date((new Date).getTime()+V.clockOffset):new Date},getClockOffset:function(){return V.clockOffset},getHeaderStringFromDate:function(e){return void 0===e&&(e=V.getDateWithClockOffset()),e.toISOString().replace(/[:\-]|\.\d{3}/g,"")},getDateFromHeaderString:function(e){var t=K(e.match(/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2}).+/),7),n=t[1],r=t[2],o=t[3],i=t[4],a=t[5],s=t[6];return new Date(Date.UTC(Number(n),Number(r)-1,Number(o),Number(i),Number(a),Number(s)))},isClockSkewed:function(e){return Math.abs(e.getTime()-V.getDateWithClockOffset().getTime())>=3e5},isClockSkewError:function(e){if(!e.response||!e.response.headers)return!1;var t=e.response.headers;return Boolean(["BadRequestException","InvalidSignatureException"].includes(t["x-amzn-errortype"])&&(t.date||t.Date))},setClockOffset:function(e){V.clockOffset=e}};function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Z=function(){return(Z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},J=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},X=new g("Signer"),Q=function(e,t){var n=new F.Sha256(e);return n.update(t),n.digestSync()},ee=function(e){var t=e||"",n=new F.Sha256;return n.update(t),W(n.digestSync())},te=function(e){return Object.keys(e).map((function(e){return e.toLowerCase()})).sort().join(";")},ne=function(e){var t,n,r=Object($.parse)(e.url);return[e.method||"/",encodeURIComponent(r.pathname).replace(/%2F/gi,"/"),(n=r.query,n&&0!==n.length?n.split("&").map((function(e){var t=e.split("=");if(1===t.length)return e;var n=t[1].replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}));return t[0]+"="+n})).sort((function(e,t){var n=e.split("=")[0],r=t.split("=")[0];return n===r?e<t?-1:1:n<r?-1:1})).join("&"):""),(t=e.headers,t&&0!==Object.keys(t).length?Object.keys(t).map((function(e){return{key:e.toLowerCase(),value:t[e]?t[e].trim().replace(/\s+/g," "):""}})).sort((function(e,t){return e.key<t.key?-1:1})).map((function(e){return e.key+":"+e.value})).join("\n")+"\n":""),te(e.headers),ee(e.data)].join("\n")},re=function(e){var t=(Object($.parse)(e.url).host.match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)||[]).slice(1,3);return"es"===t[1]&&(t=t.reverse()),{service:e.service||t[0],region:e.region||t[1]}},oe=function(e,t,n){return[e,t,n,"aws4_request"].join("/")},ie=function(e,t,n,r){return[e,n,r,ee(t)].join("\n")},ae=function(e,t,n){X.debug(n);var r=Q("AWS4"+e,t),o=Q(r,n.region),i=Q(o,n.service);return Q(i,"aws4_request")},se=function(e,t){return W(Q(e,t))},ue=function(){function e(){}return e.sign=function(e,t,n){void 0===n&&(n=null),e.headers=e.headers||{};var r=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),o=r.substr(0,8),i=Object($.parse)(e.url);e.headers.host=i.host,e.headers["x-amz-date"]=r,t.session_token&&(e.headers["X-Amz-Security-Token"]=t.session_token);var a=ne(e);X.debug(a);var s=n||re(e),u=oe(o,s.region,s.service),c=ie("AWS4-HMAC-SHA256",a,r,u),f=ae(t.secret_key,o,s),l=se(f,c),d=function(e,t,n,r,o){return[e+" Credential="+t+"/"+n,"SignedHeaders="+r,"Signature="+o].join(", ")}("AWS4-HMAC-SHA256",t.access_key,u,te(e.headers),l);return e.headers.Authorization=d,e},e.signUrl=function(e,t,n,r){var o="object"===Y(e)?e.url:e,i="object"===Y(e)?e.method:"GET",a="object"===Y(e)?e.body:void 0,s=V.getDateWithClockOffset().toISOString().replace(/[:\-]|\.\d{3}/g,""),u=s.substr(0,8),c=Object($.parse)(o,!0,!0),f=(c.search,J(c,["search"])),l={host:f.host},d=n||re({url:Object($.format)(f)}),h=d.region,p=d.service,g=oe(u,h,p),v=t.session_token&&"iotdevicegateway"!==p,m=Z(Z(Z({"X-Amz-Algorithm":"AWS4-HMAC-SHA256","X-Amz-Credential":[t.access_key,g].join("/"),"X-Amz-Date":s.substr(0,16)},v?{"X-Amz-Security-Token":""+t.session_token}:{}),r?{"X-Amz-Expires":""+r}:{}),{"X-Amz-SignedHeaders":Object.keys(l).join(",")}),y=ne({method:i,url:Object($.format)(Z(Z({},f),{query:Z(Z({},f.query),m)})),headers:l,data:a}),b=ie("AWS4-HMAC-SHA256",y,s,g),w=ae(t.secret_key,u,{region:h,service:p}),_=se(w,b),S=Z({"X-Amz-Signature":_},t.session_token&&{"X-Amz-Security-Token":t.session_token});return Object($.format)({protocol:f.protocol,slashes:!0,hostname:f.hostname,port:f.port,pathname:f.pathname,query:Z(Z(Z({},f.query),m),S)})},e}(),ce=function(){return(ce=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},fe=new g("Parser"),le=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var r={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=r}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},e.Logging&&(n.Logging=ce(ce({},e.Logging),{region:e.aws_project_region})),e.geo&&(n.Geo=Object.assign({},e.geo),e.geo.amazon_location_service&&(n.Geo={AmazonLocationService:e.geo.amazon_location_service})),n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),n.Logging=Object.assign({},n.Logging,e.Logging),fe.debug("parse config",e,"to amplifyconfig",n),n},de=function(){function e(){}return e.parseMobilehubConfig=le,e}(),he=function(e,t){return(he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function pe(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ge=function(){return(ge=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function ve(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function me(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function ye(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var be,we,_e,Se,Ee,xe,Ae,Oe,ke,Le,Ie,Ce,Pe,Te,je,Re,Me,Ne,ze,Be,Ue,Fe,De,qe,Ge,He,We,$e,Ke,Ve,Ye,Ze,Je,Xe,Qe,et,tt,nt,rt,ot,it,at,st,ut,ct,ft,lt,dt,ht,pt,gt,vt,mt,yt,bt,wt,_t,St,Et,xt,At,Ot,kt,Lt,It,Ct,Pt,Tt,jt,Rt,Mt,Nt,zt,Bt,Ut,Ft,Dt,qt,Gt,Ht,Wt,$t,Kt,Vt,Yt,Zt,Jt,Xt,Qt,en,tn,nn,rn,on,an,sn,un,cn,fn,ln,dn,hn,pn,gn;Object.create;(be||(be={})).filterSensitiveLog=function(e){return ge({},e)},(we||(we={})).filterSensitiveLog=function(e){return ge({},e)},(_e||(_e={})).filterSensitiveLog=function(e){return ge({},e)},(Se||(Se={})).filterSensitiveLog=function(e){return ge({},e)},(Ee||(Ee={})).filterSensitiveLog=function(e){return ge({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return ge({},e)},(Ae||(Ae={})).filterSensitiveLog=function(e){return ge({},e)},(Oe||(Oe={})).filterSensitiveLog=function(e){return ge({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return ge({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return ge({},e)},(Ie||(Ie={})).filterSensitiveLog=function(e){return ge({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return ge({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return ge({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return ge({},e)},(je||(je={})).filterSensitiveLog=function(e){return ge({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return ge({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return ge({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return ge({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return ge({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return ge({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return ge({},e)},(Fe||(Fe={})).filterSensitiveLog=function(e){return ge({},e)},(De||(De={})).filterSensitiveLog=function(e){return ge({},e)},(qe||(qe={})).filterSensitiveLog=function(e){return ge({},e)},(Ge||(Ge={})).filterSensitiveLog=function(e){return ge({},e)},(He||(He={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.PENDING="PENDING",e.PENDING_CANCEL="PENDING_CANCEL",e.RUNNING="RUNNING"}(We||(We={})),($e||($e={})).filterSensitiveLog=function(e){return ge({},e)},(Ke||(Ke={})).filterSensitiveLog=function(e){return ge({},e)},(Ve||(Ve={})).filterSensitiveLog=function(e){return ge({},e)},(Ye||(Ye={})).filterSensitiveLog=function(e){return ge({},e)},(Ze||(Ze={})).filterSensitiveLog=function(e){return ge({},e)},(Je||(Je={})).filterSensitiveLog=function(e){return ge({},e)},(Xe||(Xe={})).filterSensitiveLog=function(e){return ge({},e)},(Qe||(Qe={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.LastEventTime="LastEventTime",e.LogStreamName="LogStreamName"}(et||(et={})),(tt||(tt={})).filterSensitiveLog=function(e){return ge({},e)},(nt||(nt={})).filterSensitiveLog=function(e){return ge({},e)},(rt||(rt={})).filterSensitiveLog=function(e){return ge({},e)},(ot||(ot={})).filterSensitiveLog=function(e){return ge({},e)},(it||(it={})).filterSensitiveLog=function(e){return ge({},e)},(at||(at={})).filterSensitiveLog=function(e){return ge({},e)},(st||(st={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.Cancelled="Cancelled",e.Complete="Complete",e.Failed="Failed",e.Running="Running",e.Scheduled="Scheduled"}(ut||(ut={})),(ct||(ct={})).filterSensitiveLog=function(e){return ge({},e)},(ft||(ft={})).filterSensitiveLog=function(e){return ge({},e)},(lt||(lt={})).filterSensitiveLog=function(e){return ge({},e)},(dt||(dt={})).filterSensitiveLog=function(e){return ge({},e)},(ht||(ht={})).filterSensitiveLog=function(e){return ge({},e)},(pt||(pt={})).filterSensitiveLog=function(e){return ge({},e)},(gt||(gt={})).filterSensitiveLog=function(e){return ge({},e)},(vt||(vt={})).filterSensitiveLog=function(e){return ge({},e)},(mt||(mt={})).filterSensitiveLog=function(e){return ge({},e)},(yt||(yt={})).filterSensitiveLog=function(e){return ge({},e)},function(e){e.ByLogStream="ByLogStream",e.Random="Random"}(bt||(bt={})),(wt||(wt={})).filterSensitiveLog=function(e){return ge({},e)},(_t||(_t={})).filterSensitiveLog=function(e){return ge({},e)},(St||(St={})).filterSensitiveLog=function(e){return ge({},e)},(Et||(Et={})).filterSensitiveLog=function(e){return ge({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return ge({},e)},(At||(At={})).filterSensitiveLog=function(e){return ge({},e)},(Ot||(Ot={})).filterSensitiveLog=function(e){return ge({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return ge({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return ge({},e)},(It||(It={})).filterSensitiveLog=function(e){return ge({},e)},(Ct||(Ct={})).filterSensitiveLog=function(e){return ge({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return ge({},e)},(Tt||(Tt={})).filterSensitiveLog=function(e){return ge({},e)},(jt||(jt={})).filterSensitiveLog=function(e){return ge({},e)},(Rt||(Rt={})).filterSensitiveLog=function(e){return ge({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return ge({},e)},(Nt||(Nt={})).filterSensitiveLog=function(e){return ge({},e)},(zt||(zt={})).filterSensitiveLog=function(e){return ge({},e)},(Bt||(Bt={})).filterSensitiveLog=function(e){return ge({},e)},(Ut||(Ut={})).filterSensitiveLog=function(e){return ge({},e)},(Ft||(Ft={})).filterSensitiveLog=function(e){return ge({},e)},(Dt||(Dt={})).filterSensitiveLog=function(e){return ge({},e)},(qt||(qt={})).filterSensitiveLog=function(e){return ge({},e)},(Gt||(Gt={})).filterSensitiveLog=function(e){return ge({},e)},(Ht||(Ht={})).filterSensitiveLog=function(e){return ge({},e)},(Wt||(Wt={})).filterSensitiveLog=function(e){return ge({},e)},($t||($t={})).filterSensitiveLog=function(e){return ge({},e)},(Kt||(Kt={})).filterSensitiveLog=function(e){return ge({},e)},(Vt||(Vt={})).filterSensitiveLog=function(e){return ge({},e)},(Yt||(Yt={})).filterSensitiveLog=function(e){return ge({},e)},(Zt||(Zt={})).filterSensitiveLog=function(e){return ge({},e)},(Jt||(Jt={})).filterSensitiveLog=function(e){return ge({},e)},(Xt||(Xt={})).filterSensitiveLog=function(e){return ge({},e)},(Qt||(Qt={})).filterSensitiveLog=function(e){return ge({},e)},(en||(en={})).filterSensitiveLog=function(e){return ge({},e)},(tn||(tn={})).filterSensitiveLog=function(e){return ge({},e)},(nn||(nn={})).filterSensitiveLog=function(e){return ge({},e)},(rn||(rn={})).filterSensitiveLog=function(e){return ge({},e)},(on||(on={})).filterSensitiveLog=function(e){return ge({},e)},(an||(an={})).filterSensitiveLog=function(e){return ge({},e)},(sn||(sn={})).filterSensitiveLog=function(e){return ge({},e)},(un||(un={})).filterSensitiveLog=function(e){return ge({},e)},(cn||(cn={})).filterSensitiveLog=function(e){return ge({},e)},(fn||(fn={})).filterSensitiveLog=function(e){return ge({},e)},(ln||(ln={})).filterSensitiveLog=function(e){return ge({},e)},(dn||(dn={})).filterSensitiveLog=function(e){return ge({},e)},(hn||(hn={})).filterSensitiveLog=function(e){return ge({},e)},(pn||(pn={})).filterSensitiveLog=function(e){return ge({},e)},(gn||(gn={})).filterSensitiveLog=function(e){return ge({},e)};var vn=function(){function e(e){this.statusCode=e.statusCode,this.headers=e.headers||{},this.body=e.body}return e.isInstance=function(e){if(!e)return!1;var t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers},e}(),mn=n(0),yn=function(){function e(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.substr(-1)?e.protocol+":":e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?"/"+e.path:e.path:"/"}return e.isInstance=function(e){if(!e)return!1;var t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers},e.prototype.clone=function(){var t,n=new e(Object(mn.__assign)(Object(mn.__assign)({},this),{headers:Object(mn.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Object(mn.__assign)(Object(mn.__assign)({},e),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{}))),n},e}();var bn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h;return me(this,(function(p){switch(p.label){case 0:return r=[ge({},e)],h={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(h.body=p.sent(),h)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"LimitExceededException":case"com.amazonaws.cloudwatchlogs#LimitExceededException":return[3,4];case"OperationAbortedException":case"com.amazonaws.cloudwatchlogs#OperationAbortedException":return[3,6];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10]}return[3,12];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 4:return s=[{}],[4,Ln(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 6:return u=[{}],[4,In(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 8:return c=[{}],[4,Cn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([p.sent()])),{name:i,$metadata:ir(e)}]),[3,13];case 12:l=n.body,i=l.code||l.Code||i,o=ge(ge({},l),{name:""+i,message:l.message||l.Message||i,$fault:"client",$metadata:ir(e)}),p.label=13;case 13:return d=o.message||o.Message||i,o.message=d,delete o.Message,[2,Promise.reject(Object.assign(new Error(d),o))]}}))}))},wn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d;return me(this,(function(h){switch(h.label){case 0:return r=[ge({},e)],d={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(d.body=h.sent(),d)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceAlreadyExistsException":case"com.amazonaws.cloudwatchlogs#ResourceAlreadyExistsException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,6];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,8]}return[3,10];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 4:return s=[{}],[4,Cn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 6:return u=[{}],[4,Pn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 8:return c=[{}],[4,Tn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([h.sent()])),{name:i,$metadata:ir(e)}]),[3,11];case 10:f=n.body,i=f.code||f.Code||i,o=ge(ge({},f),{name:""+i,message:f.message||f.Message||i,$fault:"client",$metadata:ir(e)}),h.label=11;case 11:return l=o.message||o.Message||i,o.message=l,delete o.Message,[2,Promise.reject(Object.assign(new Error(l),o))]}}))}))},_n=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return r=[ge({},e)],f={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(f.body=l.sent(),f)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,4]}return[3,6];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 4:return s=[{}],[4,Tn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([l.sent()])),{name:i,$metadata:ir(e)}]),[3,7];case 6:u=n.body,i=u.code||u.Code||i,o=ge(ge({},u),{name:""+i,message:u.message||u.Message||i,$fault:"client",$metadata:ir(e)}),l.label=7;case 7:return c=o.message||o.Message||i,o.message=c,delete o.Message,[2,Promise.reject(Object.assign(new Error(c),o))]}}))}))},Sn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},En=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l;return me(this,(function(d){switch(d.label){case 0:return r=[ge({},e)],l={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(l.body=d.sent(),l)])),i="UnknownError",i=cr(e,n.body),i){case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,2];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,4];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,6]}return[3,8];case 2:return a=[{}],[4,On(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 4:return s=[{}],[4,Pn(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 6:return u=[{}],[4,Tn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([d.sent()])),{name:i,$metadata:ir(e)}]),[3,9];case 8:c=n.body,i=c.code||c.Code||i,o=ge(ge({},c),{name:""+i,message:c.message||c.Message||i,$fault:"client",$metadata:ir(e)}),d.label=9;case 9:return f=o.message||o.Message||i,o.message=f,delete o.Message,[2,Promise.reject(Object.assign(new Error(f),o))]}}))}))},xn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p;return me(this,(function(g){switch(g.label){case 0:return r=[ge({},e)],p={},[4,ur(e.body,t)];case 1:switch(n=ge.apply(void 0,r.concat([(p.body=g.sent(),p)])),i="UnknownError",i=cr(e,n.body),i){case"DataAlreadyAcceptedException":case"com.amazonaws.cloudwatchlogs#DataAlreadyAcceptedException":return[3,2];case"InvalidParameterException":case"com.amazonaws.cloudwatchlogs#InvalidParameterException":return[3,4];case"InvalidSequenceTokenException":case"com.amazonaws.cloudwatchlogs#InvalidSequenceTokenException":return[3,6];case"ResourceNotFoundException":case"com.amazonaws.cloudwatchlogs#ResourceNotFoundException":return[3,8];case"ServiceUnavailableException":case"com.amazonaws.cloudwatchlogs#ServiceUnavailableException":return[3,10];case"UnrecognizedClientException":case"com.amazonaws.cloudwatchlogs#UnrecognizedClientException":return[3,12]}return[3,14];case 2:return a=[{}],[4,An(n,t)];case 3:return o=ge.apply(void 0,[ge.apply(void 0,a.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 4:return s=[{}],[4,On(n,t)];case 5:return o=ge.apply(void 0,[ge.apply(void 0,s.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 6:return u=[{}],[4,kn(n,t)];case 7:return o=ge.apply(void 0,[ge.apply(void 0,u.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 8:return c=[{}],[4,Pn(n,t)];case 9:return o=ge.apply(void 0,[ge.apply(void 0,c.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 10:return f=[{}],[4,Tn(n,t)];case 11:return o=ge.apply(void 0,[ge.apply(void 0,f.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 12:return l=[{}],[4,jn(n,t)];case 13:return o=ge.apply(void 0,[ge.apply(void 0,l.concat([g.sent()])),{name:i,$metadata:ir(e)}]),[3,15];case 14:d=n.body,i=d.code||d.Code||i,o=ge(ge({},d),{name:""+i,message:d.message||d.Message||i,$fault:"client",$metadata:ir(e)}),g.label=15;case 15:return h=o.message||o.Message||i,o.message=h,delete o.Message,[2,Promise.reject(Object.assign(new Error(h),o))]}}))}))},An=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=qn(n,t),[2,ge({name:"DataAlreadyAcceptedException",$fault:"client",$metadata:ir(e)},r)]}))}))},On=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=$n(n,t),[2,ge({name:"InvalidParameterException",$fault:"client",$metadata:ir(e)},r)]}))}))},kn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Kn(n,t),[2,ge({name:"InvalidSequenceTokenException",$fault:"client",$metadata:ir(e)},r)]}))}))},Ln=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Vn(n,t),[2,ge({name:"LimitExceededException",$fault:"client",$metadata:ir(e)},r)]}))}))},In=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=Jn(n,t),[2,ge({name:"OperationAbortedException",$fault:"client",$metadata:ir(e)},r)]}))}))},Cn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=tr(n,t),[2,ge({name:"ResourceAlreadyExistsException",$fault:"client",$metadata:ir(e)},r)]}))}))},Pn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=nr(n,t),[2,ge({name:"ResourceNotFoundException",$fault:"client",$metadata:ir(e)},r)]}))}))},Tn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=rr(n,t),[2,ge({name:"ServiceUnavailableException",$fault:"server",$metadata:ir(e)},r)]}))}))},jn=function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n=e.body,r=or(n,t),[2,ge({name:"UnrecognizedClientException",$fault:"client",$metadata:ir(e)},r)]}))}))},Rn=function(e,t){return ge(ge(ge({},void 0!==e.kmsKeyId&&null!==e.kmsKeyId&&{kmsKeyId:e.kmsKeyId}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.tags&&null!==e.tags&&{tags:Dn(e.tags,t)})},Mn=function(e,t){return ge(ge({},void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName})},Nn=function(e,t){return ge(ge(ge({},void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupNamePrefix&&null!==e.logGroupNamePrefix&&{logGroupNamePrefix:e.logGroupNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken})},zn=function(e,t){return ge(ge(ge(ge(ge(ge({},void 0!==e.descending&&null!==e.descending&&{descending:e.descending}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamNamePrefix&&null!==e.logStreamNamePrefix&&{logStreamNamePrefix:e.logStreamNamePrefix}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.orderBy&&null!==e.orderBy&&{orderBy:e.orderBy})},Bn=function(e,t){return ge(ge(ge(ge(ge(ge(ge({},void 0!==e.endTime&&null!==e.endTime&&{endTime:e.endTime}),void 0!==e.limit&&null!==e.limit&&{limit:e.limit}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.nextToken&&null!==e.nextToken&&{nextToken:e.nextToken}),void 0!==e.startFromHead&&null!==e.startFromHead&&{startFromHead:e.startFromHead}),void 0!==e.startTime&&null!==e.startTime&&{startTime:e.startTime})},Un=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return ge(ge({},void 0!==e.message&&null!==e.message&&{message:e.message}),void 0!==e.timestamp&&null!==e.timestamp&&{timestamp:e.timestamp})}(e)}))},Fn=function(e,t){return ge(ge(ge(ge({},void 0!==e.logEvents&&null!==e.logEvents&&{logEvents:Un(e.logEvents)}),void 0!==e.logGroupName&&null!==e.logGroupName&&{logGroupName:e.logGroupName}),void 0!==e.logStreamName&&null!==e.logStreamName&&{logStreamName:e.logStreamName}),void 0!==e.sequenceToken&&null!==e.sequenceToken&&{sequenceToken:e.sequenceToken})},Dn=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=ye(t,2),o=r[0],i=r[1];return null===i?e:ge(ge({},e),((n={})[o]=i,n))}),{})},qn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Gn=function(e,t){return{logGroups:void 0!==e.logGroups&&null!==e.logGroups?Yn(e.logGroups,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Hn=function(e,t){return{logStreams:void 0!==e.logStreams&&null!==e.logStreams?Zn(e.logStreams,t):void 0,nextToken:void 0!==e.nextToken&&null!==e.nextToken?e.nextToken:void 0}},Wn=function(e,t){return{events:void 0!==e.events&&null!==e.events?Xn(e.events,t):void 0,nextBackwardToken:void 0!==e.nextBackwardToken&&null!==e.nextBackwardToken?e.nextBackwardToken:void 0,nextForwardToken:void 0!==e.nextForwardToken&&null!==e.nextForwardToken?e.nextForwardToken:void 0}},$n=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Kn=function(e,t){return{expectedSequenceToken:void 0!==e.expectedSequenceToken&&null!==e.expectedSequenceToken?e.expectedSequenceToken:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Vn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Yn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,kmsKeyId:void 0!==e.kmsKeyId&&null!==e.kmsKeyId?e.kmsKeyId:void 0,logGroupName:void 0!==e.logGroupName&&null!==e.logGroupName?e.logGroupName:void 0,metricFilterCount:void 0!==e.metricFilterCount&&null!==e.metricFilterCount?e.metricFilterCount:void 0,retentionInDays:void 0!==e.retentionInDays&&null!==e.retentionInDays?e.retentionInDays:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0}}(e)}))},Zn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{arn:void 0!==e.arn&&null!==e.arn?e.arn:void 0,creationTime:void 0!==e.creationTime&&null!==e.creationTime?e.creationTime:void 0,firstEventTimestamp:void 0!==e.firstEventTimestamp&&null!==e.firstEventTimestamp?e.firstEventTimestamp:void 0,lastEventTimestamp:void 0!==e.lastEventTimestamp&&null!==e.lastEventTimestamp?e.lastEventTimestamp:void 0,lastIngestionTime:void 0!==e.lastIngestionTime&&null!==e.lastIngestionTime?e.lastIngestionTime:void 0,logStreamName:void 0!==e.logStreamName&&null!==e.logStreamName?e.logStreamName:void 0,storedBytes:void 0!==e.storedBytes&&null!==e.storedBytes?e.storedBytes:void 0,uploadSequenceToken:void 0!==e.uploadSequenceToken&&null!==e.uploadSequenceToken?e.uploadSequenceToken:void 0}}(e)}))},Jn=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Xn=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ingestionTime:void 0!==e.ingestionTime&&null!==e.ingestionTime?e.ingestionTime:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0,timestamp:void 0!==e.timestamp&&null!==e.timestamp?e.timestamp:void 0}}(e)}))},Qn=function(e,t){return{nextSequenceToken:void 0!==e.nextSequenceToken&&null!==e.nextSequenceToken?e.nextSequenceToken:void 0,rejectedLogEventsInfo:void 0!==e.rejectedLogEventsInfo&&null!==e.rejectedLogEventsInfo?er(e.rejectedLogEventsInfo,t):void 0}},er=function(e,t){return{expiredLogEventEndIndex:void 0!==e.expiredLogEventEndIndex&&null!==e.expiredLogEventEndIndex?e.expiredLogEventEndIndex:void 0,tooNewLogEventStartIndex:void 0!==e.tooNewLogEventStartIndex&&null!==e.tooNewLogEventStartIndex?e.tooNewLogEventStartIndex:void 0,tooOldLogEventEndIndex:void 0!==e.tooOldLogEventEndIndex&&null!==e.tooOldLogEventEndIndex?e.tooOldLogEventEndIndex:void 0}},tr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},nr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},rr=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},or=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ir=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},ar=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},sr=function(e,t,n,r,o){return ve(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return me(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},ur=function(e,t){return function(e,t){return ar(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},cr=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},fr={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},lr={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function dr(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return[4,n(r)];case 1:return o=a.sent().response,[4,t(o,e)];case 2:return i=a.sent(),[2,{response:o,output:i}]}}))}))}}}(e,n),fr),r.add(function(e,t){return function(n,r){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return[4,t(r.input,e)];case 1:return o=i.sent(),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}}(e,t),lr)}}}var hr=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(mn.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(mn.__assign)({},e))})),n},o=function(e){var t=[];return e.before.forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t.push(e),e.after.reverse().forEach((function(e){0===e.before.length&&0===e.after.length?t.push(e):t.push.apply(t,Object(mn.__spread)(o(e)))})),t},i=function(){var n,r=[],i=[],a={};return e.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(mn.__assign)(Object(mn.__assign)({},e),{before:[],after:[]});t.name&&(a[t.name]=t),i.push(t)})),i.forEach((function(e){if(e.toMiddleware){var t=a[e.toMiddleware];if(void 0===t)throw new Error(e.toMiddleware+" is not found when adding "+(e.name||"anonymous")+" middleware "+e.relation+" "+e.toMiddleware);"after"===e.relation&&t.after.push(e),"before"===e.relation&&t.before.push(e)}})),(n=r,n.sort((function(e,t){return pr[t.step]-pr[e.step]||gr[t.priority||"normal"]-gr[e.priority||"normal"]}))).map(o).reduce((function(e,t){return e.push.apply(e,Object(mn.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},a={add:function(t,r){void 0===r&&(r={});var o=r.name,i=r.override,a=Object(mn.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=e.findIndex((function(e){return e.name===o})),u=e[s];if(u.step!==a.step||u.priority!==a.priority)throw new Error('"'+o+'" middleware with '+u.priority+" priority in "+u.step+" step cannot be overridden by same-name middleware with "+a.priority+" priority in "+a.step+" step.");e.splice(s,1)}n.add(o)}e.push(a)},addRelativeTo:function(e,r){var o=r.name,i=r.override,a=Object(mn.__assign)({middleware:e},r);if(o){if(n.has(o)){if(!i)throw new Error("Duplicate middleware name '"+o+"'");var s=t.findIndex((function(e){return e.name===o})),u=t[s];if(u.toMiddleware!==a.toMiddleware||u.relation!==a.relation)throw new Error('"'+o+'" middleware '+u.relation+' "'+u.toMiddleware+'" middleware cannot be overridden by same-name middleware '+a.relation+' "'+a.toMiddleware+'" middleware.');t.splice(s,1)}n.add(o)}t.push(a)},clone:function(){return r(hr())},use:function(e){e.applyToStack(a)},remove:function(r){return"string"==typeof r?function(r){var o=!1,i=function(e){return!e.name||e.name!==r||(o=!0,n.delete(r),!1)};return e=e.filter(i),t=t.filter(i),o}(r):function(r){var o=!1,i=function(e){return e.middleware!==r||(o=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(i),t=t.filter(i),o}(r)},removeByTag:function(r){var o=!1,i=function(e){var t=e.tags,i=e.name;return!t||!t.includes(r)||(i&&n.delete(i),o=!0,!1)};return e=e.filter(i),t=t.filter(i),o},concat:function(e){var t=r(hr());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var o=Object(mn.__values)(i().reverse()),a=o.next();!a.done;a=o.next()){e=(0,a.value)(e,t)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e}};return a},pr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},gr={high:3,normal:2,low:1},vr=function(){function e(e){this.middlewareStack=hr(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,o="function"==typeof t?t:n,i=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!o)return i(e).then((function(e){return e.output}));i(e).then((function(e){return o(null,e.output)}),(function(e){return o(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),mr=function(){this.middlewareStack=hr()};var yr=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(mn.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};yr.prototype=Object.create(String.prototype,{constructor:{value:yr,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(yr,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(mn.__extends)(t,e),t.prototype.deserializeJSON=function(){return JSON.parse(e.prototype.toString.call(this))},t.prototype.toJSON=function(){return e.prototype.toString.call(this)},t.fromObject=function(e){return e instanceof t?e:new t(e instanceof String||"string"==typeof e?e:JSON.stringify(e))}}(yr);var br=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogGroupCommand",inputFilterSensitiveLog:Ce.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogGroup"},r=JSON.stringify(Rn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,bn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),wr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogGroupsCommand",inputFilterSensitiveLog:Je.filterSensitiveLog,outputFilterSensitiveLog:Qe.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogGroups"},r=JSON.stringify(Nn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,_n(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Gn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),_r=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"CreateLogStreamCommand",inputFilterSensitiveLog:Pe.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.CreateLogStream"},r=JSON.stringify(Mn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n;return me(this,(function(r){switch(r.label){case 0:return e.statusCode>=300?[2,wn(e,t)]:[4,ar(e.body,t)];case 1:return r.sent(),n={$metadata:ir(e)},[2,Promise.resolve(n)]}}))}))}(e,t)},t}(mr),Sr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"DescribeLogStreamsCommand",inputFilterSensitiveLog:tt.filterSensitiveLog,outputFilterSensitiveLog:rt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.DescribeLogStreams"},r=JSON.stringify(zn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Sn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Hn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Er=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"GetLogEventsCommand",inputFilterSensitiveLog:kt.filterSensitiveLog,outputFilterSensitiveLog:It.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.GetLogEvents"},r=JSON.stringify(Bn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,En(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Wn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),xr=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return pe(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CloudWatchLogsClient",commandName:"PutLogEventsCommand",inputFilterSensitiveLog:$t.filterSensitiveLog,outputFilterSensitiveLog:Vt.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r;return me(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Logs_20140328.PutLogEvents"},r=JSON.stringify(Fn(e,t)),[2,sr(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return ve(void 0,void 0,void 0,(function(){var n,r,o;return me(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,xn(e,t)]:[4,ur(e.body,t)];case 1:return n=i.sent(),{},r=Qn(n,t),o=ge({$metadata:ir(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ar=n(20),Or=n(6),kr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Lr)},Lr=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Ir=function(){function e(e){var t=(void 0===e?{}:e).requestTimeout;this.requestTimeout=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=(void 0===t?{}:t).abortSignal,r=this.requestTimeout;if(null==n?void 0:n.aborted){var o=new Error("Request aborted");return o.name="AbortError",Promise.reject(o)}var i=e.path;if(e.query){var a=function(e){var t,n,r=[];try{for(var o=Object(mn.__values)(Object.keys(e).sort()),i=o.next();!i.done;i=o.next()){var a=i.value,s=e[a];if(a=kr(a),Array.isArray(s))for(var u=0,c=s.length;u<c;u++)r.push(a+"="+kr(s[u]));else{var f=a;(s||"string"==typeof s)&&(f+="="+kr(s)),r.push(f)}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.join("&")}(e.query);a&&(i+="?"+a)}var s=e.port,u=e.method,c=e.protocol+"//"+e.hostname+(s?":"+s:"")+i,f={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(f.signal=n);var l,d=new Request(c,f),h=[fetch(d).then((function(e){var t,n,r=e.headers,o={};try{for(var i=Object(mn.__values)(r.entries()),a=i.next();!a.done;a=i.next()){var s=a.value;o[s[0]]=s[1]}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new vn({headers:o,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new vn({headers:o,statusCode:e.status,body:t})}}))})),(l=r,void 0===l&&(l=0),new Promise((function(e,t){l&&setTimeout((function(){var e=new Error("Request did not complete within "+l+" ms");e.name="TimeoutError",t(e)}),l)})))];return n&&h.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(h)},e}(),Cr={},Pr=new Array(64),Tr=0,jr="A".charCodeAt(0),Rr="Z".charCodeAt(0);Tr+jr<=Rr;Tr++){var Mr=String.fromCharCode(Tr+jr);Cr[Mr]=Tr,Pr[Tr]=Mr}for(Tr=0,jr="a".charCodeAt(0),Rr="z".charCodeAt(0);Tr+jr<=Rr;Tr++){Mr=String.fromCharCode(Tr+jr);var Nr=Tr+26;Cr[Mr]=Nr,Pr[Nr]=Mr}for(Tr=0;Tr<10;Tr++){Cr[Tr.toString(10)]=Tr+52;Mr=Tr.toString(10),Nr=Tr+52;Cr[Mr]=Nr,Pr[Nr]=Mr}Cr["+"]=62,Pr[62]="+",Cr["/"]=63,Pr[63]="/";function zr(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),r=new DataView(n),o=0;o<e.length;o+=4){for(var i=0,a=0,s=o,u=o+3;s<=u;s++)"="!==e[s]?(i|=Cr[e[s]]<<6*(u-s),a+=6):i>>=6;var c=o/4*3;i>>=a%8;for(var f=Math.floor(a/8),l=0;l<f;l++){var d=8*(f-l-1);r.setUint8(c+l,(i&255<<d)>>d)}}return new Uint8Array(n)}function Br(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,i=n,a=Math.min(n+3,e.length);i<a;i++)r|=e[i]<<8*(a-i-1),o+=8;var s=Math.ceil(o/6);r<<=6*s-o;for(var u=1;u<=s;u++){var c=6*(s-u);t+=Pr[(r&63<<c)>>c]}t+="==".slice(0,4-s)}return t}var Ur=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(mn.__generator)(this,(function(r){switch(r.label){case 0:return[4,Fr(e)];case 1:return t=r.sent(),n=zr(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,o,i,a,s;return Object(mn.__generator)(this,(function(u){switch(u.label){case 0:t=new Uint8Array(0),n=e.getReader(),r=!1,u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=u.sent(),i=o.done,(a=o.value)&&(s=t,(t=new Uint8Array(s.length+a.length)).set(s),t.set(a,s.length)),r=i,[3,1];case 3:return[2,t]}}))}))}(e)};function Fr(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e;if(2!==r.readyState)return n(new Error("Reader aborted too early"));var o=null!==(e=r.result)&&void 0!==e?e:"",i=o.indexOf(","),a=i>-1?i+1:o.length;t(o.substring(a))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Dr=function(e){return function(){return Promise.reject(e)}},qr={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Gr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o;return Object(mn.__generator)(this,(function(i){return(null===(o=null==e?void 0:e.retryStrategy)||void 0===o?void 0:o.mode)&&(n.userAgent=Object(mn.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),qr)}}},Hr=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Wr=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],$r=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Kr=[500,502,503,504],Vr=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||Wr.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},Yr=n(18),Zr=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},Jr=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return Hr.includes(e.name)}(e)||Vr(e)||function(e){var t;return $r.includes(e.name)||Kr.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},Xr=function(){function e(e,t){var n,r,o,i,a,s,u,c;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:Jr,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Zr,this.retryQuota=null!==(o=null==t?void 0:t.retryQuota)&&void 0!==o?o:(a=i=500,s=i,u=function(e){return"TimeoutError"===e.name?10:5},c=function(e){return u(e)<=s},Object.freeze({hasRetryTokens:c,retrieveRetryTokens:function(e){if(!c(e))throw new Error("No retry token available");var t=u(e);return s-=t,t},releaseRetryTokens:function(e){s+=null!=e?e:1,s=Math.min(s,a)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e;return Object(mn.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.maxAttemptsProvider()];case 1:return e=t.sent(),[3,3];case 2:return t.sent(),e=3,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:return r=0,o=0,[4,this.getMaxAttempts()];case 1:i=f.sent(),a=t.request,yn.isInstance(a)&&(a.headers["amz-sdk-invocation-id"]=Object(Yr.v4)()),s=function(){var s,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,5]),yn.isInstance(a)&&(a.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+i),[4,e(t)];case 1:return s=h.sent(),c=s.response,f=s.output,u.retryQuota.releaseRetryTokens(n),f.$metadata.attempts=r+1,f.$metadata.totalRetryDelay=o,[2,{value:{response:c,output:f}}];case 2:return l=h.sent(),r++,u.shouldRetry(l,r,i)?(n=u.retryQuota.retrieveRetryTokens(l),d=u.delayDecider(Vr(l)?500:100,r),o+=d,[4,new Promise((function(e){return setTimeout(e,d)}))]):[3,4];case 3:return h.sent(),[2,"continue"];case 4:throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=r,l.$metadata.totalRetryDelay=o,l;case 5:return[2]}}))},u=this,f.label=2;case 2:return[5,s()];case 3:return"object"==typeof(c=f.sent())?[2,c.value]:[3,2];case 4:return[2]}}))}))},e}(),Qr=function(e){var t=eo(e.maxAttempts);return Object(mn.__assign)(Object(mn.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new Xr(t)})},eo=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function to(e){if("string"==typeof e){for(var t=e.length,n=t-1;n>=0;n--){var r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2)}return t}return"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.size?e.size:void 0}var no=n(19),ro=n.n(no),oo=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var e,r,o,i,a,s,u,c,f;return Object(mn.__generator)(this,(function(l){return e=(null===(o=null===window||void 0===window?void 0:window.navigator)||void 0===o?void 0:o.userAgent)?ro.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(i=null==e?void 0:e.os)||void 0===i?void 0:i.name)||"other"),null===(a=null==e?void 0:e.os)||void 0===a?void 0:a.version],["lang/js"],["md/browser",(null!==(u=null===(s=null==e?void 0:e.browser)||void 0===s?void 0:s.name)&&void 0!==u?u:"unknown")+"_"+(null!==(f=null===(c=null==e?void 0:e.browser)||void 0===c?void 0:c.version)&&void 0!==f?f:"unknown")]],t&&r.push(["api/"+t,n]),[2,r]}))}))}},io=n(4),ao=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),so=new Set(["cn-north-1","cn-northwest-1"]),uo=new Set(["us-iso-east-1"]),co=new Set(["us-isob-east-1"]),fo=new Set(["us-gov-east-1","us-gov-west-1"]);var lo=function(e){var t,n=new URL(e),r=n.hostname,o=n.pathname,i=n.port,a=n.protocol,s=n.search;return s&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var o=Object(mn.__values)(e.split("&")),i=o.next();!i.done;i=o.next()){var a=i.value,s=Object(mn.__read)(a.split("="),2),u=s[0],c=s[1],f=void 0===c?null:c;u=decodeURIComponent(u),f&&(f=decodeURIComponent(f)),u in r?Array.isArray(r[u])?r[u].push(f):r[u]=[r[u],f]:r[u]=f}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r}(s)),{hostname:r,port:i?parseInt(i):void 0,protocol:a,path:o,query:t}},ho={apiVersion:"2014-03-28",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"logs.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"logs.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"logs.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"logs.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"logs.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"logs.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"logs.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"logs.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"logs.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"logs.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"logs.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"logs.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"logs.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"logs.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"logs.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"logs.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"logs-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"logs-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"logs-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"logs-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"logs.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"logs.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"logs.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"logs.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"logs.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"logs.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"logs.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"logs.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"logs.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"logs.us-west-2.amazonaws.com",partition:"aws"};break;default:ao.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),so.has(e)&&(n={hostname:"logs.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),uo.has(e)&&(n={hostname:"logs.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),co.has(e)&&(n={hostname:"logs.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),fo.has(e)&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"logs.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(ge({signingService:"logs"},n))},serviceId:"CloudWatch Logs",urlParser:lo},po=ge(ge({},ho),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:ho.serviceId,clientVersion:Ar.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),go=function(e){var t;return Object(mn.__assign)(Object(mn.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?vo(e):function(){return mo(e)},isCustomEndpoint:!!e.endpoint})},vo=function(e){var t=e.endpoint,n=e.urlParser;if("string"==typeof t){var r=Promise.resolve(n(t));return function(){return r}}if("object"==typeof t){var o=Promise.resolve(t);return function(){return o}}return t},mo=function(e){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,o,i;return Object(mn.__generator)(this,(function(a){switch(a.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=a.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(r)];case 2:if(!(o=(null!==(i=a.sent())&&void 0!==i?i:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},yo=function(e){if(!e.region)throw new Error("Region is missing");return Object(mn.__assign)(Object(mn.__assign)({},e),{region:bo(e.region)})},bo=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var wo={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},_o=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,o,i,a,s;return Object(mn.__generator)(this,(function(u){return t=r.request,yn.isInstance(t)&&(o=t.body,i=t.headers,o&&-1===Object.keys(i).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(a=e(o))&&(t.headers=Object(mn.__assign)(Object(mn.__assign)({},t.headers),((s={})["content-length"]=String(a),s)))),[2,n(Object(mn.__assign)(Object(mn.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),wo)}}};for(var So={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Eo=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){return yn.isInstance(n.request)?(r=n.request,o=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===o?"":o).indexOf("h2")>=0&&!r.headers[":authority"]?(delete r.headers.host,r.headers[":authority"]=""):r.headers.host||(r.headers.host=r.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),So)}}},xo={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Ao=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var r,o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return r=t.clientName,o=t.commandName,i=t.inputFilterSensitiveLog,a=t.logger,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return u=d.sent(),a?("function"==typeof a.info&&(c=u.output,f=c.$metadata,l=Object(mn.__rest)(c,["$metadata"]),a.info({clientName:r,commandName:o,input:i(n.input),output:s(l),metadata:f})),[2,u]):[2,u]}}))}))}}),xo)}}},Oo={},ko={},Lo=0;Lo<256;Lo++){var Io=Lo.toString(16).toLowerCase();1===Io.length&&(Io="0"+Io),Oo[Lo]=Io,ko[Io]=Lo}function Co(e){for(var t="",n=0;n<e.byteLength;n++)t+=Oo[e[n]];return t}var Po="X-Amz-Date".toLowerCase(),To=["authorization",Po,"date"],jo="X-Amz-Signature".toLowerCase(),Ro="X-Amz-Security-Token".toLowerCase(),Mo={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},No=/^proxy-/,zo=/^sec-/,Bo="AWS4-HMAC-SHA256-PAYLOAD",Uo={},Fo=[];function Do(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function qo(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Go(e,t,n){var r,o,i=e.headers,a={};try{for(var s=Object(mn.__values)(Object.keys(i).sort()),u=s.next();!u.done;u=s.next()){var c=u.value,f=c.toLowerCase();(f in Mo||(null==t?void 0:t.has(f))||No.test(f)||zo.test(f))&&(!n||n&&!n.has(f))||(a[f]=i[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return a}var Ho=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Wo)},Wo=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function $o(e,t){var n=e.headers,r=e.body;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,o,i,a,s,u,c;return Object(mn.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(mn.__values)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(i=o.value).toLowerCase())return[2,n[i]]}catch(e){u={error:e}}finally{try{o&&!o.done&&(c=e.return)&&c.call(e)}finally{if(u)throw u.error}}return null!=r?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof r||ArrayBuffer.isView(r)||(l=r,"function"==typeof ArrayBuffer&&l instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(l))?((a=new t).update(r),s=Co,[4,a.digest()]):[3,3];case 2:return[2,s.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var l}))}))}function Ko(e){var t=e.headers,n=e.query,r=Object(mn.__rest)(e,["headers","query"]);return Object(mn.__assign)(Object(mn.__assign)({},r),{headers:Object(mn.__assign)({},t),query:n?Vo(n):void 0})}function Vo(e){return Object.keys(e).reduce((function(t,n){var r,o=e[n];return Object(mn.__assign)(Object(mn.__assign)({},t),((r={})[n]=Array.isArray(o)?Object(mn.__spread)(o):o,r))}),{})}function Yo(e){var t,n;e="function"==typeof e.clone?e.clone():Ko(e);try{for(var r=Object(mn.__values)(Object.keys(e.headers)),o=r.next();!o.done;o=r.next()){var i=o.value;To.indexOf(i.toLowerCase())>-1&&delete e.headers[i]}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function Zo(e){return function(e){if("number"==typeof e)return new Date(1e3*e);if("string"==typeof e)return Number(e)?new Date(1e3*Number(e)):new Date(e);return e}(e).toISOString().replace(/\.\d{3}Z$/,"Z")}var Jo=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,o=e.service,i=e.sha256,a=e.uriEscapePath,s=void 0===a||a;this.service=o,this.sha256=i,this.uriEscapePath=s,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=ei(r),this.credentialProvider=ti(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(mn.__awaiter)(this,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v,m,y,b,w,_,S,E,x,A;return Object(mn.__generator)(this,(function(O){switch(O.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,o=t.expiresIn,i=void 0===o?3600:o,a=t.unsignableHeaders,s=t.unhoistableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return l=O.sent(),null==c?[3,2]:(h=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=O.sent(),O.label=4;case 4:return d=h,p=Xo(r),g=p.longDate,v=p.shortDate,i>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=Do(v,d,null!=f?f:this.service),y=function(e,t){var n,r,o;void 0===t&&(t={});var i="function"==typeof e.clone?e.clone():Ko(e),a=i.headers,s=i.query,u=void 0===s?{}:s;try{for(var c=Object(mn.__values)(Object.keys(a)),f=c.next();!f.done;f=c.next()){var l=f.value,d=l.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(o=t.unhoistableHeaders)||void 0===o?void 0:o.has(d))||(u[l]=a[l],delete a[l])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(mn.__assign)(Object(mn.__assign)({},e),{headers:a,query:u})}(Yo(e),{unhoistableHeaders:s}),l.sessionToken&&(y.query["X-Amz-Security-Token"]=l.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=l.accessKeyId+"/"+m,y.query["X-Amz-Date"]=g,y.query["X-Amz-Expires"]=i.toString(10),b=Go(y,a,u),y.query["X-Amz-SignedHeaders"]=Qo(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[g,m,this.getSigningKey(l,d,v,f)],x=this.createCanonicalRequest,A=[y,b],[4,$o(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([x.apply(this,A.concat([O.sent()]))]))];case 6:return w[_]=O.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(mn.__awaiter)(this,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){return"string"==typeof e?[2,this.signString(e,t)]:e.headers&&e.payload?[2,this.signEvent(e,t)]:[2,this.signRequest(e,t)]}))}))},e.prototype.signEvent=function(e,t){var n=e.headers,r=e.payload,o=t.signingDate,i=void 0===o?new Date:o,a=t.priorSignature,s=t.signingRegion,u=t.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var e,t,o,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return null==s?[3,1]:(t=s,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,o=Xo(i),c=o.shortDate,f=o.longDate,l=Do(c,e,null!=u?u:this.service),[4,$o({headers:{},body:r},this.sha256)];case 4:return d=m.sent(),(h=new this.sha256).update(n),g=Co,[4,h.digest()];case 5:return p=g.apply(void 0,[m.sent()]),v=[Bo,f,l,a,p,d].join("\n"),[2,this.signString(v,{signingDate:i,signingRegion:e,signingService:u})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signingRegion,a=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==i?[3,2]:(r=i,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,s=Xo(o).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,s,a)];case 5:return(u=new(f.apply(c,[void 0,d.sent()]))).update(e),l=Co,[4,u.digest()];case 6:return[2,l.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,o=void 0===r?new Date:r,i=n.signableHeaders,a=n.unsignableHeaders,s=n.signingRegion,u=n.signingService;return Object(mn.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,l,d,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==s?[3,2]:(r=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,c=Yo(e),f=Xo(o),l=f.longDate,d=f.shortDate,h=Do(d,n,null!=u?u:this.service),c.headers[Po]=l,t.sessionToken&&(c.headers[Ro]=t.sessionToken),[4,$o(c,this.sha256)];case 5:return p=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var o=Object(mn.__values)(Object.keys(t)),i=o.next();!i.done;i=o.next()){if(e===i.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=p),g=Go(c,a,i),[4,this.getSignature(l,h,this.getSigningKey(t,n,d,u),this.createCanonicalRequest(c,g,p))];case 6:return v=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+h+", SignedHeaders="+Qo(g)+", Signature="+v,[2,c]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var r=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,r=e.query,o=void 0===r?{}:r,i=[],a={},s=function(e){if(e.toLowerCase()===jo)return"continue";i.push(e);var t=o[e];"string"==typeof t?a[e]=Ho(e)+"="+Ho(t):Array.isArray(t)&&(a[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Ho(e)+"="+Ho(n)])}),[]).join("&"))};try{for(var u=Object(mn.__values)(Object.keys(o).sort()),c=u.next();!c.done;c=u.next()){s(c.value)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return i.map((function(e){return a[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+r.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+r.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var r,o;return Object(mn.__generator)(this,(function(i){switch(i.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return o=i.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Co(o)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u;return Object(mn.__generator)(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return o=c.sent(),s=(a=this.sha256).bind,[4,n];case 2:return(i=new(s.apply(a,[void 0,c.sent()]))).update(o),u=Co,[4,i.digest()];case 3:return[2,u.apply(void 0,[c.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,r){return function(e,t,n,r,o){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return[4,qo(e,t.secretAccessKey,t.accessKeyId)];case 1:if(i=p.sent(),(a=n+":"+r+":"+o+":"+Co(i)+":"+t.sessionToken)in Uo)return[2,Uo[a]];for(Fo.push(a);Fo.length>50;)delete Uo[Fo.shift()];s="AWS4"+t.secretAccessKey,p.label=2;case 2:p.trys.push([2,7,8,9]),u=Object(mn.__values)([n,r,o,"aws4_request"]),c=u.next(),p.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,qo(e,s,f)]);case 4:s=p.sent(),p.label=5;case 5:return c=u.next(),[3,3];case 6:return[3,9];case 7:return l=p.sent(),d={error:l},[3,9];case 8:try{c&&!c.done&&(h=u.return)&&h.call(u)}finally{if(d)throw d.error}return[7];case 9:return[2,Uo[a]=s]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),Xo=function(e){var t=Zo(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},Qo=function(e){return Object.keys(e).sort().join(";")},ei=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ti=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ni(e){var t,n=this,r=ri(e.credentials||e.credentialDefaultProvider(e)),o=e.signingEscapePath,i=void 0===o||o,a=e.systemClockOffset,s=void 0===a?e.systemClockOffset||0:a,u=e.sha256;return t=e.signer?ri(e.signer):function(){return ri(e.region)().then((function(t){return Object(mn.__awaiter)(n,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(n){switch(n.label){case 0:return[4,e.regionInfoProvider(t)];case 1:return[2,[n.sent()||{},t]]}}))}))})).then((function(t){var n=Object(mn.__read)(t,2),o=n[0],a=n[1],s=o.signingRegion,c=o.signingService;return e.signingRegion=e.signingRegion||s||a,e.signingName=e.signingName||c||e.serviceId,new Jo({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:i})}))},Object(mn.__assign)(Object(mn.__assign)({},e),{systemClockOffset:s,signingEscapePath:i,credentials:r,signer:t})}function ri(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var oi=function(e){return new Date(Date.now()+e)};function ii(e){return function(t,n){return function(r){return Object(mn.__awaiter)(this,void 0,void 0,(function(){var o,i,a,s,u,c,f,l,d;return Object(mn.__generator)(this,(function(h){switch(h.label){case 0:return yn.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return i=h.sent(),[3,3];case 2:i=e.signer,h.label=3;case 3:return o=i,s=t,u=[Object(mn.__assign)({},r)],d={},[4,o.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,s.apply(void 0,[mn.__assign.apply(void 0,u.concat([(d.request=h.sent(),d)]))])];case 5:return a=h.sent(),c=a.response.headers,(f=c&&(c.date||c.Date))&&(l=Date.parse(f),p=l,g=e.systemClockOffset,Math.abs(oi(g).getTime()-p)>=3e5&&(e.systemClockOffset=l-Date.now())),[2,a]}var p,g}))}))}}}var ai={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0};function si(e){return Object(mn.__assign)(Object(mn.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var ui,ci=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,fi=function(e){var t=Object(mn.__read)(e,2),n=t[0],r=t[1],o=n.indexOf("/"),i=n.substring(0,o),a=n.substring(o+1);return"api"===i&&(a=a.toLowerCase()),[i,a,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(ci,"_")})).join("/")},li={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},di=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(mn.__awaiter)(void 0,void 0,void 0,(function(){var o,i,a,s,u,c,f,l;return Object(mn.__generator)(this,(function(d){switch(d.label){case 0:return o=r.request,yn.isInstance(o)?(i=o.headers,a=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(fi))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return s=d.sent().map(fi),u=(null===(l=null==n?void 0:n.customUserAgent)||void 0===l?void 0:l.map(fi))||[],i["x-amz-user-agent"]=Object(mn.__spread)(s,a,u).join(" "),c=Object(mn.__spread)(s.filter((function(e){return e.startsWith("aws-sdk-")})),u).join(" "),"browser"!==n.runtime&&c&&(i["user-agent"]=i["user-agent"]?i["user-agent"]+" "+c:c),[2,e(Object(mn.__assign)(Object(mn.__assign)({},r),{request:o}))]}}))}))}}),li)}}},hi=function(e){function t(t){var n,r=this,o=ge(ge({},po),t),i=yo(o),a=ni(go(i)),s=si(Qr(a));return(r=e.call(this,s)||this).config=s,r.middlewareStack.use((n=r.config,{applyToStack:function(e){e.addRelativeTo(ii(n),ai)}})),r.middlewareStack.use(Gr(r.config)),r.middlewareStack.use(_o(r.config)),r.middlewareStack.use(Eo(r.config)),r.middlewareStack.use(Ao(r.config)),r.middlewareStack.use(di(r.config)),r}return pe(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr),pi={},gi=function(){function e(){}return e.setItem=function(e,t){return pi[e]=t,pi[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(pi,e)?pi[e]:void 0},e.removeItem=function(e){return delete pi[e]},e.clear=function(){return pi={}},e}(),vi=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=gi}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),mi=(ui=function(e,t){return(ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},bi=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wi=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wi(arguments[t]));return e},Si=new g("Util"),Ei=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return mi(t,e),t}(Error);function xi(e,t,n,r){return void 0===r&&(r=1),yi(this,void 0,void 0,(function(){var o,i;return bi(this,(function(a){switch(a.label){case 0:if("function"!=typeof e)throw Error("functionToRetry must be a function");Si.debug(e.name+" attempt #"+r+" with this vars: "+JSON.stringify(t)),a.label=1;case 1:return a.trys.push([1,3,,8]),[4,e.apply(void 0,_i(t))];case 2:return[2,a.sent()];case 3:if(o=a.sent(),Si.debug("error on "+e.name,o),(s=o)&&s.nonRetryable)throw Si.debug(e.name+" non retryable error",o),o;return i=n(r,t,o),Si.debug(e.name+" retrying in "+i+" ms"),!1===i?[3,6]:[4,new Promise((function(e){return setTimeout(e,i)}))];case 4:return a.sent(),[4,xi(e,t,n,r+1)];case 5:return[2,a.sent()];case 6:throw o;case 7:return[3,8];case 8:return[2]}var s}))}))}function Ai(e){void 0===e&&(e=3e5);return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}var Oi=function(e,t,n){return void 0===n&&(n=3e5),xi(e,t,Ai(n))},ki=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Li=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ii=new g("CognitoCredentials"),Ci=new Promise((function(e,t){return Object(U.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(Ii.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ii.debug("not in the browser, directly resolved"),e())})),Pi=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return ki(this,void 0,void 0,(function(){return Li(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ii.debug("need to wait for the Google SDK loaded"),[4,Ci]);case 1:e.sent(),this.initialized=!0,Ii.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(U.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(Ii.debug("google Auth undefined"),n(new Ei("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(Ii.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new Ei("Failed to reload google auth response"))}))):n(new Ei("User is not signed in with Google"))})).catch((function(e){Ii.debug("Failed to refresh google token",e),n(new Ei("Failed to refresh google token"))}))})):(Ii.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),Ti=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},ji=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Ri=new g("CognitoCredentials"),Mi=new Promise((function(e,t){return Object(U.b)().isBrowser?window.FB?(Ri.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(Ri.debug("not in the browser, directly resolved"),e())})),Ni=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return Ti(this,void 0,void 0,(function(){return ji(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(Ri.debug("need to wait for the Facebook SDK loaded"),[4,Mi]);case 1:e.sent(),this.initialized=!0,Ri.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(U.b)().isBrowser&&(e=window.FB),!e){return Ri.debug("no fb sdk available"),Promise.reject(new Ei("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,o=r.accessToken,i=1e3*r.expiresIn+(new Date).getTime();if(!o){a="the jwtToken is undefined";Ri.debug(a),n(new Ei(a))}t({token:o,expires_at:i})}else{var a="no response from facebook when refreshing the jwt token";Ri.debug(a),n(new Ei(a))}}),{scope:"public_profile,email"})}))},e}(),zi=new Pi,Bi=new Ni,Ui=function(e,t){return(Ui=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Fi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ui(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Di=function(){return(Di=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function qi(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Gi(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Hi(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var Wi,$i,Ki,Vi,Yi,Zi,Ji,Xi,Qi,ea,ta,na,ra,oa,ia,aa,sa,ua,ca,fa,la,da,ha,pa,ga,va,ma,ya,ba,wa,_a,Sa,Ea,xa,Aa,Oa,ka,La,Ia,Ca,Pa,Ta,ja,Ra,Ma,Na,za,Ba,Ua,Fa,Da,qa,Ga,Ha,Wa,$a,Ka;Object.create;!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Wi||(Wi={})),($i||($i={})).filterSensitiveLog=function(e){return Di({},e)},(Ki||(Ki={})).filterSensitiveLog=function(e){return Di({},e)},(Vi||(Vi={})).filterSensitiveLog=function(e){return Di({},e)},(Yi||(Yi={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(Zi||(Zi={})),function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(Ji||(Ji={})),(Xi||(Xi={})).filterSensitiveLog=function(e){return Di({},e)},(Qi||(Qi={})).filterSensitiveLog=function(e){return Di({},e)},(ea||(ea={})).filterSensitiveLog=function(e){return Di({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(na||(na={})),(ra||(ra={})).filterSensitiveLog=function(e){return Di({},e)},(oa||(oa={})).filterSensitiveLog=function(e){return Di({},e)},(ia||(ia={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.filterSensitiveLog=function(e){return Di({},e)}}(aa||(aa={})),(sa||(sa={})).filterSensitiveLog=function(e){return Di({},e)},(ua||(ua={})).filterSensitiveLog=function(e){return Di({},e)},(ca||(ca={})).filterSensitiveLog=function(e){return Di({},e)},(fa||(fa={})).filterSensitiveLog=function(e){return Di({},e)},(la||(la={})).filterSensitiveLog=function(e){return Di({},e)},(da||(da={})).filterSensitiveLog=function(e){return Di({},e)},(ha||(ha={})).filterSensitiveLog=function(e){return Di({},e)},(pa||(pa={})).filterSensitiveLog=function(e){return Di({},e)},(ga||(ga={})).filterSensitiveLog=function(e){return Di({},e)},(va||(va={})).filterSensitiveLog=function(e){return Di({},e)},(ma||(ma={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(ya||(ya={})),(ba||(ba={})).filterSensitiveLog=function(e){return Di({},e)},(wa||(wa={})).filterSensitiveLog=function(e){return Di({},e)},function(e){e.RULES="Rules",e.TOKEN="Token"}(_a||(_a={})),(Sa||(Sa={})).filterSensitiveLog=function(e){return Di({},e)},(Ea||(Ea={})).filterSensitiveLog=function(e){return Di({},e)},(xa||(xa={})).filterSensitiveLog=function(e){return Di({},e)},(Aa||(Aa={})).filterSensitiveLog=function(e){return Di({},e)},(Oa||(Oa={})).filterSensitiveLog=function(e){return Di({},e)},(ka||(ka={})).filterSensitiveLog=function(e){return Di({},e)},(La||(La={})).filterSensitiveLog=function(e){return Di({},e)},(Ia||(Ia={})).filterSensitiveLog=function(e){return Di({},e)},(Ca||(Ca={})).filterSensitiveLog=function(e){return Di({},e)},(Pa||(Pa={})).filterSensitiveLog=function(e){return Di({},e)},(Ta||(Ta={})).filterSensitiveLog=function(e){return Di({},e)},(ja||(ja={})).filterSensitiveLog=function(e){return Di({},e)},(Ra||(Ra={})).filterSensitiveLog=function(e){return Di({},e)},(Ma||(Ma={})).filterSensitiveLog=function(e){return Di({},e)},(Na||(Na={})).filterSensitiveLog=function(e){return Di({},e)},(za||(za={})).filterSensitiveLog=function(e){return Di({},e)},(Ba||(Ba={})).filterSensitiveLog=function(e){return Di({},e)},(Ua||(Ua={})).filterSensitiveLog=function(e){return Di({},e)},(Fa||(Fa={})).filterSensitiveLog=function(e){return Di({},e)},(Da||(Da={})).filterSensitiveLog=function(e){return Di({},e)},(qa||(qa={})).filterSensitiveLog=function(e){return Di({},e)},(Ga||(Ga={})).filterSensitiveLog=function(e){return Di({},e)},(Ha||(Ha={})).filterSensitiveLog=function(e){return Di({},e)},(Wa||(Wa={})).filterSensitiveLog=function(e){return Di({},e)},($a||($a={})).filterSensitiveLog=function(e){return Di({},e)},(Ka||(Ka={})).filterSensitiveLog=function(e){return Di({},e)};var Va=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Gi(this,(function(m){switch(m.label){case 0:return r=[Di({},e)],v={},[4,Es(e.body,t)];case 1:switch(n=Di.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=xs(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Za(n,t)];case 3:return o=Di.apply(void 0,[Di.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 4:return s=[{}],[4,Ja(n,t)];case 5:return o=Di.apply(void 0,[Di.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 6:return u=[{}],[4,Xa(n,t)];case 7:return o=Di.apply(void 0,[Di.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 8:return c=[{}],[4,Qa(n,t)];case 9:return o=Di.apply(void 0,[Di.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 10:return f=[{}],[4,ts(n,t)];case 11:return o=Di.apply(void 0,[Di.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 12:return l=[{}],[4,ns(n,t)];case 13:return o=Di.apply(void 0,[Di.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 14:return d=[{}],[4,rs(n,t)];case 15:return o=Di.apply(void 0,[Di.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 16:return h=[{}],[4,os(n,t)];case 17:return o=Di.apply(void 0,[Di.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Di(Di({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:ws(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Ya=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return Gi(this,(function(m){switch(m.label){case 0:return r=[Di({},e)],v={},[4,Es(e.body,t)];case 1:switch(n=Di.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=xs(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Za(n,t)];case 3:return o=Di.apply(void 0,[Di.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 4:return s=[{}],[4,Ja(n,t)];case 5:return o=Di.apply(void 0,[Di.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 6:return u=[{}],[4,Qa(n,t)];case 7:return o=Di.apply(void 0,[Di.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 8:return c=[{}],[4,es(n,t)];case 9:return o=Di.apply(void 0,[Di.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 10:return f=[{}],[4,ts(n,t)];case 11:return o=Di.apply(void 0,[Di.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 12:return l=[{}],[4,ns(n,t)];case 13:return o=Di.apply(void 0,[Di.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 14:return d=[{}],[4,rs(n,t)];case 15:return o=Di.apply(void 0,[Di.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 16:return h=[{}],[4,os(n,t)];case 17:return o=Di.apply(void 0,[Di.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:ws(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Di(Di({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:ws(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Za=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=cs(n,t),[2,Di({name:"ExternalServiceException",$fault:"client",$metadata:ws(e)},r)]}))}))},Ja=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ds(n,t),[2,Di({name:"InternalErrorException",$fault:"server",$metadata:ws(e)},r)]}))}))},Xa=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=hs(n,t),[2,Di({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:ws(e)},r)]}))}))},Qa=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ps(n,t),[2,Di({name:"InvalidParameterException",$fault:"client",$metadata:ws(e)},r)]}))}))},es=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=gs(n,t),[2,Di({name:"LimitExceededException",$fault:"client",$metadata:ws(e)},r)]}))}))},ts=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=vs(n,t),[2,Di({name:"NotAuthorizedException",$fault:"client",$metadata:ws(e)},r)]}))}))},ns=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ms(n,t),[2,Di({name:"ResourceConflictException",$fault:"client",$metadata:ws(e)},r)]}))}))},rs=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=ys(n,t),[2,Di({name:"ResourceNotFoundException",$fault:"client",$metadata:ws(e)},r)]}))}))},os=function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n=e.body,r=bs(n,t),[2,Di({name:"TooManyRequestsException",$fault:"client",$metadata:ws(e)},r)]}))}))},is=function(e,t){return Di(Di(Di({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:ss(e.Logins,t)})},as=function(e,t){return Di(Di(Di({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:ss(e.Logins,t)})},ss=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Hi(t,2),o=r[0],i=r[1];return null===i?e:Di(Di({},e),((n={})[o]=i,n))}),{})},us=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},cs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},fs=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?us(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ls=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},ds=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},hs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ps=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},gs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ms=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ys=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bs=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ws=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},_s=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ss=function(e,t,n,r,o){return qi(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return Gi(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Es=function(e,t){return function(e,t){return _s(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},xs=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},As=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Fi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:la.filterSensitiveLog,outputFilterSensitiveLog:ha.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(is(e,t)),[2,Ss(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o;return Gi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Va(e,t)]:[4,Es(e.body,t)];case 1:return n=i.sent(),{},r=fs(n,t),o=Di({$metadata:ws(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Os=function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}return Object(mn.__extends)(t,e),t}(Error);function ks(e){return Promise.all(Object.keys(e).reduce((function(t,n){var r=e[n];return"string"==typeof r?t.push([n,r]):t.push(r().then((function(e){return[n,e]}))),t}),[])).then((function(e){return e.reduce((function(e,t){var n=Object(mn.__read)(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}))}function Ls(e){var t=this;return function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var t,n,r,o,i,a,s,u,c,f,l,d,h;return Object(mn.__generator)(this,(function(p){switch(p.label){case 0:return f=(c=e.client).send,l=As.bind,h={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,ks(e.logins)]:[3,2];case 1:return d=p.sent(),[3,3];case 2:d=void 0,p.label=3;case 3:return[4,f.apply(c,[new(l.apply(As,[void 0,(h.Logins=d,h)]))])];case 4:return t=p.sent().Credentials,n=void 0===t?function(){throw new Os("Response from Amazon Cognito contained no credentials")}():t,r=n.AccessKeyId,o=void 0===r?function(){throw new Os("Response from Amazon Cognito contained no access key ID")}():r,i=n.Expiration,a=n.SecretKey,s=void 0===a?function(){throw new Os("Response from Amazon Cognito contained no secret key")}():a,u=n.SessionToken,[2,{identityId:e.identityId,accessKeyId:o,secretAccessKey:s,sessionToken:u,expiration:i}]}}))}))}}var Is=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Fi(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:ga.filterSensitiveLog,outputFilterSensitiveLog:va.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r;return Gi(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(as(e,t)),[2,Ss(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return qi(void 0,void 0,void 0,(function(){var n,r,o;return Gi(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ya(e,t)]:[4,Es(e.body,t)];case 1:return n=i.sent(),{},r=ls(n,t),o=Di({$metadata:ws(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cs=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",(function(t){var n=t.get(e);return new Promise((function(e){n.onerror=function(){return e(null)},n.onsuccess=function(){return e(n.result?n.result.value:null)}}))})).catch((function(){return null}))},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",(function(t){var n=t.delete(e);return new Promise((function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}}))}))},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",(function(n){var r=n.put({id:e,value:t});return new Promise((function(e,t){r.onerror=function(){return t(r.error)},r.onsuccess=function(){return e()}}))}))},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)},e.onblocked=function(){n(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){n(new Error("Failed to create object store"))},t.createObjectStore("IdentityIds",{keyPath:"id"})}}))},e.prototype.withObjectStore=function(e,t){return this.getDb().then((function(n){var r=n.transaction("IdentityIds",e);return r.oncomplete=function(){return n.close()},new Promise((function(e,n){r.onerror=function(){return n(r.error)},e(t(r.objectStore("IdentityIds")))})).catch((function(e){throw n.close(),e}))}))},e}(),Ps=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());function Ts(e){var t=this,n=e.accountId,r=e.cache,o=void 0===r?"object"==typeof self&&self.indexedDB?new Cs:"object"==typeof window&&window.localStorage?window.localStorage:Ps:r,i=e.client,a=e.customRoleArn,s=e.identityPoolId,u=e.logins,c=e.userIdentifier,f=void 0===c?u&&0!==Object.keys(u).length?void 0:"ANONYMOUS":c,l=f?"aws:cognito-identity-credentials:"+s+":"+f:void 0,d=function(){return Object(mn.__awaiter)(t,void 0,void 0,(function(){var e,t,r,c,f,h,p,g,v;return Object(mn.__generator)(this,(function(m){switch(m.label){case 0:return(t=l)?[4,o.getItem(l)]:[3,2];case 1:t=m.sent(),m.label=2;case 2:return(e=t)?[3,7]:(h=(f=i).send,p=Is.bind,v={AccountId:n,IdentityPoolId:s},u?[4,ks(u)]:[3,4]);case 3:return g=m.sent(),[3,5];case 4:g=void 0,m.label=5;case 5:return[4,h.apply(f,[new(p.apply(Is,[void 0,(v.Logins=g,v)]))])];case 6:r=m.sent().IdentityId,c=void 0===r?function(){throw new Os("Response from Amazon Cognito contained no identity ID")}():r,e=c,l&&Promise.resolve(o.setItem(l,e)).catch((function(){})),m.label=7;case 7:return[2,(d=Ls({client:i,customRoleArn:a,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(mn.__awaiter)(t,void 0,void 0,(function(){return Object(mn.__generator)(this,(function(t){throw l&&Promise.resolve(o.removeItem(l)).catch((function(){})),e}))}))}))}}var js=function(e,t){return(js=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Rs(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}js(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ms=function(){return(Ms=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Ns(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function zs(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}Object.create;function Bs(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}Object.create;var Us,Fs,Ds,qs,Gs,Hs,Ws,$s,Ks,Vs,Ys,Zs,Js,Xs,Qs,eu,tu,nu,ru,ou,iu,au,su,uu,cu,fu,lu,du,hu,pu,gu,vu,mu,yu,bu,wu,_u,Su,Eu,xu,Au,Ou,ku,Lu,Iu,Cu,Pu,Tu,ju,Ru,Mu,Nu,zu,Bu,Uu,Fu,Du,qu=n(21),Gu=new Set(["af-south-1","ap-east-1","ap-northeast-1","ap-northeast-2","ap-south-1","ap-southeast-1","ap-southeast-2","ca-central-1","eu-central-1","eu-north-1","eu-south-1","eu-west-1","eu-west-2","eu-west-3","me-south-1","sa-east-1","us-east-1","us-east-2","us-west-1","us-west-2"]),Hu=new Set(["cn-north-1","cn-northwest-1"]),Wu=new Set(["us-iso-east-1"]),$u=new Set(["us-isob-east-1"]),Ku=new Set(["us-gov-east-1","us-gov-west-1"]),Vu={apiVersion:"2014-06-30",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"cognito-identity.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"cognito-identity.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"cognito-identity-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"cognito-identity-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-west-1":n={hostname:"cognito-identity-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"cognito-identity-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"sa-east-1":n={hostname:"cognito-identity.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-west-1":n={hostname:"cognito-identity.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"cognito-identity.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:Gu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Hu.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Wu.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),$u.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Ku.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(Ms({signingService:"cognito-identity"},n))},serviceId:"Cognito Identity",urlParser:lo},Yu=Ms(Ms({},Vu),{runtime:"browser",base64Decoder:zr,base64Encoder:Br,bodyLengthChecker:to,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:oo({serviceId:Vu.serviceId,clientVersion:qu.version}),maxAttempts:3,region:Dr("Region is missing"),requestHandler:new Ir,sha256:Or.Sha256,streamCollector:Ur,utf8Decoder:io.fromUtf8,utf8Encoder:io.toUtf8}),Zu=function(e){function t(t){var n=this,r=Ms(Ms({},Yu),t),o=yo(r),i=ni(go(o)),a=si(Qr(i));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(Gr(n.config)),n.middlewareStack.use(_o(n.config)),n.middlewareStack.use(Eo(n.config)),n.middlewareStack.use(Ao(n.config)),n.middlewareStack.use(di(n.config)),n}return Rs(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(vr);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(Us||(Us={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Fs||(Fs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ds||(Ds={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(qs||(qs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Gs||(Gs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Hs||(Hs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ws||(Ws={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}($s||($s={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ks||(Ks={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Vs||(Vs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ys||(Ys={})),function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(Zs||(Zs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Js||(Js={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Xs||(Xs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Qs||(Qs={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(eu||(eu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(tu||(tu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(nu||(nu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ru||(ru={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ou||(ou={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(iu||(iu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(au||(au={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(su||(su={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(uu||(uu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(cu||(cu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(fu||(fu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(lu||(lu={})),function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(du||(du={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(hu||(hu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(pu||(pu={})),function(e){e.RULES="Rules",e.TOKEN="Token"}(gu||(gu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(vu||(vu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(mu||(mu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(yu||(yu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(bu||(bu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(wu||(wu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(_u||(_u={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Su||(Su={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Eu||(Eu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(xu||(xu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Au||(Au={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ou||(Ou={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ku||(ku={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Lu||(Lu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Iu||(Iu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Cu||(Cu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Pu||(Pu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Tu||(Tu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(ju||(ju={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Ru||(Ru={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Mu||(Mu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Nu||(Nu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(zu||(zu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Bu||(Bu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Uu||(Uu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Fu||(Fu={})),function(e){e.filterSensitiveLog=function(e){return Ms({},e)}}(Du||(Du={}));var Ju=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return zs(this,(function(m){switch(m.label){case 0:return r=[Ms({},e)],v={},[4,Oc(e.body,t)];case 1:switch(n=Ms.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=kc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Qu(n,t)];case 3:return o=Ms.apply(void 0,[Ms.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 4:return s=[{}],[4,ec(n,t)];case 5:return o=Ms.apply(void 0,[Ms.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 6:return u=[{}],[4,tc(n,t)];case 7:return o=Ms.apply(void 0,[Ms.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 8:return c=[{}],[4,nc(n,t)];case 9:return o=Ms.apply(void 0,[Ms.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 10:return f=[{}],[4,oc(n,t)];case 11:return o=Ms.apply(void 0,[Ms.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 12:return l=[{}],[4,ic(n,t)];case 13:return o=Ms.apply(void 0,[Ms.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 14:return d=[{}],[4,ac(n,t)];case 15:return o=Ms.apply(void 0,[Ms.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 16:return h=[{}],[4,sc(n,t)];case 17:return o=Ms.apply(void 0,[Ms.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Ms(Ms({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ec(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Xu=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o,i,a,s,u,c,f,l,d,h,p,g,v;return zs(this,(function(m){switch(m.label){case 0:return r=[Ms({},e)],v={},[4,Oc(e.body,t)];case 1:switch(n=Ms.apply(void 0,r.concat([(v.body=m.sent(),v)])),i="UnknownError",i=kc(e,n.body),i){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,Qu(n,t)];case 3:return o=Ms.apply(void 0,[Ms.apply(void 0,a.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 4:return s=[{}],[4,ec(n,t)];case 5:return o=Ms.apply(void 0,[Ms.apply(void 0,s.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 6:return u=[{}],[4,nc(n,t)];case 7:return o=Ms.apply(void 0,[Ms.apply(void 0,u.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 8:return c=[{}],[4,rc(n,t)];case 9:return o=Ms.apply(void 0,[Ms.apply(void 0,c.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 10:return f=[{}],[4,oc(n,t)];case 11:return o=Ms.apply(void 0,[Ms.apply(void 0,f.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 12:return l=[{}],[4,ic(n,t)];case 13:return o=Ms.apply(void 0,[Ms.apply(void 0,l.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 14:return d=[{}],[4,ac(n,t)];case 15:return o=Ms.apply(void 0,[Ms.apply(void 0,d.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 16:return h=[{}],[4,sc(n,t)];case 17:return o=Ms.apply(void 0,[Ms.apply(void 0,h.concat([m.sent()])),{name:i,$metadata:Ec(e)}]),[3,19];case 18:p=n.body,i=p.code||p.Code||i,o=Ms(Ms({},p),{name:""+i,message:p.message||p.Message||i,$fault:"client",$metadata:Ec(e)}),m.label=19;case 19:return g=o.message||o.Message||i,o.message=g,delete o.Message,[2,Promise.reject(Object.assign(new Error(g),o))]}}))}))},Qu=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=dc(n,t),[2,Ms({name:"ExternalServiceException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ec=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=gc(n,t),[2,Ms({name:"InternalErrorException",$fault:"server",$metadata:Ec(e)},r)]}))}))},tc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=vc(n,t),[2,Ms({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:Ec(e)},r)]}))}))},nc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=mc(n,t),[2,Ms({name:"InvalidParameterException",$fault:"client",$metadata:Ec(e)},r)]}))}))},rc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=yc(n,t),[2,Ms({name:"LimitExceededException",$fault:"client",$metadata:Ec(e)},r)]}))}))},oc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=bc(n,t),[2,Ms({name:"NotAuthorizedException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ic=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=wc(n,t),[2,Ms({name:"ResourceConflictException",$fault:"client",$metadata:Ec(e)},r)]}))}))},ac=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=_c(n,t),[2,Ms({name:"ResourceNotFoundException",$fault:"client",$metadata:Ec(e)},r)]}))}))},sc=function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n=e.body,r=Sc(n,t),[2,Ms({name:"TooManyRequestsException",$fault:"client",$metadata:Ec(e)},r)]}))}))},uc=function(e,t){return Ms(Ms(Ms({},void 0!==e.CustomRoleArn&&null!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&null!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:fc(e.Logins,t)})},cc=function(e,t){return Ms(Ms(Ms({},void 0!==e.AccountId&&null!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&null!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&null!==e.Logins&&{Logins:fc(e.Logins,t)})},fc=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=Bs(t,2),o=r[0],i=r[1];return null===i?e:Ms(Ms({},e),((n={})[o]=i,n))}),{})},lc=function(e,t){return{AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},dc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},hc=function(e,t){return{Credentials:void 0!==e.Credentials&&null!==e.Credentials?lc(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},pc=function(e,t){return{IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},gc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},vc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},mc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},yc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},bc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},wc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_c=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sc=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ec=function(e){var t;return{httpStatusCode:e.statusCode,requestId:null!==(t=e.headers["x-amzn-requestid"])&&void 0!==t?t:e.headers["x-amzn-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}},xc=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ac=function(e,t,n,r,o){return Ns(void 0,void 0,void 0,(function(){var i,a,s,u,c,f;return zs(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return i=l.sent(),a=i.hostname,s=i.protocol,u=void 0===s?"https":s,c=i.port,f={protocol:u,hostname:a,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==o&&(f.body=o),[2,new yn(f)]}}))}))},Oc=function(e,t){return function(e,t){return xc(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},kc=function(e,t){var n,r,o=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},i=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==i?o(e.headers[i]):void 0!==t.code?o(t.code):void 0!==t.__type?o(t.__type):""},Lc=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Rs(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetIdCommand",inputFilterSensitiveLog:cu.filterSensitiveLog,outputFilterSensitiveLog:fu.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(cc(e,t)),[2,Ac(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o;return zs(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Xu(e,t)]:[4,Oc(e.body,t)];case 1:return n=i.sent(),{},r=pc(n,t),o=Ms({$metadata:Ec(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Ic=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Rs(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(dr(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),o={logger:t.logger,clientName:"CognitoIdentityClient",commandName:"GetCredentialsForIdentityCommand",inputFilterSensitiveLog:iu.filterSensitiveLog,outputFilterSensitiveLog:su.filterSensitiveLog},i=t.requestHandler;return r.resolve((function(e){return i.handle(e.request,n||{})}),o)},t.prototype.serialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r;return zs(this,(function(o){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(uc(e,t)),[2,Ac(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ns(void 0,void 0,void 0,(function(){var n,r,o;return zs(this,(function(i){switch(i.label){case 0:return e.statusCode>=300?[2,Ju(e,t)]:[4,Oc(e.body,t)];case 1:return n=i.sent(),{},r=hc(n,t),o=Ms({$metadata:Ec(e)},r),[2,Promise.resolve(o)]}}))}))}(e,t)},t}(mr),Cc=function(){return(Cc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Pc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},Tc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},jc=new g("Credentials"),Rc=function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=zi.refreshGoogleToken,this._refreshHandlers.facebook=Bi.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Cc(Cc({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new vi).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return jc.debug("getting credentials"),this._pickupCredentials()},e.prototype._getCognitoIdentityIdStorageKey=function(e){return"CognitoIdentityId-"+e},e.prototype._pickupCredentials=function(){return jc.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?jc.debug("getting old cred promise"):(jc.debug("getting new cred promise"),this._gettingCredPromise=Object(U.i)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){return Pc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a;return Tc(this,(function(s){switch(s.label){case 0:if(jc.debug("checking if credentials exists and not expired"),(e=this._credentials)&&!this._isExpired(e)&&!this._isPastTTL())return jc.debug("credentials not changed and not expired, directly return"),[2,Promise.resolve(e)];if(jc.debug("need to get a new credential or refresh the existing one"),t=this.Auth,!(n=void 0===t?b.Auth:t)||"function"!=typeof n.currentUserCredentials)return[2,Promise.reject("No Auth module registered in Amplify")];if(this._isExpired(e)||!this._isPastTTL())return[3,6];jc.debug("ttl has passed but token is not yet expired"),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,n.currentUserPoolUser()];case 2:return r=s.sent(),[4,n.currentSession()];case 3:return o=s.sent(),i=o.refreshToken,[4,new Promise((function(e,t){r.refreshSession(i,(function(n,r){return n?t(n):e(r)}))}))];case 4:return s.sent(),[3,6];case 5:return a=s.sent(),jc.debug("Error attempting to refreshing the session",a),[3,6];case 6:return[2,n.currentUserCredentials()]}}))}))},e.prototype.refreshFederatedToken=function(e){jc.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,o=e.identity_id,i=e.expires_at;i=1970===new Date(i).getFullYear()?1e3*i:i;return jc.debug("checking if federated jwt token expired"),i>(new Date).getTime()?(jc.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:o,expires_at:i})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(jc.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(jc.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,o=e.user;return Oi(n,[],1e4).then((function(e){return jc.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:o,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),jc.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return jc.debug("no credentials for expiration check"),!0;jc.debug("are these credentials expired?",e);var t=Date.now();return e.expiration.getTime()<=t},e.prototype._isPastTTL=function(){return this._nextCredentialsRefresh<=Date.now()},e.prototype._setCredentialsForGuest=function(){return Pc(this,void 0,void 0,(function(){var e,t,n,r,o,i,a,s=this;return Tc(this,(function(u){switch(u.label){case 0:return jc.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn?[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")]:t?n?(o=this,[4,this._getGuestIdentityId()]):(jc.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")]):(jc.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")]);case 1:return r=o._identityId=u.sent(),i=new Zu({region:n,customUserAgent:_()}),a=void 0,a=r?Ls({identityId:r,client:i})():function(){return Pc(s,void 0,void 0,(function(){var e;return Tc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Lc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ls({client:i,identityId:e})()]}}))}))}().catch((function(e){return Pc(s,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null).then((function(e){return e})).catch((function(e){return Pc(s,void 0,void 0,(function(){var n=this;return Tc(this,(function(o){switch(o.label){case 0:return"ResourceNotFoundException"!==e.name||e.message!=="Identity '"+r+"' not found."?[3,2]:(jc.debug("Failed to load guest credentials"),[4,this._removeGuestIdentityId()]);case 1:return o.sent(),a=function(){return Pc(n,void 0,void 0,(function(){var e;return Tc(this,(function(n){switch(n.label){case 0:return[4,i.send(new Lc({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Ls({client:i,identityId:e})()]}}))}))}().catch((function(e){return Pc(n,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))})),[2,this._loadCredentials(a,"guest",!1,null)];case 2:return[2,e]}}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,o={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!o)return Promise.reject("You must specify a federated provider");var i={};i[o]=n;var a=this._config,s=a.identityPoolId,u=a.region;if(!s)return jc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return jc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new Zu({region:u,customUserAgent:_()}),f=void 0;r?f=Ls({identityId:r,logins:i,client:c})():f=Ts({logins:i,identityPoolId:s,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;jc.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,o=r.region,i=r.userPoolId,a=r.identityPoolId;if(!a)return jc.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!o)return jc.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var s={};s["cognito-idp."+o+".amazonaws.com/"+i]=n;var u=new Zu({region:o,customUserAgent:_()}),c=Pc(t,void 0,void 0,(function(){var e,t,n,r,o,i,c,f,l,d;return Tc(this,(function(h){switch(h.label){case 0:return[4,this._getGuestIdentityId()];case 1:return(e=h.sent())?[3,3]:[4,u.send(new Lc({IdentityPoolId:a,Logins:s}))];case 2:n=h.sent().IdentityId,t=n,h.label=3;case 3:return[4,u.send(new Ic({IdentityId:e||t,Logins:s}))];case 4:return r=h.sent(),o=r.Credentials,i=o.AccessKeyId,c=o.Expiration,f=o.SecretKey,l=o.SessionToken,d=r.IdentityId,this._identityId=d,e?(jc.debug("The guest identity "+e+" has been successfully linked to the logins"),e===d&&jc.debug("The guest identity "+e+" has become the primary identity"),[4,this._removeGuestIdentityId()]):[3,6];case 5:h.sent(),h.label=6;case 6:return[2,{accessKeyId:i,secretAccessKey:f,sessionToken:l,expiration:c,identityId:d}]}}))})).catch((function(e){return Pc(t,void 0,void 0,(function(){return Tc(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var o=this,i=this;return new Promise((function(a,s){e.then((function(e){return Pc(o,void 0,void 0,(function(){var o,s,u,c,f;return Tc(this,(function(l){switch(l.label){case 0:if(jc.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),i._credentials=e,i._credentials.authenticated=n,i._credentials_source=t,i._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){o=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,u=r.token,c=r.expires_at,f=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:u,user:o,expires_at:c,identity_id:f}))}catch(e){jc.debug("Failed to put federated info into auth storage",e)}}return"guest"!==t?[3,2]:[4,this._setGuestIdentityId(e.identityId)];case 1:l.sent(),l.label=2;case 2:return a(i._credentials),[2]}}))}))})).catch((function(t){if(t)return jc.debug("Failed to load credentials",e),jc.debug("Error loading credentials",t),void s(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(jc.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Pc(this,void 0,void 0,(function(){return Tc(this,(function(e){return this._credentials=null,this._credentials_source=null,jc.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype._getGuestIdentityId=function(){return Pc(this,void 0,void 0,(function(){var e,t;return Tc(this,(function(n){switch(n.label){case 0:e=this._config.identityPoolId,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._storageSync];case 2:return n.sent(),[2,this._storage.getItem(this._getCognitoIdentityIdStorageKey(e))];case 3:return t=n.sent(),jc.debug("Failed to get the cached guest identityId",t),[3,4];case 4:return[2]}}))}))},e.prototype._setGuestIdentityId=function(e){return Pc(this,void 0,void 0,(function(){var t,n;return Tc(this,(function(r){switch(r.label){case 0:t=this._config.identityPoolId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),this._storage.setItem(this._getCognitoIdentityIdStorageKey(t),e),[3,4];case 3:return n=r.sent(),jc.debug("Failed to cache guest identityId",n),[3,4];case 4:return[2]}}))}))},e.prototype._removeGuestIdentityId=function(){return Pc(this,void 0,void 0,(function(){var e;return Tc(this,(function(t){return e=this._config.identityPoolId,jc.debug("removing "+this._getCognitoIdentityIdStorageKey(e)+" from storage"),this._storage.removeItem(this._getCognitoIdentityIdStorageKey(e)),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}(),Mc=new Rc(null);b.register(Mc);var Nc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},zc=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Bc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Uc=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Bc(arguments[t]));return e},Fc=new g("AWSCloudWatch"),Dc=function(){function e(e){this.configure(e),this._dataTracker={eventUploadInProgress:!1,logEvents:[]},this._currentLogBatch=[],this._initiateLogPushInterval()}return e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.getCategoryName=function(){return e.CATEGORY},e.prototype.getLogQueue=function(){return this._dataTracker.logEvents},e.prototype.configure=function(e){if(!e)return this._config||{};var t=Object.assign({},this._config,le(e).Logging,e);return this._config=t,this._config},e.prototype.createLogGroup=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("creating new log group in CloudWatch - ",e.logGroupName),t=new br(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error creating log group - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogGroups=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting list of log groups"),t=new wr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log group - "+n),n;case 5:return[2]}}))}))},e.prototype.createLogStream=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("creating new log stream in CloudWatch - ",e.logStreamName),t=new _r(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error creating log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogStreams=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting list of log streams"),t=new Sr(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log stream - "+n),n;case 5:return[2]}}))}))},e.prototype.getLogEvents=function(e){return Nc(this,void 0,void 0,(function(){var t,n;return zc(this,(function(r){switch(r.label){case 0:Fc.debug("getting log events from stream - ",e.logStreamName),t=new Er(e),r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this._ensureCredentials()];case 2:if(!r.sent())throw new Error(c);return[4,this._initCloudWatchLogs().send(t)];case 3:return[2,r.sent()];case 4:throw n=r.sent(),Fc.error("error getting log events - "+n),n;case 5:return[2]}}))}))},e.prototype.pushLogs=function(e){Fc.debug("pushing log events to Cloudwatch..."),this._dataTracker.logEvents=Uc(this._dataTracker.logEvents,e)},e.prototype._validateLogGroupExistsAndCreate=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r,o;return zc(this,(function(i){switch(i.label){case 0:if(this._dataTracker.verifiedLogGroup)return[2,this._dataTracker.verifiedLogGroup];i.label=1;case 1:return i.trys.push([1,5,,6]),[4,this._ensureCredentials()];case 2:if(!i.sent())throw new Error(c);return[4,this.getLogGroups({logGroupNamePrefix:e})];case 3:return"string"!=typeof(t=i.sent())&&t.logGroups&&(n=t.logGroups.filter((function(t){return t.logGroupName===e}))).length>0?(this._dataTracker.verifiedLogGroup=n[0],[2,n[0]]):[4,this.createLogGroup({logGroupName:e})];case 4:return i.sent(),[2,null];case 5:throw r=i.sent(),o="failure during log group search: "+r,Fc.error(o),r;case 6:return[2]}}))}))},e.prototype._validateLogStreamExists=function(e,t){return Nc(this,void 0,void 0,(function(){var n,r,o,i;return zc(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),[4,this._ensureCredentials()];case 1:if(!a.sent())throw new Error(c);return[4,this.getLogStreams({logGroupName:e,logStreamNamePrefix:t})];case 2:return(n=a.sent()).logStreams&&(r=n.logStreams.filter((function(e){return e.logStreamName===t}))).length>0?(this._nextSequenceToken=r[0].uploadSequenceToken,[2,r[0]]):[4,this.createLogStream({logGroupName:e,logStreamName:t})];case 3:return a.sent(),[2,null];case 4:throw o=a.sent(),i="failure during log stream search: "+o,Fc.error(i),o;case 5:return[2]}}))}))},e.prototype._sendLogEvents=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r;return zc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this._ensureCredentials()];case 1:if(!o.sent())throw new Error(c);return Fc.debug("sending log events to stream - ",e.logStreamName),t=new xr(e),[4,this._initCloudWatchLogs().send(t)];case 2:return[2,o.sent()];case 3:return n=o.sent(),r="failure during log push: "+n,Fc.error(r),[3,4];case 4:return[2]}}))}))},e.prototype._initCloudWatchLogs=function(){return new hi({region:this._config.region,credentials:this._config.credentials,customUserAgent:_(),endpoint:this._config.endpoint})},e.prototype._ensureCredentials=function(){return Nc(this,void 0,void 0,(function(){var e=this;return zc(this,(function(t){switch(t.label){case 0:return[4,Mc.get().then((function(t){if(!t)return!1;var n=Mc.shear(t);return Fc.debug("set credentials for logging",n),e._config.credentials=n,!0})).catch((function(e){return Fc.warn("ensure credentials error",e),!1}))];case 1:return[2,t.sent()]}}))}))},e.prototype._getNextSequenceToken=function(){return Nc(this,void 0,void 0,(function(){var e,t;return zc(this,(function(n){switch(n.label){case 0:if(this._nextSequenceToken&&this._nextSequenceToken.length>0)return[2,this._nextSequenceToken];n.label=1;case 1:return n.trys.push([1,4,,5]),[4,this._validateLogGroupExistsAndCreate(this._config.logGroupName)];case 2:return n.sent(),this._nextSequenceToken=void 0,[4,this._validateLogStreamExists(this._config.logGroupName,this._config.logStreamName)];case 3:return(e=n.sent())&&(this._nextSequenceToken=e.uploadSequenceToken),[2,this._nextSequenceToken];case 4:throw t=n.sent(),Fc.error("failure while getting next sequence token: "+t),t;case 5:return[2]}}))}))},e.prototype._safeUploadLogEvents=function(){return Nc(this,void 0,void 0,(function(){var e,t,n,r,o;return zc(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this._getNextSequenceToken()];case 1:return e=i.sent(),t=0===this._currentLogBatch.length?this._getBufferedBatchOfLogs():this._currentLogBatch,n={logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName,logEvents:t,sequenceToken:e},this._dataTracker.eventUploadInProgress=!0,[4,this._sendLogEvents(n)];case 2:return r=i.sent(),this._nextSequenceToken=r.nextSequenceToken,this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,r];case 3:if(o=i.sent(),Fc.error("error during _safeUploadLogEvents: "+o),!f.includes(o.name))throw this._dataTracker.eventUploadInProgress=!1,o;return this._getNewSequenceTokenAndSubmit({logEvents:this._currentLogBatch,logGroupName:this._config.logGroupName,logStreamName:this._config.logStreamName}),[3,4];case 4:return[2]}}))}))},e.prototype._getBufferedBatchOfLogs=function(){for(var e=0,t=0;e<this._dataTracker.logEvents.length;){var n=this._dataTracker.logEvents[e],r=n?(new TextEncoder).encode(n.message).length+o:0;if(r>a){var s="Log entry exceeds maximum size for CloudWatch logs. Log size: "+r+". Truncating log message.";Fc.warn(s),n.message=n.message.substring(0,r)}if(t+r>i)break;t+=r,e++}return this._currentLogBatch=this._dataTracker.logEvents.splice(0,e),this._currentLogBatch},e.prototype._getNewSequenceTokenAndSubmit=function(e){return Nc(this,void 0,void 0,(function(){var t,n,r;return zc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this._nextSequenceToken=void 0,this._dataTracker.eventUploadInProgress=!0,[4,this._getNextSequenceToken()];case 1:return t=o.sent(),e.sequenceToken=t,[4,this._sendLogEvents(e)];case 2:return n=o.sent(),this._dataTracker.eventUploadInProgress=!1,this._currentLogBatch=[],[2,n];case 3:throw r=o.sent(),Fc.error("error when retrying log submission with new sequence token: "+r),this._dataTracker.eventUploadInProgress=!1,r;case 4:return[2]}}))}))},e.prototype._initiateLogPushInterval=function(){var e=this;this._timer&&clearInterval(this._timer),this._timer=setInterval((function(){return Nc(e,void 0,void 0,(function(){var e;return zc(this,(function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),this._getDocUploadPermissibility()?[4,this._safeUploadLogEvents()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[3,4];case 3:return e=t.sent(),Fc.error("error when calling _safeUploadLogEvents in the timer interval - "+e),[3,4];case 4:return[2]}}))}))}),2e3)},e.prototype._getDocUploadPermissibility=function(){return(0!==this._dataTracker.logEvents.length||0!==this._currentLogBatch.length)&&!this._dataTracker.eventUploadInProgress},e.PROVIDER_NAME=u,e.CATEGORY=s,e}(),qc={},Gc={addEventListener:function(e,t){}},Hc=Object(U.b)().isBrowser?(new vi).getStorage():void 0;function Wc(e){return(Wc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var $c=function(){function e(){this._logger=new g("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,o){if(!navigator||!("serviceWorker"in navigator))return o(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),o(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(U.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),o=0;o<n.length;++o)r[o]=n.charCodeAt(o);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"===Wc(e)?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),b.Analytics&&"function"==typeof b.Analytics.record&&b.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}(),Kc=n(5);function Vc(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var Yc=function(){return(Yc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},Zc=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?Kc.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=Kc.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),Vc(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=Vc(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=Yc(Yc({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Kc.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=Yc(Yc({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Yc({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Kc.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),Jc=Object(U.b)().isBrowser,Xc=function(){function e(e){void 0===e&&(e={}),this.cookies=new Zc,this.store=Jc?window.localStorage:Object.create(null),this.cookies=e.req?new Zc(e.req.headers.cookie):new Zc,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e,{path:"/"})},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"refreshToken":case"idToken":Jc?this.setUniversalItem(e,t):this.setLocalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),Qc="undefined"!=typeof Symbol&&"function"==typeof Symbol.for,ef=Qc?Symbol.for("INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_PUBSUB_PROVIDER",tf=Qc?Symbol.for("INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER"):"@@INTERNAL_AWS_APPSYNC_REALTIME_PUBSUB_PROVIDER",nf="x-amz-user-agent",rf=function(){function e(){this._queue=[],this._pending=!1}return e.prototype.isLocked=function(){return this._pending},e.prototype.acquire=function(){var e=this,t=new Promise((function(t){return e._queue.push(t)}));return this._pending||this._dispatchNext(),t},e.prototype.runExclusive=function(e){return this.acquire().then((function(t){var n;try{n=e()}catch(e){throw t(),e}return Promise.resolve(n).then((function(e){return t(),e}),(function(e){throw t(),e}))}))},e.prototype._dispatchNext=function(){this._queue.length>0?(this._pending=!0,this._queue.shift()(this._dispatchNext.bind(this))):this._pending=!1},e}(),of=n(22),af=n.n(of).a,sf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},uf=function(){function e(){}return e.prototype.networkMonitor=function(t){if(Object(U.b)().isNode)return af.from([{online:!0}]);var n=Object(U.h)()?self:window;return new af((function(t){t.next({online:n.navigator.onLine});var r=function(){return t.next({online:!0})},o=function(){return t.next({online:!1})};return n.addEventListener("online",r),n.addEventListener("offline",o),e._observers.push(t),function(){n.removeEventListener("online",r),n.removeEventListener("offline",o),e._observers=e._observers.filter((function(e){return e!==t}))}}))},e._observerOverride=function(t){var n,r,o=function(n){if(n.closed)return e._observers=e._observers.filter((function(e){return e!==n})),"continue";n.next(t)};try{for(var i=sf(e._observers),a=i.next();!a.done;a=i.next()){o(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e._observers=[],e}();function cf(e){return e.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join("")}function ff(e){return e.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join("")}var lf={userAgent:w.userAgent};t.default=b},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return o}));var r=function(e){return"function"==typeof TextEncoder?function(e){return(new TextEncoder).encode(e)}(e):function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e.charCodeAt(n);if(o<128)t.push(o);else if(o<2048)t.push(o>>6|192,63&o|128);else if(n+1<e.length&&55296==(64512&o)&&56320==(64512&e.charCodeAt(n+1))){var i=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n));t.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else t.push(o>>12|224,o>>6&63|128,63&o|128)}return Uint8Array.from(t)}(e)},o=function(e){return"function"==typeof TextDecoder?function(e){return new TextDecoder("utf-8").decode(e)}(e):function(e){for(var t="",n=0,r=e.length;n<r;n++){var o=e[n];if(o<128)t+=String.fromCharCode(o);else if(192<=o&&o<224){var i=e[++n];t+=String.fromCharCode((31&o)<<6|63&i)}else if(240<=o&&o<365){var a="%"+[o,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(a)}else t+=String.fromCharCode((15&o)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}])}));
32
32
  //# sourceMappingURL=aws-amplify-core.min.js.map
@@ -1 +1 @@
1
- export declare const version = "4.5.6";
1
+ export declare const version = "4.5.7";
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  // generated by genversion
4
- exports.version = '4.5.6';
4
+ exports.version = '4.5.7';
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- export declare const version = "4.5.6";
1
+ export declare const version = "4.5.7";
@@ -1,3 +1,3 @@
1
1
  // generated by genversion
2
- export var version = '4.5.6';
2
+ export var version = '4.5.7';
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "4.5.7",
3
+ "version": "4.5.8",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -108,5 +108,5 @@
108
108
  "lib-esm"
109
109
  ]
110
110
  },
111
- "gitHead": "d4364447760f62f8aaa20c415747e9df753dbaea"
111
+ "gitHead": "f206bf675cd63bee4147984b050036c82905bf27"
112
112
  }
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '4.5.6';
2
+ export const version = '4.5.7';