Untitled

 avatar
unknown
javascript
3 years ago
464 kB
7
Indexable
!function(e){var t=window.webpackHotUpdate;window.webpackHotUpdate=function(e,n){!function(e,t){if(!w[e]||!S[e])return;for(var n in S[e]=!1,t)Object.prototype.hasOwnProperty.call(t,n)&&(p[n]=t[n]);0==--y&&0===m&&E()}(e,n),t&&t(e,n)};var n,r=!0,i="bf685dafca2f40f32b4b",o={},s=[],a=[];function u(e){var t=x[e];if(!t)return P;var r=function(r){return t.hot.active?(x[r]?-1===x[r].parents.indexOf(e)&&x[r].parents.push(e):(s=[e],n=r),-1===t.children.indexOf(r)&&t.children.push(r)):(console.warn("[HMR] unexpected require("+r+") from disposed module "+e),s=[]),P(r)},i=function(e){return{configurable:!0,enumerable:!0,get:function(){return P[e]},set:function(t){P[e]=t}}};for(var o in P)Object.prototype.hasOwnProperty.call(P,o)&&"e"!==o&&"t"!==o&&Object.defineProperty(r,o,i(o));return r.e=function(e){return"ready"===l&&d("prepare"),m++,P.e(e).then(t,(function(e){throw t(),e}));function t(){m--,"prepare"===l&&(b[e]||C(e),0===m&&0===y&&E())}},r.t=function(e,t){return 1&t&&(e=r(e)),P.t(e,-2&t)},r}function c(t){var r={_acceptedDependencies:{},_declinedDependencies:{},_selfAccepted:!1,_selfDeclined:!1,_selfInvalidated:!1,_disposeHandlers:[],_main:n!==t,active:!0,accept:function(e,t){if(void 0===e)r._selfAccepted=!0;else if("function"==typeof e)r._selfAccepted=e;else if("object"==typeof e)for(var n=0;n<e.length;n++)r._acceptedDependencies[e[n]]=t||function(){};else r._acceptedDependencies[e]=t||function(){}},decline:function(e){if(void 0===e)r._selfDeclined=!0;else if("object"==typeof e)for(var t=0;t<e.length;t++)r._declinedDependencies[e[t]]=!0;else r._declinedDependencies[e]=!0},dispose:function(e){r._disposeHandlers.push(e)},addDisposeHandler:function(e){r._disposeHandlers.push(e)},removeDisposeHandler:function(e){var t=r._disposeHandlers.indexOf(e);t>=0&&r._disposeHandlers.splice(t,1)},invalidate:function(){switch(this._selfInvalidated=!0,l){case"idle":(p={})[t]=e[t],d("ready");break;case"ready":I(t);break;case"prepare":case"check":case"dispose":case"apply":(v=v||[]).push(t)}},check:O,apply:A,status:function(e){if(!e)return l;f.push(e)},addStatusHandler:function(e){f.push(e)},removeStatusHandler:function(e){var t=f.indexOf(e);t>=0&&f.splice(t,1)},data:o[t]};return n=void 0,r}var f=[],l="idle";function d(e){l=e;for(var t=0;t<f.length;t++)f[t].call(null,e)}var h,p,g,v,y=0,m=0,b={},S={},w={};function _(e){return+e+""===e?+e:e}function O(e){if("idle"!==l)throw new Error("check() is only allowed in idle status");return r=e,d("check"),(t=1e4,t=t||1e4,new Promise((function(e,n){if("undefined"==typeof XMLHttpRequest)return n(new Error("No browser support"));try{var r=new XMLHttpRequest,o=P.p+""+i+".hot-update.json";r.open("GET",o,!0),r.timeout=t,r.send(null)}catch(e){return n(e)}r.onreadystatechange=function(){if(4===r.readyState)if(0===r.status)n(new Error("Manifest request to "+o+" timed out."));else if(404===r.status)e();else if(200!==r.status&&304!==r.status)n(new Error("Manifest request to "+o+" failed."));else{try{var t=JSON.parse(r.responseText)}catch(e){return void n(e)}e(t)}}}))).then((function(e){if(!e)return d(j()?"ready":"idle"),null;S={},b={},w=e.c,g=e.h,d("prepare");var t=new Promise((function(e,t){h={resolve:e,reject:t}}));p={};return C(0),"prepare"===l&&0===m&&0===y&&E(),t}));var t}function C(e){w[e]?(S[e]=!0,y++,function(e){var t=document.createElement("script");t.charset="utf-8",t.src=P.p+""+e+"."+i+".hot-update.js",document.head.appendChild(t)}(e)):b[e]=!0}function E(){d("ready");var e=h;if(h=null,e)if(r)Promise.resolve().then((function(){return A(r)})).then((function(t){e.resolve(t)}),(function(t){e.reject(t)}));else{var t=[];for(var n in p)Object.prototype.hasOwnProperty.call(p,n)&&t.push(_(n));e.resolve(t)}}function A(t){if("ready"!==l)throw new Error("apply() is only allowed in ready status");return function t(r){var a,u,c,f,l;function h(e){for(var t=[e],n={},r=t.map((function(e){return{chain:[e],id:e}}));r.length>0;){var i=r.pop(),o=i.id,s=i.chain;if((f=x[o])&&(!f.hot._selfAccepted||f.hot._selfInvalidated)){if(f.hot._selfDeclined)return{type:"self-declined",chain:s,moduleId:o};if(f.hot._main)return{type:"unaccepted",chain:s,moduleId:o};for(var a=0;a<f.parents.length;a++){var u=f.parents[a],c=x[u];if(c){if(c.hot._declinedDependencies[o])return{type:"declined",chain:s.concat([u]),moduleId:o,parentId:u};-1===t.indexOf(u)&&(c.hot._acceptedDependencies[o]?(n[u]||(n[u]=[]),y(n[u],[o])):(delete n[u],t.push(u),r.push({chain:s.concat([u]),id:u})))}}}}return{type:"accepted",moduleId:e,outdatedModules:t,outdatedDependencies:n}}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];-1===e.indexOf(r)&&e.push(r)}}j();var m={},b=[],S={},O=function(){console.warn("[HMR] unexpected require("+E.moduleId+") to disposed module")};for(var C in p)if(Object.prototype.hasOwnProperty.call(p,C)){var E;l=_(C),E=p[C]?h(l):{type:"disposed",moduleId:C};var A=!1,I=!1,k=!1,T="";switch(E.chain&&(T="\nUpdate propagation: "+E.chain.join(" -> ")),E.type){case"self-declined":r.onDeclined&&r.onDeclined(E),r.ignoreDeclined||(A=new Error("Aborted because of self decline: "+E.moduleId+T));break;case"declined":r.onDeclined&&r.onDeclined(E),r.ignoreDeclined||(A=new Error("Aborted because of declined dependency: "+E.moduleId+" in "+E.parentId+T));break;case"unaccepted":r.onUnaccepted&&r.onUnaccepted(E),r.ignoreUnaccepted||(A=new Error("Aborted because "+l+" is not accepted"+T));break;case"accepted":r.onAccepted&&r.onAccepted(E),I=!0;break;case"disposed":r.onDisposed&&r.onDisposed(E),k=!0;break;default:throw new Error("Unexception type "+E.type)}if(A)return d("abort"),Promise.reject(A);if(I)for(l in S[l]=p[l],y(b,E.outdatedModules),E.outdatedDependencies)Object.prototype.hasOwnProperty.call(E.outdatedDependencies,l)&&(m[l]||(m[l]=[]),y(m[l],E.outdatedDependencies[l]));k&&(y(b,[E.moduleId]),S[l]=O)}var U,R=[];for(u=0;u<b.length;u++)l=b[u],x[l]&&x[l].hot._selfAccepted&&S[l]!==O&&!x[l].hot._selfInvalidated&&R.push({module:l,parents:x[l].parents.slice(),errorHandler:x[l].hot._selfAccepted});d("dispose"),Object.keys(w).forEach((function(e){!1===w[e]&&function(e){delete installedChunks[e]}(e)}));var L,D,M=b.slice();for(;M.length>0;)if(l=M.pop(),f=x[l]){var N={},B=f.hot._disposeHandlers;for(c=0;c<B.length;c++)(a=B[c])(N);for(o[l]=N,f.hot.active=!1,delete x[l],delete m[l],c=0;c<f.children.length;c++){var F=x[f.children[c]];F&&((U=F.parents.indexOf(l))>=0&&F.parents.splice(U,1))}}for(l in m)if(Object.prototype.hasOwnProperty.call(m,l)&&(f=x[l]))for(D=m[l],c=0;c<D.length;c++)L=D[c],(U=f.children.indexOf(L))>=0&&f.children.splice(U,1);d("apply"),void 0!==g&&(i=g,g=void 0);for(l in p=void 0,S)Object.prototype.hasOwnProperty.call(S,l)&&(e[l]=S[l]);var z=null;for(l in m)if(Object.prototype.hasOwnProperty.call(m,l)&&(f=x[l])){D=m[l];var K=[];for(u=0;u<D.length;u++)if(L=D[u],a=f.hot._acceptedDependencies[L]){if(-1!==K.indexOf(a))continue;K.push(a)}for(u=0;u<K.length;u++){a=K[u];try{a(D)}catch(e){r.onErrored&&r.onErrored({type:"accept-errored",moduleId:l,dependencyId:D[u],error:e}),r.ignoreErrored||z||(z=e)}}}for(u=0;u<R.length;u++){var q=R[u];l=q.module,s=q.parents,n=l;try{P(l)}catch(e){if("function"==typeof q.errorHandler)try{q.errorHandler(e)}catch(t){r.onErrored&&r.onErrored({type:"self-accept-error-handler-errored",moduleId:l,error:t,originalError:e}),r.ignoreErrored||z||(z=t),z||(z=e)}else r.onErrored&&r.onErrored({type:"self-accept-errored",moduleId:l,error:e}),r.ignoreErrored||z||(z=e)}}if(z)return d("fail"),Promise.reject(z);if(v)return t(r).then((function(e){return b.forEach((function(t){e.indexOf(t)<0&&e.push(t)})),e}));return d("idle"),new Promise((function(e){e(b)}))}(t=t||{})}function j(){if(v)return p||(p={}),v.forEach(I),v=void 0,!0}function I(t){Object.prototype.hasOwnProperty.call(p,t)||(p[t]=e[t])}var x={};function P(t){if(x[t])return x[t].exports;var n=x[t]={i:t,l:!1,exports:{},hot:c(t),parents:(a=s,s=[],a),children:[]};return e[t].call(n.exports,n,n.exports,u(t)),n.l=!0,n.exports}P.m=e,P.c=x,P.d=function(e,t,n){P.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},P.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},P.t=function(e,t){if(1&t&&(e=P(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(P.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)P.d(n,r,function(t){return e[t]}.bind(null,r));return n},P.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return P.d(t,"a",t),t},P.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},P.p="",P.h=function(){return i},u(87)(P.s=87)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return u})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return l})),n.d(t,"h",(function(){return d})),n.d(t,"d",(function(){return v})),n.d(t,"c",(function(){return y}));var r=n(1),i=function(){var e=[],t=[],n=new Set,a=function(n){return e.forEach((function(e){n.add(e.middleware,Object(r.__assign)({},e))})),t.forEach((function(e){n.addRelativeTo(e.middleware,Object(r.__assign)({},e))})),n},u=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(r.__spread)(u(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(r.__spread)(u(e)))})),t},c=function(){var n,i=[],a=[],c={};return e.forEach((function(e){var t=Object(r.__assign)(Object(r.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),i.push(t)})),t.forEach((function(e){var t=Object(r.__assign)(Object(r.__assign)({},e),{before:[],after:[]});t.name&&(c[t.name]=t),a.push(t)})),a.forEach((function(e){if(e.toMiddleware){var t=c[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=i,n.sort((function(e,t){return o[t.step]-o[e.step]||s[t.priority||"normal"]-s[e.priority||"normal"]}))).map(u).reduce((function(e,t){return e.push.apply(e,Object(r.__spread)(t)),e}),[]).map((function(e){return e.middleware}))},f={add:function(t,i){void 0===i&&(i={});var o=i.name,s=Object(r.__assign)({step:"initialize",priority:"normal",middleware:t},i);if(o){if(n.has(o))throw new Error("Duplicate middleware name '"+o+"'");n.add(o)}e.push(s)},addRelativeTo:function(e,i){var o=i.name,s=Object(r.__assign)({middleware:e},i);if(o){if(n.has(o))throw new Error("Duplicated middleware name '"+o+"'");n.add(o)}t.push(s)},clone:function(){return a(i())},use:function(e){e.applyToStack(f)},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=a(i());return t.use(e),t},applyToStack:a,resolve:function(e,t){var n,i;try{for(var o=Object(r.__values)(c().reverse()),s=o.next();!s.done;s=o.next()){e=(0,s.value)(e,t)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e}};return f},o={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},s={high:3,normal:2,low:1},a=function(){function e(e){this.middlewareStack=i(),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}(),u=function(){this.middlewareStack=i()};function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}var f=function(e){return Array.isArray(e)?e:[e]},l=function(e){for(var t in e)e.hasOwnProperty(t)&&void 0!==e[t]["#text"]?e[t]=e[t]["#text"]:"object"==typeof e[t]&&null!==e[t]&&(e[t]=l(e[t]));return e};function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"object"==typeof e&&("__type"in e&&t.indexOf(e.__type)>-1||"name"in e&&t.indexOf(e.name)>-1)}var h=function(){var e=Object.getPrototypeOf(this).constructor,t=Function.bind.apply(String,Object(r.__spread)([null],arguments)),n=new t;return Object.setPrototypeOf(n,e.prototype),n};h.prototype=Object.create(String.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf(h,String);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Object(r.__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))}}(h);var p=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function v(e){var t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),a=e.getUTCSeconds();return p[r]+", "+(i<10?"0"+i:""+i)+" "+g[n]+" "+t+" "+(o<10?"0"+o:""+o)+":"+(s<10?"0"+s:""+s)+":"+(a<10?"0"+a:""+a)+" GMT"}var y="***SensitiveInformation***"},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 h})),n.d(t,"__values",(function(){return p})),n.d(t,"__read",(function(){return g})),n.d(t,"__spread",(function(){return v})),n.d(t,"__spreadArrays",(function(){return y})),n.d(t,"__await",(function(){return m})),n.d(t,"__asyncGenerator",(function(){return b})),n.d(t,"__asyncDelegator",(function(){return S})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return _})),n.d(t,"__importStar",(function(){return O})),n.d(t,"__importDefault",(function(){return C})),n.d(t,"__classPrivateFieldGet",(function(){return E})),n.d(t,"__classPrivateFieldSet",(function(){return A}));
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function 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 h(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function p(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 g(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 v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e}function y(){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 m(e){return this instanceof m?(this.v=e,this):new m(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 m?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 S(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:m(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(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 _(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function O(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 C(e){return e&&e.__esModule?e:{default:e}}function E(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function A(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(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));var r=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}(),i=n(1),o=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(i.__assign)(Object(i.__assign)({},this),{headers:Object(i.__assign)({},this.headers)}));return n.query&&(n.query=(t=n.query,Object.keys(t).reduce((function(e,n){var r,o=t[n];return Object(i.__assign)(Object(i.__assign)({},e),((r={})[n]=Array.isArray(o)?Object(i.__spread)(o):o,r))}),{}))),n},e}()},function(e,t,n){"use strict";(function(e){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
var r=n(88),i=n(89),o=n(90);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|p(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|h(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|h(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function d(e,t){var n=t.length<0?0:0|h(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function h(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return j(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return E(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 v(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(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:m(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):m(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function m(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 S(e,t,n,r){return K(F(t,e.length-n),e,n,r)}function w(e,t,n,r){return K(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n,r){return w(e,t,n,r)}function O(e,t,n,r){return K(z(t),e,n,r)}function C(e,t,n,r){return K(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 E(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function A(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=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,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 y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(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 S(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return O(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(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 j(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 I(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 x(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+=B(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 k(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,n,r,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 U(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 R(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 L(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||L(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function M(e,t,n,r,o){return o||L(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||k(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||k(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||k(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||k(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||k(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||k(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||k(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||k(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||k(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||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||k(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||k(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||k(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||k(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||k(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||k(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||k(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||k(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)||T(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)||T(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||T(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);T(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);T(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||T(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):U(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):U(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return 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 M(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return M(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:F(new u(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,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 z(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(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(53))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1);var i={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"]},o={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"]};function s(e,t,n){return{applyToStack:function(s){s.add(function(e,t){var n=this;return function(i){return function(o){return Object(r.__awaiter)(n,void 0,void 0,(function(){var n,s;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,i(o)];case 1:return n=r.sent().response,[4,t(n,e)];case 2:return s=r.sent(),[2,{response:n,output:s}]}}))}))}}}(e,n),i),s.add(function(e,t){var n=this;return function(i){return function(o){return Object(r.__awaiter)(n,void 0,void 0,(function(){var n;return Object(r.__generator)(this,(function(s){switch(s.label){case 0:return[4,t(o.input,e)];case 1:return n=s.sent(),[2,i(Object(r.__assign)(Object(r.__assign)({},o),{request:n}))]}}))}))}}}(e,t),o)}}}},function(e,t,n){var r;e.exports=(r=r||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){t=t;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o<t;o+=4){var a=i(4294967296*(n||e.random()));n=987654071*a(),r.push(4294967296*a()|0)}return new s.init(r,t)}}),a=r.enc={},u=a.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},c=a.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},f=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,a=i/(4*o),u=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,c=e.min(4*u,i);if(u){for(var f=0;f<u;f+=o)this._doProcessBlock(r,f);var l=r.splice(0,u);n.sigBytes-=c}return new s.init(l,c)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),d=(i.Hasher=l.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new d.HMAC.init(e,n).finalize(t)}}}),r.algo={});return r}(Math),r)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return u}));for(var r={},i={},o=0;o<256;o++){var s=o.toString(16).toLowerCase();1===s.length&&(s="0"+s),r[o]=s,i[s]=o}function a(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 i))throw new Error("Cannot decode unrecognized sequence "+r+" as hexadecimal");t[n/2]=i[r]}return t}function u(e){for(var t="",n=0;n<e.byteLength;n++)t+=r[e[n]];return t}},,function(e,t,n){"use strict";var r=n(64),i=n(120),o=Object.prototype.toString;function s(e){return"[object Array]"===o.call(e)}function a(e){return null!==e&&"object"==typeof e}function u(e){return"[object Function]"===o.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:s,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:i,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:a,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return a(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]="object"==typeof n?e({},n):n}for(var r=0,i=arguments.length;r<i;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,i){e[i]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return v}));var r=[{type:"text/plain",ext:"txt"},{type:"text/html",ext:"html"},{type:"text/javascript",ext:"js"},{type:"text/css",ext:"css"},{type:"text/csv",ext:"csv"},{type:"text/yaml",ext:"yml"},{type:"text/yaml",ext:"yaml"},{type:"text/calendar",ext:"ics"},{type:"text/calendar",ext:"ical"},{type:"image/apng",ext:"apng"},{type:"image/bmp",ext:"bmp"},{type:"image/gif",ext:"gif"},{type:"image/x-icon",ext:"ico"},{type:"image/x-icon",ext:"cur"},{type:"image/jpeg",ext:"jpg"},{type:"image/jpeg",ext:"jpeg"},{type:"image/jpeg",ext:"jfif"},{type:"image/jpeg",ext:"pjp"},{type:"image/jpeg",ext:"pjpeg"},{type:"image/png",ext:"png"},{type:"image/svg+xml",ext:"svg"},{type:"image/tiff",ext:"tif"},{type:"image/tiff",ext:"tiff"},{type:"image/webp",ext:"webp"},{type:"application/json",ext:"json"},{type:"application/xml",ext:"xml"},{type:"application/x-sh",ext:"sh"},{type:"application/zip",ext:"zip"},{type:"application/x-rar-compressed",ext:"rar"},{type:"application/x-tar",ext:"tar"},{type:"application/x-bzip",ext:"bz"},{type:"application/x-bzip2",ext:"bz2"},{type:"application/pdf",ext:"pdf"},{type:"application/java-archive",ext:"jar"},{type:"application/msword",ext:"doc"},{type:"application/vnd.ms-excel",ext:"xls"},{type:"application/vnd.ms-excel",ext:"xlsx"},{type:"message/rfc822",ext:"eml"}],i=function(e){return void 0===e&&(e={}),0===Object.keys(e).length},o=function(e,t,n){if(!e||!e.sort)return!1;var r=n&&"desc"===n?-1:1;return e.sort((function(e,n){var i=e[t],o=n[t];return void 0===o?void 0===i?0:1*r:void 0===i||i<o?-1*r:i>o?1*r:0})),!0},s=function(e,t){var n=Object.assign({},e);return t&&("string"==typeof t?delete n[t]:t.forEach((function(e){delete n[e]}))),n},a=function(e,t){void 0===t&&(t="application/octet-stream");var n=e.toLowerCase(),i=r.filter((function(e){return n.endsWith("."+e.ext)}));return i.length>0?i[0].type:t},u=function(e){var t=e.toLowerCase();return!!t.startsWith("text/")||("application/json"===t||"application/xml"===t||"application/sh"===t)},c=function(){for(var e="",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=32;n>0;n-=1)e+=t[Math.floor(Math.random()*t.length)];return e},f=function(e){if(e.isResolved)return e;var t=!0,n=!1,r=!1,i=e.then((function(e){return r=!0,t=!1,e}),(function(e){throw n=!0,t=!1,e}));return i.isFullfilled=function(){return r},i.isPending=function(){return t},i.isRejected=function(){return n},i},l=function(){if("undefined"==typeof self)return!1;var e=self;return void 0!==e.WorkerGlobalScope&&self instanceof e.WorkerGlobalScope},d=function(){return{isBrowser:"undefined"!=typeof window&&void 0!==window.document,isNode:void 0!==e&&null!=e.versions&&null!=e.versions.node}},h=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!g(e))return e;var r={};for(var i in e){if(e.hasOwnProperty(i))r[t.includes(i)?i:i[0].toLowerCase()+i.slice(1)]=n.includes(i)?e[i]:h(e[i],t,n)}return r},p=function(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),!g(e))return e;var r={};for(var i in e){if(e.hasOwnProperty(i))r[t.includes(i)?i:i[0].toUpperCase()+i.slice(1)]=n.includes(i)?e[i]:p(e[i],t,n)}return r},g=function(e){return!(!(e instanceof Object)||e instanceof Array||e instanceof Function||e instanceof Number||e instanceof String||e instanceof Boolean)},v=function(){function e(){}return e.isEmpty=i,e.sortByField=o,e.objectLessAttributes=s,e.filenameToContentType=a,e.isTextFile=u,e.generateRandomString=c,e.makeQuerablePromise=f,e.isWebWorker=l,e.browserOrNode=d,e.transferKeyToLowerCase=h,e.transferKeyToUpperCase=p,e.isStrictObject=g,e}()}).call(this,n(56))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(18),i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},o=new r.a("Amplify"),s=new(function(){function e(){this._components=[],this._config={},this._modules={},this.Auth=null,this.Analytics=null,this.API=null,this.Credentials=null,this.Storage=null,this.I18n=null,this.Cache=null,this.PubSub=null,this.Interactions=null,this.Pushnotification=null,this.UI=null,this.XR=null,this.Predictions=null,this.DataStore=null,this.Logger=r.a,this.ServiceWorker=null}return e.prototype.register=function(e){o.debug("component registered in amplify",e),this._components.push(e),"function"==typeof e.getModuleName?(this._modules[e.getModuleName()]=e,this[e.getModuleName()]=e):o.debug("no getModuleName method for component",e),e.configure(this._config)},e.prototype.configure=function(e){var t=this;return e?(this._config=Object.assign(this._config,e),o.debug("amplify config",this._config),Object.entries(this._modules).forEach((function(e){var n=i(e,2),r=(n[0],n[1]);Object.keys(r).forEach((function(e){t._modules[e]&&(r[e]=t._modules[e])}))})),this._components.map((function(e){e.configure(t._config)})),this._config):this._config},e.prototype.addPluggable=function(e){e&&e.getCategory&&"function"==typeof e.getCategory&&this._components.map((function(t){t.addPluggable&&"function"==typeof t.addPluggable&&t.addPluggable(e)}))},e}())},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return g})),n.d(t,"c",(function(){return y}));var r=n(1),i={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high"},o=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){return Object(r.__generator)(this,(function(r){return[2,e.retryStrategy.retry(t,n)]}))}))}}}(e),i)}}},s=n(2),a=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],u=["Throttling","ThrottlingException","ThrottledException","RequestThrottledException","TooManyRequestsException","ProvisionedThroughputExceededException","TransactionInProgressException","RequestLimitExceeded","BandwidthLimitExceeded","LimitExceededException","RequestThrottled","SlowDown","PriorRequestNotComplete","EC2ThrottledException"],c=["AbortError","TimeoutError","RequestTimeout","RequestTimeoutException"],f=[500,502,503,504],l=function(e){var t;return u.includes(e.name)||1==(null===(t=e.$retryable)||void 0===t?void 0:t.throttling)},d=n(76),h=function(e,t){return Math.floor(Math.min(2e4,Math.random()*Math.pow(2,t)*e))},p=function(e){return!!e&&(function(e){return void 0!==e.$retryable}(e)||function(e){return a.includes(e.name)}(e)||l(e)||function(e){var t;return c.includes(e.name)||f.includes((null===(t=e.$metadata)||void 0===t?void 0:t.httpStatusCode)||0)}(e))},g=3,v=function(){function e(e,t){var n,r,i,o,s,a,u,c;this.maxAttemptsProvider=e,this.retryDecider=null!==(n=null==t?void 0:t.retryDecider)&&void 0!==n?n:p,this.delayDecider=null!==(r=null==t?void 0:t.delayDecider)&&void 0!==r?r:h,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(r.__awaiter)(this,void 0,void 0,(function(){var e;return Object(r.__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=g,[3,3];case 3:return[2,e]}}))}))},e.prototype.retry=function(e,t){return Object(r.__awaiter)(this,void 0,void 0,(function(){var n,i,o,a,u,c,f,h;return Object(r.__generator)(this,(function(p){switch(p.label){case 0:return i=0,o=0,[4,this.getMaxAttempts()];case 1:a=p.sent(),u=t.request,s.a.isInstance(u)&&(u.headers["amz-sdk-invocation-id"]=Object(d.v4)()),c=function(){var c,d,h,p,g;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,5]),s.a.isInstance(u)&&(u.headers["amz-sdk-request"]="attempt="+(i+1)+"; max="+a),[4,e(t)];case 1:return c=r.sent(),d=c.response,h=c.output,f.retryQuota.releaseRetryTokens(n),h.$metadata.attempts=i+1,h.$metadata.totalRetryDelay=o,[2,{value:{response:d,output:h}}];case 2:return p=r.sent(),i++,f.shouldRetry(p,i,a)?(n=f.retryQuota.retrieveRetryTokens(p),g=f.delayDecider(l(p)?500:100,i),o+=g,[4,new Promise((function(e){return setTimeout(e,g)}))]):[3,4];case 3:return r.sent(),[2,"continue"];case 4:throw p.$metadata||(p.$metadata={}),p.$metadata.attempts=i,p.$metadata.totalRetryDelay=o,p;case 5:return[2]}}))},f=this,p.label=2;case 2:return[5,c()];case 3:return"object"==typeof(h=p.sent())?[2,h.value]:[3,2];case 4:return[2]}}))}))},e}(),y=function(e){var t=m(e.maxAttempts);return Object(r.__assign)(Object(r.__assign)({},e),{maxAttempts:t,retryStrategy:e.retryStrategy||new v(t)})},m=function(e){if(void 0===e&&(e=g),"number"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},function(e,t,n){"use strict";var r=n(93),i=n(95);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){i.isString(e)&&(e=b(e));return e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(c),l=["%","/","?",";","#"].concat(f),d=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=n(96);function b(e,t,n){if(e&&i.isObject(e)&&e instanceof o)return e;var r=new o;return r.parse(e,t,n),r}o.prototype.parse=function(e,t,n){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),a=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(a);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(a);if(b=b.trim(),!n&&1===e.split("#").length){var S=u.exec(b);if(S)return this.path=b,this.href=b,this.pathname=S[1],S[2]?(this.search=S[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=s.exec(b);if(w){var _=(w=w[0]).toLowerCase();this.protocol=_,b=b.substr(w.length)}if(n||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var O="//"===b.substr(0,2);!O||w&&v[w]||(b=b.substr(2),this.slashes=!0)}if(!v[w]&&(O||w&&!y[w])){for(var C,E,A=-1,j=0;j<d.length;j++){-1!==(I=b.indexOf(d[j]))&&(-1===A||I<A)&&(A=I)}-1!==(E=-1===A?b.lastIndexOf("@"):b.lastIndexOf("@",A))&&(C=b.slice(0,E),b=b.slice(E+1),this.auth=decodeURIComponent(C)),A=-1;for(j=0;j<l.length;j++){var I;-1!==(I=b.indexOf(l[j]))&&(-1===A||I<A)&&(A=I)}-1===A&&(A=b.length),this.host=b.slice(0,A),b=b.slice(A),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var P=this.hostname.split(/\./),k=(j=0,P.length);j<k;j++){var T=P[j];if(T&&!T.match(h)){for(var U="",R=0,L=T.length;R<L;R++)T.charCodeAt(R)>127?U+="x":U+=T[R];if(!U.match(h)){var D=P.slice(0,j),M=P.slice(j+1),N=T.match(p);N&&(D.push(N[1]),M.unshift(N[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+B,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[_])for(j=0,k=f.length;j<k;j++){var z=f[j];if(-1!==b.indexOf(z)){var K=encodeURIComponent(z);K===z&&(K=escape(z)),b=b.split(z).join(K)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=m.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var V=this.search||"";this.path=B+V}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",o=!1,s="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(s=m.stringify(this.query));var a=this.search||s&&"?"+s||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==o?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),r&&"#"!==r.charAt(0)&&(r="#"+r),a&&"?"!==a.charAt(0)&&(a="?"+a),t+o+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+r},o.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var n=new o,r=Object.keys(this),s=0;s<r.length;s++){var a=r[s];n[a]=this[a]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var f=u[c];"protocol"!==f&&(n[f]=e[f])}return y[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!y[e.protocol]){for(var l=Object.keys(e),d=0;d<l.length;d++){var h=l[d];n[h]=e[h]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||v[e.protocol])n.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),n.pathname=p.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var g=n.pathname||"",m=n.search||"";n.path=g+m}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),S=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=S||b||n.host&&e.pathname,_=w,O=n.pathname&&n.pathname.split("/")||[],C=(p=e.pathname&&e.pathname.split("/")||[],n.protocol&&!y[n.protocol]);if(C&&(n.hostname="",n.port=null,n.host&&(""===O[0]?O[0]=n.host:O.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===O[0])),S)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,O=p;else if(p.length)O||(O=[]),O.pop(),O=O.concat(p),n.search=e.search,n.query=e.query;else if(!i.isNullOrUndefined(e.search)){if(C)n.hostname=n.host=O.shift(),(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.host=n.hostname=x.shift());return n.search=e.search,n.query=e.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!O.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var E=O.slice(-1)[0],A=(n.host||e.host||O.length>1)&&("."===E||".."===E)||""===E,j=0,I=O.length;I>=0;I--)"."===(E=O[I])?O.splice(I,1):".."===E?(O.splice(I,1),j++):j&&(O.splice(I,1),j--);if(!w&&!_)for(;j--;j)O.unshift("..");!w||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),A&&"/"!==O.join("/").substr(-1)&&O.push("");var x,P=""===O[0]||O[0]&&"/"===O[0].charAt(0);C&&(n.hostname=n.host=P?"":O.length?O.shift():"",(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.host=n.hostname=x.shift()));return(w=w||n.host&&O.length)&&!P&&O.unshift(""),O.length?n.pathname=O.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";const r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+i+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),i=r.length;for(let o=0;o<i;o++)e[r[o]]="strict"===n?[t[r[o]]]:t[r[o]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.buildOptions=function(e,t,n){var r={};if(!e)return t;for(let i=0;i<n.length;i++)void 0!==e[n[i]]?r[n[i]]=e[n[i]]:r[n[i]]=t[n[i]];return r},t.isName=function(e){const t=o.exec(e);return!(null==t)},t.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const i=[],o=r.length;for(let e=0;e<o;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n},t.nameRegexp=i},function(e,t,n){"use strict";function r(e){var t=encodeURIComponent(e);return t=t.replace(/[!'()*]/g,i)}function i(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}n.d(t,"a",(function(){return r}));n(1)},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return l}));for(var r={},i=new Array(64),o=0,s="A".charCodeAt(0),a="Z".charCodeAt(0);o+s<=a;o++){var u=String.fromCharCode(o+s);r[u]=o,i[o]=u}for(o=0,s="a".charCodeAt(0),a="z".charCodeAt(0);o+s<=a;o++){u=String.fromCharCode(o+s);var c=o+26;r[u]=c,i[c]=u}for(o=0;o<10;o++){r[o.toString(10)]=o+52;u=o.toString(10),c=o+52;r[u]=c,i[c]=u}r["+"]=62,i[62]="+",r["/"]=63,i[63]="/";function f(e){var t=e.length/4*3;"=="===e.substr(-2)?t-=2:"="===e.substr(-1)&&t--;for(var n=new ArrayBuffer(t),i=new DataView(n),o=0;o<e.length;o+=4){for(var s=0,a=0,u=o,c=o+3;u<=c;u++)"="!==e[u]?(s|=r[e[u]]<<6*(c-u),a+=6):s>>=6;var f=o/4*3;s>>=a%8;for(var l=Math.floor(a/8),d=0;d<l;d++){var h=8*(l-d-1);i.setUint8(f+d,(s&255<<h)>>h)}}return new Uint8Array(n)}function l(e){for(var t="",n=0;n<e.length;n+=3){for(var r=0,o=0,s=n,a=Math.min(n+3,e.length);s<a;s++)r|=e[s]<<8*(a-s-1),o+=8;var u=Math.ceil(o/6);r<<=6*u-o;for(var c=1;c<=u;c++){var f=6*(u-c);t+=i[(r&63<<f)>>f]}t+="==".slice(0,4-u)}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var r=n(1),i=n(2),o=n(21);var s=function(){function e(e){void 0===e&&(e={}),this.httpOptions=e}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=null==t?void 0:t.abortSignal,s=this.httpOptions.requestTimeout;if(null==n?void 0:n.aborted){var a=new Error("Request aborted");return a.name="AbortError",Promise.reject(a)}var u=e.path;if(e.query){var c=Object(o.a)(e.query);c&&(u+="?"+c)}var f=e.port,l=e.protocol+"//"+e.hostname+(f?":"+f:"")+u,d={body:e.body,headers:new Headers(e.headers),method:e.method};"undefined"!=typeof AbortController&&(d.signal=n);var h,p=new Request(l,d),g=[fetch(p).then((function(e){var t,n,o=e.headers,s={};try{for(var a=Object(r.__values)(o.entries()),u=a.next();!u.done;u=a.next()){var c=u.value;s[c[0]]=c[1]}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return void 0!==e.body?{response:new i.b({headers:s,statusCode:e.status,body:e.body})}:e.blob().then((function(t){return{response:new i.b({headers:s,statusCode:e.status,body:t})}}))})),(h=s,void 0===h&&(h=0),new Promise((function(e,t){h&&setTimeout((function(){var e=new Error("Request did not complete within "+h+" ms");e.name="TimeoutError",t(e)}),h)})))];return n&&g.push(new Promise((function(e,t){n.onabort=function(){var e=new Error("Request aborted");e.name="AbortError",t(e)}}))),Promise.race(g)},e}(),a=n(15),u=function(e){return"function"==typeof Blob&&e instanceof Blob?function(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,c(e)];case 1:return t=r.sent(),n=Object(a.a)(t),[2,new Uint8Array(n)]}}))}))}(e):function(e){return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,o,s,a,u;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:t=new Uint8Array(0),n=e.getReader(),i=!1,r.label=1;case 1:return i?[3,3]:[4,n.read()];case 2:return o=r.sent(),s=o.done,(a=o.value)&&(u=t,(t=new Uint8Array(u.length+a.length)).set(u),t.set(a,u.length)),i=s,[3,1];case 3:return[2,t]}}))}))}(e)};function c(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)}))}},function(e,t,n){"use strict";function r(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)}function i(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)}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=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(r(arguments[t]));return e},o={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},s=function(){function e(e,t){void 0===t&&(t="WARN"),this.name=e,this.level=t}return e.prototype._padding=function(e){return e<10?"0"+e:""+e},e.prototype._ts=function(){var e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()},e.prototype._log=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.level;e.LOG_LEVEL&&(i=e.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(i=window.LOG_LEVEL);var s=o[i],a=o[t];if(a>=s){var u=console.log.bind(console);"ERROR"===t&&console.error&&(u=console.error.bind(console)),"WARN"===t&&console.warn&&(u=console.warn.bind(console));var c="["+t+"] "+this._ts()+" "+this.name;if(1===n.length&&"string"==typeof n[0])u(c+" - "+n[0]);else if(1===n.length)u(c,n[0]);else if("string"==typeof n[0]){var f=n.slice(1);1===f.length&&(f=f[0]),u(c+" - "+n[0],f)}else u(c,n)}},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["INFO"],e))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["INFO"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["WARN"],e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["ERROR"],e))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["DEBUG"],e))},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._log.apply(this,i(["VERBOSE"],e))},e.LOG_LEVEL=null,e}()},function(e,t,n){var r,i;
/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */!function(o){if(void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i),!0,e.exports=o(),!!0){var s=window.Cookies,a=window.Cookies=o();a.noConflict=function(){return window.Cookies=s,a}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function i(){}function o(t,n,o){if("undefined"!=typeof document){"number"==typeof(o=e({path:"/"},i.defaults,o)).expires&&(o.expires=new Date(1*new Date+864e5*o.expires)),o.expires=o.expires?o.expires.toUTCString():"";try{var s=JSON.stringify(n);/^[\{\[]/.test(s)&&(n=s)}catch(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var u in o)o[u]&&(a+="; "+u,!0!==o[u]&&(a+="="+o[u].split(";")[0]));return document.cookie=t+"="+n+a}}function s(e,n){if("undefined"!=typeof document){for(var i={},o=document.cookie?document.cookie.split("; "):[],s=0;s<o.length;s++){var a=o[s].split("="),u=a.slice(1).join("=");n||'"'!==u.charAt(0)||(u=u.slice(1,-1));try{var c=t(a[0]);if(u=(r.read||r)(u,c)||t(u),n)try{u=JSON.parse(u)}catch(e){}if(i[c]=u,e===c)break}catch(e){}}return e?i[e]:i}}return i.set=o,i.get=function(e){return s(e,!1)},i.getJSON=function(e){return s(e,!0)},i.remove=function(t,n){o(t,"",e(n,{expires:-1}))},i.defaults={},i.withConverter=n,i}((function(){}))}))},,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(1),i=n(14);function o(e){var t,n,o=[];try{for(var s=Object(r.__values)(Object.keys(e).sort()),a=s.next();!a.done;a=s.next()){var u=a.value,c=e[u];if(u=Object(i.a)(u),Array.isArray(c))for(var f=0,l=c.length;f<l;f++)o.push(u+"="+Object(i.a)(c[f]));else{var d=u;(c||"string"==typeof c)&&(d+="="+Object(i.a)(c)),o.push(d)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o.join("&")}},function(e,t,n){var r;e.exports=(r=n(5),n(28),n(91),r.HmacSHA256)},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return a}));var r=n(1),i=n(2);function o(e){return e}var s={name:"hostHeaderMiddleware",step:"build",tags:["HOST"]},a=function(e){return{applyToStack:function(t){t.add(function(e){return function(t){return function(n){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var o,s;return Object(r.__generator)(this,(function(r){return i.a.isInstance(n.request)?(o=n.request,s=(e.requestHandler.metadata||{}).handlerProtocol,(void 0===s?"":s).indexOf("h2")>=0&&!o.headers[":authority"]?(delete o.headers.host,o.headers[":authority"]=""):o.headers.host||(o.headers.host=o.hostname),[2,t(n)]):[2,t(n)]}))}))}}}(e),s)}}}},function(e,t,n){"use strict";
/*!
 * cookie
 * Copyright(c) 2012-2014 Roman Shtylman
 * Copyright(c) 2015 Douglas Christopher Wilson
 * MIT Licensed
 */t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},i=t||{},s=e.split(o),u=i.decode||r,c=0;c<s.length;c++){var f=s[c],l=f.indexOf("=");if(!(l<0)){var d=f.substr(0,l).trim(),h=f.substr(++l,f.length).trim();'"'==h[0]&&(h=h.slice(1,-1)),null==n[d]&&(n[d]=a(h,u))}}return n},t.serialize=function(e,t,n){var r=n||{},o=r.encode||i;if("function"!=typeof o)throw new TypeError("option encode is invalid");if(!s.test(e))throw new TypeError("argument name is invalid");var a=o(t);if(a&&!s.test(a))throw new TypeError("argument val is invalid");var u=e+"="+a;if(null!=r.maxAge){var c=r.maxAge-0;if(isNaN(c)||!isFinite(c))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+Math.floor(c)}if(r.domain){if(!s.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!s.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");u+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(u+="; HttpOnly");r.secure&&(u+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return u};var r=decodeURIComponent,i=encodeURIComponent,o=/; */,s=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function a(e,t){try{return t(e)}catch(t){return e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var r=n(1),i=function(e){var t;return Object(r.__assign)(Object(r.__assign)({},e),{tls:null===(t=e.tls)||void 0===t||t,endpoint:e.endpoint?o(e):function(){return s(e)}})},o=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},s=function(e){return Object(r.__awaiter)(void 0,void 0,void 0,(function(){var t,n,i,o,s;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return t=e.tls,n=void 0===t||t,[4,e.region()];case 1:if(i=r.sent(),!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(i))throw new Error("Invalid region in client config");return[4,e.regionInfoProvider(i)];case 2:if(!(o=(null!==(s=r.sent())&&void 0!==s?s:{}).hostname))throw new Error("Cannot resolve hostname from client config");return[2,e.urlParser((n?"https:":"http:")+"//"+o)]}}))}))},a=function(e){if(!e.region)throw new Error("Region is missing");return Object(r.__assign)(Object(r.__assign)({},e),{region:u(e.region)})},u=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return s}));var r=function(e){return e},i=n(1),o={name:"loggerMiddleware",tags:["LOGGER"],step:"finalizeRequest"},s=function(e){return{applyToStack:function(e){e.add((function(e,t){return function(n){return Object(i.__awaiter)(void 0,void 0,void 0,(function(){var r,o,s,a,u,c,f;return Object(i.__generator)(this,(function(l){switch(l.label){case 0:return r=t.logger,o=t.inputFilterSensitiveLog,s=t.outputFilterSensitiveLog,[4,e(n)];case 1:return a=l.sent(),r?(u=a.output,c=u.$metadata,f=Object(i.__rest)(u,["$metadata"]),"function"==typeof r.debug&&(r.debug({httpRequest:n.request}),r.debug({httpResponse:a.response})),"function"==typeof r.info&&r.info({$metadata:c,input:o(n.input),output:s(f)}),[2,a]):[2,a]}}))}))}}),o)}}}},function(e,t,n){"use strict";function r(e){return e}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));var i=n(1),o=n(2);var s={name:"getUserAgentMiddleware",step:"build",tags:["SET_USER_AGENT","USER_AGENT"]},a=function(e){return{applyToStack:function(t){var n;t.add((n=e,function(e){return function(t){var r=t.request;if(!o.a.isInstance(r))return e(t);var s=r.headers,a="node"===n.runtime?"user-agent":"x-amz-user-agent";return s[a]?s[a]+=" "+n.defaultUserAgent:s[a]=""+n.defaultUserAgent,n.customUserAgent&&(s[a]+=" "+n.customUserAgent),e(Object(i.__assign)(Object(i.__assign)({},t),{request:r}))}}),s)}}}},function(e,t,n){var r;e.exports=(r=n(5),function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,s=t.algo,a=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(a[i]=n(e.pow(r,.5))),u[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],f=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],a=n[4],f=n[5],l=n[6],d=n[7],h=0;h<64;h++){if(h<16)c[h]=0|e[t+h];else{var p=c[h-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=c[h-2],y=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;c[h]=g+c[h-7]+y+c[h-16]}var m=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),S=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+u[h]+c[h];d=l,l=f,f=a,a=s+S|0,s=o,o=i,i=r,r=S+(b+m)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+a|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)},function(e,t,n){var r,i,o;e.exports=(o=n(5),i=(r=o).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<n.length;o++)r[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var r=[],o=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2,u=n[e.charCodeAt(s)]>>>6-s%4*2;r[o>>>2]|=(a|u)<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},o.enc.Base64)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var r=function(e){return function(){throw new Error(e)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return l}));var r=n(1),i=n(42);function o(e){var t,n=this,o=s(e.credentials||e.credentialDefaultProvider(e)),a=e.signingEscapePath,u=void 0===a||a,c=e.systemClockOffset,f=void 0===c?e.systemClockOffset||0:c,l=e.sha256;return t=e.signer?s(e.signer):function(){return s(e.region)().then((function(t){return Object(r.__awaiter)(n,void 0,void 0,(function(){return Object(r.__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(r.__read)(t,2),s=n[0],a=n[1],c=s.signingRegion,f=void 0===c?e.signingRegion:c,d=s.signingService,h=void 0===d?e.signingName:d;return e.signingRegion=e.signingRegion||f||a,e.signingName=e.signingName||h,new i.a({credentials:o,region:e.signingRegion,service:e.signingName,sha256:l,uriEscapePath:u})}))},Object(r.__assign)(Object(r.__assign)({},e),{systemClockOffset:f,signingEscapePath:u,credentials:o,signer:t})}function s(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}var a=n(2),u=function(e){return new Date(Date.now()+e)};function c(e){return function(t,n){return function(i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,s,c,f,l,d,h,p,g;return Object(r.__generator)(this,(function(v){switch(v.label){case 0:return a.a.isInstance(i.request)?"function"!=typeof e.signer?[3,2]:[4,e.signer()]:[2,t(i)];case 1:return s=v.sent(),[3,3];case 2:s=e.signer,v.label=3;case 3:return o=s,f=t,l=[Object(r.__assign)({},i)],g={},[4,o.sign(i.request,{signingDate:new Date(Date.now()+e.systemClockOffset),signingRegion:n.signing_region,signingService:n.signing_service})];case 4:return[4,f.apply(void 0,[r.__assign.apply(void 0,l.concat([(g.request=v.sent(),g)]))])];case 5:return c=v.sent(),d=c.response.headers,(h=d&&(d.date||d.Date))&&(p=Date.parse(h),y=p,m=e.systemClockOffset,Math.abs(u(m).getTime()-y)>=3e5&&(e.systemClockOffset=p-Date.now())),[2,c]}var y,m}))}))}}}var f={name:"awsAuthMiddleware",tags:["SIGNATURE","AWSAUTH"],relation:"after",toMiddleware:"retryMiddleware"},l=function(e){return{applyToStack:function(t){t.addRelativeTo(c(e),f)}}}},function(e,t,n){"use strict";const r=n(13),i=n(13).buildOptions,o=n(114);"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,r.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const s={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",tagValueProcessor:function(e,t){return e},attrValueProcessor:function(e,t){return e},stopNodes:[]};t.defaultOptions=s;const a=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","stopNodes"];function u(e,t,n){return t&&(n.trimValues&&(t=t.trim()),t=f(t=n.tagValueProcessor(t,e),n.parseNodeValue,n.parseTrueNumberOnly)),t}function c(e,t){if(t.ignoreNameSpace){const t=e.split(":"),n="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=n+t[1])}return e}function f(e,t,n){if(t&&"string"==typeof e){let t;return""===e.trim()||isNaN(e)?t="true"===e||"false"!==e&&e:(-1!==e.indexOf("0x")?t=Number.parseInt(e,16):-1!==e.indexOf(".")?(t=Number.parseFloat(e),e=e.replace(/\.?0+$/,"")):t=Number.parseInt(e,10),n&&(t=String(t)===e?t:e)),t}return r.isExist(e)?e:""}t.props=a;const l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function d(e,t){if(!t.ignoreAttributes&&"string"==typeof e){e=e.replace(/\r?\n/g," ");const n=r.getAllMatches(e,l),i=n.length,o={};for(let e=0;e<i;e++){const r=c(n[e][1],t);r.length&&(void 0!==n[e][4]?(t.trimValues&&(n[e][4]=n[e][4].trim()),n[e][4]=t.attrValueProcessor(n[e][4],r),o[t.attributeNamePrefix+r]=f(n[e][4],t.parseAttributeValue,t.parseTrueNumberOnly)):t.allowBooleanAttributes&&(o[t.attributeNamePrefix+r]=!0))}if(!Object.keys(o).length)return;if(t.attrNodeName){const e={};return e[t.attrNodeName]=o,e}return o}}function h(e,t){let n,r="";for(let i=t;i<e.length;i++){let t=e[i];if(n)t===n&&(n="");else if('"'===t||"'"===t)n=t;else{if(">"===t)return{data:r,index:i};"\t"===t&&(t=" ")}r+=t}}function p(e,t,n,r){const i=e.indexOf(t,n);if(-1===i)throw new Error(r);return i+t.length-1}t.getTraversalObj=function(e,t){e=e.replace(/(\r\n)|\n/," "),t=i(t,s,a);const n=new o("!xml");let c=n,f="";for(let n=0;n<e.length;n++){if("<"===e[n])if("/"===e[n+1]){const i=p(e,">",n,"Closing Tag is not closed.");let o=e.substring(n+2,i).trim();if(t.ignoreNameSpace){const e=o.indexOf(":");-1!==e&&(o=o.substr(e+1))}c&&(c.val?c.val=r.getValue(c.val)+""+u(o,f,t):c.val=u(o,f,t)),t.stopNodes.length&&t.stopNodes.includes(c.tagname)&&(c.child=[],null==c.attrsMap&&(c.attrsMap={}),c.val=e.substr(c.startIndex+1,n-c.startIndex-1)),c=c.parent,f="",n=i}else if("?"===e[n+1])n=p(e,"?>",n,"Pi Tag is not closed.");else if("!--"===e.substr(n+1,3))n=p(e,"--\x3e",n,"Comment is not closed.");else if("!D"===e.substr(n+1,2)){const t=p(e,">",n,"DOCTYPE is not closed.");n=e.substring(n,t).indexOf("[")>=0?e.indexOf("]>",n)+1:t}else if("!["===e.substr(n+1,2)){const i=p(e,"]]>",n,"CDATA is not closed.")-2,s=e.substring(n+9,i);if(f&&(c.val=r.getValue(c.val)+""+u(c.tagname,f,t),f=""),t.cdataTagName){const e=new o(t.cdataTagName,c,s);c.addChild(e),c.val=r.getValue(c.val)+t.cdataPositionChar,s&&(e.val=s)}else c.val=(c.val||"")+(s||"");n=i+2}else{const i=h(e,n+1);let s=i.data;const a=i.index,l=s.indexOf(" ");let p=s;if(-1!==l&&(p=s.substr(0,l).trimRight(),s=s.substr(l+1)),t.ignoreNameSpace){const e=p.indexOf(":");-1!==e&&(p=p.substr(e+1))}if(c&&f&&"!xml"!==c.tagname&&(c.val=r.getValue(c.val)+""+u(c.tagname,f,t)),s.length>0&&s.lastIndexOf("/")===s.length-1){"/"===p[p.length-1]?(p=p.substr(0,p.length-1),s=p):s=s.substr(0,s.length-1);const e=new o(p,c,"");p!==s&&(e.attrsMap=d(s,t)),c.addChild(e)}else{const e=new o(p,c);t.stopNodes.length&&t.stopNodes.includes(e.tagname)&&(e.startIndex=a),p!==s&&(e.attrsMap=d(s,t)),c.addChild(e),c=e}f="",n=a}else f+=e[n]}return n}},function(e,t,n){"use strict";var r=n(10),i={keyPrefix:"aws-amplify-cache",capacityInBytes:1048576,itemMaxSize:21e4,defaultTTL:2592e5,defaultPriority:5,warningThreshold:.8,storage:(new(n(74).a)).getStorage()};function o(e){var t=0;t=e.length;for(var n=e.length;n>=0;n-=1){var r=e.charCodeAt(n);r>127&&r<=2047?t+=1:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&(n-=1)}return t}function s(){return(new Date).getTime()}function a(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)}var u,c={},f=(function(){function e(){}e.clear=function(){c={}},e.getItem=function(e){return c[e]||null},e.setItem=function(e,t){c[e]=t},e.removeItem=function(e){delete c[e]}}(),n(18)),l=new f.a("StorageCache"),d=function(){function e(e){this.config=Object.assign({},e),this.cacheCurSizeKey=this.config.keyPrefix+"CurSize",this.checkConfig()}return e.prototype.getModuleName=function(){return"Cache"},e.prototype.checkConfig=function(){a(this.config.capacityInBytes)||(l.error("Invalid parameter: capacityInBytes. It should be an Integer. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes),a(this.config.itemMaxSize)||(l.error("Invalid parameter: itemMaxSize. It should be an Integer. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),a(this.config.defaultTTL)||(l.error("Invalid parameter: defaultTTL. It should be an Integer. Setting back to default."),this.config.defaultTTL=i.defaultTTL),a(this.config.defaultPriority)||(l.error("Invalid parameter: defaultPriority. It should be an Integer. Setting back to default."),this.config.defaultPriority=i.defaultPriority),this.config.itemMaxSize>this.config.capacityInBytes&&(l.error("Invalid parameter: itemMaxSize. It should be smaller than capacityInBytes. Setting back to default."),this.config.itemMaxSize=i.itemMaxSize),(this.config.defaultPriority>5||this.config.defaultPriority<1)&&(l.error("Invalid parameter: defaultPriority. It should be between 1 and 5. Setting back to default."),this.config.defaultPriority=i.defaultPriority),(Number(this.config.warningThreshold)>1||Number(this.config.warningThreshold)<0)&&(l.error("Invalid parameter: warningThreshold. It should be between 0 and 1. Setting back to default."),this.config.warningThreshold=i.warningThreshold);this.config.capacityInBytes>5242880&&(l.error("Cache Capacity should be less than 5MB. Setting back to default. Setting back to default."),this.config.capacityInBytes=i.capacityInBytes)},e.prototype.fillCacheItem=function(e,t,n){var r={key:e,data:t,timestamp:s(),visitedTime:s(),priority:n.priority,expires:n.expires,type:typeof t,byteSize:0};return r.byteSize=o(JSON.stringify(r)),r.byteSize=o(JSON.stringify(r)),r},e.prototype.configure=function(e){return e?(e.keyPrefix&&l.warn("Don't try to configure keyPrefix!"),this.config=Object.assign({},this.config,e,e.Cache),this.checkConfig(),this.config):this.config},e}(),h=(u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),p=new f.a("Cache"),g=new(function(e){function t(t){var n=this,r=t?Object.assign({},i,t):i;return(n=e.call(this,r)||this).config.storage=r.storage,n.getItem=n.getItem.bind(n),n.setItem=n.setItem.bind(n),n.removeItem=n.removeItem.bind(n),n}return h(t,e),t.prototype._decreaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t-e).toString())},t.prototype._increaseCurSizeInBytes=function(e){var t=this.getCacheCurSize();this.config.storage.setItem(this.cacheCurSizeKey,(t+e).toString())},t.prototype._refreshItem=function(e,t){return e.visitedTime=s(),this.config.storage.setItem(t,JSON.stringify(e)),e},t.prototype._isExpired=function(e){var t=this.config.storage.getItem(e),n=JSON.parse(t);return s()>=n.expires},t.prototype._removeItem=function(e,t){var n=t||JSON.parse(this.config.storage.getItem(e)).byteSize;this._decreaseCurSizeInBytes(n),this.config.storage.removeItem(e)},t.prototype._setItem=function(e,t){this._increaseCurSizeInBytes(t.byteSize);try{this.config.storage.setItem(e,JSON.stringify(t))}catch(e){this._decreaseCurSizeInBytes(t.byteSize),p.error("Failed to set item "+e)}},t.prototype._sizeToPop=function(e){var t=this.getCacheCurSize()+e-this.config.capacityInBytes,n=(1-this.config.warningThreshold)*this.config.capacityInBytes;return t>n?t:n},t.prototype._isCacheFull=function(e){return e+this.getCacheCurSize()>this.config.capacityInBytes},t.prototype._findValidKeys=function(){for(var e=[],t=[],n=0;n<this.config.storage.length;n+=1)t.push(this.config.storage.key(n));for(n=0;n<t.length;n+=1){var r=t[n];0===r.indexOf(this.config.keyPrefix)&&r!==this.cacheCurSizeKey&&(this._isExpired(r)?this._removeItem(r):e.push(r))}return e},t.prototype._popOutItems=function(e,t){for(var n=[],r=t,i=0;i<e.length;i+=1){var o=this.config.storage.getItem(e[i]);if(null!=o){var s=JSON.parse(o);n.push(s)}}n.sort((function(e,t){return e.priority>t.priority?-1:e.priority<t.priority?1:e.visitedTime<t.visitedTime?-1:1}));for(i=0;i<n.length;i+=1)if(this._removeItem(n[i].key,n[i].byteSize),(r-=n[i].byteSize)<=0)return},t.prototype.setItem=function(e,t,n){p.log("Set item: key is "+e+", value is "+t+" with options: "+n);var r=this.config.keyPrefix+e;if(r!==this.config.keyPrefix&&r!==this.cacheCurSizeKey)if(void 0!==t){var i={priority:n&&void 0!==n.priority?n.priority:this.config.defaultPriority,expires:n&&void 0!==n.expires?n.expires:this.config.defaultTTL+s()};if(i.priority<1||i.priority>5)p.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var o=this.fillCacheItem(r,t,i);if(o.byteSize>this.config.itemMaxSize)p.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var a=this.config.storage.getItem(r);if(a&&this._removeItem(r,JSON.parse(a).byteSize),this._isCacheFull(o.byteSize)){var u=this._findValidKeys();if(this._isCacheFull(o.byteSize)){var c=this._sizeToPop(o.byteSize);this._popOutItems(u,c)}}this._setItem(r,o)}catch(e){p.warn("setItem failed! "+e)}}}else p.warn("The value of item should not be undefined!");else p.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){p.log("Get item: key is "+e+" with options "+t);var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return p.warn("Invalid key: should not be empty or 'CurSize'"),null;try{if(null!=(n=this.config.storage.getItem(r))){if(!this._isExpired(r)){var i=JSON.parse(n);return(i=this._refreshItem(i,r)).data}this._removeItem(r,JSON.parse(n).byteSize),n=null}if(t&&void 0!==t.callback){var o=t.callback();return null!==o&&this.setItem(e,o,t),o}return null}catch(e){return p.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){p.log("Remove item: key is "+e);var t=this.config.keyPrefix+e;if(t!==this.config.keyPrefix&&t!==this.cacheCurSizeKey)try{var n=this.config.storage.getItem(t);n&&this._removeItem(t,JSON.parse(n).byteSize)}catch(e){p.warn("removeItem failed! "+e)}},t.prototype.clear=function(){p.log("Clear Cache");for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&e.push(n)}try{for(t=0;t<e.length;t+=1)this.config.storage.removeItem(e[t])}catch(e){p.warn("clear failed! "+e)}},t.prototype.getAllKeys=function(){for(var e=[],t=0;t<this.config.storage.length;t+=1){var n=this.config.storage.key(t);0===n.indexOf(this.config.keyPrefix)&&n!==this.cacheCurSizeKey&&e.push(n.substring(this.config.keyPrefix.length))}return e},t.prototype.getCacheCurSize=function(){var e=this.config.storage.getItem(this.cacheCurSizeKey);return e||(this.config.storage.setItem(this.cacheCurSizeKey,"0"),e="0"),Number(e)},t.prototype.createInstance=function(e){return e.keyPrefix&&e.keyPrefix!==i.keyPrefix||(p.error("invalid keyPrefix, setting keyPrefix with timeStamp"),e.keyPrefix=s.toString()),new t(e)},t}(d));t.a=g;r.a.register(g)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(1),i=n(2);var o={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware"},s=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(o){return Object(r.__awaiter)(t,void 0,void 0,(function(){var t,s,a,u,c;return Object(r.__generator)(this,(function(f){return t=o.request,i.a.isInstance(t)&&(s=t.body,a=t.headers,s&&-1===Object.keys(a).map((function(e){return e.toLowerCase()})).indexOf("content-length")&&void 0!==(u=e(s))&&(t.headers=Object(r.__assign)(Object(r.__assign)({},t.headers),((c={})["content-length"]=String(u),c)))),[2,n(Object(r.__assign)(Object(r.__assign)({},o),{request:t}))]}))}))}}}(e.bodyLengthChecker),o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1).__exportStar(n(101),t);var r=n(59);Object.defineProperty(t,"Ie11Sha256",{enumerable:!0,get:function(){return r.Sha256}});var i=n(62);Object.defineProperty(t,"WebCryptoSha256",{enumerable:!0,get:function(){return i.Sha256}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(37),i=function(e){var t,n=new URL(e),i=n.hostname,o=n.pathname,s=n.port,a=n.protocol,u=n.search;return u&&(t=Object(r.a)(u)),{hostname:i,port:s?parseInt(s):void 0,protocol:a,path:o,query:t}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1);function i(e){var t,n,i={};if(e=e.replace(/^\?/,""))try{for(var o=Object(r.__values)(e.split("&")),s=o.next();!s.done;s=o.next()){var a=s.value,u=Object(r.__read)(a.split("="),2),c=u[0],f=u[1],l=void 0===f?null:f;c=decodeURIComponent(c),l&&(l=decodeURIComponent(l)),c in i?Array.isArray(i[c])?i[c].push(l):i[c]=[i[c],l]:i[c]=l}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return i}},function(e,t,n){"use strict";function r(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}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return"aws-sdk-js-v3-"+e+"/"+t+" "+("undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){void 0!==o&&e.removeListener("error",o),n([].slice.call(arguments))}var o;"error"!==t&&(o=function(n){e.removeListener(t,i),r(n)},e.once("error",o)),e.once(t,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,s,a;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):v(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=v(u,c);for(n=0;n<c;++n)o(f[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){return c(t),this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,o,s;if(c(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Crc32=t.crc32=void 0;var r=n(1);t.crc32=function(e){return(new i).update(e).digest()};var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var i=r.__values(e),s=i.next();!s.done;s=i.next()){var a=s.value;this.checksum=this.checksum>>>8^o[255&(this.checksum^a)]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}();t.Crc32=i;var o=Uint32Array.from([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117])},function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var r=n(1),i="X-Amz-Date".toLowerCase(),o=["authorization",i,"date"],s="X-Amz-Signature".toLowerCase(),a="X-Amz-Security-Token".toLowerCase(),u={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},c=/^proxy-/,f=/^sec-/,l="AWS4-HMAC-SHA256-PAYLOAD",d={},h=[];function p(e,t,n){return e+"/"+t+"/"+n+"/aws4_request"}var g=n(6);function v(e,t,n){var i,o,s=e.headers,a={};try{for(var l=Object(r.__values)(Object.keys(s).sort()),d=l.next();!d.done;d=l.next()){var h=d.value,p=h.toLowerCase();(p in u||(null==t?void 0:t.has(p))||c.test(p)||f.test(p))&&(!n||n&&!n.has(p))||(a[p]=s[h].trim().replace(/\s+/g," "))}}catch(e){i={error:e}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}return a}var y=n(14);var m=n(77);function b(e,t){var n=e.headers,i=e.body;return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,o,s,a,u,c,f;return Object(r.__generator)(this,(function(l){switch(l.label){case 0:try{for(e=Object(r.__values)(Object.keys(n)),o=e.next();!o.done;o=e.next())if("x-amz-content-sha256"===(s=o.value).toLowerCase())return[2,n[s]]}catch(e){c={error:e}}finally{try{o&&!o.done&&(f=e.return)&&f.call(e)}finally{if(c)throw c.error}}return null!=i?[3,1]:[2,"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"];case 1:return"string"==typeof i||ArrayBuffer.isView(i)||Object(m.a)(i)?((a=new t).update(i),u=g.b,[4,a.digest()]):[3,3];case 2:return[2,u.apply(void 0,[l.sent()])];case 3:return[2,"UNSIGNED-PAYLOAD"]}}))}))}function S(e){var t=e.headers,n=e.query,i=Object(r.__rest)(e,["headers","query"]);return Object(r.__assign)(Object(r.__assign)({},i),{headers:Object(r.__assign)({},t),query:n?w(n):void 0})}function w(e){return Object.keys(e).reduce((function(t,n){var i,o=e[n];return Object(r.__assign)(Object(r.__assign)({},t),((i={})[n]=Array.isArray(o)?Object(r.__spread)(o):o,i))}),{})}function _(e){var t,n;e="function"==typeof e.clone?e.clone():S(e);try{for(var i=Object(r.__values)(Object.keys(e.headers)),s=i.next();!s.done;s=i.next()){var a=s.value;o.indexOf(a.toLowerCase())>-1&&delete e.headers[a]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return e}function O(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 C=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=j(r),this.credentialProvider=I(n)}return e.prototype.presign=function(e,t){return void 0===t&&(t={}),Object(r.__awaiter)(this,void 0,void 0,(function(){var n,i,o,s,a,u,c,f,l,d,h,g,y,m,w,O,C,j,I,x,P,k,T;return Object(r.__generator)(this,(function(U){switch(U.label){case 0:return n=t.signingDate,i=void 0===n?new Date:n,o=t.expiresIn,s=void 0===o?3600:o,a=t.unsignableHeaders,u=t.signableHeaders,c=t.signingRegion,f=t.signingService,[4,this.credentialProvider()];case 1:return l=U.sent(),null==c?[3,2]:(h=c,[3,4]);case 2:return[4,this.regionProvider()];case 3:h=U.sent(),U.label=4;case 4:return d=h,g=E(i),y=g.longDate,m=g.shortDate,s>604800?[2,Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future")]:(w=p(m,d,null!=f?f:this.service),O=function(e){var t,n,i="function"==typeof e.clone?e.clone():S(e),o=i.headers,s=i.query,a=void 0===s?{}:s;try{for(var u=Object(r.__values)(Object.keys(o)),c=u.next();!c.done;c=u.next()){var f=c.value;"x-amz-"===f.toLowerCase().substr(0,6)&&(a[f]=o[f],delete o[f])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return Object(r.__assign)(Object(r.__assign)({},e),{headers:o,query:a})}(_(e)),l.sessionToken&&(O.query["X-Amz-Security-Token"]=l.sessionToken),O.query["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",O.query["X-Amz-Credential"]=l.accessKeyId+"/"+w,O.query["X-Amz-Date"]=y,O.query["X-Amz-Expires"]=s.toString(10),C=v(O,a,u),O.query["X-Amz-SignedHeaders"]=A(C),j=O.query,I="X-Amz-Signature",x=this.getSignature,P=[y,w,this.getSigningKey(l,d,m,f)],k=this.createCanonicalRequest,T=[O,C],[4,b(e,this.sha256)]);case 5:return[4,x.apply(this,P.concat([k.apply(this,T.concat([U.sent()]))]))];case 6:return j[I]=U.sent(),[2,O]}}))}))},e.prototype.sign=function(e,t){return Object(r.__awaiter)(this,void 0,void 0,(function(){return Object(r.__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,i=e.payload,o=t.signingDate,s=void 0===o?new Date:o,a=t.priorSignature,u=t.signingRegion,c=t.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var e,t,o,f,d,h,v,y,m,S,w;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return null==u?[3,1]:(t=u,[3,3]);case 1:return[4,this.regionProvider()];case 2:t=r.sent(),r.label=3;case 3:return e=t,o=E(s),f=o.shortDate,d=o.longDate,h=p(f,e,null!=c?c:this.service),[4,b({headers:{},body:i},this.sha256)];case 4:return v=r.sent(),(y=new this.sha256).update(n),S=g.b,[4,y.digest()];case 5:return m=S.apply(void 0,[r.sent()]),w=[l,d,h,a,m,v].join("\n"),[2,this.signString(w,{signingDate:s,signingRegion:e,signingService:c})]}}))}))},e.prototype.signString=function(e,t){var n=void 0===t?{}:t,i=n.signingDate,o=void 0===i?new Date:i,s=n.signingRegion,a=n.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,i,u,c,f,l,d;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,this.credentialProvider()];case 1:return t=r.sent(),null==s?[3,2]:(i=s,[3,4]);case 2:return[4,this.regionProvider()];case 3:i=r.sent(),r.label=4;case 4:return n=i,u=E(o).shortDate,l=(f=this.sha256).bind,[4,this.getSigningKey(t,n,u,a)];case 5:return(c=new(l.apply(f,[void 0,r.sent()]))).update(e),d=g.b,[4,c.digest()];case 6:return[2,d.apply(void 0,[r.sent()])]}}))}))},e.prototype.signRequest=function(e,t){var n=void 0===t?{}:t,o=n.signingDate,s=void 0===o?new Date:o,u=n.signableHeaders,c=n.unsignableHeaders,f=n.signingRegion,l=n.signingService;return Object(r.__awaiter)(this,void 0,void 0,(function(){var t,n,o,d,h,g,y,m,S,w,O;return Object(r.__generator)(this,(function(C){switch(C.label){case 0:return[4,this.credentialProvider()];case 1:return t=C.sent(),null==f?[3,2]:(o=f,[3,4]);case 2:return[4,this.regionProvider()];case 3:o=C.sent(),C.label=4;case 4:return n=o,d=_(e),h=E(s),g=h.longDate,y=h.shortDate,m=p(y,n,null!=l?l:this.service),d.headers[i]=g,t.sessionToken&&(d.headers[a]=t.sessionToken),[4,b(d,this.sha256)];case 5:return S=C.sent(),!function(e,t){var n,i;e=e.toLowerCase();try{for(var o=Object(r.__values)(Object.keys(t)),s=o.next();!s.done;s=o.next()){if(e===s.value.toLowerCase())return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return!1}("x-amz-content-sha256",d.headers)&&this.applyChecksum&&(d.headers["x-amz-content-sha256"]=S),w=v(d,c,u),[4,this.getSignature(g,m,this.getSigningKey(t,n,y,l),this.createCanonicalRequest(d,w,S))];case 6:return O=C.sent(),d.headers.authorization="AWS4-HMAC-SHA256 Credential="+t.accessKeyId+"/"+m+", SignedHeaders="+A(w)+", Signature="+O,[2,d]}}))}))},e.prototype.createCanonicalRequest=function(e,t,n){var i=Object.keys(t).sort();return e.method+"\n"+this.getCanonicalPath(e)+"\n"+function(e){var t,n,i=e.query,o=void 0===i?{}:i,a=[],u={},c=function(e){if(e.toLowerCase()===s)return"continue";a.push(e);var t=o[e];"string"==typeof t?u[e]=Object(y.a)(e)+"="+Object(y.a)(t):Array.isArray(t)&&(u[e]=t.slice(0).sort().reduce((function(t,n){return t.concat([Object(y.a)(e)+"="+Object(y.a)(n)])}),[]).join("&"))};try{for(var f=Object(r.__values)(Object.keys(o).sort()),l=f.next();!l.done;l=f.next()){c(l.value)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return a.map((function(e){return u[e]})).filter((function(e){return e})).join("&")}(e)+"\n"+i.map((function(e){return e+":"+t[e]})).join("\n")+"\n\n"+i.join(";")+"\n"+n},e.prototype.createStringToSign=function(e,t,n){return Object(r.__awaiter)(this,void 0,void 0,(function(){var i,o;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return(i=new this.sha256).update(n),[4,i.digest()];case 1:return o=r.sent(),[2,"AWS4-HMAC-SHA256\n"+e+"\n"+t+"\n"+Object(g.b)(o)]}}))}))},e.prototype.getCanonicalPath=function(e){var t=e.path;return this.uriEscapePath?"/"+encodeURIComponent(t.replace(/^\//,"")).replace(/%2F/g,"/"):t},e.prototype.getSignature=function(e,t,n,i){return Object(r.__awaiter)(this,void 0,void 0,(function(){var o,s,a,u,c;return Object(r.__generator)(this,(function(r){switch(r.label){case 0:return[4,this.createStringToSign(e,t,i)];case 1:return o=r.sent(),u=(a=this.sha256).bind,[4,n];case 2:return(s=new(u.apply(a,[void 0,r.sent()]))).update(o),c=g.b,[4,s.digest()];case 3:return[2,c.apply(void 0,[r.sent()])]}}))}))},e.prototype.getSigningKey=function(e,t,n,i){return function(e,t,n,i,o){var s=n+":"+i+":"+o+":"+t.accessKeyId+":"+t.sessionToken;if(s in d)return d[s];for(h.push(s);h.length>50;)delete d[h.shift()];return d[s]=new Promise((function(a,u){var c,f,l=Promise.resolve("AWS4"+t.secretAccessKey),h=function(t){(l=l.then((function(n){return r=t,(i=new e(n)).update(r),i.digest();var r,i}))).catch((function(){}))};try{for(var p=Object(r.__values)([n,i,o,"aws4_request"]),g=p.next();!g.done;g=p.next()){h(g.value)}}catch(e){c={error:e}}finally{try{g&&!g.done&&(f=p.return)&&f.call(p)}finally{if(c)throw c.error}}l.then(a,(function(e){delete d[s],u(e)}))}))}(this.sha256,e,n,t,i||this.service)},e}(),E=function(e){var t=O(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.substr(0,8)}},A=function(e){return Object.keys(e).sort().join(";")},j=function(e){if("string"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e},I=function(e){if("object"==typeof e){var t=Promise.resolve(e);return function(){return t}}return e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var r={userAgent:"aws-amplify/3.6.0 js",product:"",navigator:null,isReactNative:!1};if("undefined"!=typeof navigator&&navigator.product)switch(r.product=navigator.product||"",r.navigator=navigator||null,navigator.product){case"ReactNative":r.userAgent="aws-amplify/3.6.0 react-native",r.isReactNative=!0;break;default:r.userAgent="aws-amplify/3.6.0 js",r.isReactNative=!1}var i=function(){return r.userAgent}},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){"use strict";var r=n(18),i=n(159),o=n(75),s=n(160),a=n(43),u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=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 l(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;Object.create;var h,p,g,v,y,m,b,S,w,_,O,C,E,A,j,I,x,P,k,T,U,R,L,D,M,N,B,F,z,K,q,H,V,G,W,$,Y,J,X,Z,Q,ee,te,ne,re,ie,oe,se,ae,ue,ce,fe,le,de,he,pe,ge,ve,ye,me,be,Se,we,_e,Oe,Ce,Ee,Ae,je,Ie,xe,Pe,ke,Te,Ue,Re,Le,De,Me,Ne,Be,Fe,ze,Ke,qe,He,Ve,Ge,We,$e,Ye,Je,Xe,Ze,Qe,et,tt,nt,rt,it,ot,st,at,ut,ct,ft,lt,dt,ht,pt,gt,vt,yt,mt,bt,St,wt,_t,Ot,Ct,Et,At,jt,It,xt,Pt,kt,Tt,Ut,Rt,Lt,Dt,Mt,Nt,Bt,Ft,zt,Kt,qt,Ht,Vt,Gt,Wt,$t,Yt,Jt,Xt,Zt,Qt,en,tn,nn,rn,on,sn,an,un,cn,fn,ln,dn,hn,pn,gn,vn,yn,mn,bn,Sn,wn,_n,On,Cn,En,An,jn,In,xn,Pn,kn,Tn,Un,Rn,Ln,Dn,Mn,Nn,Bn,Fn,zn,Kn,qn,Hn,Vn,Gn,Wn,$n,Yn,Jn,Xn,Zn,Qn,er,tr,nr,rr,ir,or,sr,ar,ur,cr,fr,lr,dr,hr,pr,gr,vr,yr,mr,br,Sr,wr,_r,Or,Cr,Er,Ar,jr,Ir,xr,Pr,kr,Tr,Ur,Rr,Lr,Dr,Mr,Nr,Br,Fr,zr,Kr,qr,Hr,Vr,Gr,Wr,$r,Yr,Jr,Xr,Zr,Qr,ei,ti,ni,ri,ii,oi,si,ai,ui,ci,fi,li,di,hi,pi,gi,vi,yi,mi,bi,Si,wi,_i,Oi,Ci,Ei,Ai,ji,Ii,xi,Pi,ki,Ti,Ui,Ri,Li,Di,Mi,Ni,Bi,Fi,zi,Ki,qi,Hi,Vi,Gi,Wi,$i,Yi,Ji,Xi,Zi,Qi,eo,to,no,ro,io,oo,so,ao,uo,co,fo,lo,ho,po,go,vo,yo,mo,bo,So,wo,_o,Oo,Co,Eo,Ao,jo,Io,xo,Po,ko,To,Uo,Ro,Lo,Do,Mo,No,Bo,Fo,zo,Ko,qo,Ho,Vo,Go,Wo,$o,Yo,Jo,Xo,Zo,Qo,es,ts,ns,rs,is,os,ss,as,us,cs,fs,ls,ds,hs,ps,gs,vs,ys,ms,bs,Ss,ws,_s,Os,Cs,Es,As,js,Is,xs,Ps,ks,Ts,Us,Rs,Ls,Ds,Ms,Ns,Bs,Fs,zs,Ks,qs,Hs,Vs,Gs,Ws,$s,Ys,Js,Xs,Zs,Qs,ea,ta,na,ra,ia,oa,sa,aa,ua,ca,fa,la,da,ha,pa,ga,va,ya,ma,ba,Sa,wa,_a,Oa,Ca,Ea,Aa,ja,Ia,xa,Pa,ka,Ta,Ua,Ra,La,Da,Ma,Na,Ba,Fa,za,Ka,qa,Ha,Va,Ga,Wa,$a,Ya,Ja,Xa,Za,Qa,eu,tu,nu,ru,iu,ou,su,au,uu,cu,fu,lu,du,hu,pu,gu,vu,yu,mu,bu,Su,wu,_u,Ou,Cu,Eu,Au,ju,Iu,xu,Pu,ku,Tu,Uu,Ru,Lu,Du,Mu,Nu,Bu,Fu,zu,Ku,qu,Hu,Vu,Gu,Wu,$u,Yu,Ju,Xu,Zu,Qu,ec,tc,nc,rc,ic=n(0);(p=h||(h={})).filterSensitiveLog=function(e){return f({},e)},p.isa=function(e){return Object(ic.h)(e,"AbortIncompleteMultipartUpload")},(v=g||(g={})).filterSensitiveLog=function(e){return f({},e)},v.isa=function(e){return Object(ic.h)(e,"AbortMultipartUploadOutput")},(m=y||(y={})).filterSensitiveLog=function(e){return f({},e)},m.isa=function(e){return Object(ic.h)(e,"AbortMultipartUploadRequest")},(S=b||(b={})).filterSensitiveLog=function(e){return f({},e)},S.isa=function(e){return Object(ic.h)(e,"AccelerateConfiguration")},(_=w||(w={})).filterSensitiveLog=function(e){return f({},e)},_.isa=function(e){return Object(ic.h)(e,"AccessControlPolicy")},(C=O||(O={})).filterSensitiveLog=function(e){return f({},e)},C.isa=function(e){return Object(ic.h)(e,"AccessControlTranslation")},(A=E||(E={})).filterSensitiveLog=function(e){return f({},e)},A.isa=function(e){return Object(ic.h)(e,"AnalyticsAndOperator")},(I=j||(j={})).filterSensitiveLog=function(e){return f({},e)},I.isa=function(e){return Object(ic.h)(e,"AnalyticsConfiguration")},(P=x||(x={})).filterSensitiveLog=function(e){return f({},e)},P.isa=function(e){return Object(ic.h)(e,"AnalyticsExportDestination")},(T=k||(k={})).filterSensitiveLog=function(e){return f({},e)},T.isa=function(e){return Object(ic.h)(e,"AnalyticsFilter")},(R=U||(U={})).filterSensitiveLog=function(e){return f({},e)},R.isa=function(e){return Object(ic.h)(e,"AnalyticsS3BucketDestination")},(D=L||(L={})).filterSensitiveLog=function(e){return f({},e)},D.isa=function(e){return Object(ic.h)(e,"Bucket")},(N=M||(M={})).filterSensitiveLog=function(e){return f({},e)},N.isa=function(e){return Object(ic.h)(e,"BucketAlreadyExists")},(F=B||(B={})).filterSensitiveLog=function(e){return f({},e)},F.isa=function(e){return Object(ic.h)(e,"BucketAlreadyOwnedByYou")},(K=z||(z={})).filterSensitiveLog=function(e){return f({},e)},K.isa=function(e){return Object(ic.h)(e,"BucketLifecycleConfiguration")},(H=q||(q={})).filterSensitiveLog=function(e){return f({},e)},H.isa=function(e){return Object(ic.h)(e,"BucketLoggingStatus")},(G=V||(V={})).filterSensitiveLog=function(e){return f({},e)},G.isa=function(e){return Object(ic.h)(e,"CommonPrefix")},($=W||(W={})).filterSensitiveLog=function(e){return f({},e)},$.isa=function(e){return Object(ic.h)(e,"CompletedMultipartUpload")},(J=Y||(Y={})).filterSensitiveLog=function(e){return f({},e)},J.isa=function(e){return Object(ic.h)(e,"CompletedPart")},(Z=X||(X={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},Z.isa=function(e){return Object(ic.h)(e,"CompleteMultipartUploadOutput")},(ee=Q||(Q={})).filterSensitiveLog=function(e){return f({},e)},ee.isa=function(e){return Object(ic.h)(e,"CompleteMultipartUploadRequest")},(ne=te||(te={})).filterSensitiveLog=function(e){return f({},e)},ne.isa=function(e){return Object(ic.h)(e,"Condition")},(ie=re||(re={})).filterSensitiveLog=function(e){return f({},e)},ie.isa=function(e){return Object(ic.h)(e,"ContinuationEvent")},(se=oe||(oe={})).filterSensitiveLog=function(e){return f(f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c}),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c})},se.isa=function(e){return Object(ic.h)(e,"CopyObjectOutput")},(ue=ae||(ae={})).filterSensitiveLog=function(e){return f(f(f(f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c}),e.SSECustomerKey&&{SSECustomerKey:ic.c}),e.CopySourceSSECustomerKey&&{CopySourceSSECustomerKey:ic.c}),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c})},ue.isa=function(e){return Object(ic.h)(e,"CopyObjectRequest")},(fe=ce||(ce={})).filterSensitiveLog=function(e){return f({},e)},fe.isa=function(e){return Object(ic.h)(e,"CopyObjectResult")},(de=le||(le={})).filterSensitiveLog=function(e){return f({},e)},de.isa=function(e){return Object(ic.h)(e,"CopyPartResult")},(pe=he||(he={})).filterSensitiveLog=function(e){return f({},e)},pe.isa=function(e){return Object(ic.h)(e,"CORSConfiguration")},(ve=ge||(ge={})).filterSensitiveLog=function(e){return f({},e)},ve.isa=function(e){return Object(ic.h)(e,"CORSRule")},(me=ye||(ye={})).filterSensitiveLog=function(e){return f({},e)},me.isa=function(e){return Object(ic.h)(e,"CreateBucketConfiguration")},(Se=be||(be={})).filterSensitiveLog=function(e){return f({},e)},Se.isa=function(e){return Object(ic.h)(e,"CreateBucketOutput")},(_e=we||(we={})).filterSensitiveLog=function(e){return f({},e)},_e.isa=function(e){return Object(ic.h)(e,"CreateBucketRequest")},(Ce=Oe||(Oe={})).filterSensitiveLog=function(e){return f(f(f({},e),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c}),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},Ce.isa=function(e){return Object(ic.h)(e,"CreateMultipartUploadOutput")},(Ae=Ee||(Ee={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c}),e.SSECustomerKey&&{SSECustomerKey:ic.c}),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c})},Ae.isa=function(e){return Object(ic.h)(e,"CreateMultipartUploadRequest")},(Ie=je||(je={})).filterSensitiveLog=function(e){return f({},e)},Ie.isa=function(e){return Object(ic.h)(e,"CSVInput")},(Pe=xe||(xe={})).filterSensitiveLog=function(e){return f({},e)},Pe.isa=function(e){return Object(ic.h)(e,"CSVOutput")},(Te=ke||(ke={})).filterSensitiveLog=function(e){return f({},e)},Te.isa=function(e){return Object(ic.h)(e,"DefaultRetention")},(Re=Ue||(Ue={})).filterSensitiveLog=function(e){return f({},e)},Re.isa=function(e){return Object(ic.h)(e,"Delete")},(De=Le||(Le={})).filterSensitiveLog=function(e){return f({},e)},De.isa=function(e){return Object(ic.h)(e,"DeleteBucketAnalyticsConfigurationRequest")},(Ne=Me||(Me={})).filterSensitiveLog=function(e){return f({},e)},Ne.isa=function(e){return Object(ic.h)(e,"DeleteBucketCorsRequest")},(Fe=Be||(Be={})).filterSensitiveLog=function(e){return f({},e)},Fe.isa=function(e){return Object(ic.h)(e,"DeleteBucketEncryptionRequest")},(Ke=ze||(ze={})).filterSensitiveLog=function(e){return f({},e)},Ke.isa=function(e){return Object(ic.h)(e,"DeleteBucketInventoryConfigurationRequest")},(He=qe||(qe={})).filterSensitiveLog=function(e){return f({},e)},He.isa=function(e){return Object(ic.h)(e,"DeleteBucketLifecycleRequest")},(Ge=Ve||(Ve={})).filterSensitiveLog=function(e){return f({},e)},Ge.isa=function(e){return Object(ic.h)(e,"DeleteBucketMetricsConfigurationRequest")},($e=We||(We={})).filterSensitiveLog=function(e){return f({},e)},$e.isa=function(e){return Object(ic.h)(e,"DeleteBucketPolicyRequest")},(Je=Ye||(Ye={})).filterSensitiveLog=function(e){return f({},e)},Je.isa=function(e){return Object(ic.h)(e,"DeleteBucketReplicationRequest")},(Ze=Xe||(Xe={})).filterSensitiveLog=function(e){return f({},e)},Ze.isa=function(e){return Object(ic.h)(e,"DeleteBucketRequest")},(et=Qe||(Qe={})).filterSensitiveLog=function(e){return f({},e)},et.isa=function(e){return Object(ic.h)(e,"DeleteBucketTaggingRequest")},(nt=tt||(tt={})).filterSensitiveLog=function(e){return f({},e)},nt.isa=function(e){return Object(ic.h)(e,"DeleteBucketWebsiteRequest")},(it=rt||(rt={})).filterSensitiveLog=function(e){return f({},e)},it.isa=function(e){return Object(ic.h)(e,"DeletedObject")},(st=ot||(ot={})).filterSensitiveLog=function(e){return f({},e)},st.isa=function(e){return Object(ic.h)(e,"DeleteMarkerEntry")},(ut=at||(at={})).filterSensitiveLog=function(e){return f({},e)},ut.isa=function(e){return Object(ic.h)(e,"DeleteMarkerReplication")},(ft=ct||(ct={})).filterSensitiveLog=function(e){return f({},e)},ft.isa=function(e){return Object(ic.h)(e,"DeleteObjectOutput")},(dt=lt||(lt={})).filterSensitiveLog=function(e){return f({},e)},dt.isa=function(e){return Object(ic.h)(e,"DeleteObjectRequest")},(pt=ht||(ht={})).filterSensitiveLog=function(e){return f({},e)},pt.isa=function(e){return Object(ic.h)(e,"DeleteObjectsOutput")},(vt=gt||(gt={})).filterSensitiveLog=function(e){return f({},e)},vt.isa=function(e){return Object(ic.h)(e,"DeleteObjectsRequest")},(mt=yt||(yt={})).filterSensitiveLog=function(e){return f({},e)},mt.isa=function(e){return Object(ic.h)(e,"DeleteObjectTaggingOutput")},(St=bt||(bt={})).filterSensitiveLog=function(e){return f({},e)},St.isa=function(e){return Object(ic.h)(e,"DeleteObjectTaggingRequest")},(_t=wt||(wt={})).filterSensitiveLog=function(e){return f({},e)},_t.isa=function(e){return Object(ic.h)(e,"DeletePublicAccessBlockRequest")},(Ct=Ot||(Ot={})).filterSensitiveLog=function(e){return f({},e)},Ct.isa=function(e){return Object(ic.h)(e,"Destination")},(At=Et||(Et={})).filterSensitiveLog=function(e){return f(f({},e),e.KMSKeyId&&{KMSKeyId:ic.c})},At.isa=function(e){return Object(ic.h)(e,"Encryption")},(It=jt||(jt={})).filterSensitiveLog=function(e){return f({},e)},It.isa=function(e){return Object(ic.h)(e,"EncryptionConfiguration")},(Pt=xt||(xt={})).filterSensitiveLog=function(e){return f({},e)},Pt.isa=function(e){return Object(ic.h)(e,"EndEvent")},(Tt=kt||(kt={})).filterSensitiveLog=function(e){return f({},e)},Tt.isa=function(e){return Object(ic.h)(e,"Error")},(Rt=Ut||(Ut={})).filterSensitiveLog=function(e){return f({},e)},Rt.isa=function(e){return Object(ic.h)(e,"ErrorDocument")},(Dt=Lt||(Lt={})).filterSensitiveLog=function(e){return f({},e)},Dt.isa=function(e){return Object(ic.h)(e,"ExistingObjectReplication")},function(e){e.IGNORE="IGNORE",e.NONE="NONE",e.USE="USE"}(Mt||(Mt={})),(Bt=Nt||(Nt={})).filterSensitiveLog=function(e){return f({},e)},Bt.isa=function(e){return Object(ic.h)(e,"FilterRule")},(zt=Ft||(Ft={})).filterSensitiveLog=function(e){return f({},e)},zt.isa=function(e){return Object(ic.h)(e,"GetBucketAccelerateConfigurationOutput")},(qt=Kt||(Kt={})).filterSensitiveLog=function(e){return f({},e)},qt.isa=function(e){return Object(ic.h)(e,"GetBucketAccelerateConfigurationRequest")},(Vt=Ht||(Ht={})).filterSensitiveLog=function(e){return f({},e)},Vt.isa=function(e){return Object(ic.h)(e,"GetBucketAclOutput")},(Wt=Gt||(Gt={})).filterSensitiveLog=function(e){return f({},e)},Wt.isa=function(e){return Object(ic.h)(e,"GetBucketAclRequest")},(Yt=$t||($t={})).filterSensitiveLog=function(e){return f({},e)},Yt.isa=function(e){return Object(ic.h)(e,"GetBucketAnalyticsConfigurationOutput")},(Xt=Jt||(Jt={})).filterSensitiveLog=function(e){return f({},e)},Xt.isa=function(e){return Object(ic.h)(e,"GetBucketAnalyticsConfigurationRequest")},(Qt=Zt||(Zt={})).filterSensitiveLog=function(e){return f({},e)},Qt.isa=function(e){return Object(ic.h)(e,"GetBucketCorsOutput")},(tn=en||(en={})).filterSensitiveLog=function(e){return f({},e)},tn.isa=function(e){return Object(ic.h)(e,"GetBucketCorsRequest")},(rn=nn||(nn={})).filterSensitiveLog=function(e){return f(f({},e),e.ServerSideEncryptionConfiguration&&{ServerSideEncryptionConfiguration:vu.filterSensitiveLog(e.ServerSideEncryptionConfiguration)})},rn.isa=function(e){return Object(ic.h)(e,"GetBucketEncryptionOutput")},(sn=on||(on={})).filterSensitiveLog=function(e){return f({},e)},sn.isa=function(e){return Object(ic.h)(e,"GetBucketEncryptionRequest")},(un=an||(an={})).filterSensitiveLog=function(e){return f(f({},e),e.InventoryConfiguration&&{InventoryConfiguration:Qr.filterSensitiveLog(e.InventoryConfiguration)})},un.isa=function(e){return Object(ic.h)(e,"GetBucketInventoryConfigurationOutput")},(fn=cn||(cn={})).filterSensitiveLog=function(e){return f({},e)},fn.isa=function(e){return Object(ic.h)(e,"GetBucketInventoryConfigurationRequest")},(dn=ln||(ln={})).filterSensitiveLog=function(e){return f({},e)},dn.isa=function(e){return Object(ic.h)(e,"GetBucketLifecycleConfigurationOutput")},(pn=hn||(hn={})).filterSensitiveLog=function(e){return f({},e)},pn.isa=function(e){return Object(ic.h)(e,"GetBucketLifecycleConfigurationRequest")},(vn=gn||(gn={})).filterSensitiveLog=function(e){return f({},e)},vn.isa=function(e){return Object(ic.h)(e,"GetBucketLocationOutput")},(mn=yn||(yn={})).filterSensitiveLog=function(e){return f({},e)},mn.isa=function(e){return Object(ic.h)(e,"GetBucketLocationRequest")},(Sn=bn||(bn={})).filterSensitiveLog=function(e){return f({},e)},Sn.isa=function(e){return Object(ic.h)(e,"GetBucketLoggingOutput")},(_n=wn||(wn={})).filterSensitiveLog=function(e){return f({},e)},_n.isa=function(e){return Object(ic.h)(e,"GetBucketLoggingRequest")},(Cn=On||(On={})).filterSensitiveLog=function(e){return f({},e)},Cn.isa=function(e){return Object(ic.h)(e,"GetBucketMetricsConfigurationOutput")},(An=En||(En={})).filterSensitiveLog=function(e){return f({},e)},An.isa=function(e){return Object(ic.h)(e,"GetBucketMetricsConfigurationRequest")},(In=jn||(jn={})).filterSensitiveLog=function(e){return f({},e)},In.isa=function(e){return Object(ic.h)(e,"GetBucketNotificationConfigurationRequest")},(Pn=xn||(xn={})).filterSensitiveLog=function(e){return f({},e)},Pn.isa=function(e){return Object(ic.h)(e,"GetBucketPolicyOutput")},(Tn=kn||(kn={})).filterSensitiveLog=function(e){return f({},e)},Tn.isa=function(e){return Object(ic.h)(e,"GetBucketPolicyRequest")},(Rn=Un||(Un={})).filterSensitiveLog=function(e){return f({},e)},Rn.isa=function(e){return Object(ic.h)(e,"GetBucketPolicyStatusOutput")},(Dn=Ln||(Ln={})).filterSensitiveLog=function(e){return f({},e)},Dn.isa=function(e){return Object(ic.h)(e,"GetBucketPolicyStatusRequest")},(Nn=Mn||(Mn={})).filterSensitiveLog=function(e){return f({},e)},Nn.isa=function(e){return Object(ic.h)(e,"GetBucketReplicationOutput")},(Fn=Bn||(Bn={})).filterSensitiveLog=function(e){return f({},e)},Fn.isa=function(e){return Object(ic.h)(e,"GetBucketReplicationRequest")},(Kn=zn||(zn={})).filterSensitiveLog=function(e){return f({},e)},Kn.isa=function(e){return Object(ic.h)(e,"GetBucketRequestPaymentOutput")},(Hn=qn||(qn={})).filterSensitiveLog=function(e){return f({},e)},Hn.isa=function(e){return Object(ic.h)(e,"GetBucketRequestPaymentRequest")},(Gn=Vn||(Vn={})).filterSensitiveLog=function(e){return f({},e)},Gn.isa=function(e){return Object(ic.h)(e,"GetBucketTaggingOutput")},($n=Wn||(Wn={})).filterSensitiveLog=function(e){return f({},e)},$n.isa=function(e){return Object(ic.h)(e,"GetBucketTaggingRequest")},(Jn=Yn||(Yn={})).filterSensitiveLog=function(e){return f({},e)},Jn.isa=function(e){return Object(ic.h)(e,"GetBucketVersioningOutput")},(Zn=Xn||(Xn={})).filterSensitiveLog=function(e){return f({},e)},Zn.isa=function(e){return Object(ic.h)(e,"GetBucketVersioningRequest")},(er=Qn||(Qn={})).filterSensitiveLog=function(e){return f({},e)},er.isa=function(e){return Object(ic.h)(e,"GetBucketWebsiteOutput")},(nr=tr||(tr={})).filterSensitiveLog=function(e){return f({},e)},nr.isa=function(e){return Object(ic.h)(e,"GetBucketWebsiteRequest")},(ir=rr||(rr={})).filterSensitiveLog=function(e){return f({},e)},ir.isa=function(e){return Object(ic.h)(e,"GetObjectAclOutput")},(sr=or||(or={})).filterSensitiveLog=function(e){return f({},e)},sr.isa=function(e){return Object(ic.h)(e,"GetObjectAclRequest")},(ur=ar||(ar={})).filterSensitiveLog=function(e){return f({},e)},ur.isa=function(e){return Object(ic.h)(e,"GetObjectLegalHoldOutput")},(fr=cr||(cr={})).filterSensitiveLog=function(e){return f({},e)},fr.isa=function(e){return Object(ic.h)(e,"GetObjectLegalHoldRequest")},(dr=lr||(lr={})).filterSensitiveLog=function(e){return f({},e)},dr.isa=function(e){return Object(ic.h)(e,"GetObjectLockConfigurationOutput")},(pr=hr||(hr={})).filterSensitiveLog=function(e){return f({},e)},pr.isa=function(e){return Object(ic.h)(e,"GetObjectLockConfigurationRequest")},(vr=gr||(gr={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},vr.isa=function(e){return Object(ic.h)(e,"GetObjectOutput")},(mr=yr||(yr={})).filterSensitiveLog=function(e){return f(f({},e),e.SSECustomerKey&&{SSECustomerKey:ic.c})},mr.isa=function(e){return Object(ic.h)(e,"GetObjectRequest")},(Sr=br||(br={})).filterSensitiveLog=function(e){return f({},e)},Sr.isa=function(e){return Object(ic.h)(e,"GetObjectRetentionOutput")},(_r=wr||(wr={})).filterSensitiveLog=function(e){return f({},e)},_r.isa=function(e){return Object(ic.h)(e,"GetObjectRetentionRequest")},(Cr=Or||(Or={})).filterSensitiveLog=function(e){return f({},e)},Cr.isa=function(e){return Object(ic.h)(e,"GetObjectTaggingOutput")},(Ar=Er||(Er={})).filterSensitiveLog=function(e){return f({},e)},Ar.isa=function(e){return Object(ic.h)(e,"GetObjectTaggingRequest")},(Ir=jr||(jr={})).filterSensitiveLog=function(e){return f({},e)},Ir.isa=function(e){return Object(ic.h)(e,"GetObjectTorrentOutput")},(Pr=xr||(xr={})).filterSensitiveLog=function(e){return f({},e)},Pr.isa=function(e){return Object(ic.h)(e,"GetObjectTorrentRequest")},(Tr=kr||(kr={})).filterSensitiveLog=function(e){return f({},e)},Tr.isa=function(e){return Object(ic.h)(e,"GetPublicAccessBlockOutput")},(Rr=Ur||(Ur={})).filterSensitiveLog=function(e){return f({},e)},Rr.isa=function(e){return Object(ic.h)(e,"GetPublicAccessBlockRequest")},(Dr=Lr||(Lr={})).filterSensitiveLog=function(e){return f({},e)},Dr.isa=function(e){return Object(ic.h)(e,"GlacierJobParameters")},(Nr=Mr||(Mr={})).filterSensitiveLog=function(e){return f({},e)},Nr.isa=function(e){return Object(ic.h)(e,"Grant")},(Fr=Br||(Br={})).filterSensitiveLog=function(e){return f({},e)},Fr.isa=function(e){return Object(ic.h)(e,"Grantee")},(Kr=zr||(zr={})).filterSensitiveLog=function(e){return f({},e)},Kr.isa=function(e){return Object(ic.h)(e,"HeadBucketRequest")},(Hr=qr||(qr={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},Hr.isa=function(e){return Object(ic.h)(e,"HeadObjectOutput")},(Gr=Vr||(Vr={})).filterSensitiveLog=function(e){return f(f({},e),e.SSECustomerKey&&{SSECustomerKey:ic.c})},Gr.isa=function(e){return Object(ic.h)(e,"HeadObjectRequest")},($r=Wr||(Wr={})).filterSensitiveLog=function(e){return f({},e)},$r.isa=function(e){return Object(ic.h)(e,"IndexDocument")},(Jr=Yr||(Yr={})).filterSensitiveLog=function(e){return f({},e)},Jr.isa=function(e){return Object(ic.h)(e,"Initiator")},(Zr=Xr||(Xr={})).filterSensitiveLog=function(e){return f({},e)},Zr.isa=function(e){return Object(ic.h)(e,"InputSerialization")},(ei=Qr||(Qr={})).filterSensitiveLog=function(e){return f(f({},e),e.Destination&&{Destination:ti.filterSensitiveLog(e.Destination)})},ei.isa=function(e){return Object(ic.h)(e,"InventoryConfiguration")},(ni=ti||(ti={})).filterSensitiveLog=function(e){return f(f({},e),e.S3BucketDestination&&{S3BucketDestination:ai.filterSensitiveLog(e.S3BucketDestination)})},ni.isa=function(e){return Object(ic.h)(e,"InventoryDestination")},(ii=ri||(ri={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMS&&{SSEKMS:_u.filterSensitiveLog(e.SSEKMS)})},ii.isa=function(e){return Object(ic.h)(e,"InventoryEncryption")},(si=oi||(oi={})).filterSensitiveLog=function(e){return f({},e)},si.isa=function(e){return Object(ic.h)(e,"InventoryFilter")},(ui=ai||(ai={})).filterSensitiveLog=function(e){return f(f({},e),e.Encryption&&{Encryption:ri.filterSensitiveLog(e.Encryption)})},ui.isa=function(e){return Object(ic.h)(e,"InventoryS3BucketDestination")},(fi=ci||(ci={})).filterSensitiveLog=function(e){return f({},e)},fi.isa=function(e){return Object(ic.h)(e,"InventorySchedule")},(di=li||(li={})).filterSensitiveLog=function(e){return f({},e)},di.isa=function(e){return Object(ic.h)(e,"JSONInput")},(pi=hi||(hi={})).filterSensitiveLog=function(e){return f({},e)},pi.isa=function(e){return Object(ic.h)(e,"JSONOutput")},function(e){e.DOCUMENT="DOCUMENT",e.LINES="LINES"}(gi||(gi={})),(yi=vi||(vi={})).filterSensitiveLog=function(e){return f({},e)},yi.isa=function(e){return Object(ic.h)(e,"LambdaFunctionConfiguration")},(bi=mi||(mi={})).filterSensitiveLog=function(e){return f({},e)},bi.isa=function(e){return Object(ic.h)(e,"LifecycleExpiration")},(wi=Si||(Si={})).filterSensitiveLog=function(e){return f({},e)},wi.isa=function(e){return Object(ic.h)(e,"LifecycleRule")},(Oi=_i||(_i={})).filterSensitiveLog=function(e){return f({},e)},Oi.isa=function(e){return Object(ic.h)(e,"LifecycleRuleAndOperator")},(Ei=Ci||(Ci={})).filterSensitiveLog=function(e){return f({},e)},Ei.isa=function(e){return Object(ic.h)(e,"LifecycleRuleFilter")},(ji=Ai||(Ai={})).filterSensitiveLog=function(e){return f({},e)},ji.isa=function(e){return Object(ic.h)(e,"ListBucketAnalyticsConfigurationsOutput")},(xi=Ii||(Ii={})).filterSensitiveLog=function(e){return f({},e)},xi.isa=function(e){return Object(ic.h)(e,"ListBucketAnalyticsConfigurationsRequest")},(ki=Pi||(Pi={})).filterSensitiveLog=function(e){return f(f({},e),e.InventoryConfigurationList&&{InventoryConfigurationList:e.InventoryConfigurationList.map((function(e){return Qr.filterSensitiveLog(e)}))})},ki.isa=function(e){return Object(ic.h)(e,"ListBucketInventoryConfigurationsOutput")},(Ui=Ti||(Ti={})).filterSensitiveLog=function(e){return f({},e)},Ui.isa=function(e){return Object(ic.h)(e,"ListBucketInventoryConfigurationsRequest")},(Li=Ri||(Ri={})).filterSensitiveLog=function(e){return f({},e)},Li.isa=function(e){return Object(ic.h)(e,"ListBucketMetricsConfigurationsOutput")},(Mi=Di||(Di={})).filterSensitiveLog=function(e){return f({},e)},Mi.isa=function(e){return Object(ic.h)(e,"ListBucketMetricsConfigurationsRequest")},(Bi=Ni||(Ni={})).filterSensitiveLog=function(e){return f({},e)},Bi.isa=function(e){return Object(ic.h)(e,"ListBucketsOutput")},(zi=Fi||(Fi={})).filterSensitiveLog=function(e){return f({},e)},zi.isa=function(e){return Object(ic.h)(e,"ListMultipartUploadsOutput")},(qi=Ki||(Ki={})).filterSensitiveLog=function(e){return f({},e)},qi.isa=function(e){return Object(ic.h)(e,"ListMultipartUploadsRequest")},(Vi=Hi||(Hi={})).filterSensitiveLog=function(e){return f({},e)},Vi.isa=function(e){return Object(ic.h)(e,"ListObjectsOutput")},(Wi=Gi||(Gi={})).filterSensitiveLog=function(e){return f({},e)},Wi.isa=function(e){return Object(ic.h)(e,"ListObjectsRequest")},(Yi=$i||($i={})).filterSensitiveLog=function(e){return f({},e)},Yi.isa=function(e){return Object(ic.h)(e,"ListObjectsV2Output")},(Xi=Ji||(Ji={})).filterSensitiveLog=function(e){return f({},e)},Xi.isa=function(e){return Object(ic.h)(e,"ListObjectsV2Request")},(Qi=Zi||(Zi={})).filterSensitiveLog=function(e){return f({},e)},Qi.isa=function(e){return Object(ic.h)(e,"ListObjectVersionsOutput")},(to=eo||(eo={})).filterSensitiveLog=function(e){return f({},e)},to.isa=function(e){return Object(ic.h)(e,"ListObjectVersionsRequest")},(ro=no||(no={})).filterSensitiveLog=function(e){return f({},e)},ro.isa=function(e){return Object(ic.h)(e,"ListPartsOutput")},(oo=io||(io={})).filterSensitiveLog=function(e){return f({},e)},oo.isa=function(e){return Object(ic.h)(e,"ListPartsRequest")},(ao=so||(so={})).filterSensitiveLog=function(e){return f({},e)},ao.isa=function(e){return Object(ic.h)(e,"LoggingEnabled")},(co=uo||(uo={})).filterSensitiveLog=function(e){return f({},e)},co.isa=function(e){return Object(ic.h)(e,"MetadataEntry")},(lo=fo||(fo={})).filterSensitiveLog=function(e){return f({},e)},lo.isa=function(e){return Object(ic.h)(e,"Metrics")},(po=ho||(ho={})).filterSensitiveLog=function(e){return f({},e)},po.isa=function(e){return Object(ic.h)(e,"MetricsAndOperator")},(vo=go||(go={})).filterSensitiveLog=function(e){return f({},e)},vo.isa=function(e){return Object(ic.h)(e,"MetricsConfiguration")},(mo=yo||(yo={})).filterSensitiveLog=function(e){return f({},e)},mo.isa=function(e){return Object(ic.h)(e,"MetricsFilter")},(So=bo||(bo={})).filterSensitiveLog=function(e){return f({},e)},So.isa=function(e){return Object(ic.h)(e,"MultipartUpload")},(_o=wo||(wo={})).filterSensitiveLog=function(e){return f({},e)},_o.isa=function(e){return Object(ic.h)(e,"NoncurrentVersionExpiration")},(Co=Oo||(Oo={})).filterSensitiveLog=function(e){return f({},e)},Co.isa=function(e){return Object(ic.h)(e,"NoncurrentVersionTransition")},(Ao=Eo||(Eo={})).filterSensitiveLog=function(e){return f({},e)},Ao.isa=function(e){return Object(ic.h)(e,"NoSuchBucket")},(Io=jo||(jo={})).filterSensitiveLog=function(e){return f({},e)},Io.isa=function(e){return Object(ic.h)(e,"NoSuchKey")},(Po=xo||(xo={})).filterSensitiveLog=function(e){return f({},e)},Po.isa=function(e){return Object(ic.h)(e,"NoSuchUpload")},(To=ko||(ko={})).filterSensitiveLog=function(e){return f({},e)},To.isa=function(e){return Object(ic.h)(e,"NotificationConfiguration")},(Ro=Uo||(Uo={})).filterSensitiveLog=function(e){return f({},e)},Ro.isa=function(e){return Object(ic.h)(e,"NotificationConfigurationFilter")},(Do=Lo||(Lo={})).filterSensitiveLog=function(e){return f({},e)},Do.isa=function(e){return Object(ic.h)(e,"Object")},(No=Mo||(Mo={})).filterSensitiveLog=function(e){return f({},e)},No.isa=function(e){return Object(ic.h)(e,"ObjectAlreadyInActiveTierError")},(Fo=Bo||(Bo={})).filterSensitiveLog=function(e){return f({},e)},Fo.isa=function(e){return Object(ic.h)(e,"ObjectIdentifier")},(Ko=zo||(zo={})).filterSensitiveLog=function(e){return f({},e)},Ko.isa=function(e){return Object(ic.h)(e,"ObjectLockConfiguration")},(Ho=qo||(qo={})).filterSensitiveLog=function(e){return f({},e)},Ho.isa=function(e){return Object(ic.h)(e,"ObjectLockLegalHold")},(Go=Vo||(Vo={})).filterSensitiveLog=function(e){return f({},e)},Go.isa=function(e){return Object(ic.h)(e,"ObjectLockRetention")},($o=Wo||(Wo={})).filterSensitiveLog=function(e){return f({},e)},$o.isa=function(e){return Object(ic.h)(e,"ObjectLockRule")},(Jo=Yo||(Yo={})).filterSensitiveLog=function(e){return f({},e)},Jo.isa=function(e){return Object(ic.h)(e,"ObjectNotInActiveTierError")},(Zo=Xo||(Xo={})).filterSensitiveLog=function(e){return f({},e)},Zo.isa=function(e){return Object(ic.h)(e,"ObjectVersion")},(es=Qo||(Qo={})).filterSensitiveLog=function(e){return f(f({},e),e.S3&&{S3:ru.filterSensitiveLog(e.S3)})},es.isa=function(e){return Object(ic.h)(e,"OutputLocation")},(ns=ts||(ts={})).filterSensitiveLog=function(e){return f({},e)},ns.isa=function(e){return Object(ic.h)(e,"OutputSerialization")},(is=rs||(rs={})).filterSensitiveLog=function(e){return f({},e)},is.isa=function(e){return Object(ic.h)(e,"Owner")},(ss=os||(os={})).filterSensitiveLog=function(e){return f({},e)},ss.isa=function(e){return Object(ic.h)(e,"ParquetInput")},(us=as||(as={})).filterSensitiveLog=function(e){return f({},e)},us.isa=function(e){return Object(ic.h)(e,"Part")},(fs=cs||(cs={})).filterSensitiveLog=function(e){return f({},e)},fs.isa=function(e){return Object(ic.h)(e,"PolicyStatus")},(ds=ls||(ls={})).filterSensitiveLog=function(e){return f({},e)},ds.isa=function(e){return Object(ic.h)(e,"Progress")},(ps=hs||(hs={})).filterSensitiveLog=function(e){return f({},e)},ps.isa=function(e){return Object(ic.h)(e,"ProgressEvent")},(vs=gs||(gs={})).filterSensitiveLog=function(e){return f({},e)},vs.isa=function(e){return Object(ic.h)(e,"PublicAccessBlockConfiguration")},(ms=ys||(ys={})).filterSensitiveLog=function(e){return f({},e)},ms.isa=function(e){return Object(ic.h)(e,"PutBucketAccelerateConfigurationRequest")},(Ss=bs||(bs={})).filterSensitiveLog=function(e){return f({},e)},Ss.isa=function(e){return Object(ic.h)(e,"PutBucketAclRequest")},(_s=ws||(ws={})).filterSensitiveLog=function(e){return f({},e)},_s.isa=function(e){return Object(ic.h)(e,"PutBucketAnalyticsConfigurationRequest")},(Cs=Os||(Os={})).filterSensitiveLog=function(e){return f({},e)},Cs.isa=function(e){return Object(ic.h)(e,"PutBucketCorsRequest")},(As=Es||(Es={})).filterSensitiveLog=function(e){return f(f({},e),e.ServerSideEncryptionConfiguration&&{ServerSideEncryptionConfiguration:vu.filterSensitiveLog(e.ServerSideEncryptionConfiguration)})},As.isa=function(e){return Object(ic.h)(e,"PutBucketEncryptionRequest")},(Is=js||(js={})).filterSensitiveLog=function(e){return f(f({},e),e.InventoryConfiguration&&{InventoryConfiguration:Qr.filterSensitiveLog(e.InventoryConfiguration)})},Is.isa=function(e){return Object(ic.h)(e,"PutBucketInventoryConfigurationRequest")},(Ps=xs||(xs={})).filterSensitiveLog=function(e){return f({},e)},Ps.isa=function(e){return Object(ic.h)(e,"PutBucketLifecycleConfigurationRequest")},(Ts=ks||(ks={})).filterSensitiveLog=function(e){return f({},e)},Ts.isa=function(e){return Object(ic.h)(e,"PutBucketLoggingRequest")},(Rs=Us||(Us={})).filterSensitiveLog=function(e){return f({},e)},Rs.isa=function(e){return Object(ic.h)(e,"PutBucketMetricsConfigurationRequest")},(Ds=Ls||(Ls={})).filterSensitiveLog=function(e){return f({},e)},Ds.isa=function(e){return Object(ic.h)(e,"PutBucketNotificationConfigurationRequest")},(Ns=Ms||(Ms={})).filterSensitiveLog=function(e){return f({},e)},Ns.isa=function(e){return Object(ic.h)(e,"PutBucketPolicyRequest")},(Fs=Bs||(Bs={})).filterSensitiveLog=function(e){return f({},e)},Fs.isa=function(e){return Object(ic.h)(e,"PutBucketReplicationRequest")},(Ks=zs||(zs={})).filterSensitiveLog=function(e){return f({},e)},Ks.isa=function(e){return Object(ic.h)(e,"PutBucketRequestPaymentRequest")},(Hs=qs||(qs={})).filterSensitiveLog=function(e){return f({},e)},Hs.isa=function(e){return Object(ic.h)(e,"PutBucketTaggingRequest")},(Gs=Vs||(Vs={})).filterSensitiveLog=function(e){return f({},e)},Gs.isa=function(e){return Object(ic.h)(e,"PutBucketVersioningRequest")},($s=Ws||(Ws={})).filterSensitiveLog=function(e){return f({},e)},$s.isa=function(e){return Object(ic.h)(e,"PutBucketWebsiteRequest")},(Js=Ys||(Ys={})).filterSensitiveLog=function(e){return f({},e)},Js.isa=function(e){return Object(ic.h)(e,"PutObjectAclOutput")},(Zs=Xs||(Xs={})).filterSensitiveLog=function(e){return f({},e)},Zs.isa=function(e){return Object(ic.h)(e,"PutObjectAclRequest")},(ea=Qs||(Qs={})).filterSensitiveLog=function(e){return f({},e)},ea.isa=function(e){return Object(ic.h)(e,"PutObjectLegalHoldOutput")},(na=ta||(ta={})).filterSensitiveLog=function(e){return f({},e)},na.isa=function(e){return Object(ic.h)(e,"PutObjectLegalHoldRequest")},(ia=ra||(ra={})).filterSensitiveLog=function(e){return f({},e)},ia.isa=function(e){return Object(ic.h)(e,"PutObjectLockConfigurationOutput")},(sa=oa||(oa={})).filterSensitiveLog=function(e){return f({},e)},sa.isa=function(e){return Object(ic.h)(e,"PutObjectLockConfigurationRequest")},(ua=aa||(aa={})).filterSensitiveLog=function(e){return f(f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c}),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c})},ua.isa=function(e){return Object(ic.h)(e,"PutObjectOutput")},(fa=ca||(ca={})).filterSensitiveLog=function(e){return f(f(f(f({},e),e.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:ic.c}),e.SSECustomerKey&&{SSECustomerKey:ic.c}),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},fa.isa=function(e){return Object(ic.h)(e,"PutObjectRequest")},(da=la||(la={})).filterSensitiveLog=function(e){return f({},e)},da.isa=function(e){return Object(ic.h)(e,"PutObjectRetentionOutput")},(pa=ha||(ha={})).filterSensitiveLog=function(e){return f({},e)},pa.isa=function(e){return Object(ic.h)(e,"PutObjectRetentionRequest")},(va=ga||(ga={})).filterSensitiveLog=function(e){return f({},e)},va.isa=function(e){return Object(ic.h)(e,"PutObjectTaggingOutput")},(ma=ya||(ya={})).filterSensitiveLog=function(e){return f({},e)},ma.isa=function(e){return Object(ic.h)(e,"PutObjectTaggingRequest")},(Sa=ba||(ba={})).filterSensitiveLog=function(e){return f({},e)},Sa.isa=function(e){return Object(ic.h)(e,"PutPublicAccessBlockRequest")},(_a=wa||(wa={})).filterSensitiveLog=function(e){return f({},e)},_a.isa=function(e){return Object(ic.h)(e,"QueueConfiguration")},function(e){e.ALWAYS="ALWAYS",e.ASNEEDED="ASNEEDED"}(Oa||(Oa={})),(Ea=Ca||(Ca={})).filterSensitiveLog=function(e){return f({},e)},Ea.isa=function(e){return Object(ic.h)(e,"RecordsEvent")},(ja=Aa||(Aa={})).filterSensitiveLog=function(e){return f({},e)},ja.isa=function(e){return Object(ic.h)(e,"Redirect")},(xa=Ia||(Ia={})).filterSensitiveLog=function(e){return f({},e)},xa.isa=function(e){return Object(ic.h)(e,"RedirectAllRequestsTo")},(ka=Pa||(Pa={})).filterSensitiveLog=function(e){return f({},e)},ka.isa=function(e){return Object(ic.h)(e,"ReplicationConfiguration")},(Ua=Ta||(Ta={})).filterSensitiveLog=function(e){return f({},e)},Ua.isa=function(e){return Object(ic.h)(e,"ReplicationRule")},(La=Ra||(Ra={})).filterSensitiveLog=function(e){return f({},e)},La.isa=function(e){return Object(ic.h)(e,"ReplicationRuleAndOperator")},(Ma=Da||(Da={})).filterSensitiveLog=function(e){return f({},e)},Ma.isa=function(e){return Object(ic.h)(e,"ReplicationRuleFilter")},(Ba=Na||(Na={})).filterSensitiveLog=function(e){return f({},e)},Ba.isa=function(e){return Object(ic.h)(e,"ReplicationTime")},(za=Fa||(Fa={})).filterSensitiveLog=function(e){return f({},e)},za.isa=function(e){return Object(ic.h)(e,"ReplicationTimeValue")},(qa=Ka||(Ka={})).filterSensitiveLog=function(e){return f({},e)},qa.isa=function(e){return Object(ic.h)(e,"RequestPaymentConfiguration")},(Va=Ha||(Ha={})).filterSensitiveLog=function(e){return f({},e)},Va.isa=function(e){return Object(ic.h)(e,"RequestProgress")},(Wa=Ga||(Ga={})).filterSensitiveLog=function(e){return f({},e)},Wa.isa=function(e){return Object(ic.h)(e,"RestoreObjectOutput")},(Ya=$a||($a={})).filterSensitiveLog=function(e){return f(f({},e),e.RestoreRequest&&{RestoreRequest:Ja.filterSensitiveLog(e.RestoreRequest)})},Ya.isa=function(e){return Object(ic.h)(e,"RestoreObjectRequest")},(Xa=Ja||(Ja={})).filterSensitiveLog=function(e){return f(f({},e),e.OutputLocation&&{OutputLocation:Qo.filterSensitiveLog(e.OutputLocation)})},Xa.isa=function(e){return Object(ic.h)(e,"RestoreRequest")},function(e){e.SELECT="SELECT"}(Za||(Za={})),(eu=Qa||(Qa={})).filterSensitiveLog=function(e){return f({},e)},eu.isa=function(e){return Object(ic.h)(e,"RoutingRule")},(nu=tu||(tu={})).filterSensitiveLog=function(e){return f({},e)},nu.isa=function(e){return Object(ic.h)(e,"S3KeyFilter")},(iu=ru||(ru={})).filterSensitiveLog=function(e){return f(f({},e),e.Encryption&&{Encryption:Et.filterSensitiveLog(e.Encryption)})},iu.isa=function(e){return Object(ic.h)(e,"S3Location")},(su=ou||(ou={})).filterSensitiveLog=function(e){return f({},e)},su.isa=function(e){return Object(ic.h)(e,"ScanRange")},function(e){e.visit=function(e,t){return void 0!==e.Stats?t.Stats(e.Stats):void 0!==e.End?t.End(e.End):void 0!==e.Progress?t.Progress(e.Progress):void 0!==e.Records?t.Records(e.Records):void 0!==e.Cont?t.Cont(e.Cont):t._(e.$unknown[0],e.$unknown[1])},e.filterSensitiveLog=function(e){var t;return void 0!==e.Stats?{Stats:Pu.filterSensitiveLog(e.Stats)}:void 0!==e.End?{End:xt.filterSensitiveLog(e.End)}:void 0!==e.Progress?{Progress:hs.filterSensitiveLog(e.Progress)}:void 0!==e.Records?{Records:Ca.filterSensitiveLog(e.Records)}:void 0!==e.Cont?{Cont:re.filterSensitiveLog(e.Cont)}:void 0!==e.$unknown?((t={})[e.$unknown[0]]="UNKNOWN",t):void 0}}(au||(au={})),(cu=uu||(uu={})).filterSensitiveLog=function(e){return f(f({},e),e.Payload&&{Payload:"STREAMING_CONTENT"})},cu.isa=function(e){return Object(ic.h)(e,"SelectObjectContentOutput")},(lu=fu||(fu={})).filterSensitiveLog=function(e){return f(f({},e),e.SSECustomerKey&&{SSECustomerKey:ic.c})},lu.isa=function(e){return Object(ic.h)(e,"SelectObjectContentRequest")},(hu=du||(du={})).filterSensitiveLog=function(e){return f({},e)},hu.isa=function(e){return Object(ic.h)(e,"SelectParameters")},(gu=pu||(pu={})).filterSensitiveLog=function(e){return f(f({},e),e.KMSMasterKeyID&&{KMSMasterKeyID:ic.c})},gu.isa=function(e){return Object(ic.h)(e,"ServerSideEncryptionByDefault")},(yu=vu||(vu={})).filterSensitiveLog=function(e){return f(f({},e),e.Rules&&{Rules:e.Rules.map((function(e){return mu.filterSensitiveLog(e)}))})},yu.isa=function(e){return Object(ic.h)(e,"ServerSideEncryptionConfiguration")},(bu=mu||(mu={})).filterSensitiveLog=function(e){return f(f({},e),e.ApplyServerSideEncryptionByDefault&&{ApplyServerSideEncryptionByDefault:pu.filterSensitiveLog(e.ApplyServerSideEncryptionByDefault)})},bu.isa=function(e){return Object(ic.h)(e,"ServerSideEncryptionRule")},(wu=Su||(Su={})).filterSensitiveLog=function(e){return f({},e)},wu.isa=function(e){return Object(ic.h)(e,"SourceSelectionCriteria")},(Ou=_u||(_u={})).filterSensitiveLog=function(e){return f(f({},e),e.KeyId&&{KeyId:ic.c})},Ou.isa=function(e){return Object(ic.h)(e,"SSEKMS")},(Eu=Cu||(Cu={})).filterSensitiveLog=function(e){return f({},e)},Eu.isa=function(e){return Object(ic.h)(e,"SseKmsEncryptedObjects")},(ju=Au||(Au={})).filterSensitiveLog=function(e){return f({},e)},ju.isa=function(e){return Object(ic.h)(e,"SSES3")},(xu=Iu||(Iu={})).filterSensitiveLog=function(e){return f({},e)},xu.isa=function(e){return Object(ic.h)(e,"Stats")},(ku=Pu||(Pu={})).filterSensitiveLog=function(e){return f({},e)},ku.isa=function(e){return Object(ic.h)(e,"StatsEvent")},(Uu=Tu||(Tu={})).filterSensitiveLog=function(e){return f({},e)},Uu.isa=function(e){return Object(ic.h)(e,"StorageClassAnalysis")},(Lu=Ru||(Ru={})).filterSensitiveLog=function(e){return f({},e)},Lu.isa=function(e){return Object(ic.h)(e,"StorageClassAnalysisDataExport")},(Mu=Du||(Du={})).filterSensitiveLog=function(e){return f({},e)},Mu.isa=function(e){return Object(ic.h)(e,"Tag")},(Bu=Nu||(Nu={})).filterSensitiveLog=function(e){return f({},e)},Bu.isa=function(e){return Object(ic.h)(e,"Tagging")},(zu=Fu||(Fu={})).filterSensitiveLog=function(e){return f({},e)},zu.isa=function(e){return Object(ic.h)(e,"TargetGrant")},(qu=Ku||(Ku={})).filterSensitiveLog=function(e){return f({},e)},qu.isa=function(e){return Object(ic.h)(e,"TopicConfiguration")},(Vu=Hu||(Hu={})).filterSensitiveLog=function(e){return f({},e)},Vu.isa=function(e){return Object(ic.h)(e,"Transition")},(Wu=Gu||(Gu={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},Wu.isa=function(e){return Object(ic.h)(e,"UploadPartCopyOutput")},(Yu=$u||($u={})).filterSensitiveLog=function(e){return f(f(f({},e),e.CopySourceSSECustomerKey&&{CopySourceSSECustomerKey:ic.c}),e.SSECustomerKey&&{SSECustomerKey:ic.c})},Yu.isa=function(e){return Object(ic.h)(e,"UploadPartCopyRequest")},(Xu=Ju||(Ju={})).filterSensitiveLog=function(e){return f(f({},e),e.SSEKMSKeyId&&{SSEKMSKeyId:ic.c})},Xu.isa=function(e){return Object(ic.h)(e,"UploadPartOutput")},(Qu=Zu||(Zu={})).filterSensitiveLog=function(e){return f(f({},e),e.SSECustomerKey&&{SSECustomerKey:ic.c})},Qu.isa=function(e){return Object(ic.h)(e,"UploadPartRequest")},(tc=ec||(ec={})).filterSensitiveLog=function(e){return f({},e)},tc.isa=function(e){return Object(ic.h)(e,"VersioningConfiguration")},(rc=nc||(nc={})).filterSensitiveLog=function(e){return f({},e)},rc.isa=function(e){return Object(ic.h)(e,"WebsiteConfiguration")};var oc=n(2),sc=n(1);var ac=function(){function e(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}return e.prototype.withName=function(e){return this.name=e,this},e.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},e.prototype.addChildNode=function(e){return this.children.push(e),this},e.prototype.removeAttribute=function(e){return delete this.attributes[e],this},e.prototype.toString=function(){var e,t,n=Boolean(this.children.length),r="<"+this.name,i=this.attributes;try{for(var o=Object(sc.__values)(Object.keys(i)),s=o.next();!s.done;s=o.next()){var a=s.value,u=i[a];null!=u&&(r+=" "+a+'="'+((""+u).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")+'"'))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}return r+(n?">"+this.children.map((function(e){return e.toString()})).join("")+"</"+this.name+">":"/>")},e}();var uc=function(){function e(e){this.value=e}return e.prototype.toString=function(){return(""+this.value).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},e}(),cc=n(79),fc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return r=[f({},e)],c={},[4,Tc(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(c.body=l.sent(),c)])),o="UnknownError",o=Uc(e,n.body),o){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":return[3,2]}return[3,4];case 2:return s=[{}],[4,wc(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,s.concat([l.sent()])),{name:o,$metadata:xc(e)}]),[3,5];case 4:a=n.body,o=a.code||a.Code||o,i=f(f({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:xc(e)}),l.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))]}}))}))},lc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},dc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},hc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},pc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return r=[f({},e)],c={},[4,Tc(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(c.body=l.sent(),c)])),o="UnknownError",o=Uc(e,n.body),o){case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":return[3,2]}return[3,4];case 2:return s=[{}],[4,Sc(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,s.concat([l.sent()])),{name:o,$metadata:xc(e)}]),[3,5];case 4:a=n.body,o=a.code||a.Code||o,i=f(f({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:xc(e)}),l.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))]}}))}))},gc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c;return d(this,(function(l){switch(l.label){case 0:return r=[f({},e)],c={},[4,Tc(e.body,t)];case 1:switch(n=f.apply(void 0,r.concat([(c.body=l.sent(),c)])),o="UnknownError",o=Uc(e,n.body),o){case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":return[3,2]}return[3,4];case 2:return s=[{}],[4,bc(n,t)];case 3:return i=f.apply(void 0,[f.apply(void 0,s.concat([l.sent()])),{name:o,$metadata:xc(e)}]),[3,5];case 4:a=n.body,o=a.code||a.Code||o,i=f(f({},a),{name:""+o,message:a.message||a.Message||o,$fault:"client",$metadata:xc(e)}),l.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))]}}))}))},vc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},yc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},mc=function(e,t){return l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u;return d(this,(function(c){switch(c.label){case 0:return r=[f({},e)],u={},[4,Tc(e.body,t)];case 1:return n=f.apply(void 0,r.concat([(u.body=c.sent(),u)])),o="UnknownError",o=Uc(e,n.body),s=n.body,o=s.code||s.Code||o,i=f(f({},s),{name:""+o,message:s.message||s.Message||o,$fault:"client",$metadata:xc(e)}),a=i.message||i.Message||o,i.message=a,delete i.Message,[2,Promise.reject(Object.assign(new Error(a),i))]}}))}))},bc=function(e,t){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){return t={name:"NoSuchBucket",$fault:"client",$metadata:xc(e)},e.body,[2,t]}))}))},Sc=function(e,t){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){return t={name:"NoSuchKey",$fault:"client",$metadata:xc(e)},e.body,[2,t]}))}))},wc=function(e,t){return l(void 0,void 0,void 0,(function(){var t;return d(this,(function(n){return t={name:"NoSuchUpload",$fault:"client",$metadata:xc(e)},e.body,[2,t]}))}))},_c=function(e,t){var n=new ac("CompletedMultipartUpload");void 0!==e.Parts&&Oc(e.Parts,t).map((function(e){e=e.withName("Part"),n.addChildNode(e)}));return n},Oc=function(e,t){return e.map((function(e){return function(e,t){var n=new ac("CompletedPart");if(void 0!==e.ETag){var r=new ac("ETag").addChildNode(new uc(e.ETag)).withName("ETag");n.addChildNode(r)}if(void 0!==e.PartNumber){r=new ac("PartNumber").addChildNode(new uc(String(e.PartNumber))).withName("PartNumber");n.addChildNode(r)}return n}(e).withName("member")}))},Cc=function(e,t){return(e||[]).map((function(e){return function(e,t){var n={__type:"CommonPrefix",Prefix:void 0};return void 0!==e.Prefix&&(n.Prefix=e.Prefix),n}(e)}))},Ec=function(e,t){var n={__type:"Initiator",ID:void 0,DisplayName:void 0};return void 0!==e.ID&&(n.ID=e.ID),void 0!==e.DisplayName&&(n.DisplayName=e.DisplayName),n},Ac=function(e,t){return(e||[]).map((function(e){return function(e,t){var n={__type:"Object",Owner:void 0,StorageClass:void 0,LastModified:void 0,ETag:void 0,Size:void 0,Key:void 0};return void 0!==e.Owner&&(n.Owner=jc(e.Owner,t)),void 0!==e.StorageClass&&(n.StorageClass=e.StorageClass),void 0!==e.LastModified&&(n.LastModified=new Date(e.LastModified)),void 0!==e.ETag&&(n.ETag=e.ETag),void 0!==e.Size&&(n.Size=parseInt(e.Size)),void 0!==e.Key&&(n.Key=e.Key),n}(e,t)}))},jc=function(e,t){var n={__type:"Owner",DisplayName:void 0,ID:void 0};return void 0!==e.DisplayName&&(n.DisplayName=e.DisplayName),void 0!==e.ID&&(n.ID=e.ID),n},Ic=function(e,t){return(e||[]).map((function(e){return function(e,t){var n={__type:"Part",ETag:void 0,PartNumber:void 0,LastModified:void 0,Size:void 0};return void 0!==e.ETag&&(n.ETag=e.ETag),void 0!==e.PartNumber&&(n.PartNumber=parseInt(e.PartNumber)),void 0!==e.LastModified&&(n.LastModified=new Date(e.LastModified)),void 0!==e.Size&&(n.Size=parseInt(e.Size)),n}(e)}))},xc=function(e){return{httpStatusCode:e.statusCode,httpHeaders:e.headers,requestId:e.headers["x-amzn-requestid"]}},Pc=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},kc=function(e){return!(void 0===e||""===e||Object.getOwnPropertyNames(e).includes("length")&&0==e.length||Object.getOwnPropertyNames(e).includes("size")&&0==e.size)},Tc=function(e,t){return function(e,t){return Pc(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){if(e.length){var t=Object(cc.parse)(e,{attributeNamePrefix:"",ignoreAttributes:!1,parseNodeValue:!1,tagValueProcessor:function(e,t){return e.replace(/&amp;/g,"&").replace(/&apos;/g,"'").replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<")}}),n=Object.keys(t)[0],r=t[n];return r["#text"]&&(r[n]=r["#text"],delete r["#text"]),Object(ic.g)(r)}return{}}))},Uc=function(e,t){return void 0!==t.Code?t.Code:404==e.statusCode?"NotFound":""},Rc=function(e){return"string"==typeof e&&0===e.indexOf("arn:")&&e.split(":").length>=6},Lc=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Dc=/(\d+\.){3}\d+/,Mc=/\.\./,Nc=/\./,Bc=/^(.+\.)?s3[.-]([a-z0-9-]+)\./,Fc=/^s3(-external-1)?\.amazonaws\.com$/,zc=function(e){return qc(e)?e.replace(/fips-|-fips/,""):e},Kc=function(e){var t=e.match(Bc);return[t[2],e.replace(new RegExp("^"+t[0]),"")]},qc=function(e){return e.startsWith("fips-")||e.endsWith("-fips")},Hc=function(e,t){return e===t||zc(e)===t||e===zc(t)},Vc=function(e){var t=e.baseHostname;return Bc.test(t)?function(e){return"string"==typeof e.bucketName}(e)?Wc(e):{bucketEndpoint:!0,hostname:Gc(e)}:{bucketEndpoint:!1,hostname:t}},Gc=function(e){var t,n=Object(sc.__read)((t=e.baseHostname,Fc.test(t)?[t.replace(".amazonaws.com",""),"amazonaws.com"]:Kc(t)),2),r=n[0],i=n[1],o=e.pathStyleEndpoint,s=e.dualstackEndpoint,a=e.accelerateEndpoint,u=e.tlsCompatible,c=void 0===u||u,f=e.useArnRegion,l=e.bucketName,d=e.clientPartition,h=void 0===d?"aws":d,p=e.clientSigningRegion,g=void 0===p?r:p;if(o)throw new Error("Path-style S3 endpoint is not supported when bucket is an Access Point ARN");if(a)throw new Error("Accelerate is not supported when bucket is an Access Point ARN");if(!c)throw new Error("Access Point can only be used with https");var v=l.service,y=l.partition,m=l.accountId,b=l.region,S=l.resource;!function(e){if("s3"!==e)throw new Error("Expect 's3' in access point ARN service component")}(v),function(e,t){if(""===e)throw new Error("Access point ARN region is empty");if(!t.useArnRegion&&!Hc(e,t.clientRegion)&&!Hc(e,t.clientSigningRegion))throw new Error("Region in ARN is incompatible, got "+e+" but expected "+t.clientRegion);if(t.useArnRegion&&qc(e))throw new Error("Access point endpoint does not support FIPS region")}(b,{useArnRegion:f,clientRegion:r,clientSigningRegion:g}),function(e,t){if(e!==t.clientPartition)throw new Error('Partition in ARN is incompatible, got "'+e+'" but expected "'+t.clientPartition+'"')}(y,{clientPartition:h}),function(e){if(!/[0-9]{12}/.exec(e))throw new Error("Access point ARN accountID does not match regex '[0-9]{12}'")}(m);var w=function(e){if(0!==e.indexOf("accesspoint:")&&0!==e.indexOf("accesspoint/"))throw new Error("Access point ARN resource should begin with 'accesspoint/'");var t=e.split(e["accesspoint".length]);if(2!==t.length||""===t[1])throw new Error("Access Point ARN should have one resource accesspoint/{accesspointname}");return t[1]}(S);return function(e,t){if(void 0===t&&(t={tlsCompatible:!0}),e.length>=64||!/^[a-z0-9][a-z0-9.-]+[a-z0-9]$/.test(e)||/(\d+\.){3}\d+/.test(e)||/[.-]{2}/.test(e)||(null==t?void 0:t.tlsCompatible)&&Nc.test(e))throw new Error("Invalid DNS label "+e)}(w+"-"+m,{tlsCompatible:c}),w+"-"+m+".s3-accesspoint"+(s?".dualstack":"")+"."+(f?b:r)+"."+i},Wc=function(e){var t,n=e.accelerateEndpoint,r=void 0!==n&&n,i=e.baseHostname,o=e.bucketName,s=e.dualstackEndpoint,a=void 0!==s&&s,u=e.pathStyleEndpoint,c=void 0!==u&&u,f=e.tlsCompatible,l=void 0===f||f,d=Object(sc.__read)((t=i,Fc.test(t)?["us-east-1","amazonaws.com"]:Kc(t)),2),h=d[0],p=d[1];return c||!function(e){return Lc.test(e)&&!Dc.test(e)&&!Mc.test(e)}(o)||l&&Nc.test(o)?{bucketEndpoint:!1,hostname:a?"s3.dualstack."+h+"."+p:i}:(r?i="s3-accelerate"+(a?".dualstack":"")+"."+p:a&&(i="s3.dualstack."+h+"."+p),{bucketEndpoint:!0,hostname:o+"."+i})};function $c(e){var t=this;return function(n,r){return function(i){return Object(sc.__awaiter)(t,void 0,void 0,(function(){var t,o,s,a,u,c,f,l,d,h,p,g,v,y;return Object(sc.__generator)(this,(function(m){switch(m.label){case 0:return t=i.input.Bucket,o=e.bucketEndpoint,s=i.request,oc.a.isInstance(s)?e.bucketEndpoint?(s.hostname=t,[3,6]):[3,1]:[3,7];case 1:return Rc(t)?(a=function(e){var t=e.split(":");if(t.length<6||"arn"!==t[0])throw new Error("Malformed ARN");var n=Object(sc.__read)(t);return{partition:n[1],service:n[2],region:n[3],accountId:n[4],resource:n.slice(5).join(":")}}(t),c=zc,[4,e.region()]):[3,5];case 2:return u=c.apply(void 0,[m.sent()]),[4,e.regionInfoProvider(u)];case 3:return f=m.sent()||{},l=f.partition,d=f.signingRegion,[4,e.useArnRegion()];case 4:return h=m.sent(),p=Vc({bucketName:a,baseHostname:s.hostname,accelerateEndpoint:e.useAccelerateEndpoint,dualstackEndpoint:e.useDualstackEndpoint,pathStyleEndpoint:e.forcePathStyle,tlsCompatible:"https:"===s.protocol,useArnRegion:h,clientPartition:l,clientSigningRegion:d}),v=p.hostname,y=p.bucketEndpoint,h&&u!==a.region&&(r.signing_region=a.region),s.hostname=v,o=y,[3,6];case 5:g=Vc({bucketName:t,baseHostname:s.hostname,accelerateEndpoint:e.useAccelerateEndpoint,dualstackEndpoint:e.useDualstackEndpoint,pathStyleEndpoint:e.forcePathStyle,tlsCompatible:"https:"===s.protocol}),v=g.hostname,y=g.bucketEndpoint,s.hostname=v,o=y,m.label=6;case 6:o&&(s.path=s.path.replace(/^(\/)?[^\/]+/,""),""===s.path&&(s.path="/")),m.label=7;case 7:return[2,n(Object(sc.__assign)(Object(sc.__assign)({},i),{request:s}))]}}))}))}}}var Yc={tags:["BUCKET_ENDPOINT"],name:"bucketEndpointMiddleware",relation:"before",toMiddleware:"hostHeaderMiddleware"},Jc=function(e){return{applyToStack:function(t){t.addRelativeTo($c(e),Yc)}}};var Xc=n(4);var Zc={name:"ssecMiddleware",step:"initialize",tags:["SSE"]},Qc=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(sc.__awaiter)(t,void 0,void 0,(function(){var t,i,o,s,a,u,c,f,l,d,h,p,g,v,y,m,b;return Object(sc.__generator)(this,(function(S){switch(S.label){case 0:t=Object(sc.__assign)({},r.input),i=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}],S.label=1;case 1:S.trys.push([1,6,7,8]),o=Object(sc.__values)(i),s=o.next(),S.label=2;case 2:return s.done?[3,5]:(a=s.value,(u=t[a.target])?(c=ArrayBuffer.isView(u)?new Uint8Array(u.buffer,u.byteOffset,u.byteLength):"string"==typeof u?e.utf8Decoder(u):new Uint8Array(u),f=e.base64Encoder(c),(l=new e.md5).update(c),d=[Object(sc.__assign)({},t)],(b={})[a.target]=f,h=a.hash,g=(p=e).base64Encoder,[4,l.digest()]):[3,4]);case 3:t=sc.__assign.apply(void 0,d.concat([(b[h]=g.apply(p,[S.sent()]),b)])),S.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return v=S.sent(),y={error:v},[3,8];case 7:try{s&&!s.done&&(m=o.return)&&m.call(o)}finally{if(y)throw y.error}return[7];case 8:return[2,n(Object(sc.__assign)(Object(sc.__assign)({},r),{input:t}))]}}))}))}}}(e),Zc)}}},ef=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Qc(t)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:yr.filterSensitiveLog,outputFilterSensitiveLog:gr.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f(f(f(f(f(f(f(f(f({"Content-Type":""},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),kc(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-MD5":e.SSECustomerKeyMD5}),kc(e.IfNoneMatch)&&{"If-None-Match":e.IfNoneMatch}),kc(e.IfMatch)&&{"If-Match":e.IfMatch}),kc(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),kc(e.Range)&&{Range:e.Range}),kc(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),kc(e.IfModifiedSince)&&{"If-Modified-Since":Object(ic.d)(e.IfModifiedSince).toString()}),kc(e.IfUnmodifiedSince)&&{"If-Unmodified-Since":Object(ic.d)(e.IfUnmodifiedSince).toString()}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(ic.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),o=f(f(f(f(f(f(f(f({"x-id":"GetObject"},void 0!==e.ResponseContentDisposition&&{"response-content-disposition":e.ResponseContentDisposition}),void 0!==e.ResponseContentLanguage&&{"response-content-language":e.ResponseContentLanguage}),void 0!==e.VersionId&&{versionId:e.VersionId}),void 0!==e.ResponseContentEncoding&&{"response-content-encoding":e.ResponseContentEncoding}),void 0!==e.ResponseCacheControl&&{"response-cache-control":e.ResponseCacheControl}),void 0!==e.ResponseExpires&&{"response-expires":(e.ResponseExpires.toISOString().split(".")[0]+"Z").toString()}),void 0!==e.ResponseContentType&&{"response-content-type":e.ResponseContentType}),void 0!==e.PartNumber&&{partNumber:e.PartNumber.toString()}),[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return d(this,(function(i){return 200!==e.statusCode&&e.statusCode>=400?[2,pc(e,t)]:(n={$metadata:xc(e),__type:"GetObjectOutput",AcceptRanges:void 0,Body:void 0,CacheControl:void 0,ContentDisposition:void 0,ContentEncoding:void 0,ContentLanguage:void 0,ContentLength:void 0,ContentRange:void 0,ContentType:void 0,DeleteMarker:void 0,ETag:void 0,Expiration:void 0,Expires:void 0,LastModified:void 0,Metadata:void 0,MissingMeta:void 0,ObjectLockLegalHoldStatus:void 0,ObjectLockMode:void 0,ObjectLockRetainUntilDate:void 0,PartsCount:void 0,ReplicationStatus:void 0,RequestCharged:void 0,Restore:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,StorageClass:void 0,TagCount:void 0,VersionId:void 0,WebsiteRedirectLocation:void 0},void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-restore"]&&(n.Restore=e.headers["x-amz-restore"]),void 0!==e.headers["last-modified"]&&(n.LastModified=new Date(e.headers["last-modified"])),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-mp-parts-count"]&&(n.PartsCount=parseInt(e.headers["x-amz-mp-parts-count"],10)),void 0!==e.headers["content-range"]&&(n.ContentRange=e.headers["content-range"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-object-lock-mode"]&&(n.ObjectLockMode=e.headers["x-amz-object-lock-mode"]),void 0!==e.headers["accept-ranges"]&&(n.AcceptRanges=e.headers["accept-ranges"]),void 0!==e.headers["content-encoding"]&&(n.ContentEncoding=e.headers["content-encoding"]),void 0!==e.headers["x-amz-storage-class"]&&(n.StorageClass=e.headers["x-amz-storage-class"]),void 0!==e.headers["x-amz-tagging-count"]&&(n.TagCount=parseInt(e.headers["x-amz-tagging-count"],10)),void 0!==e.headers["x-amz-delete-marker"]&&(n.DeleteMarker="true"===e.headers["x-amz-delete-marker"]),void 0!==e.headers["x-amz-missing-meta"]&&(n.MissingMeta=parseInt(e.headers["x-amz-missing-meta"],10)),void 0!==e.headers["x-amz-object-lock-retain-until-date"]&&(n.ObjectLockRetainUntilDate=new Date(e.headers["x-amz-object-lock-retain-until-date"])),void 0!==e.headers["content-language"]&&(n.ContentLanguage=e.headers["content-language"]),void 0!==e.headers.expires&&(n.Expires=new Date(e.headers.expires)),void 0!==e.headers["content-length"]&&(n.ContentLength=parseInt(e.headers["content-length"],10)),void 0!==e.headers["content-disposition"]&&(n.ContentDisposition=e.headers["content-disposition"]),void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-object-lock-legal-hold"]&&(n.ObjectLockLegalHoldStatus=e.headers["x-amz-object-lock-legal-hold"]),void 0!==e.headers["content-type"]&&(n.ContentType=e.headers["content-type"]),void 0!==e.headers["cache-control"]&&(n.CacheControl=e.headers["cache-control"]),void 0!==e.headers["x-amz-website-redirect-location"]&&(n.WebsiteRedirectLocation=e.headers["x-amz-website-redirect-location"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-replication-status"]&&(n.ReplicationStatus=e.headers["x-amz-replication-status"]),void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),Object.keys(e.headers).forEach((function(t){void 0===n.Metadata&&(n.Metadata={}),t.startsWith("x-amz-meta-")&&(n.Metadata[t.substring(11)]=e.headers[t])})),r=e.body,n.Body=r,[2,Promise.resolve(n)])}))}))}(e,t)},t}(ic.b),tf=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:lt.filterSensitiveLog,outputFilterSensitiveLog:ct.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f(f(f({"Content-Type":""},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),kc(e.MFA)&&{"x-amz-mfa":e.MFA}),kc(e.BypassGovernanceRetention)&&{"x-amz-bypass-governance-retention":e.BypassGovernanceRetention.toString()}),r="/{Bucket}/{Key+}",void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");if(r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");return r=r.replace("{Bucket}",Object(ic.e)(i)),o=f({"x-id":"DeleteObject"},void 0!==e.VersionId&&{versionId:e.VersionId}),[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"DELETE",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return 204!==e.statusCode&&e.statusCode>=400?[2,hc(e,t)]:(n={$metadata:xc(e),__type:"DeleteObjectOutput",DeleteMarker:void 0,RequestCharged:void 0,VersionId:void 0},void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-delete-marker"]&&(n.DeleteMarker="true"===e.headers["x-amz-delete-marker"]),[4,Pc(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),nf=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:Gi.filterSensitiveLog,outputFilterSensitiveLog:Hi.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f({"Content-Type":""},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),r="/{Bucket}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");return r=r.replace("{Bucket}",Object(ic.e)(i)),o=f(f(f(f(f({},void 0!==e.Marker&&{marker:e.Marker}),void 0!==e.Prefix&&{prefix:e.Prefix}),void 0!==e.EncodingType&&{"encoding-type":e.EncodingType}),void 0!==e.MaxKeys&&{"max-keys":e.MaxKeys.toString()}),void 0!==e.Delimiter&&{delimiter:e.Delimiter}),[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,gc(e,t)]:(n={$metadata:xc(e),__type:"ListObjectsOutput",CommonPrefixes:void 0,Contents:void 0,Delimiter:void 0,EncodingType:void 0,IsTruncated:void 0,Marker:void 0,MaxKeys:void 0,Name:void 0,NextMarker:void 0,Prefix:void 0},[4,Tc(e.body,t)]);case 1:return""===(r=i.sent()).CommonPrefixes&&(n.CommonPrefixes=[]),void 0!==r.CommonPrefixes&&(n.CommonPrefixes=Cc(Object(ic.f)(r.CommonPrefixes),t)),""===r.Contents&&(n.Contents=[]),void 0!==r.Contents&&(n.Contents=Ac(Object(ic.f)(r.Contents),t)),void 0!==r.Delimiter&&(n.Delimiter=r.Delimiter),void 0!==r.EncodingType&&(n.EncodingType=r.EncodingType),void 0!==r.IsTruncated&&(n.IsTruncated="true"==r.IsTruncated),void 0!==r.Marker&&(n.Marker=r.Marker),void 0!==r.MaxKeys&&(n.MaxKeys=parseInt(r.MaxKeys)),void 0!==r.Name&&(n.Name=r.Name),void 0!==r.NextMarker&&(n.NextMarker=r.NextMarker),void 0!==r.Prefix&&(n.Prefix=r.Prefix),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),rf=n(48),of=n(35),sf=n(41),af=n(6),uf=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&&cf(n),new e(n)},e.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&cf(e),parseInt(Object(af.b)(e),16)*(t?-1:1)},e.prototype.toString=function(){return String(this.valueOf())},e}();function cf(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}var ff,lf=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(sc.__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(sc.__values)(o),h=d.next();!h.done;h=d.next()){var p=h.value;f.set(p,l),l+=p.byteLength}}catch(e){r={error:e}}finally{try{h&&!h.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(uf.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!wf.test(e.value))throw new Error("Invalid UUID received: "+e.value);var f=new Uint8Array(17);return f[0]=9,f.set(Object(af.a)(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:df,value:!0};break;case 1:t[i]={type:df,value:!1};break;case 2:t[i]={type:hf,value:e.getInt8(n++)};break;case 3:t[i]={type:pf,value:e.getInt16(n,!1)},n+=2;break;case 4:t[i]={type:gf,value:e.getInt32(n,!1)},n+=4;break;case 5:t[i]={type:vf,value:new uf(new Uint8Array(e.buffer,e.byteOffset+n,8))},n+=8;break;case 6:var o=e.getUint16(n,!1);n+=2,t[i]={type:yf,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:mf,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+n,s))},n+=s;break;case 8:t[i]={type:bf,value:new Date(new uf(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:Sf,value:Object(af.b)(a.subarray(0,4))+"-"+Object(af.b)(a.subarray(4,6))+"-"+Object(af.b)(a.subarray(6,8))+"-"+Object(af.b)(a.subarray(8,10))+"-"+Object(af.b)(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"}(ff||(ff={}));var df="boolean",hf="byte",pf="short",gf="integer",vf="long",yf="binary",mf="string",bf="timestamp",Sf="uuid",wf=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var _f=function(){function e(e,t){this.headerMarshaller=new lf(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 sf.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 sf.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 Of=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new _f(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(sc.__asyncGenerator)(this,arguments,(function(){var n,r,i,o,s,a,u,c,f,l,d,h,p,g,v,y,m;return Object(sc.__generator)(this,(function(b){switch(b.label){case 0:b.trys.push([0,12,13,18]),n=Object(sc.__asyncValues)(e),b.label=1;case 1:return[4,Object(sc.__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,(g={})[u]=o,c=g,[4,Object(sc.__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]:((v={})[o.headers[":event-type"].value]=o,d=v,[4,Object(sc.__await)(t.deserializer(d))]);case 6:return(h=b.sent()).$unknown?[3,10]:[4,Object(sc.__await)(h)];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 p=b.sent(),y={error:p},[3,18];case 13:return b.trys.push([13,,16,17]),r&&!r.done&&(m=n.return)?[4,Object(sc.__await)(m.call(n))]:[3,15];case 14:b.sent(),b.label=15;case 15:return[3,17];case 16:if(y)throw y.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(sc.__asyncGenerator)(this,arguments,(function(){var e,t,r,c,f,l,d,h;return Object(sc.__generator)(this,(function(p){switch(p.label){case 0:e=n[Symbol.asyncIterator](),p.label=1;case 1:return[4,Object(sc.__await)(e.next())];case 2:return t=p.sent(),r=t.value,t.done?i?[3,4]:[4,Object(sc.__await)(void 0)]:[3,10];case 3:return[2,p.sent()];case 4:return i!==o?[3,7]:[4,Object(sc.__await)(s)];case 5:return[4,p.sent()];case 6:return p.sent(),[3,8];case 7:throw new Error("Truncated event message received.");case 8:return[4,Object(sc.__await)(void 0)];case 9:return[2,p.sent()];case 10:c=r.length,f=0,p.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 h=Math.min(i-o,c-f),s.set(r.slice(f,f+h),o),o+=h,f+=h,i&&i===o?[4,Object(sc.__await)(s)]:[3,14];case 12:return[4,p.sent()];case 13:p.sent(),s=null,i=0,o=0,p.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(sc.__asyncGenerator)(this,arguments,(function(){var n,i,o,s,a,u,c;return Object(sc.__generator)(this,(function(f){switch(f.label){case 0:f.trys.push([0,7,8,13]),n=Object(sc.__asyncValues)(e),f.label=1;case 1:return[4,Object(sc.__await)(n.next())];case 2:return(i=f.sent()).done?[3,6]:(o=i.value,s=r.eventMarshaller.marshall(t(o)),[4,Object(sc.__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(sc.__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(sc.__await)(new Uint8Array(0))];case 14:return[4,f.sent()];case 15:return f.sent(),[2]}}))}))},n},e}(),Cf=function(){function e(e){var t=e.utf8Encoder,n=e.utf8Decoder;this.eventMarshaller=new _f(t,n),this.universalMarshaller=new Of({utf8Decoder:n,utf8Encoder:t})}return e.prototype.deserialize=function(e,t){var n,r,i=Ef(e)?(n=e,(r={})[Symbol.asyncIterator]=function(){return Object(sc.__asyncGenerator)(this,arguments,(function(){var e,t,r,i;return Object(sc.__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(sc.__await)(e.read())];case 3:return t=o.sent(),r=t.done,i=t.value,r?[4,Object(sc.__await)(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Object(sc.__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(sc.__awaiter)(this,void 0,void 0,(function(){var t,r,i;return Object(sc.__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}(),Ef=function(e){return"function"==typeof ReadableStream&&e instanceof ReadableStream},Af=n(16);function jf(e,t,n){return void 0===n&&(n=1048576),new Promise((function(r,i){var o=new FileReader;o.addEventListener("error",i),o.addEventListener("abort",i);var s=e.size,a=0;function u(){a>=s?r():o.readAsArrayBuffer(e.slice(a,Math.min(s,a+n)))}o.addEventListener("load",(function(e){var n=e.target.result;t(new Uint8Array(n)),a+=n.byteLength,u()})),u()}))}var If=n(30),xf=n(17),Pf=[1732584193,4023233417,2562383102,271733878],kf=function(){function e(){this.state=Uint32Array.from(Pf),this.buffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(!function(e){if("string"==typeof e)return 0===e.length;return 0===e.byteLength}(e)){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=function(e){if("string"==typeof e)return Object(xf.a)(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)}(e),n=0,r=t.byteLength;for(this.bytesHashed+=r;r>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),r--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0)}},e.prototype.digest=function(){return Object(sc.__awaiter)(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return Object(sc.__generator)(this,(function(a){if(!this.finished){if(t=(e=this).buffer,n=e.bufferLength,r=e.bytesHashed,i=8*r,t.setUint8(this.bufferLength++,128),n%64>=56){for(s=this.bufferLength;s<64;s++)t.setUint8(s,0);this.hashBuffer(),this.bufferLength=0}for(s=this.bufferLength;s<56;s++)t.setUint8(s,0);t.setUint32(56,i>>>0,!0),t.setUint32(60,Math.floor(i/4294967296),!0),this.hashBuffer(),this.finished=!0}for(o=new DataView(new ArrayBuffer(16)),s=0;s<4;s++)o.setUint32(4*s,this.state[s],!0);return[2,new Uint8Array(o.buffer,o.byteOffset,o.byteLength)]}))}))},e.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3];n=Uf(n,r,i,o,e.getUint32(0,!0),7,3614090360),o=Uf(o,n,r,i,e.getUint32(4,!0),12,3905402710),i=Uf(i,o,n,r,e.getUint32(8,!0),17,606105819),r=Uf(r,i,o,n,e.getUint32(12,!0),22,3250441966),n=Uf(n,r,i,o,e.getUint32(16,!0),7,4118548399),o=Uf(o,n,r,i,e.getUint32(20,!0),12,1200080426),i=Uf(i,o,n,r,e.getUint32(24,!0),17,2821735955),r=Uf(r,i,o,n,e.getUint32(28,!0),22,4249261313),n=Uf(n,r,i,o,e.getUint32(32,!0),7,1770035416),o=Uf(o,n,r,i,e.getUint32(36,!0),12,2336552879),i=Uf(i,o,n,r,e.getUint32(40,!0),17,4294925233),r=Uf(r,i,o,n,e.getUint32(44,!0),22,2304563134),n=Uf(n,r,i,o,e.getUint32(48,!0),7,1804603682),o=Uf(o,n,r,i,e.getUint32(52,!0),12,4254626195),i=Uf(i,o,n,r,e.getUint32(56,!0),17,2792965006),n=Rf(n,r=Uf(r,i,o,n,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=Rf(o,n,r,i,e.getUint32(24,!0),9,3225465664),i=Rf(i,o,n,r,e.getUint32(44,!0),14,643717713),r=Rf(r,i,o,n,e.getUint32(0,!0),20,3921069994),n=Rf(n,r,i,o,e.getUint32(20,!0),5,3593408605),o=Rf(o,n,r,i,e.getUint32(40,!0),9,38016083),i=Rf(i,o,n,r,e.getUint32(60,!0),14,3634488961),r=Rf(r,i,o,n,e.getUint32(16,!0),20,3889429448),n=Rf(n,r,i,o,e.getUint32(36,!0),5,568446438),o=Rf(o,n,r,i,e.getUint32(56,!0),9,3275163606),i=Rf(i,o,n,r,e.getUint32(12,!0),14,4107603335),r=Rf(r,i,o,n,e.getUint32(32,!0),20,1163531501),n=Rf(n,r,i,o,e.getUint32(52,!0),5,2850285829),o=Rf(o,n,r,i,e.getUint32(8,!0),9,4243563512),i=Rf(i,o,n,r,e.getUint32(28,!0),14,1735328473),n=Lf(n,r=Rf(r,i,o,n,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=Lf(o,n,r,i,e.getUint32(32,!0),11,2272392833),i=Lf(i,o,n,r,e.getUint32(44,!0),16,1839030562),r=Lf(r,i,o,n,e.getUint32(56,!0),23,4259657740),n=Lf(n,r,i,o,e.getUint32(4,!0),4,2763975236),o=Lf(o,n,r,i,e.getUint32(16,!0),11,1272893353),i=Lf(i,o,n,r,e.getUint32(28,!0),16,4139469664),r=Lf(r,i,o,n,e.getUint32(40,!0),23,3200236656),n=Lf(n,r,i,o,e.getUint32(52,!0),4,681279174),o=Lf(o,n,r,i,e.getUint32(0,!0),11,3936430074),i=Lf(i,o,n,r,e.getUint32(12,!0),16,3572445317),r=Lf(r,i,o,n,e.getUint32(24,!0),23,76029189),n=Lf(n,r,i,o,e.getUint32(36,!0),4,3654602809),o=Lf(o,n,r,i,e.getUint32(48,!0),11,3873151461),i=Lf(i,o,n,r,e.getUint32(60,!0),16,530742520),n=Df(n,r=Lf(r,i,o,n,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=Df(o,n,r,i,e.getUint32(28,!0),10,1126891415),i=Df(i,o,n,r,e.getUint32(56,!0),15,2878612391),r=Df(r,i,o,n,e.getUint32(20,!0),21,4237533241),n=Df(n,r,i,o,e.getUint32(48,!0),6,1700485571),o=Df(o,n,r,i,e.getUint32(12,!0),10,2399980690),i=Df(i,o,n,r,e.getUint32(40,!0),15,4293915773),r=Df(r,i,o,n,e.getUint32(4,!0),21,2240044497),n=Df(n,r,i,o,e.getUint32(32,!0),6,1873313359),o=Df(o,n,r,i,e.getUint32(60,!0),10,4264355552),i=Df(i,o,n,r,e.getUint32(24,!0),15,2734768916),r=Df(r,i,o,n,e.getUint32(52,!0),21,1309151649),n=Df(n,r,i,o,e.getUint32(16,!0),6,4149444226),o=Df(o,n,r,i,e.getUint32(44,!0),10,3174756917),i=Df(i,o,n,r,e.getUint32(8,!0),15,718787259),r=Df(r,i,o,n,e.getUint32(36,!0),21,3951481745),t[0]=n+t[0]&4294967295,t[1]=r+t[1]&4294967295,t[2]=i+t[2]&4294967295,t[3]=o+t[3]&4294967295},e}();function Tf(e,t,n,r,i,o){return((t=(t+e&4294967295)+(r+o&4294967295)&4294967295)<<i|t>>>32-i)+n&4294967295}function Uf(e,t,n,r,i,o,s){return Tf(t&n|~t&r,e,t,i,o,s)}function Rf(e,t,n,r,i,o,s){return Tf(t&r|n&~r,e,t,i,o,s)}function Lf(e,t,n,r,i,o,s){return Tf(t^n^r,e,t,i,o,s)}function Df(e,t,n,r,i,o,s){return Tf(n^(t|~r),e,t,i,o,s)}var Mf=n(11),Nf=n(36),Bf=n(15),Ff=n(38),zf=n(39),Kf=new Set(["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-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"]),Hf=new Set(["us-iso-east-1"]),Vf=new Set(["us-isob-east-1"]),Gf=new Set(["us-gov-east-1","us-gov-west-1"]),Wf=f(f({},{apiVersion:"2006-03-01",disableHostPrefix:!1,regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-east-1":n={hostname:"s3.ap-east-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-1":n={hostname:"s3.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"s3.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"s3.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"s3.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"s3.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"s3.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"s3.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"cn-northwest-1":n={hostname:"s3.cn-northwest-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"s3.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-north-1":n={hostname:"s3.eu-north-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"s3.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"s3.eu-west-2.amazonaws.com",partition:"aws"};break;case"eu-west-3":n={hostname:"s3.eu-west-3.amazonaws.com",partition:"aws"};break;case"fips-us-gov-west-1":n={hostname:"s3-fips-us-gov-west-1.amazonaws.com",partition:"aws-us-gov",signingRegion:"us-gov-west-1"};break;case"me-south-1":n={hostname:"s3.me-south-1.amazonaws.com",partition:"aws"};break;case"s3-external-1":n={hostname:"s3-external-1.amazonaws.com",partition:"aws",signingRegion:"us-east-1"};break;case"sa-east-1":n={hostname:"s3.sa-east-1.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"s3.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"s3.us-east-2.amazonaws.com",partition:"aws"};break;case"us-gov-east-1":n={hostname:"s3.us-gov-east-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-gov-west-1":n={hostname:"s3.us-gov-west-1.amazonaws.com",partition:"aws-us-gov"};break;case"us-iso-east-1":n={hostname:"s3.us-iso-east-1.c2s.ic.gov",partition:"aws-iso"};break;case"us-isob-east-1":n={hostname:"s3.us-isob-east-1.sc2s.sgov.gov",partition:"aws-iso-b"};break;case"us-west-1":n={hostname:"s3.us-west-1.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"s3.us-west-2.amazonaws.com",partition:"aws"};break;default:Kf.has(e)&&(n={hostname:"s3.{region}.amazonaws.com".replace("{region}",e),partition:"aws"}),qf.has(e)&&(n={hostname:"s3.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Hf.has(e)&&(n={hostname:"s3.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Vf.has(e)&&(n={hostname:"s3.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Gf.has(e)&&(n={hostname:"s3.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:"s3.{region}.amazonaws.com".replace("{region}",e),partition:"aws"})}return Promise.resolve(n)},signingEscapePath:!1,signingName:"s3",useArnRegion:!1}),{runtime:"browser",base64Decoder:Bf.a,base64Encoder:Bf.b,bodyLengthChecker:Ff.a,credentialDefaultProvider:Object(If.a)("Credential is missing"),defaultUserAgent:Object(zf.a)(rf.a,rf.b),eventStreamSerdeProvider:function(e){return new Cf(e)},maxAttempts:Mf.a,md5:kf,region:Object(If.a)("Region is missing"),requestHandler:new Af.a,sha256:of.Sha256,streamCollector:Af.b,streamHasher:function(e,t){return Object(sc.__awaiter)(this,void 0,void 0,(function(){var n;return Object(sc.__generator)(this,(function(r){switch(r.label){case 0:return n=new e,[4,jf(t,(function(e){n.update(e)}))];case 1:return r.sent(),[2,n.digest()]}}))}))},urlParser:Nf.a,utf8Decoder:xf.a,utf8Encoder:xf.b}),$f=n(25),Yf=n(34);var Jf={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware"},Xf=function(e){return{applyToStack:function(t){t.add(function(e){var t=this;return function(n){return function(r){return Object(sc.__awaiter)(t,void 0,void 0,(function(){var t;return Object(sc.__generator)(this,(function(i){return t=r.request,oc.a.isInstance(t)&&t.body&&"node"===e.runtime&&(t.headers=Object(sc.__assign)(Object(sc.__assign)({},t.headers),{Expect:"100-continue"})),[2,n(Object(sc.__assign)(Object(sc.__assign)({},r),{request:t}))]}))}))}}}(e),Jf)}}},Zf=n(23),Qf=n(26);var el={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware"},tl=function(e){return{applyToStack:function(e){e.add(function(){var e=this;return function(t){return function(n){return Object(sc.__awaiter)(e,void 0,void 0,(function(){var e,r;return Object(sc.__generator)(this,(function(i){if("string"==typeof(e=n.input.Bucket)&&!Rc(e)&&e.indexOf("/")>=0)throw(r=new Error("Bucket name shouldn't contain '/', received '"+e+"'")).name="InvalidBucketName",r;return[2,t(Object(sc.__assign)({},n))]}))}))}}}(),el)}}},nl=n(31),rl=n(27),il=function(e){function t(t){var n,r,i,o,s,a,u,c,l,d,h,p=this,g=f(f({},Wf),t),v=Object($f.b)(g),y=Object($f.a)(v),m=Object(nl.b)(y),b=Object(Mf.c)(m),S=Object(rl.b)(b),w=(r=(n=S).bucketEndpoint,i=void 0!==r&&r,o=n.forcePathStyle,s=void 0!==o&&o,a=n.useAccelerateEndpoint,u=void 0!==a&&a,c=n.useDualstackEndpoint,l=void 0!==c&&c,d=n.useArnRegion,h=void 0!==d&&d,Object(sc.__assign)(Object(sc.__assign)({},n),{bucketEndpoint:i,forcePathStyle:s,useAccelerateEndpoint:u,useDualstackEndpoint:l,useArnRegion:"function"==typeof h?h:function(){return Promise.resolve(h)}})),_=Object(Zf.b)(w),O=function(e){return Object(sc.__assign)(Object(sc.__assign)({},e),{eventStreamMarshaller:e.eventStreamSerdeProvider(e)})}(Object(Qf.b)(_));return(p=e.call(this,O)||this).config=O,p.middlewareStack.use(Object(nl.a)(p.config)),p.middlewareStack.use(Object(Mf.b)(p.config)),p.middlewareStack.use(Object(rl.a)(p.config)),p.middlewareStack.use(Object(Yf.a)(p.config)),p.middlewareStack.use(tl(p.config)),p.middlewareStack.use(Xf(p.config)),p.middlewareStack.use(Object(Zf.a)(p.config)),p.middlewareStack.use(Object(Qf.a)(p.config)),p}return c(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(ic.a),ol=n(21);function sl(e){var t=e.port,n=e.query,r=e.protocol,i=e.path,o=e.hostname;r&&":"!==r.substr(-1)&&(r+=":"),t&&(o+=":"+t),i&&"/"!==i.charAt(0)&&(i="/"+i);var s=n?Object(ol.a)(n):"";return s&&"?"!==s[0]&&(s="?"+s),r+"//"+o+i+s}function al(e,t){return Object(sc.__awaiter)(this,void 0,void 0,(function(){var n,r,i=this;return Object(sc.__generator)(this,(function(o){switch(o.label){case 0:return n=function(e){return function(e){return Object(sc.__awaiter)(i,void 0,void 0,(function(){return Object(sc.__generator)(this,(function(t){return[2,{output:{request:e.request},response:void 0}]}))}))}},(r=e.middlewareStack.clone()).add(n,{step:"build",priority:"low"}),[4,t.resolveMiddleware(r,e.config,void 0)(t).then((function(e){return e.output.request}))];case 1:return[2,o.sent()]}}))}))}var ul=n(42),cl=function(){function e(e){var t=Object(sc.__assign)({service:e.signingName||e.service||"s3",uriEscapePath:e.uriEscapePath||!1},e);this.signer=new ul.a(t)}return e.prototype.presign=function(e,t){void 0===t&&(t={});var n=t.unsignableHeaders,r=void 0===n?new Set:n,i=Object(sc.__rest)(t,["unsignableHeaders"]);return Object(sc.__awaiter)(this,void 0,void 0,(function(){return Object(sc.__generator)(this,(function(t){return r.add("content-type"),e.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",[2,this.signer.presign(e,Object(sc.__assign)({expiresIn:900,unsignableHeaders:r},i))]}))}))},e}(),fl=n(80),ll=n.n(fl),dl=new r.a("axios-http-handler"),hl=function(){function e(e,t){void 0===e&&(e={}),this.httpOptions=e,this.emitter=t}return e.prototype.destroy=function(){},e.prototype.handle=function(e,t){var n=this.httpOptions.requestTimeout,r=this.emitter,i=e.path;if(e.query){var o=Object(ol.a)(e.query);o&&(i+="?"+o)}var s=e.port,a=e.protocol+"//"+e.hostname+(s?":"+s:"")+i,u={};u.url=a,u.method=e.method,u.headers=e.headers,delete u.headers.host,e.body?u.data=e.body:u.headers["Content-Type"]&&(u.data=null),r&&(u.onUploadProgress=function(e){r.emit("sendProgress",e),dl.debug(e)}),u.responseType="blob";var c=[ll.a.request(u).then((function(e){return{response:new oc.b({headers:e.headers,statusCode:e.status,body:e.data})}})).catch((function(e){throw dl.error(e),e})),pl(n)];return Promise.race(c)},e}();function pl(e){return void 0===e&&(e=0),new Promise((function(t,n){e&&setTimeout((function(){var t=new Error("Request did not complete within "+e+" ms");t.name="TimeoutError",n(t)}),e)}))}var gl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Qc(t)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:ca.filterSensitiveLog,outputFilterSensitiveLog:aa.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:if(n=f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f({"Content-Type":"application/octet-stream"},kc(e.StorageClass)&&{"x-amz-storage-class":e.StorageClass}),kc(e.Tagging)&&{"x-amz-tagging":e.Tagging}),kc(e.SSEKMSEncryptionContext)&&{"x-amz-server-side-encryption-context":e.SSEKMSEncryptionContext}),kc(e.WebsiteRedirectLocation)&&{"x-amz-website-redirect-location":e.WebsiteRedirectLocation}),kc(e.ServerSideEncryption)&&{"x-amz-server-side-encryption":e.ServerSideEncryption}),kc(e.Expires)&&{Expires:Object(ic.d)(e.Expires).toString()}),kc(e.GrantWriteACP)&&{"x-amz-grant-write-acp":e.GrantWriteACP}),kc(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),kc(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),kc(e.ContentMD5)&&{"Content-MD5":e.ContentMD5}),kc(e.GrantFullControl)&&{"x-amz-grant-full-control":e.GrantFullControl}),kc(e.ContentDisposition)&&{"Content-Disposition":e.ContentDisposition}),kc(e.GrantReadACP)&&{"x-amz-grant-read-acp":e.GrantReadACP}),kc(e.ObjectLockLegalHoldStatus)&&{"x-amz-object-lock-legal-hold":e.ObjectLockLegalHoldStatus}),kc(e.ContentEncoding)&&{"Content-Encoding":e.ContentEncoding}),kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),kc(e.ObjectLockRetainUntilDate)&&{"x-amz-object-lock-retain-until-date":(e.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()}),kc(e.CacheControl)&&{"Cache-Control":e.CacheControl}),kc(e.ContentLength)&&{"Content-Length":e.ContentLength.toString()}),kc(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-MD5":e.SSECustomerKeyMD5}),kc(e.SSEKMSKeyId)&&{"x-amz-server-side-encryption-aws-kms-key-id":e.SSEKMSKeyId}),kc(e.ObjectLockMode)&&{"x-amz-object-lock-mode":e.ObjectLockMode}),kc(e.ContentLanguage)&&{"Content-Language":e.ContentLanguage}),kc(e.ACL)&&{"x-amz-acl":e.ACL}),kc(e.ContentType)&&{"Content-Type":e.ContentType}),kc(e.GrantRead)&&{"x-amz-grant-read":e.GrantRead}),void 0!==e.Metadata&&Object.keys(e.Metadata).reduce((function(t,n){return t["x-amz-meta-"+n]=e.Metadata[n],t}),{})),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(ic.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),o={"x-id":"PutObject"},void 0!==e.Body&&(a=e.Body,s=a),[4,t.endpoint()];case 1:return u=d.sent(),c=u.hostname,l=u.protocol,h=void 0===l?"https":l,p=u.port,[2,new oc.a({protocol:h,hostname:c,port:p,method:"PUT",headers:n,path:r,query:o,body:s})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,yc(e,t)]:(n={$metadata:xc(e),__type:"PutObjectOutput",ETag:void 0,Expiration:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSEncryptionContext:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,VersionId:void 0},void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-context"]&&(n.SSEKMSEncryptionContext=e.headers["x-amz-server-side-encryption-context"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),[4,Pc(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),vl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Qc(t)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:Ee.filterSensitiveLog,outputFilterSensitiveLog:Oe.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f(f({"Content-Type":""},kc(e.ServerSideEncryption)&&{"x-amz-server-side-encryption":e.ServerSideEncryption}),kc(e.WebsiteRedirectLocation)&&{"x-amz-website-redirect-location":e.WebsiteRedirectLocation}),kc(e.GrantWriteACP)&&{"x-amz-grant-write-acp":e.GrantWriteACP}),kc(e.Tagging)&&{"x-amz-tagging":e.Tagging}),kc(e.ACL)&&{"x-amz-acl":e.ACL}),kc(e.Expires)&&{Expires:Object(ic.d)(e.Expires).toString()}),kc(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),kc(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-MD5":e.SSECustomerKeyMD5}),kc(e.GrantReadACP)&&{"x-amz-grant-read-acp":e.GrantReadACP}),kc(e.ObjectLockLegalHoldStatus)&&{"x-amz-object-lock-legal-hold":e.ObjectLockLegalHoldStatus}),kc(e.CacheControl)&&{"Cache-Control":e.CacheControl}),kc(e.ContentType)&&{"Content-Type":e.ContentType}),kc(e.ObjectLockMode)&&{"x-amz-object-lock-mode":e.ObjectLockMode}),kc(e.SSEKMSKeyId)&&{"x-amz-server-side-encryption-aws-kms-key-id":e.SSEKMSKeyId}),kc(e.ContentLanguage)&&{"Content-Language":e.ContentLanguage}),kc(e.GrantRead)&&{"x-amz-grant-read":e.GrantRead}),kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),kc(e.ObjectLockRetainUntilDate)&&{"x-amz-object-lock-retain-until-date":(e.ObjectLockRetainUntilDate.toISOString().split(".")[0]+"Z").toString()}),kc(e.ContentDisposition)&&{"Content-Disposition":e.ContentDisposition}),kc(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),kc(e.ContentEncoding)&&{"Content-Encoding":e.ContentEncoding}),kc(e.StorageClass)&&{"x-amz-storage-class":e.StorageClass}),kc(e.GrantFullControl)&&{"x-amz-grant-full-control":e.GrantFullControl}),kc(e.SSEKMSEncryptionContext)&&{"x-amz-server-side-encryption-context":e.SSEKMSEncryptionContext}),void 0!==e.Metadata&&Object.keys(e.Metadata).reduce((function(t,n){return t["x-amz-meta-"+n]=e.Metadata[n],t}),{})),r="/{Bucket}/{Key+}",void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");if(r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");return r=r.replace("{Bucket}",Object(ic.e)(i)),o={uploads:""},[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"POST",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,dc(e,t)]:(n={$metadata:xc(e),__type:"CreateMultipartUploadOutput",AbortDate:void 0,AbortRuleId:void 0,Bucket:void 0,Key:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSEncryptionContext:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,UploadId:void 0},void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-context"]&&(n.SSEKMSEncryptionContext=e.headers["x-amz-server-side-encryption-context"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),void 0!==e.headers["x-amz-abort-rule-id"]&&(n.AbortRuleId=e.headers["x-amz-abort-rule-id"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-abort-date"]&&(n.AbortDate=new Date(e.headers["x-amz-abort-date"])),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),[4,Tc(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.UploadId&&(n.UploadId=r.UploadId),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),yl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Qc(t)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:Zu.filterSensitiveLog,outputFilterSensitiveLog:Ju.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:if(n=f(f(f(f(f(f({"Content-Type":"application/octet-stream"},kc(e.ContentLength)&&{"Content-Length":e.ContentLength.toString()}),kc(e.SSECustomerKey)&&{"x-amz-server-side-encryption-customer-key":e.SSECustomerKey}),kc(e.SSECustomerKeyMD5)&&{"x-amz-server-side-encryption-customer-key-MD5":e.SSECustomerKeyMD5}),kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),kc(e.ContentMD5)&&{"Content-MD5":e.ContentMD5}),kc(e.SSECustomerAlgorithm)&&{"x-amz-server-side-encryption-customer-algorithm":e.SSECustomerAlgorithm}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(ic.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),o=f(f({"x-id":"UploadPart"},void 0!==e.PartNumber&&{partNumber:e.PartNumber.toString()}),void 0!==e.UploadId&&{uploadId:e.UploadId}),void 0!==e.Body&&(a=e.Body,s=a),[4,t.endpoint()];case 1:return u=d.sent(),c=u.hostname,l=u.protocol,h=void 0===l?"https":l,p=u.port,[2,new oc.a({protocol:h,hostname:c,port:p,method:"PUT",headers:n,path:r,query:o,body:s})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,mc(e,t)]:(n={$metadata:xc(e),__type:"UploadPartOutput",ETag:void 0,RequestCharged:void 0,SSECustomerAlgorithm:void 0,SSECustomerKeyMD5:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0},void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers.etag&&(n.ETag=e.headers.etag),void 0!==e.headers["x-amz-server-side-encryption-customer-key-md5"]&&(n.SSECustomerKeyMD5=e.headers["x-amz-server-side-encryption-customer-key-md5"]),void 0!==e.headers["x-amz-server-side-encryption-customer-algorithm"]&&(n.SSECustomerAlgorithm=e.headers["x-amz-server-side-encryption-customer-algorithm"]),[4,Pc(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),ml=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:Q.filterSensitiveLog,outputFilterSensitiveLog:X.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l,h,p;return d(this,(function(d){switch(d.label){case 0:if(n=f({"Content-Type":"application/xml"},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(ic.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),o=f({},void 0!==e.UploadId&&{uploadId:e.UploadId}),void 0!==e.MultipartUpload&&(a=_c(e.MultipartUpload,t),s='<?xml version="1.0" encoding="UTF-8"?>',a.addAttribute("xmlns","http://s3.amazonaws.com/doc/2006-03-01/"),s+=a.toString()),[4,t.endpoint()];case 1:return u=d.sent(),c=u.hostname,l=u.protocol,h=void 0===l?"https":l,p=u.port,[2,new oc.a({protocol:h,hostname:c,port:p,method:"POST",headers:n,path:r,query:o,body:s})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,lc(e,t)]:(n={$metadata:xc(e),__type:"CompleteMultipartUploadOutput",Bucket:void 0,ETag:void 0,Expiration:void 0,Key:void 0,Location:void 0,RequestCharged:void 0,SSEKMSKeyId:void 0,ServerSideEncryption:void 0,VersionId:void 0},void 0!==e.headers["x-amz-version-id"]&&(n.VersionId=e.headers["x-amz-version-id"]),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),void 0!==e.headers["x-amz-server-side-encryption-aws-kms-key-id"]&&(n.SSEKMSKeyId=e.headers["x-amz-server-side-encryption-aws-kms-key-id"]),void 0!==e.headers["x-amz-server-side-encryption"]&&(n.ServerSideEncryption=e.headers["x-amz-server-side-encryption"]),void 0!==e.headers["x-amz-expiration"]&&(n.Expiration=e.headers["x-amz-expiration"]),[4,Tc(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.ETag&&(n.ETag=r.ETag),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.Location&&(n.Location=r.Location),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),bl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:y.filterSensitiveLog,outputFilterSensitiveLog:g.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f({"Content-Type":""},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),r="/{Bucket}/{Key+}",void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");if(r=r.replace("{Bucket}",Object(ic.e)(i)),void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");return r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),o=f({"x-id":"AbortMultipartUpload"},void 0!==e.UploadId&&{uploadId:e.UploadId}),[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"DELETE",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n;return d(this,(function(r){switch(r.label){case 0:return 204!==e.statusCode&&e.statusCode>=400?[2,fc(e,t)]:(n={$metadata:xc(e),__type:"AbortMultipartUploadOutput",RequestCharged:void 0},void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,Pc(e.body,t)]);case 1:return r.sent(),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),Sl=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return c(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(Xc.a)(t,this.serialize,this.deserialize)),this.middlewareStack.use(Jc(t));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:io.filterSensitiveLog,outputFilterSensitiveLog:no.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 l(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,l;return d(this,(function(d){switch(d.label){case 0:if(n=f({"Content-Type":""},kc(e.RequestPayer)&&{"x-amz-request-payer":e.RequestPayer}),r="/{Bucket}/{Key+}",void 0===e.Key)throw new Error("No value provided for input HTTP label: Key.");if((i=e.Key).length<=0)throw new Error("Empty value provided for input HTTP label: Key.");if(r=r.replace("{Key+}",i.split("/").map((function(e){return Object(ic.e)(e)})).join("/")),void 0===e.Bucket)throw new Error("No value provided for input HTTP label: Bucket.");if((i=e.Bucket).length<=0)throw new Error("Empty value provided for input HTTP label: Bucket.");return r=r.replace("{Bucket}",Object(ic.e)(i)),o=f(f(f({"x-id":"ListParts"},void 0!==e.PartNumberMarker&&{"part-number-marker":e.PartNumberMarker.toString()}),void 0!==e.MaxParts&&{"max-parts":e.MaxParts.toString()}),void 0!==e.UploadId&&{uploadId:e.UploadId}),[4,t.endpoint()];case 1:return s=d.sent(),a=s.hostname,u=s.protocol,c=void 0===u?"https":u,l=s.port,[2,new oc.a({protocol:c,hostname:a,port:l,method:"GET",headers:n,path:r,query:o,body:void 0})]}}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return l(void 0,void 0,void 0,(function(){var n,r;return d(this,(function(i){switch(i.label){case 0:return 200!==e.statusCode&&e.statusCode>=400?[2,vc(e,t)]:(n={$metadata:xc(e),__type:"ListPartsOutput",AbortDate:void 0,AbortRuleId:void 0,Bucket:void 0,Initiator:void 0,IsTruncated:void 0,Key:void 0,MaxParts:void 0,NextPartNumberMarker:void 0,Owner:void 0,PartNumberMarker:void 0,Parts:void 0,RequestCharged:void 0,StorageClass:void 0,UploadId:void 0},void 0!==e.headers["x-amz-abort-rule-id"]&&(n.AbortRuleId=e.headers["x-amz-abort-rule-id"]),void 0!==e.headers["x-amz-abort-date"]&&(n.AbortDate=new Date(e.headers["x-amz-abort-date"])),void 0!==e.headers["x-amz-request-charged"]&&(n.RequestCharged=e.headers["x-amz-request-charged"]),[4,Tc(e.body,t)]);case 1:return void 0!==(r=i.sent()).Bucket&&(n.Bucket=r.Bucket),void 0!==r.Initiator&&(n.Initiator=Ec(r.Initiator,t)),void 0!==r.IsTruncated&&(n.IsTruncated="true"==r.IsTruncated),void 0!==r.Key&&(n.Key=r.Key),void 0!==r.MaxParts&&(n.MaxParts=parseInt(r.MaxParts)),void 0!==r.NextPartNumberMarker&&(n.NextPartNumberMarker=parseInt(r.NextPartNumberMarker)),void 0!==r.Owner&&(n.Owner=jc(r.Owner,t)),void 0!==r.PartNumberMarker&&(n.PartNumberMarker=parseInt(r.PartNumberMarker)),""===r.Part&&(n.Parts=[]),void 0!==r.Part&&(n.Parts=Ic(Object(ic.f)(r.Part),t)),void 0!==r.StorageClass&&(n.StorageClass=r.StorageClass),void 0!==r.UploadId&&(n.UploadId=r.UploadId),[2,Promise.resolve(n)]}}))}))}(e,t)},t}(ic.b),wl=n(40),_l=n(37),Ol=n(12),Cl=function(e){var t,n=Object(Ol.parse)(e),r=n.hostname,i=void 0===r?"localhost":r,o=n.pathname,s=void 0===o?"/":o,a=n.port,u=n.protocol,c=void 0===u?"https:":u,f=n.search;return f&&(t=Object(_l.a)(f)),{hostname:i,port:a?parseInt(a):void 0,protocol:c,path:s,query:t}},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)},Al=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())}))},jl=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])}}},Il=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},xl=new r.a("AWSS3ProviderManagedUpload"),Pl=function(){function e(e,t,n){this.minPartSize=5242880,this.queueSize=4,this.body=null,this.params=null,this.opts=null,this.multiPartMap=[],this.cancel=!1,this.bytesUploaded=0,this.totalBytesToUpload=0,this.emitter=null,this.params=e,this.opts=t,this.emitter=n}return e.prototype.upload=function(){return Al(this,void 0,void 0,(function(){var e,t,n,r,i,o;return jl(this,(function(s){switch(s.label){case 0:return e=this,[4,this.validateAndSanitizeBody(this.params.Body)];case 1:return e.body=s.sent(),this.totalBytesToUpload=this.byteLength(this.body),this.totalBytesToUpload<=this.minPartSize?(this.params.Body=this.body,t=new gl(this.params),[4,this._createNewS3Client(this.opts,this.emitter)]):[3,3];case 2:return[2,s.sent().send(t)];case 3:return[4,this.createMultiPartUpload()];case 4:n=s.sent(),r=Math.ceil(this.totalBytesToUpload/this.minPartSize),i=0,s.label=5;case 5:return i<r?[4,this.checkIfUploadCancelled(n)]:[3,10];case 6:return s.sent(),o=this.createParts(i),[4,this.uploadParts(n,o)];case 7:return s.sent(),[4,this.checkIfUploadCancelled(n)];case 8:s.sent(),s.label=9;case 9:return i+=this.queueSize,[3,5];case 10:return[4,this.finishMultiPartUpload(n)];case 11:return[2,s.sent()]}}))}))},e.prototype.createParts=function(e){for(var t=[],n=e,r=e*this.minPartSize;r<this.totalBytesToUpload&&t.length<this.queueSize;){var i=Math.min(r+this.minPartSize,this.totalBytesToUpload);t.push({bodyPart:this.body.slice(r,i),partNumber:++n,emitter:new wl.EventEmitter,_lastUploadedBytes:0}),r+=this.minPartSize}return t},e.prototype.createMultiPartUpload=function(){return Al(this,void 0,void 0,(function(){var e,t;return jl(this,(function(n){switch(n.label){case 0:return e=new vl(this.params),[4,this._createNewS3Client(this.opts)];case 1:return[4,n.sent().send(e)];case 2:return t=n.sent(),xl.debug(t.UploadId),[2,t.UploadId]}}))}))},e.prototype.uploadParts=function(e,t){return Al(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,h,p;return jl(this,(function(g){switch(g.label){case 0:n=[],g.label=1;case 1:g.trys.push([1,6,7,8]),r=Il(t),i=r.next(),g.label=2;case 2:return i.done?[3,5]:(o=i.value,this.setupEventListener(o),s={PartNumber:o.partNumber,Body:o.bodyPart,UploadId:e,Key:this.params.Key,Bucket:this.params.Bucket},a=new yl(s),[4,this._createNewS3Client(this.opts,o.emitter)]);case 3:u=g.sent(),n.push(u.send(a)),g.label=4;case 4:return i=r.next(),[3,2];case 5:return[3,8];case 6:return c=g.sent(),h={error:c},[3,8];case 7:try{i&&!i.done&&(p=r.return)&&p.call(r)}finally{if(h)throw h.error}return[7];case 8:return g.trys.push([8,10,,11]),[4,Promise.all(n)];case 9:for(f=g.sent(),l=0;l<f.length;l++)this.multiPartMap.push({PartNumber:t[l].partNumber,ETag:f[l].ETag});return[3,11];case 10:return d=g.sent(),xl.error("error happened while uploading a part. Cancelling the multipart upload",d),this.cancelUpload(),[2];case 11:return[2]}}))}))},e.prototype.finishMultiPartUpload=function(e){return Al(this,void 0,void 0,(function(){var t,n,r,i;return jl(this,(function(o){switch(o.label){case 0:return t={Bucket:this.params.Bucket,Key:this.params.Key,UploadId:e,MultipartUpload:{Parts:this.multiPartMap}},n=new ml(t),[4,this._createNewS3Client(this.opts)];case 1:r=o.sent(),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,r.send(n)];case 3:return[2,o.sent().Key];case 4:return i=o.sent(),xl.error("error happened while finishing the upload. Cancelling the multipart upload",i),this.cancelUpload(),[2];case 5:return[2]}}))}))},e.prototype.checkIfUploadCancelled=function(e){return Al(this,void 0,void 0,(function(){var t,n;return jl(this,(function(r){switch(r.label){case 0:if(!this.cancel)return[3,5];t="Upload was cancelled.",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.cleanup(e)];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),t+=n.errorMessage,[3,4];case 4:throw new Error(t);case 5:return[2]}}))}))},e.prototype.cancelUpload=function(){this.cancel=!0},e.prototype.cleanup=function(e){return Al(this,void 0,void 0,(function(){var t,n,r;return jl(this,(function(i){switch(i.label){case 0:return this.body=null,this.multiPartMap=[],this.bytesUploaded=0,this.totalBytesToUpload=0,t={Bucket:this.params.Bucket,Key:this.params.Key,UploadId:e},[4,this._createNewS3Client(this.opts)];case 1:return[4,(n=i.sent()).send(new bl(t))];case 2:return i.sent(),[4,n.send(new Sl(t))];case 3:if((r=i.sent())&&r.Parts&&r.Parts.length>0)throw new Error("Multi Part upload clean up failed");return[2]}}))}))},e.prototype.setupEventListener=function(e){var t=this;e.emitter.on("sendProgress",(function(n){t.progressChanged(e.partNumber,n.loaded-e._lastUploadedBytes),e._lastUploadedBytes=n.loaded}))},e.prototype.progressChanged=function(e,t){this.bytesUploaded+=t,this.emitter.emit("sendProgress",{loaded:this.bytesUploaded,total:this.totalBytesToUpload,part:e,key:this.params.Key})},e.prototype.byteLength=function(e){if(null==e)return 0;if("number"==typeof e.byteLength)return e.byteLength;if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("string"!=typeof e.path)throw new Error("Cannot determine length of "+e)},e.prototype.validateAndSanitizeBody=function(e){return Al(this,void 0,void 0,(function(){return jl(this,(function(t){switch(t.label){case 0:return this.isGenericObject(e)?[2,JSON.stringify(e)]:[3,1];case 1:return this.isBlob(e)?a.a.isReactNative?[4,Object(Af.b)(e)]:[3,3]:[3,4];case 2:return[2,t.sent()];case 3:case 4:return[2,e]}}))}))},e.prototype.isBlob=function(e){return"undefined"!=typeof Blob&&e instanceof Blob},e.prototype.isGenericObject=function(e){if(null!==e&&"object"==typeof e)try{return!(this.byteLength(e)>=0)}catch(e){return!0}return!1},e.prototype._createNewS3Client=function(e,t){return Al(this,void 0,void 0,(function(){var n,r,i,o,s;return jl(this,(function(u){switch(u.label){case 0:return[4,this._getCredentials()];case 1:return n=u.sent(),r=e.region,i=e.dangerouslyConnectToHttpEndpointForTesting,o={},i&&(o={endpoint:"http://localhost:20005",tls:!1,bucketEndpoint:!1,forcePathStyle:!0}),(s=new il(El(El({region:r,credentials:n},o),{requestHandler:new hl({},t),customUserAgent:Object(a.b)(),urlParser:Cl}))).middlewareStack.remove("contentLengthMiddleware"),[2,s]}}))}))},e.prototype._getCredentials=function(){return s.a.get().then((function(e){if(!e)return!1;var t=s.a.shear(e);return xl.debug("set credentials for storage",t),t})).catch((function(e){return xl.warn("ensure credentials error",e),!1}))},e}(),kl=function(){return(kl=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)},Tl=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())}))},Ul=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])}}},Rl=new r.a("AWSS3Provider"),Ll="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Dl=function(e,t,n,r,i){if(e){var s={attrs:n};r&&(s.metrics=r),o.a.dispatch("storage",{event:t,data:s,message:i},"Storage",Ll)}},Ml=function(){function e(e){this._config=e||{},Rl.debug("Storage Options",this._config)}return e.prototype.getCategory=function(){return e.CATEGORY},e.prototype.getProviderName=function(){return e.PROVIDER_NAME},e.prototype.configure=function(e){if(Rl.debug("configure Storage",e),!e)return this._config;var t=i.a.parseMobilehubConfig(e);return this._config=Object.assign({},this._config,t.Storage),this._config.bucket||Rl.debug("Do not have bucket yet"),this._config},e.prototype.get=function(e,t){return Tl(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,h,p,g,v,y,m,b,S,w,_,O;return Ul(this,(function(C){switch(C.label){case 0:return[4,this._ensureCredentials()];case 1:if(!C.sent())return[2,Promise.reject("No credentials")];if(n=Object.assign({},this._config,t),r=n.bucket,i=n.download,o=n.cacheControl,s=n.contentDisposition,a=n.contentEncoding,u=n.contentLanguage,c=n.contentType,f=n.expires,l=n.track,d=this._prefix(n),h=d+e,p=this._createNewS3Client(n),Rl.debug("get "+e+" from "+h),g={Bucket:r,Key:h},o&&(g.ResponseCacheControl=o),s&&(g.ResponseContentDisposition=s),a&&(g.ResponseContentEncoding=a),u&&(g.ResponseContentLanguage=u),c&&(g.ResponseContentType=c),!0!==i)return[3,5];v=new ef(g),C.label=2;case 2:return C.trys.push([2,4,,5]),[4,p.send(v)];case 3:return y=C.sent(),Dl(l,"download",{method:"get",result:"success"},{fileSize:Number(y.Body.size||y.Body.length)},"Download success for "+e),[2,y];case 4:throw m=C.sent(),Dl(l,"download",{method:"get",result:"failed"},null,"Download failed with "+m.message),m;case 5:g.Expires=f||900,C.label=6;case 6:return C.trys.push([6,9,,10]),b=new cl(kl({},p.config)),[4,al(p,new ef(g))];case 7:return S=C.sent(),_=sl,[4,b.presign(S,{expiresIn:g.Expires})];case 8:return w=_.apply(void 0,[C.sent()]),Dl(l,"getSignedUrl",{method:"get",result:"success"},null,"Signed URL: "+w),[2,w];case 9:throw O=C.sent(),Rl.warn("get signed url error",O),Dl(l,"getSignedUrl",{method:"get",result:"failed"},null,"Could not get a signed URL for "+e),O;case 10:return[2]}}))}))},e.prototype.put=function(e,t,n){return Tl(this,void 0,void 0,(function(){var r,i,o,s,a,u,c,f,l,d,h,p,g,v,y,m,b,S,w,_,O,C,E,A;return Ul(this,(function(j){switch(j.label){case 0:return[4,this._ensureCredentials()];case 1:if(!j.sent())return[2,Promise.reject("No credentials")];r=Object.assign({},this._config,n),i=r.bucket,o=r.track,s=r.progressCallback,a=r.contentType,u=r.contentDisposition,c=r.cacheControl,f=r.expires,l=r.metadata,d=r.tagging,h=r.acl,p=r.serverSideEncryption,g=r.SSECustomerAlgorithm,v=r.SSECustomerKey,y=r.SSECustomerKeyMD5,m=r.SSEKMSKeyId,b=a||"binary/octet-stream",S=this._prefix(r),w=S+e,Rl.debug("put "+e+" to "+w),_={Bucket:i,Key:w,Body:t,ContentType:b},c&&(_.CacheControl=c),u&&(_.ContentDisposition=u),f&&(_.Expires=f),l&&(_.Metadata=l),d&&(_.Tagging=d),p&&(_.ServerSideEncryption=p,g&&(_.SSECustomerAlgorithm=g),v&&(_.SSECustomerKey=v),y&&(_.SSECustomerKeyMD5=y),m&&(_.SSEKMSKeyId=m)),O=new wl.EventEmitter,C=new Pl(_,r,O),h&&(_.ACL=h),j.label=2;case 2:return j.trys.push([2,4,,5]),O.on("sendProgress",(function(e){s&&("function"==typeof s?s(e):Rl.warn("progressCallback should be a function, not a "+typeof s))})),[4,C.upload()];case 3:return E=j.sent(),Rl.debug("upload result",E),Dl(o,"upload",{method:"put",result:"success"},null,"Upload success for "+e),[2,{key:e}];case 4:throw A=j.sent(),Rl.warn("error uploading",A),Dl(o,"upload",{method:"put",result:"failed"},null,"Error uploading "+e),A;case 5:return[2]}}))}))},e.prototype.remove=function(e,t){return Tl(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f;return Ul(this,(function(l){switch(l.label){case 0:return[4,this._ensureCredentials()];case 1:if(!l.sent())return[2,Promise.reject("No credentials")];n=Object.assign({},this._config,t),r=n.bucket,i=n.track,o=this._prefix(n),s=o+e,a=this._createNewS3Client(n),Rl.debug("remove "+e+" from "+s),u=new tf({Bucket:r,Key:s}),l.label=2;case 2:return l.trys.push([2,4,,5]),[4,a.send(u)];case 3:return c=l.sent(),Dl(i,"delete",{method:"remove",result:"success"},null,"Deleted "+e+" successfully"),[2,c];case 4:throw f=l.sent(),Dl(i,"delete",{method:"remove",result:"failed"},null,"Deletion of "+e+" failed with "+f),f;case 5:return[2]}}))}))},e.prototype.list=function(e,t){return Tl(this,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d;return Ul(this,(function(h){switch(h.label){case 0:return[4,this._ensureCredentials()];case 1:if(!h.sent())return[2,Promise.reject("No credentials")];n=Object.assign({},this._config,t),r=n.bucket,i=n.track,o=n.maxKeys,s=this._prefix(n),a=s+e,u=this._createNewS3Client(n),Rl.debug("list "+e+" from "+a),c=new nf({Bucket:r,Prefix:a,MaxKeys:o}),h.label=2;case 2:return h.trys.push([2,4,,5]),[4,u.send(c)];case 3:return f=h.sent(),l=[],f&&f.Contents&&(l=f.Contents.map((function(e){return{key:e.Key.substr(s.length),eTag:e.ETag,lastModified:e.LastModified,size:e.Size}}))),Dl(i,"list",{method:"list",result:"success"},null,l.length+" items returned from list operation"),Rl.debug("list",l),[2,l];case 4:throw d=h.sent(),Rl.warn("list error",d),Dl(i,"list",{method:"list",result:"failed"},null,"Listing items failed: "+d.message),d;case 5:return[2]}}))}))},e.prototype._ensureCredentials=function(){var e=this;return s.a.get().then((function(t){if(!t)return!1;var n=s.a.shear(t);return Rl.debug("set credentials for storage",n),e._config.credentials=n,!0})).catch((function(e){return Rl.warn("ensure credentials error",e),!1}))},e.prototype._prefix=function(e){var t=e.credentials,n=e.level,r=e.customPrefix||{},i=e.identityId||t.identityId,o=(void 0!==r.private?r.private:"private/")+i+"/",s=(void 0!==r.protected?r.protected:"protected/")+i+"/",a=void 0!==r.public?r.public:"public/";switch(n){case"private":return o;case"protected":return s;default:return a}},e.prototype._createNewS3Client=function(e,t){var n=e.region,r=e.credentials,i={};return e.dangerouslyConnectToHttpEndpointForTesting&&(i={endpoint:"http://localhost:20005",tls:!1,bucketEndpoint:!1,forcePathStyle:!0}),new il(kl(kl({region:n,credentials:r,customUserAgent:Object(a.b)()},i),{requestHandler:new hl({},t)}))},e.CATEGORY="Storage",e.PROVIDER_NAME="AWSS3",e}(),Nl=function(){return(Nl=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)},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])}}},zl=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},Kl=new r.a("StorageClass"),ql=function(){function e(){this._config={},this._pluggables=[],Kl.debug("Storage Options",this._config),this.get=this.get.bind(this),this.put=this.put.bind(this),this.remove=this.remove.bind(this),this.list=this.list.bind(this)}return e.prototype.getModuleName=function(){return"Storage"},e.prototype.addPluggable=function(e){if(e&&"Storage"===e.getCategory()){this._pluggables.push(e);return e.configure(this._config[e.getProviderName()])}},e.prototype.getPluggable=function(e){var t=this._pluggables.find((function(t){return t.getProviderName()===e}));return void 0===t?(Kl.debug("No plugin found with providerName",e),null):t},e.prototype.removePluggable=function(e){this._pluggables=this._pluggables.filter((function(t){return t.getProviderName()!==e}))},e.prototype.configure=function(e){var t=this;if(Kl.debug("configure Storage"),!e)return this._config;var n=i.a.parseMobilehubConfig(e),r=Object.keys(n.Storage),o=["bucket","region","level","track","customPrefix","serverSideEncryption","SSECustomerAlgorithm","SSECustomerKey","SSECustomerKeyMD5","SSEKMSKeyId"],s=function(e){return o.some((function(t){return t===e}))};return r&&r.find((function(e){return s(e)}))&&!n.Storage.AWSS3&&(n.Storage.AWSS3={}),Object.entries(n.Storage).map((function(e){var t=zl(e,2),r=t[0],i=t[1];r&&s(r)&&void 0!==i&&(n.Storage.AWSS3[r]=i,delete n.Storage[r])})),Object.keys(n.Storage).forEach((function(e){"string"!=typeof n.Storage[e]&&(t._config[e]=Nl(Nl({},t._config[e]),n.Storage[e]))})),this._pluggables.forEach((function(e){e.configure(t._config[e.getProviderName()])})),0===this._pluggables.length&&this.addPluggable(new Ml),this._config},e.prototype.get=function(e,t){return Bl(this,void 0,void 0,(function(){var n,r,i;return Fl(this,(function(o){return n=(t||{}).provider,r=void 0===n?"AWSS3":n,void 0===(i=this._pluggables.find((function(e){return e.getProviderName()===r})))&&(Kl.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider")),[2,i.get(e,t)]}))}))},e.prototype.put=function(e,t,n){return Bl(this,void 0,void 0,(function(){var r,i,o;return Fl(this,(function(s){return r=(n||{}).provider,i=void 0===r?"AWSS3":r,void 0===(o=this._pluggables.find((function(e){return e.getProviderName()===i})))&&(Kl.debug("No plugin found with providerName",i),Promise.reject("No plugin found in Storage for the provider")),[2,o.put(e,t,n)]}))}))},e.prototype.remove=function(e,t){return Bl(this,void 0,void 0,(function(){var n,r,i;return Fl(this,(function(o){return n=(t||{}).provider,r=void 0===n?"AWSS3":n,void 0===(i=this._pluggables.find((function(e){return e.getProviderName()===r})))&&(Kl.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider")),[2,i.remove(e,t)]}))}))},e.prototype.list=function(e,t){return Bl(this,void 0,void 0,(function(){var n,r,i;return Fl(this,(function(o){return n=(t||{}).provider,r=void 0===n?"AWSS3":n,void 0===(i=this._pluggables.find((function(e){return e.getProviderName()===r})))&&(Kl.debug("No plugin found with providerName",r),Promise.reject("No plugin found in Storage for the provider")),[2,i.list(e,t)]}))}))},e}(),Hl=n(10),Vl=function(){return(Vl=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)},Gl=new r.a("Storage"),Wl=null,$l=function(){if(Wl)return Wl;Gl.debug("Create Storage Instance, debug"),(Wl=new ql).vault=new ql;var e=Wl.configure;return Wl.configure=function(t){Gl.debug("storage configure called");var n=Vl({},e.call(Wl,t));Object.keys(n).forEach((function(e){"string"!=typeof n[e]&&(n[e]=Vl(Vl({},n[e]),{level:"private"}))})),Gl.debug("storage vault configure called"),Wl.vault.configure(n)},Wl}();Hl.a.register($l)},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){e.exports=JSON.parse('{"a":"@aws-sdk/client-cognito-identity","b":"1.0.0-gamma.8"}')},function(e){e.exports=JSON.parse('{"a":"@aws-sdk/client-s3","b":"1.0.0-gamma.8"}')},function(e,t,n){"use strict";var r,i;function o(e){return e&&!!["provider"].find((function(t){return e.hasOwnProperty(t)}))}function s(e){return void 0!==e.redirectSignIn}n.d(t,"a",(function(){return ze})),function(e){e.Cognito="COGNITO",e.Google="Google",e.Facebook="Facebook",e.Amazon="LoginWithAmazon",e.Apple="SignInWithApple"}(r||(r={})),function(e){e.NoConfig="noConfig",e.MissingAuthConfig="missingAuthConfig",e.EmptyUsername="emptyUsername",e.InvalidUsername="invalidUsername",e.EmptyPassword="emptyPassword",e.EmptyCode="emptyCode",e.SignUpError="signUpError",e.NoMFA="noMFA",e.InvalidMFA="invalidMFA",e.EmptyChallengeResponse="emptyChallengeResponse",e.NoUserSession="noUserSession",e.Default="default"}(i||(i={}));var a=n(18),u=n(75),c=n(160),f=n(159),l=n(24);function d(e,t){void 0===t&&(t={});var n=function(e){if(e&&"j"===e[0]&&":"===e[1])return e.substr(2);return e}(e);if(function(e,t){return void 0===t&&(t=!e||"{"!==e[0]&&"["!==e[0]&&'"'!==e[0]),!t}(n,t.doNotParse))try{return JSON.parse(n)}catch(e){}return e}var h=function(){return(h=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)},p=function(){function e(e,t){var n=this;this.changeListeners=[],this.HAS_DOCUMENT_COOKIE=!1,this.cookies=function(e,t){return"string"==typeof e?l.parse(e,t):"object"==typeof e&&null!==e?e:{}}(e,t),new Promise((function(){n.HAS_DOCUMENT_COOKIE="object"==typeof document&&"string"==typeof document.cookie})).catch((function(){}))}return e.prototype._updateBrowserValues=function(e){this.HAS_DOCUMENT_COOKIE&&(this.cookies=l.parse(document.cookie,e))},e.prototype._emitChange=function(e){for(var t=0;t<this.changeListeners.length;++t)this.changeListeners[t](e)},e.prototype.get=function(e,t,n){return void 0===t&&(t={}),this._updateBrowserValues(n),d(this.cookies[e],t)},e.prototype.getAll=function(e,t){void 0===e&&(e={}),this._updateBrowserValues(t);var n={};for(var r in this.cookies)n[r]=d(this.cookies[r],e);return n},e.prototype.set=function(e,t,n){var r;"object"==typeof t&&(t=JSON.stringify(t)),this.cookies=h(h({},this.cookies),((r={})[e]=t,r)),this.HAS_DOCUMENT_COOKIE&&(document.cookie=l.serialize(e,t,n)),this._emitChange({name:e,value:t,options:n})},e.prototype.remove=function(e,t){var n=t=h(h({},t),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=h({},this.cookies),delete this.cookies[e],this.HAS_DOCUMENT_COOKIE&&(document.cookie=l.serialize(e,"",n)),this._emitChange({name:e,value:void 0,options:t})},e.prototype.addChangeListener=function(e){this.changeListeners.push(e)},e.prototype.removeChangeListener=function(e){var t=this.changeListeners.indexOf(e);t>=0&&this.changeListeners.splice(t,1)},e}(),g=n(9),v=Object(g.b)().isBrowser,y=function(){function e(e){void 0===e&&(e={}),this.cookies=new p,this.store=v?window.localStorage:Object.create(null),this.cookies=e.req?new p(e.req.headers.cookie):new p,Object.assign(this.store,this.cookies.getAll())}return Object.defineProperty(e.prototype,"length",{get:function(){return Object.entries(this.store).length},enumerable:!0,configurable:!0}),e.prototype.clear=function(){var e=this;Array.from(new Array(this.length)).map((function(t,n){return e.key(n)})).forEach((function(t){return e.removeItem(t)}))},e.prototype.getItem=function(e){return this.getLocalItem(e)},e.prototype.getLocalItem=function(e){return Object.prototype.hasOwnProperty.call(this.store,e)?this.store[e]:null},e.prototype.getUniversalItem=function(e){return this.cookies.get(e)},e.prototype.key=function(e){return Object.keys(this.store)[e]},e.prototype.removeItem=function(e){this.removeLocalItem(e),this.removeUniversalItem(e)},e.prototype.removeLocalItem=function(e){delete this.store[e]},e.prototype.removeUniversalItem=function(e){this.cookies.remove(e)},e.prototype.setItem=function(e,t){switch(this.setLocalItem(e,t),e.split(".").pop()){case"LastAuthUser":case"accessToken":case"idToken":this.setUniversalItem(e,t)}},e.prototype.setLocalItem=function(e,t){this.store[e]=t},e.prototype.setUniversalItem=function(e,t){this.cookies.set(e,t,{path:"/",sameSite:!0,secure:"localhost"!==window.location.hostname})},e}(),m=n(74);var b,S=n(10),w=function(){function e(e){var t=e||{},n=t.ValidationData,r=t.Username,i=t.Password,o=t.AuthParameters,s=t.ClientMetadata;this.validationData=n||{},this.authParameters=o||{},this.clientMetadata=s||{},this.username=r,this.password=i}var t=e.prototype;return t.getUsername=function(){return this.username},t.getPassword=function(){return this.password},t.getValidationData=function(){return this.validationData},t.getAuthParameters=function(){return this.authParameters},t.getClientMetadata=function(){return this.clientMetadata},e}(),_=n(3),O=n(5),C=n.n(O),E=(n(54),n(28)),A=n.n(E),j=n(22),I=n.n(j),x=P;
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */function P(e,t){null!=e&&this.fromString(e,t)}function k(){return new P(null)}var T="undefined"!=typeof navigator;T&&"Microsoft Internet Explorer"==navigator.appName?(P.prototype.am=function(e,t,n,r,i,o){for(var s=32767&t,a=t>>15;--o>=0;){var u=32767&this[e],c=this[e++]>>15,f=a*u+c*s;i=((u=s*u+((32767&f)<<15)+n[r]+(1073741823&i))>>>30)+(f>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},b=30):T&&"Netscape"!=navigator.appName?(P.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var s=t*this[e++]+n[r]+i;i=Math.floor(s/67108864),n[r++]=67108863&s}return i},b=26):(P.prototype.am=function(e,t,n,r,i,o){for(var s=16383&t,a=t>>14;--o>=0;){var u=16383&this[e],c=this[e++]>>14,f=a*u+c*s;i=((u=s*u+((16383&f)<<14)+n[r]+i)>>28)+(f>>14)+a*c,n[r++]=268435455&u}return i},b=28),P.prototype.DB=b,P.prototype.DM=(1<<b)-1,P.prototype.DV=1<<b;P.prototype.FV=Math.pow(2,52),P.prototype.F1=52-b,P.prototype.F2=2*b-52;var U,R,L=new Array;for(U="0".charCodeAt(0),R=0;R<=9;++R)L[U++]=R;for(U="a".charCodeAt(0),R=10;R<36;++R)L[U++]=R;for(U="A".charCodeAt(0),R=10;R<36;++R)L[U++]=R;function D(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function M(e,t){var n=L[e.charCodeAt(t)];return null==n?-1:n}function N(e){var t=k();return t.fromInt(e),t}function B(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function F(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}F.prototype.convert=function(e){var t=k();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(P.ZERO)>0&&this.m.subTo(t,t),t},F.prototype.revert=function(e){var t=k();return e.copyTo(t),this.reduce(t),t},F.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},F.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},F.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},P.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},P.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},P.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var s=M(e,r);s<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}this.clamp(),i&&P.ZERO.subTo(this,this)},P.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},P.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},P.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},P.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&o)<<r;for(n=s-1;n>=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},P.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)t[s-n-1]|=(this[s]&o)<<i,t[s-n]=this[s]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},P.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},P.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&P.ZERO.subTo(t,t)},P.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},P.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=k());var o=k(),s=this.s,a=e.s,u=this.DB-B(r[r.t-1]);u>0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var c=o.t,f=o[c-1];if(0!=f){var l=f*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),d=this.FV/l,h=(1<<this.F1)/l,p=1<<this.F2,g=n.t,v=g-c,y=null==t?k():t;for(o.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),P.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--v>=0;){var m=n[--g]==f?this.DM:Math.floor(n[g]*d+(n[g-1]+p)*h);if((n[g]+=o.am(0,m,n,v,0,c))<m)for(o.dlShiftTo(v,y),n.subTo(y,n);n[g]<--m;)n.subTo(y,n)}null!=t&&(n.drShiftTo(c,t),s!=a&&P.ZERO.subTo(t,t)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&P.ZERO.subTo(n,n)}}},P.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},P.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},P.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)throw new Error("Only radix 2, 4, 8, 16, 32 are supported");t=2}var n,r=(1<<t)-1,i=!1,o="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(i=!0,o=D(n));s>=0;)a<t?(n=(this[s]&(1<<a)-1)<<t-a,n|=this[--s]>>(a+=this.DB-t)):(n=this[s]>>(a-=t)&r,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(o+=D(n));return i?o:"0"},P.prototype.negate=function(){var e=k();return P.ZERO.subTo(this,e),e},P.prototype.abs=function(){return this.s<0?this.negate():this},P.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},P.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+B(this[this.t-1]^this.s&this.DM)},P.prototype.mod=function(e){var t=k();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(P.ZERO)>0&&e.subTo(t,t),t},P.prototype.equals=function(e){return 0==this.compareTo(e)},P.prototype.add=function(e){var t=k();return this.addTo(e,t),t},P.prototype.subtract=function(e){var t=k();return this.subTo(e,t),t},P.prototype.multiply=function(e){var t=k();return this.multiplyTo(e,t),t},P.prototype.divide=function(e){var t=k();return this.divRemTo(e,t,null),t},P.prototype.modPow=function(e,t,n){var r,i=e.bitLength(),o=N(1),s=new F(t);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6;var a=new Array,u=3,c=r-1,f=(1<<r)-1;if(a[1]=s.convert(this),r>1){var l=k();for(s.sqrTo(a[1],l);u<=f;)a[u]=k(),s.mulTo(l,a[u-2],a[u]),u+=2}var d,h,p=e.t-1,g=!0,v=k();for(i=B(e[p])-1;p>=0;){for(i>=c?d=e[p]>>i-c&f:(d=(e[p]&(1<<i+1)-1)<<c-i,p>0&&(d|=e[p-1]>>this.DB+i-c)),u=r;0==(1&d);)d>>=1,--u;if((i-=u)<0&&(i+=this.DB,--p),g)a[d].copyTo(o),g=!1;else{for(;u>1;)s.sqrTo(o,v),s.sqrTo(v,o),u-=2;u>0?s.sqrTo(o,v):(h=o,o=v,v=h),s.mulTo(v,a[d],o)}for(;p>=0&&0==(e[p]&1<<i);)s.sqrTo(o,v),h=o,o=v,v=h,--i<0&&(i=this.DB-1,--p)}var y=s.revert(o);return n(null,y),y},P.ZERO=N(0),P.ONE=N(1);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var z=function(e){return _.Buffer.from(C.a.lib.WordArray.random(e).toString(),"hex")},K=function(){function e(e){this.N=new x("FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",16),this.g=new x("2",16),this.k=new x(this.hexHash("00"+this.N.toString(16)+"0"+this.g.toString(16)),16),this.smallAValue=this.generateRandomSmallA(),this.getLargeAValue((function(){})),this.infoBits=_.Buffer.from("Caldera Derived Key","utf8"),this.poolName=e}var t=e.prototype;return t.getSmallAValue=function(){return this.smallAValue},t.getLargeAValue=function(e){var t=this;this.largeAValue?e(null,this.largeAValue):this.calculateA(this.smallAValue,(function(n,r){n&&e(n,null),t.largeAValue=r,e(null,t.largeAValue)}))},t.generateRandomSmallA=function(){var e=z(128).toString("hex");return new x(e,16).mod(this.N)},t.generateRandomString=function(){return z(40).toString("base64")},t.getRandomPassword=function(){return this.randomPassword},t.getSaltDevices=function(){return this.SaltToHashDevices},t.getVerifierDevices=function(){return this.verifierDevices},t.generateHashDevice=function(e,t,n){var r=this;this.randomPassword=this.generateRandomString();var i=""+e+t+":"+this.randomPassword,o=this.hash(i),s=z(16).toString("hex");this.SaltToHashDevices=this.padHex(new x(s,16)),this.g.modPow(new x(this.hexHash(this.SaltToHashDevices+o),16),this.N,(function(e,t){e&&n(e,null),r.verifierDevices=r.padHex(t),n(null,null)}))},t.calculateA=function(e,t){var n=this;this.g.modPow(e,this.N,(function(e,r){e&&t(e,null),r.mod(n.N).equals(x.ZERO)&&t(new Error("Illegal paramater. A mod N cannot be 0."),null),t(null,r)}))},t.calculateU=function(e,t){return this.UHexHash=this.hexHash(this.padHex(e)+this.padHex(t)),new x(this.UHexHash,16)},t.hash=function(e){var t=e instanceof _.Buffer?C.a.lib.WordArray.create(e):e,n=A()(t).toString();return new Array(64-n.length).join("0")+n},t.hexHash=function(e){return this.hash(_.Buffer.from(e,"hex"))},t.computehkdf=function(e,t){var n=C.a.lib.WordArray.create(_.Buffer.concat([this.infoBits,_.Buffer.from(String.fromCharCode(1),"utf8")])),r=e instanceof _.Buffer?C.a.lib.WordArray.create(e):e,i=t instanceof _.Buffer?C.a.lib.WordArray.create(t):t,o=I()(r,i),s=I()(n,o);return _.Buffer.from(s.toString(),"hex").slice(0,16)},t.getPasswordAuthenticationKey=function(e,t,n,r,i){var o=this;if(n.mod(this.N).equals(x.ZERO))throw new Error("B cannot be zero.");if(this.UValue=this.calculateU(this.largeAValue,n),this.UValue.equals(x.ZERO))throw new Error("U cannot be zero.");var s=""+this.poolName+e+":"+t,a=this.hash(s),u=new x(this.hexHash(this.padHex(r)+a),16);this.calculateS(u,n,(function(e,t){e&&i(e,null);var n=o.computehkdf(_.Buffer.from(o.padHex(t),"hex"),_.Buffer.from(o.padHex(o.UValue.toString(16)),"hex"));i(null,n)}))},t.calculateS=function(e,t,n){var r=this;this.g.modPow(e,this.N,(function(i,o){i&&n(i,null),t.subtract(r.k.multiply(o)).modPow(r.smallAValue.add(r.UValue.multiply(e)),r.N,(function(e,t){e&&n(e,null),n(null,t.mod(r.N))}))}))},t.getNewPasswordRequiredChallengeUserAttributePrefix=function(){return"userAttributes."},t.padHex=function(e){var t=e.toString(16);return t.length%2==1?t="0"+t:-1!=="89ABCDEFabcdef".indexOf(t[0])&&(t="00"+t),t},e}(),q=function(){function e(e){this.jwtToken=e||"",this.payload=this.decodePayload()}var t=e.prototype;return t.getJwtToken=function(){return this.jwtToken},t.getExpiration=function(){return this.payload.exp},t.getIssuedAt=function(){return this.payload.iat},t.decodePayload=function(){var e=this.jwtToken.split(".")[1];try{return JSON.parse(_.Buffer.from(e,"base64").toString("utf8"))}catch(e){return{}}},e}();var H=function(e){var t,n;function r(t){var n=(void 0===t?{}:t).AccessToken;return e.call(this,n||"")||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r}(q);
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */
var V=function(e){var t,n;function r(t){var n=(void 0===t?{}:t).IdToken;return e.call(this,n||"")||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r}(q),G=function(){function e(e){var t=(void 0===e?{}:e).RefreshToken;this.token=t||""}return e.prototype.getToken=function(){return this.token},e}(),W=n(29),$=n.n(W),Y=function(){function e(e){var t=void 0===e?{}:e,n=t.IdToken,r=t.RefreshToken,i=t.AccessToken,o=t.ClockDrift;if(null==i||null==n)throw new Error("Id token and Access Token must be present.");this.idToken=n,this.refreshToken=r,this.accessToken=i,this.clockDrift=void 0===o?this.calculateClockDrift():o}var t=e.prototype;return t.getIdToken=function(){return this.idToken},t.getRefreshToken=function(){return this.refreshToken},t.getAccessToken=function(){return this.accessToken},t.getClockDrift=function(){return this.clockDrift},t.calculateClockDrift=function(){return Math.floor(new Date/1e3)-Math.min(this.accessToken.getIssuedAt(),this.idToken.getIssuedAt())},t.isValid=function(){var e=Math.floor(new Date/1e3)-this.clockDrift;return e<this.accessToken.getExpiration()&&e<this.idToken.getExpiration()},e}(),J=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],X=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Z=function(){function e(){}return e.prototype.getNowString=function(){var e=new Date,t=X[e.getUTCDay()],n=J[e.getUTCMonth()],r=e.getUTCDate(),i=e.getUTCHours();i<10&&(i="0"+i);var o=e.getUTCMinutes();o<10&&(o="0"+o);var s=e.getUTCSeconds();return s<10&&(s="0"+s),t+" "+n+" "+r+" "+i+":"+o+":"+s+" UTC "+e.getUTCFullYear()},e}(),Q=function(){function e(e){var t=void 0===e?{}:e,n=t.Name,r=t.Value;this.Name=n||"",this.Value=r||""}var t=e.prototype;return t.getValue=function(){return this.Value},t.setValue=function(e){return this.Value=e,this},t.getName=function(){return this.Name},t.setName=function(e){return this.Name=e,this},t.toString=function(){return JSON.stringify(this)},t.toJSON=function(){return{Name:this.Name,Value:this.Value}},e}(),ee={},te=function(){function e(){}return e.setItem=function(e,t){return ee[e]=t,ee[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(ee,e)?ee[e]:void 0},e.removeItem=function(e){return delete ee[e]},e.clear=function(){return ee={}},e}(),ne=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.cognito.test-ls",1),this.storageWindow.removeItem("aws.cognito.test-ls")}catch(e){this.storageWindow=te}}return e.prototype.getStorage=function(){return this.storageWindow},e}(),re="undefined"!=typeof navigator?navigator.userAgent:"nodejs",ie=function(){function e(e){if(null==e||null==e.Username||null==e.Pool)throw new Error("Username and pool information are required.");this.username=e.Username||"",this.pool=e.Pool,this.Session=null,this.client=e.Pool.client,this.signInUserSession=null,this.authenticationFlowType="USER_SRP_AUTH",this.storage=e.Storage||(new ne).getStorage(),this.keyPrefix="CognitoIdentityServiceProvider."+this.pool.getClientId(),this.userDataKey=this.keyPrefix+"."+this.username+".userData"}var t=e.prototype;return t.setSignInUserSession=function(e){this.clearCachedUserData(),this.signInUserSession=e,this.cacheTokens()},t.getSignInUserSession=function(){return this.signInUserSession},t.getUsername=function(){return this.username},t.getAuthenticationFlowType=function(){return this.authenticationFlowType},t.setAuthenticationFlowType=function(e){this.authenticationFlowType=e},t.initiateAuth=function(e,t){var n=this,r=e.getAuthParameters();r.USERNAME=this.username;var i=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),o={AuthFlow:"CUSTOM_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:i};this.getUserContextData()&&(o.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",o,(function(e,r){if(e)return t.onFailure(e);var i=r.ChallengeName,o=r.ChallengeParameters;return"CUSTOM_CHALLENGE"===i?(n.Session=r.Session,t.customChallenge(o)):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),t.onSuccess(n.signInUserSession))}))},t.authenticateUser=function(e,t){return"USER_PASSWORD_AUTH"===this.authenticationFlowType?this.authenticateUserPlainUsernamePassword(e,t):"USER_SRP_AUTH"===this.authenticationFlowType||"CUSTOM_AUTH"===this.authenticationFlowType?this.authenticateUserDefaultAuth(e,t):t.onFailure(new Error("Authentication flow type is invalid."))},t.authenticateUserDefaultAuth=function(e,t){var n,r,i=this,o=new K(this.pool.getUserPoolId().split("_")[1]),s=new Z,a={};null!=this.deviceKey&&(a.DEVICE_KEY=this.deviceKey),a.USERNAME=this.username,o.getLargeAValue((function(u,c){u&&t.onFailure(u),a.SRP_A=c.toString(16),"CUSTOM_AUTH"===i.authenticationFlowType&&(a.CHALLENGE_NAME="SRP_A");var f=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),l={AuthFlow:i.authenticationFlowType,ClientId:i.pool.getClientId(),AuthParameters:a,ClientMetadata:f};i.getUserContextData(i.username)&&(l.UserContextData=i.getUserContextData(i.username)),i.client.request("InitiateAuth",l,(function(a,u){if(a)return t.onFailure(a);var c=u.ChallengeParameters;i.username=c.USER_ID_FOR_SRP,n=new x(c.SRP_B,16),r=new x(c.SALT,16),i.getCachedDeviceKeyAndPassword(),o.getPasswordAuthenticationKey(i.username,e.getPassword(),n,r,(function(e,n){e&&t.onFailure(e);var r=s.getNowString(),a=C.a.lib.WordArray.create(_.Buffer.concat([_.Buffer.from(i.pool.getUserPoolId().split("_")[1],"utf8"),_.Buffer.from(i.username,"utf8"),_.Buffer.from(c.SECRET_BLOCK,"base64"),_.Buffer.from(r,"utf8")])),l=C.a.lib.WordArray.create(n),d=$.a.stringify(I()(a,l)),h={};h.USERNAME=i.username,h.PASSWORD_CLAIM_SECRET_BLOCK=c.SECRET_BLOCK,h.TIMESTAMP=r,h.PASSWORD_CLAIM_SIGNATURE=d,null!=i.deviceKey&&(h.DEVICE_KEY=i.deviceKey);var p={ChallengeName:"PASSWORD_VERIFIER",ClientId:i.pool.getClientId(),ChallengeResponses:h,Session:u.Session,ClientMetadata:f};i.getUserContextData()&&(p.UserContextData=i.getUserContextData()),function e(t,n){return i.client.request("RespondToAuthChallenge",t,(function(r,o){return r&&"ResourceNotFoundException"===r.code&&-1!==r.message.toLowerCase().indexOf("device")?(h.DEVICE_KEY=null,i.deviceKey=null,i.randomPassword=null,i.deviceGroupKey=null,i.clearCachedDeviceKeyAndPassword(),e(t,n)):n(r,o)}))}(p,(function(e,n){return e?t.onFailure(e):i.authenticateUserInternal(n,o,t)}))}))}))}))},t.authenticateUserPlainUsernamePassword=function(e,t){var n=this,r={};if(r.USERNAME=this.username,r.PASSWORD=e.getPassword(),r.PASSWORD){var i=new K(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(r.DEVICE_KEY=this.deviceKey);var o=0!==Object.keys(e.getValidationData()).length?e.getValidationData():e.getClientMetadata(),s={AuthFlow:"USER_PASSWORD_AUTH",ClientId:this.pool.getClientId(),AuthParameters:r,ClientMetadata:o};this.getUserContextData(this.username)&&(s.UserContextData=this.getUserContextData(this.username)),this.client.request("InitiateAuth",s,(function(e,r){return e?t.onFailure(e):n.authenticateUserInternal(r,i,t)}))}else t.onFailure(new Error("PASSWORD parameter is required"))},t.authenticateUserInternal=function(e,t,n){var r=this,i=e.ChallengeName,o=e.ChallengeParameters;if("SMS_MFA"===i)return this.Session=e.Session,n.mfaRequired(i,o);if("SELECT_MFA_TYPE"===i)return this.Session=e.Session,n.selectMFAType(i,o);if("MFA_SETUP"===i)return this.Session=e.Session,n.mfaSetup(i,o);if("SOFTWARE_TOKEN_MFA"===i)return this.Session=e.Session,n.totpRequired(i,o);if("CUSTOM_CHALLENGE"===i)return this.Session=e.Session,n.customChallenge(o);if("NEW_PASSWORD_REQUIRED"===i){this.Session=e.Session;var s=null,a=null,u=[],c=t.getNewPasswordRequiredChallengeUserAttributePrefix();if(o&&(s=JSON.parse(e.ChallengeParameters.userAttributes),a=JSON.parse(e.ChallengeParameters.requiredAttributes)),a)for(var f=0;f<a.length;f++)u[f]=a[f].substr(c.length);return n.newPasswordRequired(s,u)}if("DEVICE_SRP_AUTH"!==i){this.signInUserSession=this.getCognitoUserSession(e.AuthenticationResult),this.challengeName=i,this.cacheTokens();var l=e.AuthenticationResult.NewDeviceMetadata;if(null==l)return n.onSuccess(this.signInUserSession);t.generateHashDevice(e.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,e.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(i){if(i)return n.onFailure(i);var o={Salt:_.Buffer.from(t.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:_.Buffer.from(t.getVerifierDevices(),"hex").toString("base64")};r.verifierDevices=o.PasswordVerifier,r.deviceGroupKey=l.DeviceGroupKey,r.randomPassword=t.getRandomPassword(),r.client.request("ConfirmDevice",{DeviceKey:l.DeviceKey,AccessToken:r.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:re},(function(t,i){return t?n.onFailure(t):(r.deviceKey=e.AuthenticationResult.NewDeviceMetadata.DeviceKey,r.cacheDeviceKeyAndPassword(),!0===i.UserConfirmationNecessary?n.onSuccess(r.signInUserSession,i.UserConfirmationNecessary):n.onSuccess(r.signInUserSession))}))}))}else this.getDeviceResponse(n)},t.completeNewPasswordChallenge=function(e,t,n,r){var i=this;if(!e)return n.onFailure(new Error("New password is required."));var o=new K(this.pool.getUserPoolId().split("_")[1]),s=o.getNewPasswordRequiredChallengeUserAttributePrefix(),a={};t&&Object.keys(t).forEach((function(e){a[s+e]=t[e]})),a.NEW_PASSWORD=e,a.USERNAME=this.username;var u={ChallengeName:"NEW_PASSWORD_REQUIRED",ClientId:this.pool.getClientId(),ChallengeResponses:a,Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",u,(function(e,t){return e?n.onFailure(e):i.authenticateUserInternal(t,o,n)}))},t.getDeviceResponse=function(e,t){var n=this,r=new K(this.deviceGroupKey),i=new Z,o={};o.USERNAME=this.username,o.DEVICE_KEY=this.deviceKey,r.getLargeAValue((function(s,a){s&&e.onFailure(s),o.SRP_A=a.toString(16);var u={ChallengeName:"DEVICE_SRP_AUTH",ClientId:n.pool.getClientId(),ChallengeResponses:o,ClientMetadata:t};n.getUserContextData()&&(u.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",u,(function(t,o){if(t)return e.onFailure(t);var s=o.ChallengeParameters,a=new x(s.SRP_B,16),u=new x(s.SALT,16);r.getPasswordAuthenticationKey(n.deviceKey,n.randomPassword,a,u,(function(t,r){if(t)return e.onFailure(t);var a=i.getNowString(),u=C.a.lib.WordArray.create(_.Buffer.concat([_.Buffer.from(n.deviceGroupKey,"utf8"),_.Buffer.from(n.deviceKey,"utf8"),_.Buffer.from(s.SECRET_BLOCK,"base64"),_.Buffer.from(a,"utf8")])),c=C.a.lib.WordArray.create(r),f=$.a.stringify(I()(u,c)),l={};l.USERNAME=n.username,l.PASSWORD_CLAIM_SECRET_BLOCK=s.SECRET_BLOCK,l.TIMESTAMP=a,l.PASSWORD_CLAIM_SIGNATURE=f,l.DEVICE_KEY=n.deviceKey;var d={ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:n.pool.getClientId(),ChallengeResponses:l,Session:o.Session};n.getUserContextData()&&(d.UserContextData=n.getUserContextData()),n.client.request("RespondToAuthChallenge",d,(function(t,r){return t?e.onFailure(t):(n.signInUserSession=n.getCognitoUserSession(r.AuthenticationResult),n.cacheTokens(),e.onSuccess(n.signInUserSession))}))}))}))}))},t.confirmRegistration=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),ConfirmationCode:e,Username:this.username,ForceAliasCreation:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmSignUp",i,(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.sendCustomChallengeAnswer=function(e,t,n){var r=this,i={};i.USERNAME=this.username,i.ANSWER=e;var o=new K(this.pool.getUserPoolId().split("_")[1]);this.getCachedDeviceKeyAndPassword(),null!=this.deviceKey&&(i.DEVICE_KEY=this.deviceKey);var s={ChallengeName:"CUSTOM_CHALLENGE",ChallengeResponses:i,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:n};this.getUserContextData()&&(s.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",s,(function(e,n){return e?t.onFailure(e):r.authenticateUserInternal(n,o,t)}))},t.sendMFACode=function(e,t,n,r){var i=this,o={};o.USERNAME=this.username,o.SMS_MFA_CODE=e;var s=n||"SMS_MFA";"SOFTWARE_TOKEN_MFA"===s&&(o.SOFTWARE_TOKEN_MFA_CODE=e),null!=this.deviceKey&&(o.DEVICE_KEY=this.deviceKey);var a={ChallengeName:s,ChallengeResponses:o,ClientId:this.pool.getClientId(),Session:this.Session,ClientMetadata:r};this.getUserContextData()&&(a.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",a,(function(e,n){if(e)return t.onFailure(e);if("DEVICE_SRP_AUTH"!==n.ChallengeName){if(i.signInUserSession=i.getCognitoUserSession(n.AuthenticationResult),i.cacheTokens(),null==n.AuthenticationResult.NewDeviceMetadata)return t.onSuccess(i.signInUserSession);var r=new K(i.pool.getUserPoolId().split("_")[1]);r.generateHashDevice(n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,n.AuthenticationResult.NewDeviceMetadata.DeviceKey,(function(e){if(e)return t.onFailure(e);var o={Salt:_.Buffer.from(r.getSaltDevices(),"hex").toString("base64"),PasswordVerifier:_.Buffer.from(r.getVerifierDevices(),"hex").toString("base64")};i.verifierDevices=o.PasswordVerifier,i.deviceGroupKey=n.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey,i.randomPassword=r.getRandomPassword(),i.client.request("ConfirmDevice",{DeviceKey:n.AuthenticationResult.NewDeviceMetadata.DeviceKey,AccessToken:i.signInUserSession.getAccessToken().getJwtToken(),DeviceSecretVerifierConfig:o,DeviceName:re},(function(e,r){return e?t.onFailure(e):(i.deviceKey=n.AuthenticationResult.NewDeviceMetadata.DeviceKey,i.cacheDeviceKeyAndPassword(),!0===r.UserConfirmationNecessary?t.onSuccess(i.signInUserSession,r.UserConfirmationNecessary):t.onSuccess(i.signInUserSession))}))}))}else i.getDeviceResponse(t)}))},t.changePassword=function(e,t,n,r){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("ChangePassword",{PreviousPassword:e,ProposedPassword:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:r},(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.enableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);var t=[];t.push({DeliveryMedium:"SMS",AttributeName:"phone_number"}),this.client.request("SetUserSettings",{MFAOptions:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t){return t?e(t,null):e(null,"SUCCESS")}))},t.setUserMfaPreference=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n(new Error("User is not authenticated"),null);this.client.request("SetUserMFAPreference",{SMSMfaSettings:e,SoftwareTokenMfaSettings:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?n(e,null):n(null,"SUCCESS")}))},t.disableMFA=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("SetUserSettings",{MFAOptions:[],AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t){return t?e(t,null):e(null,"SUCCESS")}))},t.deleteUser=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("DeleteUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:t},(function(t){return t?e(t,null):(n.clearCachedUser(),e(null,"SUCCESS"))}))},t.updateAttributes=function(e,t,n){var r=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("UpdateUserAttributes",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserAttributes:e,ClientMetadata:n},(function(e){return e?t(e,null):r.getUserData((function(){return t(null,"SUCCESS")}),{bypassCache:!0})}))},t.getUserAttributes=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,n){if(t)return e(t,null);for(var r=[],i=0;i<n.UserAttributes.length;i++){var o={Name:n.UserAttributes[i].Name,Value:n.UserAttributes[i].Value},s=new Q(o);r.push(s)}return e(null,r)}))},t.getMFAOptions=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e(new Error("User is not authenticated"),null);this.client.request("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,n){return t?e(t,null):e(null,n.MFAOptions)}))},t.createGetUserRequest=function(){return this.client.promisifyRequest("GetUser",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()})},t.refreshSessionIfPossible=function(){var e=this;return new Promise((function(t){var n=e.signInUserSession.getRefreshToken();n&&n.getToken()?e.refreshSession(n,t):t()}))},t.getUserData=function(e,t){var n=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return this.clearCachedUserData(),e(new Error("User is not authenticated"),null);var r=this.getUserDataFromCache();if(r)if(this.isFetchUserDataAndTokenRequired(t))this.fetchUserData().then((function(e){return n.refreshSessionIfPossible().then((function(){return e}))})).then((function(t){return e(null,t)})).catch(e);else try{return void e(null,JSON.parse(r))}catch(t){return this.clearCachedUserData(),void e(t,null)}else this.fetchUserData().then((function(t){e(null,t)})).catch(e)},t.getUserDataFromCache=function(){return this.storage.getItem(this.userDataKey)},t.isFetchUserDataAndTokenRequired=function(e){var t=(e||{}).bypassCache;return void 0!==t&&t},t.fetchUserData=function(){var e=this;return this.createGetUserRequest().then((function(t){return e.cacheUserData(t),t}))},t.deleteAttributes=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t(new Error("User is not authenticated"),null);this.client.request("DeleteUserAttributes",{UserAttributeNames:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?t(e,null):t(null,"SUCCESS")}))},t.resendConfirmationCode=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.client.request("ResendConfirmationCode",n,(function(t,n){return t?e(t,null):e(null,n)}))},t.getSession=function(e){if(null==this.username)return e(new Error("Username is null. Cannot retrieve a new session"),null);if(null!=this.signInUserSession&&this.signInUserSession.isValid())return e(null,this.signInUserSession);var t="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,n=t+".idToken",r=t+".accessToken",i=t+".refreshToken",o=t+".clockDrift";if(this.storage.getItem(n)){var s=new V({IdToken:this.storage.getItem(n)}),a=new H({AccessToken:this.storage.getItem(r)}),u=new G({RefreshToken:this.storage.getItem(i)}),c=parseInt(this.storage.getItem(o),0)||0,f=new Y({IdToken:s,AccessToken:a,RefreshToken:u,ClockDrift:c});if(f.isValid())return this.signInUserSession=f,e(null,this.signInUserSession);if(!u.getToken())return e(new Error("Cannot retrieve a new session. Please authenticate."),null);this.refreshSession(u,e)}else e(new Error("Local storage is missing an ID Token, Please authenticate"),null)},t.refreshSession=function(e,t,n){var r=this,i={};i.REFRESH_TOKEN=e.getToken();var o="CognitoIdentityServiceProvider."+this.pool.getClientId(),s=o+".LastAuthUser";if(this.storage.getItem(s)){this.username=this.storage.getItem(s);var a=o+"."+this.username+".deviceKey";this.deviceKey=this.storage.getItem(a),i.DEVICE_KEY=this.deviceKey}var u={ClientId:this.pool.getClientId(),AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:i,ClientMetadata:n};this.getUserContextData()&&(u.UserContextData=this.getUserContextData()),this.client.request("InitiateAuth",u,(function(n,i){if(n)return"NotAuthorizedException"===n.code&&r.clearCachedUser(),t(n,null);if(i){var o=i.AuthenticationResult;return Object.prototype.hasOwnProperty.call(o,"RefreshToken")||(o.RefreshToken=e.getToken()),r.signInUserSession=r.getCognitoUserSession(o),r.cacheTokens(),t(null,r.signInUserSession)}}))},t.cacheTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+"."+this.username+".clockDrift",o=e+".LastAuthUser";this.storage.setItem(t,this.signInUserSession.getIdToken().getJwtToken()),this.storage.setItem(n,this.signInUserSession.getAccessToken().getJwtToken()),this.storage.setItem(r,this.signInUserSession.getRefreshToken().getToken()),this.storage.setItem(i,""+this.signInUserSession.getClockDrift()),this.storage.setItem(o,this.username)},t.cacheUserData=function(e){this.storage.setItem(this.userDataKey,JSON.stringify(e))},t.clearCachedUserData=function(){this.storage.removeItem(this.userDataKey)},t.clearCachedUser=function(){this.clearCachedTokens(),this.clearCachedUserData()},t.cacheDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.setItem(t,this.deviceKey),this.storage.setItem(n,this.randomPassword),this.storage.setItem(r,this.deviceGroupKey)},t.getCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.getItem(t)&&(this.deviceKey=this.storage.getItem(t),this.randomPassword=this.storage.getItem(n),this.deviceGroupKey=this.storage.getItem(r))},t.clearCachedDeviceKeyAndPassword=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId()+"."+this.username,t=e+".deviceKey",n=e+".randomPasswordKey",r=e+".deviceGroupKey";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r)},t.clearCachedTokens=function(){var e="CognitoIdentityServiceProvider."+this.pool.getClientId(),t=e+"."+this.username+".idToken",n=e+"."+this.username+".accessToken",r=e+"."+this.username+".refreshToken",i=e+".LastAuthUser",o=e+"."+this.username+".clockDrift";this.storage.removeItem(t),this.storage.removeItem(n),this.storage.removeItem(r),this.storage.removeItem(i),this.storage.removeItem(o)},t.getCognitoUserSession=function(e){var t=new V(e),n=new H(e),r=new G(e);return new Y({IdToken:t,AccessToken:n,RefreshToken:r})},t.forgotPassword=function(e,t){var n={ClientId:this.pool.getClientId(),Username:this.username,ClientMetadata:t};this.getUserContextData()&&(n.UserContextData=this.getUserContextData()),this.client.request("ForgotPassword",n,(function(t,n){return t?e.onFailure(t):"function"==typeof e.inputVerificationCode?e.inputVerificationCode(n):e.onSuccess(n)}))},t.confirmPassword=function(e,t,n,r){var i={ClientId:this.pool.getClientId(),Username:this.username,ConfirmationCode:e,Password:t,ClientMetadata:r};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("ConfirmForgotPassword",i,(function(e){return e?n.onFailure(e):n.onSuccess()}))},t.getAttributeVerificationCode=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("GetUserAttributeVerificationCode",{AttributeName:e,AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),ClientMetadata:n},(function(e,n){return e?t.onFailure(e):"function"==typeof t.inputVerificationCode?t.inputVerificationCode(n):t.onSuccess()}))},t.verifyAttribute=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));this.client.request("VerifyUserAttribute",{AttributeName:e,Code:t,AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(e){return e?n.onFailure(e):n.onSuccess("SUCCESS")}))},t.getDevice=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey},(function(t,n){return t?e.onFailure(t):e.onSuccess(n)}))},t.forgetSpecificDevice=function(e,t){if(null==this.signInUserSession||!this.signInUserSession.isValid())return t.onFailure(new Error("User is not authenticated"));this.client.request("ForgetDevice",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:e},(function(e){return e?t.onFailure(e):t.onSuccess("SUCCESS")}))},t.forgetDevice=function(e){var t=this;this.forgetSpecificDevice(this.deviceKey,{onFailure:e.onFailure,onSuccess:function(n){return t.deviceKey=null,t.deviceGroupKey=null,t.randomPassword=null,t.clearCachedDeviceKeyAndPassword(),e.onSuccess(n)}})},t.setDeviceStatusRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"remembered"},(function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")}))},t.setDeviceStatusNotRemembered=function(e){if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("UpdateDeviceStatus",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),DeviceKey:this.deviceKey,DeviceRememberedStatus:"not_remembered"},(function(t){return t?e.onFailure(t):e.onSuccess("SUCCESS")}))},t.listDevices=function(e,t,n){if(null==this.signInUserSession||!this.signInUserSession.isValid())return n.onFailure(new Error("User is not authenticated"));var r={AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),Limit:e};t&&(r.PaginationToken=t),this.client.request("ListDevices",r,(function(e,t){return e?n.onFailure(e):n.onSuccess(t)}))},t.globalSignOut=function(e){var t=this;if(null==this.signInUserSession||!this.signInUserSession.isValid())return e.onFailure(new Error("User is not authenticated"));this.client.request("GlobalSignOut",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(n){return n?e.onFailure(n):(t.clearCachedUser(),e.onSuccess("SUCCESS"))}))},t.signOut=function(){this.signInUserSession=null,this.clearCachedUser()},t.sendMFASelectionAnswer=function(e,t){var n=this,r={};r.USERNAME=this.username,r.ANSWER=e;var i={ChallengeName:"SELECT_MFA_TYPE",ChallengeResponses:r,ClientId:this.pool.getClientId(),Session:this.Session};this.getUserContextData()&&(i.UserContextData=this.getUserContextData()),this.client.request("RespondToAuthChallenge",i,(function(r,i){return r?t.onFailure(r):(n.Session=i.Session,"SMS_MFA"===e?t.mfaRequired(i.ChallengeName,i.ChallengeParameters):"SOFTWARE_TOKEN_MFA"===e?t.totpRequired(i.ChallengeName,i.ChallengeParameters):void 0)}))},t.getUserContextData=function(){return this.pool.getUserContextData(this.username)},t.associateSoftwareToken=function(e){var t=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("AssociateSoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken()},(function(t,n){return t?e.onFailure(t):e.associateSecretCode(n.SecretCode)})):this.client.request("AssociateSoftwareToken",{Session:this.Session},(function(n,r){return n?e.onFailure(n):(t.Session=r.Session,e.associateSecretCode(r.SecretCode))}))},t.verifySoftwareToken=function(e,t,n){var r=this;null!=this.signInUserSession&&this.signInUserSession.isValid()?this.client.request("VerifySoftwareToken",{AccessToken:this.signInUserSession.getAccessToken().getJwtToken(),UserCode:e,FriendlyDeviceName:t},(function(e,t){return e?n.onFailure(e):n.onSuccess(t)})):this.client.request("VerifySoftwareToken",{Session:this.Session,UserCode:e,FriendlyDeviceName:t},(function(e,t){if(e)return n.onFailure(e);r.Session=t.Session;var i={};i.USERNAME=r.username;var o={ChallengeName:"MFA_SETUP",ClientId:r.pool.getClientId(),ChallengeResponses:i,Session:r.Session};r.getUserContextData()&&(o.UserContextData=r.getUserContextData()),r.client.request("RespondToAuthChallenge",o,(function(e,t){return e?n.onFailure(e):(r.signInUserSession=r.getCognitoUserSession(t.AuthenticationResult),r.cacheTokens(),n.onSuccess(r.signInUserSession))}))}))},e}();
/*!
 * Copyright 2016 Amazon.com,
 * Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Amazon Software License (the "License").
 * You may not use this file except in compliance with the
 * License. A copy of the License is located at
 *
 *     http://aws.amazon.com/asl/
 *
 * or in the "license" file accompanying this file. This file is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, express or implied. See the License
 * for the specific language governing permissions and
 * limitations under the License.
 */n(92);function oe(){}oe.prototype.userAgent="aws-amplify/0.1.x js";var se=oe;function ae(e){var t="function"==typeof Map?new Map:void 0;return(ae=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ue(e,arguments,le(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),fe(r,e)})(e)}function ue(e,t,n){return(ue=ce()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&fe(i,n.prototype),i}).apply(null,arguments)}function ce(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function fe(e,t){return(fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){return(le=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var de,he=function(e){var t,n;function r(t,n,r,i){var o;return(o=e.call(this,t)||this).code=n,o.name=r,o.statusCode=i,o}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r}(ae(Error)),pe=function(){function e(e,t,n){this.endpoint=t||"https://cognito-idp."+e+".amazonaws.com/";var r=(n||{}).credentials;this.fetchOptions=r?{credentials:r}:{}}var t=e.prototype;return t.promisifyRequest=function(e,t){var n=this;return new Promise((function(r,i){n.request(e,t,(function(e,t){e?i(new he(e.message,e.code,e.name,e.statusCode)):r(t)}))}))},t.request=function(e,t,n){var r,i={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityProviderService."+e,"X-Amz-User-Agent":se.prototype.userAgent},o=Object.assign({},this.fetchOptions,{headers:i,method:"POST",mode:"cors",cache:"no-cache",body:JSON.stringify(t)});fetch(this.endpoint,o).then((function(e){return r=e,e}),(function(e){if(e instanceof TypeError)throw new Error("Network error");throw e})).then((function(e){return e.json().catch((function(){return{}}))})).then((function(e){if(r.ok)return n(null,e);e;var t=(e.__type||e.code).split("#").pop(),i={code:t,name:t,message:e.message||e.Message||null};return n(i)})).catch((function(e){if(!(r&&r.headers&&r.headers.get("x-amzn-errortype"))){if(e instanceof Error&&"Network error"===e.message){var t={code:"NetworkError",name:e.name,message:e.message};return n(t)}return n(e)}try{var i=r.headers.get("x-amzn-errortype").split(":")[0],o={code:i,name:i,statusCode:r.status,message:r.status?r.status.toString():null};return n(o)}catch(t){return n(e)}}))},e}(),ge=function(){function e(e){var t=e||{},n=t.UserPoolId,r=t.ClientId,i=t.endpoint,o=t.fetchOptions,s=t.AdvancedSecurityDataCollectionFlag;if(!n||!r)throw new Error("Both UserPoolId and ClientId are required.");if(!/^[\w-]+_.+$/.test(n))throw new Error("Invalid UserPoolId format.");var a=n.split("_")[0];this.userPoolId=n,this.clientId=r,this.client=new pe(a,i,o),this.advancedSecurityDataCollectionFlag=!1!==s,this.storage=e.Storage||(new ne).getStorage()}var t=e.prototype;return t.getUserPoolId=function(){return this.userPoolId},t.getClientId=function(){return this.clientId},t.signUp=function(e,t,n,r,i,o){var s=this,a={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r,ClientMetadata:o};this.getUserContextData(e)&&(a.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",a,(function(t,n){if(t)return i(t,null);var r={Username:e,Pool:s,Storage:s.storage},o={user:new ie(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub,codeDeliveryDetails:n.CodeDeliveryDetails};return i(null,o)}))},t.getCurrentUser=function(){var e="CognitoIdentityServiceProvider."+this.clientId+".LastAuthUser",t=this.storage.getItem(e);if(t){var n={Username:t,Pool:this,Storage:this.storage};return new ie(n)}return null},t.getUserContextData=function(e){if("undefined"!=typeof AmazonCognitoAdvancedSecurityData){var t=AmazonCognitoAdvancedSecurityData;if(this.advancedSecurityDataCollectionFlag){var n=t.getData(e,this.userPoolId,this.clientId);if(n)return{EncodedData:n}}return{}}},e}(),ve=n(19),ye=function(){function e(e){if(!e.domain)throw new Error("The domain of cookieStorage can not be undefined.");if(this.domain=e.domain,e.path?this.path=e.path:this.path="/",Object.prototype.hasOwnProperty.call(e,"expires")?this.expires=e.expires:this.expires=365,Object.prototype.hasOwnProperty.call(e,"secure")?this.secure=e.secure:this.secure=!0,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!["strict","lax","none"].includes(e.sameSite))throw new Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===e.sameSite&&!this.secure)throw new Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=e.sameSite}else this.sameSite=null}var t=e.prototype;return t.setItem=function(e,t){var n={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(n.sameSite=this.sameSite),ve.set(e,t,n),ve.get(e)},t.getItem=function(e){return ve.get(e)},t.removeItem=function(e){var t={path:this.path,expires:this.expires,domain:this.domain,secure:this.secure};return this.sameSite&&(t.sameSite=this.sameSite),ve.remove(e,t)},t.clear=function(){var e,t=ve.get();for(e=0;e<t.length;++e)ve.remove(t[e]);return{}},e}(),me=n(12),be=function(e){var t=window.open(e,"_self");return t?Promise.resolve(t):Promise.reject()},Se=function(){return(Se=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)},we=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())}))},_e=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])}}},Oe=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},Ce="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Ee=function(e,t,n){u.a.dispatch("auth",{event:e,data:t,message:n},"Auth",Ce)},Ae=new a.a("OAuth"),je=function(){function e(e){var t=e.config,n=e.cognitoClientId,r=e.scopes,i=void 0===r?[]:r;if(this._urlOpener=t.urlOpener||be,this._config=t,this._cognitoClientId=n,!this.isValidScopes(i))throw Error("scopes must be a String Array");this._scopes=i}return e.prototype.isValidScopes=function(e){return Array.isArray(e)&&e.every((function(e){return"string"==typeof e}))},e.prototype.oauthSignIn=function(e,t,n,i,o,s){void 0===e&&(e="code"),void 0===o&&(o=r.Cognito);var a=this._generateState(32),u=s?a+"-"+s.split("").map((function(e){return e.charCodeAt(0).toString(16).padStart(2,"0")})).join(""):a;!function(e){window.sessionStorage.setItem("oauth_state",e)}(u);var c,f=this._generateRandom(128);c=f,window.sessionStorage.setItem("ouath_pkce_key",c);var l=this._generateChallenge(f),d=this._scopes.join(" "),h="https://"+t+"/oauth2/authorize?"+Object.entries(Se(Se({redirect_uri:n,response_type:e,client_id:i,identity_provider:o,scope:d,state:u},"code"===e?{code_challenge:l}:{}),"code"===e?{code_challenge_method:"S256"}:{})).map((function(e){var t=Oe(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&");Ae.debug("Redirecting to "+h),this._urlOpener(h,n)},e.prototype._handleCodeFlow=function(e){return we(this,void 0,void 0,(function(){var t,n,r,i,o,a,u,c,f,l,d,h;return _e(this,(function(p){switch(p.label){case 0:return(t=(Object(me.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Oe(t,2),i=r[0],o=r[1];return Se(Se({},e),((n={})[i]=o,n))}),{code:void 0}).code)?(n="https://"+this._config.domain+"/oauth2/token",Ee("codeFlow",{},"Retrieving tokens from "+n),r=s(this._config)?this._cognitoClientId:this._config.clientID,i=s(this._config)?this._config.redirectSignIn:this._config.redirectUri,g=window.sessionStorage.getItem("ouath_pkce_key"),window.sessionStorage.removeItem("ouath_pkce_key"),a=Se({grant_type:"authorization_code",code:t,client_id:r,redirect_uri:i},(o=g)?{code_verifier:o}:{}),Ae.debug("Calling token endpoint: "+n+" with",a),u=Object.entries(a).map((function(e){var t=Oe(e,2),n=t[0],r=t[1];return encodeURIComponent(n)+"="+encodeURIComponent(r)})).join("&"),[4,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:u})]):[2];case 1:return[4,p.sent().json()];case 2:if(c=p.sent(),f=c.access_token,l=c.refresh_token,d=c.id_token,h=c.error)throw new Error(h);return[2,{accessToken:f,refreshToken:l,idToken:d}]}var g}))}))},e.prototype._handleImplicitFlow=function(e){return we(this,void 0,void 0,(function(){var t,n,r;return _e(this,(function(i){return t=(Object(me.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n,r=Oe(t,2),i=r[0],o=r[1];return Se(Se({},e),((n={})[i]=o,n))}),{id_token:void 0,access_token:void 0}),n=t.id_token,r=t.access_token,Ee("implicitFlow",{},"Got tokens from "+e),Ae.debug("Retrieving implicit tokens from "+e+" with"),[2,{accessToken:r,idToken:n,refreshToken:null}]}))}))},e.prototype.handleAuthResponse=function(e){return we(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return _e(this,(function(u){switch(u.label){case 0:if(u.trys.push([0,5,,6]),t=e?Se(Se({},(Object(me.parse)(e).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Oe(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})),(Object(me.parse)(e).query||"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){var n=Oe(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})):{},n=t.error,r=t.error_description,n)throw new Error(r);return i=this._validateState(t),Ae.debug("Starting "+this._config.responseType+" flow with "+e),"code"!==this._config.responseType?[3,2]:(o=[{}],[4,this._handleCodeFlow(e)]);case 1:return[2,Se.apply(void 0,[Se.apply(void 0,o.concat([u.sent()])),{state:i}])];case 2:return s=[{}],[4,this._handleImplicitFlow(e)];case 3:return[2,Se.apply(void 0,[Se.apply(void 0,s.concat([u.sent()])),{state:i}])];case 4:return[3,6];case 5:throw a=u.sent(),Ae.error("Error handling auth response.",a),a;case 6:return[2]}}))}))},e.prototype._validateState=function(e){if(e){var t,n=(t=window.sessionStorage.getItem("oauth_state"),window.sessionStorage.removeItem("oauth_state"),t),r=e.state;if(n&&n!==r)throw new Error("Invalid state in OAuth flow");return r}},e.prototype.signOut=function(){return we(this,void 0,void 0,(function(){var e,t,n;return _e(this,(function(r){return e="https://"+this._config.domain+"/logout?",t=s(this._config)?this._cognitoClientId:this._config.oauth.clientID,n=s(this._config)?this._config.redirectSignOut:this._config.returnTo,e+=Object.entries({client_id:t,logout_uri:encodeURIComponent(n)}).map((function(e){var t=Oe(e,2);return t[0]+"="+t[1]})).join("&"),Ee("oAuthSignOut",{oAuth:"signOut"},"Signing out from "+e),Ae.debug("Signing out from "+e),[2,this._urlOpener(e)]}))}))},e.prototype._generateState=function(e){for(var t="",n=e,r="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";n>0;--n)t+=r[Math.round(Math.random()*(r.length-1))];return t},e.prototype._generateChallenge=function(e){return this._base64URL(A()(e))},e.prototype._base64URL=function(e){return e.toString($.a).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype._generateRandom=function(e){var t=new Uint8Array(e);if("undefined"!=typeof window&&window.crypto)window.crypto.getRandomValues(t);else for(var n=0;n<e;n+=1)t[n]=Math.random()*"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~".length|0;return this._bufferToString(t)},e.prototype._bufferToString=function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=[],r=0;r<e.byteLength;r+=1){var i=e[r]%t.length;n.push(t[i])}return n.join("")},e}();!function(e){e.DEFAULT_MSG="Authentication Error",e.EMPTY_USERNAME="Username cannot be empty",e.INVALID_USERNAME="The username should either be a string or one of the sign in types",e.EMPTY_PASSWORD="Password cannot be empty",e.EMPTY_CODE="Confirmation code cannot be empty",e.SIGN_UP_ERROR="Error creating account",e.NO_MFA="No valid MFA method provided",e.INVALID_MFA="Invalid MFA type",e.EMPTY_CHALLENGE="Challenge response cannot be empty",e.NO_USER_SESSION="Failed to get the session because the user is empty"}(de||(de={}));var Ie,xe=(Ie=function(e,t){return(Ie=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}Ie(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Pe=new a.a("AuthError"),ke=function(e){function t(n){var r=this,i=Ue[n],o=i.message,s=i.log;return(r=e.call(this,o)||this).constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="AuthError",r.log=s||o,Pe.error(r.log),r}return xe(t,e),t}(Error),Te=function(e){function t(n){var r=e.call(this,n)||this;return r.constructor=t,Object.setPrototypeOf(r,t.prototype),r.name="NoUserPoolError",r}return xe(t,e),t}(ke),Ue={noConfig:{message:de.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly.\n            This error is typically caused by one of the following scenarios:\n\n            1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n                See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n            \n            2. There might be multiple conflicting versions of aws-amplify or amplify packages in your node_modules.\n                Try deleting your node_modules folder and reinstalling the dependencies with `yarn install`\n        "},missingAuthConfig:{message:de.DEFAULT_MSG,log:"\n            Error: Amplify has not been configured correctly. \n            The configuration object is missing required auth properties. \n            Did you run `amplify push` after adding auth via `amplify add auth`?\n            See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n        "},emptyUsername:{message:de.EMPTY_USERNAME},invalidUsername:{message:de.INVALID_USERNAME},emptyPassword:{message:de.EMPTY_PASSWORD},emptyCode:{message:de.EMPTY_CODE},signUpError:{message:de.SIGN_UP_ERROR,log:"The first parameter should either be non-null string or object"},noMFA:{message:de.NO_MFA},invalidMFA:{message:de.INVALID_MFA},emptyChallengeResponse:{message:de.EMPTY_CHALLENGE},noUserSession:{message:de.NO_USER_SESSION},default:{message:de.DEFAULT_MSG}},Re=function(){return(Re=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)},Le=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())}))},De=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])}}},Me=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},Ne=new a.a("AuthClass"),Be="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default",Fe=function(e,t,n){u.a.dispatch("auth",{event:e,data:t,message:n},"Auth",Be)},ze=new(function(){function e(e){var t=this;this.userPool=null,this.user=null,this.oAuthFlowInProgress=!1,this.Credentials=c.a,this.configure(e),this.currentCredentials=this.currentCredentials.bind(this),this.currentUserCredentials=this.currentUserCredentials.bind(this),u.a.listen("auth",(function(e){switch(e.payload.event){case"signIn":t._storage.setItem("amplify-signin-with-hostedUI","false");break;case"signOut":t._storage.removeItem("amplify-signin-with-hostedUI");break;case"cognitoHostedUI":t._storage.setItem("amplify-signin-with-hostedUI","true")}}))}return e.prototype.getModuleName=function(){return"Auth"},e.prototype.configure=function(e){var t=this;if(!e)return this._config||{};Ne.debug("configure Auth");var n=Object.assign({},this._config,f.a.parseMobilehubConfig(e).Auth,e);this._config=n;var r=this._config,i=r.userPoolId,o=r.userPoolWebClientId,a=r.cookieStorage,u=r.oauth,c=r.region,l=r.identityPoolId,d=r.mandatorySignIn,h=r.refreshHandlers,p=r.identityPoolRegion,v=r.clientMetadata,b=r.endpoint;if(this._config.storage){if(!this._isValidAuthStorage(this._config.storage))throw Ne.error("The storage in the Auth config is not valid!"),new Error("Empty storage object");this._storage=this._config.storage}else this._storage=a?new ye(a):e.ssr?new y:(new m.a).getStorage();if(this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),i){var S={UserPoolId:i,ClientId:o,endpoint:b};S.Storage=this._storage,this.userPool=new ge(S)}this.Credentials.configure({mandatorySignIn:d,region:p||c,userPoolId:i,identityPoolId:l,refreshHandlers:h,storage:this._storage});var w=u?s(this._config.oauth)?u:u.awsCognito:void 0;if(w){var _=Object.assign({cognitoClientId:o,UserPoolId:i,domain:w.domain,scopes:w.scope,redirectSignIn:w.redirectSignIn,redirectSignOut:w.redirectSignOut,responseType:w.responseType,Storage:this._storage,urlOpener:w.urlOpener,clientMetadata:v},w.options);this._oAuthHandler=new je({scopes:_.scopes,config:_,cognitoClientId:_.cognitoClientId});var O={};!function(e){if(g.a.browserOrNode().isBrowser&&window.location)e({url:window.location.href});else if(!g.a.browserOrNode().isNode)throw new Error("Not supported")}((function(e){var n=e.url;O[n]||(O[n]=!0,t._handleAuthResponse(n))}))}return Fe("configured",null,"The Auth category has been configured successfully"),this._config},e.prototype.signUp=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(!this.userPool)return this.rejectNoUserPool();var o,s=null,a=null,u=[],c=null;if(e&&"string"==typeof e){s=e,a=n?n[0]:null;var f=n?n[1]:null,l=n?n[2]:null;f&&u.push({Name:"email",Value:f}),l&&u.push({Name:"phone_number",Value:l})}else{if(!e||"object"!=typeof e)return this.rejectAuthError(i.SignUpError);s=e.username,a=e.password,e&&e.clientMetadata?o=e.clientMetadata:this._config.clientMetadata&&(o=this._config.clientMetadata);var d=e.attributes;d&&Object.keys(d).map((function(e){var t={Name:e,Value:d[e]};u.push(t)})),c=e.validationData||null}return s?a?(Ne.debug("signUp attrs:",u),Ne.debug("signUp validation data:",c),new Promise((function(e,n){t.userPool.signUp(s,a,u,c,(function(t,r){t?(Fe("signUp_failure",t,s+" failed to signup"),n(t)):(Fe("signUp",r,s+" has signed up successfully"),e(r))}),o)}))):this.rejectAuthError(i.EmptyPassword):this.rejectAuthError(i.EmptyUsername)},e.prototype.confirmSignUp=function(e,t,n){if(!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);var r,o=this.createCognitoUser(e),s=!n||"boolean"!=typeof n.forceAliasCreation||n.forceAliasCreation;return n&&n.clientMetadata?r=n.clientMetadata:this._config.clientMetadata&&(r=this._config.clientMetadata),new Promise((function(e,n){o.confirmRegistration(t,s,(function(t,r){t?n(t):e(r)}),r)}))},e.prototype.resendSignUp=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(e,r){n.resendConfirmationCode((function(t,n){t?r(t):e(n)}),t)}))},e.prototype.signIn=function(e,t,n){if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();var r=null,o=null,s={};if("string"==typeof e)r=e,o=t;else{if(!e.username)return this.rejectAuthError(i.InvalidUsername);void 0!==t&&Ne.warn("The password should be defined under the first parameter object!"),r=e.username,o=e.password,s=e.validationData}if(!r)return this.rejectAuthError(i.EmptyUsername);var a=new w({Username:r,Password:o,ValidationData:s,ClientMetadata:n});return o?this.signInWithPassword(a):this.signInWithoutPassword(a)},e.prototype.authCallbacks=function(e,t,n){var r=this,i=this;return{onSuccess:function(o){return Le(r,void 0,void 0,(function(){var r,s,a,u;return De(this,(function(c){switch(c.label){case 0:Ne.debug(o),delete e.challengeName,delete e.challengeParam,c.label=1;case 1:return c.trys.push([1,4,5,9]),[4,this.Credentials.clear()];case 2:return c.sent(),[4,this.Credentials.set(o,"session")];case 3:return r=c.sent(),Ne.debug("succeed to get cognito credentials",r),[3,9];case 4:return s=c.sent(),Ne.debug("cannot get cognito credentials",s),[3,9];case 5:return c.trys.push([5,7,,8]),[4,this.currentUserPoolUser()];case 6:return a=c.sent(),i.user=a,Fe("signIn",a,"A user "+e.getUsername()+" has been signed in"),t(a),[3,8];case 7:return u=c.sent(),Ne.error("Failed to get the signed in user",u),n(u),[3,8];case 8:return[7];case 9:return[2]}}))}))},onFailure:function(t){Ne.debug("signIn failure",t),Fe("signIn_failure",t,e.getUsername()+" failed to signin"),n(t)},customChallenge:function(n){Ne.debug("signIn custom challenge answer required"),e.challengeName="CUSTOM_CHALLENGE",e.challengeParam=n,t(e)},mfaRequired:function(n,r){Ne.debug("signIn MFA required"),e.challengeName=n,e.challengeParam=r,t(e)},mfaSetup:function(n,r){Ne.debug("signIn mfa setup",n),e.challengeName=n,e.challengeParam=r,t(e)},newPasswordRequired:function(n,r){Ne.debug("signIn new password"),e.challengeName="NEW_PASSWORD_REQUIRED",e.challengeParam={userAttributes:n,requiredAttributes:r},t(e)},totpRequired:function(n,r){Ne.debug("signIn totpRequired"),e.challengeName=n,e.challengeParam=r,t(e)},selectMFAType:function(n,r){Ne.debug("signIn selectMFAType",n),e.challengeName=n,e.challengeParam=r,t(e)}}},e.prototype.signInWithPassword=function(e){var t=this,n=this.createCognitoUser(e.getUsername());return new Promise((function(r,i){n.authenticateUser(e,t.authCallbacks(n,r,i))}))},e.prototype.signInWithoutPassword=function(e){var t=this,n=this.createCognitoUser(e.getUsername());return n.setAuthenticationFlowType("CUSTOM_AUTH"),new Promise((function(r,i){n.initiateAuth(e,t.authCallbacks(n,r,i))}))},e.prototype.getMFAOptions=function(e){return new Promise((function(t,n){e.getMFAOptions((function(e,r){if(e)return Ne.debug("get MFA Options failed",e),void n(e);Ne.debug("get MFA options success",r),t(r)}))}))},e.prototype.getPreferredMFA=function(e,t){var n=this;return new Promise((function(r,i){var o=!!t&&t.bypassCache;e.getUserData((function(e,t){if(e)return Ne.debug("getting preferred mfa failed",e),void i(e);var o=n._getMfaTypeFromUserData(t);return o?void r(o):void i("invalid MFA Type")}),{bypassCache:o})}))},e.prototype._getMfaTypeFromUserData=function(e){var t=null,n=e.PreferredMfaSetting;if(n)t=n;else{var r=e.UserMFASettingList;if(r)0===r.length?t="NOMFA":Ne.debug("invalid case for getPreferredMFA",e);else t=e.MFAOptions?"SMS_MFA":"NOMFA"}return t},e.prototype._getUserData=function(e,t){return new Promise((function(n,r){e.getUserData((function(e,t){return e?(Ne.debug("getting user data failed",e),void r(e)):void n(t)}),t)}))},e.prototype.setPreferredMFA=function(e,t){return Le(this,void 0,void 0,(function(){var n,r,o,s,a;return De(this,(function(u){switch(u.label){case 0:return[4,this._getUserData(e,{bypassCache:!0})];case 1:switch(n=u.sent(),r=null,o=null,t){case"TOTP":return[3,2];case"SMS":return[3,3];case"NOMFA":return[3,4]}return[3,6];case 2:return o={PreferredMfa:!0,Enabled:!0},[3,7];case 3:return r={PreferredMfa:!0,Enabled:!0},[3,7];case 4:return s=n.UserMFASettingList,[4,this._getMfaTypeFromUserData(n)];case 5:if("NOMFA"===(a=u.sent()))return[2,Promise.resolve("No change for mfa type")];if("SMS_MFA"===a)r={PreferredMfa:!1,Enabled:!1};else{if("SOFTWARE_TOKEN_MFA"!==a)return[2,this.rejectAuthError(i.InvalidMFA)];o={PreferredMfa:!1,Enabled:!1}}return s&&0!==s.length&&s.forEach((function(e){"SMS_MFA"===e?r={PreferredMfa:!1,Enabled:!1}:"SOFTWARE_TOKEN_MFA"===e&&(o={PreferredMfa:!1,Enabled:!1})})),[3,7];case 6:return Ne.debug("no validmfa method provided"),[2,this.rejectAuthError(i.NoMFA)];case 7:return this,[2,new Promise((function(t,n){e.setUserMfaPreference(r,o,(function(r,i){if(r)return Ne.debug("Set user mfa preference error",r),n(r);Ne.debug("Set user mfa success",i),Ne.debug("Caching the latest user data into local"),e.getUserData((function(e,r){return e?(Ne.debug("getting user data failed",e),n(e)):t(i)}),{bypassCache:!0})}))}))]}}))}))},e.prototype.disableSMS=function(e){return new Promise((function(t,n){e.disableMFA((function(e,r){if(e)return Ne.debug("disable mfa failed",e),void n(e);Ne.debug("disable mfa succeed",r),t(r)}))}))},e.prototype.enableSMS=function(e){return new Promise((function(t,n){e.enableMFA((function(e,r){if(e)return Ne.debug("enable mfa failed",e),void n(e);Ne.debug("enable mfa succeed",r),t(r)}))}))},e.prototype.setupTOTP=function(e){return new Promise((function(t,n){e.associateSoftwareToken({onFailure:function(e){Ne.debug("associateSoftwareToken failed",e),n(e)},associateSecretCode:function(e){Ne.debug("associateSoftwareToken sucess",e),t(e)}})}))},e.prototype.verifyTotpToken=function(e,t){return Ne.debug("verfication totp token",e,t),new Promise((function(n,r){e.verifySoftwareToken(t,"My TOTP device",{onFailure:function(e){Ne.debug("verifyTotpToken failed",e),r(e)},onSuccess:function(e){Ne.debug("verifyTotpToken success",e),n(e)}})}))},e.prototype.confirmSignIn=function(e,t,n,r){var o=this;if(void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyCode);var s=this;return new Promise((function(i,a){e.sendMFACode(t,{onSuccess:function(t){return Le(o,void 0,void 0,(function(){var n,r;return De(this,(function(o){switch(o.label){case 0:Ne.debug(t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return o.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=o.sent(),Ne.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=o.sent(),Ne.debug("cannot get cognito credentials",r),[3,6];case 5:return s.user=e,Fe("signIn",e,e+" has signed in"),i(e),[7];case 6:return[2]}}))}))},onFailure:function(e){Ne.debug("confirm signIn failure",e),a(e)}},n,r)}))},e.prototype.completeNewPassword=function(e,t,n,r){var o=this;if(void 0===n&&(n={}),void 0===r&&(r=this._config.clientMetadata),!t)return this.rejectAuthError(i.EmptyPassword);var s=this;return new Promise((function(i,a){e.completeNewPasswordChallenge(t,n,{onSuccess:function(t){return Le(o,void 0,void 0,(function(){var n,r;return De(this,(function(o){switch(o.label){case 0:Ne.debug(t),o.label=1;case 1:return o.trys.push([1,4,5,6]),[4,this.Credentials.clear()];case 2:return o.sent(),[4,this.Credentials.set(t,"session")];case 3:return n=o.sent(),Ne.debug("succeed to get cognito credentials",n),[3,6];case 4:return r=o.sent(),Ne.debug("cannot get cognito credentials",r),[3,6];case 5:return s.user=e,Fe("signIn",e,e+" has signed in"),i(e),[7];case 6:return[2]}}))}))},onFailure:function(e){Ne.debug("completeNewPassword failure",e),Fe("completeNewPassword_failure",e,o.user+" failed to complete the new password flow"),a(e)},mfaRequired:function(t,n){Ne.debug("signIn MFA required"),e.challengeName=t,e.challengeParam=n,i(e)},mfaSetup:function(t,n){Ne.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)},totpRequired:function(t,n){Ne.debug("signIn mfa setup",t),e.challengeName=t,e.challengeParam=n,i(e)}},r)}))},e.prototype.sendCustomChallengeAnswer=function(e,t,n){var r=this;if(void 0===n&&(n=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!t)return this.rejectAuthError(i.EmptyChallengeResponse);return new Promise((function(i,o){e.sendCustomChallengeAnswer(t,r.authCallbacks(e,i,o),n)}))},e.prototype.updateUserAttributes=function(e,t,n){void 0===n&&(n=this._config.clientMetadata);var r=[],i=this;return new Promise((function(o,s){i.userSession(e).then((function(i){for(var a in t)if("sub"!==a&&a.indexOf("_verified")<0){var u={Name:a,Value:t[a]};r.push(u)}e.updateAttributes(r,(function(e,t){return e?s(e):o(t)}),n)}))}))},e.prototype.userAttributes=function(e){var t=this;return new Promise((function(n,r){t.userSession(e).then((function(t){e.getUserAttributes((function(e,t){e?r(e):n(t)}))}))}))},e.prototype.verifiedContact=function(e){var t=this;return this.userAttributes(e).then((function(e){var n=t.attributesToObject(e),r={},i={};return n.email&&(n.email_verified?i.email=n.email:r.email=n.email),n.phone_number&&(n.phone_number_verified?i.phone_number=n.phone_number:r.phone_number=n.phone_number),{verified:i,unverified:r}}))},e.prototype.currentUserPoolUser=function(e){var t=this;return this.userPool?new Promise((function(n,r){t._storageSync.then((function(){return Le(t,void 0,void 0,(function(){var t,i=this;return De(this,(function(o){switch(o.label){case 0:return this.isOAuthInProgress()?(Ne.debug("OAuth signIn in progress, waiting for resolution..."),[4,new Promise((function(e){var t=setTimeout((function(){Ne.debug("OAuth signIn in progress timeout"),u.a.remove("auth",n),e()}),1e4);function n(r){var i=r.payload.event;"cognitoHostedUI"!==i&&"cognitoHostedUI_failure"!==i||(Ne.debug("OAuth signIn resolved: "+i),clearTimeout(t),u.a.remove("auth",n),e())}u.a.listen("auth",n)}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return(t=this.userPool.getCurrentUser())?(t.getSession((function(o,s){return Le(i,void 0,void 0,(function(){var i,a,u=this;return De(this,(function(c){switch(c.label){case 0:return o?(Ne.debug("Failed to get the user session",o),r(o),[2]):(i=!!e&&e.bypassCache)?[4,this.Credentials.clear()]:[3,2];case 1:c.sent(),c.label=2;case 2:return a=s.getAccessToken().decodePayload().scope,(void 0===a?"":a).split(" ").includes("aws.cognito.signin.user.admin")?(t.getUserData((function(e,i){if(e)return Ne.debug("getting user data failed",e),void("User is disabled."===e.message||"User does not exist."===e.message||"Access Token has been revoked"===e.message?r(e):n(t));for(var o=i.PreferredMfaSetting||"NOMFA",s=[],a=0;a<i.UserAttributes.length;a++){var c={Name:i.UserAttributes[a].Name,Value:i.UserAttributes[a].Value},f=new Q(c);s.push(f)}var l=u.attributesToObject(s);return Object.assign(t,{attributes:l,preferredMFA:o}),n(t)}),{bypassCache:i}),[2]):(Ne.debug("Unable to get the user data because the aws.cognito.signin.user.admin is not in the scopes of the access token"),[2,n(t)])}}))}))})),[2]):(Ne.debug("Failed to get user from user pool"),r("No current user"),[2])}}))}))})).catch((function(e){return Ne.debug("Failed to sync cache info into memory",e),r(e)}))})):this.rejectNoUserPool()},e.prototype.isOAuthInProgress=function(){return this.oAuthFlowInProgress},e.prototype.currentAuthenticatedUser=function(e){return Le(this,void 0,void 0,(function(){var t,n,r,i,o;return De(this,(function(s){switch(s.label){case 0:Ne.debug("getting current authenticated user"),t=null,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._storageSync];case 2:return s.sent(),[3,4];case 3:throw n=s.sent(),Ne.debug("Failed to sync cache info into memory",n),n;case 4:try{(r=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")))&&(t=Re(Re({},r.user),{token:r.token}))}catch(e){Ne.debug("cannot load federated user from auth storage")}return t?(this.user=t,Ne.debug("get current authenticated federated user",this.user),[2,this.user]):[3,5];case 5:Ne.debug("get current authenticated userpool user"),i=null,s.label=6;case 6:return s.trys.push([6,8,,9]),[4,this.currentUserPoolUser(e)];case 7:return i=s.sent(),[3,9];case 8:throw"No userPool"===(o=s.sent())&&Ne.error("Cannot get the current user because the user pool is missing. Please make sure the Auth module is configured with a valid Cognito User Pool ID"),Ne.debug("The user is not authenticated by the error",o),"not authenticated";case 9:return this.user=i,[2,this.user]}}))}))},e.prototype.currentSession=function(){var e=this;return Ne.debug("Getting current session"),this.userPool?new Promise((function(t,n){e.currentUserPoolUser().then((function(r){e.userSession(r).then((function(e){t(e)})).catch((function(e){Ne.debug("Failed to get the current session",e),n(e)}))})).catch((function(e){Ne.debug("Failed to get the current user",e),n(e)}))})):Promise.reject()},e.prototype.userSession=function(e){return e?new Promise((function(t,n){Ne.debug("Getting the session from this user:",e),e.getSession((function(r,i){return r?(Ne.debug("Failed to get the session from user",e),void n(r)):(Ne.debug("Succeed to get the user session",i),void t(i))}))})):(Ne.debug("the user is null"),this.rejectAuthError(i.NoUserSession))},e.prototype.currentUserCredentials=function(){return Le(this,void 0,void 0,(function(){var e,t,n=this;return De(this,(function(r){switch(r.label){case 0:Ne.debug("Getting current user credentials"),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this._storageSync];case 2:return r.sent(),[3,4];case 3:throw e=r.sent(),Ne.debug("Failed to sync cache info into memory",e),e;case 4:t=null;try{t=JSON.parse(this._storage.getItem("aws-amplify-federatedInfo"))}catch(e){Ne.debug("failed to get or parse item aws-amplify-federatedInfo",e)}return t?[2,this.Credentials.refreshFederatedToken(t)]:[2,this.currentSession().then((function(e){return Ne.debug("getting session success",e),n.Credentials.set(e,"session")})).catch((function(e){return Ne.debug("getting session failed",e),n.Credentials.set(null,"guest")}))]}}))}))},e.prototype.currentCredentials=function(){return Ne.debug("getting current credentials"),this.Credentials.get()},e.prototype.verifyUserAttribute=function(e,t,n){return void 0===n&&(n=this._config.clientMetadata),new Promise((function(r,i){e.getAttributeVerificationCode(t,{onSuccess:function(){return r()},onFailure:function(e){return i(e)},clientMetadata:n})}))},e.prototype.verifyUserAttributeSubmit=function(e,t,n){return n?new Promise((function(r,i){e.verifyAttribute(t,n,{onSuccess:function(e){r(e)},onFailure:function(e){i(e)}})})):this.rejectAuthError(i.EmptyCode)},e.prototype.verifyCurrentUserAttribute=function(e){var t=this;return t.currentUserPoolUser().then((function(n){return t.verifyUserAttribute(n,e)}))},e.prototype.verifyCurrentUserAttributeSubmit=function(e,t){var n=this;return n.currentUserPoolUser().then((function(r){return n.verifyUserAttributeSubmit(r,e,t)}))},e.prototype.cognitoIdentitySignOut=function(e,t){return Le(this,void 0,void 0,(function(){var n,r,i=this;return De(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this._storageSync];case 1:return o.sent(),[3,3];case 2:throw n=o.sent(),Ne.debug("Failed to sync cache info into memory",n),n;case 3:return r=this._oAuthHandler&&"true"===this._storage.getItem("amplify-signin-with-hostedUI"),[2,new Promise((function(n,o){if(e&&e.global)Ne.debug("user global sign out",t),t.getSession((function(e,s){if(e)return Ne.debug("failed to get the user session",e),o(e);t.globalSignOut({onSuccess:function(e){if(Ne.debug("global sign out success"),!r)return n();i.oAuthSignOutRedirect(n,o)},onFailure:function(e){return Ne.debug("global sign out failed",e),o(e)}})}));else{if(Ne.debug("user sign out",t),t.signOut(),!r)return n();i.oAuthSignOutRedirect(n,o)}}))]}}))}))},e.prototype.oAuthSignOutRedirect=function(e,t){g.a.browserOrNode().isBrowser?this.oAuthSignOutRedirectOrReject(t):this.oAuthSignOutAndResolve(e)},e.prototype.oAuthSignOutAndResolve=function(e){this._oAuthHandler.signOut(),e()},e.prototype.oAuthSignOutRedirectOrReject=function(e){this._oAuthHandler.signOut(),setTimeout((function(){return e("Signout timeout fail")}),3e3)},e.prototype.signOut=function(e){return Le(this,void 0,void 0,(function(){var t;return De(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cleanCachedItems()];case 1:return n.sent(),[3,3];case 2:return n.sent(),Ne.debug("failed to clear cached items"),[3,3];case 3:return this.userPool?(t=this.userPool.getCurrentUser())?[4,this.cognitoIdentitySignOut(e,t)]:[3,5]:[3,7];case 4:return n.sent(),[3,6];case 5:Ne.debug("no current Cognito user"),n.label=6;case 6:return[3,8];case 7:Ne.debug("no Congito User pool"),n.label=8;case 8:return Fe("signOut",this.user,"A user has been signed out"),this.user=null,[2]}}))}))},e.prototype.cleanCachedItems=function(){return Le(this,void 0,void 0,(function(){return De(this,(function(e){switch(e.label){case 0:return[4,this.Credentials.clear()];case 1:return e.sent(),[2]}}))}))},e.prototype.changePassword=function(e,t,n,r){var i=this;return void 0===r&&(r=this._config.clientMetadata),new Promise((function(o,s){i.userSession(e).then((function(i){e.changePassword(t,n,(function(e,t){return e?(Ne.debug("change password failure",e),s(e)):o(t)}),r)}))}))},e.prototype.forgotPassword=function(e,t){if(void 0===t&&(t=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);var n=this.createCognitoUser(e);return new Promise((function(r,i){n.forgotPassword({onSuccess:function(){r()},onFailure:function(t){Ne.debug("forgot password failure",t),Fe("forgotPassword_failure",t,e+" forgotPassword failed"),i(t)},inputVerificationCode:function(t){Fe("forgotPassword",n,e+" has initiated forgot password flow"),r(t)}},t)}))},e.prototype.forgotPasswordSubmit=function(e,t,n,r){if(void 0===r&&(r=this._config.clientMetadata),!this.userPool)return this.rejectNoUserPool();if(!e)return this.rejectAuthError(i.EmptyUsername);if(!t)return this.rejectAuthError(i.EmptyCode);if(!n)return this.rejectAuthError(i.EmptyPassword);var o=this.createCognitoUser(e);return new Promise((function(i,s){o.confirmPassword(t,n,{onSuccess:function(){Fe("forgotPasswordSubmit",o,e+" forgotPasswordSubmit successful"),i()},onFailure:function(t){Fe("forgotPasswordSubmit_failure",t,e+" forgotPasswordSubmit failed"),s(t)}},r)}))},e.prototype.currentUserInfo=function(){return Le(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return De(this,(function(a){switch(a.label){case 0:return(e=this.Credentials.getCredSource())&&"aws"!==e&&"userPool"!==e?[3,9]:[4,this.currentUserPoolUser().catch((function(e){return Ne.debug(e)}))];case 1:if(!(s=a.sent()))return[2,null];a.label=2;case 2:return a.trys.push([2,8,,9]),[4,this.userAttributes(s)];case 3:t=a.sent(),n=this.attributesToObject(t),r=null,a.label=4;case 4:return a.trys.push([4,6,,7]),[4,this.currentCredentials()];case 5:return r=a.sent(),[3,7];case 6:return i=a.sent(),Ne.debug("Failed to retrieve credentials while getting current user info",i),[3,7];case 7:return[2,{id:r?r.identityId:void 0,username:s.getUsername(),attributes:n}];case 8:return o=a.sent(),Ne.debug("currentUserInfo error",o),[2,{}];case 9:return"federated"===e?[2,(s=this.user)||{}]:[2]}}))}))},e.prototype.federatedSignIn=function(e,t,n){return Le(this,void 0,void 0,(function(){var i,a,u,c,f,l,d,h,p,g,v;return De(this,(function(y){switch(y.label){case 0:if(!this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation requires either a User Pool or Identity Pool in config");if(void 0===e&&this._config.identityPoolId&&!this._config.userPoolId)throw new Error("Federation with Identity Pools requires tokens passed as arguments");return o(e)||(m=e)&&["customProvider"].find((function(e){return m.hasOwnProperty(e)}))||function(e){return e&&!!["customState"].find((function(t){return e.hasOwnProperty(t)}))}(e)||void 0===e?(i=e||{provider:r.Cognito},f=o(i)?i.provider:i.customProvider,o(i),a=i.customState,this._config.userPoolId&&(u=s(this._config.oauth)?this._config.userPoolWebClientId:this._config.oauth.clientID,c=s(this._config.oauth)?this._config.oauth.redirectSignIn:this._config.oauth.redirectUri,this._oAuthHandler.oauthSignIn(this._config.oauth.responseType,this._config.oauth.domain,c,u,f,a)),[3,4]):[3,1];case 1:f=e;try{(l=JSON.stringify(JSON.parse(this._storage.getItem("aws-amplify-federatedInfo")).user))&&Ne.warn("There is already a signed in user: "+l+" in your app.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.")}catch(e){}return d=t.token,h=t.identity_id,p=t.expires_at,[4,this.Credentials.set({provider:f,token:d,identity_id:h,user:n,expires_at:p},"federation")];case 2:return g=y.sent(),[4,this.currentAuthenticatedUser()];case 3:return v=y.sent(),Fe("signIn",v,"A user "+v.username+" has been signed in"),Ne.debug("federated sign in credentials",g),[2,g];case 4:return[2]}var m}))}))},e.prototype._handleAuthResponse=function(e){return Le(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,f,l,d,h,p;return De(this,(function(v){switch(v.label){case 0:if(this.oAuthFlowInProgress)return Ne.debug("Skipping URL "+e+" current flow in progress"),[2];v.label=1;case 1:if(v.trys.push([1,,8,9]),this.oAuthFlowInProgress=!0,!this._config.userPoolId)throw new Error("OAuth responses require a User Pool defined in config");if(Fe("parsingCallbackUrl",{url:e},"The callback url is being parsed"),t=e||(g.a.browserOrNode().isBrowser?window.location.href:""),n=!!(Object(me.parse)(t).query||"").split("&").map((function(e){return e.split("=")})).find((function(e){var t=Me(e,1)[0];return"code"===t||"error"===t})),r=!!(Object(me.parse)(t).hash||"#").substr(1).split("&").map((function(e){return e.split("=")})).find((function(e){var t=Me(e,1)[0];return"access_token"===t||"error"===t})),!n&&!r)return[3,7];this._storage.setItem("amplify-redirected-from-hosted-ui","true"),v.label=2;case 2:return v.trys.push([2,6,,7]),[4,this._oAuthHandler.handleAuthResponse(t)];case 3:return i=v.sent(),o=i.accessToken,s=i.idToken,a=i.refreshToken,u=i.state,c=new Y({IdToken:new V({IdToken:s}),RefreshToken:new G({RefreshToken:a}),AccessToken:new H({AccessToken:o})}),f=void 0,this._config.identityPoolId?[4,this.Credentials.set(c,"session")]:[3,5];case 4:f=v.sent(),Ne.debug("AWS credentials",f),v.label=5;case 5:return l=/-/.test(u),(d=this.createCognitoUser(c.getIdToken().decodePayload()["cognito:username"])).setSignInUserSession(c),window&&void 0!==window.history&&window.history.replaceState({},null,this._config.oauth.redirectSignIn),Fe("signIn",d,"A user "+d.getUsername()+" has been signed in"),Fe("cognitoHostedUI",d,"A user "+d.getUsername()+" has been signed in via Cognito Hosted UI"),l&&(h=u.split("-").splice(1).join("-"),Fe("customOAuthState",h.match(/.{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""),"State for user "+d.getUsername())),[2,f];case 6:return p=v.sent(),Ne.debug("Error in cognito hosted auth response",p),Fe("signIn_failure",p,"The OAuth response flow failed"),Fe("cognitoHostedUI_failure",p,"A failure occurred when returning to the Cognito Hosted UI"),Fe("customState_failure",p,"A failure occurred when returning state"),[3,7];case 7:return[3,9];case 8:return this.oAuthFlowInProgress=!1,[7];case 9:return[2]}}))}))},e.prototype.essentialCredentials=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e.prototype.attributesToObject=function(e){var t={};return e&&e.map((function(e){"email_verified"===e.Name||"phone_number_verified"===e.Name?t[e.Name]="true"===e.Value||!0===e.Value:t[e.Name]=e.Value})),t},e.prototype.createCognitoUser=function(e){var t={Username:e,Pool:this.userPool};t.Storage=this._storage;var n=this._config.authenticationFlowType,r=new ie(t);return n&&r.setAuthenticationFlowType(n),r},e.prototype._isValidAuthStorage=function(e){return!!e&&"function"==typeof e.getItem&&"function"==typeof e.setItem&&"function"==typeof e.removeItem&&"function"==typeof e.clear},e.prototype.noUserPoolErrorHandler=function(e){return!e||e.userPoolId&&e.identityPoolId?i.NoConfig:i.MissingAuthConfig},e.prototype.rejectAuthError=function(e){return Promise.reject(new ke(e))},e.prototype.rejectNoUserPool=function(){var e=this.noUserPoolErrorHandler(this._config);return Promise.reject(new Te(e))},e}())(null);S.a.register(ze)},,,,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r;e.exports=(r=n(5),function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,r=[],i=0;i<n;i++)r[i>>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)},function(e,t,n){"use strict";n.r(t),t.default=function(e,t){return t=t||{},new Promise((function(n,r){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}};for(var c in i.open(t.method||"get",e,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){o.push(t=t.toLowerCase()),s.push([t,n]),a[t]=a[t]?a[t]+","+n:n})),n(u())},i.onerror=r,i.withCredentials="include"==t.credentials,t.headers)i.setRequestHeader(c,t.headers[c]);i.send(t.body||null)}))}},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var u,c=[],f=!1,l=-1;function d(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&h())}function h(){if(!f){var e=a(d);f=!0;for(var t=c.length;t;){for(u=c,c=[];++l<t;)u&&u[l].run();l=-1,t=c.length}u=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||f||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},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(60),i=n(61),o=n(46),s=n(44),a=function(){function e(e){e?(this.operation=function(e){return new Promise((function(t,n){var r=s.locateWindow().msCrypto.subtle.importKey("raw",u(e),i.SHA_256_HMAC_ALGO,!1,["sign"]);r.oncomplete=function(){r.result&&t(r.result),n("ImportKey completed without importing key.")},r.onerror=function(){n("ImportKey failed to import key.")}}))}(e).then((function(e){return s.locateWindow().msCrypto.subtle.sign(i.SHA_256_HMAC_ALGO,e)})),this.operation.catch((function(){}))):this.operation=Promise.resolve(s.locateWindow().msCrypto.subtle.digest("SHA-256"))}return e.prototype.update=function(e){var t=this;r.isEmptyData(e)||(this.operation=this.operation.then((function(n){return n.onerror=function(){t.operation=Promise.reject(new Error("Error encountered updating hash"))},n.process(u(e)),n})),this.operation.catch((function(){})))},e.prototype.digest=function(){return this.operation.then((function(e){return new Promise((function(t,n){e.onerror=function(){n("Error encountered finalizing hash")},e.oncomplete=function(){e.result&&t(new Uint8Array(e.result)),n("Error encountered finalizing hash")},e.finish()}))}))},e}();function u(e){return"string"==typeof e?o.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEmptyData=void 0,t.isEmptyData=function(e){return"string"==typeof e?0===e.length:0===e.byteLength}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EMPTY_DATA_SHA_256=t.SHA_256_HMAC_ALGO=t.SHA_256_HASH=void 0,t.SHA_256_HASH={name:"SHA-256"},t.SHA_256_HMAC_ALGO={name:"HMAC",hash:t.SHA_256_HASH},t.EMPTY_DATA_SHA_256=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(46),i=n(60),o=n(61),s=n(44),a=function(){function e(e){this.toHash=new Uint8Array(0),void 0!==e&&(this.key=new Promise((function(t,n){s.locateWindow().crypto.subtle.importKey("raw",u(e),o.SHA_256_HMAC_ALGO,!1,["sign"]).then(t,n)})),this.key.catch((function(){})))}return e.prototype.update=function(e){if(!i.isEmptyData(e)){var t=u(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},e.prototype.digest=function(){var e=this;return this.key?this.key.then((function(t){return s.locateWindow().crypto.subtle.sign(o.SHA_256_HMAC_ALGO,t,e.toHash).then((function(e){return new Uint8Array(e)}))})):i.isEmptyData(this.toHash)?Promise.resolve(o.EMPTY_DATA_SHA_256):Promise.resolve().then((function(){return s.locateWindow().crypto.subtle.digest(o.SHA_256_HASH,e.toHash)})).then((function(e){return Promise.resolve(new Uint8Array(e))}))},e}();function u(e){return"string"==typeof e?r.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HASHABLE_LENGTH=t.INIT=t.KEY=t.DIGEST_LENGTH=t.BLOCK_SIZE=void 0,t.BLOCK_SIZE=64,t.DIGEST_LENGTH=32,t.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),t.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],t.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(8);function i(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(8),i=n(125),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var a,u={adapter:((void 0!==t&&"[object process]"===Object.prototype.toString.call(t)||"undefined"!=typeof XMLHttpRequest)&&(a=n(68)),a),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(o)})),e.exports=u}).call(this,n(56))},function(e,t,n){"use strict";var r=n(8),i=n(126),o=n(65),s=n(128),a=n(129),u=n(69);e.exports=function(e){return new Promise((function(t,c){var f=e.data,l=e.headers;r.isFormData(f)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",p=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+p)}if(d.open(e.method.toUpperCase(),o(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?s(d.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};i(t,c,r),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=n(130),v=(e.withCredentials||a(e.url))&&e.xsrfCookieName?g.read(e.xsrfCookieName):void 0;v&&(l[e.xsrfHeaderName]=v)}if("setRequestHeader"in d&&r.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),c(e),d=null)})),void 0===f&&(f=null),d.send(f)}))}},function(e,t,n){"use strict";var r=n(127);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],(function(e){void 0!==t[e]&&(n[e]=t[e])})),r.forEach(["headers","auth","proxy"],(function(i){r.isObject(t[i])?n[i]=r.deepMerge(e[i],t[i]):void 0!==t[i]?n[i]=t[i]:r.isObject(e[i])?n[i]=r.deepMerge(e[i]):void 0!==e[i]&&(n[i]=e[i])})),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},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=0)}([function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1)),r(n(2)),r(n(3)),r(n(4)),r(n(5)),r(n(6)),r(n(7)),r(n(8)),r(n(9)),r(n(10)),r(n(11)),r(n(12)),r(n(13))},function(e,t,n){e.exports={a:"Anchor__a___1_Iz8"}},function(e,t,n){e.exports={button:"Button__button___vS7Mv",signInButton:"Button__signInButton___3bUH-",googleSignInButton:"Button__googleSignInButton___1YiCu",signInButtonIcon:"Button__signInButtonIcon___ihN75",auth0SignInButton:"Button__auth0SignInButton___znnCj",facebookSignInButton:"Button__facebookSignInButton___34Txh",amazonSignInButton:"Button__amazonSignInButton___2EMtl",oAuthSignInButton:"Button__oAuthSignInButton___3UGOl",signInButtonContent:"Button__signInButtonContent___xqTXJ"}},function(e,t,n){e.exports={formContainer:"Form__formContainer___1GA3x",formSection:"Form__formSection___1PPvW",formField:"Form__formField___38Ikl",formRow:"Form__formRow___2mwRs"}},function(e,t,n){e.exports={hint:"Hint__hint___2XngB"}},function(e,t,n){e.exports={input:"Input__input___3e_bf",inputLabel:"Input__inputLabel___3VF0S",label:"Input__label___23sO8",radio:"Input__radio___2hllK"}},function(e,t,n){e.exports={navBar:"Nav__navBar___xtCFA",navRight:"Nav__navRight___1QG2J",nav:"Nav__nav___2Dx2Y",navItem:"Nav__navItem___1LtFQ"}},function(e,t,n){e.exports={photoPickerButton:"PhotoPicker__photoPickerButton___2XdVn",photoPlaceholder:"PhotoPicker__photoPlaceholder___2JXO4",photoPlaceholderIcon:"PhotoPicker__photoPlaceholderIcon___3Et71"}},function(e,t,n){e.exports={container:"Section__container___3YYTG",actionRow:"Section__actionRow___2LWSU",sectionHeader:"Section__sectionHeader___2djyg",sectionHeaderHint:"Section__sectionHeaderHint___3Wxdc",sectionBody:"Section__sectionBody___ihqqd",sectionHeaderContent:"Section__sectionHeaderContent___1UCqa",sectionFooter:"Section__sectionFooter___1T54C",sectionFooterPrimaryContent:"Section__sectionFooterPrimaryContent___2r9ZX",sectionFooterSecondaryContent:"Section__sectionFooterSecondaryContent___Nj41Q"}},function(e,t,n){e.exports={selectInput:"SelectInput__selectInput___3efO4"}},function(e,t,n){e.exports={strike:"Strike__strike___1XV1b",strikeContent:"Strike__strikeContent___10gLb"}},function(e,t,n){e.exports={toast:"Toast__toast___XXr3v",toastClose:"Toast__toastClose___18lU4"}},function(e,t,n){e.exports={totpQrcode:"Totp__totpQrcode___1crLx"}},function(e,t,n){e.exports={sumerianSceneContainer:"XR__sumerianSceneContainer___3nVMt",sumerianScene:"XR__sumerianScene___2Tt7-",loadingOverlay:"XR__loadingOverlay___IbqcI",loadingContainer:"XR__loadingContainer___2Itxb",loadingLogo:"XR__loadingLogo___Ub7xQ",loadingSceneName:"XR__loadingSceneName___3__ne",loadingBar:"XR__loadingBar___2vcke",loadingBarFill:"XR__loadingBarFill___3M-D9",sceneErrorText:"XR__sceneErrorText___2y0tp",sceneBar:"XR__sceneBar___2ShrP",sceneName:"XR__sceneName___1ApHr",sceneActions:"XR__sceneActions___7plGs",actionButton:"XR__actionButton___2poIM",tooltip:"XR__tooltip___UYyhn",actionIcon:"XR__actionIcon___2qnd2",autoShowTooltip:"XR__autoShowTooltip___V1QH7"}}])},function(e,t,n){"use strict";var r=n(10),i=n(78),o=n(49),s=n(33);n(45),n(72);r.a.Auth=o.a,r.a.Cache=s.a,r.a.ServiceWorker=i.a,t.default=r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r={},i=function(){function e(){}return e.setItem=function(e,t){return r[e]=t,r[e]},e.getItem=function(e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0},e.removeItem=function(e){return delete r[e]},e.clear=function(){return r={}},e}(),o=function(){function e(){try{this.storageWindow=window.localStorage,this.storageWindow.setItem("aws.amplify.test-ls",1),this.storageWindow.removeItem("aws.amplify.test-ls")}catch(e){this.storageWindow=i}}return e.prototype.getStorage=function(){return this.storageWindow},e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(18),i=function(){return(i=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)},o=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},s=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e},a=new r.a("Hub"),u="undefined"!=typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("amplify_default"):"@@amplify_default";var c=new(function(){function e(e){this.listeners=[],this.patterns=[],this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","xr"],this.name=e}return e.prototype.remove=function(e,t){if(e instanceof RegExp){var n=this.patterns.find((function(t){return t.pattern.source===e.source}));if(!n)return void a.warn("No listeners for "+e);this.patterns=s(this.patterns.filter((function(e){return e!==n})))}else{var r=this.listeners[e];if(!r)return void a.warn("No listeners for "+e);this.listeners[e]=s(r.filter((function(e){return e.callback!==t})))}},e.prototype.dispatch=function(e,t,n,r){(void 0===n&&(n=""),this.protectedChannels.indexOf(e)>-1)&&(r===u||a.warn("WARNING: "+e+" is protected and dispatching on it can have unintended consequences"));var o={channel:e,payload:i({},t),source:n,patternInfo:[]};try{this._toListeners(o)}catch(e){a.error(e)}},e.prototype.listen=function(e,t,n){var r,i=this;if(void 0===n&&(n="noname"),function(e){return void 0!==e.onHubCapsule}(t))a.warn("WARNING onHubCapsule is Deprecated. Please pass in a callback."),r=t.onHubCapsule.bind(t);else{if("function"!=typeof t)throw new Error("No callback supplied to Hub");r=t}if(e instanceof RegExp)this.patterns.push({pattern:e,callback:r});else{var o=this.listeners[e];o||(o=[],this.listeners[e]=o),o.push({name:n,callback:r})}return function(){i.remove(e,r)}},e.prototype._toListeners=function(e){var t=e.channel,n=e.payload,r=this.listeners[t];if(r&&r.forEach((function(r){a.debug("Dispatching to "+t+" with ",n);try{r.callback(e)}catch(e){a.error(e)}})),this.patterns.length>0){if(!n.message)return void a.warn("Cannot perform pattern matching without a message key");var s=n.message;this.patterns.forEach((function(t){var n=s.match(t.pattern);if(n){var r=o(n).slice(1),u=i(i({},e),{patternInfo:r});try{t.callback(u)}catch(e){a.error(e)}}}))}},e}())("__default__")},function(e,t,n){var r=n(99),i=n(100),o=i;o.v1=r,o.v4=i,e.exports=o},function(e,t,n){"use strict";function r(e){return"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(18),i=n(9),o=n(10),s=function(){function e(){this._logger=new r.a("ServiceWorker")}return Object.defineProperty(e.prototype,"serviceWorker",{get:function(){return this._serviceWorker},enumerable:!0,configurable:!0}),e.prototype.register=function(e,t){var n=this;return void 0===e&&(e="/service-worker.js"),void 0===t&&(t="/"),this._logger.debug("registering "+e),this._logger.debug("registering service worker with scope "+t),new Promise((function(r,i){if(!navigator||!("serviceWorker"in navigator))return i(new Error("Service Worker not available"));navigator.serviceWorker.register(e,{scope:t}).then((function(e){return e.installing?n._serviceWorker=e.installing:e.waiting?n._serviceWorker=e.waiting:e.active&&(n._serviceWorker=e.active),n._registration=e,n._setupListeners(),n._logger.debug("Service Worker Registration Success: "+e),r(e)})).catch((function(e){return n._logger.debug("Service Worker Registration Failed "+e),i(e)}))}))},e.prototype.enablePush=function(e){var t=this;if(!this._registration)throw new Error("Service Worker not registered");return this._publicKey=e,new Promise((function(n,r){if(!Object(i.b)().isBrowser)return r(new Error("Service Worker not available"));t._registration.pushManager.getSubscription().then((function(r){if(!r)return t._logger.debug("User is NOT subscribed to push"),t._registration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:t._urlB64ToUint8Array(e)}).then((function(e){t._subscription=e,t._logger.debug("User subscribed: "+JSON.stringify(e)),n(e)})).catch((function(e){t._logger.error(e)}));t._subscription=r,t._logger.debug("User is subscribed to push: "+JSON.stringify(r)),n(r)}))}))},e.prototype._urlB64ToUint8Array=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),n=window.atob(t),r=new Uint8Array(n.length),i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r},e.prototype.send=function(e){this._serviceWorker&&this._serviceWorker.postMessage("object"==typeof e?JSON.stringify(e):e)},e.prototype._setupListeners=function(){var e=this;this._serviceWorker.addEventListener("statechange",(function(t){var n=e._serviceWorker.state;e._logger.debug("ServiceWorker statechange: "+n),o.a.Analytics&&"function"==typeof o.a.Analytics.record&&o.a.Analytics.record({name:"ServiceWorker",attributes:{state:n}})})),this._serviceWorker.addEventListener("message",(function(t){e._logger.debug("ServiceWorker message event: "+t)}))},e}()},function(e,t,n){"use strict";const r=n(113),i=n(32),o=n(32),s=n(13).buildOptions,a=n(115);t.parse=function(e,t,n){if(n){!0===n&&(n={});const t=a.validate(e,n);if(!0!==t)throw Error(t.err.msg)}t=s(t,o.defaultOptions,o.props);const u=i.getTraversalObj(e,t);return r.convertToJson(u,t)},t.convertTonimn=n(116).convert2nimn,t.getTraversalObj=i.getTraversalObj,t.convertToJson=r.convertToJson,t.convertToJsonString=n(117).convertToJsonString,t.validate=a.validate,t.j2xParser=n(118),t.parseToNimn=function(e,n,r){return t.convertTonimn(t.getTraversalObj(e,r),n,r)}},function(e,t,n){e.exports=n(119)},,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(73),i=n(49),o=n(75);window.Amplify=r.default,window.Auth=i.a,window.Hub=o.a},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){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.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,h=e[t+l];for(l+=d,o=h&(1<<-f)-1,h>>=-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*(h?-1:1);s+=Math.pow(2,r),o-=c}return(h?-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,h=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(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+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[n+h]=255&s,h+=p,s/=256,c-=8);e[n+h-p]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r,i,o,s;e.exports=(r=n(5),o=(i=r).lib.Base,s=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,u=o.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;i.sigBytes=o.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))},function(e,t,n){e.exports=self.fetch||(self.fetch=n(55).default||n(55))},function(e,t,n){(function(e,r){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=/^xn--/,f=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,p=String.fromCharCode;function g(e){throw RangeError(d[e])}function v(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function y(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+v((e=e.replace(l,".")).split("."),t).join(".")}function m(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function b(e){return v(e,(function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=p(e)})).join("")}function S(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,n){var r=0;for(e=n?h(e/700):e>>1,e+=h(e/t);e>455;r+=36)e=h(e/35);return h(r+36*e/(e+38))}function _(e){var t,n,r,i,o,s,a,c,f,l,d,p=[],v=e.length,y=0,m=128,S=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&g("not-basic"),p.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=y,s=1,a=36;i>=v&&g("invalid-input"),((c=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||c>h((u-y)/s))&&g("overflow"),y+=c*s,!(c<(f=a<=S?1:a>=S+26?26:a-S));a+=36)s>h(u/(l=36-f))&&g("overflow"),s*=l;S=w(y-o,t=p.length+1,0==o),h(y/t)>u-m&&g("overflow"),m+=h(y/t),y%=t,p.splice(y++,0,m)}return b(p)}function O(e){var t,n,r,i,o,s,a,c,f,l,d,v,y,b,_,O=[];for(v=(e=m(e)).length,t=128,n=0,o=72,s=0;s<v;++s)(d=e[s])<128&&O.push(p(d));for(r=i=O.length,i&&O.push("-");r<v;){for(a=u,s=0;s<v;++s)(d=e[s])>=t&&d<a&&(a=d);for(a-t>h((u-n)/(y=r+1))&&g("overflow"),n+=(a-t)*y,t=a,s=0;s<v;++s)if((d=e[s])<t&&++n>u&&g("overflow"),d==t){for(c=n,f=36;!(c<(l=f<=o?1:f>=o+26?26:f-o));f+=36)_=c-l,b=36-l,O.push(p(S(l+_%b,0))),c=h(_/b);O.push(p(S(c,0))),o=w(n,y,r==i),n=0,++r}++n,++t}return O.join("")}a={version:"1.3.2",ucs2:{decode:m,encode:b},decode:_,encode:O,toASCII:function(e){return y(e,(function(e){return f.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return y(e,(function(e){return c.test(e)?_(e.slice(4).toLowerCase()):e}))}},void 0===(i=function(){return a}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(94)(e),n(53))},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){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,n){"use strict";t.decode=t.parse=n(97),t.encode=t.stringify=n(98)},function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,n,o){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var f=0;f<c;++f){var l,d,h,p,g=e[f].replace(a,"%20"),v=g.indexOf(n);v>=0?(l=g.substr(0,v),d=g.substr(v+1)):(l=g,d=""),h=decodeURIComponent(l),p=decodeURIComponent(d),r(s,h)?i(s[h])?s[h].push(p):s[h]=[s[h],p]:s[h]=p}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),(function(s){var a=encodeURIComponent(r(s))+n;return i(e[s])?o(e[s],(function(e){return a+encodeURIComponent(r(e))})).join(t):a+encodeURIComponent(r(e[s]))})).join(t):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var s=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},function(e,t,n){var r,i,o=n(57),s=n(58),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 h=o();null==l&&(l=r=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==d&&(d=i=16383&(h[6]<<8|h[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:u+1,v=p-a+(g-u)/1e4;if(v<0&&void 0===e.clockseq&&(d=d+1&16383),(v<0||p>a)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=p,u=g,i=d;var y=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;f[c++]=y>>>24&255,f[c++]=y>>>16&255,f[c++]=y>>>8&255,f[c++]=255&y;var m=p/4294967296*1e4&268435455;f[c++]=m>>>8&255,f[c++]=255&m,f[c++]=m>>>24&15|16,f[c++]=m>>>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(57),i=n(58);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(59),i=n(62),o=n(102),s=n(105),a=n(107),u=n(44),c=function(){function e(e){s.supportsWebCrypto(u.locateWindow())?this.hash=new i.Sha256(e):a.isMsWindow(u.locateWindow())?this.hash=new r.Sha256(e):this.hash=new o.Sha256(e)}return e.prototype.update=function(e,t){this.hash.update(e,t)},e.prototype.digest=function(){return this.hash.digest()},e}();t.Sha256=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1).__exportStar(n(103),t)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sha256=void 0;var r=n(1),i=n(63),o=n(104),s=n(46),a=function(){function e(e){if(this.hash=new o.RawSha256,e){this.outer=new o.RawSha256;var t=function(e){var t=u(e);if(t.byteLength>i.BLOCK_SIZE){var n=new o.RawSha256;n.update(t),t=n.digest()}var r=new Uint8Array(i.BLOCK_SIZE);return r.set(t),r}(e),n=new Uint8Array(i.BLOCK_SIZE);n.set(t);for(var r=0;r<i.BLOCK_SIZE;r++)t[r]^=54,n[r]^=92;this.hash.update(t),this.outer.update(n);for(r=0;r<t.byteLength;r++)t[r]=0}}return e.prototype.update=function(e){if(!function(e){if("string"==typeof e)return 0===e.length;return 0===e.byteLength}(e)&&!this.error)try{this.hash.update(u(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return r.__awaiter(this,void 0,void 0,(function(){return r.__generator(this,(function(e){return[2,this.digestSync()]}))}))},e}();function u(e){return"string"==typeof e?s.fromUtf8(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}t.Sha256=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawSha256=void 0;var r=n(63),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],h=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,p=((d=this.temp[l-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(p+this.temp[l-16]|0)}var g=(((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,v=((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+g|0,s=o,o=i,i=n,n=g+v|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(1).__exportStar(n(106),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(1),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(1);r.__exportStar(n(108),t),r.__exportStar(n(109),t),r.__exportStar(n(110),t),r.__exportStar(n(111),t),r.__exportStar(n(112),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";const r=n(13),i=function(e,t){const n={};if(!(e.child&&!r.isEmptyObject(e.child)||e.attrsMap&&!r.isEmptyObject(e.attrsMap)))return r.isExist(e.val)?e.val:"";r.isExist(e.val)&&("string"!=typeof e.val||""!==e.val&&e.val!==t.cdataPositionChar)&&("strict"===t.arrayMode?n[t.textNodeName]=[e.val]:n[t.textNodeName]=e.val),r.merge(n,e.attrsMap,t.arrayMode);const o=Object.keys(e.child);for(let r=0;r<o.length;r++){var s=o[r];if(e.child[s]&&e.child[s].length>1)for(var a in n[s]=[],e.child[s])n[s].push(i(e.child[s][a],t));else if(!0===t.arrayMode){const r=i(e.child[s][0],t);n[s]="object"==typeof r?[r]:r}else"strict"===t.arrayMode?n[s]=[i(e.child[s][0],t)]:n[s]=i(e.child[s][0],t)}return n};t.convertToJson=i},function(e,t,n){"use strict";e.exports=function(e,t,n){this.tagname=e,this.parent=t,this.child={},this.attrsMap={},this.val=n,this.addChild=function(e){Array.isArray(this.child[e.tagname])?this.child[e.tagname].push(e):this.child[e.tagname]=[e]}}},function(e,t,n){"use strict";const r=n(13),i={allowBooleanAttributes:!1},o=["allowBooleanAttributes"];function s(e,t){for(var n=t;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{var r=e.substr(n,t-n);if(t>5&&"xml"===r)return d("InvalidXml","XML declaration allowed only at the start of the document.",p(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=r.buildOptions(t,i,o);const n=[];let c=!1,h=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let i=0;i<e.length;i++){if("<"!==e[i]){if(" "===e[i]||"\t"===e[i]||"\n"===e[i]||"\r"===e[i])continue;return d("InvalidChar","char '"+e[i]+"' is not expected.",p(e,i))}if(i++,"?"===e[i]){if(i=s(e,++i),i.err)return i}else{if("!"===e[i]){i=a(e,i);continue}{let o=!1;"/"===e[i]&&(o=!0,i++);let s="";for(;i<e.length&&">"!==e[i]&&" "!==e[i]&&"\t"!==e[i]&&"\n"!==e[i]&&"\r"!==e[i];i++)s+=e[i];if(s=s.trim(),"/"===s[s.length-1]&&(s=s.substring(0,s.length-1),i--),g=s,!r.isName(g)){let t;return t=0===s.trim().length?"There is an unnecessary space between tag name and backward slash '</ ..'.":"Tag '"+s+"' is an invalid name.",d("InvalidTag",t,p(e,i))}const v=u(e,i);if(!1===v)return d("InvalidAttr","Attributes for '"+s+"' have open quote.",p(e,i));let y=v.value;if(i=v.index,"/"===y[y.length-1]){y=y.substring(0,y.length-1);const n=f(y,t);if(!0!==n)return d(n.err.code,n.err.msg,p(e,i-y.length+n.err.line));c=!0}else if(o){if(!v.tagClosed)return d("InvalidTag","Closing tag '"+s+"' doesn't have proper closing.",p(e,i));if(y.trim().length>0)return d("InvalidTag","Closing tag '"+s+"' can't have attributes or invalid starting.",p(e,i));{const t=n.pop();if(s!==t)return d("InvalidTag","Closing tag '"+t+"' is expected inplace of '"+s+"'.",p(e,i));0==n.length&&(h=!0)}}else{const r=f(y,t);if(!0!==r)return d(r.err.code,r.err.msg,p(e,i-y.length+r.err.line));if(!0===h)return d("InvalidXml","Multiple possible root nodes found.",p(e,i));n.push(s),c=!0}for(i++;i<e.length;i++){if("<"===e[i]){if("!"===e[i+1]){i++,i=a(e,i);continue}break}if("&"===e[i]){const t=l(e,i);if(-1==t)return d("InvalidChar","char '&' is not expected.",p(e,i));i=t}}"<"===e[i]&&i--}}}var g;return c?!(n.length>0)||d("InvalidXml","Invalid '"+JSON.stringify(n,null,4).replace(/\r?\n/g,"")+"' found.",1):d("InvalidXml","Start tag expected.",1)};function u(e,t){let n="",r="",i=!1;for(;t<e.length;t++){if('"'===e[t]||"'"===e[t])if(""===r)r=e[t];else{if(r!==e[t])continue;r=""}else if(">"===e[t]&&""===r){i=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:i}}const c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function f(e,t){const n=r.getAllMatches(e,c),i={};for(let r=0;r<n.length;r++){if(0===n[r][1].length)return d("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",g(e,n[r][0]));if(void 0===n[r][3]&&!t.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",g(e,n[r][0]));const o=n[r][2];if(!h(o))return d("InvalidAttr","Attribute '"+o+"' is an invalid name.",g(e,n[r][0]));if(i.hasOwnProperty(o))return d("InvalidAttr","Attribute '"+o+"' is repeated.",g(e,n[r][0]));i[o]=1}return!0}function l(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function d(e,t,n){return{err:{code:e,msg:t,line:n}}}function h(e){return r.isName(e)}function p(e,t){return e.substring(0,t).split(/\r?\n/).length}function g(e,t){return e.indexOf(t)+t.length}},function(e,t,n){"use strict";const r=function(e){return String.fromCharCode(e)},i={nilChar:r(176),missingChar:r(201),nilPremitive:r(175),missingPremitive:r(200),emptyChar:r(178),emptyValue:r(177),boundryChar:r(179),objStart:r(198),arrStart:r(204),arrayEnd:r(185)},o=[i.nilChar,i.nilPremitive,i.missingChar,i.missingPremitive,i.boundryChar,i.emptyChar,i.emptyValue,i.arrayEnd,i.objStart,i.arrStart],s=function(e,t,n){if("string"==typeof t)return e&&e[0]&&void 0!==e[0].val?a(e[0].val,t):a(e,t);{const o=void 0===(r=e)?i.missingChar:null===r?i.nilChar:!(r.child&&0===Object.keys(r.child).length&&(!r.attrsMap||0===Object.keys(r.attrsMap).length))||i.emptyChar;if(!0===o){let r="";if(Array.isArray(t)){r+=i.arrStart;const o=t[0],c=e.length;if("string"==typeof o)for(let t=0;t<c;t++){const n=a(e[t].val,o);r=u(r,n)}else for(let t=0;t<c;t++){const i=s(e[t],o,n);r=u(r,i)}r+=i.arrayEnd}else{r+=i.objStart;const o=Object.keys(t);Array.isArray(e)&&(e=e[0]);for(let i in o){const a=o[i];let c;c=!n.ignoreAttributes&&e.attrsMap&&e.attrsMap[a]?s(e.attrsMap[a],t[a],n):a===n.textNodeName?s(e.val,t[a],n):s(e.child[a],t[a],n),r=u(r,c)}}return r}return o}var r},a=function(e){switch(e){case void 0:return i.missingPremitive;case null:return i.nilPremitive;case"":return i.emptyValue;default:return e}},u=function(e,t){return c(t[0])||c(e[e.length-1])||(e+=i.boundryChar),e+t},c=function(e){return-1!==o.indexOf(e)};const f=n(32),l=n(13).buildOptions;t.convert2nimn=function(e,t,n){return n=l(n,f.defaultOptions,f.props),s(e,t,n)}},function(e,t,n){"use strict";const r=n(13),i=n(13).buildOptions,o=n(32),s=function(e,t,n){let i="{";const o=Object.keys(e.child);for(let n=0;n<o.length;n++){var a=o[n];if(e.child[a]&&e.child[a].length>1){for(var u in i+='"'+a+'" : [ ',e.child[a])i+=s(e.child[a][u],t)+" , ";i=i.substr(0,i.length-1)+" ] "}else i+='"'+a+'" : '+s(e.child[a][0],t)+" ,"}return r.merge(i,e.attrsMap),r.isEmptyObject(i)?r.isExist(e.val)?e.val:"":(r.isExist(e.val)&&("string"!=typeof e.val||""!==e.val&&e.val!==t.cdataPositionChar)&&(i+='"'+t.textNodeName+'" : '+(!0!==(c=e.val)&&!1!==c&&isNaN(c)?'"'+c+'"':c)),","===i[i.length-1]&&(i=i.substr(0,i.length-2)),i+"}");var c};t.convertToJsonString=function(e,t){return(t=i(t,o.defaultOptions,o.props)).indentBy=t.indentBy||"",s(e,t,0)}},function(e,t,n){"use strict";const r=n(13).buildOptions,i={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataTagName:!1,cdataPositionChar:"\\c",format:!1,indentBy:"  ",supressEmptyNode:!1,tagValueProcessor:function(e){return e},attrValueProcessor:function(e){return e}},o=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","cdataTagName","cdataPositionChar","format","indentBy","supressEmptyNode","tagValueProcessor","attrValueProcessor"];function s(e){this.options=r(e,i,o),this.options.ignoreAttributes||this.options.attrNodeName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=p),this.options.cdataTagName?this.isCDATA=g:this.isCDATA=function(){return!1},this.replaceCDATAstr=a,this.replaceCDATAarr=u,this.options.format?(this.indentate=h,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=d,this.buildObjNode=f):(this.buildTextNode=l,this.buildObjNode=c),this.buildTextValNode=l,this.buildObjectNode=c}function a(e,t){return e=this.options.tagValueProcessor(""+e),""===this.options.cdataPositionChar||""===e?e+"<![CDATA["+t+"]]"+this.tagEndChar:e.replace(this.options.cdataPositionChar,"<![CDATA["+t+"]]"+this.tagEndChar)}function u(e,t){if(e=this.options.tagValueProcessor(""+e),""===this.options.cdataPositionChar||""===e)return e+"<![CDATA["+t.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(let n in t)e=e.replace(this.options.cdataPositionChar,"<![CDATA["+t[n]+"]]>");return e+this.newLine}function c(e,t,n,r){return n&&!e.includes("<")?this.indentate(r)+"<"+t+n+">"+e+"</"+t+this.tagEndChar:this.indentate(r)+"<"+t+n+this.tagEndChar+e+this.indentate(r)+"</"+t+this.tagEndChar}function f(e,t,n,r){return""!==e?this.buildObjectNode(e,t,n,r):this.indentate(r)+"<"+t+n+"/"+this.tagEndChar}function l(e,t,n,r){return this.indentate(r)+"<"+t+n+">"+this.options.tagValueProcessor(e)+"</"+t+this.tagEndChar}function d(e,t,n,r){return""!==e?this.buildTextValNode(e,t,n,r):this.indentate(r)+"<"+t+n+"/"+this.tagEndChar}function h(e){return this.options.indentBy.repeat(e)}function p(e){return!!e.startsWith(this.options.attributeNamePrefix)&&e.substr(this.attrPrefixLen)}function g(e){return e===this.options.cdataTagName}s.prototype.parse=function(e){return this.j2x(e,0).val},s.prototype.j2x=function(e,t){let n="",r="";const i=Object.keys(e),o=i.length;for(let s=0;s<o;s++){const o=i[s];if(void 0===e[o]);else if(null===e[o])r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)r+=this.buildTextNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);i?n+=" "+i+'="'+this.options.attrValueProcessor(""+e[o])+'"':this.isCDATA(o)?e[this.options.textNodeName]?r+=this.replaceCDATAstr(e[this.options.textNodeName],e[o]):r+=this.replaceCDATAstr("",e[o]):o===this.options.textNodeName?e[this.options.cdataTagName]||(r+=this.options.tagValueProcessor(""+e[o])):r+=this.buildTextNode(e[o],o,"",t)}else if(Array.isArray(e[o]))if(this.isCDATA(o))r+=this.indentate(t),e[this.options.textNodeName]?r+=this.replaceCDATAarr(e[this.options.textNodeName],e[o]):r+=this.replaceCDATAarr("",e[o]);else{const n=e[o].length;for(let i=0;i<n;i++){const n=e[o][i];if(void 0===n);else if(null===n)r+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof n){const e=this.j2x(n,t+1);r+=this.buildObjNode(e.val,o,e.attrStr,t)}else r+=this.buildTextNode(n,o,"",t)}}else if(this.options.attrNodeName&&o===this.options.attrNodeName){const t=Object.keys(e[o]),r=t.length;for(let i=0;i<r;i++)n+=" "+t[i]+'="'+this.options.attrValueProcessor(""+e[o][t[i]])+'"'}else{const n=this.j2x(e[o],t+1);r+=this.buildObjNode(n.val,o,n.attrStr,t)}}return{attrStr:n,val:r}},e.exports=s},function(e,t,n){"use strict";var r=n(8),i=n(64),o=n(121),s=n(70);function a(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var u=a(n(67));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=n(71),u.CancelToken=n(133),u.isCancel=n(66),u.all=function(e){return Promise.all(e)},u.spread=n(134),e.exports=u,e.exports.default=u},function(e,t){
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";var r=n(8),i=n(65),o=n(122),s=n(123),a=n(70);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method=e.method?e.method.toLowerCase():"get";var t=[s,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},u.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,n){return this.request(r.merge(n||{},{method:e,url:t}))}})),r.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,n,i){return this.request(r.merge(i||{},{method:e,url:t,data:n}))}})),e.exports=u},function(e,t,n){"use strict";var r=n(8);function i(){this.handlers=[]}i.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},function(e,t,n){"use strict";var r=n(8),i=n(124),o=n(66),s=n(67),a=n(131),u=n(132);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.baseURL&&!a(e.url)&&(e.url=u(e.baseURL,e.url)),e.headers=e.headers||{},e.data=i(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return c(e),t.data=i(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(c(e),t&&t.response&&(t.response.data=i(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(8);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(69);e.exports=function(e,t,n){var i=n.config.validateStatus;!i||i(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(8),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,s={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},function(e,t,n){"use strict";var r=n(8);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(8);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(71);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=new(n(18).a)("Parser"),i=function(e){var t,n={};if(e.aws_mobile_analytics_app_id){var i={AWSPinpoint:{appId:e.aws_mobile_analytics_app_id,region:e.aws_mobile_analytics_app_region}};n.Analytics=i}return(e.aws_cognito_identity_pool_id||e.aws_user_pools_id)&&(n.Auth={userPoolId:e.aws_user_pools_id,userPoolWebClientId:e.aws_user_pools_web_client_id,region:e.aws_cognito_region,identityPoolId:e.aws_cognito_identity_pool_id,identityPoolRegion:e.aws_cognito_region,mandatorySignIn:"enable"===e.aws_mandatory_sign_in}),t=e.aws_user_files_s3_bucket?{AWSS3:{bucket:e.aws_user_files_s3_bucket,region:e.aws_user_files_s3_bucket_region,dangerouslyConnectToHttpEndpointForTesting:e.aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing}}:e?e.Storage||e:{},n.Analytics=Object.assign({},n.Analytics,e.Analytics),n.Auth=Object.assign({},n.Auth,e.Auth),n.Storage=Object.assign({},t),r.debug("parse config",e,"to amplifyconfig",n),n},o=function(){function e(){}return e.parseMobilehubConfig=i,e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return Qn}));var r=n(18),i=n(74),o=n(9),s=function(){var e=function(t,n){return(e=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])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),a=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())}))},u=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])}}},c=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},f=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(c(arguments[t]));return e},l=new r.a("Util"),d=function(e){function t(t){var n=e.call(this,t)||this;return n.nonRetryable=!0,n}return s(t,e),t}(Error);var h=function(e,t,n){return void 0===n&&(n=3e5),function e(t,n,r,i){return void 0===i&&(i=1),a(this,void 0,void 0,(function(){var o,s;return u(this,(function(a){switch(a.label){case 0:if("function"!=typeof t)throw Error("functionToRetry must be a function");l.debug(t.name+" attempt #"+i+" with this vars: "+JSON.stringify(n)),a.label=1;case 1:return a.trys.push([1,3,,8]),[4,t.apply(void 0,f(n))];case 2:return[2,a.sent()];case 3:if(o=a.sent(),l.debug("error on "+t.name,o),(u=o)&&u.nonRetryable)throw l.debug(t.name+" non retryable error",o),o;return s=r(i,n,o),l.debug(t.name+" retrying in "+s+" ms"),!1===s?[3,6]:[4,new Promise((function(e){return setTimeout(e,s)}))];case 4:return a.sent(),[4,e(t,n,r,i+1)];case 5:return[2,a.sent()];case 6:throw o;case 7:return[3,8];case 8:return[2]}var u}))}))}(e,t,function(e){return function(t){var n=100*Math.pow(2,t)+100*Math.random();return!(n>e)&&n}}(n))},p=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())}))},g=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])}}},v=new r.a("CognitoCredentials"),y=new Promise((function(e,t){return Object(o.b)().isBrowser?(window.gapi&&window.gapi.auth2?window.gapi.auth2:null)?(v.debug("google api already loaded"),e()):void setTimeout((function(){return e()}),2e3):(v.debug("not in the browser, directly resolved"),e())})),m=function(){function e(){this.initialized=!1,this.refreshGoogleToken=this.refreshGoogleToken.bind(this),this._refreshGoogleTokenImpl=this._refreshGoogleTokenImpl.bind(this)}return e.prototype.refreshGoogleToken=function(){return p(this,void 0,void 0,(function(){return g(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(v.debug("need to wait for the Google SDK loaded"),[4,y]);case 1:e.sent(),this.initialized=!0,v.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshGoogleTokenImpl()]}}))}))},e.prototype._refreshGoogleTokenImpl=function(){var e=null;return Object(o.b)().isBrowser&&(e=window.gapi&&window.gapi.auth2?window.gapi.auth2:null),e?new Promise((function(t,n){e.getAuthInstance().then((function(e){e||(v.debug("google Auth undefined"),n(new d("google Auth undefined")));var r=e.currentUser.get();r.isSignedIn()?(v.debug("refreshing the google access token"),r.reloadAuthResponse().then((function(e){var n=e.id_token,r=e.expires_at;t({token:n,expires_at:r})})).catch((function(e){e&&"network_error"===e.error?n("Network error reloading google auth response"):n(new d("Failed to reload google auth response"))}))):n(new d("User is not signed in with Google"))})).catch((function(e){v.debug("Failed to refresh google token",e),n(new d("Failed to refresh google token"))}))})):(v.debug("no gapi auth2 available"),Promise.reject("no gapi auth2 available"))},e}(),b=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())}))},S=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])}}},w=new r.a("CognitoCredentials"),_=new Promise((function(e,t){return Object(o.b)().isBrowser?window.FB?(w.debug("FB SDK already loaded"),e()):void setTimeout((function(){return e()}),2e3):(w.debug("not in the browser, directly resolved"),e())})),O=function(){function e(){this.initialized=!1,this.refreshFacebookToken=this.refreshFacebookToken.bind(this),this._refreshFacebookTokenImpl=this._refreshFacebookTokenImpl.bind(this)}return e.prototype.refreshFacebookToken=function(){return b(this,void 0,void 0,(function(){return S(this,(function(e){switch(e.label){case 0:return this.initialized?[3,2]:(w.debug("need to wait for the Facebook SDK loaded"),[4,_]);case 1:e.sent(),this.initialized=!0,w.debug("finish waiting"),e.label=2;case 2:return[2,this._refreshFacebookTokenImpl()]}}))}))},e.prototype._refreshFacebookTokenImpl=function(){var e=null;if(Object(o.b)().isBrowser&&(e=window.FB),!e){return w.debug("no fb sdk available"),Promise.reject(new d("no fb sdk available"))}return new Promise((function(t,n){e.getLoginStatus((function(e){if(e&&e.authResponse){var r=e.authResponse,i=r.accessToken,o=1e3*r.expiresIn+(new Date).getTime();if(!i){s="the jwtToken is undefined";w.debug(s),n(new d(s))}t({token:i,expires_at:o})}else{var s="no response from facebook when refreshing the jwt token";w.debug(s),n(new d(s))}}),{scope:"public_profile,email"})}))},e}(),C=new m,E=new O,A=n(43),j=n(10),I=n(1),x=function(e,t){return(x=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 P(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var k=function(){return(k=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 T(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 R(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}Object.create;var L,D,M,N,B,F,z,K,q,H,V,G,W,$,Y,J,X,Z,Q,ee,te,ne,re,ie,oe,se,ae,ue,ce,fe,le,de,he,pe,ge,ve,ye,me,be,Se,we,_e,Oe,Ce,Ee,Ae,je,Ie,xe,Pe,ke,Te,Ue,Re,Le,De,Me,Ne,Be,Fe,ze,Ke,qe,He,Ve,Ge,We,$e,Ye,Je,Xe,Ze,Qe,et,tt,nt,rt,it,ot,st,at,ut,ct,ft,lt,dt,ht,pt,gt,vt,yt,mt,bt,St,wt,_t,Ot,Ct,Et,At,jt,It,xt,Pt,kt,Tt,Ut,Rt,Lt,Dt,Mt=n(0);!function(e){e.AUTHENTICATED_ROLE="AuthenticatedRole",e.DENY="Deny"}(L||(L={})),(M=D||(D={})).filterSensitiveLog=function(e){return k({},e)},M.isa=function(e){return Object(Mt.h)(e,"CognitoIdentityProvider")},(B=N||(N={})).filterSensitiveLog=function(e){return k({},e)},B.isa=function(e){return Object(Mt.h)(e,"ConcurrentModificationException")},(z=F||(F={})).filterSensitiveLog=function(e){return k({},e)},z.isa=function(e){return Object(Mt.h)(e,"CreateIdentityPoolInput")},(q=K||(K={})).filterSensitiveLog=function(e){return k({},e)},q.isa=function(e){return Object(Mt.h)(e,"Credentials")},(V=H||(H={})).filterSensitiveLog=function(e){return k({},e)},V.isa=function(e){return Object(Mt.h)(e,"DeleteIdentitiesInput")},(W=G||(G={})).filterSensitiveLog=function(e){return k({},e)},W.isa=function(e){return Object(Mt.h)(e,"DeleteIdentitiesResponse")},(Y=$||($={})).filterSensitiveLog=function(e){return k({},e)},Y.isa=function(e){return Object(Mt.h)(e,"DeleteIdentityPoolInput")},(X=J||(J={})).filterSensitiveLog=function(e){return k({},e)},X.isa=function(e){return Object(Mt.h)(e,"DescribeIdentityInput")},(Q=Z||(Z={})).filterSensitiveLog=function(e){return k({},e)},Q.isa=function(e){return Object(Mt.h)(e,"DescribeIdentityPoolInput")},(te=ee||(ee={})).filterSensitiveLog=function(e){return k({},e)},te.isa=function(e){return Object(Mt.h)(e,"DeveloperUserAlreadyRegisteredException")},function(e){e.ACCESS_DENIED="AccessDenied",e.INTERNAL_SERVER_ERROR="InternalServerError"}(ne||(ne={})),(ie=re||(re={})).filterSensitiveLog=function(e){return k({},e)},ie.isa=function(e){return Object(Mt.h)(e,"ExternalServiceException")},(se=oe||(oe={})).filterSensitiveLog=function(e){return k({},e)},se.isa=function(e){return Object(Mt.h)(e,"GetCredentialsForIdentityInput")},(ue=ae||(ae={})).filterSensitiveLog=function(e){return k({},e)},ue.isa=function(e){return Object(Mt.h)(e,"GetCredentialsForIdentityResponse")},(fe=ce||(ce={})).filterSensitiveLog=function(e){return k({},e)},fe.isa=function(e){return Object(Mt.h)(e,"GetIdentityPoolRolesInput")},(de=le||(le={})).filterSensitiveLog=function(e){return k({},e)},de.isa=function(e){return Object(Mt.h)(e,"GetIdentityPoolRolesResponse")},(pe=he||(he={})).filterSensitiveLog=function(e){return k({},e)},pe.isa=function(e){return Object(Mt.h)(e,"GetIdInput")},(ve=ge||(ge={})).filterSensitiveLog=function(e){return k({},e)},ve.isa=function(e){return Object(Mt.h)(e,"GetIdResponse")},(me=ye||(ye={})).filterSensitiveLog=function(e){return k({},e)},me.isa=function(e){return Object(Mt.h)(e,"GetOpenIdTokenForDeveloperIdentityInput")},(Se=be||(be={})).filterSensitiveLog=function(e){return k({},e)},Se.isa=function(e){return Object(Mt.h)(e,"GetOpenIdTokenForDeveloperIdentityResponse")},(_e=we||(we={})).filterSensitiveLog=function(e){return k({},e)},_e.isa=function(e){return Object(Mt.h)(e,"GetOpenIdTokenInput")},(Ce=Oe||(Oe={})).filterSensitiveLog=function(e){return k({},e)},Ce.isa=function(e){return Object(Mt.h)(e,"GetOpenIdTokenResponse")},(Ae=Ee||(Ee={})).filterSensitiveLog=function(e){return k({},e)},Ae.isa=function(e){return Object(Mt.h)(e,"IdentityDescription")},(Ie=je||(je={})).filterSensitiveLog=function(e){return k({},e)},Ie.isa=function(e){return Object(Mt.h)(e,"IdentityPool")},(Pe=xe||(xe={})).filterSensitiveLog=function(e){return k({},e)},Pe.isa=function(e){return Object(Mt.h)(e,"IdentityPoolShortDescription")},(Te=ke||(ke={})).filterSensitiveLog=function(e){return k({},e)},Te.isa=function(e){return Object(Mt.h)(e,"InternalErrorException")},(Re=Ue||(Ue={})).filterSensitiveLog=function(e){return k({},e)},Re.isa=function(e){return Object(Mt.h)(e,"InvalidIdentityPoolConfigurationException")},(De=Le||(Le={})).filterSensitiveLog=function(e){return k({},e)},De.isa=function(e){return Object(Mt.h)(e,"InvalidParameterException")},(Ne=Me||(Me={})).filterSensitiveLog=function(e){return k({},e)},Ne.isa=function(e){return Object(Mt.h)(e,"LimitExceededException")},(Fe=Be||(Be={})).filterSensitiveLog=function(e){return k({},e)},Fe.isa=function(e){return Object(Mt.h)(e,"ListIdentitiesInput")},(Ke=ze||(ze={})).filterSensitiveLog=function(e){return k({},e)},Ke.isa=function(e){return Object(Mt.h)(e,"ListIdentitiesResponse")},(He=qe||(qe={})).filterSensitiveLog=function(e){return k({},e)},He.isa=function(e){return Object(Mt.h)(e,"ListIdentityPoolsInput")},(Ge=Ve||(Ve={})).filterSensitiveLog=function(e){return k({},e)},Ge.isa=function(e){return Object(Mt.h)(e,"ListIdentityPoolsResponse")},($e=We||(We={})).filterSensitiveLog=function(e){return k({},e)},$e.isa=function(e){return Object(Mt.h)(e,"ListTagsForResourceInput")},(Je=Ye||(Ye={})).filterSensitiveLog=function(e){return k({},e)},Je.isa=function(e){return Object(Mt.h)(e,"ListTagsForResourceResponse")},(Ze=Xe||(Xe={})).filterSensitiveLog=function(e){return k({},e)},Ze.isa=function(e){return Object(Mt.h)(e,"LookupDeveloperIdentityInput")},(et=Qe||(Qe={})).filterSensitiveLog=function(e){return k({},e)},et.isa=function(e){return Object(Mt.h)(e,"LookupDeveloperIdentityResponse")},(nt=tt||(tt={})).filterSensitiveLog=function(e){return k({},e)},nt.isa=function(e){return Object(Mt.h)(e,"MappingRule")},function(e){e.CONTAINS="Contains",e.EQUALS="Equals",e.NOT_EQUAL="NotEqual",e.STARTS_WITH="StartsWith"}(rt||(rt={})),(ot=it||(it={})).filterSensitiveLog=function(e){return k({},e)},ot.isa=function(e){return Object(Mt.h)(e,"MergeDeveloperIdentitiesInput")},(at=st||(st={})).filterSensitiveLog=function(e){return k({},e)},at.isa=function(e){return Object(Mt.h)(e,"MergeDeveloperIdentitiesResponse")},(ct=ut||(ut={})).filterSensitiveLog=function(e){return k({},e)},ct.isa=function(e){return Object(Mt.h)(e,"NotAuthorizedException")},(lt=ft||(ft={})).filterSensitiveLog=function(e){return k({},e)},lt.isa=function(e){return Object(Mt.h)(e,"ResourceConflictException")},(ht=dt||(dt={})).filterSensitiveLog=function(e){return k({},e)},ht.isa=function(e){return Object(Mt.h)(e,"ResourceNotFoundException")},(gt=pt||(pt={})).filterSensitiveLog=function(e){return k({},e)},gt.isa=function(e){return Object(Mt.h)(e,"RoleMapping")},function(e){e.RULES="Rules",e.TOKEN="Token"}(vt||(vt={})),(mt=yt||(yt={})).filterSensitiveLog=function(e){return k({},e)},mt.isa=function(e){return Object(Mt.h)(e,"RulesConfigurationType")},(St=bt||(bt={})).filterSensitiveLog=function(e){return k({},e)},St.isa=function(e){return Object(Mt.h)(e,"SetIdentityPoolRolesInput")},(_t=wt||(wt={})).filterSensitiveLog=function(e){return k({},e)},_t.isa=function(e){return Object(Mt.h)(e,"TagResourceInput")},(Ct=Ot||(Ot={})).filterSensitiveLog=function(e){return k({},e)},Ct.isa=function(e){return Object(Mt.h)(e,"TagResourceResponse")},(At=Et||(Et={})).filterSensitiveLog=function(e){return k({},e)},At.isa=function(e){return Object(Mt.h)(e,"TooManyRequestsException")},(It=jt||(jt={})).filterSensitiveLog=function(e){return k({},e)},It.isa=function(e){return Object(Mt.h)(e,"UnlinkDeveloperIdentityInput")},(Pt=xt||(xt={})).filterSensitiveLog=function(e){return k({},e)},Pt.isa=function(e){return Object(Mt.h)(e,"UnlinkIdentityInput")},(Tt=kt||(kt={})).filterSensitiveLog=function(e){return k({},e)},Tt.isa=function(e){return Object(Mt.h)(e,"UnprocessedIdentityId")},(Rt=Ut||(Ut={})).filterSensitiveLog=function(e){return k({},e)},Rt.isa=function(e){return Object(Mt.h)(e,"UntagResourceInput")},(Dt=Lt||(Lt={})).filterSensitiveLog=function(e){return k({},e)},Dt.isa=function(e){return Object(Mt.h)(e,"UntagResourceResponse")};var Nt=n(2),Bt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,h,p,g,v,y;return U(this,(function(m){switch(m.label){case 0:return r=[k({},e)],y={},[4,gn(e.body,t)];case 1:switch(n=k.apply(void 0,r.concat([(y.body=m.sent(),y)])),o="UnknownError",s=n.body.__type.split("#"),o=void 0===s[1]?s[0]:s[1],o){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":return[3,6];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,zt(n,t)];case 3:return i=k.apply(void 0,[k.apply(void 0,a.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 4:return u=[{}],[4,Kt(n,t)];case 5:return i=k.apply(void 0,[k.apply(void 0,u.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 6:return c=[{}],[4,qt(n,t)];case 7:return i=k.apply(void 0,[k.apply(void 0,c.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 8:return f=[{}],[4,Ht(n,t)];case 9:return i=k.apply(void 0,[k.apply(void 0,f.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 10:return l=[{}],[4,Gt(n,t)];case 11:return i=k.apply(void 0,[k.apply(void 0,l.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 12:return d=[{}],[4,Wt(n,t)];case 13:return i=k.apply(void 0,[k.apply(void 0,d.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 14:return h=[{}],[4,$t(n,t)];case 15:return i=k.apply(void 0,[k.apply(void 0,h.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 16:return p=[{}],[4,Yt(n,t)];case 17:return i=k.apply(void 0,[k.apply(void 0,p.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 18:g=n.body,o=g.code||g.Code||o,i=k(k({},g),{name:""+o,message:g.message||g.Message||o,$fault:"client",$metadata:dn(e)}),m.label=19;case 19:return v=i.message||i.Message||o,i.message=v,delete i.Message,[2,Promise.reject(Object.assign(new Error(v),i))]}}))}))},Ft=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r,i,o,s,a,u,c,f,l,d,h,p,g,v,y;return U(this,(function(m){switch(m.label){case 0:return r=[k({},e)],y={},[4,gn(e.body,t)];case 1:switch(n=k.apply(void 0,r.concat([(y.body=m.sent(),y)])),o="UnknownError",s=n.body.__type.split("#"),o=void 0===s[1]?s[0]:s[1],o){case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":return[3,2];case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":return[3,4];case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":return[3,6];case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":return[3,8];case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":return[3,10];case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":return[3,12];case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":return[3,14];case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":return[3,16]}return[3,18];case 2:return a=[{}],[4,zt(n,t)];case 3:return i=k.apply(void 0,[k.apply(void 0,a.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 4:return u=[{}],[4,Kt(n,t)];case 5:return i=k.apply(void 0,[k.apply(void 0,u.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 6:return c=[{}],[4,Ht(n,t)];case 7:return i=k.apply(void 0,[k.apply(void 0,c.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 8:return f=[{}],[4,Vt(n,t)];case 9:return i=k.apply(void 0,[k.apply(void 0,f.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 10:return l=[{}],[4,Gt(n,t)];case 11:return i=k.apply(void 0,[k.apply(void 0,l.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 12:return d=[{}],[4,Wt(n,t)];case 13:return i=k.apply(void 0,[k.apply(void 0,d.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 14:return h=[{}],[4,$t(n,t)];case 15:return i=k.apply(void 0,[k.apply(void 0,h.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 16:return p=[{}],[4,Yt(n,t)];case 17:return i=k.apply(void 0,[k.apply(void 0,p.concat([m.sent()])),{name:o,$metadata:dn(e)}]),[3,19];case 18:g=n.body,o=g.code||g.Code||o,i=k(k({},g),{name:""+o,message:g.message||g.Message||o,$fault:"client",$metadata:dn(e)}),m.label=19;case 19:return v=i.message||i.Message||o,i.message=v,delete i.Message,[2,Promise.reject(Object.assign(new Error(v),i))]}}))}))},zt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=en(n,t),[2,k({name:"ExternalServiceException",$fault:"client",$metadata:dn(e)},r)]}))}))},Kt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=rn(n,t),[2,k({name:"InternalErrorException",$fault:"server",$metadata:dn(e)},r)]}))}))},qt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=on(n,t),[2,k({name:"InvalidIdentityPoolConfigurationException",$fault:"client",$metadata:dn(e)},r)]}))}))},Ht=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=sn(n,t),[2,k({name:"InvalidParameterException",$fault:"client",$metadata:dn(e)},r)]}))}))},Vt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=an(n,t),[2,k({name:"LimitExceededException",$fault:"client",$metadata:dn(e)},r)]}))}))},Gt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=un(n,t),[2,k({name:"NotAuthorizedException",$fault:"client",$metadata:dn(e)},r)]}))}))},Wt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=cn(n,t),[2,k({name:"ResourceConflictException",$fault:"client",$metadata:dn(e)},r)]}))}))},$t=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=fn(n,t),[2,k({name:"ResourceNotFoundException",$fault:"client",$metadata:dn(e)},r)]}))}))},Yt=function(e,t){return T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n=e.body,r=ln(n,t),[2,k({name:"TooManyRequestsException",$fault:"client",$metadata:dn(e)},r)]}))}))},Jt=function(e,t){return k(k(k({},void 0!==e.CustomRoleArn&&{CustomRoleArn:e.CustomRoleArn}),void 0!==e.IdentityId&&{IdentityId:e.IdentityId}),void 0!==e.Logins&&{Logins:Zt(e.Logins,t)})},Xt=function(e,t){return k(k(k({},void 0!==e.AccountId&&{AccountId:e.AccountId}),void 0!==e.IdentityPoolId&&{IdentityPoolId:e.IdentityPoolId}),void 0!==e.Logins&&{Logins:Zt(e.Logins,t)})},Zt=function(e,t){return Object.entries(e).reduce((function(e,t){var n,r=R(t,2),i=r[0],o=r[1];return k(k({},e),((n={})[i]=o,n))}),{})},Qt=function(e,t){return{__type:"Credentials",AccessKeyId:void 0!==e.AccessKeyId&&null!==e.AccessKeyId?e.AccessKeyId:void 0,Expiration:void 0!==e.Expiration&&null!==e.Expiration?new Date(Math.round(1e3*e.Expiration)):void 0,SecretKey:void 0!==e.SecretKey&&null!==e.SecretKey?e.SecretKey:void 0,SessionToken:void 0!==e.SessionToken&&null!==e.SessionToken?e.SessionToken:void 0}},en=function(e,t){return{__type:"ExternalServiceException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},tn=function(e,t){return{__type:"GetCredentialsForIdentityResponse",Credentials:void 0!==e.Credentials&&null!==e.Credentials?Qt(e.Credentials):void 0,IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},nn=function(e,t){return{__type:"GetIdResponse",IdentityId:void 0!==e.IdentityId&&null!==e.IdentityId?e.IdentityId:void 0}},rn=function(e,t){return{__type:"InternalErrorException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},on=function(e,t){return{__type:"InvalidIdentityPoolConfigurationException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},sn=function(e,t){return{__type:"InvalidParameterException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},an=function(e,t){return{__type:"LimitExceededException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},un=function(e,t){return{__type:"NotAuthorizedException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},cn=function(e,t){return{__type:"ResourceConflictException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},fn=function(e,t){return{__type:"ResourceNotFoundException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},ln=function(e,t){return{__type:"TooManyRequestsException",message:void 0!==e.message&&null!==e.message?e.message:void 0}},dn=function(e){return{httpStatusCode:e.statusCode,httpHeaders:e.headers,requestId:e.headers["x-amzn-requestid"]}},hn=function(e,t){return void 0===e&&(e=new Uint8Array),e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array)},pn=function(e,t,n,r,i){return T(void 0,void 0,void 0,(function(){var o,s,a,u,c,f;return U(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 Nt.a(f)]}}))}))},gn=function(e,t){return function(e,t){return hn(e,t).then((function(e){return t.utf8Encoder(e)}))}(e,t).then((function(e){return e.length?JSON.parse(e):{}}))},vn=n(4),yn=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return P(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(vn.a)(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:oe.filterSensitiveLog,outputFilterSensitiveLog:ae.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 T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},r=JSON.stringify(Jt(e,t)),[2,pn(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return T(void 0,void 0,void 0,(function(){var n,r,i;return U(this,(function(o){switch(o.label){case 0:return e.statusCode>=400?[2,Bt(e,t)]:[4,gn(e.body,t)];case 1:return n=o.sent(),{},r=tn(n,t),i=k({$metadata:dn(e),__type:"GetCredentialsForIdentityResponse"},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Mt.b),mn=function(e){function t(t,n){void 0===n&&(n=!0);var r=e.call(this,t)||this;return r.tryNextLink=n,r}return Object(I.__extends)(t,e),t}(Error);function bn(e){return Promise.all(Object.keys(e).reduce((function(t,n){var r=e[n];return"string"==typeof r?t.push([n,r]):t.push(r().then((function(e){return[n,e]}))),t}),[])).then((function(e){return e.reduce((function(e,t){var n=Object(I.__read)(t,2),r=n[0],i=n[1];return e[r]=i,e}),{})}))}function Sn(e){var t=this;return function(){return Object(I.__awaiter)(t,void 0,void 0,(function(){var t,n,r,i,o,s,a,u,c,f,l,d,h;return Object(I.__generator)(this,(function(p){switch(p.label){case 0:return f=(c=e.client).send,l=yn.bind,h={CustomRoleArn:e.customRoleArn,IdentityId:e.identityId},e.logins?[4,bn(e.logins)]:[3,2];case 1:return d=p.sent(),[3,3];case 2:d=void 0,p.label=3;case 3:return[4,f.apply(c,[new(l.apply(yn,[void 0,(h.Logins=d,h)]))])];case 4:return t=p.sent().Credentials,n=void 0===t?function(){throw new mn("Response from Amazon Cognito contained no credentials")}():t,r=n.AccessKeyId,i=void 0===r?function(){throw new mn("Response from Amazon Cognito contained no access key ID")}():r,o=n.Expiration,s=n.SecretKey,a=void 0===s?function(){throw new mn("Response from Amazon Cognito contained no secret key")}():s,u=n.SessionToken,[2,{accessKeyId:i,secretAccessKey:a,sessionToken:u,expiration:o}]}}))}))}}var wn=function(e){function t(t){var n=e.call(this)||this;return n.input=t,n}return P(t,e),t.prototype.resolveMiddleware=function(e,t,n){this.middlewareStack.use(Object(vn.a)(t,this.serialize,this.deserialize));var r=e.concat(this.middlewareStack),i={logger:t.logger,inputFilterSensitiveLog:he.filterSensitiveLog,outputFilterSensitiveLog:ge.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 T(void 0,void 0,void 0,(function(){var n,r;return U(this,(function(i){return n={"Content-Type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},r=JSON.stringify(Xt(e,t)),[2,pn(t,n,"/",void 0,r)]}))}))}(e,t)},t.prototype.deserialize=function(e,t){return function(e,t){return T(void 0,void 0,void 0,(function(){var n,r,i;return U(this,(function(o){switch(o.label){case 0:return e.statusCode>=400?[2,Ft(e,t)]:[4,gn(e.body,t)];case 1:return n=o.sent(),{},r=nn(n,t),i=k({$metadata:dn(e),__type:"GetIdResponse"},r),[2,Promise.resolve(i)]}}))}))}(e,t)},t}(Mt.b),_n=function(){function e(e){void 0===e&&(e="aws:cognito-identity-ids"),this.dbName=e}return e.prototype.getItem=function(e){return this.withObjectStore("readonly",(function(t){var n=t.get(e);return new Promise((function(e){n.onerror=function(){return e(null)},n.onsuccess=function(){return e(n.result?n.result.value:null)}}))})).catch((function(){return null}))},e.prototype.removeItem=function(e){return this.withObjectStore("readwrite",(function(t){var n=t.delete(e);return new Promise((function(e,t){n.onerror=function(){return t(n.error)},n.onsuccess=function(){return e()}}))}))},e.prototype.setItem=function(e,t){return this.withObjectStore("readwrite",(function(n){var r=n.put({id:e,value:t});return new Promise((function(e,t){r.onerror=function(){return t(r.error)},r.onsuccess=function(){return e()}}))}))},e.prototype.getDb=function(){var e=self.indexedDB.open(this.dbName,1);return new Promise((function(t,n){e.onsuccess=function(){t(e.result)},e.onerror=function(){n(e.error)},e.onblocked=function(){n(new Error("Unable to access DB"))},e.onupgradeneeded=function(){var t=e.result;t.onerror=function(){n(new Error("Failed to create object store"))},t.createObjectStore("IdentityIds",{keyPath:"id"})}}))},e.prototype.withObjectStore=function(e,t){return this.getDb().then((function(n){var r=n.transaction("IdentityIds",e);return r.oncomplete=function(){return n.close()},new Promise((function(e,n){r.onerror=function(){return n(r.error)},e(t(r.objectStore("IdentityIds")))})).catch((function(e){throw n.close(),e}))}))},e}(),On=new(function(){function e(e){void 0===e&&(e={}),this.store=e}return e.prototype.getItem=function(e){return e in this.store?this.store[e]:null},e.prototype.removeItem=function(e){delete this.store[e]},e.prototype.setItem=function(e,t){this.store[e]=t},e}());function Cn(e){var t=this,n=e.accountId,r=e.cache,i=void 0===r?"object"==typeof self&&self.indexedDB?new _n:"object"==typeof window&&window.localStorage?window.localStorage:On:r,o=e.client,s=e.customRoleArn,a=e.identityPoolId,u=e.logins,c=e.userIdentifier,f=void 0===c?u&&0!==Object.keys(u).length?void 0:"ANONYMOUS":c,l=f?"aws:cognito-identity-credentials:"+a+":"+f:void 0,d=function(){return Object(I.__awaiter)(t,void 0,void 0,(function(){var e,t,r,c,f,h,p,g,v;return Object(I.__generator)(this,(function(y){switch(y.label){case 0:return(t=l)?[4,i.getItem(l)]:[3,2];case 1:t=y.sent(),y.label=2;case 2:return(e=t)?[3,7]:(h=(f=o).send,p=wn.bind,v={AccountId:n,IdentityPoolId:a},u?[4,bn(u)]:[3,4]);case 3:return g=y.sent(),[3,5];case 4:g=void 0,y.label=5;case 5:return[4,h.apply(f,[new(p.apply(wn,[void 0,(v.Logins=g,v)]))])];case 6:r=y.sent().IdentityId,c=void 0===r?function(){throw new mn("Response from Amazon Cognito contained no identity ID")}():r,e=c,l&&Promise.resolve(i.setItem(l,e)).catch((function(){})),y.label=7;case 7:return[2,(d=Sn({client:o,customRoleArn:s,logins:u,identityId:e}))()]}}))}))};return function(){return d().catch((function(e){return Object(I.__awaiter)(t,void 0,void 0,(function(){return Object(I.__generator)(this,(function(t){throw l&&Promise.resolve(i.removeItem(l)).catch((function(){})),e}))}))}))}}var En=n(47),An=n(35),jn=n(16),In=n(30),xn=n(11),Pn=n(36),kn=n(15),Tn=n(38),Un=n(39),Rn=n(17),Ln="cognito-identity.{region}.amazonaws.com",Dn=new Set(["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-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"]),Mn=new Set(["cn-north-1","cn-northwest-1"]),Nn=new Set(["us-iso-east-1"]),Bn=new Set(["us-isob-east-1"]),Fn=new Set(["us-gov-east-1","us-gov-west-1"]),zn=k(k({},{apiVersion:"2014-06-30",disableHostPrefix:!1,regionInfoProvider:function(e,t){var n=void 0;switch(e){case"ap-northeast-1":n={hostname:"cognito-identity.ap-northeast-1.amazonaws.com",partition:"aws"};break;case"ap-northeast-2":n={hostname:"cognito-identity.ap-northeast-2.amazonaws.com",partition:"aws"};break;case"ap-south-1":n={hostname:"cognito-identity.ap-south-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-1":n={hostname:"cognito-identity.ap-southeast-1.amazonaws.com",partition:"aws"};break;case"ap-southeast-2":n={hostname:"cognito-identity.ap-southeast-2.amazonaws.com",partition:"aws"};break;case"ca-central-1":n={hostname:"cognito-identity.ca-central-1.amazonaws.com",partition:"aws"};break;case"cn-north-1":n={hostname:"cognito-identity.cn-north-1.amazonaws.com.cn",partition:"aws-cn"};break;case"eu-central-1":n={hostname:"cognito-identity.eu-central-1.amazonaws.com",partition:"aws"};break;case"eu-west-1":n={hostname:"cognito-identity.eu-west-1.amazonaws.com",partition:"aws"};break;case"eu-west-2":n={hostname:"cognito-identity.eu-west-2.amazonaws.com",partition:"aws"};break;case"us-east-1":n={hostname:"cognito-identity.us-east-1.amazonaws.com",partition:"aws"};break;case"us-east-2":n={hostname:"cognito-identity.us-east-2.amazonaws.com",partition:"aws"};break;case"us-west-2":n={hostname:"cognito-identity.us-west-2.amazonaws.com",partition:"aws"};break;default:Dn.has(e)&&(n={hostname:Ln.replace("{region}",e),partition:"aws"}),Mn.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com.cn".replace("{region}",e),partition:"aws-cn"}),Nn.has(e)&&(n={hostname:"cognito-identity.{region}.c2s.ic.gov".replace("{region}",e),partition:"aws-iso"}),Bn.has(e)&&(n={hostname:"cognito-identity.{region}.sc2s.sgov.gov".replace("{region}",e),partition:"aws-iso-b"}),Fn.has(e)&&(n={hostname:"cognito-identity.{region}.amazonaws.com".replace("{region}",e),partition:"aws-us-gov"}),void 0===n&&(n={hostname:Ln.replace("{region}",e),partition:"aws"})}return Promise.resolve(n)},signingName:"cognito-identity"}),{runtime:"browser",base64Decoder:kn.a,base64Encoder:kn.b,bodyLengthChecker:Tn.a,credentialDefaultProvider:function(){},defaultUserAgent:Object(Un.a)(En.a,En.b),maxAttempts:xn.a,region:Object(In.a)("Region is missing"),requestHandler:new jn.a,sha256:An.Sha256,streamCollector:jn.b,urlParser:Pn.a,utf8Decoder:Rn.a,utf8Encoder:Rn.b}),Kn=n(25),qn=n(34),Hn=n(23),Vn=n(26),Gn=n(31),Wn=n(27),$n=function(e){function t(t){var n=this,r=k(k({},zn),t),i=Object(Kn.b)(r),o=Object(Kn.a)(i),s=Object(Gn.b)(o),a=Object(xn.c)(s),u=Object(Wn.b)(a),c=Object(Hn.b)(u),f=Object(Vn.b)(c);return(n=e.call(this,f)||this).config=f,n.middlewareStack.use(Object(xn.b)(n.config)),n.middlewareStack.use(Object(Wn.a)(n.config)),n.middlewareStack.use(Object(qn.a)(n.config)),n.middlewareStack.use(Object(Hn.a)(n.config)),n.middlewareStack.use(Object(Vn.a)(n.config)),n}return P(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this)},t}(Mt.a),Yn=function(){return(Yn=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)},Jn=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())}))},Xn=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])}}},Zn=new r.a("Credentials"),Qn=new(function(){function e(e){this._gettingCredPromise=null,this._refreshHandlers={},this.Auth=void 0,this.configure(e),this._refreshHandlers.google=C.refreshGoogleToken,this._refreshHandlers.facebook=E.refreshFacebookToken}return e.prototype.getModuleName=function(){return"Credentials"},e.prototype.getCredSource=function(){return this._credentials_source},e.prototype.configure=function(e){if(!e)return this._config||{};this._config=Object.assign({},this._config,e);var t=this._config.refreshHandlers;return t&&(this._refreshHandlers=Yn(Yn({},this._refreshHandlers),t)),this._storage=this._config.storage,this._storage||(this._storage=(new i.a).getStorage()),this._storageSync=Promise.resolve(),"function"==typeof this._storage.sync&&(this._storageSync=this._storage.sync()),this._config},e.prototype.get=function(){return Zn.debug("getting credentials"),this._pickupCredentials()},e.prototype._pickupCredentials=function(){return Zn.debug("picking up credentials"),this._gettingCredPromise&&this._gettingCredPromise.isPending()?Zn.debug("getting old cred promise"):(Zn.debug("getting new cred promise"),this._gettingCredPromise=Object(o.c)(this._keepAlive())),this._gettingCredPromise},e.prototype._keepAlive=function(){Zn.debug("checking if credentials exists and not expired");var e=this._credentials;if(e&&!this._isExpired(e))return Zn.debug("credentials not changed and not expired, directly return"),Promise.resolve(e);Zn.debug("need to get a new credential or refresh the existing one");var t=this.Auth,n=void 0===t?j.a.Auth:t;return n&&"function"==typeof n.currentUserCredentials?n.currentUserCredentials():Promise.reject("No Auth module registered in Amplify")},e.prototype.refreshFederatedToken=function(e){Zn.debug("Getting federated credentials");var t=e.provider,n=e.user,r=e.token,i=e.identity_id,o=e.expires_at;o=1970===new Date(o).getFullYear()?1e3*o:o;return Zn.debug("checking if federated jwt token expired"),o>(new Date).getTime()?(Zn.debug("token not expired"),this._setCredentialsFromFederation({provider:t,token:r,user:n,identity_id:i,expires_at:o})):this._refreshHandlers[t]&&"function"==typeof this._refreshHandlers[t]?(Zn.debug("getting refreshed jwt token from federation provider"),this._providerRefreshWithRetry({refreshHandler:this._refreshHandlers[t],provider:t,user:n})):(Zn.debug("no refresh handler for provider:",t),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._providerRefreshWithRetry=function(e){var t=this,n=e.refreshHandler,r=e.provider,i=e.user;return h(n,[],1e4).then((function(e){return Zn.debug("refresh federated token sucessfully",e),t._setCredentialsFromFederation({provider:r,token:e.token,user:i,identity_id:e.identity_id,expires_at:e.expires_at})})).catch((function(e){return"string"==typeof e&&0===e.toLowerCase().lastIndexOf("network error",e.length)||t.clear(),Zn.debug("refresh federated token failed",e),Promise.reject("refreshing federation token failed: "+e)}))},e.prototype._isExpired=function(e){if(!e)return Zn.debug("no credentials for expiration check"),!0;Zn.debug("are these credentials expired?",e);var t=Date.now();return!(e.expiration.getTime()>t+6e5&&t<this._nextCredentialsRefresh)},e.prototype._setCredentialsForGuest=function(){return Jn(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a=this;return Xn(this,(function(u){switch(u.label){case 0:if(Zn.debug("setting credentials for guest"),e=this._config,t=e.identityPoolId,n=e.region,e.mandatorySignIn)return[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")];if(!t)return Zn.debug("No Cognito Identity pool provided for unauthenticated access"),[2,Promise.reject("No Cognito Identity pool provided for unauthenticated access")];if(!n)return Zn.debug("region is not configured for getting the credentials"),[2,Promise.reject("region is not configured for getting the credentials")];r=void 0,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._storageSync];case 2:return u.sent(),r=this._storage.getItem("CognitoIdentityId-"+t),this._identityId=r,[3,4];case 3:return i=u.sent(),Zn.debug("Failed to get the cached identityId",i),[3,4];case 4:return o=new $n({region:n,customUserAgent:Object(A.b)()}),s=void 0,s=r?Sn({identityId:r,client:o})():function(){return Jn(a,void 0,void 0,(function(){var e;return Xn(this,(function(n){switch(n.label){case 0:return[4,o.send(new wn({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Sn({client:o,identityId:e})()]}}))}))}().catch((function(e){return Jn(a,void 0,void 0,(function(){return Xn(this,(function(t){throw e}))}))})),[2,this._loadCredentials(s,"guest",!1,null).then((function(e){return e})).catch((function(e){return Jn(a,void 0,void 0,(function(){var n=this;return Xn(this,(function(i){return"ResourceNotFoundException"===e.name&&e.message==="Identity '"+r+"' not found."?(Zn.debug("Failed to load guest credentials"),this._storage.removeItem("CognitoIdentityId-"+t),s=function(){return Jn(n,void 0,void 0,(function(){var e;return Xn(this,(function(n){switch(n.label){case 0:return[4,o.send(new wn({IdentityPoolId:t}))];case 1:return e=n.sent().IdentityId,this._identityId=e,[2,Sn({client:o,identityId:e})()]}}))}))}().catch((function(e){return Jn(n,void 0,void 0,(function(){return Xn(this,(function(t){throw e}))}))})),[2,this._loadCredentials(s,"guest",!1,null)]):[2,e]}))}))}))]}}))}))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,i={google:"accounts.google.com",facebook:"graph.facebook.com",amazon:"www.amazon.com",developer:"cognito-identity.amazonaws.com"}[t]||t;if(!i)return Promise.reject("You must specify a federated provider");var o={};o[i]=n;var s=this._config,a=s.identityPoolId,u=s.region;if(!a)return Zn.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!u)return Zn.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var c=new $n({region:u,customUserAgent:Object(A.b)()}),f=void 0;r?f=Sn({identityId:r,logins:o,client:c})():f=Cn({logins:o,identityPoolId:a,client:c})();return this._loadCredentials(f,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){var t=this;Zn.debug("set credentials from session");var n=e.getIdToken().getJwtToken(),r=this._config,i=r.region,o=r.userPoolId,s=r.identityPoolId;if(!s)return Zn.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");if(!i)return Zn.debug("region is not configured for getting the credentials"),Promise.reject("region is not configured for getting the credentials");var a={};a["cognito-idp."+i+".amazonaws.com/"+o]=n;var u=new $n({region:i,customUserAgent:Object(A.b)()}),c=Jn(t,void 0,void 0,(function(){var e;return Xn(this,(function(t){switch(t.label){case 0:return[4,u.send(new wn({IdentityPoolId:s,Logins:a}))];case 1:return e=t.sent().IdentityId,this._identityId=e,[2,Sn({client:u,logins:a,identityId:e})()]}}))})).catch((function(e){return Jn(t,void 0,void 0,(function(){return Xn(this,(function(t){throw e}))}))}));return this._loadCredentials(c,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var i=this,o=this,s=this._config.identityPoolId;return new Promise((function(a,u){e.then((function(e){return Jn(i,void 0,void 0,(function(){var i,u,c,f,l,d;return Xn(this,(function(h){switch(h.label){case 0:if(Zn.debug("Load credentials successfully",e),this._identityId&&!e.identityId&&(e.identityId=this._identityId),o._credentials=e,o._credentials.authenticated=n,o._credentials_source=t,o._nextCredentialsRefresh=(new Date).getTime()+3e6,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),u=r.provider,c=r.token,f=r.expires_at,l=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:u,token:c,user:i,expires_at:f,identity_id:l}))}catch(e){Zn.debug("Failed to put federated info into auth storage",e)}}if("guest"!==t)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._storageSync];case 2:return h.sent(),this._storage.setItem("CognitoIdentityId-"+s,e.identityId),[3,4];case 3:return d=h.sent(),Zn.debug("Failed to cache identityId",d),[3,4];case 4:return a(o._credentials),[2]}}))}))})).catch((function(t){if(t)return Zn.debug("Failed to load credentials",e),Zn.debug("Error loading credentials",t),void u(t)}))}))},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(Zn.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return Jn(this,void 0,void 0,(function(){return Xn(this,(function(e){return this._credentials=null,this._credentials_source=null,Zn.debug("removing aws-amplify-federatedInfo from storage"),this._storage.removeItem("aws-amplify-federatedInfo"),[2]}))}))},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}())(null);j.a.register(Qn)}]);
Editor is loading...