text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@aws-amplify/core"),require("@aws-amplify/cache")):"function"==typeof define&&define.amd?define("aws_amplify_analytics",["@aws-amplify/core","@aws-amplify/cache"],t):"object"==typeof exports?exports.aws_amplify_analytics=t(require("@aws-amplify/core"),require("@aws-amplify/cache")):e.aws_amplify_analytics=t(e["@aws-amplify/core"],e["@aws-amplify/cache"])}(this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=139)}([function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return i})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return s})),n.d(t,"__decorate",(function(){return a})),n.d(t,"__param",(function(){return u})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return f})),n.d(t,"__generator",(function(){return d})),n.d(t,"__createBinding",(function(){return l})),n.d(t,"__exportStar",(function(){return p})),n.d(t,"__values",(function(){return h})),n.d(t,"__read",(function(){return v})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return m})),n.d(t,"__await",(function(){return y})),n.d(t,"__asyncGenerator",(function(){return b})),n.d(t,"__asyncDelegator",(function(){return w})),n.d(t,"__asyncValues",(function(){return _})),n.d(t,"__makeTemplateObject",(function(){return S})),n.d(t,"__importStar",(function(){return E})),n.d(t,"__importDefault",(function(){return A})),n.d(t,"__classPrivateFieldGet",(function(){return O})),n.d(t,"__classPrivateFieldSet",(function(){return k}));
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */
  var r=function(e,t){return(r=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 i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}function p(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function h(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.")}function v(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function y(e){return this instanceof y?(this.v=e,this):new y(e)}function b(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),o=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){o.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=i[e](t)).value instanceof y?Promise.resolve(n.value.v).then(u,c):f(o[0][2],n)}catch(e){f(o[0][3],e)}var n}function u(e){a("next",e)}function c(e){a("throw",e)}function f(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function w(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:y(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=h(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function S(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function E(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function A(e){return e&&e.__esModule?e:{default:e}}function O(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function k(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(t,n){t.exports=e},function(e,t,n){var r=n(52),i=n(53),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r=n(36),i=n(38),o=n(39),s=n(6),a=n(40),u=n(22),c=n(37),f=n(23),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(a(e)&&(s(e)||"string"==typeof e||"function"==typeof e.splice||u(e)||f(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},function(e,t,n){var r=n(31),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebCryptoSha256=t.Ie11Sha256=void 0,n(0).__exportStar(n(54),t);var r=n(26);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var i=n(29);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return i.Sha256}})},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(78),i=n(81);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,n){e.exports=t},function(e,t,n){var r=n(11),i=n(70),o=n(71),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?i(e):o(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(4).Symbol;e.exports=r},function(e,t,n){var r=n(7)(Object,"create");e.exports=r},function(e,t,n){var r=n(86),i=n(87),o=n(88),s=n(89),a=n(90);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(35);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(92);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crc32=t.crc32=void 0;var r=n(0);t.crc32=function(e){return(new i).update(e).digest()};var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var i=r.__values(e),s=i.next();!s.done;s=i.next()){var a=s.value;this.checksum=this.checksum>>>8^o[255&(this.checksum^a)]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}();t.Crc32=i;var o=Uint32Array.from([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117])},function(e,t,n){var r=n(111);e.exports=function(e,t){return r(e,t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"locateWindow",(function(){return i}));var r={};function i(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:r}},function(e,t,n){var r=n(9),i=n(10);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(75),i=n(91),o=n(93),s=n(94),a=n(95);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(7)(n(4),"Map");e.exports=r},function(e,t,n){(function(e){var r=n(4),i=n(107),o=t&&!t.nodeType&&t,s=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===o?r.Buffer:void 0,u=(a?a.isBuffer:void 0)||i;e.exports=u}).call(this,n(42)(e))},function(e,t,n){var r=n(108),i=n(109),o=n(110),s=o&&o.isTypedArray,a=s?i(s):r;e.exports=a},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var i=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,i=n;return[i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],"-",i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]],i[e[r++]]].join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(27),i=n(28),o=n(44),s=n(18),a=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=s.locateWindow().msCrypto.subtle.importKey("raw",u(e),i.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n(new Error("ImportKey completed without importing key."))},r.onerror=function(){n(new Error("ImportKey failed to import key."))}}))}(e).then((function(e){return s.locateWindow().msCrypto.subtle.sign(i.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve(s.locateWindow().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;r.isEmptyData(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(u(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n(new Error("Error encountered finalizing hash"))},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n(new Error("Error encountered finalizing hash"))},e.finish()}))}))},e}();function u(e){return"string"==typeof e?o.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},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.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(44),i=n(27),o=n(28),s=n(18),a=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){s.locateWindow().crypto.subtle.importKey("raw",u(e),o.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!i.isEmptyData(e)){var t=u(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return s.locateWindow().crypto.subtle.sign(o.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):i.isEmptyData(this.toHash)?Promise.resolve(o.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return s.locateWindow().crypto.subtle.digest(o.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();function u(e){return"string"==typeof e?r.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(69))},function(e,t,n){var r=n(9),i=n(33);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(37),i=n(100),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(102),i=n(21),o=n(103),s=n(104),a=n(105),u=n(9),c=n(34),f=c(r),d=c(i),l=c(o),p=c(s),h=c(a),v=u;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||s&&"[object Set]"!=v(new s)||a&&"[object WeakMap]"!=v(new a))&&(v=function(e){var t=u(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case f:return"[object DataView]";case d:return"[object Map]";case l:return"[object Promise]";case p:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,n){var r=n(106),i=n(10),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=r(function(){return arguments}())?r:function(e){return i(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=u},function(e,t,n){var r=n(32),i=n(41);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(119),i=n(122),o=n(123);e.exports=function(e,t,n,s,a,u){var c=1&n,f=e.length,d=t.length;if(f!=d&&!(c&&d>f))return!1;var l=u.get(e),p=u.get(t);if(l&&p)return l==t&&p==e;var h=-1,v=!0,g=2&n?new r:void 0;for(u.set(e,t),u.set(t,e);++h<f;){var m=e[h],y=t[h];if(s)var b=c?s(y,m,h,t,e,u):s(m,y,h,e,t,u);if(void 0!==b){if(b)continue;v=!1;break}if(g){if(!i(t,(function(e,t){if(!o(g,t)&&(m===e||a(m,e,n,s,u)))return g.push(t)}))){v=!1;break}}else if(m!==y&&!a(m,y,n,s,u)){v=!1;break}}return u.delete(e),u.delete(t),v}},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));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 i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=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 i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var s="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(s)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18),i=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||""},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||""},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,n,r){void 0===r&&(r=!1);var i=e.getVersionPrecision(t),o=e.getVersionPrecision(n),s=Math.max(i,o),a=0,u=e.map([t,n],(function(t){var n=s-e.getVersionPrecision(t),r=t+new Array(n+1).join(".0");return e.map(r.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(r&&(a=s-Math.min(i,o)),s-=1;s>=a;){if(u[0][s]>u[1][s])return 1;if(u[0][s]===u[1][s]){if(s===a)return 0;s-=1}else if(u[0][s]<u[1][s])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];if(Object.assign)return Object.assign.apply(Object,[e].concat(o));var a=function(){var e=o[t];"object"==typeof e&&null!==e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=o.length;t<n;t+=1)a();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||""},e}();t.default=i,e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},t.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},t.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},t.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},t.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},o=n(18);function s(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)}}var a=function(){function e(){}var t,n;return e.getParser=function(e,t){if(void 0===t&&(t=!1),"string"!=typeof e)throw new Error("UserAgent should be a string");return new i.default(e,t)},e.parse=function(e){return new i.default(e).getResult()},t=e,(n=[{key:"BROWSER_MAP",get:function(){return o.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return o.ENGINE_MAP}},{key:"OS_MAP",get:function(){return o.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return o.PLATFORMS_MAP}}])&&s(t,n),e}();t.default=a,e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=u(n(92)),i=u(n(93)),o=u(n(94)),s=u(n(95)),a=u(n(17));function u(e){return e&&e.__esModule?e:{default:e}}var c=function(){function e(e,t){if(void 0===t&&(t=!1),null==e||""===e)throw new Error("UserAgent parameter can't be empty");this._ua=e,this.parsedResult={},!0!==t&&this.parse()}var t=e.prototype;return t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=a.default.find(r.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.browser=t.describe(this.getUA())),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=a.default.find(i.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||"":t||""},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){void 0===e&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||"":t||""},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=a.default.find(o.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=a.default.find(s.default,(function(t){if("function"==typeof t.test)return t.test(e);if(t.test instanceof Array)return t.test.some((function(t){return e.test(t)}));throw new Error("Browser's test function is not valid")}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return a.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},o=0;if(Object.keys(e).forEach((function(t){var s=e[t];"string"==typeof s?(i[t]=s,o+=1):"object"==typeof s&&(n[t]=s,r+=1)})),r>0){var s=Object.keys(n),u=a.default.find(s,(function(e){return t.isOS(e)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var f=a.default.find(s,(function(e){return t.isPlatform(e)}));if(f){var d=this.satisfies(n[f]);if(void 0!==d)return d}}if(o>0){var l=Object.keys(i),p=a.default.find(l,(function(e){return t.isBrowser(e,!0)}));if(void 0!==p)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),t.indexOf(a.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=c,e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=/version\/(\d+(\.?_?\d+)+)/i,s=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},n=i.default.getFirstMatch(o,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:"Android Browser"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},n=i.default.getFirstMatch(o,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=s,e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:o.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:o.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:o.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(t),r={name:o.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:o.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:o.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:o.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:o.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:o.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:o.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:o.OS_MAP.PlayStation4,version:t}}}];t.default=s,e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",n={type:o.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:o.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:o.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:o.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:o.PLATFORMS_MAP.tv}}}];t.default=s,e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},o=n(18),s=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:o.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:o.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:o.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:o.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:o.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:o.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:o.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}];t.default=s,e.exports=t.default}})},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-pinpoint","description":"AWS SDK for JavaScript Pinpoint Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test":"exit 0","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-pinpoint","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-pinpoint"}}')},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-kinesis","description":"AWS SDK for JavaScript Kinesis Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test":"exit 0","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/eventstream-serde-browser":"3.6.1","@aws-sdk/eventstream-serde-config-resolver":"3.6.1","@aws-sdk/eventstream-serde-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","@aws-sdk/util-waiter":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-kinesis","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-kinesis"}}')},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-firehose","description":"AWS SDK for JavaScript Firehose Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test":"exit 0","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-firehose","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-firehose"}}')},function(e,t,n){var r=n(66);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},function(e){e.exports=JSON.parse('{"name":"@aws-sdk/client-personalize-events","description":"AWS SDK for JavaScript Personalize Events Client for Node.js, Browser and React Native","version":"3.6.1","scripts":{"clean":"yarn remove-definitions && yarn remove-dist && yarn remove-documentation","build-documentation":"yarn remove-documentation && typedoc ./","prepublishOnly":"yarn build","pretest":"yarn build:cjs","remove-definitions":"rimraf ./types","remove-dist":"rimraf ./dist","remove-documentation":"rimraf ./docs","test":"exit 0","build:cjs":"tsc -p tsconfig.json","build:es":"tsc -p tsconfig.es.json","build":"yarn build:cjs && yarn build:es","postbuild":"downlevel-dts types types/ts3.4"},"main":"./dist/cjs/index.js","types":"./types/index.d.ts","module":"./dist/es/index.js","browser":{"./runtimeConfig":"./runtimeConfig.browser"},"react-native":{"./runtimeConfig":"./runtimeConfig.native"},"sideEffects":false,"dependencies":{"@aws-crypto/sha256-browser":"^1.0.0","@aws-crypto/sha256-js":"^1.0.0","@aws-sdk/config-resolver":"3.6.1","@aws-sdk/credential-provider-node":"3.6.1","@aws-sdk/fetch-http-handler":"3.6.1","@aws-sdk/hash-node":"3.6.1","@aws-sdk/invalid-dependency":"3.6.1","@aws-sdk/middleware-content-length":"3.6.1","@aws-sdk/middleware-host-header":"3.6.1","@aws-sdk/middleware-logger":"3.6.1","@aws-sdk/middleware-retry":"3.6.1","@aws-sdk/middleware-serde":"3.6.1","@aws-sdk/middleware-signing":"3.6.1","@aws-sdk/middleware-stack":"3.6.1","@aws-sdk/middleware-user-agent":"3.6.1","@aws-sdk/node-config-provider":"3.6.1","@aws-sdk/node-http-handler":"3.6.1","@aws-sdk/protocol-http":"3.6.1","@aws-sdk/smithy-client":"3.6.1","@aws-sdk/types":"3.6.1","@aws-sdk/url-parser":"3.6.1","@aws-sdk/url-parser-native":"3.6.1","@aws-sdk/util-base64-browser":"3.6.1","@aws-sdk/util-base64-node":"3.6.1","@aws-sdk/util-body-length-browser":"3.6.1","@aws-sdk/util-body-length-node":"3.6.1","@aws-sdk/util-user-agent-browser":"3.6.1","@aws-sdk/util-user-agent-node":"3.6.1","@aws-sdk/util-utf8-browser":"3.6.1","@aws-sdk/util-utf8-node":"3.6.1","tslib":"^2.0.0"},"devDependencies":{"@aws-sdk/client-documentation-generator":"3.6.1","@types/node":"^12.7.5","downlevel-dts":"0.7.0","jest":"^26.1.0","rimraf":"^3.0.0","typedoc":"^0.19.2","typescript":"~4.1.2"},"engines":{"node":">=10.0.0"},"typesVersions":{"<4.0":{"types/*":["types/ts3.4/*"]}},"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-personalize-events","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-personalize-events"}}')},,function(e,t,n){var r,i,o=n(24),s=n(25),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,f=t||[],d=(e=e||{}).node||r,l=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==l){var p=o();null==d&&(d=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==l&&(l=i=16383&(p[6]<<8|p[7]))}var h=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:u+1,g=h-a+(v-u)/1e4;if(g<0&&void 0===e.clockseq&&(l=l+1&16383),(g<0||h>a)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,u=v,i=l;var m=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;f[c++]=m>>>24&255,f[c++]=m>>>16&255,f[c++]=m>>>8&255,f[c++]=255&m;var y=h/4294967296*1e4&268435455;f[c++]=y>>>8&255,f[c++]=255&y,f[c++]=y>>>24&15|16,f[c++]=y>>>16&255,f[c++]=l>>>8|128,f[c++]=255&l;for(var b=0;b<6;++b)f[c+b]=d[b];return t||s(f)}},function(e,t,n){var r=n(24),i=n(25);e.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(26),i=n(29),o=n(55),s=n(58),a=n(60),u=n(18),c=function(){function e(e){s.supportsWebCrypto(u.locateWindow())?this.hash=new i.Sha256(e):a.isMsWindow(u.locateWindow())?this.hash=new r.Sha256(e):this.hash=new o.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(56),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),i=n(30),o=n(57),s=n(140),a=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=u(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!function(e){if("string"==typeof e)return 0===e.length;return 0===e.byteLength}(e)&&!this.error)try{this.hash.update(u(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 r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e}();function u(e){return"string"==typeof e?s.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(30),i=function(){function e(){this.state=Int32Array.from(r.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>r.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===r.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%r.BLOCK_SIZE>=r.BLOCK_SIZE-8){for(var i=this.bufferLength;i<r.BLOCK_SIZE;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(i=this.bufferLength;i<r.BLOCK_SIZE-8;i++)t.setUint8(i,0);t.setUint32(r.BLOCK_SIZE-8,Math.floor(e/4294967296),!0),t.setUint32(r.BLOCK_SIZE-4,e),this.hashBuffer(),this.finished=!0}var o=new Uint8Array(r.DIGEST_LENGTH);for(i=0;i<8;i++)o[4*i]=this.state[i]>>>24&255,o[4*i+1]=this.state[i]>>>16&255,o[4*i+2]=this.state[i]>>>8&255,o[4*i+3]=this.state[i]>>>0&255;return o},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],i=t[1],o=t[2],s=t[3],a=t[4],u=t[5],c=t[6],f=t[7],d=0;d<r.BLOCK_SIZE;d++){if(d<16)this.temp[d]=(255&e[4*d])<<24|(255&e[4*d+1])<<16|(255&e[4*d+2])<<8|255&e[4*d+3];else{var l=this.temp[d-2],p=(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,h=((l=this.temp[d-15])>>>7|l<<25)^(l>>>18|l<<14)^l>>>3;this.temp[d]=(p+this.temp[d-7]|0)+(h+this.temp[d-16]|0)}var v=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(f+(r.KEY[d]+this.temp[d]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&i^n&o^i&o)|0;f=c,c=u,u=a,a=s+v|0,s=o,o=i,i=n,n=v+g|0}t[0]+=n,t[1]+=i,t[2]+=o,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=f},e}();t.RawSha256=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(0).__exportStar(n(59),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),i=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function o(e){return"object"==typeof e&&"object"==typeof e.crypto&&"function"==typeof e.crypto.getRandomValues}function s(e){return e&&i.every((function(t){return"function"==typeof e[t]}))}t.supportsWebCrypto=function(e){return!(!o(e)||"object"!=typeof e.crypto.subtle)&&s(e.crypto.subtle)},t.supportsSecureRandom=o,t.supportsSubtleCrypto=s,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(!s(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(61),t),r.__exportStar(n(62),t),r.__exportStar(n(63),t),r.__exportStar(n(64),t),r.__exportStar(n(65),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,i=t.subtle;return r.map((function(e){return i[e]})).concat(n).every((function(e){return"function"==typeof e}))}return!1}},function(e,t,n){var r=n(67),i=n(99);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[i(t[n++])];return n&&n==o?e:void 0}},function(e,t,n){var r=n(6),i=n(68),o=n(72),s=n(96);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(6),i=n(19),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(s.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(11),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=s.call(e);return r&&(t?e[a]=n:delete e[a]),i}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r=n(73),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=s},function(e,t,n){var r=n(74);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(20);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},function(e,t,n){var r=n(76),i=n(13),o=n(21);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(e,t,n){var r=n(77),i=n(82),o=n(83),s=n(84),a=n(85);function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}u.prototype.clear=r,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},function(e,t,n){var r=n(12);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(32),i=n(79),o=n(33),s=n(34),a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,d=c.hasOwnProperty,l=RegExp("^"+f.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?l:a).test(s(e))}},function(e,t,n){var r,i=n(80),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},function(e,t,n){var r=n(4)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(12),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(12),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},function(e,t,n){var r=n(12);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(14),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():i.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(14);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(14);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(14);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},function(e,t,n){var r=n(15);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(15);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(15);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(15);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},function(e,t,n){var r=n(97);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(11),i=n(98),o=n(6),s=n(19),a=r?r.prototype:void 0,u=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(s(t))return u?u.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}},function(e,t,n){var r=n(19);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(101)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(7)(n(4),"DataView");e.exports=r},function(e,t,n){var r=n(7)(n(4),"Promise");e.exports=r},function(e,t,n){var r=n(7)(n(4),"Set");e.exports=r},function(e,t,n){var r=n(7)(n(4),"WeakMap");e.exports=r},function(e,t,n){var r=n(9),i=n(10);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(9),i=n(41),o=n(10),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!s[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(31),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i&&r.process,a=function(){try{var e=o&&o.require&&o.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a}).call(this,n(42)(e))},function(e,t,n){var r=n(112),i=n(10);e.exports=function e(t,n,o,s,a){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,s,e,a))}},function(e,t,n){var r=n(113),i=n(43),o=n(124),s=n(128),a=n(38),u=n(6),c=n(22),f=n(23),d="[object Object]",l=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,p,h,v){var g=u(e),m=u(t),y=g?"[object Array]":a(e),b=m?"[object Array]":a(t),w=(y="[object Arguments]"==y?d:y)==d,_=(b="[object Arguments]"==b?d:b)==d,S=y==b;if(S&&c(e)){if(!c(t))return!1;g=!0,w=!1}if(S&&!w)return v||(v=new r),g||f(e)?i(e,t,n,p,h,v):o(e,t,y,n,p,h,v);if(!(1&n)){var E=w&&l.call(e,"__wrapped__"),A=_&&l.call(t,"__wrapped__");if(E||A){var O=E?e.value():e,k=A?t.value():t;return v||(v=new r),h(O,k,n,p,v)}}return!!S&&(v||(v=new r),s(e,t,n,p,h,v))}},function(e,t,n){var r=n(13),i=n(114),o=n(115),s=n(116),a=n(117),u=n(118);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=s,c.prototype.has=a,c.prototype.set=u,e.exports=c},function(e,t,n){var r=n(13);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(13),i=n(21),o=n(20);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(20),i=n(120),o=n(121);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=i,s.prototype.has=o,e.exports=s},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(11),i=n(125),o=n(35),s=n(43),a=n(126),u=n(127),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,l){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=a;case"[object Set]":var h=1&r;if(p||(p=u),e.size!=t.size&&!h)return!1;var v=l.get(e);if(v)return v==t;r|=2,l.set(e,t);var g=s(p(e),p(t),r,c,d,l);return l.delete(e),g;case"[object Symbol]":if(f)return f.call(e)==f.call(t)}return!1}},function(e,t,n){var r=n(4).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(129),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,s,a){var u=1&n,c=r(e),f=c.length;if(f!=r(t).length&&!u)return!1;for(var d=f;d--;){var l=c[d];if(!(u?l in t:i.call(t,l)))return!1}var p=a.get(e),h=a.get(t);if(p&&h)return p==t&&h==e;var v=!0;a.set(e,t),a.set(t,e);for(var g=u;++d<f;){var m=e[l=c[d]],y=t[l];if(o)var b=u?o(y,m,l,t,e,a):o(m,y,l,e,t,a);if(!(void 0===b?m===y||s(m,y,n,o,a):b)){v=!1;break}g||(g="constructor"==l)}if(v&&!g){var w=e.constructor,_=t.constructor;w==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof _&&_ instanceof _||(v=!1)}return a.delete(e),a.delete(t),v}},function(e,t,n){var r=n(130),i=n(132),o=n(135);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(131),i=n(6);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}},function(e,t,n){var r=n(133),i=n(134),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return o.call(e,t)})))}:i;e.exports=a},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(136),i=n(36),o=n(40);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){var r=n(137),i=n(39),o=n(6),s=n(22),a=n(138),u=n(23),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),f=!n&&i(e),d=!n&&!f&&s(e),l=!n&&!f&&!d&&u(e),p=n||f||d||l,h=p?r(e.length,String):[],v=h.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||d&&("offset"==g||"parent"==g)||l&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||a(g,v))||h.push(g);return h}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){"use strict";n.r(t),n.d(t,"Analytics",(function(){return Mo})),n.d(t,"AWSPinpointProvider",(function(){return zi})),n.d(t,"AWSKinesisProvider",(function(){return wu})),n.d(t,"AWSKinesisFirehoseProvider",(function(){return Qf})),n.d(t,"AmazonPersonalizeProvider",(function(){return Vd}));var r=n(1),i=function(e,t){return(i=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)};
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */function o(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}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function a(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function u(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}var f,d,l,p,h,v,g,m,y,b,w,_,S,E,A,O,k,L,I,M,x,P,j,R,T,C,N,D,z,U,F,B,q,K,V,H,G,$,W,Z,Y,J,Q,X,ee,te,ne,re,ie,oe,se,ae,ue,ce,fe,de,le,pe,he,ve,ge,me,ye,be,we,_e,Se,Ee,Ae,Oe,ke,Le,Ie,Me,xe,Pe,je,Re,Te,Ce,Ne,De,ze,Ue,Fe,Be,qe,Ke,Ve,He,Ge,$e,We,Ze,Ye,Je,Qe,Xe,et,tt,nt,rt,it,ot,st,at,ut,ct,ft,dt,lt,pt,ht,vt,gt,mt,yt,bt,wt,_t,St,Et,At,Ot,kt,Lt,It,Mt,xt,Pt,jt;Object.create;(f||(f={})).filterSensitiveLog=function(e){return s({},e)},(d||(d={})).filterSensitiveLog=function(e){return s({},e)},(l||(l={})).filterSensitiveLog=function(e){return s({},e)},(p||(p={})).filterSensitiveLog=function(e){return s({},e)},(h||(h={})).filterSensitiveLog=function(e){return s({},e)},(v||(v={})).filterSensitiveLog=function(e){return s({},e)},(g||(g={})).filterSensitiveLog=function(e){return s({},e)},(m||(m={})).filterSensitiveLog=function(e){return s({},e)},(y||(y={})).filterSensitiveLog=function(e){return s({},e)},(b||(b={})).filterSensitiveLog=function(e){return s({},e)},(w||(w={})).filterSensitiveLog=function(e){return s({},e)},(_||(_={})).filterSensitiveLog=function(e){return s({},e)},(S||(S={})).filterSensitiveLog=function(e){return s({},e)},(E||(E={})).filterSensitiveLog=function(e){return s({},e)},(A||(A={})).filterSensitiveLog=function(e){return s({},e)},(O||(O={})).filterSensitiveLog=function(e){return s({},e)},(k||(k={})).filterSensitiveLog=function(e){return s({},e)},(L||(L={})).filterSensitiveLog=function(e){return s({},e)},(I||(I={})).filterSensitiveLog=function(e){return s({},e)},(M||(M={})).filterSensitiveLog=function(e){return s({},e)},(x||(x={})).filterSensitiveLog=function(e){return s({},e)},(P||(P={})).filterSensitiveLog=function(e){return s({},e)},(j||(j={})).filterSensitiveLog=function(e){return s({},e)},(R||(R={})).filterSensitiveLog=function(e){return s({},e)},(T||(T={})).filterSensitiveLog=function(e){return s({},e)},(C||(C={})).filterSensitiveLog=function(e){return s({},e)},(N||(N={})).filterSensitiveLog=function(e){return s({},e)},(D||(D={})).filterSensitiveLog=function(e){return s({},e)},(z||(z={})).filterSensitiveLog=function(e){return s({},e)},(U||(U={})).filterSensitiveLog=function(e){return s({},e)},(F||(F={})).filterSensitiveLog=function(e){return s({},e)},(B||(B={})).filterSensitiveLog=function(e){return s({},e)},(q||(q={})).filterSensitiveLog=function(e){return s({},e)},(K||(K={})).filterSensitiveLog=function(e){return s({},e)},(V||(V={})).filterSensitiveLog=function(e){return s({},e)},(H||(H={})).filterSensitiveLog=function(e){return s({},e)},(G||(G={})).filterSensitiveLog=function(e){return s({},e)},($||($={})).filterSensitiveLog=function(e){return s({},e)},(W||(W={})).filterSensitiveLog=function(e){return s({},e)},(Z||(Z={})).filterSensitiveLog=function(e){return s({},e)},(Y||(Y={})).filterSensitiveLog=function(e){return s({},e)},(J||(J={})).filterSensitiveLog=function(e){return s({},e)},(Q||(Q={})).filterSensitiveLog=function(e){return s({},e)},(X||(X={})).filterSensitiveLog=function(e){return s({},e)},(ee||(ee={})).filterSensitiveLog=function(e){return s({},e)},(te||(te={})).filterSensitiveLog=function(e){return s({},e)},(ne||(ne={})).filterSensitiveLog=function(e){return s({},e)},(re||(re={})).filterSensitiveLog=function(e){return s({},e)},(ie||(ie={})).filterSensitiveLog=function(e){return s({},e)},(oe||(oe={})).filterSensitiveLog=function(e){return s({},e)},(se||(se={})).filterSensitiveLog=function(e){return s({},e)},(ae||(ae={})).filterSensitiveLog=function(e){return s({},e)},(ue||(ue={})).filterSensitiveLog=function(e){return s({},e)},(ce||(ce={})).filterSensitiveLog=function(e){return s({},e)},(fe||(fe={})).filterSensitiveLog=function(e){return s({},e)},(de||(de={})).filterSensitiveLog=function(e){return s({},e)},(le||(le={})).filterSensitiveLog=function(e){return s({},e)},(pe||(pe={})).filterSensitiveLog=function(e){return s({},e)},(he||(he={})).filterSensitiveLog=function(e){return s({},e)},(ve||(ve={})).filterSensitiveLog=function(e){return s({},e)},(ge||(ge={})).filterSensitiveLog=function(e){return s({},e)},(me||(me={})).filterSensitiveLog=function(e){return s({},e)},(ye||(ye={})).filterSensitiveLog=function(e){return s({},e)},(be||(be={})).filterSensitiveLog=function(e){return s({},e)},(we||(we={})).filterSensitiveLog=function(e){return s({},e)},(_e||(_e={})).filterSensitiveLog=function(e){return s({},e)},(Se||(Se={})).filterSensitiveLog=function(e){return s({},e)},(Ee||(Ee={})).filterSensitiveLog=function(e){return s({},e)},(Ae||(Ae={})).filterSensitiveLog=function(e){return s({},e)},(Oe||(Oe={})).filterSensitiveLog=function(e){return s({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return s({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return s({},e)},(Ie||(Ie={})).filterSensitiveLog=function(e){return s({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return s({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return s({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return s({},e)},(je||(je={})).filterSensitiveLog=function(e){return s({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return s({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return s({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return s({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return s({},e)},(De||(De={})).filterSensitiveLog=function(e){return s({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return s({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return s({},e)},(Fe||(Fe={})).filterSensitiveLog=function(e){return s({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return s({},e)},(qe||(qe={})).filterSensitiveLog=function(e){return s({},e)},(Ke||(Ke={})).filterSensitiveLog=function(e){return s({},e)},(Ve||(Ve={})).filterSensitiveLog=function(e){return s({},e)},(He||(He={})).filterSensitiveLog=function(e){return s({},e)},(Ge||(Ge={})).filterSensitiveLog=function(e){return s({},e)},($e||($e={})).filterSensitiveLog=function(e){return s({},e)},(We||(We={})).filterSensitiveLog=function(e){return s({},e)},(Ze||(Ze={})).filterSensitiveLog=function(e){return s({},e)},(Ye||(Ye={})).filterSensitiveLog=function(e){return s({},e)},(Je||(Je={})).filterSensitiveLog=function(e){return s({},e)},(Qe||(Qe={})).filterSensitiveLog=function(e){return s({},e)},(Xe||(Xe={})).filterSensitiveLog=function(e){return s({},e)},(et||(et={})).filterSensitiveLog=function(e){return s({},e)},(tt||(tt={})).filterSensitiveLog=function(e){return s({},e)},(nt||(nt={})).filterSensitiveLog=function(e){return s({},e)},(rt||(rt={})).filterSensitiveLog=function(e){return s({},e)},(it||(it={})).filterSensitiveLog=function(e){return s({},e)},(ot||(ot={})).filterSensitiveLog=function(e){return s({},e)},(st||(st={})).filterSensitiveLog=function(e){return s({},e)},(at||(at={})).filterSensitiveLog=function(e){return s({},e)},(ut||(ut={})).filterSensitiveLog=function(e){return s({},e)},(ct||(ct={})).filterSensitiveLog=function(e){return s({},e)},(ft||(ft={})).filterSensitiveLog=function(e){return s({},e)},(dt||(dt={})).filterSensitiveLog=function(e){return s({},e)},(lt||(lt={})).filterSensitiveLog=function(e){return s({},e)},(pt||(pt={})).filterSensitiveLog=function(e){return s({},e)},(ht||(ht={})).filterSensitiveLog=function(e){return s({},e)},(vt||(vt={})).filterSensitiveLog=function(e){return s({},e)},(gt||(gt={})).filterSensitiveLog=function(e){return s({},e)},(mt||(mt={})).filterSensitiveLog=function(e){return s({},e)},(yt||(yt={})).filterSensitiveLog=function(e){return s({},e)},(bt||(bt={})).filterSensitiveLog=function(e){return s({},e)},(wt||(wt={})).filterSensitiveLog=function(e){return s({},e)},(_t||(_t={})).filterSensitiveLog=function(e){return s({},e)},(St||(St={})).filterSensitiveLog=function(e){return s({},e)},(Et||(Et={})).filterSensitiveLog=function(e){return s({},e)},(At||(At={})).filterSensitiveLog=function(e){return s({},e)},(Ot||(Ot={})).filterSensitiveLog=function(e){return s({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return s({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return s({},e)},(It||(It={})).filterSensitiveLog=function(e){return s({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return s({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return s({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return s({},e)},(jt||(jt={})).filterSensitiveLog=function(e){return s({},e)};var Rt=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}(),Tt=n(0),Ct=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(Tt.__assign)(Object(Tt.__assign)({},this),{headers:Object(Tt.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,i=t[n];return Object(Tt.__assign)(Object(Tt.__assign)({},e),((r={})[n]=Array.isArray(i)?Object(Tt.__spread)(i):i,r))}),{}))),n},e}();var Nt=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(Tt.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(Tt.__assign)({},e))})),n},i=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(Tt.__spread)(i(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(Tt.__spread)(i(e)))})),t},o=function(){var n,r=[],o=[],s={};return e.forEach((function(e){var t=Object(Tt.__assign)(Object(Tt.__assign)({},e),{before:[],after:[]});t.name&&(s[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(Tt.__assign)(Object(Tt.__assign)({},e),{before:[],after:[]});t.name&&(s[t.name]=t),o.push(t)})),o.forEach((function(e){if(e.toMiddleware){var t=s[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 Dt[t.step]-Dt[e.step]||zt[t.priority||"normal"]-zt[e.priority||"normal"]}))).map(i).reduce((function(e,t){return e.push.apply(e,Object(Tt.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},s={add:function(t,r){void 0===r&&(r={});var i=r.name,o=r.override,s=Object(Tt.__assign)({step:"initialize",priority:"normal",middleware:t},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=e.findIndex((function(e){return e.name===i})),u=e[a];if(u.step!==s.step||u.priority!==s.priority)throw new Error('"'+i+'" middleware with '+u.priority+" priority in "+u.step+" step cannot be overridden by same-name middleware with "+s.priority+" priority in "+s.step+" step.");e.splice(a,1)}n.add(i)}e.push(s)},addRelativeTo:function(e,r){var i=r.name,o=r.override,s=Object(Tt.__assign)({middleware:e},r);if(i){if(n.has(i)){if(!o)throw new Error("Duplicate middleware name '"+i+"'");var a=t.findIndex((function(e){return e.name===i})),u=t[a];if(u.toMiddleware!==s.toMiddleware||u.relation!==s.relation)throw new Error('"'+i+'" middleware '+u.relation+' "'+u.toMiddleware+'" middleware cannot be overridden by same-name middleware '+s.relation+' "'+s.toMiddleware+'" middleware.');t.splice(a,1)}n.add(i)}t.push(s)},clone:function(){return r(Nt())},use:function(e){e.applyToStack(s)},remove:function(r){return"string"==typeof r?function(r){var i=!1,o=function(e){return!e.name||e.name!==r||(i=!0,n.delete(r),!1)};return e=e.filter(o),t=t.filter(o),i}(r):function(r){var i=!1,o=function(e){return e.middleware!==r||(i=!0,e.name&&n.delete(e.name),!1)};return e=e.filter(o),t=t.filter(o),i}(r)},removeByTag:function(r){var i=!1,o=function(e){var t=e.tags,o=e.name;return!t||!t.includes(r)||(o&&n.delete(o),i=!0,!1)};return e=e.filter(o),t=t.filter(o),i},concat:function(e){var t=r(Nt());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var i=Object(Tt.__values)(o().reverse()),s=i.next();!s.done;s=i.next()){e=(0,s.value)(e,t)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e}};return s},Dt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},zt={high:3,normal:2,low:1},Ut=function(){function e(e){this.middlewareStack=Nt(),this.config=e}return e.prototype.send=function(e,t,n){var r="function"!=typeof t?t:void 0,i="function"==typeof t?t:n,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(!i)return o(e).then((function(e){return e.output}));o(e).then((function(e){return i(null,e.output)}),(function(e){return i(e)})).catch((function(){}))},e.prototype.destroy=function(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()},e}(),Ft=function(){this.middlewareStack=Nt()};function Bt(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}var qt=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(Tt.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};qt.prototype=Object.create(String.prototype,{constructor:{value:qt,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(qt,String);var Kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(Tt.__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))},t}(qt);var Vt="***SensitiveInformation***",Ht=function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o,a,c,f,d,l,p,h,v,g,m;return u(this,(function(u){switch(u.label){case 0:return r=[s({},e)],m={},[4,_n(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(m.body=u.sent(),m)])),o="UnknownError",o=Sn(e,n.body),o){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return a=[{}],[4,$t(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,a.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 4:return c=[{}],[4,Wt(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,c.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 6:return f=[{}],[4,Zt(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,f.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 8:return d=[{}],[4,Yt(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,d.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 10:return l=[{}],[4,Jt(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,l.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 12:return p=[{}],[4,Qt(n,t)];case 13:return i=s.apply(void 0,[s.apply(void 0,p.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 14:return h=[{}],[4,Xt(n,t)];case 15:return i=s.apply(void 0,[s.apply(void 0,h.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 16:v=n.body,o=v.code||v.Code||o,i=s(s({},v),{name:""+o,message:v.message||v.Message||o,$fault:"client",$metadata:bn(e)}),u.label=17;case 17:return g=i.message||i.Message||o,i.message=g,delete i.Message,[2,Promise.reject(Object.assign(new Error(g),i))]}}))}))},Gt=function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o,a,c,f,d,l,p,h,v,g,m;return u(this,(function(u){switch(u.label){case 0:return r=[s({},e)],m={},[4,_n(e.body,t)];case 1:switch(n=s.apply(void 0,r.concat([(m.body=u.sent(),m)])),o="UnknownError",o=Sn(e,n.body),o){case"BadRequestException":case"com.amazonaws.pinpoint#BadRequestException":return[3,2];case"ForbiddenException":case"com.amazonaws.pinpoint#ForbiddenException":return[3,4];case"InternalServerErrorException":case"com.amazonaws.pinpoint#InternalServerErrorException":return[3,6];case"MethodNotAllowedException":case"com.amazonaws.pinpoint#MethodNotAllowedException":return[3,8];case"NotFoundException":case"com.amazonaws.pinpoint#NotFoundException":return[3,10];case"PayloadTooLargeException":case"com.amazonaws.pinpoint#PayloadTooLargeException":return[3,12];case"TooManyRequestsException":case"com.amazonaws.pinpoint#TooManyRequestsException":return[3,14]}return[3,16];case 2:return a=[{}],[4,$t(n,t)];case 3:return i=s.apply(void 0,[s.apply(void 0,a.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 4:return c=[{}],[4,Wt(n,t)];case 5:return i=s.apply(void 0,[s.apply(void 0,c.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 6:return f=[{}],[4,Zt(n,t)];case 7:return i=s.apply(void 0,[s.apply(void 0,f.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 8:return d=[{}],[4,Yt(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,d.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 10:return l=[{}],[4,Jt(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,l.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 12:return p=[{}],[4,Qt(n,t)];case 13:return i=s.apply(void 0,[s.apply(void 0,p.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 14:return h=[{}],[4,Xt(n,t)];case 15:return i=s.apply(void 0,[s.apply(void 0,h.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 16:v=n.body,o=v.code||v.Code||o,i=s(s({},v),{name:""+o,message:v.message||v.Message||o,$fault:"client",$metadata:bn(e)}),u.label=17;case 17:return g=i.message||i.Message||o,i.message=g,delete i.Message,[2,Promise.reject(Object.assign(new Error(g),i))]}}))}))},$t=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"BadRequestException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Wt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"ForbiddenException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Zt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"InternalServerErrorException",$fault:"server",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Yt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"MethodNotAllowedException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Jt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"NotFoundException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Qt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"PayloadTooLargeException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},Xt=function(e,t){return a(void 0,void 0,void 0,(function(){var t,n;return u(this,(function(r){return t={name:"TooManyRequestsException",$fault:"client",$metadata:bn(e),Message:void 0,RequestID:void 0},void 0!==(n=e.body).Message&&null!==n.Message&&(t.Message=n.Message),void 0!==n.RequestID&&null!==n.RequestID&&(t.RequestID=n.RequestID),[2,t]}))}))},en=function(e,t){return s(s(s(s(s(s(s(s({},void 0!==e.AppVersion&&null!==e.AppVersion&&{AppVersion:e.AppVersion}),void 0!==e.Locale&&null!==e.Locale&&{Locale:e.Locale}),void 0!==e.Make&&null!==e.Make&&{Make:e.Make}),void 0!==e.Model&&null!==e.Model&&{Model:e.Model}),void 0!==e.ModelVersion&&null!==e.ModelVersion&&{ModelVersion:e.ModelVersion}),void 0!==e.Platform&&null!==e.Platform&&{Platform:e.Platform}),void 0!==e.PlatformVersion&&null!==e.PlatformVersion&&{PlatformVersion:e.PlatformVersion}),void 0!==e.Timezone&&null!==e.Timezone&&{Timezone:e.Timezone})},tn=function(e,t){return s(s(s(s(s(s({},void 0!==e.City&&null!==e.City&&{City:e.City}),void 0!==e.Country&&null!==e.Country&&{Country:e.Country}),void 0!==e.Latitude&&null!==e.Latitude&&{Latitude:e.Latitude}),void 0!==e.Longitude&&null!==e.Longitude&&{Longitude:e.Longitude}),void 0!==e.PostalCode&&null!==e.PostalCode&&{PostalCode:e.PostalCode}),void 0!==e.Region&&null!==e.Region&&{Region:e.Region})},nn=function(e,t){return s(s(s(s(s(s(s(s(s(s(s({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:dn(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:en(e.Demographic,t)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:tn(e.Location,t)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:an(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:rn(e.User,t)})},rn=function(e,t){return s(s({},void 0!==e.UserAttributes&&null!==e.UserAttributes&&{UserAttributes:dn(e.UserAttributes,t)}),void 0!==e.UserId&&null!==e.UserId&&{UserId:e.UserId})},on=function(e,t){return s({},void 0!==e.BatchItem&&null!==e.BatchItem&&{BatchItem:fn(e.BatchItem,t)})},sn=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},an=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=c(t,2),i=r[0],o=r[1];return null===o?e:s(s({},e),((n={})[i]=o,n))}),{})},un=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=c(t,2),i=r[0],o=r[1];return null===o?e:s(s({},e),((n={})[i]=o,n))}),{})},cn=function(e,t){return Object.entries(e).reduce((function(e,n){var r,i=c(n,2),o=i[0],a=i[1];return null===a?e:s(s({},e),((r={})[o]=function(e,t){return s(s(s(s(s(s(s(s(s(s({},void 0!==e.AppPackageName&&null!==e.AppPackageName&&{AppPackageName:e.AppPackageName}),void 0!==e.AppTitle&&null!==e.AppTitle&&{AppTitle:e.AppTitle}),void 0!==e.AppVersionCode&&null!==e.AppVersionCode&&{AppVersionCode:e.AppVersionCode}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:un(e.Attributes,t)}),void 0!==e.ClientSdkVersion&&null!==e.ClientSdkVersion&&{ClientSdkVersion:e.ClientSdkVersion}),void 0!==e.EventType&&null!==e.EventType&&{EventType:e.EventType}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:an(e.Metrics,t)}),void 0!==e.SdkName&&null!==e.SdkName&&{SdkName:e.SdkName}),void 0!==e.Session&&null!==e.Session&&{Session:pn(e.Session,t)}),void 0!==e.Timestamp&&null!==e.Timestamp&&{Timestamp:e.Timestamp})}(a,t),r))}),{})},fn=function(e,t){return Object.entries(e).reduce((function(e,n){var r,i=c(n,2),o=i[0],a=i[1];return null===a?e:s(s({},e),((r={})[o]=function(e,t){return s(s({},void 0!==e.Endpoint&&null!==e.Endpoint&&{Endpoint:ln(e.Endpoint,t)}),void 0!==e.Events&&null!==e.Events&&{Events:cn(e.Events,t)})}(a,t),r))}),{})},dn=function(e,t){return Object.entries(e).reduce((function(e,n){var r,i=c(n,2),o=i[0],a=i[1];return null===a?e:s(s({},e),((r={})[o]=sn(a,t),r))}),{})},ln=function(e,t){return s(s(s(s(s(s(s(s(s(s(s({},void 0!==e.Address&&null!==e.Address&&{Address:e.Address}),void 0!==e.Attributes&&null!==e.Attributes&&{Attributes:dn(e.Attributes,t)}),void 0!==e.ChannelType&&null!==e.ChannelType&&{ChannelType:e.ChannelType}),void 0!==e.Demographic&&null!==e.Demographic&&{Demographic:en(e.Demographic,t)}),void 0!==e.EffectiveDate&&null!==e.EffectiveDate&&{EffectiveDate:e.EffectiveDate}),void 0!==e.EndpointStatus&&null!==e.EndpointStatus&&{EndpointStatus:e.EndpointStatus}),void 0!==e.Location&&null!==e.Location&&{Location:tn(e.Location,t)}),void 0!==e.Metrics&&null!==e.Metrics&&{Metrics:an(e.Metrics,t)}),void 0!==e.OptOut&&null!==e.OptOut&&{OptOut:e.OptOut}),void 0!==e.RequestId&&null!==e.RequestId&&{RequestId:e.RequestId}),void 0!==e.User&&null!==e.User&&{User:rn(e.User,t)})},pn=function(e,t){return s(s(s(s({},void 0!==e.Duration&&null!==e.Duration&&{Duration:e.Duration}),void 0!==e.Id&&null!==e.Id&&{Id:e.Id}),void 0!==e.StartTimestamp&&null!==e.StartTimestamp&&{StartTimestamp:e.StartTimestamp}),void 0!==e.StopTimestamp&&null!==e.StopTimestamp&&{StopTimestamp:e.StopTimestamp})},hn=function(e,t){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}},vn=function(e,t){return{Results:void 0!==e.Results&&null!==e.Results?mn(e.Results,t):void 0}},gn=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=c(t,2),i=r[0],o=r[1];return null===o?e:s(s({},e),((n={})[i]=function(e,t){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,StatusCode:void 0!==e.StatusCode&&null!==e.StatusCode?e.StatusCode:void 0}}(o),n))}),{})},mn=function(e,t){return Object.entries(e).reduce((function(e,n){var r,i=c(n,2),o=i[0],a=i[1];return null===a?e:s(s({},e),((r={})[o]=function(e,t){return{EndpointItemResponse:void 0!==e.EndpointItemResponse&&null!==e.EndpointItemResponse?hn(e.EndpointItemResponse):void 0,EventsItemResponse:void 0!==e.EventsItemResponse&&null!==e.EventsItemResponse?gn(e.EventsItemResponse,t):void 0}}(a,t),r))}),{})},yn=function(e,t){return{Message:void 0!==e.Message&&null!==e.Message?e.Message:void 0,RequestID:void 0!==e.RequestID&&null!==e.RequestID?e.RequestID:void 0}},bn=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"]}},wn=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},_n=function(e,t){return function(e,t){return wn(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Sn=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},En={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},An={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function On(e,t,n){return{applyToStack:function(r){r.add(function(e,t){return function(n,r){return function(r){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var i,o;return Object(Tt.__generator)(this,(function(s){switch(s.label){case 0:return[4,n(r)];case 1:return i=s.sent().response,[4,t(i,e)];case 2:return o=s.sent(),[2,{response:i,output:o}]}}))}))}}}(e,n),En),r.add(function(e,t){return function(n,r){return function(r){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var i;return Object(Tt.__generator)(this,(function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return i=o.sent(),[2,n(Object(Tt.__assign)(Object(Tt.__assign)({},r),{request:i}))]}}))}))}}}(e,t),An)}}}var kn=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return o(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(On(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"PinpointClient",commandName:"PutEventsCommand",inputFilterSensitiveLog:we.filterSensitiveLog,outputFilterSensitiveLog:_e.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,c,f,d;return u(this,(function(u){switch(u.label){case 0:if(n={"content-type":"application/json"},r="/v1/apps/{ApplicationId}/events",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((i=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");return r=r.replace("{ApplicationId}",Bt(i)),void 0!==e.EventsRequest&&(o=on(e.EventsRequest,t)),void 0===o&&(o={}),o=JSON.stringify(o),[4,t.endpoint()];case 1:return s=u.sent(),a=s.hostname,c=s.protocol,f=void 0===c?"https":c,d=s.port,[2,new Ct({protocol:f,hostname:a,port:d,method:"POST",headers:n,path:r,body:o})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return a(void 0,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,Ht(e,t)]:(n={$metadata:bn(e),EventsResponse:void 0},[4,_n(e.body,t)]);case 1:return r=i.sent(),n.EventsResponse=vn(r,t),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Ft),Ln=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return o(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(On(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"PinpointClient",commandName:"UpdateEndpointCommand",inputFilterSensitiveLog:rt.filterSensitiveLog,outputFilterSensitiveLog:it.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return a(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,c,f,d;return u(this,(function(u){switch(u.label){case 0:if(n={"content-type":"application/json"},r="/v1/apps/{ApplicationId}/endpoints/{EndpointId}",void 0===e.ApplicationId)throw new Error("No value provided for input HTTP label: ApplicationId.");if((i=e.ApplicationId).length<=0)throw new Error("Empty value provided for input HTTP label: ApplicationId.");if(r=r.replace("{ApplicationId}",Bt(i)),void 0===e.EndpointId)throw new Error("No value provided for input HTTP label: EndpointId.");if((i=e.EndpointId).length<=0)throw new Error("Empty value provided for input HTTP label: EndpointId.");return r=r.replace("{EndpointId}",Bt(i)),void 0!==e.EndpointRequest&&(o=nn(e.EndpointRequest,t)),void 0===o&&(o={}),o=JSON.stringify(o),[4,t.endpoint()];case 1:return s=u.sent(),a=s.hostname,c=s.protocol,f=void 0===c?"https":c,d=s.port,[2,new Ct({protocol:f,hostname:a,port:d,method:"PUT",headers:n,path:r,body:o})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return a(void 0,void 0,void 0,(function(){var n,r;return u(this,(function(i){switch(i.label){case 0:return 202!==e.statusCode&&e.statusCode>=300?[2,Gt(e,t)]:(n={$metadata:bn(e),MessageBody:void 0},[4,_n(e.body,t)]);case 1:return r=i.sent(),n.MessageBody=yn(r,t),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Ft),In=n(46),Mn=n(5),xn=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Pn)},Pn=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var jn=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 i=new Error("Request aborted");return i.name="AbortError",Promise.reject(i)}var o=e.path;if(e.query){var s=function(e){var t,n,r=[];try{for(var i=Object(Tt.__values)(Object.keys(e).sort()),o=i.next();!o.done;o=i.next()){var s=o.value,a=e[s];if(s=xn(s),Array.isArray(a))for(var u=0,c=a.length;u<c;u++)r.push(s+"="+xn(a[u]));else{var f=s;(a||"string"==typeof a)&&(f+="="+xn(a)),r.push(f)}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r.join("&")}(e.query);s&&(o+="?"+s)}var a=e.port,u=e.method,c=e.protocol+"//"+e.hostname+(a?":"+a:"")+o,f={body:"GET"===u||"HEAD"===u?void 0:e.body,headers:new Headers(e.headers),method:u};"undefined"!=typeof AbortController&&(f.signal=n);var d,l=new Request(c,f),p=[fetch(l).then((function(e){var t,n,r=e.headers,i={};try{for(var o=Object(Tt.__values)(r.entries()),s=o.next();!s.done;s=o.next()){var a=s.value;i[a[0]]=a[1]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new Rt({headers:i,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new Rt({headers:i,statusCode:e.status,body:t})}}))})),(d=r,void 0===d&&(d=0),new Promise((function(e,t){d&&setTimeout((function(){var e=new Error("Request did not complete within "+d+" ms");e.name="TimeoutError",t(e)}),d)})))];return n&&p.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(p)},e}(),Rn={},Tn=new Array(64),Cn=0,Nn="A".charCodeAt(0),Dn="Z".charCodeAt(0);Cn+Nn<=Dn;Cn++){var zn=String.fromCharCode(Cn+Nn);Rn[zn]=Cn,Tn[Cn]=zn}for(Cn=0,Nn="a".charCodeAt(0),Dn="z".charCodeAt(0);Cn+Nn<=Dn;Cn++){zn=String.fromCharCode(Cn+Nn);var Un=Cn+26;Rn[zn]=Un,Tn[Un]=zn}for(Cn=0;Cn<10;Cn++){Rn[Cn.toString(10)]=Cn+52;zn=Cn.toString(10),Un=Cn+52;Rn[zn]=Un,Tn[Un]=zn}Rn["+"]=62,Tn[62]="+",Rn["/"]=63,Tn[63]="/";function Fn(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),i=0;i<e.length;i+=4){for(var o=0,s=0,a=i,u=i+3;a<=u;a++)"="!==e[a]?(o|=Rn[e[a]]<<6*(u-a),s+=6):o>>=6;var c=i/4*3;o>>=s%8;for(var f=Math.floor(s/8),d=0;d<f;d++){var l=8*(f-d-1);r.setUint8(c+d,(o&255<<l)>>l)}}return new Uint8Array(n)}function Bn(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,i=0,o=n,s=Math.min(n+3,e.length);o<s;o++)r|=e[o]<<8*(s-o-1),i+=8;var a=Math.ceil(i/6);r<<=6*a-i;for(var u=1;u<=a;u++){var c=6*(a-u);t+=Tn[(r&63<<c)>>c]}t+="==".slice(0,4-a)}return t}var qn=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(Tt.__generator)(this,(function(r){switch(r.label){case 0:return[4,Kn(e)];case 1:return t=r.sent(),n=Fn(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return Object(Tt.__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 i=u.sent(),o=i.done,(s=i.value)&&(a=t,(t=new Uint8Array(a.length+s.length)).set(a),t.set(s,a.length)),r=o,[3,1];case 3:return[2,t]}}))}))}(e)};function Kn(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 i=null!==(e=r.result)&&void 0!==e?e:"",o=i.indexOf(","),s=o>-1?o+1:i.length;t(i.substring(s))},r.onabort=function(){return n(new Error("Read aborted"))},r.onerror=function(){return n(r.error)},r.readAsDataURL(e)}))}var Vn=function(e){return function(){return Promise.reject(e)}},Hn={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Gn=function(e){return{applyToStack:function(t){t.add(function(e){return function(t,n){return function(r){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var i;return Object(Tt.__generator)(this,(function(o){return(null===(i=null==e?void 0:e.retryStrategy)||void 0===i?void 0:i.mode)&&(n.userAgent=Object(Tt.__spread)(n.userAgent||[],[["cfg/retry-mode",e.retryStrategy.mode]])),[2,e.retryStrategy.retry(t,r)]}))}))}}}(e),Hn)}}},$n=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Wn=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Zn=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Yn=[500,502,503,504],Jn=function(e){var t,n;return 429===(null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||Wn.includes(e.name)||1==(null===(n=e.$retryable)||void 0===n?void 0:n.throttling)},Qn=n(2),Xn=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},er=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return $n.includes(e.name)}(e)||Jn(e)||function(e){var t;return Zn.includes(e.name)||Yn.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},tr=function(){function e(e,t){var n,r,i,o,s,a,u,c;this.maxAttemptsProvider=e,this.mode="standard",this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:er,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:Xn,this.retryQuota=null!==(i=null==t?void 0:t.retryQuota)&&void 0!==i?i:(s=o=500,a=o,u=function(e){return"TimeoutError"===e.name?10:5},c=function(e){return u(e)<=a},Object.freeze({hasRetryTokens:c,retrieveRetryTokens:function(e){if(!c(e))throw new Error("No retry token available");var t=u(e);return a-=t,t},releaseRetryTokens:function(e){a+=null!=e?e:1,a=Math.min(a,s)}}))}return e.prototype.shouldRetry=function(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)},e.prototype.getMaxAttempts=function(){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var e;return Object(Tt.__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(Tt.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return Object(Tt.__generator)(this,(function(f){switch(f.label){case 0:return r=0,i=0,[4,this.getMaxAttempts()];case 1:o=f.sent(),s=t.request,Ct.isInstance(s)&&(s.headers["amz-sdk-invocation-id"]=Object(Qn.v4)()),a=function(){var a,c,f,d,l;return Object(Tt.__generator)(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,,5]),Ct.isInstance(s)&&(s.headers["amz-sdk-request"]="attempt="+(r+1)+"; max="+o),[4,e(t)];case 1:return a=p.sent(),c=a.response,f=a.output,u.retryQuota.releaseRetryTokens(n),f.$metadata.attempts=r+1,f.$metadata.totalRetryDelay=i,[2,{value:{response:c,output:f}}];case 2:return d=p.sent(),r++,u.shouldRetry(d,r,o)?(n=u.retryQuota.retrieveRetryTokens(d),l=u.delayDecider(Jn(d)?500:100,r),i+=l,[4,new Promise((function(e){return setTimeout(e,l)}))]):[3,4];case 3:return p.sent(),[2,"continue"];case 4:throw d.$metadata||(d.$metadata={}),d.$metadata.attempts=r,d.$metadata.totalRetryDelay=i,d;case 5:return[2]}}))},u=this,f.label=2;case 2:return[5,a()];case 3:return"object"==typeof(c=f.sent())?[2,c.value]:[3,2];case 4:return[2]}}))}))},e}(),nr=function(e){var t=rr(e.maxAttempts);return Object(Tt.__assign)(Object(Tt.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new tr(t)})},rr=function(e){if(void 0===e&&(e=3),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ir(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 or=n(45),sr=n.n(or),ar=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var e,r,i,o,s,a,u,c,f;return Object(Tt.__generator)(this,(function(d){return e=(null===(i=null===window||void 0===window?void 0:window.navigator)||void 0===i?void 0:i.userAgent)?sr.a.parse(window.navigator.userAgent):void 0,r=[["aws-sdk-js",n],["os/"+((null===(o=null==e?void 0:e.os)||void 0===o?void 0:o.name)||"other"),null===(s=null==e?void 0:e.os)||void 0===s?void 0:s.version],["lang/js"],["md/browser",(null!==(u=null===(a=null==e?void 0:e.browser)||void 0===a?void 0:a.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]}))}))}};var ur=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 i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},cr=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 i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var s="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(s)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)},fr=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"]),dr=new Set(["cn-north-1","cn-northwest-1"]),lr=new Set(["us-iso-east-1"]),pr=new Set(["us-isob-east-1"]),hr=new Set(["us-gov-east-1","us-gov-west-1"]);var vr=function(e){var t,n=new URL(e),r=n.hostname,i=n.pathname,o=n.port,s=n.protocol,a=n.search;return a&&(t=function(e){var t,n,r={};if(e=e.replace(/^\?/,""))try{for(var i=Object(Tt.__values)(e.split("&")),o=i.next();!o.done;o=i.next()){var s=o.value,a=Object(Tt.__read)(s.split("="),2),u=a[0],c=a[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{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}(a)),{hostname:r,port:o?parseInt(o):void 0,protocol:s,path:i,query:t}},gr={apiVersion:"2016-12-01",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"pinpoint.ap-northeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-northeast-2":n={hostname:"pinpoint.ap-northeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-south-1":n={hostname:"pinpoint.ap-south-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-1":n={hostname:"pinpoint.ap-southeast-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ap-southeast-2":n={hostname:"pinpoint.ap-southeast-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"ca-central-1":n={hostname:"pinpoint.ca-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-central-1":n={hostname:"pinpoint.eu-central-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-1":n={hostname:"pinpoint.eu-west-1.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"eu-west-2":n={hostname:"pinpoint.eu-west-2.amazonaws.com",partition:"aws",signingService:"mobiletargeting"};break;case"fips-us-east-1":n={hostname:"pinpoint-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-gov-west-1":n={hostname:"pinpoint-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-2":n={hostname:"pinpoint-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"us-east-1":n={hostname:"pinpoint.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"us-gov-west-1":n={hostname:"pinpoint.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-west-2":n={hostname:"pinpoint.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;default:fr.has(e)&&(n={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws",signingService:"mobiletargeting"}),dr.has(e)&&(n={hostname:"pinpoint.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),lr.has(e)&&(n={hostname:"pinpoint.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),pr.has(e)&&(n={hostname:"pinpoint.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),hr.has(e)&&(n={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov",signingService:"mobiletargeting"}),void 0===n&&(n={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws",signingService:"mobiletargeting"})}return Promise.resolve(s({signingService:"mobiletargeting"},n))},serviceId:"Pinpoint",urlParser:vr},mr=s(s({},gr),{runtime:"browser",base64Decoder:Fn,base64Encoder:Bn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:gr.serviceId,clientVersion:In.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new jn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur,utf8Encoder:cr}),yr=function(e){var t;return Object(Tt.__assign)(Object(Tt.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?br(e):function(){return wr(e)},isCustomEndpoint:!!e.endpoint})},br=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 i=Promise.resolve(t);return function(){return i}}return t},wr=function(e){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,i,o;return Object(Tt.__generator)(this,(function(s){switch(s.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(r=s.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(!(i=(null!==(o=s.sent())&&void 0!==o?o:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+i)]}}))}))},_r=function(e){if(!e.region)throw new Error("Region is missing");return Object(Tt.__assign)(Object(Tt.__assign)({},e),{region:Sr(e.region)})},Sr=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var Er={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Ar=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(Tt.__awaiter)(t,void 0,void 0,(function(){var t,i,o,s,a;return Object(Tt.__generator)(this,(function(u){return t=r.request,Ct.isInstance(t)&&(i=t.body,o=t.headers,i&&-1===Object.keys(o).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(s=e(i))&&(t.headers=Object(Tt.__assign)(Object(Tt.__assign)({},t.headers),((a={})["content-length"]=String(s),a)))),[2,n(Object(Tt.__assign)(Object(Tt.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),Er)}}};for(var Or={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},kr=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var r,i;return Object(Tt.__generator)(this,(function(o){return Ct.isInstance(n.request)?(r=n.request,i=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===i?"":i).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),Or)}}},Lr={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Ir=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var r,i,o,s,a,u,c,f,d;return Object(Tt.__generator)(this,(function(l){switch(l.label){case 0:return r=t.clientName,i=t.commandName,o=t.inputFilterSensitiveLog,s=t.logger,a=t.outputFilterSensitiveLog,[4,e(n)];case 1:return u=l.sent(),s?("function"==typeof s.info&&(c=u.output,f=c.$metadata,d=Object(Tt.__rest)(c,["$metadata"]),s.info({clientName:r,commandName:i,input:o(n.input),output:a(d),metadata:f})),[2,u]):[2,u]}}))}))}}),Lr)}}},Mr={},xr={},Pr=0;Pr<256;Pr++){var jr=Pr.toString(16).toLowerCase();1===jr.length&&(jr="0"+jr),Mr[Pr]=jr,xr[jr]=Pr}function Rr(e){for(var t="",n=0;n<e.byteLength;n++)t+=Mr[e[n]];return t}var Tr="X-Amz-Date".toLowerCase(),Cr=["authorization",Tr,"date"],Nr="X-Amz-Signature".toLowerCase(),Dr="X-Amz-Security-Token".toLowerCase(),zr={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},Ur=/^proxy-/,Fr=/^sec-/,Br="AWS4-HMAC-SHA256-PAYLOAD",qr={},Kr=[];function Vr(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function Hr(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Gr(e,t,n){var r,i,o=e.headers,s={};try{for(var a=Object(Tt.__values)(Object.keys(o).sort()),u=a.next();!u.done;u=a.next()){var c=u.value,f=c.toLowerCase();(f in zr||(null==t?void 0:t.has(f))||Ur.test(f)||Fr.test(f))&&(!n||n&&!n.has(f))||(s[f]=o[c].trim().replace(/\s+/g," "))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return s}var $r=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,Wr)},Wr=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function Zr(e,t){var n=e.headers,r=e.body;return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var e,i,o,s,a,u,c;return Object(Tt.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(Tt.__values)(Object.keys(n)),i=e.next();!i.done;i=e.next())if("x-amz-content-sha256"===(o=i.value).toLowerCase())return[2,n[o]]}catch(e){u={error:e}}finally{try{i&&!i.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)||(d=r,"function"==typeof ArrayBuffer&&d instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(d))?((s=new t).update(r),a=Rr,[4,s.digest()]):[3,3];case 2:return[2,a.apply(void 0,[f.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}var d}))}))}function Yr(e){var t=e.headers,n=e.query,r=Object(Tt.__rest)(e,["headers","query"]);return Object(Tt.__assign)(Object(Tt.__assign)({},r),{headers:Object(Tt.__assign)({},t),query:n?Jr(n):void 0})}function Jr(e){return Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object(Tt.__assign)(Object(Tt.__assign)({},t),((r={})[n]=Array.isArray(i)?Object(Tt.__spread)(i):i,r))}),{})}function Qr(e){var t,n;e="function"==typeof e.clone?e.clone():Yr(e);try{for(var r=Object(Tt.__values)(Object.keys(e.headers)),i=r.next();!i.done;i=r.next()){var o=i.value;Cr.indexOf(o.toLowerCase())>-1&&delete e.headers[o]}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return e}function Xr(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 ei=function(){function e(e){var t=e.applyChecksum,n=e.credentials,r=e.region,i=e.service,o=e.sha256,s=e.uriEscapePath,a=void 0===s||s;this.service=i,this.sha256=o,this.uriEscapePath=a,this.applyChecksum="boolean"!=typeof t||t,this.regionProvider=ri(r),this.credentialProvider=ii(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(Tt.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,d,l,p,h,v,g,m,y,b,w,_,S,E,A,O;return Object(Tt.__generator)(this,(function(k){switch(k.label){case 0:return n=t.signingDate,r=void 0===n?new Date:n,i=t.expiresIn,o=void 0===i?3600:i,s=t.unsignableHeaders,a=t.unhoistableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return d=k.sent(),null==c?[3,2]:(p=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:p=k.sent(),k.label=4;case 4:return l=p,h=ti(r),v=h.longDate,g=h.shortDate,o>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(m=Vr(g,l,null!=f?f:this.service),y=function(e,t){var n,r,i;void 0===t&&(t={});var o="function"==typeof e.clone?e.clone():Yr(e),s=o.headers,a=o.query,u=void 0===a?{}:a;try{for(var c=Object(Tt.__values)(Object.keys(s)),f=c.next();!f.done;f=c.next()){var d=f.value,l=d.toLowerCase();"x-amz-"!==l.substr(0,6)||(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(l))||(u[d]=s[d],delete s[d])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(Tt.__assign)(Object(Tt.__assign)({},e),{headers:s,query:u})}(Qr(e),{unhoistableHeaders:a}),d.sessionToken&&(y.query["X-Amz-Security-Token"]=d.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=d.accessKeyId+"/"+m,y.query["X-Amz-Date"]=v,y.query["X-Amz-Expires"]=o.toString(10),b=Gr(y,s,u),y.query["X-Amz-SignedHeaders"]=ni(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[v,m,this.getSigningKey(d,l,g,f)],A=this.createCanonicalRequest,O=[y,b],[4,Zr(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([A.apply(this,O.concat([k.sent()]))]))];case 6:return w[_]=k.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){return Object(Tt.__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,i=t.signingDate,o=void 0===i?new Date:i,s=t.priorSignature,a=t.signingRegion,u=t.signingService;return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var e,t,i,c,f,d,l,p,h,v,g;return Object(Tt.__generator)(this,(function(m){switch(m.label){case 0:return null==a?[3,1]:(t=a,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=m.sent(),m.label=3;case 3:return e=t,i=ti(o),c=i.shortDate,f=i.longDate,d=Vr(c,e,null!=u?u:this.service),[4,Zr({headers:{},body:r},this.sha256)];case 4:return l=m.sent(),(p=new this.sha256).update(n),v=Rr,[4,p.digest()];case 5:return h=v.apply(void 0,[m.sent()]),g=[Br,f,d,s,h,l].join("\n"),[2,this.signString(g,{signingDate:o,signingRegion:e,signingService:u})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signingRegion,s=n.signingService;return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,a,u,c,f,d;return Object(Tt.__generator)(this,(function(l){switch(l.label){case 0:return[4,this.credentialProvider()];case 1:return t=l.sent(),null==o?[3,2]:(r=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=l.sent(),l.label=4;case 4:return n=r,a=ti(i).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,a,s)];case 5:return(u=new(f.apply(c,[void 0,l.sent()]))).update(e),d=Rr,[4,u.digest()];case 6:return[2,d.apply(void 0,[l.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signableHeaders,s=n.unsignableHeaders,a=n.signingRegion,u=n.signingService;return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,d,l,p,h,v,g;return Object(Tt.__generator)(this,(function(m){switch(m.label){case 0:return[4,this.credentialProvider()];case 1:return t=m.sent(),null==a?[3,2]:(r=a,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=m.sent(),m.label=4;case 4:return n=r,c=Qr(e),f=ti(i),d=f.longDate,l=f.shortDate,p=Vr(l,n,null!=u?u:this.service),c.headers[Tr]=d,t.sessionToken&&(c.headers[Dr]=t.sessionToken),[4,Zr(c,this.sha256)];case 5:return h=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var i=Object(Tt.__values)(Object.keys(t)),o=i.next();!o.done;o=i.next()){if(e===o.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",c.headers)&&this.applyChecksum&&(c.headers["x-amz-content-sha256"]=h),v=Gr(c,s,o),[4,this.getSignature(d,p,this.getSigningKey(t,n,l,u),this.createCanonicalRequest(c,v,h))];case 6:return g=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+p+", SignedHeaders="+ni(v)+", Signature="+g,[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,i=void 0===r?{}:r,o=[],s={},a=function(e){if(e.toLowerCase()===Nr)return"continue";o.push(e);var t=i[e];"string"==typeof t?s[e]=$r(e)+"="+$r(t):Array.isArray(t)&&(s[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([$r(e)+"="+$r(n)])}),[]).join("&"))};try{for(var u=Object(Tt.__values)(Object.keys(i).sort()),c=u.next();!c.done;c=u.next()){a(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 o.map((function(e){return s[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(Tt.__awaiter)(this,void 0,void 0,(function(){var r,i;return Object(Tt.__generator)(this,(function(o){switch(o.label){case 0:return(r=new this.sha256).update(n),[4,r.digest()];case 1:return i=o.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Rr(i)]}}))}))},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(Tt.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,u;return Object(Tt.__generator)(this,(function(c){switch(c.label){case 0:return[4,this.createStringToSign(e,t,r)];case 1:return i=c.sent(),a=(s=this.sha256).bind,[4,n];case 2:return(o=new(a.apply(s,[void 0,c.sent()]))).update(i),u=Rr,[4,o.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,i){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var o,s,a,u,c,f,d,l,p;return Object(Tt.__generator)(this,(function(h){switch(h.label){case 0:return[4,Hr(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=h.sent(),(s=n+":"+r+":"+i+":"+Rr(o)+":"+t.sessionToken)in qr)return[2,qr[s]];for(Kr.push(s);Kr.length>50;)delete qr[Kr.shift()];a="AWS4"+t.secretAccessKey,h.label=2;case 2:h.trys.push([2,7,8,9]),u=Object(Tt.__values)([n,r,i,"aws4_request"]),c=u.next(),h.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,Hr(e,a,f)]);case 4:a=h.sent(),h.label=5;case 5:return c=u.next(),[3,3];case 6:return[3,9];case 7:return d=h.sent(),l={error:d},[3,9];case 8:try{c&&!c.done&&(p=u.return)&&p.call(u)}finally{if(l)throw l.error}return[7];case 9:return[2,qr[s]=a]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),ti=function(e){var t=Xr(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},ni=function(e){return Object.keys(e).sort().join(";")},ri=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ii=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function oi(e){var t,n=this,r=si(e.credentials||e.credentialDefaultProvider(e)),i=e.signingEscapePath,o=void 0===i||i,s=e.systemClockOffset,a=void 0===s?e.systemClockOffset||0:s,u=e.sha256;return t=e.signer?si(e.signer):function(){return si(e.region)().then((function(t){return Object(Tt.__awaiter)(n,void 0,void 0,(function(){return Object(Tt.__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(Tt.__read)(t,2),i=n[0],s=n[1],a=i.signingRegion,c=i.signingService;return e.signingRegion=e.signingRegion||a||s,e.signingName=e.signingName||c||e.serviceId,new ei({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o})}))},Object(Tt.__assign)(Object(Tt.__assign)({},e),{systemClockOffset:a,signingEscapePath:o,credentials:r,signer:t})}function si(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var ai=function(e){return new Date(Date.now()+e)};function ui(e){return function(t,n){return function(r){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,u,c,f,d,l;return Object(Tt.__generator)(this,(function(p){switch(p.label){case 0:return Ct.isInstance(r.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(r)];case 1:return o=p.sent(),[3,3];case 2:o=e.signer,p.label=3;case 3:return i=o,a=t,u=[Object(Tt.__assign)({},r)],l={},[4,i.sign(r.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,a.apply(void 0,[Tt.__assign.apply(void 0,u.concat([(l.request=p.sent(),l)]))])];case 5:return s=p.sent(),c=s.response.headers,(f=c&&(c.date||c.Date))&&(d=Date.parse(f),h=d,v=e.systemClockOffset,Math.abs(ai(v).getTime()-h)>=3e5&&(e.systemClockOffset=d-Date.now())),[2,s]}var h,v}))}))}}}var ci={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},fi=function(e){return{applyToStack:function(t){t.addRelativeTo(ui(e),ci)}}};function di(e){return Object(Tt.__assign)(Object(Tt.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var li=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,pi=function(e){var t=Object(Tt.__read)(e,2),n=t[0],r=t[1],i=n.indexOf("/"),o=n.substring(0,i),s=n.substring(i+1);return"api"===o&&(s=s.toLowerCase()),[o,s,r].filter((function(e){return e&&e.length>0})).map((function(e){return null==e?void 0:e.replace(li,"_")})).join("/")},hi={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},vi=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(Tt.__awaiter)(void 0,void 0,void 0,(function(){var i,o,s,a,u,c,f,d;return Object(Tt.__generator)(this,(function(l){switch(l.label){case 0:return i=r.request,Ct.isInstance(i)?(o=i.headers,s=(null===(f=null==t?void 0:t.userAgent)||void 0===f?void 0:f.map(pi))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return a=l.sent().map(pi),u=(null===(d=null==n?void 0:n.customUserAgent)||void 0===d?void 0:d.map(pi))||[],o["x-amz-user-agent"]=Object(Tt.__spread)(a,s,u).join(" "),c=Object(Tt.__spread)(a.filter((function(e){return e.startsWith("aws-sdk-")})),u).join(" "),"browser"!==n.runtime&&c&&(o["user-agent"]=o["user-agent"]?o["user-agent"]+" "+c:c),[2,e(Object(Tt.__assign)(Object(Tt.__assign)({},r),{request:i}))]}}))}))}}),hi)}}},gi=function(e){function t(t){var n=this,r=s(s({},mr),t),i=_r(r),o=oi(yr(i)),a=di(nr(o));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(fi(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Ar(n.config)),n.middlewareStack.use(kr(n.config)),n.middlewareStack.use(Ir(n.config)),n.middlewareStack.use(vi(n.config)),n}return o(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Ut),mi=n(8),yi=n.n(mi),bi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},wi=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},_i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},Si=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_i(arguments[t]));return e},Ei=new r.ConsoleLogger("EventsBuffer"),Ai=[429,500],Oi=[202],ki=function(){function e(e,t){this._pause=!1,this._flush=!1,Ei.debug("Instantiating buffer with config:",t),this._buffer=[],this._client=e,this._config=t,this._sendBatch=this._sendBatch.bind(this),this._startLoop()}return e.prototype.push=function(e){var t;if(this._buffer>this._config.bufferSize)return Ei.debug("Exceeded analytics events buffer size"),e.handlers.reject(new Error("Exceeded the size of analytics events buffer"));var n=((t={})[e.params.event.eventId]=e,t);this._buffer.push(n)},e.prototype.pause=function(){this._pause=!0},e.prototype.resume=function(){this._pause=!1},e.prototype.updateClient=function(e){this._client=e},e.prototype.flush=function(){this._flush=!0},e.prototype._startLoop=function(){this._interval&&clearInterval(this._interval);var e=this._config.flushInterval;this._interval=setInterval(this._sendBatch,e)},e.prototype._sendBatch=function(){var e=this._buffer.length;if(this._flush&&!e&&clearInterval(this._interval),!this._pause&&e){var t=this._config.flushSize,n=Math.min(t,e),r=this._buffer.splice(0,n);this._putEvents(r)}},e.prototype._putEvents=function(e){return bi(this,void 0,void 0,(function(){var t,n,r,i,o;return wi(this,(function(s){switch(s.label){case 0:t=this._bufferToMap(e),n=this._generateBatchEventParams(t),s.label=1;case 1:return s.trys.push([1,3,,4]),r=new kn(n),[4,this._client.send(r)];case 2:return i=s.sent(),this._processPutEventsSuccessResponse(i,t),[3,4];case 3:return o=s.sent(),[2,this._handlePutEventsFailure(o,t)];case 4:return[2]}}))}))},e.prototype._generateBatchEventParams=function(e){var t={ApplicationId:"",EventsRequest:{BatchItem:{}}};return Object.values(e).forEach((function(e){var n=e.params,r=n.event,i=n.timestamp,o=n.config,s=r.name,a=r.attributes,u=r.metrics,c=r.eventId,f=r.session,d=o.appId,l=o.endpointId,p=t.EventsRequest.BatchItem;t.ApplicationId=t.ApplicationId||d,p[l]||(p[l]={Endpoint:{},Events:{}}),p[l].Events[c]={EventType:s,Timestamp:new Date(i).toISOString(),Attributes:a,Metrics:u,Session:f}})),t},e.prototype._handlePutEventsFailure=function(e,t){Ei.debug("_putEvents Failed: ",e);var n=e.$metadata&&e.$metadata.httpStatusCode;if(Ai.includes(n)){var r=Object.values(t);this._retry(r)}else;},e.prototype._processPutEventsSuccessResponse=function(e,t){var n=e.EventsResponse.Results,r=[];Object.entries(n).forEach((function(e){var n=_i(e,2),i=n[0],o=n[1].EventsItemResponse;Object.entries(o).forEach((function(e){var n,o,s=_i(e,2),a=s[0],u=s[1],c=u.StatusCode,f=u.Message,d=t[a],l={EventsResponse:{Results:(n={},n[i]={EventsItemResponse:(o={},o[a]={StatusCode:c,Message:f},o)},n)}};if(Oi.includes(c))d.handlers.resolve(l);else{if(!Ai.includes(c)){var p=d.params.event.name;return Ei.error("event "+a+" : "+p+" failed with error: "+f),d.handlers.reject(l)}r.push(d)}}))})),r.length&&this._retry(r)},e.prototype._retry=function(e){var t,n=[];e.forEach((function(e){var t,r=e.params,i=r.event,o=i.eventId,s=i.name;if(r.resendLimit-- >0)return Ei.debug("resending event "+o+" : "+s+" with "+r.resendLimit+" retry attempts remaining"),void n.push((t={},t[o]=e,t));Ei.debug("no retry attempts remaining for event "+o+" : "+s)})),(t=this._buffer).unshift.apply(t,Si(n))},e.prototype._bufferToMap=function(e){return e.reduce((function(e,t){var n=_i(Object.entries(t),1),r=_i(n[0],2),i=r[0],o=r[1];return e[i]=o,e}),{})},e}();function Li(e){return(Li="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 Ii=function(){return(Ii=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},Mi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},xi=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Pi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},ji="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ri=function(e,t){r.Hub.dispatch("analytics",{event:e,data:t},"Analytics",ji)},Ti=new r.ConsoleLogger("AWSPinpointProvider"),Ci=[429,500],Ni=[202],Di="undefined"!=typeof navigator&&navigator&&"function"==typeof navigator.sendBeacon,zi=function(){function e(e){this._endpointGenerating=!0,this._endpointUpdateInProgress=!1,this._buffer=null,this._endpointBuffer=[],this._config=e||{},this._config.bufferSize=this._config.bufferSize||1e3,this._config.flushSize=this._config.flushSize||100,this._config.flushInterval=this._config.flushInterval||5e3,this._config.resendLimit=this._config.resendLimit||5,this._clientInfo=r.ClientDevice.clientInfo()}return e.prototype.getCategory=function(){return e.category},e.prototype.getProviderName=function(){return e.providerName},e.prototype.configure=function(e){var t=this;Ti.debug("configure Analytics",e);var n=e||{};if(this._config=Object.assign({},this._config,n),this._endpointGenerating=!!e.autoSessionRecord,this._config.appId&&!this._config.disabled)if(this._config.endpointId)Ri("pinpointProvider_configured",null);else{var r=this.getProviderName()+"_"+this._config.appId;this._getEndpointId(r).then((function(e){Ti.debug("setting endpoint id from the cache",e),t._config.endpointId=e,Ri("pinpointProvider_configured",null)})).catch((function(e){Ti.debug("Failed to generate endpointId",e)}))}else this._flushBuffer();return this._config},e.prototype.record=function(e,t){return Mi(this,void 0,void 0,(function(){var n,r;return xi(this,(function(i){switch(i.label){case 0:return Ti.debug("_public record",e),[4,this._getCredentials()];case 1:return(n=i.sent())&&this._config.appId&&this._config.region?(this._initClients(n),r=(new Date).getTime(),this._generateSession(e),e.event.eventId=Object(Qn.v1)(),Object.assign(e,{timestamp:r,config:this._config}),e.event.immediate?[2,this._send(e,t)]:(this._putToBuffer(e,t),[2])):(Ti.debug("cannot send events without credentials, applicationId or region"),[2,t.reject(new Error("No credentials, applicationId or region"))])}}))}))},e.prototype._sendEndpointUpdate=function(e){return Mi(this,void 0,void 0,(function(){var t;return xi(this,(function(n){switch(n.label){case 0:return this._endpointUpdateInProgress?(this._endpointBuffer.push(e),[2]):(this._endpointUpdateInProgress=!0,[4,this._updateEndpoint(e)]);case 1:return n.sent(),t=this._endpointBuffer.shift(),this._endpointUpdateInProgress=!1,t&&this._sendEndpointUpdate(t),[2]}}))}))},e.prototype._putToBuffer=function(e,t){"_update_endpoint"!==e.event.name?this._buffer&&this._buffer.push({params:e,handlers:t}):this._sendEndpointUpdate({params:e,handlers:t})},e.prototype._generateSession=function(e){this._sessionId=this._sessionId||Object(Qn.v1)();var t=e.event;switch(t.name){case"_session.start":this._sessionStartTimestamp=(new Date).getTime(),this._sessionId=Object(Qn.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()};break;case"_session.stop":var n=(new Date).getTime();this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||Object(Qn.v1)(),t.session={Id:this._sessionId,Duration:n-this._sessionStartTimestamp,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString(),StopTimestamp:new Date(n).toISOString()},this._sessionId=void 0,this._sessionStartTimestamp=void 0;break;default:this._sessionStartTimestamp=this._sessionStartTimestamp||(new Date).getTime(),this._sessionId=this._sessionId||Object(Qn.v1)(),t.session={Id:this._sessionId,StartTimestamp:new Date(this._sessionStartTimestamp).toISOString()}}},e.prototype._send=function(e,t){return Mi(this,void 0,void 0,(function(){return xi(this,(function(n){switch(e.event.name){case"_update_endpoint":return[2,this._updateEndpoint({params:e,handlers:t})];case"_session.stop":return[2,this._pinpointSendStopSession(e,t)];default:return[2,this._pinpointPutEvents(e,t)]}return[2]}))}))},e.prototype._generateBatchItemContext=function(e){var t,n=e.event,r=e.timestamp,i=e.config,o=n.name,s=n.attributes,a=n.metrics,u=n.eventId,c=n.session,f=i.appId,d=i.endpointId,l={ApplicationId:f,EventsRequest:{BatchItem:{}}},p={Endpoint:{}};return p.Events=((t={})[u]={EventType:o,Timestamp:new Date(r).toISOString(),Attributes:s,Metrics:a,Session:c},t),l.EventsRequest.BatchItem[d]=p,l},e.prototype._pinpointPutEvents=function(e,t){return Mi(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,d,l;return xi(this,(function(p){switch(p.label){case 0:n=e.event.eventId,r=e.config.endpointId,i=this._generateBatchItemContext(e),o=new kn(i),p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.pinpointClient.send(o)];case 2:return s=p.sent(),a=r,u=n,c=s.EventsResponse.Results[a].EventsItemResponse[u],f=c.StatusCode,d=c.Message,Ni.includes(f)?(Ti.debug("record event success. ",s),[2,t.resolve(s)]):Ci.includes(f)?(this._retry(e,t),[3,4]):(Ti.error("Event "+n+" is not accepted, the error is "+d),[2,t.reject(s)]);case 3:return l=p.sent(),this._eventError(l),[2,t.reject(l)];case 4:return[2]}}))}))},e.prototype._pinpointSendStopSession=function(e,t){if(Di){var n=this._generateBatchItemContext(e),i=this._config.region,o=n.ApplicationId,s=n.EventsRequest,a={secret_key:this._config.credentials.secretAccessKey,access_key:this._config.credentials.accessKeyId,session_token:this._config.credentials.sessionToken},u="https://pinpoint."+i+".amazonaws.com/v1/apps/"+o+"/events/legacy",c=JSON.stringify(s),f={url:u,body:c,method:"POST"},d={region:i,service:"mobiletargeting"},l=r.Signer.signUrl(f,a,d,null);return navigator.sendBeacon(l,c)?t.resolve("sendBeacon success"):t.reject("sendBeacon failure")}this._pinpointPutEvents(e,t)},e.prototype._retry=function(e,t){var n=e.config.resendLimit;e.resendLimit="number"==typeof e.resendLimit?e.resendLimit:n,e.resendLimit-- >0?(Ti.debug("resending event "+e.eventName+" with "+e.resendLimit+" retry times left"),this._pinpointPutEvents(e,t)):Ti.debug("retry times used up for event "+e.eventName)},e.prototype._updateEndpoint=function(e){return Mi(this,void 0,void 0,(function(){var t,n,i,o,s,a,u,c,f,d,l,p;return xi(this,(function(h){switch(h.label){case 0:t=e.params,n=e.handlers,i=t.config,o=t.event,s=i.appId,a=i.endpointId,u=this._endpointRequest(i,r.JS.transferKeyToLowerCase(o,[],["attributes","userAttributes","Attributes","UserAttributes"])),c={ApplicationId:s,EndpointId:a,EndpointRequest:u},h.label=1;case 1:return h.trys.push([1,3,,4]),f=new Ln(c),[4,this.pinpointClient.send(f)];case 2:return d=h.sent(),Ti.debug("updateEndpoint success",d),this._endpointGenerating=!1,this._resumeBuffer(),n.resolve(d),[2];case 3:return l=h.sent(),p={err:l,update_params:c,endpointObject:e},[2,this._handleEndpointUpdateFailure(p)];case 4:return[2]}}))}))},e.prototype._handleEndpointUpdateFailure=function(e){return Mi(this,void 0,void 0,(function(){var t,n,r;return xi(this,(function(i){switch(t=e.err,n=e.endpointObject,r=t.$metadata&&t.$metadata.httpStatusCode,Ti.debug("updateEndpoint error",t),r){case 403:return[2,this._handleEndpointUpdateForbidden(e)];default:if(Ci.includes(r))return!0,[2,this._retryEndpointUpdate(n,!0)];Ti.error("updateEndpoint failed",t),n.handlers.reject(t)}return[2]}))}))},e.prototype._handleEndpointUpdateForbidden=function(e){var t=e.err,n=e.endpointObject,r=t.code,i=t.retryable;if("ExpiredTokenException"!==r&&!i)return n.handlers.reject(t);this._retryEndpointUpdate(n)},e.prototype._retryEndpointUpdate=function(e,t){void 0===t&&(t=!1),Ti.debug("_retryEndpointUpdate",e);var n=e.params,r=n.config.resendLimit;if(n.resendLimit="number"==typeof n.resendLimit?n.resendLimit:r,n.resendLimit-- >0)return Ti.debug("resending endpoint update "+n.event.eventId+" with "+n.resendLimit+" retry attempts remaining"),void(this._endpointBuffer.length?this._endpointBuffer.unshift(e):this._updateEndpoint(e));Ti.warn("resending endpoint update "+n.event.eventId+" failed after "+n.config.resendLimit+" attempts"),this._endpointGenerating&&Ti.error("Initial endpoint update failed. ")},e.prototype._initClients=function(e){return Mi(this,void 0,void 0,(function(){var t,n;return xi(this,(function(i){return Ti.debug("init clients"),this.pinpointClient&&this._config.credentials&&this._config.credentials.sessionToken===e.sessionToken&&this._config.credentials.identityId===e.identityId?(Ti.debug("no change for aws credentials, directly return from init"),[2]):(t=this._config.credentials?this._config.credentials.identityId:null,this._config.credentials=e,n=this._config.region,Ti.debug("init clients with credentials",e),this.pinpointClient=new gi({region:n,credentials:e,customUserAgent:Object(r.getAmplifyUserAgent)()}),this.pinpointClient.middlewareStack.addRelativeTo((function(e){return function(t){return delete t.request.headers["amz-sdk-invocation-id"],delete t.request.headers["amz-sdk-request"],e(t)}}),{step:"finalizeRequest",relation:"after",toMiddleware:"retryMiddleware"}),this._bufferExists()&&t===e.identityId?this._updateBufferClient():this._initBuffer(),this._customizePinpointClientReq(),[2])}))}))},e.prototype._bufferExists=function(){return this._buffer&&this._buffer instanceof ki},e.prototype._initBuffer=function(){this._bufferExists()&&this._flushBuffer(),this._buffer=new ki(this.pinpointClient,this._config),this._endpointGenerating&&this._buffer.pause()},e.prototype._updateBufferClient=function(){this._bufferExists()&&this._buffer.updateClient(this.pinpointClient)},e.prototype._flushBuffer=function(){this._bufferExists()&&(this._buffer.flush(),this._buffer=null)},e.prototype._resumeBuffer=function(){this._bufferExists()&&this._buffer.resume()},e.prototype._customizePinpointClientReq=function(){},e.prototype._getEndpointId=function(e){return Mi(this,void 0,void 0,(function(){var t;return xi(this,(function(n){switch(n.label){case 0:return[4,yi.a.getItem(e)];case 1:return t=n.sent(),Ti.debug("endpointId from cache",t,"type",Li(t)),t||(t=Object(Qn.v1)(),yi.a.setItem(e,t)),[2,t]}}))}))},e.prototype._endpointRequest=function(e,t){var n=e.credentials,i=this._clientInfo||{},o=e.clientContext||{},s=e.endpoint||{},a={appVersion:i.appVersion,make:i.make,model:i.model,modelVersion:i.version,platform:i.platform},u=(o.clientId,o.appTitle,o.appVersionName,o.appVersionCode,o.appPackageName,Pi(o,["clientId","appTitle","appVersionName","appVersionCode","appPackageName"])),c=t.address?"android"===i.platform?"GCM":"APNS":void 0,f=Ii(Ii(Ii({channelType:c,requestId:Object(Qn.v1)(),effectiveDate:(new Date).toISOString()},s),t),{attributes:Ii(Ii({},s.attributes),t.attributes),demographic:Ii(Ii(Ii(Ii({},a),u),s.demographic),t.demographic),location:Ii(Ii({},s.location),t.location),metrics:Ii(Ii({},s.metrics),t.metrics),user:{userId:t.userId||s.userId||n.identityId,userAttributes:Ii(Ii({},s.userAttributes),t.userAttributes)}}),d=(f.userId,f.userAttributes,f.name,f.session,f.eventId,f.immediate,Pi(f,["userId","userAttributes","name","session","eventId","immediate"]));return r.JS.transferKeyToUpperCase(d,[],["metrics","userAttributes","attributes"])},e.prototype._eventError=function(e){Ti.error("record event failed.",e),Ti.warn('Please ensure you have updated your Pinpoint IAM Policy with the Action: "mobiletargeting:PutEvents" in order to record events')},e.prototype._getCredentials=function(){return Mi(this,void 0,void 0,(function(){var e,t;return xi(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r.Credentials.get()];case 1:return(e=n.sent())?(Ti.debug("set credentials for analytics",e),[2,r.Credentials.shear(e)]):[2,null];case 2:return t=n.sent(),Ti.debug("ensure credentials error",t),[2,null];case 3:return[2]}}))}))},e.category="Analytics",e.providerName="AWSPinpoint",e}(),Ui=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},Fi=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ui(arguments[t]));return e},Bi=[],qi=function(){function e(e,t){this.context=e,this.methodName=t,this._originalMethod=e[t].bind(e)}return e.add=function(e,t,n){Ki(e,t).set(n)},e.remove=function(e,t){Ki(e,t).remove()},e.prototype.set=function(e){var t=this;this.context[this.methodName]=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e(t._originalMethod.apply(t,Fi(n)))}},e.prototype.remove=function(){this.context[this.methodName]=this._originalMethod},e}();function Ki(e,t){var n=Bi.filter((function(n){return n.context===e&&n.methodName===t}))[0];return n||(n=new qi(e,t),Bi.push(n)),n}var Vi=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},Hi=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Gi=new r.ConsoleLogger("PageViewTracker"),$i="aws-amplify-analytics-prevUrl",Wi={enable:!1,provider:"AWSPinpoint",getUrl:function(){return r.JS.browserOrNode().isBrowser?window.location.origin+window.location.pathname:""}},Zi=function(){function e(e,t){Gi.debug("initialize pageview tracker with opts",t),this._config=Object.assign({},Wi,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),"SPA"===this._config.type?this._pageViewTrackSPA():this._pageViewTrackDefault()}return e.prototype.configure=function(e){return Object.assign(this._config,e),"SPA"===this._config.type&&this._pageViewTrackSPA(),this._config},e.prototype._isSameUrl=function(){return sessionStorage.getItem($i)===this._config.getUrl()&&(Gi.debug("the url is same"),!0)},e.prototype._pageViewTrackDefault=function(){return Vi(this,void 0,void 0,(function(){var e,t,n,i;return Hi(this,(function(o){switch(o.label){case 0:return r.JS.browserOrNode().isBrowser&&window.addEventListener&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(Gi.debug("not in the supported web enviroment"),[2]);case 1:return n=o.sent(),[3,3];case 2:n=this._config.attributes,o.label=3;case 3:return t=n,i=Object.assign({url:e},t),this._config.enable&&!this._isSameUrl()&&(this._tracker({name:this._config.eventName||"pageView",attributes:i},this._config.provider).catch((function(e){Gi.debug("Failed to record the page view event",e)})),sessionStorage.setItem($i,e)),[2]}}))}))},e.prototype._trackFunc=function(){return Vi(this,void 0,void 0,(function(){var e,t,n,i;return Hi(this,(function(o){switch(o.label){case 0:return r.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState&&window.sessionStorage?(e=this._config.getUrl(),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]):(Gi.debug("not in the supported web enviroment"),[2]);case 1:return n=o.sent(),[3,3];case 2:n=this._config.attributes,o.label=3;case 3:return t=n,i=Object.assign({url:e},t),this._isSameUrl()||(this._tracker({name:this._config.eventName||"pageView",attributes:i},this._config.provider).catch((function(e){Gi.debug("Failed to record the page view event",e)})),sessionStorage.setItem($i,e)),[2]}}))}))},e.prototype._pageViewTrackSPA=function(){r.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState?this._config.enable&&!this._hasEnabled?(qi.add(history,"pushState",this._trackFunc),qi.add(history,"replaceState",this._trackFunc),window.addEventListener("popstate",this._trackFunc),this._trackFunc(),this._hasEnabled=!0):(qi.remove(history,"pushState"),qi.remove(history,"replaceState"),window.removeEventListener("popstate",this._trackFunc),this._hasEnabled=!1):Gi.debug("not in the supported web enviroment")},e}(),Yi=r.JS.browserOrNode().isBrowser&&window.Element?window.Element.prototype:null,Ji=Yi?Yi.matches||Yi.matchesSelector||Yi.webkitMatchesSelector||Yi.mozMatchesSelector||Yi.msMatchesSelector||Yi.oMatchesSelector:null;function Qi(e,t){if(e&&1===e.nodeType&&t){if("string"==typeof t||1===t.nodeType)return e===t||Xi(e,t);if("length"in t)for(var n=0,r=void 0;r=t[n];n++)if(e===r||Xi(e,r))return!0}return!1}function Xi(e,t){if("string"!=typeof t)return!1;if(Ji)return Ji.call(e,t);for(var n=e.parentNode.querySelectorAll(t),r=0,i=void 0;i=n[r];r++)if(i===e)return!0;return!1}function eo(e,t,n,r,i){void 0===i&&(i={});var o=function(e){var t;if(i.composed&&"function"==typeof e.composedPath)for(var o=e.composedPath(),s=0,a=void 0;a=o[s];s++)1===a.nodeType&&Qi(a,n)&&(t=a);else t=function(e,t,n){if(void 0===n&&(n=!1),e&&1===e.nodeType&&t)for(var r,i=(n?[e]:[]).concat(function(e){for(var t=[],n=e;n&&n.parentNode&&1===n.parentNode.nodeType;)n=n.parentNode,t.push(n);return t}(e)),o=0;r=i[o];o++)if(Qi(r,t))return r}(e.target,n,!0);t&&r.call(t,e,t)};return e.addEventListener(t,o,i.useCapture),{destroy:function(){e.removeEventListener(t,o,i.useCapture)}}}var to=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},no=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},ro=new r.ConsoleLogger("EventTracker"),io={enable:!1,events:["click"],selectorPrefix:"data-amplify-analytics-",provider:"AWSPinpoint"},oo=function(){function e(e,t){r.JS.browserOrNode().isBrowser&&window.addEventListener?(this._config=Object.assign({},io,t),this._tracker=e,this._delegates={},this._trackFunc=this._trackFunc.bind(this),ro.debug("initialize pageview tracker with opts",this._config),this.configure(this._config)):ro.debug("not in the supported web environment")}return e.prototype.configure=function(e){var t=this;if(Object.assign(this._config,e),this._config.enable){if(this._config.enable&&0===Object.keys(this._delegates).length){var n="["+this._config.selectorPrefix+"on]";this._config.events.forEach((function(e){t._delegates[e]=eo(document,e,n,t._trackFunc,{composed:!0,useCapture:!0})}))}}else Object.keys(this._delegates).forEach((function(e){"function"==typeof t._delegates[e].destroy&&t._delegates[e].destroy()})),this._delegates={};return this._config},e.prototype._trackFunc=function(e,t){return to(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return no(this,(function(c){switch(c.label){case 0:return n={},r=t.getAttribute(this._config.selectorPrefix+"on").split(/\s*,\s*/),i=t.getAttribute(this._config.selectorPrefix+"name"),(o=t.getAttribute(this._config.selectorPrefix+"attrs"))&&o.split(/\s*,\s*/).forEach((function(e){var t=e.trim().split(/\s*:\s*/);n[t[0]]=t[1]})),"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return a=c.sent(),[3,3];case 2:a=this._config.attributes,c.label=3;case 3:return s=a,u=Object.assign({type:e.type,target:e.target.localName+" with id "+e.target.id},s,n),ro.debug("events needed to be recorded",r),ro.debug("attributes needed to be attached",n),r.indexOf(e.type)<0?(ro.debug("event "+e.type+" is not selected to be recorded"),[2]):(this._tracker({name:i||"event",attributes:u},this._config.provider).catch((function(t){ro.debug("Failed to record the "+e.type+" event', "+t)})),[2])}}))}))},e}(),so=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},ao=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},uo=new r.ConsoleLogger("SessionTracker"),co={enable:!1,provider:"AWSPinpoint"},fo=!1,lo=function(){function e(e,t){this._config=Object.assign({},co,t),this._tracker=e,this._hasEnabled=!1,this._trackFunc=this._trackFunc.bind(this),this._trackBeforeUnload=this._trackBeforeUnload.bind(this),this.configure(this._config)}return e.prototype._envCheck=function(){if(!r.JS.browserOrNode().isBrowser)return!1;if(!document||!document.addEventListener)return uo.debug("not in the supported web environment"),!1;if(void 0!==document.hidden)this._hidden="hidden",this._visibilityChange="visibilitychange";else if(void 0!==document.msHidden)this._hidden="msHidden",this._visibilityChange="msvisibilitychange";else{if(void 0===document.webkitHidden)return uo.debug("not in the supported web environment"),!1;this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"}return!0},e.prototype._trackFunc=function(){return so(this,void 0,void 0,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:return"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()];case 1:return t=r.sent(),[3,3];case 2:t=this._config.attributes,r.label=3;case 3:return e=t,n=Object.assign({},e),document.visibilityState===this._hidden?this._tracker({name:"_session.stop",attributes:n},this._config.provider).catch((function(e){uo.debug("record session stop event failed.",e)})):this._tracker({name:"_session.start",attributes:n},this._config.provider).catch((function(e){uo.debug("record session start event failed.",e)})),[2]}}))}))},e.prototype._trackBeforeUnload=function(e){var t=this;("function"==typeof this._config.attributes?Promise.resolve(this._config.attributes()):Promise.resolve(this._config.attributes)).then((function(e){var n=Object.assign({},e);t._tracker({name:"_session.stop",attributes:n,immediate:!0},t._config.provider).catch((function(e){uo.debug("record session stop event failed.",e)}))}))},e.prototype._sendInitialEvent=function(){return so(this,void 0,void 0,(function(){var e,t,n;return ao(this,(function(r){switch(r.label){case 0:return fo?(uo.debug("the start session has been sent when the page is loaded"),[2]):(fo=!0,"function"!=typeof this._config.attributes?[3,2]:[4,this._config.attributes()]);case 1:return t=r.sent(),[3,3];case 2:t=this._config.attributes,r.label=3;case 3:return e=t,n=Object.assign({},e),this._tracker({name:"_session.start",attributes:n},this._config.provider).catch((function(e){uo.debug("record session start event failed.",e)})),[2]}}))}))},e.prototype.configure=function(e){return this._envCheck()?(Object.assign(this._config,e),this._config.enable&&!this._hasEnabled?(this._sendInitialEvent(),document.addEventListener(this._visibilityChange,this._trackFunc,!1),window.addEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!0):!this._config.enable&&this._hasEnabled&&(document.removeEventListener(this._visibilityChange,this._trackFunc,!1),window.removeEventListener("beforeunload",this._trackBeforeUnload,!1),this._hasEnabled=!1),this._config):this._config},e}(),po=function(){return(po=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},ho=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},vo=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},go=new r.ConsoleLogger("AnalyticsClass"),mo="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",yo={pageView:Zi,event:oo,session:lo},bo=null,wo=function(){function e(){this._config={},this._pluggables=[],this._disabled=!1,this._trackers={},bo=this,this.record=this.record.bind(this),r.Hub.listen("auth",Ao),r.Hub.listen("storage",Ao),r.Hub.listen("analytics",Ao)}return e.prototype.getModuleName=function(){return"Analytics"},e.prototype.configure=function(e){var t=this;if(!e)return this._config;go.debug("configure Analytics",e);var n,i,o,s=r.Parser.parseMobilehubConfig(e);return this._config=Object.assign({},this._config,s.Analytics,e),this._config.disabled&&(this._disabled=!0),void 0===this._config.autoSessionRecord&&(this._config.autoSessionRecord=!0),this._pluggables.forEach((function(e){var n="AWSPinpoint"!==e.getProviderName()||t._config.AWSPinpoint?t._config[e.getProviderName()]:t._config;e.configure(po({disabled:t._config.disabled,autoSessionRecord:t._config.autoSessionRecord},n))})),0===this._pluggables.length&&this.addPluggable(new zi),n="configured",i=null,o="The Analytics category has been configured successfully",r.Hub.dispatch("analytics",{event:n,data:i,message:o},"Analytics",mo),go.debug("current configuration",this._config),this._config},e.prototype.addPluggable=function(e){if(e&&"Analytics"===e.getCategory()){this._pluggables.push(e);var t="AWSPinpoint"!==e.getProviderName()||this._config.AWSPinpoint?this._config[e.getProviderName()]:this._config,n=po({disabled:this._config.disabled},t);return e.configure(n),n}},e.prototype.getPluggable=function(e){for(var t=0;t<this._pluggables.length;t+=1){var n=this._pluggables[t];if(n.getProviderName()===e)return n}return go.debug("No plugin found with providerName",e),null},e.prototype.removePluggable=function(e){for(var t=0;t<this._pluggables.length&&this._pluggables[t].getProviderName()!==e;)t+=1;return t===this._pluggables.length?void go.debug("No plugin found with providerName",e):void this._pluggables.splice(t,t+1)},e.prototype.disable=function(){this._disabled=!0},e.prototype.enable=function(){this._disabled=!1},e.prototype.startSession=function(e){return ho(this,void 0,void 0,(function(){var t;return vo(this,(function(n){return t={event:{name:"_session.start"},provider:e},[2,this._sendEvent(t)]}))}))},e.prototype.stopSession=function(e){return ho(this,void 0,void 0,(function(){var t;return vo(this,(function(n){return t={event:{name:"_session.stop"},provider:e},[2,this._sendEvent(t)]}))}))},e.prototype.record=function(e,t,n){return ho(this,void 0,void 0,(function(){var r;return vo(this,(function(i){return r=null,r="string"==typeof e?{event:{name:e,attributes:t,metrics:n},provider:"AWSPinpoint"}:{event:e,provider:t},[2,this._sendEvent(r)]}))}))},e.prototype.updateEndpoint=function(e,t){return ho(this,void 0,void 0,(function(){var n;return vo(this,(function(r){return n=po(po({},e),{name:"_update_endpoint"}),[2,this.record(n,t)]}))}))},e.prototype._sendEvent=function(e){var t=this;if(this._disabled)return go.debug("Analytics has been disabled"),Promise.resolve();var n=e.provider?e.provider:"AWSPinpoint";return new Promise((function(r,i){t._pluggables.forEach((function(t){t.getProviderName()===n&&t.record(e,{resolve:r,reject:i})}))}))},e.prototype.autoTrack=function(e,t){if(yo[e]){"session"===e&&(this._config.autoSessionRecord=t.enable);var n=this._trackers[e];n?n.configure(t):this._trackers[e]=new yo[e](this.record,t)}else go.debug("invalid tracker type")},e}(),_o=!1,So=!1,Eo=!1,Ao=function(e){var t=e.channel,n=e.payload;switch(go.debug("on hub capsule "+t,n),t){case"auth":ko(n);break;case"storage":Oo(n);break;case"analytics":Lo(n)}},Oo=function(e){var t=e.data,n=t.attrs,r=t.metrics;n&&Eo&&bo.record({name:"Storage",attributes:n,metrics:r}).catch((function(e){go.debug("Failed to send the storage event automatically",e)}))},ko=function(e){var t=e.event;if(t){var n=function(e){return ho(void 0,void 0,void 0,(function(){var t;return vo(this,(function(n){switch(n.label){case 0:if(!So||!Eo)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,bo.record({name:"_userauth."+e})];case 2:return[2,n.sent()];case 3:return t=n.sent(),go.debug("Failed to send the "+e+" event automatically",t),[3,4];case 4:return[2]}}))}))};switch(t){case"signIn":return n("sign_in");case"signUp":return n("sign_up");case"signOut":return n("sign_out");case"signIn_failure":return n("auth_fail");case"configured":(So=!0)&&Eo&&Io()}}},Lo=function(e){var t=e.event;if(t)switch(t){case"pinpointProvider_configured":Eo=!0,So&&Eo&&Io()}},Io=function(){var e=bo.configure();!_o&&e.autoSessionRecord&&(bo.updateEndpoint({immediate:!0}).catch((function(e){go.debug("Failed to update the endpoint",e)})),_o=!0),bo.autoTrack("session",{enable:e.autoSessionRecord})},Mo=new wo;r.Amplify.register(Mo);
  /*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** */
  var xo=function(e,t){return(xo=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 Po(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}xo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var jo=function(){return(jo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Ro(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function To(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;var Co,No,Do,zo,Uo,Fo,Bo,qo,Ko,Vo,Ho,Go,$o,Wo,Zo,Yo,Jo,Qo,Xo,es,ts,ns,rs,is,os,ss,as,us,cs,fs,ds,ls,ps,hs,vs,gs,ms,ys,bs,ws,_s,Ss,Es,As,Os,ks,Ls,Is,Ms,xs,Ps,js,Rs,Ts,Cs,Ns,Ds,zs,Us,Fs,Bs,qs,Ks,Vs,Hs,Gs,$s,Ws,Zs,Ys,Js,Qs,Xs,ea,ta,na,ra,ia,oa,sa,aa,ua;Object.create;(Co||(Co={})).filterSensitiveLog=function(e){return jo({},e)},(No||(No={})).filterSensitiveLog=function(e){return jo({},e)},(Do||(Do={})).filterSensitiveLog=function(e){return jo({},e)},(zo||(zo={})).filterSensitiveLog=function(e){return jo({},e)},(Uo||(Uo={})).filterSensitiveLog=function(e){return jo({},e)},(Fo||(Fo={})).filterSensitiveLog=function(e){return jo({},e)},(Bo||(Bo={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.DELETING="DELETING"}(qo||(qo={})),(Ko||(Ko={})).filterSensitiveLog=function(e){return jo({},e)},(Vo||(Vo={})).filterSensitiveLog=function(e){return jo({},e)},(Ho||(Ho={})).filterSensitiveLog=function(e){return jo({},e)},(Go||(Go={})).filterSensitiveLog=function(e){return jo({},e)},($o||($o={})).filterSensitiveLog=function(e){return jo({},e)},(Wo||(Wo={})).filterSensitiveLog=function(e){return jo({},e)},(Zo||(Zo={})).filterSensitiveLog=function(e){return jo({},e)},(Yo||(Yo={})).filterSensitiveLog=function(e){return jo({},e)},(Jo||(Jo={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.KMS="KMS",e.NONE="NONE"}(Qo||(Qo={})),function(e){e.ALL="ALL",e.INCOMING_BYTES="IncomingBytes",e.INCOMING_RECORDS="IncomingRecords",e.ITERATOR_AGE_MILLISECONDS="IteratorAgeMilliseconds",e.OUTGOING_BYTES="OutgoingBytes",e.OUTGOING_RECORDS="OutgoingRecords",e.READ_PROVISIONED_THROUGHPUT_EXCEEDED="ReadProvisionedThroughputExceeded",e.WRITE_PROVISIONED_THROUGHPUT_EXCEEDED="WriteProvisionedThroughputExceeded"}(Xo||(Xo={})),(es||(es={})).filterSensitiveLog=function(e){return jo({},e)},(ts||(ts={})).filterSensitiveLog=function(e){return jo({},e)},(ns||(ns={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.DELETING="DELETING",e.UPDATING="UPDATING"}(rs||(rs={})),(is||(is={})).filterSensitiveLog=function(e){return jo({},e)},(os||(os={})).filterSensitiveLog=function(e){return jo({},e)},(ss||(ss={})).filterSensitiveLog=function(e){return jo({},e)},(as||(as={})).filterSensitiveLog=function(e){return jo({},e)},(us||(us={})).filterSensitiveLog=function(e){return jo({},e)},(cs||(cs={})).filterSensitiveLog=function(e){return jo({},e)},(fs||(fs={})).filterSensitiveLog=function(e){return jo({},e)},(ds||(ds={})).filterSensitiveLog=function(e){return jo({},e)},(ls||(ls={})).filterSensitiveLog=function(e){return jo({},e)},(ps||(ps={})).filterSensitiveLog=function(e){return jo({},e)},(hs||(hs={})).filterSensitiveLog=function(e){return jo({},e)},(vs||(vs={})).filterSensitiveLog=function(e){return jo({},e)},(gs||(gs={})).filterSensitiveLog=function(e){return jo({},e)},(ms||(ms={})).filterSensitiveLog=function(e){return jo({},e)},(ys||(ys={})).filterSensitiveLog=function(e){return jo({},e)},(bs||(bs={})).filterSensitiveLog=function(e){return jo({},e)},(ws||(ws={})).filterSensitiveLog=function(e){return jo({},e)},(_s||(_s={})).filterSensitiveLog=function(e){return jo({},e)},(Ss||(Ss={})).filterSensitiveLog=function(e){return jo({},e)},(Es||(Es={})).filterSensitiveLog=function(e){return jo({},e)},(As||(As={})).filterSensitiveLog=function(e){return jo({},e)},(Os||(Os={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.AFTER_SEQUENCE_NUMBER="AFTER_SEQUENCE_NUMBER",e.AT_SEQUENCE_NUMBER="AT_SEQUENCE_NUMBER",e.AT_TIMESTAMP="AT_TIMESTAMP",e.LATEST="LATEST",e.TRIM_HORIZON="TRIM_HORIZON"}(ks||(ks={})),(Ls||(Ls={})).filterSensitiveLog=function(e){return jo({},e)},(Is||(Is={})).filterSensitiveLog=function(e){return jo({},e)},(Ms||(Ms={})).filterSensitiveLog=function(e){return jo({},e)},(xs||(xs={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.AFTER_SHARD_ID="AFTER_SHARD_ID",e.AT_LATEST="AT_LATEST",e.AT_TIMESTAMP="AT_TIMESTAMP",e.AT_TRIM_HORIZON="AT_TRIM_HORIZON",e.FROM_TIMESTAMP="FROM_TIMESTAMP",e.FROM_TRIM_HORIZON="FROM_TRIM_HORIZON"}(Ps||(Ps={})),(js||(js={})).filterSensitiveLog=function(e){return jo({},e)},(Rs||(Rs={})).filterSensitiveLog=function(e){return jo({},e)},(Ts||(Ts={})).filterSensitiveLog=function(e){return jo({},e)},(Cs||(Cs={})).filterSensitiveLog=function(e){return jo({},e)},(Ns||(Ns={})).filterSensitiveLog=function(e){return jo({},e)},(Ds||(Ds={})).filterSensitiveLog=function(e){return jo({},e)},(zs||(zs={})).filterSensitiveLog=function(e){return jo({},e)},(Us||(Us={})).filterSensitiveLog=function(e){return jo({},e)},(Fs||(Fs={})).filterSensitiveLog=function(e){return jo({},e)},(Bs||(Bs={})).filterSensitiveLog=function(e){return jo({},e)},(qs||(qs={})).filterSensitiveLog=function(e){return jo({},e)},(Ks||(Ks={})).filterSensitiveLog=function(e){return jo({},e)},(Vs||(Vs={})).filterSensitiveLog=function(e){return jo({},e)},(Hs||(Hs={})).filterSensitiveLog=function(e){return jo({},e)},(Gs||(Gs={})).filterSensitiveLog=function(e){return jo({},e)},($s||($s={})).filterSensitiveLog=function(e){return jo({},e)},(Ws||(Ws={})).filterSensitiveLog=function(e){return jo({},e)},(Zs||(Zs={})).filterSensitiveLog=function(e){return jo({},e)},(Ys||(Ys={})).filterSensitiveLog=function(e){return jo({},e)},(Js||(Js={})).filterSensitiveLog=function(e){return jo({},e)},(Qs||(Qs={})).filterSensitiveLog=function(e){return jo({},e)},(Xs||(Xs={})).filterSensitiveLog=function(e){return jo({},e)},(ea||(ea={})).filterSensitiveLog=function(e){return jo({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return jo({},e)},(na||(na={})).filterSensitiveLog=function(e){return jo({},e)},(ra||(ra={})).filterSensitiveLog=function(e){return jo({},e)},function(e){e.visit=function(e,t){return void 0!==e.SubscribeToShardEvent?t.SubscribeToShardEvent(e.SubscribeToShardEvent):void 0!==e.ResourceNotFoundException?t.ResourceNotFoundException(e.ResourceNotFoundException):void 0!==e.ResourceInUseException?t.ResourceInUseException(e.ResourceInUseException):void 0!==e.KMSDisabledException?t.KMSDisabledException(e.KMSDisabledException):void 0!==e.KMSInvalidStateException?t.KMSInvalidStateException(e.KMSInvalidStateException):void 0!==e.KMSAccessDeniedException?t.KMSAccessDeniedException(e.KMSAccessDeniedException):void 0!==e.KMSNotFoundException?t.KMSNotFoundException(e.KMSNotFoundException):void 0!==e.KMSOptInRequired?t.KMSOptInRequired(e.KMSOptInRequired):void 0!==e.KMSThrottlingException?t.KMSThrottlingException(e.KMSThrottlingException):void 0!==e.InternalFailureException?t.InternalFailureException(e.InternalFailureException):t._(e.$unknown[0],e.$unknown[1])},e.filterSensitiveLog=function(e){var t;return void 0!==e.SubscribeToShardEvent?{SubscribeToShardEvent:ra.filterSensitiveLog(e.SubscribeToShardEvent)}:void 0!==e.ResourceNotFoundException?{ResourceNotFoundException:Uo.filterSensitiveLog(e.ResourceNotFoundException)}:void 0!==e.ResourceInUseException?{ResourceInUseException:zo.filterSensitiveLog(e.ResourceInUseException)}:void 0!==e.KMSDisabledException?{KMSDisabledException:ws.filterSensitiveLog(e.KMSDisabledException)}:void 0!==e.KMSInvalidStateException?{KMSInvalidStateException:_s.filterSensitiveLog(e.KMSInvalidStateException)}:void 0!==e.KMSAccessDeniedException?{KMSAccessDeniedException:bs.filterSensitiveLog(e.KMSAccessDeniedException)}:void 0!==e.KMSNotFoundException?{KMSNotFoundException:Ss.filterSensitiveLog(e.KMSNotFoundException)}:void 0!==e.KMSOptInRequired?{KMSOptInRequired:Es.filterSensitiveLog(e.KMSOptInRequired)}:void 0!==e.KMSThrottlingException?{KMSThrottlingException:As.filterSensitiveLog(e.KMSThrottlingException)}:void 0!==e.InternalFailureException?{InternalFailureException:xs.filterSensitiveLog(e.InternalFailureException)}:void 0!==e.$unknown?((t={})[e.$unknown[0]]="UNKNOWN",t):void 0}}(ia||(ia={})),(oa||(oa={})).filterSensitiveLog=function(e){return jo(jo({},e),e.EventStream&&{EventStream:"STREAMING_CONTENT"})},function(e){e.UNIFORM_SCALING="UNIFORM_SCALING"}(sa||(sa={})),(aa||(aa={})).filterSensitiveLog=function(e){return jo({},e)},(ua||(ua={})).filterSensitiveLog=function(e){return jo({},e)};for(var ca=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,d,l,p,h,v,g,m;return To(this,(function(y){switch(y.label){case 0:return r=[jo({},e)],m={},[4,Ca(e.body,t)];case 1:switch(n=jo.apply(void 0,r.concat([(m.body=y.sent(),m)])),o="UnknownError",o=Na(e,n.body),o){case"InvalidArgumentException":case"com.amazonaws.kinesis#InvalidArgumentException":return[3,2];case"KMSAccessDeniedException":case"com.amazonaws.kinesis#KMSAccessDeniedException":return[3,4];case"KMSDisabledException":case"com.amazonaws.kinesis#KMSDisabledException":return[3,6];case"KMSInvalidStateException":case"com.amazonaws.kinesis#KMSInvalidStateException":return[3,8];case"KMSNotFoundException":case"com.amazonaws.kinesis#KMSNotFoundException":return[3,10];case"KMSOptInRequired":case"com.amazonaws.kinesis#KMSOptInRequired":return[3,12];case"KMSThrottlingException":case"com.amazonaws.kinesis#KMSThrottlingException":return[3,14];case"ProvisionedThroughputExceededException":case"com.amazonaws.kinesis#ProvisionedThroughputExceededException":return[3,16];case"ResourceNotFoundException":case"com.amazonaws.kinesis#ResourceNotFoundException":return[3,18]}return[3,20];case 2:return s=[{}],[4,fa(n,t)];case 3:return i=jo.apply(void 0,[jo.apply(void 0,s.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 4:return a=[{}],[4,da(n,t)];case 5:return i=jo.apply(void 0,[jo.apply(void 0,a.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 6:return u=[{}],[4,la(n,t)];case 7:return i=jo.apply(void 0,[jo.apply(void 0,u.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 8:return c=[{}],[4,pa(n,t)];case 9:return i=jo.apply(void 0,[jo.apply(void 0,c.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 10:return f=[{}],[4,ha(n,t)];case 11:return i=jo.apply(void 0,[jo.apply(void 0,f.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 12:return d=[{}],[4,va(n,t)];case 13:return i=jo.apply(void 0,[jo.apply(void 0,d.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 14:return l=[{}],[4,ga(n,t)];case 15:return i=jo.apply(void 0,[jo.apply(void 0,l.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 16:return p=[{}],[4,ma(n,t)];case 17:return i=jo.apply(void 0,[jo.apply(void 0,p.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 18:return h=[{}],[4,ya(n,t)];case 19:return i=jo.apply(void 0,[jo.apply(void 0,h.concat([y.sent()])),{name:o,$metadata:ja(e)}]),[3,21];case 20:v=n.body,o=v.code||v.Code||o,i=jo(jo({},v),{name:""+o,message:v.message||v.Message||o,$fault:"client",$metadata:ja(e)}),y.label=21;case 21:return g=i.message||i.Message||o,i.message=g,delete i.Message,[2,Promise.reject(Object.assign(new Error(g),i))]}}))}))},fa=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=_a(n,t),[2,jo({name:"InvalidArgumentException",$fault:"client",$metadata:ja(e)},r)]}))}))},da=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Sa(n,t),[2,jo({name:"KMSAccessDeniedException",$fault:"client",$metadata:ja(e)},r)]}))}))},la=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Ea(n,t),[2,jo({name:"KMSDisabledException",$fault:"client",$metadata:ja(e)},r)]}))}))},pa=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Aa(n,t),[2,jo({name:"KMSInvalidStateException",$fault:"client",$metadata:ja(e)},r)]}))}))},ha=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Oa(n,t),[2,jo({name:"KMSNotFoundException",$fault:"client",$metadata:ja(e)},r)]}))}))},va=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=ka(n,t),[2,jo({name:"KMSOptInRequired",$fault:"client",$metadata:ja(e)},r)]}))}))},ga=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=La(n,t),[2,jo({name:"KMSThrottlingException",$fault:"client",$metadata:ja(e)},r)]}))}))},ma=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Ia(n,t),[2,jo({name:"ProvisionedThroughputExceededException",$fault:"client",$metadata:ja(e)},r)]}))}))},ya=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n=e.body,r=Pa(n,t),[2,jo({name:"ResourceNotFoundException",$fault:"client",$metadata:ja(e)},r)]}))}))},ba=function(e,t){return jo(jo({},void 0!==e.Records&&null!==e.Records&&{Records:wa(e.Records,t)}),void 0!==e.StreamName&&null!==e.StreamName&&{StreamName:e.StreamName})},wa=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return jo(jo(jo({},void 0!==e.Data&&null!==e.Data&&{Data:t.base64Encoder(e.Data)}),void 0!==e.ExplicitHashKey&&null!==e.ExplicitHashKey&&{ExplicitHashKey:e.ExplicitHashKey}),void 0!==e.PartitionKey&&null!==e.PartitionKey&&{PartitionKey:e.PartitionKey})}(e,t)}))},_a=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Sa=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ea=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Aa=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Oa=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ka=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},La=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ia=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Ma=function(e,t){return{EncryptionType:void 0!==e.EncryptionType&&null!==e.EncryptionType?e.EncryptionType:void 0,FailedRecordCount:void 0!==e.FailedRecordCount&&null!==e.FailedRecordCount?e.FailedRecordCount:void 0,Records:void 0!==e.Records&&null!==e.Records?xa(e.Records,t):void 0}},xa=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ErrorCode:void 0!==e.ErrorCode&&null!==e.ErrorCode?e.ErrorCode:void 0,ErrorMessage:void 0!==e.ErrorMessage&&null!==e.ErrorMessage?e.ErrorMessage:void 0,SequenceNumber:void 0!==e.SequenceNumber&&null!==e.SequenceNumber?e.SequenceNumber:void 0,ShardId:void 0!==e.ShardId&&null!==e.ShardId?e.ShardId:void 0}}(e)}))},Pa=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},ja=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"]}},Ra=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},Ta=function(e,t,n,r,i){return Ro(void 0,void 0,void 0,(function(){var o,s,a,u,c,f;return To(this,(function(d){switch(d.label){case 0:return[4,e.endpoint()];case 1:return o=d.sent(),s=o.hostname,a=o.protocol,u=void 0===a?"https":a,c=o.port,f={protocol:u,hostname:s,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==i&&(f.body=i),[2,new Ct(f)]}}))}))},Ca=function(e,t){return function(e,t){return Ra(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Na=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},Da=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Po(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(On(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"KinesisClient",commandName:"PutRecordsCommand",inputFilterSensitiveLog:Gs.filterSensitiveLog,outputFilterSensitiveLog:Ws.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r;return To(this,(function(i){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Kinesis_20131202.PutRecords"},r=JSON.stringify(ba(e,t)),[2,Ta(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r,i;return To(this,(function(o){switch(o.label){case 0:return e.statusCode>=300?[2,ca(e,t)]:[4,Ca(e.body,t)];case 1:return n=o.sent(),{},r=Ma(n,t),i=jo({$metadata:ja(e)},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Ft),za=n(47),Ua=n(16),Fa={},Ba={},qa=0;qa<256;qa++){var Ka=qa.toString(16).toLowerCase();1===Ka.length&&(Ka="0"+Ka),Fa[qa]=Ka,Ba[Ka]=qa}function Va(e){for(var t="",n=0;n<e.byteLength;n++)t+=Fa[e[n]];return t}var Ha=function(){function e(e){if(this.bytes=e,8!==e.byteLength)throw new Error("Int64 buffers must be exactly 8 bytes")}return e.fromNumber=function(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw new Error(t+" is too large (or, if negative, too small) to represent as an Int64");for(var n=new Uint8Array(8),r=7,i=Math.abs(Math.round(t));r>-1&&i>0;r--,i/=256)n[r]=i;return t<0&&Ga(n),new e(n)},e.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&Ga(e),parseInt(Va(e),16)*(t?-1:1)},e.prototype.toString=function(){return String(this.valueOf())},e}();function Ga(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}var $a,Wa=function(){function e(e,t){this.toUtf8=e,this.fromUtf8=t}return e.prototype.format=function(e){var t,n,r,i,o=[];try{for(var s=Object(Tt.__values)(Object.keys(e)),a=s.next();!a.done;a=s.next()){var u=a.value,c=this.fromUtf8(u);o.push(Uint8Array.from([c.byteLength]),c,this.formatHeaderValue(e[u]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var f=new Uint8Array(o.reduce((function(e,t){return e+t.byteLength}),0)),d=0;try{for(var l=Object(Tt.__values)(o),p=l.next();!p.done;p=l.next()){var h=p.value;f.set(h,d),d+=h.byteLength}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return f},e.prototype.formatHeaderValue=function(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":var t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":var n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":var r=new Uint8Array(9);return r[0]=5,r.set(e.value.bytes,1),r;case"binary":var i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);var o=new Uint8Array(i.buffer);return o.set(e.value,3),o;case"string":var s=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+s.byteLength));a.setUint8(0,7),a.setUint16(1,s.byteLength,!1);var u=new Uint8Array(a.buffer);return u.set(s,3),u;case"timestamp":var c=new Uint8Array(9);return c[0]=8,c.set(Ha.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!iu.test(e.value))throw new Error("Invalid UUID received: "+e.value);var f=new Uint8Array(17);return f[0]=9,f.set(function(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2){var r=e.substr(n,2).toLowerCase();if(!(r in Ba))throw new Error("Cannot decode unrecognized sequence "+r+" as hexadecimal");t[n/2]=Ba[r]}return t}(e.value.replace(/\-/g,"")),1),f}},e.prototype.parse=function(e){for(var t={},n=0;n<e.byteLength;){var r=e.getUint8(n++),i=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,r));switch(n+=r,e.getUint8(n++)){case 0:t[i]={type:Za,value:!0};break;case 1:t[i]={type:Za,value:!1};break;case 2:t[i]={type:Ya,value:e.getInt8(n++)};break;case 3:t[i]={type:Ja,value:e.getInt16(n,!1)},n+=2;break;case 4:t[i]={type:Qa,value:e.getInt32(n,!1)},n+=4;break;case 5:t[i]={type:Xa,value:new Ha(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:var o=e.getUint16(n,!1);n+=2,t[i]={type:eu,value:new Uint8Array(e.buffer,e.byteOffset+n,o)},n+=o;break;case 7:var s=e.getUint16(n,!1);n+=2,t[i]={type:tu,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s))},n+=s;break;case 8:t[i]={type:nu,value:new Date(new Ha(new Uint8Array(e.buffer,e.byteOffset+n,8)).valueOf())},n+=8;break;case 9:var a=new Uint8Array(e.buffer,e.byteOffset+n,16);n+=16,t[i]={type:ru,value:Va(a.subarray(0,4))+"-"+Va(a.subarray(4,6))+"-"+Va(a.subarray(6,8))+"-"+Va(a.subarray(8,10))+"-"+Va(a.subarray(10))};break;default:throw new Error("Unrecognized header type tag")}}return t},e}();!function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"}($a||($a={}));var Za="boolean",Ya="byte",Ja="short",Qa="integer",Xa="long",eu="binary",tu="string",nu="timestamp",ru="uuid",iu=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var ou=function(){function e(e,t){this.headerMarshaller=new Wa(e,t)}return e.prototype.marshall=function(e){var t=e.headers,n=e.body,r=this.headerMarshaller.format(t),i=r.byteLength+n.byteLength+16,o=new Uint8Array(i),s=new DataView(o.buffer,o.byteOffset,o.byteLength),a=new Ua.Crc32;return s.setUint32(0,i,!1),s.setUint32(4,r.byteLength,!1),s.setUint32(8,a.update(o.subarray(0,8)).digest(),!1),o.set(r,12),o.set(n,r.byteLength+12),s.setUint32(i-4,a.update(o.subarray(8,i-4)).digest(),!1),o},e.prototype.unmarshall=function(e){var t=function(e){var t=e.byteLength,n=e.byteOffset,r=e.buffer;if(t<16)throw new Error("Provided message too short to accommodate event stream message overhead");var i=new DataView(r,n,t),o=i.getUint32(0,!1);if(t!==o)throw new Error("Reported message length does not match received message length");var s=i.getUint32(4,!1),a=i.getUint32(8,!1),u=i.getUint32(t-4,!1),c=(new Ua.Crc32).update(new Uint8Array(r,n,8));if(a!==c.digest())throw new Error("The prelude checksum specified in the message ("+a+") does not match the calculated CRC32 checksum ("+c.digest()+")");if(c.update(new Uint8Array(r,n+8,t-12)),u!==c.digest())throw new Error("The message checksum ("+c.digest()+") did not match the expected value of "+u);return{headers:new DataView(r,n+8+4,s),body:new Uint8Array(r,n+8+4+s,o-s-16)}}(e),n=t.headers,r=t.body;return{headers:this.headerMarshaller.parse(n),body:r}},e.prototype.formatHeaders=function(e){return this.headerMarshaller.format(e)},e}();var su=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new ou(t,n),this.utfEncoder=t}return e.prototype.deserialize=function(e,t){var n,r,i,o,s,a,u;return function(e,t){var n;return(n={})[Symbol.asyncIterator]=function(){return Object(Tt.__asyncGenerator)(this,arguments,(function(){var n,r,i,o,s,a,u,c,f,d,l,p,h,v,g,m,y;return Object(Tt.__generator)(this,(function(b){switch(b.label){case 0:b.trys.push([0,12,13,18]),n=Object(Tt.__asyncValues)(e),b.label=1;case 1:return[4,Object(Tt.__await)(n.next())];case 2:if((r=b.sent()).done)return[3,11];if(i=r.value,o=t.eventMarshaller.unmarshall(i),"error"!==(s=o.headers[":message-type"].value))return[3,3];throw(a=new Error(o.headers[":error-message"].value||"UnknownError")).name=o.headers[":error-code"].value,a;case 3:return"exception"!==s?[3,5]:(u=o.headers[":exception-type"].value,(v={})[u]=o,c=v,[4,Object(Tt.__await)(t.deserializer(c))]);case 4:if((f=b.sent()).$unknown)throw(d=new Error(t.toUtf8(o.body))).name=u,d;throw f[u];case 5:return"event"!==s?[3,9]:((g={})[o.headers[":event-type"].value]=o,l=g,[4,Object(Tt.__await)(t.deserializer(l))]);case 6:return(p=b.sent()).$unknown?[3,10]:[4,Object(Tt.__await)(p)];case 7:return[4,b.sent()];case 8:return b.sent(),[3,10];case 9:throw Error("Unrecognizable event type: "+o.headers[":event-type"].value);case 10:return[3,1];case 11:return[3,18];case 12:return h=b.sent(),m={error:h},[3,18];case 13:return b.trys.push([13,,16,17]),r&&!r.done&&(y=n.return)?[4,Object(Tt.__await)(y.call(n))]:[3,15];case 14:b.sent(),b.label=15;case 15:return[3,17];case 16:if(m)throw m.error;return[7];case 17:return[7];case 18:return[2]}}))}))},n}((n=e,i=0,o=0,s=null,a=null,u=function(e){if("number"!=typeof e)throw new Error("Attempted to allocate an event message where size was not a number: "+e);i=e,o=4,s=new Uint8Array(e),new DataView(s.buffer).setUint32(0,e,!1)},(r={})[Symbol.asyncIterator]=function(){return Object(Tt.__asyncGenerator)(this,arguments,(function(){var e,t,r,c,f,d,l,p;return Object(Tt.__generator)(this,(function(h){switch(h.label){case 0:e=n[Symbol.asyncIterator](),h.label=1;case 1:return[4,Object(Tt.__await)(e.next())];case 2:return t=h.sent(),r=t.value,t.done?i?[3,4]:[4,Object(Tt.__await)(void 0)]:[3,10];case 3:return[2,h.sent()];case 4:return i!==o?[3,7]:[4,Object(Tt.__await)(s)];case 5:return[4,h.sent()];case 6:return h.sent(),[3,8];case 7:throw new Error("Truncated event message received.");case 8:return[4,Object(Tt.__await)(void 0)];case 9:return[2,h.sent()];case 10:c=r.length,f=0,h.label=11;case 11:if(!(f<c))return[3,15];if(!s){if(d=c-f,a||(a=new Uint8Array(4)),l=Math.min(4-o,d),a.set(r.slice(f,f+l),o),f+=l,(o+=l)<4)return[3,15];u(new DataView(a.buffer).getUint32(0,!1)),a=null}return p=Math.min(i-o,c-f),s.set(r.slice(f,f+p),o),o+=p,f+=p,i&&i===o?[4,Object(Tt.__await)(s)]:[3,14];case 12:return[4,h.sent()];case 13:h.sent(),s=null,i=0,o=0,h.label=14;case 14:return[3,11];case 15:return[3,1];case 16:return[2]}}))}))},r),{eventMarshaller:this.eventMarshaller,deserializer:t,toUtf8:this.utfEncoder})},e.prototype.serialize=function(e,t){var n,r=this;return(n={})[Symbol.asyncIterator]=function(){return Object(Tt.__asyncGenerator)(this,arguments,(function(){var n,i,o,s,a,u,c;return Object(Tt.__generator)(this,(function(f){switch(f.label){case 0:f.trys.push([0,7,8,13]),n=Object(Tt.__asyncValues)(e),f.label=1;case 1:return[4,Object(Tt.__await)(n.next())];case 2:return(i=f.sent()).done?[3,6]:(o=i.value,s=r.eventMarshaller.marshall(t(o)),[4,Object(Tt.__await)(s)]);case 3:return[4,f.sent()];case 4:f.sent(),f.label=5;case 5:return[3,1];case 6:return[3,13];case 7:return a=f.sent(),u={error:a},[3,13];case 8:return f.trys.push([8,,11,12]),i&&!i.done&&(c=n.return)?[4,Object(Tt.__await)(c.call(n))]:[3,10];case 9:f.sent(),f.label=10;case 10:return[3,12];case 11:if(u)throw u.error;return[7];case 12:return[7];case 13:return[4,Object(Tt.__await)(new Uint8Array(0))];case 14:return[4,f.sent()];case 15:return f.sent(),[2]}}))}))},n},e}(),au=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new ou(t,n),this.universalMarshaller=new su({utf8Decoder:n,utf8Encoder:t})}return e.prototype.deserialize=function(e,t){var n,r,i=uu(e)?(n=e,(r={})[Symbol.asyncIterator]=function(){return Object(Tt.__asyncGenerator)(this,arguments,(function(){var e,t,r,i;return Object(Tt.__generator)(this,(function(o){switch(o.label){case 0:e=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Object(Tt.__await)(e.read())];case 3:return t=o.sent(),r=t.done,i=t.value,r?[4,Object(Tt.__await)(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Object(Tt.__await)(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))},r):e;return this.universalMarshaller.deserialize(i,t)},e.prototype.serialize=function(e,t){var n,r=this.universalMarshaller.serialize(e,t);return"function"==typeof ReadableStream?(n=r[Symbol.asyncIterator](),new ReadableStream({pull:function(e){return Object(Tt.__awaiter)(this,void 0,void 0,(function(){var t,r,i;return Object(Tt.__generator)(this,(function(o){switch(o.label){case 0:return[4,n.next()];case 1:return t=o.sent(),r=t.done,i=t.value,r?[2,e.close()]:(e.enqueue(i),[2])}}))}))}})):r},e}(),uu=function(e){return"function"==typeof ReadableStream&&e instanceof ReadableStream},cu=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"]),fu=new Set(["cn-north-1","cn-northwest-1"]),du=new Set(["us-iso-east-1"]),lu=new Set(["us-isob-east-1"]),pu=new Set(["us-gov-east-1","us-gov-west-1"]),hu={apiVersion:"2013-12-02",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"kinesis.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"kinesis.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"kinesis.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"kinesis.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"kinesis.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"kinesis.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"kinesis.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"kinesis.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"kinesis.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"kinesis.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"kinesis.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"kinesis.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"kinesis.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"kinesis.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"kinesis.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"kinesis.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"kinesis-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"kinesis-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-west-1":n={hostname:"kinesis-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"kinesis-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"kinesis.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"kinesis.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"kinesis.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"kinesis.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"kinesis.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"us-gov-west-1":n={hostname:"kinesis.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"us-iso-east-1":n={hostname:"kinesis.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"kinesis.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"kinesis.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"kinesis.us-west-2.amazonaws.com",partition:"aws"};break;default:cu.has(e)&&(n={hostname:"kinesis.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),fu.has(e)&&(n={hostname:"kinesis.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),du.has(e)&&(n={hostname:"kinesis.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),lu.has(e)&&(n={hostname:"kinesis.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),pu.has(e)&&(n={hostname:"kinesis.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"kinesis.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(jo({signingService:"kinesis"},n))},serviceId:"Kinesis",urlParser:vr},vu=jo(jo({},hu),{runtime:"browser",base64Decoder:Fn,base64Encoder:Bn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:hu.serviceId,clientVersion:za.version}),eventStreamSerdeProvider:function(e){return new au(e)},maxAttempts:3,region:Vn("Region is missing"),requestHandler:new jn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur,utf8Encoder:cr}),gu=function(e){function t(t){var n,r=this,i=jo(jo({},vu),t),o=_r(i),s=oi(yr(o)),a=di(nr(s)),u=(n=a,Object(Tt.__assign)(Object(Tt.__assign)({},n),{eventStreamMarshaller:n.eventStreamSerdeProvider(n)}));return(r=e.call(this,u)||this).config=u,r.middlewareStack.use(fi(r.config)),r.middlewareStack.use(Gn(r.config)),r.middlewareStack.use(Ar(r.config)),r.middlewareStack.use(kr(r.config)),r.middlewareStack.use(Ir(r.config)),r.middlewareStack.use(vi(r.config)),r}return Po(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Ut),mu=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},yu=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},bu=new r.ConsoleLogger("AWSKinesisProvider"),wu=function(){function e(e){this._buffer=[],this._config=e||{},this._config.bufferSize=this._config.bufferSize||1e3,this._config.flushSize=this._config.flushSize||100,this._config.flushInterval=this._config.flushInterval||5e3,this._config.resendLimit=this._config.resendLimit||5,this._setupTimer()}return e.prototype._setupTimer=function(){var e=this;this._timer&&clearInterval(this._timer);var t=this._config,n=t.flushSize,r=t.flushInterval;this._timer=setInterval((function(){for(var t=e._buffer.length<n?e._buffer.length:n,r=[],i=0;i<t;i+=1){var o=e._buffer.shift();r.push(o)}e._sendFromBuffer(r)}),r)},e.prototype.getCategory=function(){return"Analytics"},e.prototype.getProviderName=function(){return"AWSKinesis"},e.prototype.configure=function(e){bu.debug("configure Analytics",e);var t=e||{};return this._config=Object.assign({},this._config,t),this._setupTimer(),this._config},e.prototype.record=function(e){return mu(this,void 0,void 0,(function(){var t;return yu(this,(function(n){switch(n.label){case 0:return[4,this._getCredentials()];case 1:return(t=n.sent())?(Object.assign(e,{config:this._config,credentials:t}),[2,this._putToBuffer(e)]):[2,Promise.resolve(!1)]}}))}))},e.prototype.updateEndpoint=function(){return bu.debug("updateEndpoint is not implemented in Kinesis provider"),Promise.resolve(!0)},e.prototype._putToBuffer=function(e){return this._buffer.length<1e3?(this._buffer.push(e),Promise.resolve(!0)):(bu.debug("exceed analytics events buffer size"),Promise.reject(!1))},e.prototype._sendFromBuffer=function(e){for(var t=this,n=[],r=null,i=[],o=0;o<e.length;o+=1){var s=e[o].credentials;0===o?(i.push(e[o]),r=s):s.sessionToken===r.sessionToken&&s.identityId===r.identityId?(bu.debug("no change for cred, put event in the same group"),i.push(e[o])):(n.push(i),(i=[]).push(e[o]),r=s)}n.push(i),n.map((function(e){t._sendEvents(e)}))},e.prototype._sendEvents=function(e){var t=this;if(0!==e.length){var n=e[0],r=n.config,i=n.credentials;if(!this._init(r,i))return!1;var o={};e.map((function(e){var t=e.event,n=t.streamName;void 0===o[n]&&(o[n]=[]);var r=t.data&&"string"!=typeof t.data?JSON.stringify(t.data):t.data,s={Data:ur(r),PartitionKey:t.partitionKey||"partition-"+i.identityId};o[n].push(s)})),Object.keys(o).map((function(e){return mu(t,void 0,void 0,(function(){var t,n;return yu(this,(function(r){switch(r.label){case 0:bu.debug("putting records to kinesis with records",o[e]),r.label=1;case 1:return r.trys.push([1,3,,4]),t=new Da({Records:o[e],StreamName:e}),[4,this._kinesis.send(t)];case 2:return r.sent(),bu.debug("Upload records to stream",e),[3,4];case 3:return n=r.sent(),bu.debug("Failed to upload records to Kinesis",n),[3,4];case 4:return[2]}}))}))}))}},e.prototype._init=function(e,t){if(bu.debug("init clients"),this._kinesis&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return bu.debug("no change for analytics config, directly return from init"),!0;this._config.credentials=t;var n=e.region,r=e.endpoint;return this._initKinesis(n,r,t)},e.prototype._initKinesis=function(e,t,n){return bu.debug("initialize kinesis with credentials",n),this._kinesis=new gu({region:e,credentials:n,customUserAgent:Object(r.getAmplifyUserAgent)(),endpoint:t}),!0},e.prototype._getCredentials=function(){var e=this;return r.Credentials.get().then((function(t){return t?(bu.debug("set credentials for analytics",e._config.credentials),r.Credentials.shear(t)):null})).catch((function(e){return bu.debug("ensure credentials error",e),null}))},e}(),_u=function(e,t){return(_u=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 Su(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}_u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Eu=function(){return(Eu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Au(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function Ou(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;var ku,Lu,Iu,Mu,xu,Pu,ju,Ru,Tu,Cu,Nu,Du,zu,Uu,Fu,Bu,qu,Ku,Vu,Hu,Gu,$u,Wu,Zu,Yu,Ju,Qu,Xu,ec,tc,nc,rc,ic,oc,sc,ac,uc,cc,fc,dc,lc,pc,hc,vc,gc,mc,yc,bc,wc,_c,Sc,Ec,Ac,Oc,kc,Lc,Ic,Mc,xc,Pc,jc,Rc,Tc,Cc,Nc,Dc,zc,Uc,Fc,Bc,qc,Kc,Vc,Hc,Gc,$c,Wc,Zc,Yc,Jc,Qc,Xc,ef,tf,nf,rf,of,sf,af,uf,cf,ff,df,lf,pf,hf,vf,gf,mf,yf,bf;Object.create;(ku||(ku={})).filterSensitiveLog=function(e){return Eu({},e)},(Lu||(Lu={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.GZIP="GZIP",e.HADOOP_SNAPPY="HADOOP_SNAPPY",e.SNAPPY="Snappy",e.UNCOMPRESSED="UNCOMPRESSED",e.ZIP="ZIP"}(Iu||(Iu={})),(Mu||(Mu={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.GZIP="GZIP",e.NONE="NONE"}(xu||(xu={})),(Pu||(Pu={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.AWS_OWNED_CMK="AWS_OWNED_CMK",e.CUSTOMER_MANAGED_CMK="CUSTOMER_MANAGED_CMK"}(ju||(ju={})),(Ru||(Ru={})).filterSensitiveLog=function(e){return Eu({},e)},(Tu||(Tu={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.BUFFER_INTERVAL_IN_SECONDS="BufferIntervalInSeconds",e.BUFFER_SIZE_IN_MB="BufferSizeInMBs",e.LAMBDA_ARN="LambdaArn",e.LAMBDA_NUMBER_OF_RETRIES="NumberOfRetries",e.ROLE_ARN="RoleArn"}(Cu||(Cu={})),(Nu||(Nu={})).filterSensitiveLog=function(e){return Eu({},e)},(Du||(Du={})).filterSensitiveLog=function(e){return Eu({},e)},(zu||(zu={})).filterSensitiveLog=function(e){return Eu({},e)},(Uu||(Uu={})).filterSensitiveLog=function(e){return Eu({},e)},(Fu||(Fu={})).filterSensitiveLog=function(e){return Eu({},e)},(Bu||(Bu={})).filterSensitiveLog=function(e){return Eu({},e)},(qu||(qu={})).filterSensitiveLog=function(e){return Eu({},e)},(Ku||(Ku={})).filterSensitiveLog=function(e){return Eu({},e)},(Vu||(Vu={})).filterSensitiveLog=function(e){return Eu({},e)},(Hu||(Hu={})).filterSensitiveLog=function(e){return Eu({},e)},(Gu||(Gu={})).filterSensitiveLog=function(e){return Eu({},e)},($u||($u={})).filterSensitiveLog=function(e){return Eu({},e)},(Wu||(Wu={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.NONE="NONE",e.SNAPPY="SNAPPY",e.ZLIB="ZLIB"}(Zu||(Zu={})),function(e){e.V0_11="V0_11",e.V0_12="V0_12"}(Yu||(Yu={})),(Ju||(Ju={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.GZIP="GZIP",e.SNAPPY="SNAPPY",e.UNCOMPRESSED="UNCOMPRESSED"}(Qu||(Qu={})),function(e){e.V1="V1",e.V2="V2"}(Xu||(Xu={})),(ec||(ec={})).filterSensitiveLog=function(e){return Eu({},e)},(tc||(tc={})).filterSensitiveLog=function(e){return Eu({},e)},(nc||(nc={})).filterSensitiveLog=function(e){return Eu({},e)},(rc||(rc={})).filterSensitiveLog=function(e){return Eu({},e)},(ic||(ic={})).filterSensitiveLog=function(e){return Eu({},e)},(oc||(oc={})).filterSensitiveLog=function(e){return Eu({},e)},(sc||(sc={})).filterSensitiveLog=function(e){return Eu({},e)},(ac||(ac={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.Url&&{Url:Vt}),e.AccessKey&&{AccessKey:Vt})},(uc||(uc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.AttributeName&&{AttributeName:Vt}),e.AttributeValue&&{AttributeValue:Vt})},(cc||(cc={})).filterSensitiveLog=function(e){return Eu(Eu({},e),e.CommonAttributes&&{CommonAttributes:e.CommonAttributes.map((function(e){return uc.filterSensitiveLog(e)}))})},(fc||(fc={})).filterSensitiveLog=function(e){return Eu({},e)},(dc||(dc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.EndpointConfiguration&&{EndpointConfiguration:ac.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:cc.filterSensitiveLog(e.RequestConfiguration)})},(lc||(lc={})).filterSensitiveLog=function(e){return Eu({},e)},(pc||(pc={})).filterSensitiveLog=function(e){return Eu({},e)},(hc||(hc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.Username&&{Username:Vt}),e.Password&&{Password:Vt})},(vc||(vc={})).filterSensitiveLog=function(e){return Eu({},e)},(gc||(gc={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(mc||(mc={})),(yc||(yc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.RedshiftDestinationConfiguration&&{RedshiftDestinationConfiguration:hc.filterSensitiveLog(e.RedshiftDestinationConfiguration)}),e.HttpEndpointDestinationConfiguration&&{HttpEndpointDestinationConfiguration:dc.filterSensitiveLog(e.HttpEndpointDestinationConfiguration)})},(bc||(bc={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(wc||(wc={})),(_c||(_c={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(Sc||(Sc={})),function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(Ec||(Ec={})),(Ac||(Ac={})).filterSensitiveLog=function(e){return Eu({},e)},(Oc||(Oc={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(kc||(kc={})),function(e){e.CREATE_ENI_FAILED="CREATE_ENI_FAILED",e.CREATE_KMS_GRANT_FAILED="CREATE_KMS_GRANT_FAILED",e.DELETE_ENI_FAILED="DELETE_ENI_FAILED",e.DISABLED_KMS_KEY="DISABLED_KMS_KEY",e.ENI_ACCESS_DENIED="ENI_ACCESS_DENIED",e.INVALID_KMS_KEY="INVALID_KMS_KEY",e.KMS_ACCESS_DENIED="KMS_ACCESS_DENIED",e.KMS_KEY_NOT_FOUND="KMS_KEY_NOT_FOUND",e.KMS_OPT_IN_REQUIRED="KMS_OPT_IN_REQUIRED",e.RETIRE_KMS_GRANT_FAILED="RETIRE_KMS_GRANT_FAILED",e.SECURITY_GROUP_ACCESS_DENIED="SECURITY_GROUP_ACCESS_DENIED",e.SECURITY_GROUP_NOT_FOUND="SECURITY_GROUP_NOT_FOUND",e.SUBNET_ACCESS_DENIED="SUBNET_ACCESS_DENIED",e.SUBNET_NOT_FOUND="SUBNET_NOT_FOUND",e.UNKNOWN_ERROR="UNKNOWN_ERROR"}(Lc||(Lc={})),(Ic||(Ic={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.DISABLED="DISABLED",e.DISABLING="DISABLING",e.DISABLING_FAILED="DISABLING_FAILED",e.ENABLED="ENABLED",e.ENABLING="ENABLING",e.ENABLING_FAILED="ENABLING_FAILED"}(Mc||(Mc={})),(xc||(xc={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.CREATING_FAILED="CREATING_FAILED",e.DELETING="DELETING",e.DELETING_FAILED="DELETING_FAILED"}(Pc||(Pc={})),(jc||(jc={})).filterSensitiveLog=function(e){return Eu({},e)},(Rc||(Rc={})).filterSensitiveLog=function(e){return Eu({},e)},(Tc||(Tc={})).filterSensitiveLog=function(e){return Eu({},e)},(Cc||(Cc={})).filterSensitiveLog=function(e){return Eu({},e)},(Nc||(Nc={})).filterSensitiveLog=function(e){return Eu(Eu({},e),e.Url&&{Url:Vt})},(Dc||(Dc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.EndpointConfiguration&&{EndpointConfiguration:Nc.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:cc.filterSensitiveLog(e.RequestConfiguration)})},(zc||(zc={})).filterSensitiveLog=function(e){return Eu(Eu({},e),e.Username&&{Username:Vt})},(Uc||(Uc={})).filterSensitiveLog=function(e){return Eu({},e)},(Fc||(Fc={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.RedshiftDestinationDescription&&{RedshiftDestinationDescription:zc.filterSensitiveLog(e.RedshiftDestinationDescription)}),e.HttpEndpointDestinationDescription&&{HttpEndpointDestinationDescription:Dc.filterSensitiveLog(e.HttpEndpointDestinationDescription)})},(Bc||(Bc={})).filterSensitiveLog=function(e){return Eu({},e)},(qc||(qc={})).filterSensitiveLog=function(e){return Eu({},e)},(Kc||(Kc={})).filterSensitiveLog=function(e){return Eu(Eu({},e),e.Destinations&&{Destinations:e.Destinations.map((function(e){return Fc.filterSensitiveLog(e)}))})},(Vc||(Vc={})).filterSensitiveLog=function(e){return Eu({},e)},(Hc||(Hc={})).filterSensitiveLog=function(e){return Eu(Eu({},e),e.DeliveryStreamDescription&&{DeliveryStreamDescription:Kc.filterSensitiveLog(e.DeliveryStreamDescription)})},(Gc||(Gc={})).filterSensitiveLog=function(e){return Eu({},e)},($c||($c={})).filterSensitiveLog=function(e){return Eu({},e)},(Wc||(Wc={})).filterSensitiveLog=function(e){return Eu({},e)},(Zc||(Zc={})).filterSensitiveLog=function(e){return Eu({},e)},(Yc||(Yc={})).filterSensitiveLog=function(e){return Eu({},e)},(Jc||(Jc={})).filterSensitiveLog=function(e){return Eu({},e)},(Qc||(Qc={})).filterSensitiveLog=function(e){return Eu({},e)},function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(Xc||(Xc={})),function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(ef||(ef={})),function(e){e.filterSensitiveLog=function(e){return Eu({},e)}}(tf||(tf={})),(nf||(nf={})).filterSensitiveLog=function(e){return Eu({},e)},(rf||(rf={})).filterSensitiveLog=function(e){return Eu({},e)},(of||(of={})).filterSensitiveLog=function(e){return Eu({},e)},(sf||(sf={})).filterSensitiveLog=function(e){return Eu({},e)},(af||(af={})).filterSensitiveLog=function(e){return Eu({},e)},(uf||(uf={})).filterSensitiveLog=function(e){return Eu({},e)},(cf||(cf={})).filterSensitiveLog=function(e){return Eu({},e)},(ff||(ff={})).filterSensitiveLog=function(e){return Eu({},e)},(df||(df={})).filterSensitiveLog=function(e){return Eu({},e)},(lf||(lf={})).filterSensitiveLog=function(e){return Eu({},e)},(pf||(pf={})).filterSensitiveLog=function(e){return Eu({},e)},(hf||(hf={})).filterSensitiveLog=function(e){return Eu({},e)},(vf||(vf={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.EndpointConfiguration&&{EndpointConfiguration:ac.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:cc.filterSensitiveLog(e.RequestConfiguration)})},(gf||(gf={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.Username&&{Username:Vt}),e.Password&&{Password:Vt})},(mf||(mf={})).filterSensitiveLog=function(e){return Eu({},e)},(yf||(yf={})).filterSensitiveLog=function(e){return Eu(Eu(Eu({},e),e.RedshiftDestinationUpdate&&{RedshiftDestinationUpdate:gf.filterSensitiveLog(e.RedshiftDestinationUpdate)}),e.HttpEndpointDestinationUpdate&&{HttpEndpointDestinationUpdate:vf.filterSensitiveLog(e.HttpEndpointDestinationUpdate)})},(bf||(bf={})).filterSensitiveLog=function(e){return Eu({},e)};var wf,_f=function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,d,l;return Ou(this,(function(p){switch(p.label){case 0:return r=[Eu({},e)],l={},[4,zf(e.body,t)];case 1:switch(n=Eu.apply(void 0,r.concat([(l.body=p.sent(),l)])),o="UnknownError",o=Uf(e,n.body),o){case"InvalidArgumentException":case"com.amazonaws.firehose#InvalidArgumentException":return[3,2];case"InvalidKMSResourceException":case"com.amazonaws.firehose#InvalidKMSResourceException":return[3,4];case"ResourceNotFoundException":case"com.amazonaws.firehose#ResourceNotFoundException":return[3,6];case"ServiceUnavailableException":case"com.amazonaws.firehose#ServiceUnavailableException":return[3,8]}return[3,10];case 2:return s=[{}],[4,Sf(n,t)];case 3:return i=Eu.apply(void 0,[Eu.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:Cf(e)}]),[3,11];case 4:return a=[{}],[4,Ef(n,t)];case 5:return i=Eu.apply(void 0,[Eu.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:Cf(e)}]),[3,11];case 6:return u=[{}],[4,Af(n,t)];case 7:return i=Eu.apply(void 0,[Eu.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:Cf(e)}]),[3,11];case 8:return c=[{}],[4,Of(n,t)];case 9:return i=Eu.apply(void 0,[Eu.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:Cf(e)}]),[3,11];case 10:f=n.body,o=f.code||f.Code||o,i=Eu(Eu({},f),{name:""+o,message:f.message||f.Message||o,$fault:"client",$metadata:Cf(e)}),p.label=11;case 11:return d=i.message||i.Message||o,i.message=d,delete i.Message,[2,Promise.reject(Object.assign(new Error(d),i))]}}))}))},Sf=function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r;return Ou(this,(function(i){return n=e.body,r=Mf(n,t),[2,Eu({name:"InvalidArgumentException",$fault:"client",$metadata:Cf(e)},r)]}))}))},Ef=function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r;return Ou(this,(function(i){return n=e.body,r=xf(n,t),[2,Eu({name:"InvalidKMSResourceException",$fault:"client",$metadata:Cf(e)},r)]}))}))},Af=function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r;return Ou(this,(function(i){return n=e.body,r=Rf(n,t),[2,Eu({name:"ResourceNotFoundException",$fault:"client",$metadata:Cf(e)},r)]}))}))},Of=function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r;return Ou(this,(function(i){return n=e.body,r=Tf(n,t),[2,Eu({name:"ServiceUnavailableException",$fault:"server",$metadata:Cf(e)},r)]}))}))},kf=function(e,t){return Eu(Eu({},void 0!==e.DeliveryStreamName&&null!==e.DeliveryStreamName&&{DeliveryStreamName:e.DeliveryStreamName}),void 0!==e.Records&&null!==e.Records&&{Records:Lf(e.Records,t)})},Lf=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:If(e,t)}))},If=function(e,t){return Eu({},void 0!==e.Data&&null!==e.Data&&{Data:t.base64Encoder(e.Data)})},Mf=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},xf=function(e,t){return{code:void 0!==e.code&&null!==e.code?e.code:void 0,message:void 0!==e.message&&null!==e.message?e.message:void 0}},Pf=function(e,t){return{Encrypted:void 0!==e.Encrypted&&null!==e.Encrypted?e.Encrypted:void 0,FailedPutCount:void 0!==e.FailedPutCount&&null!==e.FailedPutCount?e.FailedPutCount:void 0,RequestResponses:void 0!==e.RequestResponses&&null!==e.RequestResponses?jf(e.RequestResponses,t):void 0}},jf=function(e,t){return(e||[]).filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return{ErrorCode:void 0!==e.ErrorCode&&null!==e.ErrorCode?e.ErrorCode:void 0,ErrorMessage:void 0!==e.ErrorMessage&&null!==e.ErrorMessage?e.ErrorMessage:void 0,RecordId:void 0!==e.RecordId&&null!==e.RecordId?e.RecordId:void 0}}(e)}))},Rf=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Tf=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Cf=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"]}},Nf=function(e,t){return function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)}(e,t).then((function(e){return t.utf8Encoder(e)}))},Df=function(e,t,n,r,i){return Au(void 0,void 0,void 0,(function(){var o,s,a,u,c,f;return Ou(this,(function(d){switch(d.label){case 0:return[4,e.endpoint()];case 1:return o=d.sent(),s=o.hostname,a=o.protocol,u=void 0===a?"https":a,c=o.port,f={protocol:u,hostname:s,port:c,method:"POST",path:n,headers:t},void 0!==r&&(f.hostname=r),void 0!==i&&(f.body=i),[2,new Ct(f)]}}))}))},zf=function(e,t){return Nf(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Uf=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},Ff=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Su(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(On(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"FirehoseClient",commandName:"PutRecordBatchCommand",inputFilterSensitiveLog:rf.filterSensitiveLog,outputFilterSensitiveLog:sf.filterSensitiveLog},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r;return Ou(this,(function(i){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Firehose_20150804.PutRecordBatch"},r=JSON.stringify(kf(e,t)),[2,Df(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Au(void 0,void 0,void 0,(function(){var n,r,i;return Ou(this,(function(o){switch(o.label){case 0:return e.statusCode>=300?[2,_f(e,t)]:[4,zf(e.body,t)];case 1:return n=o.sent(),{},r=Pf(n,t),i=Eu({$metadata:Cf(e)},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Ft),Bf=n(48),qf=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"]),Kf=new Set(["cn-north-1","cn-northwest-1"]),Vf=new Set(["us-iso-east-1"]),Hf=new Set(["us-isob-east-1"]),Gf=new Set(["us-gov-east-1","us-gov-west-1"]),$f={apiVersion:"2015-08-04",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;switch(e){case"af-south-1":n={hostname:"firehose.af-south-1.amazonaws.com",partition:"aws"};break;case"ap-east-1":n={hostname:"firehose.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"firehose.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"firehose.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"firehose.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"firehose.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"firehose.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"firehose.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"firehose.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"firehose.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"firehose.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"firehose.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-south-1":n={hostname:"firehose.eu-south-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"firehose.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"firehose.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"firehose.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-east-1":n={hostname:"firehose-fips.us-east-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"fips-us-east-2":n={hostname:"firehose-fips.us-east-2.amazonaws.com",partition:"aws",signingRegion:"us-east-2"};break;case"fips-us-gov-east-1":n={hostname:"firehose-fips.us-gov-east-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-east-1"};break;case"fips-us-gov-west-1":n={hostname:"firehose-fips.us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"fips-us-west-1":n={hostname:"firehose-fips.us-west-1.amazonaws.com",partition:"aws",signingRegion:"us-west-1"};break;case"fips-us-west-2":n={hostname:"firehose-fips.us-west-2.amazonaws.com",partition:"aws",signingRegion:"us-west-2"};break;case"me-south-1":n={hostname:"firehose.me-south-1.amazonaws.com",partition:"aws"};break;case"sa-east-1":n={hostname:"firehose.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"firehose.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"firehose.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"firehose.us-gov-east-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-gov-west-1":n={hostname:"firehose.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-west-1":n={hostname:"firehose.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"firehose.us-west-2.amazonaws.com",partition:"aws"};break;default:qf.has(e)&&(n={hostname:"firehose.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Kf.has(e)&&(n={hostname:"firehose.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Vf.has(e)&&(n={hostname:"firehose.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Hf.has(e)&&(n={hostname:"firehose.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Gf.has(e)&&(n={hostname:"firehose.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"firehose.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(Eu({signingService:"firehose"},n))},serviceId:"Firehose",urlParser:vr},Wf=Eu(Eu({},$f),{runtime:"browser",base64Decoder:Fn,base64Encoder:Bn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:$f.serviceId,clientVersion:Bf.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new jn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur,utf8Encoder:cr}),Zf=function(e){function t(t){var n=this,r=Eu(Eu({},Wf),t),i=_r(r),o=oi(yr(i)),s=di(nr(o));return(n=e.call(this,s)||this).config=s,n.middlewareStack.use(fi(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Ar(n.config)),n.middlewareStack.use(kr(n.config)),n.middlewareStack.use(Ir(n.config)),n.middlewareStack.use(vi(n.config)),n}return Su(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Ut),Yf=(wf=function(e,t){return(wf=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}wf(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Jf=new r.ConsoleLogger("AWSKineisFirehoseProvider"),Qf=function(e){function t(t){return e.call(this,t)||this}return Yf(t,e),t.prototype.getProviderName=function(){return"AWSKinesisFirehose"},t.prototype._sendEvents=function(e){var t=this;if(0!==e.length){var n=e[0],r=n.config,i=n.credentials;if(!this._init(r,i))return!1;var o={};e.map((function(e){var t=e.event,n=t.streamName,r=t.data;void 0===o[n]&&(o[n]=[]);var i=r&&"string"!=typeof r?JSON.stringify(r):r,s={Data:ur(i)};o[n].push(s)})),Object.keys(o).map((function(e){Jf.debug("putting records to kinesis",e,"with records",o[e]),t._kinesisFirehose.send(new Ff({Records:o[e],DeliveryStreamName:e})).then((function(t){return Jf.debug("Upload records to stream",e)})).catch((function(e){return Jf.debug("Failed to upload records to Kinesis",e)}))}))}},t.prototype._init=function(e,t){if(Jf.debug("init clients"),this._kinesisFirehose&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return Jf.debug("no change for analytics config, directly return from init"),!0;this._config.credentials=t;var n=e.region;return this._initFirehose(n,t)},t.prototype._initFirehose=function(e,t){return Jf.debug("initialize kinesis firehose with credentials",t),this._kinesisFirehose=new Zf({apiVersion:"2015-08-04",region:e,credentials:t}),!0},t}(wu),Xf=function(e,t){return(Xf=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 ed(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}Xf(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var td=function(){return(td=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function nd(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function rd(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;var id,od,sd,ad,ud,cd,fd,dd;Object.create;(id||(id={})).filterSensitiveLog=function(e){return td({},e)},(od||(od={})).filterSensitiveLog=function(e){return td({},e)},function(e){e.filterSensitiveLog=function(e){return td({},e)}}(sd||(sd={})),(ad||(ad={})).filterSensitiveLog=function(e){return td({},e)},(ud||(ud={})).filterSensitiveLog=function(e){return td({},e)},function(e){e.filterSensitiveLog=function(e){return td({},e)}}(cd||(cd={})),(fd||(fd={})).filterSensitiveLog=function(e){return td({},e)},(dd||(dd={})).filterSensitiveLog=function(e){return td({},e)};var ld,pd,hd,vd=function(e,t){return nd(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return rd(this,(function(f){switch(f.label){case 0:return r=[td({},e)],c={},[4,_d(e.body,t)];case 1:switch(n=td.apply(void 0,r.concat([(c.body=f.sent(),c)])),o="UnknownError",o=Sd(e,n.body),o){case"InvalidInputException":case"com.amazonaws.personalizeevents#InvalidInputException":return[3,2]}return[3,4];case 2:return s=[{}],[4,gd(n,t)];case 3:return i=td.apply(void 0,[td.apply(void 0,s.concat([f.sent()])),{name:o,$metadata:bd(e)}]),[3,5];case 4:a=n.body,o=a.code||a.Code||o,i=td(td({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:bd(e)}),f.label=5;case 5:return u=i.message||i.Message||o,i.message=u,delete i.Message,[2,Promise.reject(Object.assign(new Error(u),i))]}}))}))},gd=function(e,t){return nd(void 0,void 0,void 0,(function(){var t,n;return rd(this,(function(r){return t={name:"InvalidInputException",$fault:"client",$metadata:bd(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},md=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return td(td(td(td(td(td(td(td({},void 0!==e.eventId&&null!==e.eventId&&{eventId:e.eventId}),void 0!==e.eventType&&null!==e.eventType&&{eventType:e.eventType}),void 0!==e.eventValue&&null!==e.eventValue&&{eventValue:e.eventValue}),void 0!==e.impression&&null!==e.impression&&{impression:yd(e.impression,t)}),void 0!==e.itemId&&null!==e.itemId&&{itemId:e.itemId}),void 0!==e.properties&&null!==e.properties&&{properties:Kt.fromObject(e.properties)}),void 0!==e.recommendationId&&null!==e.recommendationId&&{recommendationId:e.recommendationId}),void 0!==e.sentAt&&null!==e.sentAt&&{sentAt:Math.round(e.sentAt.getTime()/1e3)})}(e,t)}))},yd=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},bd=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"]}},wd=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},_d=function(e,t){return function(e,t){return wd(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},Sd=function(e,t){var n,r,i=function(e){var t=e;return t.indexOf(":")>=0&&(t=t.split(":")[0]),t.indexOf("#")>=0&&(t=t.split("#")[1]),t},o=(n=e.headers,r="x-amzn-errortype",Object.keys(n).find((function(e){return e.toLowerCase()===r.toLowerCase()})));return void 0!==o?i(e.headers[o]):void 0!==t.code?i(t.code):void 0!==t.__type?i(t.__type):""},Ed=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return ed(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(On(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,clientName:"PersonalizeEventsClient",commandName:"PutEventsCommand",inputFilterSensitiveLog:sd.filterSensitiveLog,outputFilterSensitiveLog:function(e){return e}},o=t.requestHandler;return r.resolve((function(e){return o.handle(e.request,n||{})}),i)},t.prototype.serialize=function(e,t){return function(e,t){return nd(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return rd(this,(function(f){switch(f.label){case 0:return n={"content-type":"application/json"},r="/events",i=JSON.stringify(td(td(td(td({},void 0!==e.eventList&&null!==e.eventList&&{eventList:md(e.eventList,t)}),void 0!==e.sessionId&&null!==e.sessionId&&{sessionId:e.sessionId}),void 0!==e.trackingId&&null!==e.trackingId&&{trackingId:e.trackingId}),void 0!==e.userId&&null!==e.userId&&{userId:e.userId})),[4,t.endpoint()];case 1:return o=f.sent(),s=o.hostname,a=o.protocol,u=void 0===a?"https":a,c=o.port,[2,new Ct({protocol:u,hostname:s,port:c,method:"POST",headers:n,path:r,body:i})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return nd(void 0,void 0,void 0,(function(){var n;return rd(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,vd(e,t)]:(n={$metadata:bd(e)},[4,wd(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Ft),Ad=n(50),Od=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"]),kd=new Set(["cn-north-1","cn-northwest-1"]),Ld=new Set(["us-iso-east-1"]),Id=new Set(["us-isob-east-1"]),Md=new Set(["us-gov-east-1","us-gov-west-1"]),xd={apiVersion:"2018-03-22",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;return Od.has(e)&&(n={hostname:"personalize-events.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),kd.has(e)&&(n={hostname:"personalize-events.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Ld.has(e)&&(n={hostname:"personalize-events.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Id.has(e)&&(n={hostname:"personalize-events.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Md.has(e)&&(n={hostname:"personalize-events.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"personalize-events.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Promise.resolve(td({signingService:"personalize"},n))},serviceId:"Personalize Events",urlParser:vr},Pd=td(td({},xd),{runtime:"browser",base64Decoder:Fn,base64Encoder:Bn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:xd.serviceId,clientVersion:Ad.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new jn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur,utf8Encoder:cr}),jd=function(e){function t(t){var n=this,r=td(td({},Pd),t),i=_r(r),o=oi(yr(i)),s=di(nr(o));return(n=e.call(this,s)||this).config=s,n.middlewareStack.use(fi(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Ar(n.config)),n.middlewareStack.use(kr(n.config)),n.middlewareStack.use(Ir(n.config)),n.middlewareStack.use(vi(n.config)),n}return ed(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Ut),Rd=n(3),Td=n.n(Rd),Cd=n(17),Nd=n.n(Cd),Dd=(new r.ConsoleLogger("AmazonPersonalizeProvider"),function(){function e(e){void 0===e&&(e=""),this._isBrowser=r.JS.browserOrNode().isBrowser,this._timerKey=Object(Qn.v1)().substr(0,15),this._refreshTimer()}return e.prototype._refreshTimer=function(){this._timer&&clearInterval(this._timer);var e=this;this._timer=setInterval((function(){e._timerKey=Object(Qn.v1)().substr(0,15)}),3e4)},e.prototype.storeValue=function(e,t){var n=new Date,r=new Date;r.setTime(n.getTime()+6048e5),yi.a.setItem(this._getCachePrefix(e),t,{expires:r.getTime()})},e.prototype.retrieveValue=function(e){return yi.a.getItem(this._getCachePrefix(e))},e.prototype._getCachePrefix=function(e){return this._isBrowser?e+"."+window.location.host:"peronslize"},e.prototype.getTimerKey=function(){return this._timerKey},e.prototype.updateSessionInfo=function(e,t){var n=t.userId,r=t.sessionId;if(this._isRequireNewSession(e,n,r)){var i=Object(Qn.v1)();this.storeValue("_awsct_uid",e),this.storeValue("_awsct_sid",i),t.sessionId=i}else this._isRequireUpdateSessionInfo(e,n,r)&&this.storeValue("_awsct_uid",e);t.userId=e},e.prototype._isRequireUpdateSessionInfo=function(e,t,n){return!Td()(n)&&Td()(t)&&!Td()(e)},e.prototype.retrieveSessionInfo=function(e){var t={};return t.trackingId=e,t.sessionId=this.retrieveValue("_awsct_sid"),t.userId=this.retrieveValue("_awsct_uid"),Td()(t.sessionId)&&(t.sessionId=Object(Qn.v1)(),this.storeValue("_awsct_sid",t.sessionId)),this.storeValue("_awsct",e),t},e.prototype._isRequireNewSession=function(e,t,n){var r=Td()(n),i=Td()(e)&&!Td()(t),o=!Td()(e)&&!Td()(t)&&!Nd()(e,t);return r||i||o},e}());!function(e){e.PLAY="play",e.PAUSE="pause",e.ENDED="Ended"}(ld||(ld={})),function(e){e.IFRAME="IFRAME",e.VIDEO="VIDEO",e.AUDIO="AUDIO"}(pd||(pd={})),function(e){e.PLAY="Play",e.ENDED="Ended",e.PAUSE="Pause",e.TIME_WATCHED="TimeWatched"}(hd||(hd={}));var zd=function(){function e(e,t){var n;this.eventActionMapping=((n={})[hd.ENDED]=this.endedEventAction.bind(this),n[hd.PLAY]=this.playEventAction.bind(this),n[hd.PAUSE]=this.pauseEventAction.bind(this),n);var r=e.eventData;this._params=e,this._mediaElement=document.getElementById(r.properties.domElementId),this._started=!1,this._provider=t,{IFRAME:this._iframeMediaTracker,VIDEO:this._html5MediaTracker,AUDIO:this._html5MediaTracker}[this._mediaElement.tagName].bind(this)(),this._initYoutubeFrame()}return e.prototype._initYoutubeFrame=function(){this._youTubeIframeLoader={src:"https://www.youtube.com/iframe_api",loading:!1,loaded:!1,listeners:[],load:function(e){var t=this;if(this.listeners.push(e),this.loaded)setTimeout((function(){t.done()}));else if(!this.loading){this.loading=!0,window.onYouTubeIframeAPIReady=function(){t.loaded=!0,t.done()};var n=document.createElement("script");n.type="text/javascript",n.src=this.src,document.body.appendChild(n)}},done:function(){for(delete window.onYouTubeIframeAPIReady;this.listeners.length;)this.listeners.pop()(window.YT)}}},e.prototype._iframeMediaTracker=function(){var e=this;setInterval((function(){e._started&&e.recordEvent(pd.IFRAME,hd.TIME_WATCHED)}),3e3),this._youTubeIframeLoader.load((function(t){e._iframePlayer=new t.Player(e._mediaElement.id,{events:{onStateChange:e._onPlayerStateChange.bind(e)}})}))},e.prototype._onPlayerStateChange=function(e){var t={0:hd.ENDED,1:hd.PLAY,2:hd.PAUSE}[e.data];t&&this.eventActionMapping[t](pd.IFRAME)},e.prototype._html5MediaTracker=function(){var e=this;setInterval((function(){e._started&&e.recordEvent(pd.VIDEO,hd.TIME_WATCHED)}),3e3),this._mediaElement.addEventListener(ld.PLAY,(function(){e.eventActionMapping[hd.PLAY](pd.VIDEO)}),!1),this._mediaElement.addEventListener(ld.PAUSE,(function(){e.eventActionMapping[hd.PAUSE](pd.VIDEO)}),!1),this._mediaElement.addEventListener(ld.ENDED,(function(){e.eventActionMapping[hd.ENDED](pd.VIDEO)}),!1)},e.prototype.playEventAction=function(e){this._started=!0,this.recordEvent(e,hd.PLAY)},e.prototype.pauseEventAction=function(e){this._started=!1,this.recordEvent(e,hd.PAUSE)},e.prototype.endedEventAction=function(e){this._started=!1,this.recordEvent(e,hd.ENDED)},e.prototype.recordEvent=function(e,t){var n=Object.assign({},this._params),r=n.eventData;r.eventType=t,e===pd.VIDEO?(r.properties.timestamp=this._mediaElement.currentTime,r.properties.duration=this._mediaElement.duration):(r.properties.timestamp=this._financial(this._iframePlayer.getCurrentTime()),r.properties.duration=this._financial(this._iframePlayer.getDuration()));var i=parseFloat(r.properties.timestamp)/parseFloat(r.properties.duration);r.properties.eventValue=Number(i.toFixed(4)),delete r.properties.domElementId,this._provider.putToBuffer(n)},e.prototype._financial=function(e){return Number.parseFloat(e).toFixed(4)},e}(),Ud=n(49),Fd=n.n(Ud),Bd=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))},qd=function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},Kd=new r.ConsoleLogger("AmazonPersonalizeProvider"),Vd=function(){function e(e){this._buffer=[],this._config=e||{},this._config.flushSize=this._config.flushSize>0&&this._config.flushSize<=10?this._config.flushSize:5,this._config.flushInterval=this._config.flushInterval||5e3,this._sessionManager=new Dd,Td()(this._config.trackingId)||(this._sessionInfo=this._sessionManager.retrieveSessionInfo(this._config.trackingId)),this._isBrowser=r.JS.browserOrNode().isBrowser,this._setupTimer()}return e.prototype._setupTimer=function(){this._timer&&clearInterval(this._timer);var e=this._config.flushInterval,t=this;this._timer=setInterval((function(){t._sendFromBuffer()}),e)},e.prototype.record=function(e){return Bd(this,void 0,void 0,(function(){var t,n,r,i,o;return qd(this,(function(s){switch(s.label){case 0:return[4,this._getCredentials()];case 1:return(t=s.sent())?(Object.assign(e,{config:this._config,credentials:t,sentAt:new Date}),n=e.event,r=n.eventType,i=n.properties,"Identify"===r?(this._sessionManager.updateSessionInfo(i&&i.userId?i.userId:"",this._sessionInfo),[2]):(Td()(e.event.userId)||this._sessionManager.updateSessionInfo(e.event.userId,this._sessionInfo),o=this.generateRequestParams(e,this._sessionInfo),"MediaAutoTrack"!==r?[3,7]:this._isBrowser?Td()(Fd()(o,"eventData.properties.domElementId",null))?[3,3]:[4,this.isElementFullyLoaded(this.loadElement,o.eventData.properties.domElementId,500,5)]:[3,5])):[2,Promise.resolve(!1)];case 2:return s.sent()?new zd(o,this):Kd.debug("Cannot find the media element."),[3,4];case 3:Kd.debug("Missing domElementId field in 'properties' for MediaAutoTrack event type."),s.label=4;case 4:return[3,6];case 5:Kd.debug("MediaAutoTrack only for browser"),s.label=6;case 6:return[2];case 7:return[2,this.putToBuffer(o)]}}))}))},e.prototype.loadElement=function(e){return new Promise((function(t,n){return document.getElementById(e)&&document.getElementById(e).clientHeight?t(!0):n(!0)}))},e.prototype.isElementFullyLoaded=function(e,t,n,r){var i=this;return new Promise((function(o,s){return e(t).then(o).catch((function(a){return r-1>0?(u=n,new Promise((function(e){return setTimeout(e,u)}))).then(i.isElementFullyLoaded.bind(null,e,t,n,r-1)).then(o).catch(s):s(a);var u}))}))},e.prototype.getCategory=function(){return"Analytics"},e.prototype.getProviderName=function(){return"AmazonPersonalize"},e.prototype.configure=function(e){Kd.debug("configure Analytics",e);var t=e||{};return this._config=Object.assign({},this._config,t),Td()(this._config.trackingId)||(this._sessionInfo=this._sessionManager.retrieveSessionInfo(this._config.trackingId)),this._setupTimer(),this._config},e.prototype.generateRequestParams=function(e,t){var n={},r=e.event,i=r.eventType,o=r.properties;return n.eventData={eventType:i,properties:o},n.sessionInfo=t,n.sentAt=e.sentAt,n.credentials=e.credentials,n.config=e.config,n},e.prototype._sendEvents=function(e){var t=e.length;if(0!==t){var n=e[0],r=n.config,i=n.credentials,o=n.sessionInfo;if(!this._init(r,i))return!1;if(t>0){for(var s=[],a=0;a<t;a+=1){var u=e.shift(),c=this._generateSingleRecordPayload(u,o);s.push(c)}var f={};f.trackingId=o.trackingId,f.sessionId=o.sessionId,f.userId=o.userId,f.eventList=[],s.forEach((function(e){f.eventList.push(e)}));var d=new Ed(f);this._personalize.send(d,(function(e){e?Kd.debug("Failed to call putEvents in Personalize",e):Kd.debug("Put events")}))}}else Kd.debug("events array is empty, directly return")},e.prototype.putToBuffer=function(e){return this._buffer.length<this._config.flushSize?this._buffer.push(e):(this._buffer.push(e),this._sendFromBuffer()),Promise.resolve(!0)},e.prototype._sendFromBuffer=function(){var e=this,t=this._buffer.length;if(!(t<=0)){for(var n=[],r=null,i=[],o=0;o<t;o+=1){var s=this._buffer.shift(),a=s.credentials,u=s.sessionInfo;0===o?(i.push(s),r=a):Nd()(u,this._sessionInfo)&&a.sessionToken===r.sessionToken&&a.identityId===r.identityId?(Kd.debug("no change for cred, put event in the same group"),i.push(s)):(n.push(i),(i=[]).push(s),r=a,this._sessionInfo=u)}n.push(i),n.map((function(t){e._sendEvents(t)}))}},e.prototype._generateSingleRecordPayload=function(e,t){var n=e.eventData,r=e.sentAt,i={};return i.sentAt=r,i.properties=n.properties&&JSON.stringify(n.properties),i.eventId=this._sessionManager.getTimerKey()+t.sessionId,i.eventType=n.eventType,i},e.prototype._init=function(e,t){if(Kd.debug("init clients"),this._personalize&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return Kd.debug("no change for analytics config, directly return from init"),!0;this._config.credentials=t;var n=e.region;return Kd.debug("initialize personalize with credentials",t),this._personalize=new jd({region:n,credentials:t,customUserAgent:Object(r.getAmplifyUserAgent)()}),!0},e.prototype._getCredentials=function(){var e=this;return r.Credentials.get().then((function(t){return t?(Kd.debug("set credentials for analytics",e._config.credentials),r.Credentials.shear(t)):null})).catch((function(e){return Kd.debug("ensure credentials error",e),null}))},e}();t.default=Mo},function(e,t,n){"use strict";n.r(t),n.d(t,"fromUtf8",(function(){return r})),n.d(t,"toUtf8",(function(){return i}));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 i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(i>>6|192,63&i|128);else if(n+1<e.length&&55296==(64512&i)&&56320==(64512&e.charCodeAt(n+1))){var o=65536+((1023&i)<<10)+(1023&e.charCodeAt(++n));t.push(o>>18|240,o>>12&63|128,o>>6&63|128,63&o|128)}else t.push(i>>12|224,i>>6&63|128,63&i|128)}return Uint8Array.from(t)}(e)},i=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 i=e[n];if(i<128)t+=String.fromCharCode(i);else if(192<=i&&i<224){var o=e[++n];t+=String.fromCharCode((31&i)<<6|63&o)}else if(240<=i&&i<365){var s="%"+[i,e[++n],e[++n],e[++n]].map((function(e){return e.toString(16)})).join("%");t+=decodeURIComponent(s)}else t+=String.fromCharCode((15&i)<<12|(63&e[++n])<<6|63&e[++n])}return t}(e)}}])}));
  //# sourceMappingURL=aws-amplify-analytics.min.js.map