UNPKG

298 kBJavaScriptView Raw
1!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=149)}([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 l})),n.d(t,"__createBinding",(function(){return d})),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 I}));
2/*! *****************************************************************************
3Copyright (c) Microsoft Corporation.
4
5Permission to use, copy, modify, and/or distribute this software for any
6purpose with or without fee is hereby granted.
7
8THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14PERFORMANCE OF THIS SOFTWARE.
15***************************************************************************** */
16var 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 l(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 d(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 I(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){"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){var r=n(53),i=n(54),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){var r=n(38),i=n(40),o=n(41),s=n(7),a=n(42),u=n(24),c=n(39),f=n(25),l=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(l.call(e,n))return!1;return!0}},function(e,t,n){var r=n(33),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,(0,n(0).__exportStar)(n(55),t);var r=n(28);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var i=n(30);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(88),i=n(91);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(14),i=n(80),o=n(81),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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AwsCrc32=t.Crc32=t.crc32=void 0;var r=n(0),i=n(13);t.crc32=function(e){return(new o).update(e).digest()};var o=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var i=(0,r.__values)(e),o=i.next();!o.done;o=i.next()){var a=o.value;this.checksum=this.checksum>>>8^s[255&(this.checksum^a)]}}catch(e){t={error:e}}finally{try{o&&!o.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=o;var s=(0,i.uint32ArrayFrom)([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]),a=n(76);Object.defineProperty(t,"AwsCrc32",{enumerable:!0,get:function(){return a.AwsCrc32}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=t.numToUint8=t.isEmptyData=t.convertToBuffer=void 0;var r=n(57);Object.defineProperty(t,"convertToBuffer",{enumerable:!0,get:function(){return r.convertToBuffer}});var i=n(62);Object.defineProperty(t,"isEmptyData",{enumerable:!0,get:function(){return i.isEmptyData}});var o=n(63);Object.defineProperty(t,"numToUint8",{enumerable:!0,get:function(){return o.numToUint8}});var s=n(64);Object.defineProperty(t,"uint32ArrayFrom",{enumerable:!0,get:function(){return s.uint32ArrayFrom}})},function(e,t,n){var r=n(5).Symbol;e.exports=r},function(e,t,n){var r=n(8)(Object,"create");e.exports=r},function(e,t,n){var r=n(96),i=n(97),o=n(98),s=n(99),a=n(100);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(37);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(102);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(121);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(10),i=n(11);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){var r=n(85),i=n(101),o=n(103),s=n(104),a=n(105);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(8)(n(5),"Map");e.exports=r},function(e,t,n){(function(e){var r=n(5),i=n(117),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(44)(e))},function(e,t,n){var r=n(118),i=n(119),o=n(120),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(56),i=n(29),o=n(2),s=n(20),a=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=(0,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(0,s.locateWindow)().msCrypto.subtle.sign(i.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve((0,s.locateWindow)().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;(0,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?(0,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.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(13),i=n(29),o=n(20),s=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){(0,o.locateWindow)().crypto.subtle.importKey("raw",(0,r.convertToBuffer)(e),i.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!(0,r.isEmptyData)(e)){var t=(0,r.convertToBuffer)(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(0,o.locateWindow)().crypto.subtle.sign(i.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):(0,r.isEmptyData)(this.toHash)?Promise.resolve(i.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return(0,o.locateWindow)().crypto.subtle.digest(i.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();t.Sha256=s},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){"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(31))},function(e,t,n){var r=n(10),i=n(35);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(39),i=n(110),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(112),i=n(23),o=n(113),s=n(114),a=n(115),u=n(10),c=n(36),f=c(r),l=c(i),d=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 l:return"[object Map]";case d: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(116),i=n(11),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(34),i=n(43);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(129),i=n(132),o=n(133);e.exports=function(e,t,n,s,a,u){var c=1&n,f=e.length,l=t.length;if(f!=l&&!(c&&l>f))return!1;var d=u.get(e),p=u.get(t);if(d&&p)return d==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){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 l=this.satisfies(n[f]);if(void 0!==l)return l}}if(o>0){var d=Object.keys(i),p=a.default.find(d,(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(77);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(26),s=n(27),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,f=t||[],l=(e=e||{}).node||r,d=void 0!==e.clockseq?e.clockseq:i;if(null==l||null==d){var p=o();null==l&&(l=r=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=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&&(d=d+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=d;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++]=d>>>8|128,f[c++]=255&d;for(var b=0;b<6;++b)f[c+b]=l[b];return t||s(f)}},function(e,t,n){var r=n(26),i=n(27);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(28),i=n(30),o=n(65),s=n(68),a=n(70),u=n(20),c=function(){function e(e){(0,s.supportsWebCrypto)((0,u.locateWindow)())?this.hash=new i.Sha256(e):(0,a.isMsWindow)((0,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}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.convertToBuffer=void 0;var r=n(150),i=void 0!==e&&e.from?function(t){return e.from(t,"utf8")}:r.fromUtf8;t.convertToBuffer=function(e){return e instanceof Uint8Array?e:"string"==typeof e?i(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}).call(this,n(58).Buffer)},function(e,t,n){"use strict";(function(e){
17/*!
18 * The buffer module from node.js, for the browser.
19 *
20 * @author Feross Aboukhadijeh <http://feross.org>
21 * @license MIT
22 */
23var r=n(59),i=n(60),o=n(61);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=d(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),i=(e=a(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|p(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):d(e,t);if("Buffer"===t.type&&o(t.data))return d(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function l(e,t){if(f(t),e=a(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|p(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function h(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return B(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return L(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(o=n;o<a;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var l=!0,d=0;d<u;d++)if(c(e,o+d)!==c(t,d)){l=!1;break}if(l)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function w(e,t,n,r){return q(B(t,e.length-n),e,n,r)}function _(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return _(e,t,n,r)}function E(e,t,n,r){return q(F(t),e,n,r)}function A(e,t,n,r){return q(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function O(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return f(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return l(null,e)},u.allocUnsafeSlow=function(e){return l(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!u.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):v.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),c=this.slice(r,i),f=e.slice(t,n),l=0;l<a;++l)if(c[l]!==f[l]){o=c[l],s=f[l];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return m(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return m(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return _(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function k(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function M(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=z(e[o]);return i}function P(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function x(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function T(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function C(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,o){return o||C(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||C(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||x(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||x(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||x(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||x(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||x(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||x(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||x(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||x(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||x(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||x(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||R(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);R(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):T(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):T(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=u.isBuffer(e)?e:B(new u(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var U=/[^+\/0-9A-Za-z-_]/g;function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(31))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),s=r[0],a=r[1],u=new o(function(e,t,n){return 3*(t+n)/4-n}(0,s,a)),f=0,l=a>0?s-4:s;for(n=0;n<l;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;2===a&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[f++]=255&t);1===a&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;s<a;s+=16383)o.push(f(e,s,s+16383>a?a:s+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)r[a]=s[a],i[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function f(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
24/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
25t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,c=u>>1,f=-7,l=n?i-1:0,d=n?-1:1,p=e[t+l];for(l+=d,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=d,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+e[t+l],l+=d,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&a,p+=h,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+p]=255&s,p+=h,s/=256,c-=8);e[n+p-h]|=128*v}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numToUint8=void 0,t.numToUint8=function(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uint32ArrayFrom=void 0,t.uint32ArrayFrom=function(e){if(!Array.from){for(var t=new Uint32Array(e.length);0<e.length;)t[0]=e[0];return t}return Uint32Array.from(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),(0,n(0).__exportStar)(n(66),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(0),i=n(32),o=n(67),s=n(13),a=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=(0,s.convertToBuffer)(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!(0,s.isEmptyData)(e)&&!this.error)try{this.hash.update((0,s.convertToBuffer)(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,this.digestSync()]}))}))},e}();t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(32),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],l=0;l<r.BLOCK_SIZE;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var d=this.temp[l-2],p=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(p+this.temp[l-7]|0)+(h+this.temp[l-16]|0)}var v=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(f+(r.KEY[l]+this.temp[l]|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(69),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(71),t),r.__exportStar(n(72),t),r.__exportStar(n(73),t),r.__exportStar(n(74),t),r.__exportStar(n(75),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){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AwsCrc32=void 0;var r=n(0),i=n(13),o=n(12),s=function(){function e(){this.crc32=new o.Crc32}return e.prototype.update=function(e){(0,i.isEmptyData)(e)||this.crc32.update((0,i.convertToBuffer)(e))},e.prototype.digest=function(){return(0,r.__awaiter)(this,void 0,void 0,(function(){return(0,r.__generator)(this,(function(e){return[2,(0,i.numToUint8)(this.crc32.digest())]}))}))},e}();t.AwsCrc32=s},function(e,t,n){var r=n(78),i=n(109);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(7),i=n(79),o=n(82),s=n(106);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(s(e))}},function(e,t,n){var r=n(7),i=n(21),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,n){var r=n(14),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(83),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(84);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(22);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(86),i=n(16),o=n(23);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(87),i=n(92),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(15);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t,n){var r=n(34),i=n(89),o=n(35),s=n(36),a=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,f=u.toString,l=c.hasOwnProperty,d=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?d:a).test(s(e))}},function(e,t,n){var r,i=n(90),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(5)["__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(15),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(15),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(15);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(17),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(17);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(17);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(17);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(18);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(18);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(18);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(18);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(107);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(14),i=n(108),o=n(7),s=n(21),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(21);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(111)(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(8)(n(5),"DataView");e.exports=r},function(e,t,n){var r=n(8)(n(5),"Promise");e.exports=r},function(e,t,n){var r=n(8)(n(5),"Set");e.exports=r},function(e,t,n){var r=n(8)(n(5),"WeakMap");e.exports=r},function(e,t,n){var r=n(10),i=n(11);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(10),i=n(43),o=n(11),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(33),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(44)(e))},function(e,t,n){var r=n(122),i=n(11);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(123),i=n(45),o=n(134),s=n(138),a=n(40),u=n(7),c=n(24),f=n(25),l="[object Object]",d=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?l:y)==l,_=(b="[object Arguments]"==b?l:b)==l,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&&d.call(e,"__wrapped__"),A=_&&d.call(t,"__wrapped__");if(E||A){var O=E?e.value():e,I=A?t.value():t;return v||(v=new r),h(O,I,n,p,v)}}return!!S&&(v||(v=new r),s(e,t,n,p,h,v))}},function(e,t,n){var r=n(16),i=n(124),o=n(125),s=n(126),a=n(127),u=n(128);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(16);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(16),i=n(23),o=n(22);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(22),i=n(130),o=n(131);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(14),i=n(135),o=n(37),s=n(45),a=n(136),u=n(137),c=r?r.prototype:void 0,f=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,l,d){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||!l(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=d.get(e);if(v)return v==t;r|=2,d.set(e,t);var g=s(p(e),p(t),r,c,l,d);return d.delete(e),g;case"[object Symbol]":if(f)return f.call(e)==f.call(t)}return!1}},function(e,t,n){var r=n(5).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(139),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 l=f;l--;){var d=c[l];if(!(u?d in t:i.call(t,d)))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;++l<f;){var m=e[d=c[l]],y=t[d];if(o)var b=u?o(y,m,d,t,e,a):o(m,y,d,e,t,a);if(!(void 0===b?m===y||s(m,y,n,o,a):b)){v=!1;break}g||(g="constructor"==d)}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(140),i=n(142),o=n(145);e.exports=function(e){return r(e,o,i)}},function(e,t,n){var r=n(141),i=n(7);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(143),i=n(144),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(146),i=n(38),o=n(42);e.exports=function(e){return o(e)?r(e):i(e)}},function(e,t,n){var r=n(147),i=n(41),o=n(7),s=n(24),a=n(148),u=n(25),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),f=!n&&i(e),l=!n&&!f&&s(e),d=!n&&!f&&!l&&u(e),p=n||f||l||d,h=p?r(e.length,String):[],v=h.length;for(var g in e)!t&&!c.call(e,g)||p&&("length"==g||l&&("offset"==g||"parent"==g)||d&&("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 ko})),n.d(t,"AWSPinpointProvider",(function(){return Ni})),n.d(t,"AWSKinesisProvider",(function(){return bu})),n.d(t,"AWSKinesisFirehoseProvider",(function(){return Jf})),n.d(t,"AmazonPersonalizeProvider",(function(){return Kl}));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)};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,l,d,p,h,v,g,m,y,b,w,_,S,E,A,O,I,L,k,M,P,x,R,T,j,C,D,N,U,z,B,F,q,K,V,H,G,$,W,Y,Z,J,Q,X,ee,te,ne,re,ie,oe,se,ae,ue,ce,fe,le,de,pe,he,ve,ge,me,ye,be,we,_e,Se,Ee,Ae,Oe,Ie,Le,ke,Me,Pe,xe,Re,Te,je,Ce,De,Ne,Ue,ze,Be,Fe,qe,Ke,Ve,He,Ge,$e,We,Ye,Ze,Je,Qe,Xe,et,tt,nt,rt,it,ot,st,at,ut,ct,ft,lt,dt,pt,ht,vt,gt,mt,yt,bt,wt,_t,St,Et,At,Ot,It,Lt,kt,Mt,Pt,xt,Rt;Object.create;(f||(f={})).filterSensitiveLog=function(e){return s({},e)},(l||(l={})).filterSensitiveLog=function(e){return s({},e)},(d||(d={})).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)},(I||(I={})).filterSensitiveLog=function(e){return s({},e)},(L||(L={})).filterSensitiveLog=function(e){return s({},e)},(k||(k={})).filterSensitiveLog=function(e){return s({},e)},(M||(M={})).filterSensitiveLog=function(e){return s({},e)},(P||(P={})).filterSensitiveLog=function(e){return s({},e)},(x||(x={})).filterSensitiveLog=function(e){return s({},e)},(R||(R={})).filterSensitiveLog=function(e){return s({},e)},(T||(T={})).filterSensitiveLog=function(e){return s({},e)},(j||(j={})).filterSensitiveLog=function(e){return s({},e)},(C||(C={})).filterSensitiveLog=function(e){return s({},e)},(D||(D={})).filterSensitiveLog=function(e){return s({},e)},(N||(N={})).filterSensitiveLog=function(e){return s({},e)},(U||(U={})).filterSensitiveLog=function(e){return s({},e)},(z||(z={})).filterSensitiveLog=function(e){return s({},e)},(B||(B={})).filterSensitiveLog=function(e){return s({},e)},(F||(F={})).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)},(Y||(Y={})).filterSensitiveLog=function(e){return s({},e)},(Z||(Z={})).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)},(le||(le={})).filterSensitiveLog=function(e){return s({},e)},(de||(de={})).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)},(Ie||(Ie={})).filterSensitiveLog=function(e){return s({},e)},(Le||(Le={})).filterSensitiveLog=function(e){return s({},e)},(ke||(ke={})).filterSensitiveLog=function(e){return s({},e)},(Me||(Me={})).filterSensitiveLog=function(e){return s({},e)},(Pe||(Pe={})).filterSensitiveLog=function(e){return s({},e)},(xe||(xe={})).filterSensitiveLog=function(e){return s({},e)},(Re||(Re={})).filterSensitiveLog=function(e){return s({},e)},(Te||(Te={})).filterSensitiveLog=function(e){return s({},e)},(je||(je={})).filterSensitiveLog=function(e){return s({},e)},(Ce||(Ce={})).filterSensitiveLog=function(e){return s({},e)},(De||(De={})).filterSensitiveLog=function(e){return s({},e)},(Ne||(Ne={})).filterSensitiveLog=function(e){return s({},e)},(Ue||(Ue={})).filterSensitiveLog=function(e){return s({},e)},(ze||(ze={})).filterSensitiveLog=function(e){return s({},e)},(Be||(Be={})).filterSensitiveLog=function(e){return s({},e)},(Fe||(Fe={})).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)},(Ye||(Ye={})).filterSensitiveLog=function(e){return s({},e)},(Ze||(Ze={})).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)},(lt||(lt={})).filterSensitiveLog=function(e){return s({},e)},(dt||(dt={})).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)},(It||(It={})).filterSensitiveLog=function(e){return s({},e)},(Lt||(Lt={})).filterSensitiveLog=function(e){return s({},e)},(kt||(kt={})).filterSensitiveLog=function(e){return s({},e)},(Mt||(Mt={})).filterSensitiveLog=function(e){return s({},e)},(Pt||(Pt={})).filterSensitiveLog=function(e){return s({},e)},(xt||(xt={})).filterSensitiveLog=function(e){return s({},e)},(Rt||(Rt={})).filterSensitiveLog=function(e){return s({},e)};var Tt=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}(),jt=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(jt.__assign)(Object(jt.__assign)({},this),{headers:Object(jt.__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(jt.__assign)(Object(jt.__assign)({},e),((r={})[n]=Array.isArray(i)?Object(jt.__spread)(i):i,r))}),{}))),n},e}();var Dt=function(){var e=[],t=[],n=new Set,r=function(n){return e.forEach((function(e){n.add(e.middleware,Object(jt.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(jt.__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(jt.__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(jt.__spread)(i(e)))})),t},o=function(){var n,r=[],o=[],s={};return e.forEach((function(e){var t=Object(jt.__assign)(Object(jt.__assign)({},e),{before:[],after:[]});t.name&&(s[t.name]=t),r.push(t)})),t.forEach((function(e){var t=Object(jt.__assign)(Object(jt.__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 Nt[t.step]-Nt[e.step]||Ut[t.priority||"normal"]-Ut[e.priority||"normal"]}))).map(i).reduce((function(e,t){return e.push.apply(e,Object(jt.__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(jt.__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(jt.__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(Dt())},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(Dt());return t.use(e),t},applyToStack:r,resolve:function(e,t){var n,r;try{for(var i=Object(jt.__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},Nt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Ut={high:3,normal:2,low:1},zt=function(){function e(e){this.middlewareStack=Dt(),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}(),Bt=function(){this.middlewareStack=Dt()};function Ft(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(jt.__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(jt.__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,l,d,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,Yt(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 l=[{}],[4,Zt(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 10:return d=[{}],[4,Jt(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.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,l,d,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,Yt(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 l=[{}],[4,Zt(n,t)];case 9:return i=s.apply(void 0,[s.apply(void 0,l.concat([u.sent()])),{name:o,$metadata:bn(e)}]),[3,17];case 10:return d=[{}],[4,Jt(n,t)];case 11:return i=s.apply(void 0,[s.apply(void 0,d.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]}))}))},Yt=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]}))}))},Zt=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:ln(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:ln(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:dn(e.Endpoint,t)}),void 0!==e.Events&&null!==e.Events&&{Events:cn(e.Events,t)})}(a,t),r))}),{})},ln=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))}),{})},dn=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:ln(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(jt.__awaiter)(void 0,void 0,void 0,(function(){var i,o;return Object(jt.__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(jt.__awaiter)(void 0,void 0,void 0,(function(){var i;return Object(jt.__generator)(this,(function(o){switch(o.label){case 0:return[4,t(r.input,e)];case 1:return i=o.sent(),[2,n(Object(jt.__assign)(Object(jt.__assign)({},r),{request:i}))]}}))}))}}}(e,t),An)}}}var In=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,l;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}",Ft(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,l=s.port,[2,new Ct({protocol:f,hostname:a,port:l,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}(Bt),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,l;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}",Ft(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}",Ft(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,l=s.port,[2,new Ct({protocol:f,hostname:a,port:l,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}(Bt),kn=n(47),Mn=n(6),Pn=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,xn)},xn=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};for(var Rn=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(jt.__values)(Object.keys(e).sort()),o=i.next();!o.done;o=i.next()){var s=o.value,a=e[s];if(s=Pn(s),Array.isArray(a))for(var u=0,c=a.length;u<c;u++)r.push(s+"="+Pn(a[u]));else{var f=s;(a||"string"==typeof a)&&(f+="="+Pn(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 l,d=new Request(c,f),p=[fetch(d).then((function(e){var t,n,r=e.headers,i={};try{for(var o=Object(jt.__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 Tt({headers:i,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new Tt({headers:i,statusCode:e.status,body:t})}}))})),(l=r,void 0===l&&(l=0),new Promise((function(e,t){l&&setTimeout((function(){var e=new Error("Request did not complete within "+l+" ms");e.name="TimeoutError",t(e)}),l)})))];return n&&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}(),Tn={},jn=new Array(64),Cn=0,Dn="A".charCodeAt(0),Nn="Z".charCodeAt(0);Cn+Dn<=Nn;Cn++){var Un=String.fromCharCode(Cn+Dn);Tn[Un]=Cn,jn[Cn]=Un}for(Cn=0,Dn="a".charCodeAt(0),Nn="z".charCodeAt(0);Cn+Dn<=Nn;Cn++){Un=String.fromCharCode(Cn+Dn);var zn=Cn+26;Tn[Un]=zn,jn[zn]=Un}for(Cn=0;Cn<10;Cn++){Tn[Cn.toString(10)]=Cn+52;Un=Cn.toString(10),zn=Cn+52;Tn[Un]=zn,jn[zn]=Un}Tn["+"]=62,jn[62]="+",Tn["/"]=63,jn[63]="/";function Bn(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|=Tn[e[a]]<<6*(u-a),s+=6):o>>=6;var c=i/4*3;o>>=s%8;for(var f=Math.floor(s/8),l=0;l<f;l++){var d=8*(f-l-1);r.setUint8(c+l,(o&255<<d)>>d)}}return new Uint8Array(n)}function Fn(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+=jn[(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(jt.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(jt.__generator)(this,(function(r){switch(r.label){case 0:return[4,Kn(e)];case 1:return t=r.sent(),n=Bn(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(jt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return Object(jt.__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(jt.__awaiter)(void 0,void 0,void 0,(function(){var i;return Object(jt.__generator)(this,(function(o){return(null===(i=null==e?void 0:e.retryStrategy)||void 0===i?void 0:i.mode)&&(n.userAgent=Object(jt.__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"],Yn=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],Zn=[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(3),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 Yn.includes(e.name)||Zn.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(jt.__awaiter)(this,void 0,void 0,(function(){var e;return Object(jt.__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(jt.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return Object(jt.__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,l,d;return Object(jt.__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 l=p.sent(),r++,u.shouldRetry(l,r,o)?(n=u.retryQuota.retrieveRetryTokens(l),d=u.delayDecider(Jn(l)?500:100,r),i+=d,[4,new Promise((function(e){return setTimeout(e,d)}))]):[3,4];case 3:return p.sent(),[2,"continue"];case 4:throw l.$metadata||(l.$metadata={}),l.$metadata.attempts=r,l.$metadata.totalRetryDelay=i,l;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(jt.__assign)(Object(jt.__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(46),sr=n.n(or),ar=function(e){var t=e.serviceId,n=e.clientVersion;return function(){return Object(jt.__awaiter)(void 0,void 0,void 0,(function(){var e,r,i,o,s,a,u,c,f;return Object(jt.__generator)(this,(function(l){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]}))}))}},ur=n(2),cr=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"]),fr=new Set(["cn-north-1","cn-northwest-1"]),lr=new Set(["us-iso-east-1"]),dr=new Set(["us-isob-east-1"]),pr=new Set(["us-gov-east-1","us-gov-west-1"]);var hr=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(jt.__values)(e.split("&")),o=i.next();!o.done;o=i.next()){var s=o.value,a=Object(jt.__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}},vr={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:cr.has(e)&&(n={hostname:"pinpoint.{region}.amazonaws.com".replace("{region}",e),partition:"aws",signingService:"mobiletargeting"}),fr.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"}),dr.has(e)&&(n={hostname:"pinpoint.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),pr.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:hr},gr=s(s({},vr),{runtime:"browser",base64Decoder:Bn,base64Encoder:Fn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:vr.serviceId,clientVersion:kn.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new Rn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur.fromUtf8,utf8Encoder:ur.toUtf8}),mr=function(e){var t;return Object(jt.__assign)(Object(jt.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?yr(e):function(){return br(e)},isCustomEndpoint:!!e.endpoint})},yr=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},br=function(e){return Object(jt.__awaiter)(void 0,void 0,void 0,(function(){var t,n,r,i,o;return Object(jt.__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)]}}))}))},wr=function(e){if(!e.region)throw new Error("Region is missing");return Object(jt.__assign)(Object(jt.__assign)({},e),{region:_r(e.region)})},_r=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};var Sr={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Er=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(jt.__awaiter)(t,void 0,void 0,(function(){var t,i,o,s,a;return Object(jt.__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(jt.__assign)(Object(jt.__assign)({},t.headers),((a={})["content-length"]=String(s),a)))),[2,n(Object(jt.__assign)(Object(jt.__assign)({},r),{request:t}))]}))}))}}}(e.bodyLengthChecker),Sr)}}};for(var Ar={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Or=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(jt.__awaiter)(void 0,void 0,void 0,(function(){var r,i;return Object(jt.__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),Ar)}}},Ir={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Lr=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(jt.__awaiter)(void 0,void 0,void 0,(function(){var r,i,o,s,a,u,c,f,l;return Object(jt.__generator)(this,(function(d){switch(d.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=d.sent(),s?("function"==typeof s.info&&(c=u.output,f=c.$metadata,l=Object(jt.__rest)(c,["$metadata"]),s.info({clientName:r,commandName:i,input:o(n.input),output:a(l),metadata:f})),[2,u]):[2,u]}}))}))}}),Ir)}}},kr={},Mr={},Pr=0;Pr<256;Pr++){var xr=Pr.toString(16).toLowerCase();1===xr.length&&(xr="0"+xr),kr[Pr]=xr,Mr[xr]=Pr}function Rr(e){for(var t="",n=0;n<e.byteLength;n++)t+=kr[e[n]];return t}var Tr="X-Amz-Date".toLowerCase(),jr=["authorization",Tr,"date"],Cr="X-Amz-Signature".toLowerCase(),Dr="X-Amz-Security-Token".toLowerCase(),Nr={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-/,zr=/^sec-/,Br="AWS4-HMAC-SHA256-PAYLOAD",Fr={},qr=[];function Kr(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}function Vr(e,t,n){var r=new e(t);return r.update(n),r.digest()}function Hr(e,t,n){var r,i,o=e.headers,s={};try{for(var a=Object(jt.__values)(Object.keys(o).sort()),u=a.next();!u.done;u=a.next()){var c=u.value,f=c.toLowerCase();(f in Nr||(null==t?void 0:t.has(f))||Ur.test(f)||zr.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 Gr=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,$r)},$r=function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()};function Wr(e,t){var n=e.headers,r=e.body;return Object(jt.__awaiter)(this,void 0,void 0,(function(){var e,i,o,s,a,u,c;return Object(jt.__generator)(this,(function(f){switch(f.label){case 0:try{for(e=Object(jt.__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)||(l=r,"function"==typeof ArrayBuffer&&l instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(l))?((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 l}))}))}function Yr(e){var t=e.headers,n=e.query,r=Object(jt.__rest)(e,["headers","query"]);return Object(jt.__assign)(Object(jt.__assign)({},r),{headers:Object(jt.__assign)({},t),query:n?Zr(n):void 0})}function Zr(e){return Object.keys(e).reduce((function(t,n){var r,i=e[n];return Object(jt.__assign)(Object(jt.__assign)({},t),((r={})[n]=Array.isArray(i)?Object(jt.__spread)(i):i,r))}),{})}function Jr(e){var t,n;e="function"==typeof e.clone?e.clone():Yr(e);try{for(var r=Object(jt.__values)(Object.keys(e.headers)),i=r.next();!i.done;i=r.next()){var o=i.value;jr.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 Qr(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 Xr=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=ni(r),this.credentialProvider=ri(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(jt.__awaiter)(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,p,h,v,g,m,y,b,w,_,S,E,A,O;return Object(jt.__generator)(this,(function(I){switch(I.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 l=I.sent(),null==c?[3,2]:(p=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:p=I.sent(),I.label=4;case 4:return d=p,h=ei(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=Kr(g,d,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(jt.__values)(Object.keys(s)),f=c.next();!f.done;f=c.next()){var l=f.value,d=l.toLowerCase();"x-amz-"!==d.substr(0,6)||(null===(i=t.unhoistableHeaders)||void 0===i?void 0:i.has(d))||(u[l]=s[l],delete s[l])}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return Object(jt.__assign)(Object(jt.__assign)({},e),{headers:s,query:u})}(Jr(e),{unhoistableHeaders:a}),l.sessionToken&&(y.query["X-Amz-Security-Token"]=l.sessionToken),y.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",y.query["X-Amz-Credential"]=l.accessKeyId+"/"+m,y.query["X-Amz-Date"]=v,y.query["X-Amz-Expires"]=o.toString(10),b=Hr(y,s,u),y.query["X-Amz-SignedHeaders"]=ti(b),w=y.query,_="X-Amz-Signature",S=this.getSignature,E=[v,m,this.getSigningKey(l,d,g,f)],A=this.createCanonicalRequest,O=[y,b],[4,Wr(e,this.sha256)]);case 5:return[4,S.apply(this,E.concat([A.apply(this,O.concat([I.sent()]))]))];case 6:return w[_]=I.sent(),[2,y]}}))}))},e.prototype.sign=function(e,t){return Object(jt.__awaiter)(this,void 0,void 0,(function(){return Object(jt.__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(jt.__awaiter)(this,void 0,void 0,(function(){var e,t,i,c,f,l,d,p,h,v,g;return Object(jt.__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=ei(o),c=i.shortDate,f=i.longDate,l=Kr(c,e,null!=u?u:this.service),[4,Wr({headers:{},body:r},this.sha256)];case 4:return d=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,l,s,h,d].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(jt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,a,u,c,f,l;return Object(jt.__generator)(this,(function(d){switch(d.label){case 0:return[4,this.credentialProvider()];case 1:return t=d.sent(),null==o?[3,2]:(r=o,[3,4]);case 2:return[4,this.regionProvider()];case 3:r=d.sent(),d.label=4;case 4:return n=r,a=ei(i).shortDate,f=(c=this.sha256).bind,[4,this.getSigningKey(t,n,a,s)];case 5:return(u=new(f.apply(c,[void 0,d.sent()]))).update(e),l=Rr,[4,u.digest()];case 6:return[2,l.apply(void 0,[d.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,r=n.signingDate,i=void 0===r?new Date:r,o=n.signableHeaders,s=n.unsignableHeaders,a=n.signingRegion,u=n.signingService;return Object(jt.__awaiter)(this,void 0,void 0,(function(){var t,n,r,c,f,l,d,p,h,v,g;return Object(jt.__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=Jr(e),f=ei(i),l=f.longDate,d=f.shortDate,p=Kr(d,n,null!=u?u:this.service),c.headers[Tr]=l,t.sessionToken&&(c.headers[Dr]=t.sessionToken),[4,Wr(c,this.sha256)];case 5:return h=m.sent(),!function(e,t){var n,r;e=e.toLowerCase();try{for(var i=Object(jt.__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=Hr(c,s,o),[4,this.getSignature(l,p,this.getSigningKey(t,n,d,u),this.createCanonicalRequest(c,v,h))];case 6:return g=m.sent(),c.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+p+", SignedHeaders="+ti(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()===Cr)return"continue";o.push(e);var t=i[e];"string"==typeof t?s[e]=Gr(e)+"="+Gr(t):Array.isArray(t)&&(s[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Gr(e)+"="+Gr(n)])}),[]).join("&"))};try{for(var u=Object(jt.__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(jt.__awaiter)(this,void 0,void 0,(function(){var r,i;return Object(jt.__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(jt.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,u;return Object(jt.__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(jt.__awaiter)(void 0,void 0,void 0,(function(){var o,s,a,u,c,f,l,d,p;return Object(jt.__generator)(this,(function(h){switch(h.label){case 0:return[4,Vr(e,t.secretAccessKey,t.accessKeyId)];case 1:if(o=h.sent(),(s=n+":"+r+":"+i+":"+Rr(o)+":"+t.sessionToken)in Fr)return[2,Fr[s]];for(qr.push(s);qr.length>50;)delete Fr[qr.shift()];a="AWS4"+t.secretAccessKey,h.label=2;case 2:h.trys.push([2,7,8,9]),u=Object(jt.__values)([n,r,i,"aws4_request"]),c=u.next(),h.label=3;case 3:return c.done?[3,6]:(f=c.value,[4,Vr(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 l=h.sent(),d={error:l},[3,9];case 8:try{c&&!c.done&&(p=u.return)&&p.call(u)}finally{if(d)throw d.error}return[7];case 9:return[2,Fr[s]=a]}}))}))}(this.sha256,e,n,t,r||this.service)},e}(),ei=function(e){var t=Qr(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},ti=function(e){return Object.keys(e).sort().join(";")},ni=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},ri=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e};function ii(e){var t,n=this,r=oi(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?oi(e.signer):function(){return oi(e.region)().then((function(t){return Object(jt.__awaiter)(n,void 0,void 0,(function(){return Object(jt.__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(jt.__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 Xr({credentials:r,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:o})}))},Object(jt.__assign)(Object(jt.__assign)({},e),{systemClockOffset:a,signingEscapePath:o,credentials:r,signer:t})}function oi(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var si=function(e){return new Date(Date.now()+e)};function ai(e){return function(t,n){return function(r){return Object(jt.__awaiter)(this,void 0,void 0,(function(){var i,o,s,a,u,c,f,l,d;return Object(jt.__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(jt.__assign)({},r)],d={},[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,[jt.__assign.apply(void 0,u.concat([(d.request=p.sent(),d)]))])];case 5:return s=p.sent(),c=s.response.headers,(f=c&&(c.date||c.Date))&&(l=Date.parse(f),h=l,v=e.systemClockOffset,Math.abs(si(v).getTime()-h)>=3e5&&(e.systemClockOffset=l-Date.now())),[2,s]}var h,v}))}))}}}var ui={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware",override:!0},ci=function(e){return{applyToStack:function(t){t.addRelativeTo(ai(e),ui)}}};function fi(e){return Object(jt.__assign)(Object(jt.__assign)({},e),{customUserAgent:"string"==typeof e.customUserAgent?[[e.customUserAgent]]:e.customUserAgent})}var li=/[^\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,di=function(e){var t=Object(jt.__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("/")},pi={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},hi=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e,t){return function(r){return Object(jt.__awaiter)(void 0,void 0,void 0,(function(){var i,o,s,a,u,c,f,l;return Object(jt.__generator)(this,(function(d){switch(d.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(di))||[],[4,n.defaultUserAgentProvider()]):[2,e(r)];case 1:return a=d.sent().map(di),u=(null===(l=null==n?void 0:n.customUserAgent)||void 0===l?void 0:l.map(di))||[],o["x-amz-user-agent"]=Object(jt.__spread)(a,s,u).join(" "),c=Object(jt.__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(jt.__assign)(Object(jt.__assign)({},r),{request:i}))]}}))}))}}),pi)}}},vi=function(e){function t(t){var n=this,r=s(s({},gr),t),i=wr(r),o=ii(mr(i)),a=fi(nr(o));return(n=e.call(this,a)||this).config=a,n.middlewareStack.use(ci(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Er(n.config)),n.middlewareStack.use(Or(n.config)),n.middlewareStack.use(Lr(n.config)),n.middlewareStack.use(hi(n.config)),n}return o(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(zt),gi=n(9),mi=n.n(gi),yi=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())}))},bi=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])}}},wi=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},_i=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(wi(arguments[t]));return e},Si=new r.ConsoleLogger("EventsBuffer"),Ei=[429,500],Ai=[202],Oi=function(){function e(e,t){this._pause=!1,this._flush=!1,Si.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 Si.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 yi(this,void 0,void 0,(function(){var t,n,r,i,o;return bi(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 In(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,l=o.appId,d=o.endpointId,p=t.EventsRequest.BatchItem;t.ApplicationId=t.ApplicationId||l,p[d]||(p[d]={Endpoint:{},Events:{}}),p[d].Events[c]={EventType:s,Timestamp:new Date(i).toISOString(),Attributes:a,Metrics:u,Session:f}})),t},e.prototype._handlePutEventsFailure=function(e,t){Si.debug("_putEvents Failed: ",e);var n=e.$metadata&&e.$metadata.httpStatusCode;if(Ei.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=wi(e,2),i=n[0],o=n[1].EventsItemResponse;Object.entries(o).forEach((function(e){var n,o,s=wi(e,2),a=s[0],u=s[1],c=u.StatusCode,f=u.Message,l=t[a],d={EventsResponse:{Results:(n={},n[i]={EventsItemResponse:(o={},o[a]={StatusCode:c,Message:f},o)},n)}};if(Ai.includes(c))l.handlers.resolve(d);else{if(!Ei.includes(c)){var p=l.params.event.name;return Si.error("event "+a+" : "+p+" failed with error: "+f),l.handlers.reject(d)}r.push(l)}}))})),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 Si.debug("resending event "+o+" : "+s+" with "+r.resendLimit+" retry attempts remaining"),void n.push((t={},t[o]=e,t));Si.debug("no retry attempts remaining for event "+o+" : "+s)})),(t=this._buffer).unshift.apply(t,_i(n))},e.prototype._bufferToMap=function(e){return e.reduce((function(e,t){var n=wi(Object.entries(t),1),r=wi(n[0],2),i=r[0],o=r[1];return e[i]=o,e}),{})},e}();function Ii(e){return(Ii="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 Li=function(){return(Li=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)},ki=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())}))},Mi=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},xi="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",xi)},Ti=new r.ConsoleLogger("AWSPinpointProvider"),ji=[429,500],Ci=[202],Di="undefined"!=typeof navigator&&navigator&&"function"==typeof navigator.sendBeacon,Ni=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 ki(this,void 0,void 0,(function(){var n,r;return Mi(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 ki(this,void 0,void 0,(function(){var t;return Mi(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 ki(this,void 0,void 0,(function(){return Mi(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,l=i.endpointId,d={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),d.EventsRequest.BatchItem[l]=p,d},e.prototype._pinpointPutEvents=function(e,t){return ki(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d;return Mi(this,(function(p){switch(p.label){case 0:n=e.event.eventId,r=e.config.endpointId,i=this._generateBatchItemContext(e),o=new In(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,l=c.Message,Ci.includes(f)?(Ti.debug("record event success. ",s),[2,t.resolve(s)]):ji.includes(f)?(this._retry(e,t),[3,4]):(Ti.error("Event "+n+" is not accepted, the error is "+l),[2,t.reject(s)]);case 3:return d=p.sent(),this._eventError(d),[2,t.reject(d)];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"},l={region:i,service:"mobiletargeting"},d=r.Signer.signUrl(f,a,l,null);return navigator.sendBeacon(d,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 ki(this,void 0,void 0,(function(){var t,n,i,o,s,a,u,c,f,l,d,p;return Mi(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 l=h.sent(),Ti.debug("updateEndpoint success",l),this._endpointGenerating=!1,this._resumeBuffer(),n.resolve(l),[2];case 3:return d=h.sent(),p={err:d,update_params:c,endpointObject:e},[2,this._handleEndpointUpdateFailure(p)];case 4:return[2]}}))}))},e.prototype._handleEndpointUpdateFailure=function(e){return ki(this,void 0,void 0,(function(){var t,n,r;return Mi(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(ji.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 ki(this,void 0,void 0,(function(){var t,n;return Mi(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 vi({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 Oi},e.prototype._initBuffer=function(){this._bufferExists()&&this._flushBuffer(),this._buffer=new Oi(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 ki(this,void 0,void 0,(function(){var t,n;return Mi(this,(function(r){switch(r.label){case 0:return[4,mi.a.getItem(e)];case 1:return t=r.sent(),Ti.debug("endpointId from cache",t,"type",Ii(t)),t||(t=Object(Qn.v1)(),31536e8,n=(new Date).getTime()+31536e8,mi.a.setItem(e,t,{expires:n,priority:1})),[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=Li(Li(Li({channelType:c,requestId:Object(Qn.v1)(),effectiveDate:(new Date).toISOString()},s),t),{attributes:Li(Li({},s.attributes),t.attributes),demographic:Li(Li(Li(Li({},a),u),s.demographic),t.demographic),location:Li(Li({},s.location),t.location),metrics:Li(Li({},s.metrics),t.metrics),user:{userId:t.userId||s.userId||n.identityId,userAttributes:Li(Li({},s.userAttributes),t.userAttributes)}}),l=(f.userId,f.userAttributes,f.name,f.session,f.eventId,f.immediate,Pi(f,["userId","userAttributes","name","session","eventId","immediate"]));return r.JS.transferKeyToUpperCase(l,[],["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 ki(this,void 0,void 0,(function(){var e,t;return Mi(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},zi=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ui(arguments[t]));return e},Bi=[],Fi=function(){function e(e,t){this.context=e,this.methodName=t,this._originalMethod=e[t].bind(e)}return e.add=function(e,t,n){qi(e,t).set(n)},e.remove=function(e,t){qi(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,zi(n)))}},e.prototype.remove=function(){this.context[this.methodName]=this._originalMethod},e}();function qi(e,t){var n=Bi.filter((function(n){return n.context===e&&n.methodName===t}))[0];return n||(n=new Fi(e,t),Bi.push(n)),n}var Ki=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())}))},Vi=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])}}},Hi=new r.ConsoleLogger("PageViewTracker"),Gi="aws-amplify-analytics-prevUrl",$i={enable:!1,provider:"AWSPinpoint",getUrl:function(){return r.JS.browserOrNode().isBrowser?window.location.origin+window.location.pathname:""}},Wi=function(){function e(e,t){Hi.debug("initialize pageview tracker with opts",t),this._config=Object.assign({},$i,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(Gi)===this._config.getUrl()&&(Hi.debug("the url is same"),!0)},e.prototype._pageViewTrackDefault=function(){return Ki(this,void 0,void 0,(function(){var e,t,n,i;return Vi(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()]):(Hi.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){Hi.debug("Failed to record the page view event",e)})),sessionStorage.setItem(Gi,e)),[2]}}))}))},e.prototype._trackFunc=function(){return Ki(this,void 0,void 0,(function(){var e,t,n,i;return Vi(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()]):(Hi.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){Hi.debug("Failed to record the page view event",e)})),sessionStorage.setItem(Gi,e)),[2]}}))}))},e.prototype._pageViewTrackSPA=function(){r.JS.browserOrNode().isBrowser&&window.addEventListener&&history.pushState?this._config.enable&&!this._hasEnabled?(Fi.add(history,"pushState",this._trackFunc),Fi.add(history,"replaceState",this._trackFunc),window.addEventListener("popstate",this._trackFunc),this._trackFunc(),this._hasEnabled=!0):(Fi.remove(history,"pushState"),Fi.remove(history,"replaceState"),window.removeEventListener("popstate",this._trackFunc),this._hasEnabled=!1):Hi.debug("not in the supported web enviroment")},e}(),Yi=r.JS.browserOrNode().isBrowser&&window.Element?window.Element.prototype:null,Zi=Yi?Yi.matches||Yi.matchesSelector||Yi.webkitMatchesSelector||Yi.mozMatchesSelector||Yi.msMatchesSelector||Yi.oMatchesSelector:null;function Ji(e,t){if(e&&1===e.nodeType&&t){if("string"==typeof t||1===t.nodeType)return e===t||Qi(e,t);if("length"in t)for(var n=0,r=void 0;r=t[n];n++)if(e===r||Qi(e,r))return!0}return!1}function Qi(e,t){if("string"!=typeof t)return!1;if(Zi)return Zi.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 Xi(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&&Ji(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(Ji(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 eo=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())}))},to=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])}}},no=new r.ConsoleLogger("EventTracker"),ro={enable:!1,events:["click"],selectorPrefix:"data-amplify-analytics-",provider:"AWSPinpoint"},io=function(){function e(e,t){r.JS.browserOrNode().isBrowser&&window.addEventListener?(this._config=Object.assign({},ro,t),this._tracker=e,this._delegates={},this._trackFunc=this._trackFunc.bind(this),no.debug("initialize pageview tracker with opts",this._config),this.configure(this._config)):no.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]=Xi(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 eo(this,void 0,void 0,(function(){var n,r,i,o,s,a,u;return to(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),no.debug("events needed to be recorded",r),no.debug("attributes needed to be attached",n),r.indexOf(e.type)<0?(no.debug("event "+e.type+" is not selected to be recorded"),[2]):(this._tracker({name:i||"event",attributes:u},this._config.provider).catch((function(t){no.debug("Failed to record the "+e.type+" event', "+t)})),[2])}}))}))},e}(),oo=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())}))},so=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])}}},ao=new r.ConsoleLogger("SessionTracker"),uo={enable:!1,provider:"AWSPinpoint"},co=!1,fo=function(){function e(e,t){this._config=Object.assign({},uo,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 ao.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 ao.debug("not in the supported web environment"),!1;this._hidden="webkitHidden",this._visibilityChange="webkitvisibilitychange"}return!0},e.prototype._trackFunc=function(){return oo(this,void 0,void 0,(function(){var e,t,n;return so(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){ao.debug("record session stop event failed.",e)})):this._tracker({name:"_session.start",attributes:n},this._config.provider).catch((function(e){ao.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){ao.debug("record session stop event failed.",e)}))}))},e.prototype._sendInitialEvent=function(){return oo(this,void 0,void 0,(function(){var e,t,n;return so(this,(function(r){switch(r.label){case 0:return co?(ao.debug("the start session has been sent when the page is loaded"),[2]):(co=!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){ao.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}(),lo=function(){return(lo=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)},po=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())}))},ho=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])}}},vo=new r.ConsoleLogger("AnalyticsClass"),go="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",mo={pageView:Wi,event:io,session:fo},yo=null,bo=function(){function e(){this._config={},this._pluggables=[],this._disabled=!1,this._trackers={},yo=this,this.record=this.record.bind(this),r.Hub.listen("auth",Eo),r.Hub.listen("storage",Eo),r.Hub.listen("analytics",Eo)}return e.prototype.getModuleName=function(){return"Analytics"},e.prototype.configure=function(e){var t=this;if(!e)return this._config;vo.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(lo({disabled:t._config.disabled,autoSessionRecord:t._config.autoSessionRecord},n))})),0===this._pluggables.length&&this.addPluggable(new Ni),n="configured",i=null,o="The Analytics category has been configured successfully",r.Hub.dispatch("analytics",{event:n,data:i,message:o},"Analytics",go),vo.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=lo({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 vo.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 vo.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 po(this,void 0,void 0,(function(){var t;return ho(this,(function(n){return t={event:{name:"_session.start"},provider:e},[2,this._sendEvent(t)]}))}))},e.prototype.stopSession=function(e){return po(this,void 0,void 0,(function(){var t;return ho(this,(function(n){return t={event:{name:"_session.stop"},provider:e},[2,this._sendEvent(t)]}))}))},e.prototype.record=function(e,t,n){return po(this,void 0,void 0,(function(){var r;return ho(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 po(this,void 0,void 0,(function(){var n;return ho(this,(function(r){return n=lo(lo({},e),{name:"_update_endpoint"}),[2,this.record(n,t)]}))}))},e.prototype._sendEvent=function(e){var t=this;if(this._disabled)return vo.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(mo[e]){"session"===e&&(this._config.autoSessionRecord=t.enable);var n=this._trackers[e];n?n.configure(t):this._trackers[e]=new mo[e](this.record,t)}else vo.debug("invalid tracker type")},e}(),wo=!1,_o=!1,So=!1,Eo=function(e){var t=e.channel,n=e.payload;switch(vo.debug("on hub capsule "+t,n),t){case"auth":Oo(n);break;case"storage":Ao(n);break;case"analytics":Io(n)}},Ao=function(e){var t=e.data,n=t.attrs,r=t.metrics;n&&So&&yo.record({name:"Storage",attributes:n,metrics:r}).catch((function(e){vo.debug("Failed to send the storage event automatically",e)}))},Oo=function(e){var t=e.event;if(t){var n=function(e){return po(void 0,void 0,void 0,(function(){var t;return ho(this,(function(n){switch(n.label){case 0:if(!_o||!So)return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,yo.record({name:"_userauth."+e})];case 2:return[2,n.sent()];case 3:return t=n.sent(),vo.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":(_o=!0)&&So&&Lo()}}},Io=function(e){var t=e.event;if(t)switch(t){case"pinpointProvider_configured":So=!0,_o&&So&&Lo()}},Lo=function(){var e=yo.configure();!wo&&e.autoSessionRecord&&(yo.updateEndpoint({immediate:!0}).catch((function(e){vo.debug("Failed to update the endpoint",e)})),wo=!0),yo.autoTrack("session",{enable:e.autoSessionRecord})},ko=new bo;r.Amplify.register(ko);var Mo=function(e,t){return(Mo=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}Mo(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var xo=function(){return(xo=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 jo,Co,Do,No,Uo,zo,Bo,Fo,qo,Ko,Vo,Ho,Go,$o,Wo,Yo,Zo,Jo,Qo,Xo,es,ts,ns,rs,is,os,ss,as,us,cs,fs,ls,ds,ps,hs,vs,gs,ms,ys,bs,ws,_s,Ss,Es,As,Os,Is,Ls,ks,Ms,Ps,xs,Rs,Ts,js,Cs,Ds,Ns,Us,zs,Bs,Fs,qs,Ks,Vs,Hs,Gs,$s,Ws,Ys,Zs,Js,Qs,Xs,ea,ta,na,ra,ia,oa,sa,aa;Object.create;(jo||(jo={})).filterSensitiveLog=function(e){return xo({},e)},(Co||(Co={})).filterSensitiveLog=function(e){return xo({},e)},(Do||(Do={})).filterSensitiveLog=function(e){return xo({},e)},(No||(No={})).filterSensitiveLog=function(e){return xo({},e)},(Uo||(Uo={})).filterSensitiveLog=function(e){return xo({},e)},(zo||(zo={})).filterSensitiveLog=function(e){return xo({},e)},(Bo||(Bo={})).filterSensitiveLog=function(e){return xo({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.DELETING="DELETING"}(Fo||(Fo={})),(qo||(qo={})).filterSensitiveLog=function(e){return xo({},e)},(Ko||(Ko={})).filterSensitiveLog=function(e){return xo({},e)},(Vo||(Vo={})).filterSensitiveLog=function(e){return xo({},e)},(Ho||(Ho={})).filterSensitiveLog=function(e){return xo({},e)},(Go||(Go={})).filterSensitiveLog=function(e){return xo({},e)},($o||($o={})).filterSensitiveLog=function(e){return xo({},e)},(Wo||(Wo={})).filterSensitiveLog=function(e){return xo({},e)},(Yo||(Yo={})).filterSensitiveLog=function(e){return xo({},e)},(Zo||(Zo={})).filterSensitiveLog=function(e){return xo({},e)},function(e){e.KMS="KMS",e.NONE="NONE"}(Jo||(Jo={})),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"}(Qo||(Qo={})),(Xo||(Xo={})).filterSensitiveLog=function(e){return xo({},e)},(es||(es={})).filterSensitiveLog=function(e){return xo({},e)},(ts||(ts={})).filterSensitiveLog=function(e){return xo({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.DELETING="DELETING",e.UPDATING="UPDATING"}(ns||(ns={})),(rs||(rs={})).filterSensitiveLog=function(e){return xo({},e)},(is||(is={})).filterSensitiveLog=function(e){return xo({},e)},(os||(os={})).filterSensitiveLog=function(e){return xo({},e)},(ss||(ss={})).filterSensitiveLog=function(e){return xo({},e)},(as||(as={})).filterSensitiveLog=function(e){return xo({},e)},(us||(us={})).filterSensitiveLog=function(e){return xo({},e)},(cs||(cs={})).filterSensitiveLog=function(e){return xo({},e)},(fs||(fs={})).filterSensitiveLog=function(e){return xo({},e)},(ls||(ls={})).filterSensitiveLog=function(e){return xo({},e)},(ds||(ds={})).filterSensitiveLog=function(e){return xo({},e)},(ps||(ps={})).filterSensitiveLog=function(e){return xo({},e)},(hs||(hs={})).filterSensitiveLog=function(e){return xo({},e)},(vs||(vs={})).filterSensitiveLog=function(e){return xo({},e)},(gs||(gs={})).filterSensitiveLog=function(e){return xo({},e)},(ms||(ms={})).filterSensitiveLog=function(e){return xo({},e)},(ys||(ys={})).filterSensitiveLog=function(e){return xo({},e)},(bs||(bs={})).filterSensitiveLog=function(e){return xo({},e)},(ws||(ws={})).filterSensitiveLog=function(e){return xo({},e)},(_s||(_s={})).filterSensitiveLog=function(e){return xo({},e)},(Ss||(Ss={})).filterSensitiveLog=function(e){return xo({},e)},(Es||(Es={})).filterSensitiveLog=function(e){return xo({},e)},(As||(As={})).filterSensitiveLog=function(e){return xo({},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"}(Os||(Os={})),(Is||(Is={})).filterSensitiveLog=function(e){return xo({},e)},(Ls||(Ls={})).filterSensitiveLog=function(e){return xo({},e)},(ks||(ks={})).filterSensitiveLog=function(e){return xo({},e)},(Ms||(Ms={})).filterSensitiveLog=function(e){return xo({},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={})),(xs||(xs={})).filterSensitiveLog=function(e){return xo({},e)},(Rs||(Rs={})).filterSensitiveLog=function(e){return xo({},e)},(Ts||(Ts={})).filterSensitiveLog=function(e){return xo({},e)},(js||(js={})).filterSensitiveLog=function(e){return xo({},e)},(Cs||(Cs={})).filterSensitiveLog=function(e){return xo({},e)},(Ds||(Ds={})).filterSensitiveLog=function(e){return xo({},e)},(Ns||(Ns={})).filterSensitiveLog=function(e){return xo({},e)},(Us||(Us={})).filterSensitiveLog=function(e){return xo({},e)},(zs||(zs={})).filterSensitiveLog=function(e){return xo({},e)},(Bs||(Bs={})).filterSensitiveLog=function(e){return xo({},e)},(Fs||(Fs={})).filterSensitiveLog=function(e){return xo({},e)},(qs||(qs={})).filterSensitiveLog=function(e){return xo({},e)},(Ks||(Ks={})).filterSensitiveLog=function(e){return xo({},e)},(Vs||(Vs={})).filterSensitiveLog=function(e){return xo({},e)},(Hs||(Hs={})).filterSensitiveLog=function(e){return xo({},e)},(Gs||(Gs={})).filterSensitiveLog=function(e){return xo({},e)},($s||($s={})).filterSensitiveLog=function(e){return xo({},e)},(Ws||(Ws={})).filterSensitiveLog=function(e){return xo({},e)},(Ys||(Ys={})).filterSensitiveLog=function(e){return xo({},e)},(Zs||(Zs={})).filterSensitiveLog=function(e){return xo({},e)},(Js||(Js={})).filterSensitiveLog=function(e){return xo({},e)},(Qs||(Qs={})).filterSensitiveLog=function(e){return xo({},e)},(Xs||(Xs={})).filterSensitiveLog=function(e){return xo({},e)},(ea||(ea={})).filterSensitiveLog=function(e){return xo({},e)},(ta||(ta={})).filterSensitiveLog=function(e){return xo({},e)},(na||(na={})).filterSensitiveLog=function(e){return xo({},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:na.filterSensitiveLog(e.SubscribeToShardEvent)}:void 0!==e.ResourceNotFoundException?{ResourceNotFoundException:Uo.filterSensitiveLog(e.ResourceNotFoundException)}:void 0!==e.ResourceInUseException?{ResourceInUseException:No.filterSensitiveLog(e.ResourceInUseException)}:void 0!==e.KMSDisabledException?{KMSDisabledException:bs.filterSensitiveLog(e.KMSDisabledException)}:void 0!==e.KMSInvalidStateException?{KMSInvalidStateException:ws.filterSensitiveLog(e.KMSInvalidStateException)}:void 0!==e.KMSAccessDeniedException?{KMSAccessDeniedException:ys.filterSensitiveLog(e.KMSAccessDeniedException)}:void 0!==e.KMSNotFoundException?{KMSNotFoundException:_s.filterSensitiveLog(e.KMSNotFoundException)}:void 0!==e.KMSOptInRequired?{KMSOptInRequired:Ss.filterSensitiveLog(e.KMSOptInRequired)}:void 0!==e.KMSThrottlingException?{KMSThrottlingException:Es.filterSensitiveLog(e.KMSThrottlingException)}:void 0!==e.InternalFailureException?{InternalFailureException:Ms.filterSensitiveLog(e.InternalFailureException)}:void 0!==e.$unknown?((t={})[e.$unknown[0]]="UNKNOWN",t):void 0}}(ra||(ra={})),(ia||(ia={})).filterSensitiveLog=function(e){return xo(xo({},e),e.EventStream&&{EventStream:"STREAMING_CONTENT"})},function(e){e.UNIFORM_SCALING="UNIFORM_SCALING"}(oa||(oa={})),(sa||(sa={})).filterSensitiveLog=function(e){return xo({},e)},(aa||(aa={})).filterSensitiveLog=function(e){return xo({},e)};for(var ua=function(e,t){return Ro(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,p,h,v,g,m;return To(this,(function(y){switch(y.label){case 0:return r=[xo({},e)],m={},[4,ja(e.body,t)];case 1:switch(n=xo.apply(void 0,r.concat([(m.body=y.sent(),m)])),o="UnknownError",o=Ca(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,ca(n,t)];case 3:return i=xo.apply(void 0,[xo.apply(void 0,s.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 4:return a=[{}],[4,fa(n,t)];case 5:return i=xo.apply(void 0,[xo.apply(void 0,a.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 6:return u=[{}],[4,la(n,t)];case 7:return i=xo.apply(void 0,[xo.apply(void 0,u.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 8:return c=[{}],[4,da(n,t)];case 9:return i=xo.apply(void 0,[xo.apply(void 0,c.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 10:return f=[{}],[4,pa(n,t)];case 11:return i=xo.apply(void 0,[xo.apply(void 0,f.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 12:return l=[{}],[4,ha(n,t)];case 13:return i=xo.apply(void 0,[xo.apply(void 0,l.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 14:return d=[{}],[4,va(n,t)];case 15:return i=xo.apply(void 0,[xo.apply(void 0,d.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 16:return p=[{}],[4,ga(n,t)];case 17:return i=xo.apply(void 0,[xo.apply(void 0,p.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 18:return h=[{}],[4,ma(n,t)];case 19:return i=xo.apply(void 0,[xo.apply(void 0,h.concat([y.sent()])),{name:o,$metadata:xa(e)}]),[3,21];case 20:v=n.body,o=v.code||v.Code||o,i=xo(xo({},v),{name:""+o,message:v.message||v.Message||o,$fault:"client",$metadata:xa(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))]}}))}))},ca=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=wa(n,t),[2,xo({name:"InvalidArgumentException",$fault:"client",$metadata:xa(e)},r)]}))}))},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,xo({name:"KMSAccessDeniedException",$fault:"client",$metadata:xa(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=Sa(n,t),[2,xo({name:"KMSDisabledException",$fault:"client",$metadata:xa(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=Ea(n,t),[2,xo({name:"KMSInvalidStateException",$fault:"client",$metadata:xa(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,xo({name:"KMSNotFoundException",$fault:"client",$metadata:xa(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,xo({name:"KMSOptInRequired",$fault:"client",$metadata:xa(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=Ia(n,t),[2,xo({name:"KMSThrottlingException",$fault:"client",$metadata:xa(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,xo({name:"ProvisionedThroughputExceededException",$fault:"client",$metadata:xa(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=Pa(n,t),[2,xo({name:"ResourceNotFoundException",$fault:"client",$metadata:xa(e)},r)]}))}))},ya=function(e,t){return xo(xo({},void 0!==e.Records&&null!==e.Records&&{Records:ba(e.Records,t)}),void 0!==e.StreamName&&null!==e.StreamName&&{StreamName:e.StreamName})},ba=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return xo(xo(xo({},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)}))},wa=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},_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}},Ia=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}},ka=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?Ma(e.Records,t):void 0}},Ma=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}},xa=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(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return o=l.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)]}}))}))},ja=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):{}}))},Ca=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:Hs.filterSensitiveLog,outputFilterSensitiveLog:$s.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(ya(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,ua(e,t)]:[4,ja(e.body,t)];case 1:return n=o.sent(),{},r=ka(n,t),i=xo({$metadata:xa(e)},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Bt),Na=n(48),Ua=n(12),za={},Ba={},Fa=0;Fa<256;Fa++){var qa=Fa.toString(16).toLowerCase();1===qa.length&&(qa="0"+qa),za[Fa]=qa,Ba[qa]=Fa}function Ka(e){for(var t="",n=0;n<e.byteLength;n++)t+=za[e[n]];return t}var Va=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&&Ha(n),new e(n)},e.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&Ha(e),parseInt(Ka(e),16)*(t?-1:1)},e.prototype.toString=function(){return String(this.valueOf())},e}();function Ha(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}var Ga,$a=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(jt.__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)),l=0;try{for(var d=Object(jt.__values)(o),p=d.next();!p.done;p=d.next()){var h=p.value;f.set(h,l),l+=h.byteLength}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}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(Va.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!ru.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:Wa,value:!0};break;case 1:t[i]={type:Wa,value:!1};break;case 2:t[i]={type:Ya,value:e.getInt8(n++)};break;case 3:t[i]={type:Za,value:e.getInt16(n,!1)},n+=2;break;case 4:t[i]={type:Ja,value:e.getInt32(n,!1)},n+=4;break;case 5:t[i]={type:Qa,value:new Va(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:var o=e.getUint16(n,!1);n+=2,t[i]={type:Xa,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:eu,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s))},n+=s;break;case 8:t[i]={type:tu,value:new Date(new Va(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:nu,value:Ka(a.subarray(0,4))+"-"+Ka(a.subarray(4,6))+"-"+Ka(a.subarray(6,8))+"-"+Ka(a.subarray(8,10))+"-"+Ka(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"}(Ga||(Ga={}));var Wa="boolean",Ya="byte",Za="short",Ja="integer",Qa="long",Xa="binary",eu="string",tu="timestamp",nu="uuid",ru=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var iu=function(){function e(e,t){this.headerMarshaller=new $a(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 ou=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new iu(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(jt.__asyncGenerator)(this,arguments,(function(){var n,r,i,o,s,a,u,c,f,l,d,p,h,v,g,m,y;return Object(jt.__generator)(this,(function(b){switch(b.label){case 0:b.trys.push([0,12,13,18]),n=Object(jt.__asyncValues)(e),b.label=1;case 1:return[4,Object(jt.__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(jt.__await)(t.deserializer(c))]);case 4:if((f=b.sent()).$unknown)throw(l=new Error(t.toUtf8(o.body))).name=u,l;throw f[u];case 5:return"event"!==s?[3,9]:((g={})[o.headers[":event-type"].value]=o,d=g,[4,Object(jt.__await)(t.deserializer(d))]);case 6:return(p=b.sent()).$unknown?[3,10]:[4,Object(jt.__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(jt.__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(jt.__asyncGenerator)(this,arguments,(function(){var e,t,r,c,f,l,d,p;return Object(jt.__generator)(this,(function(h){switch(h.label){case 0:e=n[Symbol.asyncIterator](),h.label=1;case 1:return[4,Object(jt.__await)(e.next())];case 2:return t=h.sent(),r=t.value,t.done?i?[3,4]:[4,Object(jt.__await)(void 0)]:[3,10];case 3:return[2,h.sent()];case 4:return i!==o?[3,7]:[4,Object(jt.__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(jt.__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(l=c-f,a||(a=new Uint8Array(4)),d=Math.min(4-o,l),a.set(r.slice(f,f+d),o),f+=d,(o+=d)<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(jt.__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(jt.__asyncGenerator)(this,arguments,(function(){var n,i,o,s,a,u,c;return Object(jt.__generator)(this,(function(f){switch(f.label){case 0:f.trys.push([0,7,8,13]),n=Object(jt.__asyncValues)(e),f.label=1;case 1:return[4,Object(jt.__await)(n.next())];case 2:return(i=f.sent()).done?[3,6]:(o=i.value,s=r.eventMarshaller.marshall(t(o)),[4,Object(jt.__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(jt.__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(jt.__await)(new Uint8Array(0))];case 14:return[4,f.sent()];case 15:return f.sent(),[2]}}))}))},n},e}(),su=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new iu(t,n),this.universalMarshaller=new ou({utf8Decoder:n,utf8Encoder:t})}return e.prototype.deserialize=function(e,t){var n,r,i=au(e)?(n=e,(r={})[Symbol.asyncIterator]=function(){return Object(jt.__asyncGenerator)(this,arguments,(function(){var e,t,r,i;return Object(jt.__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(jt.__await)(e.read())];case 3:return t=o.sent(),r=t.done,i=t.value,r?[4,Object(jt.__await)(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Object(jt.__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(jt.__awaiter)(this,void 0,void 0,(function(){var t,r,i;return Object(jt.__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}(),au=function(e){return"function"==typeof ReadableStream&&e instanceof ReadableStream},uu=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"]),cu=new Set(["cn-north-1","cn-northwest-1"]),fu=new Set(["us-iso-east-1"]),lu=new Set(["us-isob-east-1"]),du=new Set(["us-gov-east-1","us-gov-west-1"]),pu={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:uu.has(e)&&(n={hostname:"kinesis.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),cu.has(e)&&(n={hostname:"kinesis.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),fu.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"}),du.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(xo({signingService:"kinesis"},n))},serviceId:"Kinesis",urlParser:hr},hu=xo(xo({},pu),{runtime:"browser",base64Decoder:Bn,base64Encoder:Fn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:pu.serviceId,clientVersion:Na.version}),eventStreamSerdeProvider:function(e){return new su(e)},maxAttempts:3,region:Vn("Region is missing"),requestHandler:new Rn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur.fromUtf8,utf8Encoder:ur.toUtf8}),vu=function(e){function t(t){var n,r=this,i=xo(xo({},hu),t),o=wr(i),s=ii(mr(o)),a=fi(nr(s)),u=(n=a,Object(jt.__assign)(Object(jt.__assign)({},n),{eventStreamMarshaller:n.eventStreamSerdeProvider(n)}));return(r=e.call(this,u)||this).config=u,r.middlewareStack.use(ci(r.config)),r.middlewareStack.use(Gn(r.config)),r.middlewareStack.use(Er(r.config)),r.middlewareStack.use(Or(r.config)),r.middlewareStack.use(Lr(r.config)),r.middlewareStack.use(hi(r.config)),r}return Po(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(zt),gu=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())}))},mu=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])}}},yu=new r.ConsoleLogger("AWSKinesisProvider"),bu=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){yu.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 gu(this,void 0,void 0,(function(){var t;return mu(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 yu.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)):(yu.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?(yu.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:Object(ur.fromUtf8)(r),PartitionKey:t.partitionKey||"partition-"+i.identityId};o[n].push(s)})),Object.keys(o).map((function(e){return gu(t,void 0,void 0,(function(){var t,n;return mu(this,(function(r){switch(r.label){case 0:yu.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(),yu.debug("Upload records to stream",e),[3,4];case 3:return n=r.sent(),yu.debug("Failed to upload records to Kinesis",n),[3,4];case 4:return[2]}}))}))}))}},e.prototype._init=function(e,t){if(yu.debug("init clients"),this._kinesis&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return yu.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 yu.debug("initialize kinesis with credentials",n),this._kinesis=new vu({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?(yu.debug("set credentials for analytics",e._config.credentials),r.Credentials.shear(t)):null})).catch((function(e){return yu.debug("ensure credentials error",e),null}))},e}(),wu=function(e,t){return(wu=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 _u(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}wu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Su=function(){return(Su=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 Eu(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 Au(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 Ou,Iu,Lu,ku,Mu,Pu,xu,Ru,Tu,ju,Cu,Du,Nu,Uu,zu,Bu,Fu,qu,Ku,Vu,Hu,Gu,$u,Wu,Yu,Zu,Ju,Qu,Xu,ec,tc,nc,rc,ic,oc,sc,ac,uc,cc,fc,lc,dc,pc,hc,vc,gc,mc,yc,bc,wc,_c,Sc,Ec,Ac,Oc,Ic,Lc,kc,Mc,Pc,xc,Rc,Tc,jc,Cc,Dc,Nc,Uc,zc,Bc,Fc,qc,Kc,Vc,Hc,Gc,$c,Wc,Yc,Zc,Jc,Qc,Xc,ef,tf,nf,rf,of,sf,af,uf,cf,ff,lf,df,pf,hf,vf,gf,mf,yf;Object.create;(Ou||(Ou={})).filterSensitiveLog=function(e){return Su({},e)},(Iu||(Iu={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.GZIP="GZIP",e.HADOOP_SNAPPY="HADOOP_SNAPPY",e.SNAPPY="Snappy",e.UNCOMPRESSED="UNCOMPRESSED",e.ZIP="ZIP"}(Lu||(Lu={})),(ku||(ku={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.GZIP="GZIP",e.NONE="NONE"}(Mu||(Mu={})),(Pu||(Pu={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.AWS_OWNED_CMK="AWS_OWNED_CMK",e.CUSTOMER_MANAGED_CMK="CUSTOMER_MANAGED_CMK"}(xu||(xu={})),(Ru||(Ru={})).filterSensitiveLog=function(e){return Su({},e)},(Tu||(Tu={})).filterSensitiveLog=function(e){return Su({},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"}(ju||(ju={})),(Cu||(Cu={})).filterSensitiveLog=function(e){return Su({},e)},(Du||(Du={})).filterSensitiveLog=function(e){return Su({},e)},(Nu||(Nu={})).filterSensitiveLog=function(e){return Su({},e)},(Uu||(Uu={})).filterSensitiveLog=function(e){return Su({},e)},(zu||(zu={})).filterSensitiveLog=function(e){return Su({},e)},(Bu||(Bu={})).filterSensitiveLog=function(e){return Su({},e)},(Fu||(Fu={})).filterSensitiveLog=function(e){return Su({},e)},(qu||(qu={})).filterSensitiveLog=function(e){return Su({},e)},(Ku||(Ku={})).filterSensitiveLog=function(e){return Su({},e)},(Vu||(Vu={})).filterSensitiveLog=function(e){return Su({},e)},(Hu||(Hu={})).filterSensitiveLog=function(e){return Su({},e)},(Gu||(Gu={})).filterSensitiveLog=function(e){return Su({},e)},($u||($u={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.NONE="NONE",e.SNAPPY="SNAPPY",e.ZLIB="ZLIB"}(Wu||(Wu={})),function(e){e.V0_11="V0_11",e.V0_12="V0_12"}(Yu||(Yu={})),(Zu||(Zu={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.GZIP="GZIP",e.SNAPPY="SNAPPY",e.UNCOMPRESSED="UNCOMPRESSED"}(Ju||(Ju={})),function(e){e.V1="V1",e.V2="V2"}(Qu||(Qu={})),(Xu||(Xu={})).filterSensitiveLog=function(e){return Su({},e)},(ec||(ec={})).filterSensitiveLog=function(e){return Su({},e)},(tc||(tc={})).filterSensitiveLog=function(e){return Su({},e)},(nc||(nc={})).filterSensitiveLog=function(e){return Su({},e)},(rc||(rc={})).filterSensitiveLog=function(e){return Su({},e)},(ic||(ic={})).filterSensitiveLog=function(e){return Su({},e)},(oc||(oc={})).filterSensitiveLog=function(e){return Su({},e)},(sc||(sc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.Url&&{Url:Vt}),e.AccessKey&&{AccessKey:Vt})},(ac||(ac={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.AttributeName&&{AttributeName:Vt}),e.AttributeValue&&{AttributeValue:Vt})},(uc||(uc={})).filterSensitiveLog=function(e){return Su(Su({},e),e.CommonAttributes&&{CommonAttributes:e.CommonAttributes.map((function(e){return ac.filterSensitiveLog(e)}))})},(cc||(cc={})).filterSensitiveLog=function(e){return Su({},e)},(fc||(fc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.EndpointConfiguration&&{EndpointConfiguration:sc.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:uc.filterSensitiveLog(e.RequestConfiguration)})},(lc||(lc={})).filterSensitiveLog=function(e){return Su({},e)},(dc||(dc={})).filterSensitiveLog=function(e){return Su({},e)},(pc||(pc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.Username&&{Username:Vt}),e.Password&&{Password:Vt})},(hc||(hc={})).filterSensitiveLog=function(e){return Su({},e)},(vc||(vc={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(gc||(gc={})),(mc||(mc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.RedshiftDestinationConfiguration&&{RedshiftDestinationConfiguration:pc.filterSensitiveLog(e.RedshiftDestinationConfiguration)}),e.HttpEndpointDestinationConfiguration&&{HttpEndpointDestinationConfiguration:fc.filterSensitiveLog(e.HttpEndpointDestinationConfiguration)})},(yc||(yc={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(bc||(bc={})),(wc||(wc={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(_c||(_c={})),function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(Sc||(Sc={})),(Ec||(Ec={})).filterSensitiveLog=function(e){return Su({},e)},(Ac||(Ac={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(Oc||(Oc={})),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"}(Ic||(Ic={})),(Lc||(Lc={})).filterSensitiveLog=function(e){return Su({},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"}(kc||(kc={})),(Mc||(Mc={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.ACTIVE="ACTIVE",e.CREATING="CREATING",e.CREATING_FAILED="CREATING_FAILED",e.DELETING="DELETING",e.DELETING_FAILED="DELETING_FAILED"}(Pc||(Pc={})),(xc||(xc={})).filterSensitiveLog=function(e){return Su({},e)},(Rc||(Rc={})).filterSensitiveLog=function(e){return Su({},e)},(Tc||(Tc={})).filterSensitiveLog=function(e){return Su({},e)},(jc||(jc={})).filterSensitiveLog=function(e){return Su({},e)},(Cc||(Cc={})).filterSensitiveLog=function(e){return Su(Su({},e),e.Url&&{Url:Vt})},(Dc||(Dc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.EndpointConfiguration&&{EndpointConfiguration:Cc.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:uc.filterSensitiveLog(e.RequestConfiguration)})},(Nc||(Nc={})).filterSensitiveLog=function(e){return Su(Su({},e),e.Username&&{Username:Vt})},(Uc||(Uc={})).filterSensitiveLog=function(e){return Su({},e)},(zc||(zc={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.RedshiftDestinationDescription&&{RedshiftDestinationDescription:Nc.filterSensitiveLog(e.RedshiftDestinationDescription)}),e.HttpEndpointDestinationDescription&&{HttpEndpointDestinationDescription:Dc.filterSensitiveLog(e.HttpEndpointDestinationDescription)})},(Bc||(Bc={})).filterSensitiveLog=function(e){return Su({},e)},(Fc||(Fc={})).filterSensitiveLog=function(e){return Su({},e)},(qc||(qc={})).filterSensitiveLog=function(e){return Su(Su({},e),e.Destinations&&{Destinations:e.Destinations.map((function(e){return zc.filterSensitiveLog(e)}))})},(Kc||(Kc={})).filterSensitiveLog=function(e){return Su({},e)},(Vc||(Vc={})).filterSensitiveLog=function(e){return Su(Su({},e),e.DeliveryStreamDescription&&{DeliveryStreamDescription:qc.filterSensitiveLog(e.DeliveryStreamDescription)})},(Hc||(Hc={})).filterSensitiveLog=function(e){return Su({},e)},(Gc||(Gc={})).filterSensitiveLog=function(e){return Su({},e)},($c||($c={})).filterSensitiveLog=function(e){return Su({},e)},(Wc||(Wc={})).filterSensitiveLog=function(e){return Su({},e)},(Yc||(Yc={})).filterSensitiveLog=function(e){return Su({},e)},(Zc||(Zc={})).filterSensitiveLog=function(e){return Su({},e)},(Jc||(Jc={})).filterSensitiveLog=function(e){return Su({},e)},function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(Qc||(Qc={})),function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(Xc||(Xc={})),function(e){e.filterSensitiveLog=function(e){return Su({},e)}}(ef||(ef={})),(tf||(tf={})).filterSensitiveLog=function(e){return Su({},e)},(nf||(nf={})).filterSensitiveLog=function(e){return Su({},e)},(rf||(rf={})).filterSensitiveLog=function(e){return Su({},e)},(of||(of={})).filterSensitiveLog=function(e){return Su({},e)},(sf||(sf={})).filterSensitiveLog=function(e){return Su({},e)},(af||(af={})).filterSensitiveLog=function(e){return Su({},e)},(uf||(uf={})).filterSensitiveLog=function(e){return Su({},e)},(cf||(cf={})).filterSensitiveLog=function(e){return Su({},e)},(ff||(ff={})).filterSensitiveLog=function(e){return Su({},e)},(lf||(lf={})).filterSensitiveLog=function(e){return Su({},e)},(df||(df={})).filterSensitiveLog=function(e){return Su({},e)},(pf||(pf={})).filterSensitiveLog=function(e){return Su({},e)},(hf||(hf={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.EndpointConfiguration&&{EndpointConfiguration:sc.filterSensitiveLog(e.EndpointConfiguration)}),e.RequestConfiguration&&{RequestConfiguration:uc.filterSensitiveLog(e.RequestConfiguration)})},(vf||(vf={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.Username&&{Username:Vt}),e.Password&&{Password:Vt})},(gf||(gf={})).filterSensitiveLog=function(e){return Su({},e)},(mf||(mf={})).filterSensitiveLog=function(e){return Su(Su(Su({},e),e.RedshiftDestinationUpdate&&{RedshiftDestinationUpdate:vf.filterSensitiveLog(e.RedshiftDestinationUpdate)}),e.HttpEndpointDestinationUpdate&&{HttpEndpointDestinationUpdate:hf.filterSensitiveLog(e.HttpEndpointDestinationUpdate)})},(yf||(yf={})).filterSensitiveLog=function(e){return Su({},e)};var bf,wf=function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d;return Au(this,(function(p){switch(p.label){case 0:return r=[Su({},e)],d={},[4,Nf(e.body,t)];case 1:switch(n=Su.apply(void 0,r.concat([(d.body=p.sent(),d)])),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,_f(n,t)];case 3:return i=Su.apply(void 0,[Su.apply(void 0,s.concat([p.sent()])),{name:o,$metadata:jf(e)}]),[3,11];case 4:return a=[{}],[4,Sf(n,t)];case 5:return i=Su.apply(void 0,[Su.apply(void 0,a.concat([p.sent()])),{name:o,$metadata:jf(e)}]),[3,11];case 6:return u=[{}],[4,Ef(n,t)];case 7:return i=Su.apply(void 0,[Su.apply(void 0,u.concat([p.sent()])),{name:o,$metadata:jf(e)}]),[3,11];case 8:return c=[{}],[4,Af(n,t)];case 9:return i=Su.apply(void 0,[Su.apply(void 0,c.concat([p.sent()])),{name:o,$metadata:jf(e)}]),[3,11];case 10:f=n.body,o=f.code||f.Code||o,i=Su(Su({},f),{name:""+o,message:f.message||f.Message||o,$fault:"client",$metadata:jf(e)}),p.label=11;case 11:return l=i.message||i.Message||o,i.message=l,delete i.Message,[2,Promise.reject(Object.assign(new Error(l),i))]}}))}))},_f=function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r;return Au(this,(function(i){return n=e.body,r=kf(n,t),[2,Su({name:"InvalidArgumentException",$fault:"client",$metadata:jf(e)},r)]}))}))},Sf=function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r;return Au(this,(function(i){return n=e.body,r=Mf(n,t),[2,Su({name:"InvalidKMSResourceException",$fault:"client",$metadata:jf(e)},r)]}))}))},Ef=function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r;return Au(this,(function(i){return n=e.body,r=Rf(n,t),[2,Su({name:"ResourceNotFoundException",$fault:"client",$metadata:jf(e)},r)]}))}))},Af=function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r;return Au(this,(function(i){return n=e.body,r=Tf(n,t),[2,Su({name:"ServiceUnavailableException",$fault:"server",$metadata:jf(e)},r)]}))}))},Of=function(e,t){return Su(Su({},void 0!==e.DeliveryStreamName&&null!==e.DeliveryStreamName&&{DeliveryStreamName:e.DeliveryStreamName}),void 0!==e.Records&&null!==e.Records&&{Records:If(e.Records,t)})},If=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:Lf(e,t)}))},Lf=function(e,t){return Su({},void 0!==e.Data&&null!==e.Data&&{Data:t.base64Encoder(e.Data)})},kf=function(e,t){return{message:void 0!==e.message&&null!==e.message?e.message:void 0}},Mf=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?xf(e.RequestResponses,t):void 0}},xf=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}},jf=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"]}},Cf=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 Eu(void 0,void 0,void 0,(function(){var o,s,a,u,c,f;return Au(this,(function(l){switch(l.label){case 0:return[4,e.endpoint()];case 1:return o=l.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)]}}))}))},Nf=function(e,t){return Cf(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):""},zf=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return _u(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:nf.filterSensitiveLog,outputFilterSensitiveLog:of.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 Eu(void 0,void 0,void 0,(function(){var n,r;return Au(this,(function(i){return n={"content-type":"application/x-amz-json-1.1","x-amz-target":"Firehose_20150804.PutRecordBatch"},r=JSON.stringify(Of(e,t)),[2,Df(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return Eu(void 0,void 0,void 0,(function(){var n,r,i;return Au(this,(function(o){switch(o.label){case 0:return e.statusCode>=300?[2,wf(e,t)]:[4,Nf(e.body,t)];case 1:return n=o.sent(),{},r=Pf(n,t),i=Su({$metadata:jf(e)},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Bt),Bf=n(49),Ff=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"]),qf=new Set(["cn-north-1","cn-northwest-1"]),Kf=new Set(["us-iso-east-1"]),Vf=new Set(["us-isob-east-1"]),Hf=new Set(["us-gov-east-1","us-gov-west-1"]),Gf={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:Ff.has(e)&&(n={hostname:"firehose.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),qf.has(e)&&(n={hostname:"firehose.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Kf.has(e)&&(n={hostname:"firehose.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Vf.has(e)&&(n={hostname:"firehose.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Hf.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(Su({signingService:"firehose"},n))},serviceId:"Firehose",urlParser:hr},$f=Su(Su({},Gf),{runtime:"browser",base64Decoder:Bn,base64Encoder:Fn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:Gf.serviceId,clientVersion:Bf.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new Rn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur.fromUtf8,utf8Encoder:ur.toUtf8}),Wf=function(e){function t(t){var n=this,r=Su(Su({},$f),t),i=wr(r),o=ii(mr(i)),s=fi(nr(o));return(n=e.call(this,s)||this).config=s,n.middlewareStack.use(ci(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Er(n.config)),n.middlewareStack.use(Or(n.config)),n.middlewareStack.use(Lr(n.config)),n.middlewareStack.use(hi(n.config)),n}return _u(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(zt),Yf=(bf=function(e,t){return(bf=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}bf(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Zf=new r.ConsoleLogger("AWSKineisFirehoseProvider"),Jf=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:Object(ur.fromUtf8)(i)};o[n].push(s)})),Object.keys(o).map((function(e){Zf.debug("putting records to kinesis",e,"with records",o[e]),t._kinesisFirehose.send(new zf({Records:o[e],DeliveryStreamName:e})).then((function(t){return Zf.debug("Upload records to stream",e)})).catch((function(e){return Zf.debug("Failed to upload records to Kinesis",e)}))}))}},t.prototype._init=function(e,t){if(Zf.debug("init clients"),this._kinesisFirehose&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return Zf.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 Zf.debug("initialize kinesis firehose with credentials",t),this._kinesisFirehose=new Wf({apiVersion:"2015-08-04",region:e,credentials:t}),!0},t}(bu),Qf=function(e,t){return(Qf=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 Xf(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}Qf(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var el=function(){return(el=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 tl(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 nl(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 rl,il,ol,sl,al,ul,cl,fl;Object.create;(rl||(rl={})).filterSensitiveLog=function(e){return el({},e)},(il||(il={})).filterSensitiveLog=function(e){return el({},e)},function(e){e.filterSensitiveLog=function(e){return el({},e)}}(ol||(ol={})),(sl||(sl={})).filterSensitiveLog=function(e){return el({},e)},(al||(al={})).filterSensitiveLog=function(e){return el({},e)},function(e){e.filterSensitiveLog=function(e){return el({},e)}}(ul||(ul={})),(cl||(cl={})).filterSensitiveLog=function(e){return el({},e)},(fl||(fl={})).filterSensitiveLog=function(e){return el({},e)};var ll,dl,pl,hl=function(e,t){return tl(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return nl(this,(function(f){switch(f.label){case 0:return r=[el({},e)],c={},[4,wl(e.body,t)];case 1:switch(n=el.apply(void 0,r.concat([(c.body=f.sent(),c)])),o="UnknownError",o=_l(e,n.body),o){case"InvalidInputException":case"com.amazonaws.personalizeevents#InvalidInputException":return[3,2]}return[3,4];case 2:return s=[{}],[4,vl(n,t)];case 3:return i=el.apply(void 0,[el.apply(void 0,s.concat([f.sent()])),{name:o,$metadata:yl(e)}]),[3,5];case 4:a=n.body,o=a.code||a.Code||o,i=el(el({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:yl(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))]}}))}))},vl=function(e,t){return tl(void 0,void 0,void 0,(function(){var t,n;return nl(this,(function(r){return t={name:"InvalidInputException",$fault:"client",$metadata:yl(e),message:void 0},void 0!==(n=e.body).message&&null!==n.message&&(t.message=n.message),[2,t]}))}))},gl=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:function(e,t){return el(el(el(el(el(el(el(el({},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:ml(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)}))},ml=function(e,t){return e.filter((function(e){return null!=e})).map((function(e){return null===e?null:e}))},yl=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"]}},bl=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},wl=function(e,t){return function(e,t){return bl(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},_l=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):""},Sl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return Xf(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:ol.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 tl(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return nl(this,(function(f){switch(f.label){case 0:return n={"content-type":"application/json"},r="/events",i=JSON.stringify(el(el(el(el({},void 0!==e.eventList&&null!==e.eventList&&{eventList:gl(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 tl(void 0,void 0,void 0,(function(){var n;return nl(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=300?[2,hl(e,t)]:(n={$metadata:yl(e)},[4,bl(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(Bt),El=n(51),Al=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"]),Ol=new Set(["cn-north-1","cn-northwest-1"]),Il=new Set(["us-iso-east-1"]),Ll=new Set(["us-isob-east-1"]),kl=new Set(["us-gov-east-1","us-gov-west-1"]),Ml={apiVersion:"2018-03-22",disableHostPrefix:!1,logger:{},regionInfoProvider:function(e,t){var n=void 0;return Al.has(e)&&(n={hostname:"personalize-events.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),Ol.has(e)&&(n={hostname:"personalize-events.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Il.has(e)&&(n={hostname:"personalize-events.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Ll.has(e)&&(n={hostname:"personalize-events.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),kl.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(el({signingService:"personalize"},n))},serviceId:"Personalize Events",urlParser:hr},Pl=el(el({},Ml),{runtime:"browser",base64Decoder:Bn,base64Encoder:Fn,bodyLengthChecker:ir,credentialDefaultProvider:function(e){return function(){return Promise.reject(new Error("Credential is missing"))}},defaultUserAgentProvider:ar({serviceId:Ml.serviceId,clientVersion:El.version}),maxAttempts:3,region:Vn("Region is missing"),requestHandler:new Rn,sha256:Mn.Sha256,streamCollector:qn,utf8Decoder:ur.fromUtf8,utf8Encoder:ur.toUtf8}),xl=function(e){function t(t){var n=this,r=el(el({},Pl),t),i=wr(r),o=ii(mr(i)),s=fi(nr(o));return(n=e.call(this,s)||this).config=s,n.middlewareStack.use(ci(n.config)),n.middlewareStack.use(Gn(n.config)),n.middlewareStack.use(Er(n.config)),n.middlewareStack.use(Or(n.config)),n.middlewareStack.use(Lr(n.config)),n.middlewareStack.use(hi(n.config)),n}return Xf(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(zt),Rl=n(4),Tl=n.n(Rl),jl=n(19),Cl=n.n(jl),Dl=(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),mi.a.setItem(this._getCachePrefix(e),t,{expires:r.getTime()})},e.prototype.retrieveValue=function(e){return mi.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!Tl()(n)&&Tl()(t)&&!Tl()(e)},e.prototype.retrieveSessionInfo=function(e){var t={};return t.trackingId=e,t.sessionId=this.retrieveValue("_awsct_sid"),t.userId=this.retrieveValue("_awsct_uid"),Tl()(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=Tl()(n),i=Tl()(e)&&!Tl()(t),o=!Tl()(e)&&!Tl()(t)&&!Cl()(e,t);return r||i||o},e}());!function(e){e.PLAY="play",e.PAUSE="pause",e.ENDED="Ended"}(ll||(ll={})),function(e){e.IFRAME="IFRAME",e.VIDEO="VIDEO",e.AUDIO="AUDIO"}(dl||(dl={})),function(e){e.PLAY="Play",e.ENDED="Ended",e.PAUSE="Pause",e.TIME_WATCHED="TimeWatched"}(pl||(pl={}));var Nl=function(){function e(e,t){var n;this.eventActionMapping=((n={})[pl.ENDED]=this.endedEventAction.bind(this),n[pl.PLAY]=this.playEventAction.bind(this),n[pl.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(dl.IFRAME,pl.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:pl.ENDED,1:pl.PLAY,2:pl.PAUSE}[e.data];t&&this.eventActionMapping[t](dl.IFRAME)},e.prototype._html5MediaTracker=function(){var e=this;setInterval((function(){e._started&&e.recordEvent(dl.VIDEO,pl.TIME_WATCHED)}),3e3),this._mediaElement.addEventListener(ll.PLAY,(function(){e.eventActionMapping[pl.PLAY](dl.VIDEO)}),!1),this._mediaElement.addEventListener(ll.PAUSE,(function(){e.eventActionMapping[pl.PAUSE](dl.VIDEO)}),!1),this._mediaElement.addEventListener(ll.ENDED,(function(){e.eventActionMapping[pl.ENDED](dl.VIDEO)}),!1)},e.prototype.playEventAction=function(e){this._started=!0,this.recordEvent(e,pl.PLAY)},e.prototype.pauseEventAction=function(e){this._started=!1,this.recordEvent(e,pl.PAUSE)},e.prototype.endedEventAction=function(e){this._started=!1,this.recordEvent(e,pl.ENDED)},e.prototype.recordEvent=function(e,t){var n=Object.assign({},this._params),r=n.eventData;r.eventType=t,e===dl.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}(),Ul=n(50),zl=n.n(Ul),Bl=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())}))},Fl=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])}}},ql=new r.ConsoleLogger("AmazonPersonalizeProvider"),Kl=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 Dl,Tl()(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 Bl(this,void 0,void 0,(function(){var t,n,r,i,o;return Fl(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]):(Tl()(e.event.userId)||this._sessionManager.updateSessionInfo(e.event.userId,this._sessionInfo),o=this.generateRequestParams(e,this._sessionInfo),"MediaAutoTrack"!==r?[3,7]:this._isBrowser?Tl()(zl()(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 Nl(o,this):ql.debug("Cannot find the media element."),[3,4];case 3:ql.debug("Missing domElementId field in 'properties' for MediaAutoTrack event type."),s.label=4;case 4:return[3,6];case 5:ql.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){ql.debug("configure Analytics",e);var t=e||{};return this._config=Object.assign({},this._config,t),Tl()(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 l=new Sl(f);this._personalize.send(l,(function(e){e?ql.debug("Failed to call putEvents in Personalize",e):ql.debug("Put events")}))}}else ql.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):Cl()(u,this._sessionInfo)&&a.sessionToken===r.sessionToken&&a.identityId===r.identityId?(ql.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(ql.debug("init clients"),this._personalize&&this._config.credentials&&this._config.credentials.sessionToken===t.sessionToken&&this._config.credentials.identityId===t.identityId)return ql.debug("no change for analytics config, directly return from init"),!0;this._config.credentials=t;var n=e.region;return ql.debug("initialize personalize with credentials",t),this._personalize=new xl({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?(ql.debug("set credentials for analytics",e._config.credentials),r.Credentials.shear(t)):null})).catch((function(e){return ql.debug("ensure credentials error",e),null}))},e}();t.default=ko},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)}}])}));
26//# sourceMappingURL=aws-amplify-analytics.min.js.map
\No newline at end of file