diff --git a/auth/cognitohosteduilauncher.js b/auth/cognitohosteduilauncher.js index 067a616..4d9515d 100644 --- a/auth/cognitohosteduilauncher.js +++ b/auth/cognitohosteduilauncher.js @@ -198,7 +198,7 @@ var K=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new T * for the specific language governing permissions and * limitations under the License. */ -var W=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t||{},r=n.UserPoolId,i=n.ClientId,o=n.endpoint,s=n.AdvancedSecurityDataCollectionFlag;if(!r||!i)throw new Error("Both UserPoolId and ClientId are required.");if(!/^[\w-]+_.+$/.test(r))throw new Error("Invalid UserPoolId format.");var a=r.split("_")[0];this.userPoolId=r,this.clientId=i,this.client=new H(a,o),this.advancedSecurityDataCollectionFlag=!1!==s,this.storage=t.Storage||(new V).getStorage()}return e.prototype.getUserPoolId=function(){return this.userPoolId},e.prototype.getClientId=function(){return this.clientId},e.prototype.signUp=function(e,t,n,r,i){var o=this,s={ClientId:this.clientId,Username:e,Password:t,UserAttributes:n,ValidationData:r};this.getUserContextData(e)&&(s.UserContextData=this.getUserContextData(e)),this.client.request("SignUp",s,function(t,n){if(t)return i(t,null);var r={Username:e,Pool:o,Storage:o.storage},s={user:new K(r),userConfirmed:n.UserConfirmed,userSub:n.UserSub};return i(null,s)})},e.prototype.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 K(n)}return null},e.prototype.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}(),J=n(12);var Y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.domain=t.domain,t.path?this.path=t.path:this.path="/",Object.prototype.hasOwnProperty.call(t,"expires")?this.expires=t.expires:this.expires=365,Object.prototype.hasOwnProperty.call(t,"secure")?this.secure=t.secure:this.secure=!0}return e.prototype.setItem=function(e,t){return J.set(e,t,{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure}),J.get(e)},e.prototype.getItem=function(e){return J.get(e)},e.prototype.removeItem=function(e){return J.remove(e,{path:this.path,domain:this.domain,secure:this.secure})},e.prototype.clear=function(){var e=J.get(),t=void 0;for(t=0;t{const e=new URLSearchParams(window.location.search).get("code");console.log(e),r.Auth.currentAuthenticatedUser().then(e=>(e=>{console.log("sendToSocket");const t=new WebSocket(o,"echo-protocol");t.onopen=function(n){t.send(e),t.close(),window.close()}})(e.signInUserSession.idToken.jwtToken)).catch(t=>{if(console.log(t),e){const e=new r.Logger("Alexander_the_auth_watcher");e.onHubCapsule=(t=>{switch(t.payload.event){case"signIn":d();break;case"configured":e.error("the Auth module is configured")}}),r.Hub.listen("auth",e)}else(()=>window.location.assign("https://"+u+"/oauth2/authorize?redirect_uri="+c+"&response_type="+p+"&client_id="+i.userPoolWebClientId+"&identity_provider=Google"))()})};d()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86);t.AnalyticsClass=r.default;var i=n(1),o=new i.ConsoleLogger("Analytics"),s=!1,a=!1,u=!1,c=null;c||(o.debug("Create Analytics Instance"),c=new r.default);var l=c;i.default.register(l),t.default=l,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(189)),l.onHubCapsule=function(e){var t=e.channel,n=e.payload;e.source;switch(o.debug("on hub capsule "+t,n),t){case"auth":d(n);break;case"storage":p(n);break;case"analytics":f(n)}};var p=function(e){var t=e.attrs,n=e.metrics;t&&l.record({name:"Storage",attributes:t,metrics:n})},d=function(e){var t=e.event;if(t)switch(t){case"signIn":l.record({name:"_userauth.sign_in"});break;case"signUp":l.record({name:"_userauth.sign_up"});break;case"signOut":break;case"signIn_failure":l.record({name:"_userauth.auth_fail"});break;case"configured":if((a=!0)&&u){var n=l.configure();!s&&n.autoSessionRecord&&l.updateEndpoint({}).catch(function(e){o.debug("Failed to update the endpoint",e)}),l.autoTrack("session",{enable:l.configure().autoSessionRecord}),s=!0}}},f=function(e){var t=e.event;if(t)switch(t){case"pinpointProvider_configured":if(u=!0,a&&u){var n=l.configure();!s&&n.autoSessionRecord&&l.updateEndpoint({}).catch(function(e){o.debug("Failed to update the endpoint",e)}),l.autoTrack("session",{enable:n.autoSessionRecord}),s=!0}}};i.Hub.listen("auth",l),i.Hub.listen("storage",l),i.Hub.listen("analytics",l)},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(89),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(13))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,s,a,u=1,c={},l=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){o.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(i=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0||r?o.toString():""},e.exports=s},function(e,t,n){var r=n(93).escapeAttribute;function i(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}i.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},i.prototype.addChildNode=function(e){return this.children.push(e),this},i.prototype.removeAttribute=function(e){return delete this.attributes[e],this},i.prototype.toString=function(){for(var e=Boolean(this.children.length),t="<"+this.name,n=this.attributes,i=0,o=Object.keys(n);i"+this.children.map(function(e){return e.toString()}).join("")+"":"/>")},e.exports={XmlNode:i}},function(e,t){e.exports={escapeAttribute:function(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(//g,">").replace(/"/g,""")}}},function(e,t,n){var r=n(95).escapeElement;function i(e){this.value=e}i.prototype.toString=function(){return r(""+this.value)},e.exports={XmlText:i}},function(e,t){e.exports={escapeElement:function(e){return e.replace(/&/g,"&").replace(//g,">")}}},function(e,t){function n(e,t){if(!n.services.hasOwnProperty(e))throw new Error("InvalidService: Failed to load api for "+e);return n.services[e][t]}n.services={},e.exports=n},function(e,t,n){(function(t){var r=n(0),i=n(44),o=n(98),s=r.util.inherit,a=0;r.Service=s({constructor:function(e){if(!this.loadServiceClass)throw r.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});if(t){var n=r.util.copy(e),i=new t(e);return Object.defineProperty(i,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),i._clientId=++a,i}this.initialize(e)},initialize:function(e){var n=r.config[this.serviceIdentifier];if(this.config=new r.Config(r.config),n&&this.config.update(n,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||o(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),r.SequentialExecutor.call(this),r.Service.addDefaultMonitoringListeners(this),this.config.clientSideMonitoring&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",function(e){t.nextTick(function(){i.eventHandler(e)})}),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",function(e){t.nextTick(function(){i.eventHandler(e)})})}},validateService:function(){},loadServiceClass:function(e){var t=e;if(r.util.isEmpty(this.api)){if(t.apiConfig)return r.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){(t=new r.Config(r.config)).update(e,!0);var n=t.apiVersions[this.constructor.serviceIdentifier];return n=n||t.apiVersion,this.getLatestServiceClass(n)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&r.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},getLatestServiceVersion:function(e){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?r.util.isType(e,Date)&&(e=r.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var t=Object.keys(this.constructor.services).sort(),n=null,i=t.length-1;i>=0;i--)if("*"!==t[i][t[i].length-1]&&(n=t[i]),t[i].substr(0,10)<=e)return n;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,customizeRequests:function(e){if(e){if("function"!=typeof e)throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests");this.customRequestHandler=e}else this.customRequestHandler=null},makeRequest:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t=t||{},this.config.params){var i=this.api.operations[e];i&&(t=r.util.copy(t),r.util.each(this.config.params,function(e,n){i.input.members[e]&&(void 0!==t[e]&&null!==t[e]||(t[e]=n))}))}var o=new r.Request(this,e,t);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),n&&o.send(n),o},makeUnauthenticatedRequest:function(e,t,n){"function"==typeof t&&(n=t,t={});var r=this.makeRequest(e,t).toUnauthenticated();return n?r.send(n):r},waitFor:function(e,t,n){return new r.ResourceWaiter(this,e).wait(t,n)},addAllRequestListeners:function(e){for(var t=[r.events,r.EventListeners.Core,this.serviceInterface(),r.EventListeners.CorePost],n=0;n299?(t.AwsException=n.error.code,t.AwsExceptionMessage=n.error.message):(t.SdkException=n.error.code||n.error.name,t.SdkExceptionMessage=n.error.message),t},attachMonitoringEmitter:function(e){var t,n,i,o,s,a,u=0,c=this;e.on("validate",function(){o=r.util.realClock.now(),a=Date.now()},!0),e.on("sign",function(){n=r.util.realClock.now(),t=Date.now(),s=e.httpRequest.region,u++},!0),e.on("validateResponse",function(){i=Math.round(r.util.realClock.now()-n)}),e.addNamedListener("API_CALL_ATTEMPT","success",function(){var n=c.apiAttemptEvent(e);n.Timestamp=t,n.AttemptLatency=i>=0?i:0,n.Region=s,c.emit("apiCallAttempt",[n])}),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",function(){var o=c.attemptFailEvent(e);o.Timestamp=t,i=i||Math.round(r.util.realClock.now()-n),o.AttemptLatency=i>=0?i:0,o.Region=s,c.emit("apiCallAttempt",[o])}),e.addNamedListener("API_CALL","complete",function(){var t=c.apiCallEvent(e);if(t.AttemptCount=u,!(t.AttemptCount<=0)){t.Timestamp=a;var n=Math.round(r.util.realClock.now()-o);t.Latency=n>=0?n:0,c.emit("apiCall",[t])}})},setupRequestListeners:function(){},getSignerClass:function(e){var t,n=null,i="";e&&(i=(n=(e.service.api.operations||{})[e.operation]||null)?n.authtype:"");return t=this.config.signatureVersion?this.config.signatureVersion:"v4"===i||"v4-unsigned-body"===i?"v4":this.api.signatureVersion,r.Signers.RequestSigner.getVersion(t)},serviceInterface:function(){switch(this.api.protocol){case"ec2":case"query":return r.EventListeners.Query;case"json":return r.EventListeners.Json;case"rest-json":return r.EventListeners.RestJson;case"rest-xml":return r.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},successfulResponse:function(e){return e.httpResponse.statusCode<300},numRetries:function(){return void 0!==this.config.maxRetries?this.config.maxRetries:this.defaultRetryCount},retryDelays:function(e){return r.util.calculateRetryDelay(e,this.config.retryDelayOptions)},retryableError:function(e){return!!this.timeoutError(e)||(!!this.networkingError(e)||(!!this.expiredCredentialsError(e)||(!!this.throttledError(e)||e.statusCode>=500)))},networkingError:function(e){return"NetworkingError"===e.code},timeoutError:function(e){return"TimeoutError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},clockSkewError:function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},getSkewCorrectedDate:function(){return new Date(Date.now()+this.config.systemClockOffset)},applyClockOffset:function(e){e&&(this.config.systemClockOffset=e-Date.now())},isClockSkewed:function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e4},throttledError:function(e){switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"TooManyRequestsException":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!=typeof e)return e;var t=e;return t=(t=(t=t.replace(/\{service\}/g,this.api.endpointPrefix)).replace(/\{region\}/g,this.config.region)).replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new r.Endpoint(e,this.config)},paginationConfig:function(e,t){var n=this.api.operations[e].paginator;if(!n){if(t){var i=new Error;throw r.util.error(i,"No pagination configuration for "+e)}return null}return n}}),r.util.update(r.Service,{defineMethods:function(e){r.util.each(e.prototype.api.operations,function(t){e.prototype[t]||("none"===e.prototype.api.operations[t].authtype?e.prototype[t]=function(e,n){return this.makeUnauthenticatedRequest(t,e,n)}:e.prototype[t]=function(e,n){return this.makeRequest(t,e,n)})})},defineService:function(e,t,n){r.Service._serviceMap[e]=!0,Array.isArray(t)||(n=t,t=[]);var i=s(r.Service,n||{});if("string"==typeof e){r.Service.addVersions(i,t);var o=i.serviceIdentifier||e;i.serviceIdentifier=o}else i.prototype.api=e,r.Service.defineMethods(i);if(r.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&r.util.clientSideMonitoring){var a=r.util.clientSideMonitoring.Publisher,u=r.util.clientSideMonitoring.configProvider;this.prototype.publisher=new a(u())}return r.SequentialExecutor.call(i.prototype),r.Service.addDefaultMonitoringListeners(i.prototype),i},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var n=0;n=0)return e.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",t();r.util.computeSha256(o,function(n,r){n?t(n):(e.httpRequest.headers["X-Amz-Content-Sha256"]=r,t())})}else t()}}),e("SET_CONTENT_LENGTH","afterBuild",function(e){var t=function(e){if(!e.service.api.operations)return"";var t=e.service.api.operations[e.operation];return t?t.authtype:""}(e);if(void 0===e.httpRequest.headers["Content-Length"])try{var n=r.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=n}catch(e){if(-1===t.indexOf("unsigned-body"))throw e;return}}),e("SET_HTTP_HOST","afterBuild",function(e){e.httpRequest.headers.Host=e.httpRequest.endpoint.host}),e("RESTART","restart",function(){var e=this.response.error;e&&e.retryable&&(this.httpRequest=new r.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(e){e?t(e):o()}):o()}),e("HTTP_HEADERS","httpHeaders",function(e,t,n,i){n.httpResponse.statusCode=e,n.httpResponse.statusMessage=i,n.httpResponse.headers=t,n.httpResponse.body=new r.util.Buffer(""),n.httpResponse.buffers=[],n.httpResponse.numBytes=0;var o=t.date||t.Date,s=n.request.service;if(o){var a=Date.parse(o);s.config.correctClockSkew&&s.isClockSkewed(a)&&s.applyClockOffset(a)}}),e("HTTP_DATA","httpData",function(e,t){if(e){if(r.util.isNode()){t.httpResponse.numBytes+=e.length;var n=t.httpResponse.headers["content-length"],i={loaded:t.httpResponse.numBytes,total:n};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(new r.util.Buffer(e))}}),e("HTTP_DONE","httpDone",function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=r.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes,delete e.httpResponse.buffers}),e("FINALIZE_ERROR","retry",function(e){e.httpResponse.statusCode&&(e.error.statusCode=e.httpResponse.statusCode,void 0===e.error.retryable&&(e.error.retryable=this.service.retryableError(e.error,this)))}),e("INVALIDATE_CREDENTIALS","retry",function(e){if(e.error)switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=!0,e.request.service.config.credentials.expired=!0}}),e("EXPIRED_SIGNATURE","retry",function(e){var t=e.error;t&&"string"==typeof t.code&&"string"==typeof t.message&&t.code.match(/Signature/)&&t.message.match(/expired/)&&(e.error.retryable=!0)}),e("CLOCK_SKEWED","retry",function(e){e.error&&this.service.clockSkewError(e.error)&&this.service.config.correctClockSkew&&(e.error.retryable=!0)}),e("REDIRECT","retry",function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new r.Endpoint(e.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,e.error.redirect=!0,e.error.retryable=!0)}),e("RETRY_CHECK","retry",function(e){e.error&&(e.error.redirect&&e.redirectCount=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,e,r.depth)}function u(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function c(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&I(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=l(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),E(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(n);if(0===s.length){if(I(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return p(n)}var c,S="",C=!1,T=["{","}"];(f(n)&&(C=!0,T=["[","]"]),I(n))&&(S=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(S=" "+RegExp.prototype.toString.call(n)),_(n)&&(S=" "+Date.prototype.toUTCString.call(n)),E(n)&&(S=" "+p(n)),0!==s.length||C&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=C?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,S,T)):T[0]+S+T[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),N(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(n)?l(e,u.value,null):l(e,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function f(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return S(e)&&"[object RegExp]"===C(e)}function S(e){return"object"==typeof e&&null!==e}function _(e){return S(e)&&"[object Date]"===C(e)}function E(e){return S(e)&&("[object Error]"===C(e)||e instanceof Error)}function I(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(v(o)&&(o=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=e.pid;s[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else s[n]=function(){};return s[n]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=f,t.isBoolean=h,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=S,t.isDate=_,t.isError=E,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(103);var w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":"),[e.getDate(),w[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(104),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(A&&e[A]){var t;if("function"!=typeof(t=e[A]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,A,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],o=0;o=0){u=!0;var c=0}var l=function(){u&&c!==a?i.emit("error",t.util.error(new Error("Stream content length mismatch. Received "+c+" of "+a+" bytes."),{code:"StreamContentLengthMismatch"})):2===t.HttpClient.streamsApiVersion?i.end():i.emit("end")},p=s.httpResponse.createUnbufferedStream();if(2===t.HttpClient.streamsApiVersion)if(u){var d=new n.PassThrough;d._write=function(e){return e&&e.length&&(c+=e.length),n.PassThrough.prototype._write.apply(this,arguments)},d.on("end",l),i.on("error",function(e){u=!1,p.unpipe(d),d.emit("end"),d.end()}),p.pipe(d).pipe(i,{end:!1})}else p.pipe(i);else u&&p.on("data",function(e){e&&e.length&&(c+=e.length)}),p.on("data",function(e){i.emit("data",e)}),p.on("end",l);p.on("error",function(e){u=!1,i.emit("error",e)})}}),i},emitEvent:function(e,n,r){"function"==typeof n&&(r=n,n=null),r||(r=function(){}),n||(n=this.eventParameters(e,this.response)),t.SequentialExecutor.prototype.emit.call(this,e,n,function(e){e&&(this.response.error=e),r.call(this,e)})},eventParameters:function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},presign:function(e,n){return n||"function"!=typeof e||(n=e,e=null),(new t.Signers.Presign).sign(this.toGet(),e,n)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this._unAuthenticated=!0,this.removeListener("validate",t.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",t.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),t.Request.addPromisesToClass=function(e){this.prototype.promise=function(){var t=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(e,n){t.on("complete",function(t){t.error?n(t.error):e(Object.defineProperty(t.data||{},"$response",{value:t}))}),t.runTo()})}},t.Request.deletePromisesFromClass=function(){delete this.prototype.promise},t.util.addPromises(t.Request),t.util.mixin(t.Request,t.SequentialExecutor)}).call(this,n(9))},function(e,t){function n(e,t){this.currentState=t||null,this.states=e||{}}n.prototype.runTo=function(e,t,n,r){"function"==typeof e&&(r=n,n=t,t=e,e=null);var i=this,o=i.states[i.currentState];o.fn.call(n||i,r,function(r){if(r){if(!o.fail)return t?t.call(n,r):null;i.currentState=o.fail}else{if(!o.accept)return t?t.call(n):null;i.currentState=o.accept}if(i.currentState===e)return t?t.call(n,r):null;i.runTo(e,t,n,r)})},n.prototype.addState=function(e,t,n,r){return"function"==typeof t?(r=t,t=null,n=null):"function"==typeof n&&(r=n,n=null),this.currentState||(this.currentState=e),this.states[e]={accept:t,fail:n,fn:r},this},e.exports=n},function(e,t,n){var r=n(0),i=r.util.inherit,o=n(26);r.Response=i({constructor:function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new r.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function(e){var t,n=this.request.service,i=this.request.operation;try{t=n.paginationConfig(i,!0)}catch(e){this.error=e}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var o=r.util.copy(this.request.params);if(this.nextPageTokens){var s=t.inputToken;"string"==typeof s&&(s=[s]);for(var a=0;a=0?"&":"?";this.request.path+=o+r.util.queryParamsToString(i)},authorization:function(e,t){var n=[],r=this.credentialString(t);return n.push(this.algorithm+" Credential="+e.accessKeyId+"/"+r),n.push("SignedHeaders="+this.signedHeaders()),n.push("Signature="+this.signature(e,t)),n.join(", ")},signature:function(e,t){var n=i.getSigningKey(e,t.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return r.util.crypto.hmac(n,this.stringToSign(t),"hex")},stringToSign:function(e){var t=[];return t.push("AWS4-HMAC-SHA256"),t.push(e),t.push(this.credentialString(e)),t.push(this.hexEncodedHash(this.canonicalString())),t.join("\n")},canonicalString:function(){var e=[],t=this.request.pathname();return"s3"!==this.serviceName&&(t=r.util.uriEscapePath(t)),e.push(this.request.method),e.push(t),e.push(this.request.search()),e.push(this.canonicalHeaders()+"\n"),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join("\n")},canonicalHeaders:function(){var e=[];r.util.each.call(this,this.request.headers,function(t,n){e.push([t,n])}),e.sort(function(e,t){return e[0].toLowerCase()604800){throw r.util.error(new Error,{code:"InvalidExpiryTime",message:"Presigning does not support expiry time greater than a week with SigV4 signing.",retryable:!1})}e.httpRequest.headers[o]=t}else{if(n!==r.Signers.S3)throw r.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});var i=e.service?e.service.getSkewCorrectedDate():r.util.date.getDate();e.httpRequest.headers[o]=parseInt(r.util.date.unixTimestamp(i)+t,10).toString()}}function a(e){var t=e.httpRequest.endpoint,n=r.util.urlParse(e.httpRequest.path),i={};n.search&&(i=r.util.queryStringParse(n.search.substr(1)));var s=e.httpRequest.headers.Authorization.split(" ");if("AWS"===s[0])s=s[1].split(":"),i.AWSAccessKeyId=s[0],i.Signature=s[1],r.util.each(e.httpRequest.headers,function(e,t){e===o&&(e="Expires"),0===e.indexOf("x-amz-meta-")&&(delete i[e],e=e.toLowerCase()),i[e]=t}),delete e.httpRequest.headers[o],delete i.Authorization,delete i.Host;else if("AWS4-HMAC-SHA256"===s[0]){s.shift();var a=s.join(" ").match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}t.pathname=n.pathname,t.search=r.util.queryParamsToString(i)}r.Signers.Presign=i({sign:function(e,t,n){if(e.httpRequest.headers[o]=t||3600,e.on("build",s),e.on("sign",a),e.removeListener("afterBuild",r.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",r.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!n){if(e.build(),e.response.error)throw e.response.error;return r.util.urlFormat(e.httpRequest.endpoint)}e.build(function(){this.response.error?n(this.response.error):n(null,r.util.urlFormat(e.httpRequest.endpoint))})}}),e.exports=r.Signers.Presign},function(e,t,n){var r=n(0);r.ParamValidator=r.util.inherit({constructor:function(e){!0!==e&&void 0!==e||(e={min:!0}),this.validation=e},validate:function(e,t,n){if(this.errors=[],this.validateMember(e,t||{},n||"params"),this.errors.length>1){var i=this.errors.join("\n* ");throw i="There were "+this.errors.length+" validation errors:\n* "+i,r.util.error(new Error(i),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function(e,t){this.errors.push(r.util.error(new Error(t),{code:e}))},validateStructure:function(e,t,n){var r;this.validateType(t,n,["object"],"structure");for(var i=0;e.required&&i= 1, but found "'+t+'" for '+n)},validatePattern:function(e,t,n){this.validation.pattern&&void 0!==e.pattern&&(new RegExp(e.pattern).test(t)||this.fail("PatternMatchError",'Provided value "'+t+'" does not match regex pattern /'+e.pattern+"/ for "+n))},validateRange:function(e,t,n,r){this.validation.min&&void 0!==e.min&&t= "+e.min+", but found "+t+" for "+n),this.validation.max&&void 0!==e.max&&t>e.max&&this.fail("MaxRangeError","Expected "+r+" <= "+e.max+", but found "+t+" for "+n)},validateEnum:function(e,t,n){this.validation.enum&&void 0!==e.enum&&-1===e.enum.indexOf(t)&&this.fail("EnumError","Found string value of "+t+", but expected "+e.enum.join("|")+" for "+n)},validateType:function(e,t,n,i){if(null==e)return!1;for(var o=!1,s=0;su)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=p,c=d,a=l;var h=(1e4*(268435455&(p+=122192928e5))+d)%4294967296;o[r++]=h>>>24&255,o[r++]=h>>>16&255,o[r++]=h>>>8&255,o[r++]=255&h;var m=p/4294967296*1e4&268435455;o[r++]=m>>>8&255,o[r++]=255&m,o[r++]=m>>>24&15|16,o[r++]=m>>>16&255,o[r++]=l>>>8|128,o[r++]=255&l;for(var g=e.node||s,y=0;y<6;++y)o[r+y]=g[y];return t||i(o)}},function(e,t,n){var r=n(54),i=n(55);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){var r=n(121),i=n(125),o=n(126),s=n(127);e.exports={createHash:function(e){if("md5"===(e=e.toLowerCase()))return new i;if("sha256"===e)return new s;if("sha1"===e)return new o;throw new Error("Hash algorithm "+e+" is not supported in the browser SDK")},createHmac:function(e,t){if("md5"===(e=e.toLowerCase()))return new r(i,t);if("sha256"===e)return new r(s,t);if("sha1"===e)return new r(o,t);throw new Error("HMAC algorithm "+e+" is not supported in the browser SDK")},createSign:function(){throw new Error("createSign is not implemented in the browser")}}},function(e,t,n){var r=n(19);function i(e,t){this.hash=new e,this.outer=new e;var n=function(e,t){var n=r.convertToBuffer(t);if(n.byteLength>e.BLOCK_SIZE){var i=new e;i.update(n),n=i.digest()}var o=new Uint8Array(e.BLOCK_SIZE);return o.set(n),o}(e,t),i=new Uint8Array(e.BLOCK_SIZE);i.set(n);for(var o=0;o0?r-4:r,p=0;p>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===s&&(t=i[e.charCodeAt(p)]<<2|i[e.charCodeAt(p+1)]>>4,a[u++]=255&t);1===s&&(t=i[e.charCodeAt(p)]<<10|i[e.charCodeAt(p+1)]<<4|i[e.charCodeAt(p+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;sa?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;a0)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 l(e,t,n){for(var i,o,s=[],a=t;a>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){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,l=-7,p=n?i-1:0,d=n?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+p],p+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+p],p+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=c}return(f?-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,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,m=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+p>=1?d/u:d*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=h,a/=256,i-=8);for(s=s<0;e[n+f]=255&s,f+=h,s/=256,c-=8);e[n+f-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(19),i=n(2).Buffer,o=64;function s(){this.state=[1732584193,4023233417,2562383102,271733878],this.buffer=new DataView(new ArrayBuffer(o)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}function a(e,t,n,r,i,o){return((t=(t+e&4294967295)+(r+o&4294967295)&4294967295)<>>32-i)+n&4294967295}function u(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function c(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function p(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}e.exports=s,s.BLOCK_SIZE=o,s.prototype.update=function(e){if(r.isEmptyData(e))return this;if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=r.convertToBuffer(e),n=0,i=t.byteLength;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),i--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},s.prototype.digest=function(e){if(!this.finished){var t=this.buffer,n=this.bufferLength,r=8*this.bytesHashed;if(t.setUint8(this.bufferLength++,128),n%o>=o-8){for(var s=this.bufferLength;s>>0,!0),t.setUint32(o-4,Math.floor(r/4294967296),!0),this.hashBuffer(),this.finished=!0}var a=new DataView(new ArrayBuffer(16));for(s=0;s<4;s++)a.setUint32(4*s,this.state[s],!0);var u=new i(a.buffer,a.byteOffset,a.byteLength);return e?u.toString(e):u},s.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3];n=u(n,r,i,o,e.getUint32(0,!0),7,3614090360),o=u(o,n,r,i,e.getUint32(4,!0),12,3905402710),i=u(i,o,n,r,e.getUint32(8,!0),17,606105819),r=u(r,i,o,n,e.getUint32(12,!0),22,3250441966),n=u(n,r,i,o,e.getUint32(16,!0),7,4118548399),o=u(o,n,r,i,e.getUint32(20,!0),12,1200080426),i=u(i,o,n,r,e.getUint32(24,!0),17,2821735955),r=u(r,i,o,n,e.getUint32(28,!0),22,4249261313),n=u(n,r,i,o,e.getUint32(32,!0),7,1770035416),o=u(o,n,r,i,e.getUint32(36,!0),12,2336552879),i=u(i,o,n,r,e.getUint32(40,!0),17,4294925233),r=u(r,i,o,n,e.getUint32(44,!0),22,2304563134),n=u(n,r,i,o,e.getUint32(48,!0),7,1804603682),o=u(o,n,r,i,e.getUint32(52,!0),12,4254626195),i=u(i,o,n,r,e.getUint32(56,!0),17,2792965006),n=c(n,r=u(r,i,o,n,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=c(o,n,r,i,e.getUint32(24,!0),9,3225465664),i=c(i,o,n,r,e.getUint32(44,!0),14,643717713),r=c(r,i,o,n,e.getUint32(0,!0),20,3921069994),n=c(n,r,i,o,e.getUint32(20,!0),5,3593408605),o=c(o,n,r,i,e.getUint32(40,!0),9,38016083),i=c(i,o,n,r,e.getUint32(60,!0),14,3634488961),r=c(r,i,o,n,e.getUint32(16,!0),20,3889429448),n=c(n,r,i,o,e.getUint32(36,!0),5,568446438),o=c(o,n,r,i,e.getUint32(56,!0),9,3275163606),i=c(i,o,n,r,e.getUint32(12,!0),14,4107603335),r=c(r,i,o,n,e.getUint32(32,!0),20,1163531501),n=c(n,r,i,o,e.getUint32(52,!0),5,2850285829),o=c(o,n,r,i,e.getUint32(8,!0),9,4243563512),i=c(i,o,n,r,e.getUint32(28,!0),14,1735328473),n=l(n,r=c(r,i,o,n,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=l(o,n,r,i,e.getUint32(32,!0),11,2272392833),i=l(i,o,n,r,e.getUint32(44,!0),16,1839030562),r=l(r,i,o,n,e.getUint32(56,!0),23,4259657740),n=l(n,r,i,o,e.getUint32(4,!0),4,2763975236),o=l(o,n,r,i,e.getUint32(16,!0),11,1272893353),i=l(i,o,n,r,e.getUint32(28,!0),16,4139469664),r=l(r,i,o,n,e.getUint32(40,!0),23,3200236656),n=l(n,r,i,o,e.getUint32(52,!0),4,681279174),o=l(o,n,r,i,e.getUint32(0,!0),11,3936430074),i=l(i,o,n,r,e.getUint32(12,!0),16,3572445317),r=l(r,i,o,n,e.getUint32(24,!0),23,76029189),n=l(n,r,i,o,e.getUint32(36,!0),4,3654602809),o=l(o,n,r,i,e.getUint32(48,!0),11,3873151461),i=l(i,o,n,r,e.getUint32(60,!0),16,530742520),n=p(n,r=l(r,i,o,n,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=p(o,n,r,i,e.getUint32(28,!0),10,1126891415),i=p(i,o,n,r,e.getUint32(56,!0),15,2878612391),r=p(r,i,o,n,e.getUint32(20,!0),21,4237533241),n=p(n,r,i,o,e.getUint32(48,!0),6,1700485571),o=p(o,n,r,i,e.getUint32(12,!0),10,2399980690),i=p(i,o,n,r,e.getUint32(40,!0),15,4293915773),r=p(r,i,o,n,e.getUint32(4,!0),21,2240044497),n=p(n,r,i,o,e.getUint32(32,!0),6,1873313359),o=p(o,n,r,i,e.getUint32(60,!0),10,4264355552),i=p(i,o,n,r,e.getUint32(24,!0),15,2734768916),r=p(r,i,o,n,e.getUint32(52,!0),21,1309151649),n=p(n,r,i,o,e.getUint32(16,!0),6,4149444226),o=p(o,n,r,i,e.getUint32(44,!0),10,3174756917),i=p(i,o,n,r,e.getUint32(8,!0),15,718787259),r=p(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}},function(e,t,n){var r=n(2).Buffer,i=n(19);new Uint32Array([1518500249,1859775393,-1894007588,-899497514]),Math.pow(2,53);function o(){this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=new Uint32Array(80),this.offset=0,this.shift=24,this.totalLength=0}e.exports=o,o.BLOCK_SIZE=64,o.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=(e=i.convertToBuffer(e)).length;this.totalLength+=8*t;for(var n=0;n14||14===this.offset&&this.shift<24)&&this.processBlock(),this.offset=14,this.shift=24,this.write(0),this.write(0),this.write(this.totalLength>0xffffffffff?this.totalLength/1099511627776:0),this.write(this.totalLength>4294967295?this.totalLength/4294967296:0);for(var t=24;t>=0;t-=8)this.write(this.totalLength>>t);var n=new r(20),i=new DataView(n.buffer);return i.setUint32(0,this.h0,!1),i.setUint32(4,this.h1,!1),i.setUint32(8,this.h2,!1),i.setUint32(12,this.h3,!1),i.setUint32(16,this.h4,!1),e?n.toString(e):n},o.prototype.processBlock=function(){for(var e=16;e<80;e++){var t=this.block[e-3]^this.block[e-8]^this.block[e-14]^this.block[e-16];this.block[e]=t<<1|t>>>31}var n,r,i=this.h0,o=this.h1,s=this.h2,a=this.h3,u=this.h4;for(e=0;e<80;e++){e<20?(n=a^o&(s^a),r=1518500249):e<40?(n=o^s^a,r=1859775393):e<60?(n=o&s|a&(o|s),r=2400959708):(n=o^s^a,r=3395469782);var c=(i<<5|i>>>27)+n+u+r+(0|this.block[e]);u=a,a=s,s=o<<30|o>>>2,o=i,i=c}for(this.h0=this.h0+i|0,this.h1=this.h1+o|0,this.h2=this.h2+s|0,this.h3=this.h3+a|0,this.h4=this.h4+u|0,this.offset=0,e=0;e<16;e++)this.block[e]=0}},function(e,t,n){var r=n(2).Buffer,i=n(19),o=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]),s=Math.pow(2,53)-1;function a(){this.state=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}e.exports=a,a.BLOCK_SIZE=64,a.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=0,n=(e=i.convertToBuffer(e)).byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>s)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0);return this},a.prototype.digest=function(e){if(!this.finished){var t=8*this.bytesHashed,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(n.setUint8(this.bufferLength++,128),i%64>=56){for(var o=this.bufferLength;o<64;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<56;o++)n.setUint8(o,0);n.setUint32(56,Math.floor(t/4294967296),!0),n.setUint32(60,t),this.hashBuffer(),this.finished=!0}var s=new r(32);for(o=0;o<8;o++)s[4*o]=this.state[o]>>>24&255,s[4*o+1]=this.state[o]>>>16&255,s[4*o+2]=this.state[o]>>>8&255,s[4*o+3]=this.state[o]>>>0&255;return e?s.toString(e):s},a.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],p=0;p<64;p++){if(p<16)this.temp[p]=(255&e[4*p])<<24|(255&e[4*p+1])<<16|(255&e[4*p+2])<<8|255&e[4*p+3];else{var d=this.temp[p-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[p]=(f+this.temp[p-7]|0)+(h+this.temp[p-16]|0)}var m=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(l+(o[p]+this.temp[p]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;l=c,c=u,u=a,a=s+m|0,s=i,i=r,r=n,n=m+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=l}},function(e,t,n){(function(e,r){var i;/*! https://mths.be/punycode v1.4.1 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=36,l=1,p=26,d=38,f=700,h=72,m=128,g="-",y=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=c-l,E=Math.floor,I=String.fromCharCode;function C(e){throw new RangeError(S[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function w(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(b,".")).split("."),t).join(".")}function N(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function R(e,t,n){var r=0;for(e=n?E(e/f):e>>1,e+=E(e/t);e>_*p>>1;r+=c)e=E(e/_);return E(r+(_+1)*e/(e+d))}function P(e){var t,n,r,i,o,s,a,d,f,y,v,b=[],S=e.length,_=0,I=m,T=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r=128&&C("not-basic"),b.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=S&&C("invalid-input"),((d=(v=e.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||d>E((u-_)/s))&&C("overflow"),_+=d*s,!(d<(f=a<=T?l:a>=T+p?p:a-T));a+=c)s>E(u/(y=c-f))&&C("overflow"),s*=y;T=R(_-o,t=b.length+1,0==o),E(_/t)>u-I&&C("overflow"),I+=E(_/t),_%=t,b.splice(_++,0,I)}return A(b)}function O(e){var t,n,r,i,o,s,a,d,f,y,v,b,S,_,T,w=[];for(b=(e=N(e)).length,t=m,n=0,o=h,s=0;s=t&&vE((u-n)/(S=r+1))&&C("overflow"),n+=(a-t)*S,t=a,s=0;su&&C("overflow"),v==t){for(d=n,f=c;!(d<(y=f<=o?l:f>=o+p?p:f-o));f+=c)T=d-y,_=c-y,w.push(I(k(y+T%_,0))),d=E(T/_);w.push(I(k(d,0))),o=R(n,S,r==i),n=0,++r}++n,++t}return w.join("")}a={version:"1.4.1",ucs2:{decode:N,encode:A},decode:P,encode:O,toASCII:function(e){return w(e,function(e){return v.test(e)?"xn--"+O(e):e})},toUnicode:function(e){return w(e,function(e){return y.test(e)?P(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return a}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(129)(e),n(13))},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";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 l=0;l=0?(p=m.substr(0,g),d=m.substr(g+1)):(p=m,d=""),f=decodeURIComponent(p),h=decodeURIComponent(d),r(s,f)?i(s[f])?s[f].push(h):s[f]=[s[f],h]:s[f]=h}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-1&&(e[t]++,0===e[t]);t--);}o.fromNumber=function(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(e+" is too large (or, if negative, too small) to represent as an Int64");for(var t=new Uint8Array(8),n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&s(t),new o(t)},o.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&s(e),parseInt(e.toString("hex"),16)*(t?-1:1)},o.prototype.toString=function(){return String(this.valueOf())},e.exports={Int64:o}},function(e,t,n){var r=n(0).util,i=n(57).toBuffer,o=4,s=2*o,a=4,u=s+2*a;e.exports={splitMessage:function(e){if(r.Buffer.isBuffer(e)||(e=i(e)),e.length=this.HEADERS_RECEIVED&&!p&&(u.statusCode=l.status,u.headers=s.parseHeaders(l.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers,l.statusText),p=!0),this.readyState===this.DONE&&s.finishRequest(l,u)},!1),l.upload.addEventListener("progress",function(e){u.emit("sendProgress",e)}),l.addEventListener("progress",function(e){u.emit("receiveProgress",e)},!1),l.addEventListener("timeout",function(){o(r.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),l.addEventListener("error",function(){o(r.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),l.addEventListener("abort",function(){o(r.util.error(new Error("Request aborted"),{code:"RequestAbortedError"}))},!1),n(u),l.open(e.method,c,!1!==t.xhrAsync),r.util.each(e.headers,function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&l.setRequestHeader(e,t)}),t.timeout&&!1!==t.xhrAsync&&(l.timeout=t.timeout),t.xhrWithCredentials&&(l.withCredentials=!0);try{l.responseType="arraybuffer"}catch(e){}try{e.body?l.send(e.body):l.send()}catch(t){if(!e.body||"object"!=typeof e.body.buffer)throw t;l.send(e.body.buffer)}return u},parseHeaders:function(e){var t={};return r.util.arrayEach(e.split(/\r?\n/),function(e){var n=e.split(":",1)[0],r=e.substring(n.length+2);n.length>0&&(t[n.toLowerCase()]=r)}),t},finishRequest:function(e,t){var n;if("arraybuffer"===e.responseType&&e.response){var i=e.response;n=new r.util.Buffer(i.byteLength);for(var o=new Uint8Array(i),s=0;s0&&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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=function(){for(var e=[],t=0;t0&&(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,l=h(u,c);for(n=0;n=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=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},i=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=[],i=1;i=r[o]){var s=console.log.bind(console);"WARN"===t&&console.warn&&(s=console.warn.bind(console));var a="["+t+"] "+this._ts()+" "+this.name;if(1===n.length&&"string"==typeof n[0])s(a+" - "+n[0]);else if(1===n.length)s(a,n[0]);else if("string"==typeof n[0]){var u=n.slice(1);1===u.length&&(u=u[0]),s(a+" - "+n[0],u)}else s(a,n)}},e.prototype.log=function(){for(var e=[],t=0;t0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map(function(n){t.putVocabulariesForLanguage(n,e[n])})},e}();t.I18n=i},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]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]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](new Date).getTime()?(d.debug("token not expired"),this._setCredentialsFromFederation({provider:n,token:i,user:r,identity_id:s,expires_at:o})):a._refreshHandlers[n]&&"function"==typeof a._refreshHandlers[n]?(d.debug("getting refreshed jwt token from federation provider"),a._refreshHandlers[n]().then(function(e){return d.debug("refresh federated token sucessfully",e),i=e.token,s=e.identity_id,o=e.expires_at,a._setCredentialsFromFederation({provider:n,token:i,user:r,identity_id:s,expires_at:o})}).catch(function(e){return d.debug("refresh federated token failed",e),t.clear(),Promise.reject("refreshing federation token failed: "+e)})):(d.debug("no refresh handler for provider:",n),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._isExpired=function(e){if(!e)return d.debug("no credentials for expiration check"),!0;d.debug("is this credentials expired?",e);var t=(new Date).getTime(),n=e.expired,r=e.expireTime;return!(!n&&r>t+6e5)},e.prototype._setCredentialsForGuest=function(){return i(this,void 0,void 0,function(){var e,t,n,r,s,a,c,l=this;return o(this,function(p){switch(p.label){case 0:if(e=!1,d.debug("setting credentials for guest"),t=this._config,n=t.identityPoolId,r=t.region,t.mandatorySignIn)return[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")];if(!n)return d.debug("No Cognito Federated Identity pool provided"),[2,Promise.reject("No Cognito Federated Identity pool provided")];s=void 0,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this._storageSync];case 2:return p.sent(),s=this._storage.getItem("CognitoIdentityId-"+n),[3,4];case 3:return a=p.sent(),d.debug("Failed to get the cached identityId",a),[3,4];case 4:return c=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:n,IdentityId:s||void 0},{region:r}),this,[2,this._loadCredentials(c,"guest",!1,null).then(function(e){return e}).catch(function(t){return i(l,void 0,void 0,function(){var i;return o(this,function(o){return"ResourceNotFoundException"!==t.code||t.message!=="Identity '"+s+"' not found."||e?[2,t]:(e=!0,d.debug("Failed to load guest credentials"),this._storage.removeItem("CognitoIdentityId-"+n),c.clearCachedId(),i=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:n,IdentityId:void 0},{region:r}),[2,this._loadCredentials(i,"guest",!1,null)])})})})]}})})},e.prototype._setCredentialsFromAWS=function(){var e=u.AWS.config.credentials;d.debug("setting credentials from aws");return e instanceof u.AWS.Credentials?Promise.resolve(e):(d.debug("AWS.config.credentials is not an instance of AWS Credentials"),Promise.reject("AWS.config.credentials is not an instance of AWS Credentials"))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,i=(e.user,e.expires_at,{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,c=s.region;if(!a)return d.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");var l=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:a,IdentityId:r,Logins:o},{region:c});return this._loadCredentials(l,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){d.debug("set credentials from session");var t=e.getIdToken().getJwtToken(),n=this._config,r=n.region,i=n.userPoolId,o=n.identityPoolId;if(!o)return d.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");var s={};s["cognito-idp."+r+".amazonaws.com/"+i]=t;var a=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:o,Logins:s},{region:r});return this._loadCredentials(a,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var s=this,a=this,u=this._config.identityPoolId;return new Promise(function(c,l){e.get(function(f){return i(s,void 0,void 0,function(){var i,s,h,m,g,y;return o(this,function(o){switch(o.label){case 0:if(f)return d.debug("Failed to load credentials",e),l(f),[2];if(d.debug("Load credentials successfully",e),a._credentials=e,a._credentials.authenticated=n,a._credentials_source=t,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,h=r.token,m=r.expires_at,g=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:h,user:i,expires_at:m,identity_id:g}))}catch(e){d.debug("Failed to put federated info into auth storage",e)}p.default.Cache&&"function"==typeof p.default.Cache.setItem?p.default.Cache.setItem("federatedInfo",{provider:s,token:h,user:i,expires_at:m,identity_id:g},{priority:1}):d.debug("No Cache module registered in Amplify")}if("guest"!==t)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._storageSync];case 2:return o.sent(),this._storage.setItem("CognitoIdentityId-"+u,e.identityId),[3,4];case 3:return y=o.sent(),d.debug("Failed to cache identityId",y),[3,4];case 4:return c(a._credentials),[2]}})})})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(d.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return i(this,void 0,void 0,function(){var e,t,n;return o(this,function(r){switch(r.label){case 0:return e=this._config,t=e.identityPoolId,n=e.region,t&&new u.AWS.CognitoIdentityCredentials({IdentityPoolId:t},{region:n}).clearCachedId(),this._credentials=null,this._credentials_source=null,this._storage.removeItem("aws-amplify-federatedInfo"),p.default.Cache&&"function"==typeof p.default.Cache.setItem?[4,p.default.Cache.removeItem("federatedInfo")]:[3,2];case 1:return r.sent(),[3,3];case 2:d.debug("No Cache module registered in Amplify"),r.label=3;case 3:return[2]}})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}();t.Credentials=f;var h=new f(null);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(167);t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=n(11),o=n(21),s=function(){function e(){this._logger=new r.ConsoleLogger("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(!i.default.browserOrNode().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../../node_modules/ts-jest/preprocessor.js"},testRegex:"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",moduleFileExtensions:["ts","tsx","js","json","jsx"],testEnvironment:"jsdom",mapCoverage:!0,coverageThreshold:{global:{branches:0,functions:0,lines:0,statements:0}},testURL:"http://localhost/",coveragePathIgnorePatterns:["/node_modules/"]},license:"Apache-2.0",main:"./lib/index.js",module:"./lib/index.js",name:"@aws-amplify/core",publishConfig:{access:"public"},"react-native":{"./lib/ClientDevice":"./lib/ClientDevice/reactnative.js","./lib/RNComponents":"./lib/RNComponents/reactnative.js","./lib/StorageHelper":"./lib/StorageHelper/reactnative.js"},repository:{type:"git",url:"git+https://github.com/aws/aws-amplify.git"},scripts:{build:"npm run clean && tsc && webpack","build-with-test":"npm run clean && npm test && tsc && webpack",clean:"rimraf lib lib-esm dist",format:"tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",lint:"tslint 'src/**/*.ts'",test:"tslint 'src/**/*.ts' && jest --coverage"},typings:"./lib/index.d.ts",version:"1.0.22"}},function(e,t,n){n(10);var r=n(0),i=r.Service,o=r.apiLoader;o.services.mobileanalytics={},r.MobileAnalytics=i.defineService("mobileanalytics",["2014-06-05"]),Object.defineProperty(o.services.mobileanalytics,"2014-06-05",{get:function(){return n(170)},enumerable:!0,configurable:!0}),e.exports=r.MobileAnalytics},function(e){e.exports={version:"2.0",metadata:{apiVersion:"2014-06-05",endpointPrefix:"mobileanalytics",serviceFullName:"Amazon Mobile Analytics",serviceId:"Mobile Analytics",signatureVersion:"v4",protocol:"rest-json"},operations:{PutEvents:{http:{requestUri:"/2014-06-05/events",responseCode:202},input:{type:"structure",required:["events","clientContext"],members:{events:{type:"list",member:{type:"structure",required:["eventType","timestamp"],members:{eventType:{},timestamp:{},session:{type:"structure",members:{id:{},duration:{type:"long"},startTimestamp:{},stopTimestamp:{}}},version:{},attributes:{type:"map",key:{},value:{}},metrics:{type:"map",key:{},value:{type:"double"}}}}},clientContext:{location:"header",locationName:"x-amz-Client-Context"},clientContextEncoding:{location:"header",locationName:"x-amz-Client-Context-Encoding"}}}}},shapes:{}}},function(e,t,n){n(10);var r=n(0),i=r.Service,o=r.apiLoader;o.services.pinpoint={},r.Pinpoint=i.defineService("pinpoint",["2016-12-01"]),Object.defineProperty(o.services.pinpoint,"2016-12-01",{get:function(){return n(172)},enumerable:!0,configurable:!0}),e.exports=r.Pinpoint},function(e){e.exports={metadata:{apiVersion:"2016-12-01",endpointPrefix:"pinpoint",signingName:"mobiletargeting",serviceFullName:"Amazon Pinpoint",serviceId:"Pinpoint",protocol:"rest-json",jsonVersion:"1.1",uid:"pinpoint-2016-12-01",signatureVersion:"v4"},operations:{CreateApp:{http:{requestUri:"/v1/apps",responseCode:201},input:{type:"structure",members:{CreateApplicationRequest:{type:"structure",members:{Name:{}},required:[]}},required:["CreateApplicationRequest"],payload:"CreateApplicationRequest"},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},CreateCampaign:{http:{requestUri:"/v1/apps/{application-id}/campaigns",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteCampaignRequest:{shape:"S7"}},required:["ApplicationId","WriteCampaignRequest"],payload:"WriteCampaignRequest"},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},CreateExportJob:{http:{requestUri:"/v1/apps/{application-id}/jobs/export",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},ExportJobRequest:{type:"structure",members:{RoleArn:{},S3UrlPrefix:{},SegmentId:{},SegmentVersion:{type:"integer"}},required:[]}},required:["ApplicationId","ExportJobRequest"],payload:"ExportJobRequest"},output:{type:"structure",members:{ExportJobResponse:{shape:"Sx"}},required:["ExportJobResponse"],payload:"ExportJobResponse"}},CreateImportJob:{http:{requestUri:"/v1/apps/{application-id}/jobs/import",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},ImportJobRequest:{type:"structure",members:{DefineSegment:{type:"boolean"},ExternalId:{},Format:{},RegisterEndpoints:{type:"boolean"},RoleArn:{},S3Url:{},SegmentId:{},SegmentName:{}},required:[]}},required:["ApplicationId","ImportJobRequest"],payload:"ImportJobRequest"},output:{type:"structure",members:{ImportJobResponse:{shape:"S15"}},required:["ImportJobResponse"],payload:"ImportJobResponse"}},CreateSegment:{http:{requestUri:"/v1/apps/{application-id}/segments",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteSegmentRequest:{shape:"S18"}},required:["ApplicationId","WriteSegmentRequest"],payload:"WriteSegmentRequest"},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},DeleteAdmChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},DeleteApnsChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},DeleteApnsSandboxChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},DeleteApnsVoipChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},DeleteApnsVoipSandboxChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},DeleteApp:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},DeleteBaiduChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},DeleteCampaign:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"}},required:["CampaignId","ApplicationId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},DeleteEmailChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},DeleteEndpoint:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"}},required:["ApplicationId","EndpointId"]},output:{type:"structure",members:{EndpointResponse:{shape:"S2v"}},required:["EndpointResponse"],payload:"EndpointResponse"}},DeleteEventStream:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},DeleteGcmChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},DeleteSegment:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},DeleteSmsChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}},DeleteUserEndpoints:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/users/{user-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},UserId:{location:"uri",locationName:"user-id"}},required:["ApplicationId","UserId"]},output:{type:"structure",members:{EndpointsResponse:{shape:"S3f"}},required:["EndpointsResponse"],payload:"EndpointsResponse"}},GetAdmChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},GetApnsChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},GetApnsSandboxChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},GetApnsVoipChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},GetApnsVoipSandboxChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},GetApp:{http:{method:"GET",requestUri:"/v1/apps/{application-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},GetApplicationSettings:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/settings",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationSettingsResource:{shape:"S3v"}},required:["ApplicationSettingsResource"],payload:"ApplicationSettingsResource"}},GetApps:{http:{method:"GET",requestUri:"/v1/apps",responseCode:200},input:{type:"structure",members:{PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}}},output:{type:"structure",members:{ApplicationsResponse:{type:"structure",members:{Item:{type:"list",member:{shape:"S5"}},NextToken:{}}}},required:["ApplicationsResponse"],payload:"ApplicationsResponse"}},GetBaiduChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},GetCampaign:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"}},required:["CampaignId","ApplicationId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},GetCampaignActivities:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/activities",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId","CampaignId"]},output:{type:"structure",members:{ActivitiesResponse:{type:"structure",members:{Item:{type:"list",member:{type:"structure",members:{ApplicationId:{},CampaignId:{},End:{},Id:{},Result:{},ScheduledStart:{},Start:{},State:{},SuccessfulEndpointCount:{type:"integer"},TimezonesCompletedCount:{type:"integer"},TimezonesTotalCount:{type:"integer"},TotalEndpointCount:{type:"integer"},TreatmentId:{}},required:[]}},NextToken:{}},required:[]}},required:["ActivitiesResponse"],payload:"ActivitiesResponse"}},GetCampaignVersion:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/versions/{version}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},Version:{location:"uri",locationName:"version"}},required:["Version","ApplicationId","CampaignId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},GetCampaignVersions:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/versions",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId","CampaignId"]},output:{type:"structure",members:{CampaignsResponse:{shape:"S4d"}},required:["CampaignsResponse"],payload:"CampaignsResponse"}},GetCampaigns:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{CampaignsResponse:{shape:"S4d"}},required:["CampaignsResponse"],payload:"CampaignsResponse"}},GetChannels:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ChannelsResponse:{type:"structure",members:{Channels:{type:"map",key:{},value:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Version:{type:"integer"}}}}},required:[]}},required:["ChannelsResponse"],payload:"ChannelsResponse"}},GetEmailChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},GetEndpoint:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"}},required:["ApplicationId","EndpointId"]},output:{type:"structure",members:{EndpointResponse:{shape:"S2v"}},required:["EndpointResponse"],payload:"EndpointResponse"}},GetEventStream:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},GetExportJob:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/export/{job-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},JobId:{location:"uri",locationName:"job-id"}},required:["ApplicationId","JobId"]},output:{type:"structure",members:{ExportJobResponse:{shape:"Sx"}},required:["ExportJobResponse"],payload:"ExportJobResponse"}},GetExportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/export",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{ExportJobsResponse:{shape:"S4w"}},required:["ExportJobsResponse"],payload:"ExportJobsResponse"}},GetGcmChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},GetImportJob:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/import/{job-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},JobId:{location:"uri",locationName:"job-id"}},required:["ApplicationId","JobId"]},output:{type:"structure",members:{ImportJobResponse:{shape:"S15"}},required:["ImportJobResponse"],payload:"ImportJobResponse"}},GetImportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/import",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{ImportJobsResponse:{shape:"S54"}},required:["ImportJobsResponse"],payload:"ImportJobsResponse"}},GetSegment:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},GetSegmentExportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/jobs/export",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{ExportJobsResponse:{shape:"S4w"}},required:["ExportJobsResponse"],payload:"ExportJobsResponse"}},GetSegmentImportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/jobs/import",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{ImportJobsResponse:{shape:"S54"}},required:["ImportJobsResponse"],payload:"ImportJobsResponse"}},GetSegmentVersion:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/versions/{version}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"},Version:{location:"uri",locationName:"version"}},required:["SegmentId","Version","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},GetSegmentVersions:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/versions",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentsResponse:{shape:"S5g"}},required:["SegmentsResponse"],payload:"SegmentsResponse"}},GetSegments:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{SegmentsResponse:{shape:"S5g"}},required:["SegmentsResponse"],payload:"SegmentsResponse"}},GetSmsChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}},GetUserEndpoints:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/users/{user-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},UserId:{location:"uri",locationName:"user-id"}},required:["ApplicationId","UserId"]},output:{type:"structure",members:{EndpointsResponse:{shape:"S3f"}},required:["EndpointsResponse"],payload:"EndpointsResponse"}},PhoneNumberValidate:{http:{requestUri:"/v1/phone/number/validate",responseCode:200},input:{type:"structure",members:{NumberValidateRequest:{type:"structure",members:{IsoCountryCode:{},PhoneNumber:{}}}},required:["NumberValidateRequest"],payload:"NumberValidateRequest"},output:{type:"structure",members:{NumberValidateResponse:{type:"structure",members:{Carrier:{},City:{},CleansedPhoneNumberE164:{},CleansedPhoneNumberNational:{},Country:{},CountryCodeIso2:{},CountryCodeNumeric:{},County:{},OriginalCountryCodeIso2:{},OriginalPhoneNumber:{},PhoneType:{},PhoneTypeCode:{type:"integer"},Timezone:{},ZipCode:{}}}},required:["NumberValidateResponse"],payload:"NumberValidateResponse"}},PutEventStream:{http:{requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteEventStream:{type:"structure",members:{DestinationStreamArn:{},RoleArn:{}},required:[]}},required:["ApplicationId","WriteEventStream"],payload:"WriteEventStream"},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},PutEvents:{http:{requestUri:"/v1/apps/{application-id}/events",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EventsRequest:{type:"structure",members:{BatchItem:{type:"map",key:{},value:{type:"structure",members:{Endpoint:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}},Events:{type:"map",key:{},value:{type:"structure",members:{Attributes:{shape:"S62"},ClientSdkVersion:{},EventType:{},Metrics:{shape:"S30"},Session:{type:"structure",members:{Duration:{type:"integer"},Id:{},StartTimestamp:{},StopTimestamp:{}},required:[]},Timestamp:{}},required:[]}}},required:[]}}},required:[]}},required:["ApplicationId","EventsRequest"],payload:"EventsRequest"},output:{type:"structure",members:{EventsResponse:{type:"structure",members:{Results:{type:"map",key:{},value:{type:"structure",members:{EndpointItemResponse:{type:"structure",members:{Message:{},StatusCode:{type:"integer"}}},EventsItemResponse:{type:"map",key:{},value:{type:"structure",members:{Message:{},StatusCode:{type:"integer"}}}}}}}}}},required:["EventsResponse"],payload:"EventsResponse"}},RemoveAttributes:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/attributes/{attribute-type}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},AttributeType:{location:"uri",locationName:"attribute-type"},UpdateAttributesRequest:{type:"structure",members:{Blacklist:{shape:"Sz"}}}},required:["AttributeType","ApplicationId","UpdateAttributesRequest"],payload:"UpdateAttributesRequest"},output:{type:"structure",members:{AttributesResource:{type:"structure",members:{ApplicationId:{},AttributeType:{},Attributes:{shape:"Sz"}},required:[]}},required:["AttributesResource"],payload:"AttributesResource"}},SendMessages:{http:{requestUri:"/v1/apps/{application-id}/messages",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},MessageRequest:{type:"structure",members:{Addresses:{type:"map",key:{},value:{type:"structure",members:{BodyOverride:{},ChannelType:{},Context:{shape:"S62"},RawContent:{},Substitutions:{shape:"S2w"},TitleOverride:{}}}},Context:{shape:"S62"},Endpoints:{shape:"S6j"},MessageConfiguration:{shape:"S6l"},TraceId:{}},required:[]}},required:["ApplicationId","MessageRequest"],payload:"MessageRequest"},output:{type:"structure",members:{MessageResponse:{type:"structure",members:{ApplicationId:{},EndpointResult:{shape:"S6v"},RequestId:{},Result:{type:"map",key:{},value:{type:"structure",members:{DeliveryStatus:{},MessageId:{},StatusCode:{type:"integer"},StatusMessage:{},UpdatedToken:{}},required:[]}}},required:[]}},required:["MessageResponse"],payload:"MessageResponse"}},SendUsersMessages:{http:{requestUri:"/v1/apps/{application-id}/users-messages",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SendUsersMessageRequest:{type:"structure",members:{Context:{shape:"S62"},MessageConfiguration:{shape:"S6l"},TraceId:{},Users:{shape:"S6j"}},required:[]}},required:["ApplicationId","SendUsersMessageRequest"],payload:"SendUsersMessageRequest"},output:{type:"structure",members:{SendUsersMessageResponse:{type:"structure",members:{ApplicationId:{},RequestId:{},Result:{type:"map",key:{},value:{shape:"S6v"}}},required:[]}},required:["SendUsersMessageResponse"],payload:"SendUsersMessageResponse"}},UpdateAdmChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ADMChannelRequest:{type:"structure",members:{ClientId:{},ClientSecret:{},Enabled:{type:"boolean"}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","ADMChannelRequest"],payload:"ADMChannelRequest"},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},UpdateApnsChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{APNSChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSChannelRequest"],payload:"APNSChannelRequest"},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},UpdateApnsSandboxChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{APNSSandboxChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSSandboxChannelRequest"],payload:"APNSSandboxChannelRequest"},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},UpdateApnsVoipChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{APNSVoipChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSVoipChannelRequest"],payload:"APNSVoipChannelRequest"},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},UpdateApnsVoipSandboxChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{APNSVoipSandboxChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSVoipSandboxChannelRequest"],payload:"APNSVoipSandboxChannelRequest"},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},UpdateApplicationSettings:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/settings",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteApplicationSettingsRequest:{type:"structure",members:{CampaignHook:{shape:"Sl"},CloudWatchMetricsEnabled:{type:"boolean"},Limits:{shape:"Sn"},QuietTime:{shape:"Sk"}}}},required:["ApplicationId","WriteApplicationSettingsRequest"],payload:"WriteApplicationSettingsRequest"},output:{type:"structure",members:{ApplicationSettingsResource:{shape:"S3v"}},required:["ApplicationSettingsResource"],payload:"ApplicationSettingsResource"}},UpdateBaiduChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},BaiduChannelRequest:{type:"structure",members:{ApiKey:{},Enabled:{type:"boolean"},SecretKey:{}},required:[]}},required:["ApplicationId","BaiduChannelRequest"],payload:"BaiduChannelRequest"},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},UpdateCampaign:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},WriteCampaignRequest:{shape:"S7"}},required:["CampaignId","ApplicationId","WriteCampaignRequest"],payload:"WriteCampaignRequest"},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},UpdateEmailChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EmailChannelRequest:{type:"structure",members:{Enabled:{type:"boolean"},FromAddress:{},Identity:{},RoleArn:{}},required:[]}},required:["ApplicationId","EmailChannelRequest"],payload:"EmailChannelRequest"},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},UpdateEndpoint:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"},EndpointRequest:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}}},required:["ApplicationId","EndpointId","EndpointRequest"],payload:"EndpointRequest"},output:{type:"structure",members:{MessageBody:{shape:"S7y"}},required:["MessageBody"],payload:"MessageBody"}},UpdateEndpointsBatch:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/endpoints",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointBatchRequest:{type:"structure",members:{Item:{type:"list",member:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Id:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}}}},required:[]}},required:["ApplicationId","EndpointBatchRequest"],payload:"EndpointBatchRequest"},output:{type:"structure",members:{MessageBody:{shape:"S7y"}},required:["MessageBody"],payload:"MessageBody"}},UpdateGcmChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},GCMChannelRequest:{type:"structure",members:{ApiKey:{},Enabled:{type:"boolean"}},required:[]}},required:["ApplicationId","GCMChannelRequest"],payload:"GCMChannelRequest"},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},UpdateSegment:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"},WriteSegmentRequest:{shape:"S18"}},required:["SegmentId","ApplicationId","WriteSegmentRequest"],payload:"WriteSegmentRequest"},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},UpdateSmsChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SMSChannelRequest:{type:"structure",members:{Enabled:{type:"boolean"},SenderId:{},ShortCode:{}},required:[]}},required:["ApplicationId","SMSChannelRequest"],payload:"SMSChannelRequest"},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}}},shapes:{S5:{type:"structure",members:{Id:{},Name:{}},required:[]},S7:{type:"structure",members:{AdditionalTreatments:{type:"list",member:{type:"structure",members:{MessageConfiguration:{shape:"Sa"},Schedule:{shape:"Si"},SizePercent:{type:"integer"},TreatmentDescription:{},TreatmentName:{}},required:[]}},Description:{},HoldoutPercent:{type:"integer"},Hook:{shape:"Sl"},IsPaused:{type:"boolean"},Limits:{shape:"Sn"},MessageConfiguration:{shape:"Sa"},Name:{},Schedule:{shape:"Si"},SegmentId:{},SegmentVersion:{type:"integer"},TreatmentDescription:{},TreatmentName:{}}},Sa:{type:"structure",members:{ADMMessage:{shape:"Sb"},APNSMessage:{shape:"Sb"},BaiduMessage:{shape:"Sb"},DefaultMessage:{shape:"Sb"},EmailMessage:{type:"structure",members:{Body:{},FromAddress:{},HtmlBody:{},Title:{}},required:[]},GCMMessage:{shape:"Sb"},SMSMessage:{type:"structure",members:{Body:{},MessageType:{},SenderId:{}}}}},Sb:{type:"structure",members:{Action:{},Body:{},ImageIconUrl:{},ImageSmallIconUrl:{},ImageUrl:{},JsonBody:{},MediaUrl:{},RawContent:{},SilentPush:{type:"boolean"},TimeToLive:{type:"integer"},Title:{},Url:{}},required:[]},Si:{type:"structure",members:{EndTime:{},Frequency:{},IsLocalTime:{type:"boolean"},QuietTime:{shape:"Sk"},StartTime:{},Timezone:{}},required:[]},Sk:{type:"structure",members:{End:{},Start:{}}},Sl:{type:"structure",members:{LambdaFunctionName:{},Mode:{},WebUrl:{}}},Sn:{type:"structure",members:{Daily:{type:"integer"},MaximumDuration:{type:"integer"},MessagesPerSecond:{type:"integer"},Total:{type:"integer"}}},Sp:{type:"structure",members:{AdditionalTreatments:{type:"list",member:{type:"structure",members:{Id:{},MessageConfiguration:{shape:"Sa"},Schedule:{shape:"Si"},SizePercent:{type:"integer"},State:{shape:"Ss"},TreatmentDescription:{},TreatmentName:{}},required:[]}},ApplicationId:{},CreationDate:{},DefaultState:{shape:"Ss"},Description:{},HoldoutPercent:{type:"integer"},Hook:{shape:"Sl"},Id:{},IsPaused:{type:"boolean"},LastModifiedDate:{},Limits:{shape:"Sn"},MessageConfiguration:{shape:"Sa"},Name:{},Schedule:{shape:"Si"},SegmentId:{},SegmentVersion:{type:"integer"},State:{shape:"Ss"},TreatmentDescription:{},TreatmentName:{},Version:{type:"integer"}},required:[]},Ss:{type:"structure",members:{CampaignStatus:{}}},Sx:{type:"structure",members:{ApplicationId:{},CompletedPieces:{type:"integer"},CompletionDate:{},CreationDate:{},Definition:{type:"structure",members:{RoleArn:{},S3UrlPrefix:{},SegmentId:{},SegmentVersion:{type:"integer"}},required:[]},FailedPieces:{type:"integer"},Failures:{shape:"Sz"},Id:{},JobStatus:{},TotalFailures:{type:"integer"},TotalPieces:{type:"integer"},TotalProcessed:{type:"integer"},Type:{}},required:[]},Sz:{type:"list",member:{}},S15:{type:"structure",members:{ApplicationId:{},CompletedPieces:{type:"integer"},CompletionDate:{},CreationDate:{},Definition:{type:"structure",members:{DefineSegment:{type:"boolean"},ExternalId:{},Format:{},RegisterEndpoints:{type:"boolean"},RoleArn:{},S3Url:{},SegmentId:{},SegmentName:{}},required:[]},FailedPieces:{type:"integer"},Failures:{shape:"Sz"},Id:{},JobStatus:{},TotalFailures:{type:"integer"},TotalPieces:{type:"integer"},TotalProcessed:{type:"integer"},Type:{}},required:[]},S18:{type:"structure",members:{Dimensions:{shape:"S19"},Name:{},SegmentGroups:{shape:"S1q"}},required:[]},S19:{type:"structure",members:{Attributes:{shape:"S1a"},Behavior:{type:"structure",members:{Recency:{type:"structure",members:{Duration:{},RecencyType:{}},required:[]}}},Demographic:{type:"structure",members:{AppVersion:{shape:"S1i"},Channel:{shape:"S1i"},DeviceType:{shape:"S1i"},Make:{shape:"S1i"},Model:{shape:"S1i"},Platform:{shape:"S1i"}}},Location:{type:"structure",members:{Country:{shape:"S1i"},GPSPoint:{type:"structure",members:{Coordinates:{type:"structure",members:{Latitude:{type:"double"},Longitude:{type:"double"}},required:[]},RangeInKilometers:{type:"double"}},required:[]}}},Metrics:{type:"map",key:{},value:{type:"structure",members:{ComparisonOperator:{},Value:{type:"double"}}}},UserAttributes:{shape:"S1a"}}},S1a:{type:"map",key:{},value:{type:"structure",members:{AttributeType:{},Values:{shape:"Sz"}},required:[]}},S1i:{type:"structure",members:{DimensionType:{},Values:{shape:"Sz"}},required:[]},S1q:{type:"structure",members:{Groups:{type:"list",member:{type:"structure",members:{Dimensions:{type:"list",member:{shape:"S19"}},SourceSegments:{type:"list",member:{type:"structure",members:{Id:{},Version:{type:"integer"}}}},SourceType:{},Type:{}},required:[]}},Include:{}},required:[]},S20:{type:"structure",members:{ApplicationId:{},CreationDate:{},Dimensions:{shape:"S19"},Id:{},ImportDefinition:{type:"structure",members:{ChannelCounts:{type:"map",key:{},value:{type:"integer"}},ExternalId:{},Format:{},RoleArn:{},S3Url:{},Size:{type:"integer"}},required:[]},LastModifiedDate:{},Name:{},SegmentGroups:{shape:"S1q"},SegmentType:{},Version:{type:"integer"}},required:[]},S26:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S29:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2c:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2f:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2i:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2n:{type:"structure",members:{ApplicationId:{},CreationDate:{},Credential:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2s:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},FromAddress:{},HasCredential:{type:"boolean"},Id:{},Identity:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},MessagesPerSecond:{type:"integer"},Platform:{},RoleArn:{},Version:{type:"integer"}},required:[]},S2v:{type:"structure",members:{Address:{},ApplicationId:{},Attributes:{shape:"S2w"},ChannelType:{},CohortId:{},CreationDate:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Id:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}},S2w:{type:"map",key:{},value:{shape:"Sz"}},S2y:{type:"structure",members:{AppVersion:{},Locale:{},Make:{},Model:{},ModelVersion:{},Platform:{},PlatformVersion:{},Timezone:{}}},S2z:{type:"structure",members:{City:{},Country:{},Latitude:{type:"double"},Longitude:{type:"double"},PostalCode:{},Region:{}}},S30:{type:"map",key:{},value:{type:"double"}},S31:{type:"structure",members:{UserAttributes:{shape:"S2w"},UserId:{}}},S34:{type:"structure",members:{ApplicationId:{},DestinationStreamArn:{},ExternalId:{},LastModifiedDate:{},LastUpdatedBy:{},RoleArn:{}},required:[]},S37:{type:"structure",members:{ApplicationId:{},CreationDate:{},Credential:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S3c:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},PromotionalMessagesPerSecond:{type:"integer"},SenderId:{},ShortCode:{},TransactionalMessagesPerSecond:{type:"integer"},Version:{type:"integer"}},required:[]},S3f:{type:"structure",members:{Item:{type:"list",member:{shape:"S2v"}}},required:[]},S3v:{type:"structure",members:{ApplicationId:{},CampaignHook:{shape:"Sl"},LastModifiedDate:{},Limits:{shape:"Sn"},QuietTime:{shape:"Sk"}},required:[]},S4d:{type:"structure",members:{Item:{type:"list",member:{shape:"Sp"}},NextToken:{}},required:[]},S4w:{type:"structure",members:{Item:{type:"list",member:{shape:"Sx"}},NextToken:{}},required:[]},S54:{type:"structure",members:{Item:{type:"list",member:{shape:"S15"}},NextToken:{}},required:[]},S5g:{type:"structure",members:{Item:{type:"list",member:{shape:"S20"}},NextToken:{}},required:[]},S62:{type:"map",key:{},value:{}},S6j:{type:"map",key:{},value:{type:"structure",members:{BodyOverride:{},Context:{shape:"S62"},RawContent:{},Substitutions:{shape:"S2w"},TitleOverride:{}}}},S6l:{type:"structure",members:{ADMMessage:{type:"structure",members:{Action:{},Body:{},ConsolidationKey:{},Data:{shape:"S62"},ExpiresAfter:{},IconReference:{},ImageIconUrl:{},ImageUrl:{},MD5:{},RawContent:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},Title:{},Url:{}}},APNSMessage:{type:"structure",members:{Action:{},Badge:{type:"integer"},Body:{},Category:{},CollapseId:{},Data:{shape:"S62"},MediaUrl:{},PreferredAuthenticationMethod:{},Priority:{},RawContent:{},SilentPush:{type:"boolean"},Sound:{},Substitutions:{shape:"S2w"},ThreadId:{},TimeToLive:{type:"integer"},Title:{},Url:{}}},BaiduMessage:{type:"structure",members:{Action:{},Body:{},Data:{shape:"S62"},IconReference:{},ImageIconUrl:{},ImageUrl:{},RawContent:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},TimeToLive:{type:"integer"},Title:{},Url:{}}},DefaultMessage:{type:"structure",members:{Body:{},Substitutions:{shape:"S2w"}}},DefaultPushNotificationMessage:{type:"structure",members:{Action:{},Body:{},Data:{shape:"S62"},SilentPush:{type:"boolean"},Substitutions:{shape:"S2w"},Title:{},Url:{}}},GCMMessage:{type:"structure",members:{Action:{},Body:{},CollapseKey:{},Data:{shape:"S62"},IconReference:{},ImageIconUrl:{},ImageUrl:{},Priority:{},RawContent:{},RestrictedPackageName:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},TimeToLive:{type:"integer"},Title:{},Url:{}}},SMSMessage:{type:"structure",members:{Body:{},Keyword:{},MessageType:{},OriginationNumber:{},SenderId:{},Substitutions:{shape:"S2w"}}}},required:[]},S6v:{type:"map",key:{},value:{type:"structure",members:{Address:{},DeliveryStatus:{},MessageId:{},StatusCode:{type:"integer"},StatusMessage:{},UpdatedToken:{}},required:[]}},S7y:{type:"structure",members:{Message:{},RequestID:{}}}}}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(31),s=n(62),a=new(n(1).ConsoleLogger)("Cache"),u=function(e){function t(t){var n=this,r=t?Object.assign({},o.defaultConfig,t):o.defaultConfig;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 i(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=o.getCurrTime(),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 o.getCurrTime()>=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),a.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;nt.priority?-1:e.priority5)a.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var s=this.fillCacheItem(r,t,i);if(s.byteSize>this.config.itemMaxSize)a.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var u=this.config.storage.getItem(r);if(u&&this._removeItem(r,JSON.parse(u).byteSize),this._isCacheFull(s.byteSize)){var c=this._findValidKeys();if(this._isCacheFull(s.byteSize)){var l=this._sizeToPop(s.byteSize);this._popOutItems(c,l)}}this._setItem(r,s)}catch(e){a.warn("setItem failed! "+e)}}}else a.warn("The value of item should not be undefined!");else a.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){a.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 a.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 a.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){a.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){a.warn("removeItem failed! "+e)}},t.prototype.clear=function(){a.log("Clear Cache");for(var e=[],t=0;t=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},t.getCurrTime=function(){return(new Date).getTime()},t.isInteger=function(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)};var i={},o=function(){function e(){}return e.clear=function(){i={}},e.getItem=function(e){return i[e]||null},e.setItem=function(e,t){i[e]=t},e.removeItem=function(e){delete i[e]},e}();t.CacheObject=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e){this.key=e||"",this.prevNode=null,this.nextNode=null}}(),i=function(){function e(){this.head=new r,this.tail=new r,this.hashtable={},this.length=0,this.head.nextNode=this.tail,this.tail.prevNode=this.head}return e.prototype.insertNodeToHead=function(e){var t=this.head.nextNode;this.head.nextNode=e,e.nextNode=t,e.prevNode=this.head,t.prevNode=e,this.length=this.length+1},e.prototype.removeNode=function(e){e.prevNode.nextNode=e.nextNode,e.nextNode.prevNode=e.prevNode,e.prevNode=null,e.nextNode=null,this.length=this.length-1},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.refresh=function(e){var t=this.hashtable[e];this.removeNode(t),this.insertNodeToHead(t)},e.prototype.insertItem=function(e){var t=new r(e);this.hashtable[e]=t,this.insertNodeToHead(t)},e.prototype.getLastItem=function(){return this.tail.prevNode.key},e.prototype.removeItem=function(e){var t=this.hashtable[e];this.removeNode(t),delete this.hashtable[e]},e.prototype.getSize=function(){return this.length},e.prototype.containsKey=function(e){return e in this.hashtable},e.prototype.clearList=function(){for(var e=0,t=Object.keys(this.hashtable);e=n.expires},t.prototype._removeItem=function(e,t){this.cacheList[t].removeItem(e),this._decreaseCurSizeInBytes(JSON.parse(o.CacheObject.getItem(e)).byteSize),o.CacheObject.removeItem(e)},t.prototype._setItem=function(e,t,n){this.cacheList[n].insertItem(e),this._increaseCurSizeInBytes(t.byteSize),o.CacheObject.setItem(e,JSON.stringify(t))},t.prototype._isCacheFull=function(e){return this.curSizeInBytes+e>this.config.capacityInBytes},t.prototype.containsKey=function(e){for(var t=this.config.keyPrefix+e,n=0;n5)a.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var s=this.fillCacheItem(r,t,i);if(s.byteSize>this.config.itemMaxSize)a.warn("Item with key: "+e+" you are trying to put into is too big!");else{var u=this.containsKey(e);-1!==u&&this._removeItem(r,u-1);for(var c=this.maxPriority-1;this._isCacheFull(s.byteSize)&&c>=0;)if(this.cacheList[c].isEmpty())c-=1;else{var l=this.cacheList[c].getLastItem();this._removeItem(l,c)}this._setItem(r,s,Number(s.priority)-1)}}}else a.warn("The value of item should not be undefined!");else a.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return a.warn("Invalid key: should not be empty or 'CurSize'"),null;var i=this.containsKey(e);if(-1!==i){if(!this._isExpired(r)){n=o.CacheObject.getItem(r);var s=JSON.parse(n);return this.cacheList[s.priority-1].refresh(r),s.data}this._removeItem(r,i-1)}if(t&&void 0!==t.callback){var u=t.callback();return null!==u&&this.setItem(e,u,t),u}return null},t.prototype.removeItem=function(e){var t=this.config.keyPrefix+e,n=this.containsKey(e);-1!==n&&this._removeItem(t,n-1)},t.prototype.clear=function(){for(var e=0;ea)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,u=m,i=d;var y=(1e4*(268435455&(h+=122192928e5))+m)%4294967296;l[c++]=y>>>24&255,l[c++]=y>>>16&255,l[c++]=y>>>8&255,l[c++]=255&y;var v=h/4294967296*1e4&268435455;l[c++]=v>>>8&255,l[c++]=255&v,l[c++]=v>>>24&15|16,l[c++]=v>>>16&255,l[c++]=d>>>8|128,l[c++]=255&d;for(var b=0;b<6;++b)l[c+b]=p[b];return t||s(l)}},function(e,t,n){var r=n(63),i=n(64);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});var r=n(180);t.PageViewTracker=r.default;var i=n(182);t.EventTracker=i.default;var o=n(188);t.SessionTracker=o.default},function(e,t,n){"use strict";var r=this&&this.__awaiter||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){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||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=(i=s.trys).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]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]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]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]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]r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,a=o.words,c=0;c0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&(e="Multiple configuration errors:\n"+t.join("\n")),e)throw r.util.error(new Error,{name:"InvalidEndpoint",message:e})},shouldDisableBodySigning:function(e){var t=this.getSignerClass();return!0===this.config.s3DisableBodySigning&&t===r.Signers.V4&&"https:"===e.httpRequest.endpoint.protocol},setupRequestListeners:function(e){e.addListener("validate",this.validateScheme),e.addListener("validate",this.validateBucketEndpoint),e.addListener("validate",this.correctBucketRegionFromCache),e.addListener("validate",this.validateBucketName,!0),e.addListener("build",this.addContentType),e.addListener("build",this.populateURI),e.addListener("build",this.computeContentMd5),e.addListener("build",this.computeSseCustomerKeyMd5),e.addListener("afterBuild",this.addExpect100Continue),e.removeListener("validate",r.EventListeners.Core.VALIDATE_REGION),e.addListener("extractError",this.extractError),e.onAsync("extractError",this.requestBucketRegion),e.addListener("extractData",this.extractData),e.addListener("extractData",r.util.hoistPayloadMember),e.addListener("beforePresign",this.prepareSignedUrl),r.util.isBrowser()&&e.onAsync("retry",this.reqRegionForNetworkingError),this.shouldDisableBodySigning(e)&&(e.removeListener("afterBuild",r.EventListeners.Core.COMPUTE_SHA256),e.addListener("afterBuild",this.disableBodySigning))},validateScheme:function(e){var t=e.params,n=e.httpRequest.endpoint.protocol;if((t.SSECustomerKey||t.CopySourceSSECustomerKey)&&"https:"!==n){throw r.util.error(new Error,{code:"ConfigError",message:"Cannot send SSE keys over HTTP. Set 'sslEnabled'to 'true' in your configuration"})}},validateBucketEndpoint:function(e){if(!e.params.Bucket&&e.service.config.s3BucketEndpoint){throw r.util.error(new Error,{code:"ConfigError",message:"Cannot send requests to root API with `s3BucketEndpoint` set."})}},validateBucketName:function(e){var t=e.service.getSignatureVersion(e),n=e.params&&e.params.Bucket,i=e.params&&e.params.Key,o=n&&n.indexOf("/");if(n&&o>=0)if("string"==typeof i){e.params=r.util.copy(e.params);var s=n.substr(o+1)||"";e.params.Key=s+"/"+i,e.params.Bucket=n.substr(0,o)}else if("v4"===t){var a="Bucket names cannot contain forward slashes. Bucket: "+n;throw r.util.error(new Error,{code:"InvalidBucket",message:a})}},isValidAccelerateOperation:function(e){return-1===["createBucket","deleteBucket","listBuckets"].indexOf(e)},populateURI:function(e){var t=e.httpRequest,n=e.params.Bucket,r=e.service,i=t.endpoint;if(n&&!r.pathStyleBucketName(n)){r.config.useAccelerateEndpoint&&r.isValidAccelerateOperation(e.operation)?r.config.useDualstack?i.hostname=n+".s3-accelerate.dualstack.amazonaws.com":i.hostname=n+".s3-accelerate.amazonaws.com":r.config.s3BucketEndpoint||(i.hostname=n+"."+i.hostname);var o=i.port;i.host=80!==o&&443!==o?i.hostname+":"+i.port:i.hostname,t.virtualHostedBucket=n,r.removeVirtualHostedBucketFromPath(e)}},removeVirtualHostedBucketFromPath:function(e){var t=e.httpRequest,n=t.virtualHostedBucket;if(n&&t.path){if(e.params&&e.params.Key&&0===t.path.indexOf("/"+r.util.uriEscapePath(e.params.Key)))return;t.path=t.path.replace(new RegExp("/"+n),""),"/"!==t.path[0]&&(t.path="/"+t.path)}},addExpect100Continue:function(e){var t=e.httpRequest.headers["Content-Length"];r.util.isNode()&&t>=1048576&&(e.httpRequest.headers.Expect="100-continue")},addContentType:function(e){var t=e.httpRequest;if("GET"!==t.method&&"HEAD"!==t.method){t.headers["Content-Type"]||(t.headers["Content-Type"]="application/octet-stream");var n=t.headers["Content-Type"];if(r.util.isBrowser())if("string"!=typeof t.body||n.match(/;\s*charset=/)){t.headers["Content-Type"]=n.replace(/(;\s*charset=)(.+)$/,function(e,t,n){return t+n.toUpperCase()})}else{t.headers["Content-Type"]+="; charset=UTF-8"}}else delete t.headers["Content-Type"]},computableChecksumOperations:{putBucketCors:!0,putBucketLifecycle:!0,putBucketLifecycleConfiguration:!0,putBucketTagging:!0,deleteObjects:!0,putBucketReplication:!0},willComputeChecksums:function(e){if(this.computableChecksumOperations[e.operation])return!0;if(!this.config.computeChecksums)return!1;if(!r.util.Buffer.isBuffer(e.httpRequest.body)&&"string"!=typeof e.httpRequest.body)return!1;var t=e.service.api.operations[e.operation].input.members;return!(!e.service.shouldDisableBodySigning(e)||Object.prototype.hasOwnProperty.call(e.httpRequest.headers,"presigned-expires")||!t.ContentMD5||e.params.ContentMD5)||!(e.service.getSignerClass(e)===r.Signers.V4&&t.ContentMD5&&!t.ContentMD5.required)&&(!(!t.ContentMD5||e.params.ContentMD5)||void 0)},computeContentMd5:function(e){if(e.service.willComputeChecksums(e)){var t=r.util.crypto.md5(e.httpRequest.body,"base64");e.httpRequest.headers["Content-MD5"]=t}},computeSseCustomerKeyMd5:function(e){r.util.each({SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"},function(t,n){if(e.params[t]){var i=r.util.crypto.md5(e.params[t],"base64");e.httpRequest.headers[n]=i}})},pathStyleBucketName:function(e){return!!this.config.s3ForcePathStyle||!this.config.s3BucketEndpoint&&(!this.dnsCompatibleBucketName(e)||!(!this.config.sslEnabled||!e.match(/\./)))},dnsCompatibleBucketName:function(e){var t=e,n=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/),r=new RegExp(/(\d+\.){3}\d+/),i=new RegExp(/\.\./);return!(!t.match(n)||t.match(r)||t.match(i))},successfulResponse:function(e){var t=e.request,n=e.httpResponse;return(!o[t.operation]||!n.body.toString().match(""))&&n.statusCode<300},retryableError:function(e,t){return!(!o[t.operation]||200!==e.statusCode)||(!t._requestRegionForBucket||!t.service.bucketRegionCache[t._requestRegionForBucket])&&(!(!e||"RequestTimeout"!==e.code)||(e&&-1!=s.indexOf(e.code)&&e.region&&e.region!=t.httpRequest.region?(t.httpRequest.region=e.region,301===e.statusCode&&t.service.updateReqBucketRegion(t),!0):r.Service.prototype.retryableError.call(this,e,t)))},updateReqBucketRegion:function(e,t){var n=e.httpRequest;if("string"==typeof t&&t.length&&(n.region=t),n.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)){var i=e.service,o=i.config,s=o.s3BucketEndpoint;s&&delete o.s3BucketEndpoint;var a=r.util.copy(o);delete a.endpoint,a.region=n.region,n.endpoint=new r.S3(a).endpoint,i.populateURI(e),o.s3BucketEndpoint=s,n.headers.Host=n.endpoint.host,"validate"===e._asm.currentState&&(e.removeListener("build",i.populateURI),e.addListener("build",i.removeVirtualHostedBucketFromPath))}},extractData:function(e){var t=e.request;if("getBucketLocation"===t.operation){var n=e.httpResponse.body.toString().match(/>(.+)<\/Location/);delete e.data._,e.data.LocationConstraint=n?n[1]:""}var r=t.params.Bucket||null;if("deleteBucket"!==t.operation||"string"!=typeof r||e.error){var i=(e.httpResponse.headers||{})["x-amz-bucket-region"]||null;if(!i&&"createBucket"===t.operation&&!e.error){var o=t.params.CreateBucketConfiguration;i=o?"EU"===o.LocationConstraint?"eu-west-1":o.LocationConstraint:"us-east-1"}i&&r&&i!==t.service.bucketRegionCache[r]&&(t.service.bucketRegionCache[r]=i)}else t.service.clearBucketRegionCache(r);t.service.extractRequestIds(e)},extractError:function(e){var t,n={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"},i=e.request,o=e.httpResponse.statusCode,s=e.httpResponse.body||"",a=(e.httpResponse.headers||{})["x-amz-bucket-region"]||null,u=i.params.Bucket||null,c=i.service.bucketRegionCache;if(a&&u&&a!==c[u]&&(c[u]=a),n[o]&&0===s.length)u&&!a&&(t=c[u]||null)!==i.httpRequest.region&&(a=t),e.error=r.util.error(new Error,{code:n[o],message:null,region:a});else{var l=(new r.XML.Parser).parse(s.toString());l.Region&&!a?(a=l.Region,u&&a!==c[u]&&(c[u]=a)):!u||a||l.Region||(t=c[u]||null)!==i.httpRequest.region&&(a=t),e.error=r.util.error(new Error,{code:l.Code||o,message:l.Message||null,region:a})}i.service.extractRequestIds(e)},requestBucketRegion:function(e,t){var n=e.error,i=e.request,o=i.params.Bucket||null;if(!n||!o||n.region||"listObjects"===i.operation||r.util.isNode()&&"headBucket"===i.operation||400===n.statusCode&&"headObject"!==i.operation||-1===s.indexOf(n.code))return t();var a=r.util.isNode()?"headBucket":"listObjects",u={Bucket:o};"listObjects"===a&&(u.MaxKeys=0);var c=i.service[a](u);c._requestRegionForBucket=o,c.send(function(){var e=i.service.bucketRegionCache[o]||null;n.region=e,t()})},reqRegionForNetworkingError:function(e,t){if(!r.util.isBrowser())return t();var n=e.error,i=e.request,o=i.params.Bucket;if(!n||"NetworkingError"!==n.code||!o||"us-east-1"===i.httpRequest.region)return t();var s=i.service,a=s.bucketRegionCache,u=a[o]||null;if(u&&u!==i.httpRequest.region)s.updateReqBucketRegion(i,u),t();else if(s.dnsCompatibleBucketName(o))if(i.httpRequest.virtualHostedBucket){var c=s.listObjects({Bucket:o,MaxKeys:0});s.updateReqBucketRegion(c,"us-east-1"),c._requestRegionForBucket=o,c.send(function(){var e=s.bucketRegionCache[o]||null;e&&e!==i.httpRequest.region&&s.updateReqBucketRegion(i,e),t()})}else t();else s.updateReqBucketRegion(i,"us-east-1"),"us-east-1"!==a[o]&&(a[o]="us-east-1"),t()},bucketRegionCache:{},clearBucketRegionCache:function(e){var t=this.bucketRegionCache;e?"string"==typeof e&&(e=[e]):e=Object.keys(t);for(var n=0;n=1&&t.doneParts===t.numParts&&t.finishMultiPart()}))}n&&t.fillQueue.call(t)},abort:function(){this.cleanup(r.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1}))},validateBody:function(){if(this.body=this.service.config.params.Body,"string"==typeof this.body)this.body=new r.util.Buffer(this.body);else if(!this.body)throw new Error("params.Body is required");this.sliceFn=r.util.arraySliceFn(this.body)},bindServiceObject:function(e){e=e||{};if(this.service){var t=this.service,n=r.util.copy(t.config);n.signatureVersion=t.getSignatureVersion(),this.service=new t.constructor.__super__(n),this.service.config.params=r.util.merge(this.service.config.params||{},e)}else this.service=new r.S3({params:e})},adjustTotalBytes:function(){try{this.totalBytes=i(this.body)}catch(e){}if(this.totalBytes){var e=Math.ceil(this.totalBytes/this.maxTotalParts);e>this.partSize&&(this.partSize=e)}else this.totalBytes=void 0},isDoneChunking:!1,partPos:0,totalChunkedBytes:0,totalUploadedBytes:0,totalBytes:void 0,numParts:0,totalPartNumbers:0,activeParts:0,doneParts:0,parts:null,completeInfo:null,failed:!1,multipartReq:null,partBuffers:null,partBufferLength:0,fillBuffer:function(){var e=i(this.body);if(0===e)return this.isDoneChunking=!0,this.numParts=1,void this.nextChunk(this.body);for(;this.activeParts=this.queueSize)){var e=this.body.read(this.partSize-this.partBufferLength)||this.body.read();if(e&&(this.partBuffers.push(e),this.partBufferLength+=e.length,this.totalChunkedBytes+=e.length),this.partBufferLength>=this.partSize){var t=1===this.partBuffers.length?this.partBuffers[0]:o.concat(this.partBuffers);if(this.partBuffers=[],this.partBufferLength=0,t.length>this.partSize){var n=t.slice(this.partSize);this.partBuffers.push(n),this.partBufferLength+=n.length,t=t.slice(0,this.partSize)}this.nextChunk(t)}this.isDoneChunking&&!this.isDoneSending&&(t=1===this.partBuffers.length?this.partBuffers[0]:o.concat(this.partBuffers),this.partBuffers=[],this.partBufferLength=0,this.totalBytes=this.totalChunkedBytes,this.isDoneSending=!0,(0===this.numParts||t.length>0)&&(this.numParts++,this.nextChunk(t))),this.body.read(0)}},nextChunk:function(e){var t=this;if(t.failed)return null;var n=++t.totalPartNumbers;if(t.isDoneChunking&&1===n){var i={Body:e};this.tags&&(i.Tagging=this.getTaggingHeader());var o=t.service.putObject(i);return o._managedUpload=t,o.on("httpUploadProgress",t.progress).send(t.finishSinglePart),null}if(t.service.config.params.ContentMD5){var s=r.util.error(new Error("The Content-MD5 you specified is invalid for multi-part uploads."),{code:"InvalidDigest",retryable:!1});return t.cleanup(s),null}if(t.completeInfo[n]&&null!==t.completeInfo[n].ETag)return null;t.activeParts++,t.service.config.params.UploadId?t.uploadPart(e,n):t.multipartReq?t.queueChunks(e,n):(t.multipartReq=t.service.createMultipartUpload(),t.multipartReq.on("success",function(e){t.service.config.params.UploadId=e.data.UploadId,t.multipartReq=null}),t.queueChunks(e,n),t.multipartReq.on("error",function(e){t.cleanup(e)}),t.multipartReq.send())},getTaggingHeader:function(){for(var e=[],t=0;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2&&void 0!==arguments[2]?arguments[2]:r,a=void 0,u=Array.isArray(e),c=[e],l=-1,p=[],d=void 0,f=void 0,h=void 0,m=[],g=[],y=e;do{var v=++l===c.length,b=v&&0!==p.length;if(v){if(f=0===g.length?void 0:m[m.length-1],d=h,h=g.pop(),b){if(u)d=d.slice();else{var S={};for(var _ in d)d.hasOwnProperty(_)&&(S[_]=d[_]);d=S}for(var E=0,I=0;I0||(0,o.default)(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||(0,o.default)(0,"column in locationOffset is 1-indexed and must be positive")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new r.GraphQLError("Syntax Error: "+n,void 0,e,[t])};var r=n(34)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.locatedError=function(e,t,n){if(e&&Array.isArray(e.path))return e;return new r.GraphQLError(e&&e.message,e&&e.nodes||t,e&&e.source,e&&e.positions,n,e)};var r=n(34)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});var l=String.prototype.charCodeAt,p=String.prototype.slice;function d(e,t,n,r,i,o,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=o,this.next=null}function f(e){return isNaN(e)?c.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function h(e,t){var n=e.source,r=n.body,o=r.length,a=function(e,t,n){var r=e.length,i=t;for(;i=o)return new d(c.EOF,o,o,u,h,t);var y=l.call(r,a);if(y<32&&9!==y&&10!==y&&13!==y)throw(0,i.syntaxError)(n,a,"Cannot contain the invalid character "+f(y)+".");switch(y){case 33:return new d(c.BANG,a,a+1,u,h,t);case 35:return function(e,t,n,r,i){var o=e.body,s=void 0,a=t;do{s=l.call(o,++a)}while(null!==s&&(s>31||9===s));return new d(c.COMMENT,t,a,n,r,i,p.call(o,t+1,a))}(n,a,u,h,t);case 36:return new d(c.DOLLAR,a,a+1,u,h,t);case 38:return new d(c.AMP,a,a+1,u,h,t);case 40:return new d(c.PAREN_L,a,a+1,u,h,t);case 41:return new d(c.PAREN_R,a,a+1,u,h,t);case 46:if(46===l.call(r,a+1)&&46===l.call(r,a+2))return new d(c.SPREAD,a,a+3,u,h,t);break;case 58:return new d(c.COLON,a,a+1,u,h,t);case 61:return new d(c.EQUALS,a,a+1,u,h,t);case 64:return new d(c.AT,a,a+1,u,h,t);case 91:return new d(c.BRACKET_L,a,a+1,u,h,t);case 93:return new d(c.BRACKET_R,a,a+1,u,h,t);case 123:return new d(c.BRACE_L,a,a+1,u,h,t);case 124:return new d(c.PIPE,a,a+1,u,h,t);case 125:return new d(c.BRACE_R,a,a+1,u,h,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,i){var o=e.body,s=o.length,a=t+1,u=0;for(;a!==s&&null!==(u=l.call(o,a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new d(c.NAME,t,a,n,r,i,p.call(o,t,a))}(n,a,u,h,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,o,s){var a=e.body,u=n,h=t,g=!1;45===u&&(u=l.call(a,++h));if(48===u){if((u=l.call(a,++h))>=48&&u<=57)throw(0,i.syntaxError)(e,h,"Invalid number, unexpected digit after 0: "+f(u)+".")}else h=m(e,h,u),u=l.call(a,h);46===u&&(g=!0,u=l.call(a,++h),h=m(e,h,u),u=l.call(a,h));69!==u&&101!==u||(g=!0,43!==(u=l.call(a,++h))&&45!==u||(u=l.call(a,++h)),h=m(e,h,u));return new d(g?c.FLOAT:c.INT,t,h,r,o,s,p.call(a,t,h))}(n,a,y,u,h,t);case 34:return 34===l.call(r,a+1)&&34===l.call(r,a+2)?function(e,t,n,r,o){var a=e.body,u=t+3,h=u,m=0,g="";for(;u=48&&s<=57){do{s=l.call(r,++o)}while(s>=48&&s<=57);return o}throw(0,i.syntaxError)(e,o,"Invalid number, expected digit but got: "+f(s)+".")}function g(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}d.prototype.toJSON=d.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},function(e,t,n){"use strict";function r(e){for(var t=0;t0&&i(t[0]);)t.shift();for(;t.length>0&&i(t[t.length-1]);)t.pop();return t.join("\n")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Kind=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",VARIABLE:"Variable",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension",DIRECTIVE_DEFINITION:"DirectiveDefinition"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DirectiveLocation=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1,i=!1,o=arguments[1];return new n(function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=p(t,c);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return f(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(s("iterator")&&(r=p(t,u)))return new n(function(e){m(function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var s,a=r.call(t)[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=s.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}e.complete()}})});if(Array.isArray(t))return new n(function(e){m(function(){if(!e.closed){for(var n=0;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]{const e=new URLSearchParams(window.location.search).get("code");console.log(e),r.Auth.currentAuthenticatedUser().then(e=>(e=>{console.log("sendToSocket");const t=new WebSocket(o,"echo-protocol");t.onopen=function(n){t.send(e),t.close(),window.close()}})(e.signInUserSession.idToken.jwtToken)).catch(t=>{if(console.log(t),e){const e=new r.Logger("Alexander_the_auth_watcher");e.onHubCapsule=(t=>{switch(t.payload.event){case"signIn":d();break;case"configured":e.error("the Auth module is configured")}}),r.Hub.listen("auth",e)}else(()=>window.location.assign("https://"+u+"/oauth2/authorize?redirect_uri="+c+"&response_type="+p+"&client_id="+i.userPoolWebClientId))()})};d()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(86);t.AnalyticsClass=r.default;var i=n(1),o=new i.ConsoleLogger("Analytics"),s=!1,a=!1,u=!1,c=null;c||(o.debug("Create Analytics Instance"),c=new r.default);var l=c;i.default.register(l),t.default=l,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(189)),l.onHubCapsule=function(e){var t=e.channel,n=e.payload;e.source;switch(o.debug("on hub capsule "+t,n),t){case"auth":d(n);break;case"storage":p(n);break;case"analytics":f(n)}};var p=function(e){var t=e.attrs,n=e.metrics;t&&l.record({name:"Storage",attributes:t,metrics:n})},d=function(e){var t=e.event;if(t)switch(t){case"signIn":l.record({name:"_userauth.sign_in"});break;case"signUp":l.record({name:"_userauth.sign_up"});break;case"signOut":break;case"signIn_failure":l.record({name:"_userauth.auth_fail"});break;case"configured":if((a=!0)&&u){var n=l.configure();!s&&n.autoSessionRecord&&l.updateEndpoint({}).catch(function(e){o.debug("Failed to update the endpoint",e)}),l.autoTrack("session",{enable:l.configure().autoSessionRecord}),s=!0}}},f=function(e){var t=e.event;if(t)switch(t){case"pinpointProvider_configured":if(u=!0,a&&u){var n=l.configure();!s&&n.autoSessionRecord&&l.updateEndpoint({}).catch(function(e){o.debug("Failed to update the endpoint",e)}),l.autoTrack("session",{enable:n.autoSessionRecord}),s=!0}}};i.Hub.listen("auth",l),i.Hub.listen("storage",l),i.Hub.listen("analytics",l)},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(89),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(13))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,s,a,u=1,c={},l=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){h(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){o.port2.postMessage(e)}):p&&"onreadystatechange"in p.createElement("script")?(i=p.documentElement,r=function(e){var t=p.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0||r?o.toString():""},e.exports=s},function(e,t,n){var r=n(93).escapeAttribute;function i(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}i.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},i.prototype.addChildNode=function(e){return this.children.push(e),this},i.prototype.removeAttribute=function(e){return delete this.attributes[e],this},i.prototype.toString=function(){for(var e=Boolean(this.children.length),t="<"+this.name,n=this.attributes,i=0,o=Object.keys(n);i"+this.children.map(function(e){return e.toString()}).join("")+"":"/>")},e.exports={XmlNode:i}},function(e,t){e.exports={escapeAttribute:function(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(//g,">").replace(/"/g,""")}}},function(e,t,n){var r=n(95).escapeElement;function i(e){this.value=e}i.prototype.toString=function(){return r(""+this.value)},e.exports={XmlText:i}},function(e,t){e.exports={escapeElement:function(e){return e.replace(/&/g,"&").replace(//g,">")}}},function(e,t){function n(e,t){if(!n.services.hasOwnProperty(e))throw new Error("InvalidService: Failed to load api for "+e);return n.services[e][t]}n.services={},e.exports=n},function(e,t,n){(function(t){var r=n(0),i=n(44),o=n(98),s=r.util.inherit,a=0;r.Service=s({constructor:function(e){if(!this.loadServiceClass)throw r.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});if(t){var n=r.util.copy(e),i=new t(e);return Object.defineProperty(i,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),i._clientId=++a,i}this.initialize(e)},initialize:function(e){var n=r.config[this.serviceIdentifier];if(this.config=new r.Config(r.config),n&&this.config.update(n,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||o(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),r.SequentialExecutor.call(this),r.Service.addDefaultMonitoringListeners(this),this.config.clientSideMonitoring&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",function(e){t.nextTick(function(){i.eventHandler(e)})}),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",function(e){t.nextTick(function(){i.eventHandler(e)})})}},validateService:function(){},loadServiceClass:function(e){var t=e;if(r.util.isEmpty(this.api)){if(t.apiConfig)return r.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){(t=new r.Config(r.config)).update(e,!0);var n=t.apiVersions[this.constructor.serviceIdentifier];return n=n||t.apiVersion,this.getLatestServiceClass(n)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&r.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},getLatestServiceVersion:function(e){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?r.util.isType(e,Date)&&(e=r.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var t=Object.keys(this.constructor.services).sort(),n=null,i=t.length-1;i>=0;i--)if("*"!==t[i][t[i].length-1]&&(n=t[i]),t[i].substr(0,10)<=e)return n;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,customizeRequests:function(e){if(e){if("function"!=typeof e)throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests");this.customRequestHandler=e}else this.customRequestHandler=null},makeRequest:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t=t||{},this.config.params){var i=this.api.operations[e];i&&(t=r.util.copy(t),r.util.each(this.config.params,function(e,n){i.input.members[e]&&(void 0!==t[e]&&null!==t[e]||(t[e]=n))}))}var o=new r.Request(this,e,t);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),n&&o.send(n),o},makeUnauthenticatedRequest:function(e,t,n){"function"==typeof t&&(n=t,t={});var r=this.makeRequest(e,t).toUnauthenticated();return n?r.send(n):r},waitFor:function(e,t,n){return new r.ResourceWaiter(this,e).wait(t,n)},addAllRequestListeners:function(e){for(var t=[r.events,r.EventListeners.Core,this.serviceInterface(),r.EventListeners.CorePost],n=0;n299?(t.AwsException=n.error.code,t.AwsExceptionMessage=n.error.message):(t.SdkException=n.error.code||n.error.name,t.SdkExceptionMessage=n.error.message),t},attachMonitoringEmitter:function(e){var t,n,i,o,s,a,u=0,c=this;e.on("validate",function(){o=r.util.realClock.now(),a=Date.now()},!0),e.on("sign",function(){n=r.util.realClock.now(),t=Date.now(),s=e.httpRequest.region,u++},!0),e.on("validateResponse",function(){i=Math.round(r.util.realClock.now()-n)}),e.addNamedListener("API_CALL_ATTEMPT","success",function(){var n=c.apiAttemptEvent(e);n.Timestamp=t,n.AttemptLatency=i>=0?i:0,n.Region=s,c.emit("apiCallAttempt",[n])}),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",function(){var o=c.attemptFailEvent(e);o.Timestamp=t,i=i||Math.round(r.util.realClock.now()-n),o.AttemptLatency=i>=0?i:0,o.Region=s,c.emit("apiCallAttempt",[o])}),e.addNamedListener("API_CALL","complete",function(){var t=c.apiCallEvent(e);if(t.AttemptCount=u,!(t.AttemptCount<=0)){t.Timestamp=a;var n=Math.round(r.util.realClock.now()-o);t.Latency=n>=0?n:0,c.emit("apiCall",[t])}})},setupRequestListeners:function(){},getSignerClass:function(e){var t,n=null,i="";e&&(i=(n=(e.service.api.operations||{})[e.operation]||null)?n.authtype:"");return t=this.config.signatureVersion?this.config.signatureVersion:"v4"===i||"v4-unsigned-body"===i?"v4":this.api.signatureVersion,r.Signers.RequestSigner.getVersion(t)},serviceInterface:function(){switch(this.api.protocol){case"ec2":case"query":return r.EventListeners.Query;case"json":return r.EventListeners.Json;case"rest-json":return r.EventListeners.RestJson;case"rest-xml":return r.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},successfulResponse:function(e){return e.httpResponse.statusCode<300},numRetries:function(){return void 0!==this.config.maxRetries?this.config.maxRetries:this.defaultRetryCount},retryDelays:function(e){return r.util.calculateRetryDelay(e,this.config.retryDelayOptions)},retryableError:function(e){return!!this.timeoutError(e)||(!!this.networkingError(e)||(!!this.expiredCredentialsError(e)||(!!this.throttledError(e)||e.statusCode>=500)))},networkingError:function(e){return"NetworkingError"===e.code},timeoutError:function(e){return"TimeoutError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},clockSkewError:function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},getSkewCorrectedDate:function(){return new Date(Date.now()+this.config.systemClockOffset)},applyClockOffset:function(e){e&&(this.config.systemClockOffset=e-Date.now())},isClockSkewed:function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e4},throttledError:function(e){switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"TooManyRequestsException":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!=typeof e)return e;var t=e;return t=(t=(t=t.replace(/\{service\}/g,this.api.endpointPrefix)).replace(/\{region\}/g,this.config.region)).replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new r.Endpoint(e,this.config)},paginationConfig:function(e,t){var n=this.api.operations[e].paginator;if(!n){if(t){var i=new Error;throw r.util.error(i,"No pagination configuration for "+e)}return null}return n}}),r.util.update(r.Service,{defineMethods:function(e){r.util.each(e.prototype.api.operations,function(t){e.prototype[t]||("none"===e.prototype.api.operations[t].authtype?e.prototype[t]=function(e,n){return this.makeUnauthenticatedRequest(t,e,n)}:e.prototype[t]=function(e,n){return this.makeRequest(t,e,n)})})},defineService:function(e,t,n){r.Service._serviceMap[e]=!0,Array.isArray(t)||(n=t,t=[]);var i=s(r.Service,n||{});if("string"==typeof e){r.Service.addVersions(i,t);var o=i.serviceIdentifier||e;i.serviceIdentifier=o}else i.prototype.api=e,r.Service.defineMethods(i);if(r.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&r.util.clientSideMonitoring){var a=r.util.clientSideMonitoring.Publisher,u=r.util.clientSideMonitoring.configProvider;this.prototype.publisher=new a(u())}return r.SequentialExecutor.call(i.prototype),r.Service.addDefaultMonitoringListeners(i.prototype),i},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var n=0;n=0)return e.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",t();r.util.computeSha256(o,function(n,r){n?t(n):(e.httpRequest.headers["X-Amz-Content-Sha256"]=r,t())})}else t()}}),e("SET_CONTENT_LENGTH","afterBuild",function(e){var t=function(e){if(!e.service.api.operations)return"";var t=e.service.api.operations[e.operation];return t?t.authtype:""}(e);if(void 0===e.httpRequest.headers["Content-Length"])try{var n=r.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=n}catch(e){if(-1===t.indexOf("unsigned-body"))throw e;return}}),e("SET_HTTP_HOST","afterBuild",function(e){e.httpRequest.headers.Host=e.httpRequest.endpoint.host}),e("RESTART","restart",function(){var e=this.response.error;e&&e.retryable&&(this.httpRequest=new r.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(e){e?t(e):o()}):o()}),e("HTTP_HEADERS","httpHeaders",function(e,t,n,i){n.httpResponse.statusCode=e,n.httpResponse.statusMessage=i,n.httpResponse.headers=t,n.httpResponse.body=new r.util.Buffer(""),n.httpResponse.buffers=[],n.httpResponse.numBytes=0;var o=t.date||t.Date,s=n.request.service;if(o){var a=Date.parse(o);s.config.correctClockSkew&&s.isClockSkewed(a)&&s.applyClockOffset(a)}}),e("HTTP_DATA","httpData",function(e,t){if(e){if(r.util.isNode()){t.httpResponse.numBytes+=e.length;var n=t.httpResponse.headers["content-length"],i={loaded:t.httpResponse.numBytes,total:n};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(new r.util.Buffer(e))}}),e("HTTP_DONE","httpDone",function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=r.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes,delete e.httpResponse.buffers}),e("FINALIZE_ERROR","retry",function(e){e.httpResponse.statusCode&&(e.error.statusCode=e.httpResponse.statusCode,void 0===e.error.retryable&&(e.error.retryable=this.service.retryableError(e.error,this)))}),e("INVALIDATE_CREDENTIALS","retry",function(e){if(e.error)switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=!0,e.request.service.config.credentials.expired=!0}}),e("EXPIRED_SIGNATURE","retry",function(e){var t=e.error;t&&"string"==typeof t.code&&"string"==typeof t.message&&t.code.match(/Signature/)&&t.message.match(/expired/)&&(e.error.retryable=!0)}),e("CLOCK_SKEWED","retry",function(e){e.error&&this.service.clockSkewError(e.error)&&this.service.config.correctClockSkew&&(e.error.retryable=!0)}),e("REDIRECT","retry",function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new r.Endpoint(e.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,e.error.redirect=!0,e.error.retryable=!0)}),e("RETRY_CHECK","retry",function(e){e.error&&(e.error.redirect&&e.redirectCount=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,e,r.depth)}function u(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function c(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&I(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=l(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(h(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,n);if(o)return o;var s=Object.keys(n),a=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),E(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(n);if(0===s.length){if(I(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return p(n)}var c,S="",C=!1,T=["{","}"];(f(n)&&(C=!0,T=["[","]"]),I(n))&&(S=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(S=" "+RegExp.prototype.toString.call(n)),_(n)&&(S=" "+Date.prototype.toUTCString.call(n)),E(n)&&(S=" "+p(n)),0!==s.length||C&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=C?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,S,T)):T[0]+S+T[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),N(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=m(n)?l(e,u.value,null):l(e,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function f(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return S(e)&&"[object RegExp]"===C(e)}function S(e){return"object"==typeof e&&null!==e}function _(e){return S(e)&&"[object Date]"===C(e)}function E(e){return S(e)&&("[object Error]"===C(e)||e instanceof Error)}function I(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(v(o)&&(o=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=e.pid;s[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else s[n]=function(){};return s[n]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=f,t.isBoolean=h,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=S,t.isDate=_,t.isError=E,t.isFunction=I,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(103);var w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function N(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":"),[e.getDate(),w[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(104),t._extend=function(e,t){if(!t||!S(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var A="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(A&&e[A]){var t;if("function"!=typeof(t=e[A]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,A,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),i=[],o=0;o=0){u=!0;var c=0}var l=function(){u&&c!==a?i.emit("error",t.util.error(new Error("Stream content length mismatch. Received "+c+" of "+a+" bytes."),{code:"StreamContentLengthMismatch"})):2===t.HttpClient.streamsApiVersion?i.end():i.emit("end")},p=s.httpResponse.createUnbufferedStream();if(2===t.HttpClient.streamsApiVersion)if(u){var d=new n.PassThrough;d._write=function(e){return e&&e.length&&(c+=e.length),n.PassThrough.prototype._write.apply(this,arguments)},d.on("end",l),i.on("error",function(e){u=!1,p.unpipe(d),d.emit("end"),d.end()}),p.pipe(d).pipe(i,{end:!1})}else p.pipe(i);else u&&p.on("data",function(e){e&&e.length&&(c+=e.length)}),p.on("data",function(e){i.emit("data",e)}),p.on("end",l);p.on("error",function(e){u=!1,i.emit("error",e)})}}),i},emitEvent:function(e,n,r){"function"==typeof n&&(r=n,n=null),r||(r=function(){}),n||(n=this.eventParameters(e,this.response)),t.SequentialExecutor.prototype.emit.call(this,e,n,function(e){e&&(this.response.error=e),r.call(this,e)})},eventParameters:function(e){switch(e){case"restart":case"validate":case"sign":case"build":case"afterValidate":case"afterBuild":return[this];case"error":return[this.response.error,this.response];default:return[this.response]}},presign:function(e,n){return n||"function"!=typeof e||(n=e,e=null),(new t.Signers.Presign).sign(this.toGet(),e,n)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this._unAuthenticated=!0,this.removeListener("validate",t.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",t.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),t.Request.addPromisesToClass=function(e){this.prototype.promise=function(){var t=this;return this.httpRequest.appendToUserAgent("promise"),new e(function(e,n){t.on("complete",function(t){t.error?n(t.error):e(Object.defineProperty(t.data||{},"$response",{value:t}))}),t.runTo()})}},t.Request.deletePromisesFromClass=function(){delete this.prototype.promise},t.util.addPromises(t.Request),t.util.mixin(t.Request,t.SequentialExecutor)}).call(this,n(9))},function(e,t){function n(e,t){this.currentState=t||null,this.states=e||{}}n.prototype.runTo=function(e,t,n,r){"function"==typeof e&&(r=n,n=t,t=e,e=null);var i=this,o=i.states[i.currentState];o.fn.call(n||i,r,function(r){if(r){if(!o.fail)return t?t.call(n,r):null;i.currentState=o.fail}else{if(!o.accept)return t?t.call(n):null;i.currentState=o.accept}if(i.currentState===e)return t?t.call(n,r):null;i.runTo(e,t,n,r)})},n.prototype.addState=function(e,t,n,r){return"function"==typeof t?(r=t,t=null,n=null):"function"==typeof n&&(r=n,n=null),this.currentState||(this.currentState=e),this.states[e]={accept:t,fail:n,fn:r},this},e.exports=n},function(e,t,n){var r=n(0),i=r.util.inherit,o=n(26);r.Response=i({constructor:function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new r.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function(e){var t,n=this.request.service,i=this.request.operation;try{t=n.paginationConfig(i,!0)}catch(e){this.error=e}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var o=r.util.copy(this.request.params);if(this.nextPageTokens){var s=t.inputToken;"string"==typeof s&&(s=[s]);for(var a=0;a=0?"&":"?";this.request.path+=o+r.util.queryParamsToString(i)},authorization:function(e,t){var n=[],r=this.credentialString(t);return n.push(this.algorithm+" Credential="+e.accessKeyId+"/"+r),n.push("SignedHeaders="+this.signedHeaders()),n.push("Signature="+this.signature(e,t)),n.join(", ")},signature:function(e,t){var n=i.getSigningKey(e,t.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return r.util.crypto.hmac(n,this.stringToSign(t),"hex")},stringToSign:function(e){var t=[];return t.push("AWS4-HMAC-SHA256"),t.push(e),t.push(this.credentialString(e)),t.push(this.hexEncodedHash(this.canonicalString())),t.join("\n")},canonicalString:function(){var e=[],t=this.request.pathname();return"s3"!==this.serviceName&&(t=r.util.uriEscapePath(t)),e.push(this.request.method),e.push(t),e.push(this.request.search()),e.push(this.canonicalHeaders()+"\n"),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join("\n")},canonicalHeaders:function(){var e=[];r.util.each.call(this,this.request.headers,function(t,n){e.push([t,n])}),e.sort(function(e,t){return e[0].toLowerCase()604800){throw r.util.error(new Error,{code:"InvalidExpiryTime",message:"Presigning does not support expiry time greater than a week with SigV4 signing.",retryable:!1})}e.httpRequest.headers[o]=t}else{if(n!==r.Signers.S3)throw r.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});var i=e.service?e.service.getSkewCorrectedDate():r.util.date.getDate();e.httpRequest.headers[o]=parseInt(r.util.date.unixTimestamp(i)+t,10).toString()}}function a(e){var t=e.httpRequest.endpoint,n=r.util.urlParse(e.httpRequest.path),i={};n.search&&(i=r.util.queryStringParse(n.search.substr(1)));var s=e.httpRequest.headers.Authorization.split(" ");if("AWS"===s[0])s=s[1].split(":"),i.AWSAccessKeyId=s[0],i.Signature=s[1],r.util.each(e.httpRequest.headers,function(e,t){e===o&&(e="Expires"),0===e.indexOf("x-amz-meta-")&&(delete i[e],e=e.toLowerCase()),i[e]=t}),delete e.httpRequest.headers[o],delete i.Authorization,delete i.Host;else if("AWS4-HMAC-SHA256"===s[0]){s.shift();var a=s.join(" ").match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}t.pathname=n.pathname,t.search=r.util.queryParamsToString(i)}r.Signers.Presign=i({sign:function(e,t,n){if(e.httpRequest.headers[o]=t||3600,e.on("build",s),e.on("sign",a),e.removeListener("afterBuild",r.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",r.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!n){if(e.build(),e.response.error)throw e.response.error;return r.util.urlFormat(e.httpRequest.endpoint)}e.build(function(){this.response.error?n(this.response.error):n(null,r.util.urlFormat(e.httpRequest.endpoint))})}}),e.exports=r.Signers.Presign},function(e,t,n){var r=n(0);r.ParamValidator=r.util.inherit({constructor:function(e){!0!==e&&void 0!==e||(e={min:!0}),this.validation=e},validate:function(e,t,n){if(this.errors=[],this.validateMember(e,t||{},n||"params"),this.errors.length>1){var i=this.errors.join("\n* ");throw i="There were "+this.errors.length+" validation errors:\n* "+i,r.util.error(new Error(i),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function(e,t){this.errors.push(r.util.error(new Error(t),{code:e}))},validateStructure:function(e,t,n){var r;this.validateType(t,n,["object"],"structure");for(var i=0;e.required&&i= 1, but found "'+t+'" for '+n)},validatePattern:function(e,t,n){this.validation.pattern&&void 0!==e.pattern&&(new RegExp(e.pattern).test(t)||this.fail("PatternMatchError",'Provided value "'+t+'" does not match regex pattern /'+e.pattern+"/ for "+n))},validateRange:function(e,t,n,r){this.validation.min&&void 0!==e.min&&t= "+e.min+", but found "+t+" for "+n),this.validation.max&&void 0!==e.max&&t>e.max&&this.fail("MaxRangeError","Expected "+r+" <= "+e.max+", but found "+t+" for "+n)},validateEnum:function(e,t,n){this.validation.enum&&void 0!==e.enum&&-1===e.enum.indexOf(t)&&this.fail("EnumError","Found string value of "+t+", but expected "+e.enum.join("|")+" for "+n)},validateType:function(e,t,n,i){if(null==e)return!1;for(var o=!1,s=0;su)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=p,c=d,a=l;var h=(1e4*(268435455&(p+=122192928e5))+d)%4294967296;o[r++]=h>>>24&255,o[r++]=h>>>16&255,o[r++]=h>>>8&255,o[r++]=255&h;var m=p/4294967296*1e4&268435455;o[r++]=m>>>8&255,o[r++]=255&m,o[r++]=m>>>24&15|16,o[r++]=m>>>16&255,o[r++]=l>>>8|128,o[r++]=255&l;for(var g=e.node||s,y=0;y<6;++y)o[r+y]=g[y];return t||i(o)}},function(e,t,n){var r=n(54),i=n(55);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){var r=n(121),i=n(125),o=n(126),s=n(127);e.exports={createHash:function(e){if("md5"===(e=e.toLowerCase()))return new i;if("sha256"===e)return new s;if("sha1"===e)return new o;throw new Error("Hash algorithm "+e+" is not supported in the browser SDK")},createHmac:function(e,t){if("md5"===(e=e.toLowerCase()))return new r(i,t);if("sha256"===e)return new r(s,t);if("sha1"===e)return new r(o,t);throw new Error("HMAC algorithm "+e+" is not supported in the browser SDK")},createSign:function(){throw new Error("createSign is not implemented in the browser")}}},function(e,t,n){var r=n(19);function i(e,t){this.hash=new e,this.outer=new e;var n=function(e,t){var n=r.convertToBuffer(t);if(n.byteLength>e.BLOCK_SIZE){var i=new e;i.update(n),n=i.digest()}var o=new Uint8Array(e.BLOCK_SIZE);return o.set(n),o}(e,t),i=new Uint8Array(e.BLOCK_SIZE);i.set(n);for(var o=0;o0?r-4:r,p=0;p>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===s&&(t=i[e.charCodeAt(p)]<<2|i[e.charCodeAt(p+1)]>>4,a[u++]=255&t);1===s&&(t=i[e.charCodeAt(p)]<<10|i[e.charCodeAt(p+1)]<<4|i[e.charCodeAt(p+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=0,a=n-i;sa?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;a0)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 l(e,t,n){for(var i,o,s=[],a=t;a>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){t.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<>1,l=-7,p=n?i-1:0,d=n?-1:1,f=e[t+p];for(p+=d,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+p],p+=d,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+p],p+=d,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=c}return(f?-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,l=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,h=r?1:-1,m=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=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+p>=1?d/u:d*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=h,a/=256,i-=8);for(s=s<0;e[n+f]=255&s,f+=h,s/=256,c-=8);e[n+f-h]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(19),i=n(2).Buffer,o=64;function s(){this.state=[1732584193,4023233417,2562383102,271733878],this.buffer=new DataView(new ArrayBuffer(o)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}function a(e,t,n,r,i,o){return((t=(t+e&4294967295)+(r+o&4294967295)&4294967295)<>>32-i)+n&4294967295}function u(e,t,n,r,i,o,s){return a(t&n|~t&r,e,t,i,o,s)}function c(e,t,n,r,i,o,s){return a(t&r|n&~r,e,t,i,o,s)}function l(e,t,n,r,i,o,s){return a(t^n^r,e,t,i,o,s)}function p(e,t,n,r,i,o,s){return a(n^(t|~r),e,t,i,o,s)}e.exports=s,s.BLOCK_SIZE=o,s.prototype.update=function(e){if(r.isEmptyData(e))return this;if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=r.convertToBuffer(e),n=0,i=t.byteLength;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),i--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},s.prototype.digest=function(e){if(!this.finished){var t=this.buffer,n=this.bufferLength,r=8*this.bytesHashed;if(t.setUint8(this.bufferLength++,128),n%o>=o-8){for(var s=this.bufferLength;s>>0,!0),t.setUint32(o-4,Math.floor(r/4294967296),!0),this.hashBuffer(),this.finished=!0}var a=new DataView(new ArrayBuffer(16));for(s=0;s<4;s++)a.setUint32(4*s,this.state[s],!0);var u=new i(a.buffer,a.byteOffset,a.byteLength);return e?u.toString(e):u},s.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3];n=u(n,r,i,o,e.getUint32(0,!0),7,3614090360),o=u(o,n,r,i,e.getUint32(4,!0),12,3905402710),i=u(i,o,n,r,e.getUint32(8,!0),17,606105819),r=u(r,i,o,n,e.getUint32(12,!0),22,3250441966),n=u(n,r,i,o,e.getUint32(16,!0),7,4118548399),o=u(o,n,r,i,e.getUint32(20,!0),12,1200080426),i=u(i,o,n,r,e.getUint32(24,!0),17,2821735955),r=u(r,i,o,n,e.getUint32(28,!0),22,4249261313),n=u(n,r,i,o,e.getUint32(32,!0),7,1770035416),o=u(o,n,r,i,e.getUint32(36,!0),12,2336552879),i=u(i,o,n,r,e.getUint32(40,!0),17,4294925233),r=u(r,i,o,n,e.getUint32(44,!0),22,2304563134),n=u(n,r,i,o,e.getUint32(48,!0),7,1804603682),o=u(o,n,r,i,e.getUint32(52,!0),12,4254626195),i=u(i,o,n,r,e.getUint32(56,!0),17,2792965006),n=c(n,r=u(r,i,o,n,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=c(o,n,r,i,e.getUint32(24,!0),9,3225465664),i=c(i,o,n,r,e.getUint32(44,!0),14,643717713),r=c(r,i,o,n,e.getUint32(0,!0),20,3921069994),n=c(n,r,i,o,e.getUint32(20,!0),5,3593408605),o=c(o,n,r,i,e.getUint32(40,!0),9,38016083),i=c(i,o,n,r,e.getUint32(60,!0),14,3634488961),r=c(r,i,o,n,e.getUint32(16,!0),20,3889429448),n=c(n,r,i,o,e.getUint32(36,!0),5,568446438),o=c(o,n,r,i,e.getUint32(56,!0),9,3275163606),i=c(i,o,n,r,e.getUint32(12,!0),14,4107603335),r=c(r,i,o,n,e.getUint32(32,!0),20,1163531501),n=c(n,r,i,o,e.getUint32(52,!0),5,2850285829),o=c(o,n,r,i,e.getUint32(8,!0),9,4243563512),i=c(i,o,n,r,e.getUint32(28,!0),14,1735328473),n=l(n,r=c(r,i,o,n,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=l(o,n,r,i,e.getUint32(32,!0),11,2272392833),i=l(i,o,n,r,e.getUint32(44,!0),16,1839030562),r=l(r,i,o,n,e.getUint32(56,!0),23,4259657740),n=l(n,r,i,o,e.getUint32(4,!0),4,2763975236),o=l(o,n,r,i,e.getUint32(16,!0),11,1272893353),i=l(i,o,n,r,e.getUint32(28,!0),16,4139469664),r=l(r,i,o,n,e.getUint32(40,!0),23,3200236656),n=l(n,r,i,o,e.getUint32(52,!0),4,681279174),o=l(o,n,r,i,e.getUint32(0,!0),11,3936430074),i=l(i,o,n,r,e.getUint32(12,!0),16,3572445317),r=l(r,i,o,n,e.getUint32(24,!0),23,76029189),n=l(n,r,i,o,e.getUint32(36,!0),4,3654602809),o=l(o,n,r,i,e.getUint32(48,!0),11,3873151461),i=l(i,o,n,r,e.getUint32(60,!0),16,530742520),n=p(n,r=l(r,i,o,n,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=p(o,n,r,i,e.getUint32(28,!0),10,1126891415),i=p(i,o,n,r,e.getUint32(56,!0),15,2878612391),r=p(r,i,o,n,e.getUint32(20,!0),21,4237533241),n=p(n,r,i,o,e.getUint32(48,!0),6,1700485571),o=p(o,n,r,i,e.getUint32(12,!0),10,2399980690),i=p(i,o,n,r,e.getUint32(40,!0),15,4293915773),r=p(r,i,o,n,e.getUint32(4,!0),21,2240044497),n=p(n,r,i,o,e.getUint32(32,!0),6,1873313359),o=p(o,n,r,i,e.getUint32(60,!0),10,4264355552),i=p(i,o,n,r,e.getUint32(24,!0),15,2734768916),r=p(r,i,o,n,e.getUint32(52,!0),21,1309151649),n=p(n,r,i,o,e.getUint32(16,!0),6,4149444226),o=p(o,n,r,i,e.getUint32(44,!0),10,3174756917),i=p(i,o,n,r,e.getUint32(8,!0),15,718787259),r=p(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}},function(e,t,n){var r=n(2).Buffer,i=n(19);new Uint32Array([1518500249,1859775393,-1894007588,-899497514]),Math.pow(2,53);function o(){this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=new Uint32Array(80),this.offset=0,this.shift=24,this.totalLength=0}e.exports=o,o.BLOCK_SIZE=64,o.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=(e=i.convertToBuffer(e)).length;this.totalLength+=8*t;for(var n=0;n14||14===this.offset&&this.shift<24)&&this.processBlock(),this.offset=14,this.shift=24,this.write(0),this.write(0),this.write(this.totalLength>0xffffffffff?this.totalLength/1099511627776:0),this.write(this.totalLength>4294967295?this.totalLength/4294967296:0);for(var t=24;t>=0;t-=8)this.write(this.totalLength>>t);var n=new r(20),i=new DataView(n.buffer);return i.setUint32(0,this.h0,!1),i.setUint32(4,this.h1,!1),i.setUint32(8,this.h2,!1),i.setUint32(12,this.h3,!1),i.setUint32(16,this.h4,!1),e?n.toString(e):n},o.prototype.processBlock=function(){for(var e=16;e<80;e++){var t=this.block[e-3]^this.block[e-8]^this.block[e-14]^this.block[e-16];this.block[e]=t<<1|t>>>31}var n,r,i=this.h0,o=this.h1,s=this.h2,a=this.h3,u=this.h4;for(e=0;e<80;e++){e<20?(n=a^o&(s^a),r=1518500249):e<40?(n=o^s^a,r=1859775393):e<60?(n=o&s|a&(o|s),r=2400959708):(n=o^s^a,r=3395469782);var c=(i<<5|i>>>27)+n+u+r+(0|this.block[e]);u=a,a=s,s=o<<30|o>>>2,o=i,i=c}for(this.h0=this.h0+i|0,this.h1=this.h1+o|0,this.h2=this.h2+s|0,this.h3=this.h3+a|0,this.h4=this.h4+u|0,this.offset=0,e=0;e<16;e++)this.block[e]=0}},function(e,t,n){var r=n(2).Buffer,i=n(19),o=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]),s=Math.pow(2,53)-1;function a(){this.state=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}e.exports=a,a.BLOCK_SIZE=64,a.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=0,n=(e=i.convertToBuffer(e)).byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>s)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0);return this},a.prototype.digest=function(e){if(!this.finished){var t=8*this.bytesHashed,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(n.setUint8(this.bufferLength++,128),i%64>=56){for(var o=this.bufferLength;o<64;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<56;o++)n.setUint8(o,0);n.setUint32(56,Math.floor(t/4294967296),!0),n.setUint32(60,t),this.hashBuffer(),this.finished=!0}var s=new r(32);for(o=0;o<8;o++)s[4*o]=this.state[o]>>>24&255,s[4*o+1]=this.state[o]>>>16&255,s[4*o+2]=this.state[o]>>>8&255,s[4*o+3]=this.state[o]>>>0&255;return e?s.toString(e):s},a.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],s=t[3],a=t[4],u=t[5],c=t[6],l=t[7],p=0;p<64;p++){if(p<16)this.temp[p]=(255&e[4*p])<<24|(255&e[4*p+1])<<16|(255&e[4*p+2])<<8|255&e[4*p+3];else{var d=this.temp[p-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,h=((d=this.temp[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[p]=(f+this.temp[p-7]|0)+(h+this.temp[p-16]|0)}var m=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&u^~a&c)|0)+(l+(o[p]+this.temp[p]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;l=c,c=u,u=a,a=s+m|0,s=i,i=r,r=n,n=m+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=s,t[4]+=a,t[5]+=u,t[6]+=c,t[7]+=l}},function(e,t,n){(function(e,r){var i;/*! https://mths.be/punycode v1.4.1 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=36,l=1,p=26,d=38,f=700,h=72,m=128,g="-",y=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=c-l,E=Math.floor,I=String.fromCharCode;function C(e){throw new RangeError(S[e])}function T(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function w(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+T((e=e.replace(b,".")).split("."),t).join(".")}function N(e){for(var t,n,r=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=I((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function R(e,t,n){var r=0;for(e=n?E(e/f):e>>1,e+=E(e/t);e>_*p>>1;r+=c)e=E(e/_);return E(r+(_+1)*e/(e+d))}function P(e){var t,n,r,i,o,s,a,d,f,y,v,b=[],S=e.length,_=0,I=m,T=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r=128&&C("not-basic"),b.push(e.charCodeAt(r));for(i=n>0?n+1:0;i=S&&C("invalid-input"),((d=(v=e.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:c)>=c||d>E((u-_)/s))&&C("overflow"),_+=d*s,!(d<(f=a<=T?l:a>=T+p?p:a-T));a+=c)s>E(u/(y=c-f))&&C("overflow"),s*=y;T=R(_-o,t=b.length+1,0==o),E(_/t)>u-I&&C("overflow"),I+=E(_/t),_%=t,b.splice(_++,0,I)}return A(b)}function O(e){var t,n,r,i,o,s,a,d,f,y,v,b,S,_,T,w=[];for(b=(e=N(e)).length,t=m,n=0,o=h,s=0;s=t&&vE((u-n)/(S=r+1))&&C("overflow"),n+=(a-t)*S,t=a,s=0;su&&C("overflow"),v==t){for(d=n,f=c;!(d<(y=f<=o?l:f>=o+p?p:f-o));f+=c)T=d-y,_=c-y,w.push(I(k(y+T%_,0))),d=E(T/_);w.push(I(k(d,0))),o=R(n,S,r==i),n=0,++r}++n,++t}return w.join("")}a={version:"1.4.1",ucs2:{decode:N,encode:A},decode:P,encode:O,toASCII:function(e){return w(e,function(e){return v.test(e)?"xn--"+O(e):e})},toUnicode:function(e){return w(e,function(e){return y.test(e)?P(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return a}.call(t,n,t,e))||(e.exports=i)}()}).call(this,n(129)(e),n(13))},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";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 l=0;l=0?(p=m.substr(0,g),d=m.substr(g+1)):(p=m,d=""),f=decodeURIComponent(p),h=decodeURIComponent(d),r(s,f)?i(s[f])?s[f].push(h):s[f]=[s[f],h]:s[f]=h}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-1&&(e[t]++,0===e[t]);t--);}o.fromNumber=function(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(e+" is too large (or, if negative, too small) to represent as an Int64");for(var t=new Uint8Array(8),n=7,r=Math.abs(Math.round(e));n>-1&&r>0;n--,r/=256)t[n]=r;return e<0&&s(t),new o(t)},o.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&s(e),parseInt(e.toString("hex"),16)*(t?-1:1)},o.prototype.toString=function(){return String(this.valueOf())},e.exports={Int64:o}},function(e,t,n){var r=n(0).util,i=n(57).toBuffer,o=4,s=2*o,a=4,u=s+2*a;e.exports={splitMessage:function(e){if(r.Buffer.isBuffer(e)||(e=i(e)),e.length=this.HEADERS_RECEIVED&&!p&&(u.statusCode=l.status,u.headers=s.parseHeaders(l.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers,l.statusText),p=!0),this.readyState===this.DONE&&s.finishRequest(l,u)},!1),l.upload.addEventListener("progress",function(e){u.emit("sendProgress",e)}),l.addEventListener("progress",function(e){u.emit("receiveProgress",e)},!1),l.addEventListener("timeout",function(){o(r.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),l.addEventListener("error",function(){o(r.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),l.addEventListener("abort",function(){o(r.util.error(new Error("Request aborted"),{code:"RequestAbortedError"}))},!1),n(u),l.open(e.method,c,!1!==t.xhrAsync),r.util.each(e.headers,function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&l.setRequestHeader(e,t)}),t.timeout&&!1!==t.xhrAsync&&(l.timeout=t.timeout),t.xhrWithCredentials&&(l.withCredentials=!0);try{l.responseType="arraybuffer"}catch(e){}try{e.body?l.send(e.body):l.send()}catch(t){if(!e.body||"object"!=typeof e.body.buffer)throw t;l.send(e.body.buffer)}return u},parseHeaders:function(e){var t={};return r.util.arrayEach(e.split(/\r?\n/),function(e){var n=e.split(":",1)[0],r=e.substring(n.length+2);n.length>0&&(t[n.toLowerCase()]=r)}),t},finishRequest:function(e,t){var n;if("arraybuffer"===e.responseType&&e.response){var i=e.response;n=new r.util.Buffer(i.byteLength);for(var o=new Uint8Array(i),s=0;s0&&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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=function(){for(var e=[],t=0;t0&&(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,l=h(u,c);for(n=0;n=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=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},a.prototype.listenerCount=f,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5},i=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=[],i=1;i=r[o]){var s=console.log.bind(console);"WARN"===t&&console.warn&&(s=console.warn.bind(console));var a="["+t+"] "+this._ts()+" "+this.name;if(1===n.length&&"string"==typeof n[0])s(a+" - "+n[0]);else if(1===n.length)s(a,n[0]);else if("string"==typeof n[0]){var u=n.slice(1);1===u.length&&(u=u[0]),s(a+" - "+n[0],u)}else s(a,n)}},e.prototype.log=function(){for(var e=[],t=0;t0&&(r=this.getByLanguage(e,n.split("-")[0])),r||(void 0!==t?t:e))},e.prototype.getByLanguage=function(e,t,n){if(void 0===n&&(n=null),!t)return n;var r=this._dict[t];return r?r[e]:n},e.prototype.putVocabulariesForLanguage=function(e,t){var n=this._dict[e];n||(n=this._dict[e]={}),Object.assign(n,t)},e.prototype.putVocabularies=function(e){var t=this;Object.keys(e).map(function(n){t.putVocabulariesForLanguage(n,e[n])})},e}();t.I18n=i},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]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]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](new Date).getTime()?(d.debug("token not expired"),this._setCredentialsFromFederation({provider:n,token:i,user:r,identity_id:s,expires_at:o})):a._refreshHandlers[n]&&"function"==typeof a._refreshHandlers[n]?(d.debug("getting refreshed jwt token from federation provider"),a._refreshHandlers[n]().then(function(e){return d.debug("refresh federated token sucessfully",e),i=e.token,s=e.identity_id,o=e.expires_at,a._setCredentialsFromFederation({provider:n,token:i,user:r,identity_id:s,expires_at:o})}).catch(function(e){return d.debug("refresh federated token failed",e),t.clear(),Promise.reject("refreshing federation token failed: "+e)})):(d.debug("no refresh handler for provider:",n),this.clear(),Promise.reject("no refresh handler for provider"))},e.prototype._isExpired=function(e){if(!e)return d.debug("no credentials for expiration check"),!0;d.debug("is this credentials expired?",e);var t=(new Date).getTime(),n=e.expired,r=e.expireTime;return!(!n&&r>t+6e5)},e.prototype._setCredentialsForGuest=function(){return i(this,void 0,void 0,function(){var e,t,n,r,s,a,c,l=this;return o(this,function(p){switch(p.label){case 0:if(e=!1,d.debug("setting credentials for guest"),t=this._config,n=t.identityPoolId,r=t.region,t.mandatorySignIn)return[2,Promise.reject("cannot get guest credentials when mandatory signin enabled")];if(!n)return d.debug("No Cognito Federated Identity pool provided"),[2,Promise.reject("No Cognito Federated Identity pool provided")];s=void 0,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this._storageSync];case 2:return p.sent(),s=this._storage.getItem("CognitoIdentityId-"+n),[3,4];case 3:return a=p.sent(),d.debug("Failed to get the cached identityId",a),[3,4];case 4:return c=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:n,IdentityId:s||void 0},{region:r}),this,[2,this._loadCredentials(c,"guest",!1,null).then(function(e){return e}).catch(function(t){return i(l,void 0,void 0,function(){var i;return o(this,function(o){return"ResourceNotFoundException"!==t.code||t.message!=="Identity '"+s+"' not found."||e?[2,t]:(e=!0,d.debug("Failed to load guest credentials"),this._storage.removeItem("CognitoIdentityId-"+n),c.clearCachedId(),i=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:n,IdentityId:void 0},{region:r}),[2,this._loadCredentials(i,"guest",!1,null)])})})})]}})})},e.prototype._setCredentialsFromAWS=function(){var e=u.AWS.config.credentials;d.debug("setting credentials from aws");return e instanceof u.AWS.Credentials?Promise.resolve(e):(d.debug("AWS.config.credentials is not an instance of AWS Credentials"),Promise.reject("AWS.config.credentials is not an instance of AWS Credentials"))},e.prototype._setCredentialsFromFederation=function(e){var t=e.provider,n=e.token,r=e.identity_id,i=(e.user,e.expires_at,{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,c=s.region;if(!a)return d.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");var l=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:a,IdentityId:r,Logins:o},{region:c});return this._loadCredentials(l,"federated",!0,e)},e.prototype._setCredentialsFromSession=function(e){d.debug("set credentials from session");var t=e.getIdToken().getJwtToken(),n=this._config,r=n.region,i=n.userPoolId,o=n.identityPoolId;if(!o)return d.debug("No Cognito Federated Identity pool provided"),Promise.reject("No Cognito Federated Identity pool provided");var s={};s["cognito-idp."+r+".amazonaws.com/"+i]=t;var a=new u.AWS.CognitoIdentityCredentials({IdentityPoolId:o,Logins:s},{region:r});return this._loadCredentials(a,"userPool",!0,null)},e.prototype._loadCredentials=function(e,t,n,r){var s=this,a=this,u=this._config.identityPoolId;return new Promise(function(c,l){e.get(function(f){return i(s,void 0,void 0,function(){var i,s,h,m,g,y;return o(this,function(o){switch(o.label){case 0:if(f)return d.debug("Failed to load credentials",e),l(f),[2];if(d.debug("Load credentials successfully",e),a._credentials=e,a._credentials.authenticated=n,a._credentials_source=t,"federated"===t){i=Object.assign({id:this._credentials.identityId},r.user),s=r.provider,h=r.token,m=r.expires_at,g=r.identity_id;try{this._storage.setItem("aws-amplify-federatedInfo",JSON.stringify({provider:s,token:h,user:i,expires_at:m,identity_id:g}))}catch(e){d.debug("Failed to put federated info into auth storage",e)}p.default.Cache&&"function"==typeof p.default.Cache.setItem?p.default.Cache.setItem("federatedInfo",{provider:s,token:h,user:i,expires_at:m,identity_id:g},{priority:1}):d.debug("No Cache module registered in Amplify")}if("guest"!==t)return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this._storageSync];case 2:return o.sent(),this._storage.setItem("CognitoIdentityId-"+u,e.identityId),[3,4];case 3:return y=o.sent(),d.debug("Failed to cache identityId",y),[3,4];case 4:return c(a._credentials),[2]}})})})})},e.prototype.set=function(e,t){return"session"===t?this._setCredentialsFromSession(e):"federation"===t?this._setCredentialsFromFederation(e):"guest"===t?this._setCredentialsForGuest():(d.debug("no source specified for setting credentials"),Promise.reject("invalid source"))},e.prototype.clear=function(){return i(this,void 0,void 0,function(){var e,t,n;return o(this,function(r){switch(r.label){case 0:return e=this._config,t=e.identityPoolId,n=e.region,t&&new u.AWS.CognitoIdentityCredentials({IdentityPoolId:t},{region:n}).clearCachedId(),this._credentials=null,this._credentials_source=null,this._storage.removeItem("aws-amplify-federatedInfo"),p.default.Cache&&"function"==typeof p.default.Cache.setItem?[4,p.default.Cache.removeItem("federatedInfo")]:[3,2];case 1:return r.sent(),[3,3];case 2:d.debug("No Cache module registered in Amplify"),r.label=3;case 3:return[2]}})})},e.prototype.shear=function(e){return{accessKeyId:e.accessKeyId,sessionToken:e.sessionToken,secretAccessKey:e.secretAccessKey,identityId:e.identityId,authenticated:e.authenticated}},e}();t.Credentials=f;var h=new f(null);t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(167);t.default=r.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=n(11),o=n(21),s=function(){function e(){this._logger=new r.ConsoleLogger("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(!i.default.browserOrNode().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../../node_modules/ts-jest/preprocessor.js"},testRegex:"(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$",moduleFileExtensions:["ts","tsx","js","json","jsx"],testEnvironment:"jsdom",mapCoverage:!0,coverageThreshold:{global:{branches:0,functions:0,lines:0,statements:0}},testURL:"http://localhost/",coveragePathIgnorePatterns:["/node_modules/"]},license:"Apache-2.0",main:"./lib/index.js",module:"./lib/index.js",name:"@aws-amplify/core",publishConfig:{access:"public"},"react-native":{"./lib/ClientDevice":"./lib/ClientDevice/reactnative.js","./lib/RNComponents":"./lib/RNComponents/reactnative.js","./lib/StorageHelper":"./lib/StorageHelper/reactnative.js"},repository:{type:"git",url:"git+https://github.com/aws/aws-amplify.git"},scripts:{build:"npm run clean && tsc && webpack","build-with-test":"npm run clean && npm test && tsc && webpack",clean:"rimraf lib lib-esm dist",format:"tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",lint:"tslint 'src/**/*.ts'",test:"tslint 'src/**/*.ts' && jest --coverage"},typings:"./lib/index.d.ts",version:"1.0.22"}},function(e,t,n){n(10);var r=n(0),i=r.Service,o=r.apiLoader;o.services.mobileanalytics={},r.MobileAnalytics=i.defineService("mobileanalytics",["2014-06-05"]),Object.defineProperty(o.services.mobileanalytics,"2014-06-05",{get:function(){return n(170)},enumerable:!0,configurable:!0}),e.exports=r.MobileAnalytics},function(e){e.exports={version:"2.0",metadata:{apiVersion:"2014-06-05",endpointPrefix:"mobileanalytics",serviceFullName:"Amazon Mobile Analytics",serviceId:"Mobile Analytics",signatureVersion:"v4",protocol:"rest-json"},operations:{PutEvents:{http:{requestUri:"/2014-06-05/events",responseCode:202},input:{type:"structure",required:["events","clientContext"],members:{events:{type:"list",member:{type:"structure",required:["eventType","timestamp"],members:{eventType:{},timestamp:{},session:{type:"structure",members:{id:{},duration:{type:"long"},startTimestamp:{},stopTimestamp:{}}},version:{},attributes:{type:"map",key:{},value:{}},metrics:{type:"map",key:{},value:{type:"double"}}}}},clientContext:{location:"header",locationName:"x-amz-Client-Context"},clientContextEncoding:{location:"header",locationName:"x-amz-Client-Context-Encoding"}}}}},shapes:{}}},function(e,t,n){n(10);var r=n(0),i=r.Service,o=r.apiLoader;o.services.pinpoint={},r.Pinpoint=i.defineService("pinpoint",["2016-12-01"]),Object.defineProperty(o.services.pinpoint,"2016-12-01",{get:function(){return n(172)},enumerable:!0,configurable:!0}),e.exports=r.Pinpoint},function(e){e.exports={metadata:{apiVersion:"2016-12-01",endpointPrefix:"pinpoint",signingName:"mobiletargeting",serviceFullName:"Amazon Pinpoint",serviceId:"Pinpoint",protocol:"rest-json",jsonVersion:"1.1",uid:"pinpoint-2016-12-01",signatureVersion:"v4"},operations:{CreateApp:{http:{requestUri:"/v1/apps",responseCode:201},input:{type:"structure",members:{CreateApplicationRequest:{type:"structure",members:{Name:{}},required:[]}},required:["CreateApplicationRequest"],payload:"CreateApplicationRequest"},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},CreateCampaign:{http:{requestUri:"/v1/apps/{application-id}/campaigns",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteCampaignRequest:{shape:"S7"}},required:["ApplicationId","WriteCampaignRequest"],payload:"WriteCampaignRequest"},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},CreateExportJob:{http:{requestUri:"/v1/apps/{application-id}/jobs/export",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},ExportJobRequest:{type:"structure",members:{RoleArn:{},S3UrlPrefix:{},SegmentId:{},SegmentVersion:{type:"integer"}},required:[]}},required:["ApplicationId","ExportJobRequest"],payload:"ExportJobRequest"},output:{type:"structure",members:{ExportJobResponse:{shape:"Sx"}},required:["ExportJobResponse"],payload:"ExportJobResponse"}},CreateImportJob:{http:{requestUri:"/v1/apps/{application-id}/jobs/import",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},ImportJobRequest:{type:"structure",members:{DefineSegment:{type:"boolean"},ExternalId:{},Format:{},RegisterEndpoints:{type:"boolean"},RoleArn:{},S3Url:{},SegmentId:{},SegmentName:{}},required:[]}},required:["ApplicationId","ImportJobRequest"],payload:"ImportJobRequest"},output:{type:"structure",members:{ImportJobResponse:{shape:"S15"}},required:["ImportJobResponse"],payload:"ImportJobResponse"}},CreateSegment:{http:{requestUri:"/v1/apps/{application-id}/segments",responseCode:201},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteSegmentRequest:{shape:"S18"}},required:["ApplicationId","WriteSegmentRequest"],payload:"WriteSegmentRequest"},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},DeleteAdmChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},DeleteApnsChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},DeleteApnsSandboxChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},DeleteApnsVoipChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},DeleteApnsVoipSandboxChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},DeleteApp:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},DeleteBaiduChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},DeleteCampaign:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"}},required:["CampaignId","ApplicationId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},DeleteEmailChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},DeleteEndpoint:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"}},required:["ApplicationId","EndpointId"]},output:{type:"structure",members:{EndpointResponse:{shape:"S2v"}},required:["EndpointResponse"],payload:"EndpointResponse"}},DeleteEventStream:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},DeleteGcmChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},DeleteSegment:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},DeleteSmsChannel:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}},DeleteUserEndpoints:{http:{method:"DELETE",requestUri:"/v1/apps/{application-id}/users/{user-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},UserId:{location:"uri",locationName:"user-id"}},required:["ApplicationId","UserId"]},output:{type:"structure",members:{EndpointsResponse:{shape:"S3f"}},required:["EndpointsResponse"],payload:"EndpointsResponse"}},GetAdmChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},GetApnsChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},GetApnsSandboxChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},GetApnsVoipChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},GetApnsVoipSandboxChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},GetApp:{http:{method:"GET",requestUri:"/v1/apps/{application-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationResponse:{shape:"S5"}},required:["ApplicationResponse"],payload:"ApplicationResponse"}},GetApplicationSettings:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/settings",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ApplicationSettingsResource:{shape:"S3v"}},required:["ApplicationSettingsResource"],payload:"ApplicationSettingsResource"}},GetApps:{http:{method:"GET",requestUri:"/v1/apps",responseCode:200},input:{type:"structure",members:{PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}}},output:{type:"structure",members:{ApplicationsResponse:{type:"structure",members:{Item:{type:"list",member:{shape:"S5"}},NextToken:{}}}},required:["ApplicationsResponse"],payload:"ApplicationsResponse"}},GetBaiduChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},GetCampaign:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"}},required:["CampaignId","ApplicationId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},GetCampaignActivities:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/activities",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId","CampaignId"]},output:{type:"structure",members:{ActivitiesResponse:{type:"structure",members:{Item:{type:"list",member:{type:"structure",members:{ApplicationId:{},CampaignId:{},End:{},Id:{},Result:{},ScheduledStart:{},Start:{},State:{},SuccessfulEndpointCount:{type:"integer"},TimezonesCompletedCount:{type:"integer"},TimezonesTotalCount:{type:"integer"},TotalEndpointCount:{type:"integer"},TreatmentId:{}},required:[]}},NextToken:{}},required:[]}},required:["ActivitiesResponse"],payload:"ActivitiesResponse"}},GetCampaignVersion:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/versions/{version}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},Version:{location:"uri",locationName:"version"}},required:["Version","ApplicationId","CampaignId"]},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},GetCampaignVersions:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}/versions",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId","CampaignId"]},output:{type:"structure",members:{CampaignsResponse:{shape:"S4d"}},required:["CampaignsResponse"],payload:"CampaignsResponse"}},GetCampaigns:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/campaigns",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{CampaignsResponse:{shape:"S4d"}},required:["CampaignsResponse"],payload:"CampaignsResponse"}},GetChannels:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{ChannelsResponse:{type:"structure",members:{Channels:{type:"map",key:{},value:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Version:{type:"integer"}}}}},required:[]}},required:["ChannelsResponse"],payload:"ChannelsResponse"}},GetEmailChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},GetEndpoint:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"}},required:["ApplicationId","EndpointId"]},output:{type:"structure",members:{EndpointResponse:{shape:"S2v"}},required:["EndpointResponse"],payload:"EndpointResponse"}},GetEventStream:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},GetExportJob:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/export/{job-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},JobId:{location:"uri",locationName:"job-id"}},required:["ApplicationId","JobId"]},output:{type:"structure",members:{ExportJobResponse:{shape:"Sx"}},required:["ExportJobResponse"],payload:"ExportJobResponse"}},GetExportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/export",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{ExportJobsResponse:{shape:"S4w"}},required:["ExportJobsResponse"],payload:"ExportJobsResponse"}},GetGcmChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},GetImportJob:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/import/{job-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},JobId:{location:"uri",locationName:"job-id"}},required:["ApplicationId","JobId"]},output:{type:"structure",members:{ImportJobResponse:{shape:"S15"}},required:["ImportJobResponse"],payload:"ImportJobResponse"}},GetImportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/jobs/import",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{ImportJobsResponse:{shape:"S54"}},required:["ImportJobsResponse"],payload:"ImportJobsResponse"}},GetSegment:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},GetSegmentExportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/jobs/export",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{ExportJobsResponse:{shape:"S4w"}},required:["ExportJobsResponse"],payload:"ExportJobsResponse"}},GetSegmentImportJobs:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/jobs/import",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{ImportJobsResponse:{shape:"S54"}},required:["ImportJobsResponse"],payload:"ImportJobsResponse"}},GetSegmentVersion:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/versions/{version}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"},Version:{location:"uri",locationName:"version"}},required:["SegmentId","Version","ApplicationId"]},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},GetSegmentVersions:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments/{segment-id}/versions",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},SegmentId:{location:"uri",locationName:"segment-id"},Token:{location:"querystring",locationName:"token"}},required:["SegmentId","ApplicationId"]},output:{type:"structure",members:{SegmentsResponse:{shape:"S5g"}},required:["SegmentsResponse"],payload:"SegmentsResponse"}},GetSegments:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/segments",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},PageSize:{location:"querystring",locationName:"page-size"},Token:{location:"querystring",locationName:"token"}},required:["ApplicationId"]},output:{type:"structure",members:{SegmentsResponse:{shape:"S5g"}},required:["SegmentsResponse"],payload:"SegmentsResponse"}},GetSmsChannel:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId"]},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}},GetUserEndpoints:{http:{method:"GET",requestUri:"/v1/apps/{application-id}/users/{user-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},UserId:{location:"uri",locationName:"user-id"}},required:["ApplicationId","UserId"]},output:{type:"structure",members:{EndpointsResponse:{shape:"S3f"}},required:["EndpointsResponse"],payload:"EndpointsResponse"}},PhoneNumberValidate:{http:{requestUri:"/v1/phone/number/validate",responseCode:200},input:{type:"structure",members:{NumberValidateRequest:{type:"structure",members:{IsoCountryCode:{},PhoneNumber:{}}}},required:["NumberValidateRequest"],payload:"NumberValidateRequest"},output:{type:"structure",members:{NumberValidateResponse:{type:"structure",members:{Carrier:{},City:{},CleansedPhoneNumberE164:{},CleansedPhoneNumberNational:{},Country:{},CountryCodeIso2:{},CountryCodeNumeric:{},County:{},OriginalCountryCodeIso2:{},OriginalPhoneNumber:{},PhoneType:{},PhoneTypeCode:{type:"integer"},Timezone:{},ZipCode:{}}}},required:["NumberValidateResponse"],payload:"NumberValidateResponse"}},PutEventStream:{http:{requestUri:"/v1/apps/{application-id}/eventstream",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteEventStream:{type:"structure",members:{DestinationStreamArn:{},RoleArn:{}},required:[]}},required:["ApplicationId","WriteEventStream"],payload:"WriteEventStream"},output:{type:"structure",members:{EventStream:{shape:"S34"}},required:["EventStream"],payload:"EventStream"}},PutEvents:{http:{requestUri:"/v1/apps/{application-id}/events",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EventsRequest:{type:"structure",members:{BatchItem:{type:"map",key:{},value:{type:"structure",members:{Endpoint:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}},Events:{type:"map",key:{},value:{type:"structure",members:{Attributes:{shape:"S62"},ClientSdkVersion:{},EventType:{},Metrics:{shape:"S30"},Session:{type:"structure",members:{Duration:{type:"integer"},Id:{},StartTimestamp:{},StopTimestamp:{}},required:[]},Timestamp:{}},required:[]}}},required:[]}}},required:[]}},required:["ApplicationId","EventsRequest"],payload:"EventsRequest"},output:{type:"structure",members:{EventsResponse:{type:"structure",members:{Results:{type:"map",key:{},value:{type:"structure",members:{EndpointItemResponse:{type:"structure",members:{Message:{},StatusCode:{type:"integer"}}},EventsItemResponse:{type:"map",key:{},value:{type:"structure",members:{Message:{},StatusCode:{type:"integer"}}}}}}}}}},required:["EventsResponse"],payload:"EventsResponse"}},RemoveAttributes:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/attributes/{attribute-type}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},AttributeType:{location:"uri",locationName:"attribute-type"},UpdateAttributesRequest:{type:"structure",members:{Blacklist:{shape:"Sz"}}}},required:["AttributeType","ApplicationId","UpdateAttributesRequest"],payload:"UpdateAttributesRequest"},output:{type:"structure",members:{AttributesResource:{type:"structure",members:{ApplicationId:{},AttributeType:{},Attributes:{shape:"Sz"}},required:[]}},required:["AttributesResource"],payload:"AttributesResource"}},SendMessages:{http:{requestUri:"/v1/apps/{application-id}/messages",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},MessageRequest:{type:"structure",members:{Addresses:{type:"map",key:{},value:{type:"structure",members:{BodyOverride:{},ChannelType:{},Context:{shape:"S62"},RawContent:{},Substitutions:{shape:"S2w"},TitleOverride:{}}}},Context:{shape:"S62"},Endpoints:{shape:"S6j"},MessageConfiguration:{shape:"S6l"},TraceId:{}},required:[]}},required:["ApplicationId","MessageRequest"],payload:"MessageRequest"},output:{type:"structure",members:{MessageResponse:{type:"structure",members:{ApplicationId:{},EndpointResult:{shape:"S6v"},RequestId:{},Result:{type:"map",key:{},value:{type:"structure",members:{DeliveryStatus:{},MessageId:{},StatusCode:{type:"integer"},StatusMessage:{},UpdatedToken:{}},required:[]}}},required:[]}},required:["MessageResponse"],payload:"MessageResponse"}},SendUsersMessages:{http:{requestUri:"/v1/apps/{application-id}/users-messages",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SendUsersMessageRequest:{type:"structure",members:{Context:{shape:"S62"},MessageConfiguration:{shape:"S6l"},TraceId:{},Users:{shape:"S6j"}},required:[]}},required:["ApplicationId","SendUsersMessageRequest"],payload:"SendUsersMessageRequest"},output:{type:"structure",members:{SendUsersMessageResponse:{type:"structure",members:{ApplicationId:{},RequestId:{},Result:{type:"map",key:{},value:{shape:"S6v"}}},required:[]}},required:["SendUsersMessageResponse"],payload:"SendUsersMessageResponse"}},UpdateAdmChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/adm",responseCode:200},input:{type:"structure",members:{ADMChannelRequest:{type:"structure",members:{ClientId:{},ClientSecret:{},Enabled:{type:"boolean"}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","ADMChannelRequest"],payload:"ADMChannelRequest"},output:{type:"structure",members:{ADMChannelResponse:{shape:"S26"}},required:["ADMChannelResponse"],payload:"ADMChannelResponse"}},UpdateApnsChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns",responseCode:200},input:{type:"structure",members:{APNSChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSChannelRequest"],payload:"APNSChannelRequest"},output:{type:"structure",members:{APNSChannelResponse:{shape:"S29"}},required:["APNSChannelResponse"],payload:"APNSChannelResponse"}},UpdateApnsSandboxChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_sandbox",responseCode:200},input:{type:"structure",members:{APNSSandboxChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSSandboxChannelRequest"],payload:"APNSSandboxChannelRequest"},output:{type:"structure",members:{APNSSandboxChannelResponse:{shape:"S2c"}},required:["APNSSandboxChannelResponse"],payload:"APNSSandboxChannelResponse"}},UpdateApnsVoipChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_voip",responseCode:200},input:{type:"structure",members:{APNSVoipChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSVoipChannelRequest"],payload:"APNSVoipChannelRequest"},output:{type:"structure",members:{APNSVoipChannelResponse:{shape:"S2f"}},required:["APNSVoipChannelResponse"],payload:"APNSVoipChannelResponse"}},UpdateApnsVoipSandboxChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/apns_voip_sandbox",responseCode:200},input:{type:"structure",members:{APNSVoipSandboxChannelRequest:{type:"structure",members:{BundleId:{},Certificate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},PrivateKey:{},TeamId:{},TokenKey:{},TokenKeyId:{}},required:[]},ApplicationId:{location:"uri",locationName:"application-id"}},required:["ApplicationId","APNSVoipSandboxChannelRequest"],payload:"APNSVoipSandboxChannelRequest"},output:{type:"structure",members:{APNSVoipSandboxChannelResponse:{shape:"S2i"}},required:["APNSVoipSandboxChannelResponse"],payload:"APNSVoipSandboxChannelResponse"}},UpdateApplicationSettings:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/settings",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},WriteApplicationSettingsRequest:{type:"structure",members:{CampaignHook:{shape:"Sl"},CloudWatchMetricsEnabled:{type:"boolean"},Limits:{shape:"Sn"},QuietTime:{shape:"Sk"}}}},required:["ApplicationId","WriteApplicationSettingsRequest"],payload:"WriteApplicationSettingsRequest"},output:{type:"structure",members:{ApplicationSettingsResource:{shape:"S3v"}},required:["ApplicationSettingsResource"],payload:"ApplicationSettingsResource"}},UpdateBaiduChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/baidu",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},BaiduChannelRequest:{type:"structure",members:{ApiKey:{},Enabled:{type:"boolean"},SecretKey:{}},required:[]}},required:["ApplicationId","BaiduChannelRequest"],payload:"BaiduChannelRequest"},output:{type:"structure",members:{BaiduChannelResponse:{shape:"S2n"}},required:["BaiduChannelResponse"],payload:"BaiduChannelResponse"}},UpdateCampaign:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/campaigns/{campaign-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},CampaignId:{location:"uri",locationName:"campaign-id"},WriteCampaignRequest:{shape:"S7"}},required:["CampaignId","ApplicationId","WriteCampaignRequest"],payload:"WriteCampaignRequest"},output:{type:"structure",members:{CampaignResponse:{shape:"Sp"}},required:["CampaignResponse"],payload:"CampaignResponse"}},UpdateEmailChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/email",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EmailChannelRequest:{type:"structure",members:{Enabled:{type:"boolean"},FromAddress:{},Identity:{},RoleArn:{}},required:[]}},required:["ApplicationId","EmailChannelRequest"],payload:"EmailChannelRequest"},output:{type:"structure",members:{EmailChannelResponse:{shape:"S2s"}},required:["EmailChannelResponse"],payload:"EmailChannelResponse"}},UpdateEndpoint:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/endpoints/{endpoint-id}",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointId:{location:"uri",locationName:"endpoint-id"},EndpointRequest:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}}},required:["ApplicationId","EndpointId","EndpointRequest"],payload:"EndpointRequest"},output:{type:"structure",members:{MessageBody:{shape:"S7y"}},required:["MessageBody"],payload:"MessageBody"}},UpdateEndpointsBatch:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/endpoints",responseCode:202},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},EndpointBatchRequest:{type:"structure",members:{Item:{type:"list",member:{type:"structure",members:{Address:{},Attributes:{shape:"S2w"},ChannelType:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Id:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}}}},required:[]}},required:["ApplicationId","EndpointBatchRequest"],payload:"EndpointBatchRequest"},output:{type:"structure",members:{MessageBody:{shape:"S7y"}},required:["MessageBody"],payload:"MessageBody"}},UpdateGcmChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/gcm",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},GCMChannelRequest:{type:"structure",members:{ApiKey:{},Enabled:{type:"boolean"}},required:[]}},required:["ApplicationId","GCMChannelRequest"],payload:"GCMChannelRequest"},output:{type:"structure",members:{GCMChannelResponse:{shape:"S37"}},required:["GCMChannelResponse"],payload:"GCMChannelResponse"}},UpdateSegment:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/segments/{segment-id}",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SegmentId:{location:"uri",locationName:"segment-id"},WriteSegmentRequest:{shape:"S18"}},required:["SegmentId","ApplicationId","WriteSegmentRequest"],payload:"WriteSegmentRequest"},output:{type:"structure",members:{SegmentResponse:{shape:"S20"}},required:["SegmentResponse"],payload:"SegmentResponse"}},UpdateSmsChannel:{http:{method:"PUT",requestUri:"/v1/apps/{application-id}/channels/sms",responseCode:200},input:{type:"structure",members:{ApplicationId:{location:"uri",locationName:"application-id"},SMSChannelRequest:{type:"structure",members:{Enabled:{type:"boolean"},SenderId:{},ShortCode:{}},required:[]}},required:["ApplicationId","SMSChannelRequest"],payload:"SMSChannelRequest"},output:{type:"structure",members:{SMSChannelResponse:{shape:"S3c"}},required:["SMSChannelResponse"],payload:"SMSChannelResponse"}}},shapes:{S5:{type:"structure",members:{Id:{},Name:{}},required:[]},S7:{type:"structure",members:{AdditionalTreatments:{type:"list",member:{type:"structure",members:{MessageConfiguration:{shape:"Sa"},Schedule:{shape:"Si"},SizePercent:{type:"integer"},TreatmentDescription:{},TreatmentName:{}},required:[]}},Description:{},HoldoutPercent:{type:"integer"},Hook:{shape:"Sl"},IsPaused:{type:"boolean"},Limits:{shape:"Sn"},MessageConfiguration:{shape:"Sa"},Name:{},Schedule:{shape:"Si"},SegmentId:{},SegmentVersion:{type:"integer"},TreatmentDescription:{},TreatmentName:{}}},Sa:{type:"structure",members:{ADMMessage:{shape:"Sb"},APNSMessage:{shape:"Sb"},BaiduMessage:{shape:"Sb"},DefaultMessage:{shape:"Sb"},EmailMessage:{type:"structure",members:{Body:{},FromAddress:{},HtmlBody:{},Title:{}},required:[]},GCMMessage:{shape:"Sb"},SMSMessage:{type:"structure",members:{Body:{},MessageType:{},SenderId:{}}}}},Sb:{type:"structure",members:{Action:{},Body:{},ImageIconUrl:{},ImageSmallIconUrl:{},ImageUrl:{},JsonBody:{},MediaUrl:{},RawContent:{},SilentPush:{type:"boolean"},TimeToLive:{type:"integer"},Title:{},Url:{}},required:[]},Si:{type:"structure",members:{EndTime:{},Frequency:{},IsLocalTime:{type:"boolean"},QuietTime:{shape:"Sk"},StartTime:{},Timezone:{}},required:[]},Sk:{type:"structure",members:{End:{},Start:{}}},Sl:{type:"structure",members:{LambdaFunctionName:{},Mode:{},WebUrl:{}}},Sn:{type:"structure",members:{Daily:{type:"integer"},MaximumDuration:{type:"integer"},MessagesPerSecond:{type:"integer"},Total:{type:"integer"}}},Sp:{type:"structure",members:{AdditionalTreatments:{type:"list",member:{type:"structure",members:{Id:{},MessageConfiguration:{shape:"Sa"},Schedule:{shape:"Si"},SizePercent:{type:"integer"},State:{shape:"Ss"},TreatmentDescription:{},TreatmentName:{}},required:[]}},ApplicationId:{},CreationDate:{},DefaultState:{shape:"Ss"},Description:{},HoldoutPercent:{type:"integer"},Hook:{shape:"Sl"},Id:{},IsPaused:{type:"boolean"},LastModifiedDate:{},Limits:{shape:"Sn"},MessageConfiguration:{shape:"Sa"},Name:{},Schedule:{shape:"Si"},SegmentId:{},SegmentVersion:{type:"integer"},State:{shape:"Ss"},TreatmentDescription:{},TreatmentName:{},Version:{type:"integer"}},required:[]},Ss:{type:"structure",members:{CampaignStatus:{}}},Sx:{type:"structure",members:{ApplicationId:{},CompletedPieces:{type:"integer"},CompletionDate:{},CreationDate:{},Definition:{type:"structure",members:{RoleArn:{},S3UrlPrefix:{},SegmentId:{},SegmentVersion:{type:"integer"}},required:[]},FailedPieces:{type:"integer"},Failures:{shape:"Sz"},Id:{},JobStatus:{},TotalFailures:{type:"integer"},TotalPieces:{type:"integer"},TotalProcessed:{type:"integer"},Type:{}},required:[]},Sz:{type:"list",member:{}},S15:{type:"structure",members:{ApplicationId:{},CompletedPieces:{type:"integer"},CompletionDate:{},CreationDate:{},Definition:{type:"structure",members:{DefineSegment:{type:"boolean"},ExternalId:{},Format:{},RegisterEndpoints:{type:"boolean"},RoleArn:{},S3Url:{},SegmentId:{},SegmentName:{}},required:[]},FailedPieces:{type:"integer"},Failures:{shape:"Sz"},Id:{},JobStatus:{},TotalFailures:{type:"integer"},TotalPieces:{type:"integer"},TotalProcessed:{type:"integer"},Type:{}},required:[]},S18:{type:"structure",members:{Dimensions:{shape:"S19"},Name:{},SegmentGroups:{shape:"S1q"}},required:[]},S19:{type:"structure",members:{Attributes:{shape:"S1a"},Behavior:{type:"structure",members:{Recency:{type:"structure",members:{Duration:{},RecencyType:{}},required:[]}}},Demographic:{type:"structure",members:{AppVersion:{shape:"S1i"},Channel:{shape:"S1i"},DeviceType:{shape:"S1i"},Make:{shape:"S1i"},Model:{shape:"S1i"},Platform:{shape:"S1i"}}},Location:{type:"structure",members:{Country:{shape:"S1i"},GPSPoint:{type:"structure",members:{Coordinates:{type:"structure",members:{Latitude:{type:"double"},Longitude:{type:"double"}},required:[]},RangeInKilometers:{type:"double"}},required:[]}}},Metrics:{type:"map",key:{},value:{type:"structure",members:{ComparisonOperator:{},Value:{type:"double"}}}},UserAttributes:{shape:"S1a"}}},S1a:{type:"map",key:{},value:{type:"structure",members:{AttributeType:{},Values:{shape:"Sz"}},required:[]}},S1i:{type:"structure",members:{DimensionType:{},Values:{shape:"Sz"}},required:[]},S1q:{type:"structure",members:{Groups:{type:"list",member:{type:"structure",members:{Dimensions:{type:"list",member:{shape:"S19"}},SourceSegments:{type:"list",member:{type:"structure",members:{Id:{},Version:{type:"integer"}}}},SourceType:{},Type:{}},required:[]}},Include:{}},required:[]},S20:{type:"structure",members:{ApplicationId:{},CreationDate:{},Dimensions:{shape:"S19"},Id:{},ImportDefinition:{type:"structure",members:{ChannelCounts:{type:"map",key:{},value:{type:"integer"}},ExternalId:{},Format:{},RoleArn:{},S3Url:{},Size:{type:"integer"}},required:[]},LastModifiedDate:{},Name:{},SegmentGroups:{shape:"S1q"},SegmentType:{},Version:{type:"integer"}},required:[]},S26:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S29:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2c:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2f:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2i:{type:"structure",members:{ApplicationId:{},CreationDate:{},DefaultAuthenticationMethod:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},HasTokenKey:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2n:{type:"structure",members:{ApplicationId:{},CreationDate:{},Credential:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S2s:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},FromAddress:{},HasCredential:{type:"boolean"},Id:{},Identity:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},MessagesPerSecond:{type:"integer"},Platform:{},RoleArn:{},Version:{type:"integer"}},required:[]},S2v:{type:"structure",members:{Address:{},ApplicationId:{},Attributes:{shape:"S2w"},ChannelType:{},CohortId:{},CreationDate:{},Demographic:{shape:"S2y"},EffectiveDate:{},EndpointStatus:{},Id:{},Location:{shape:"S2z"},Metrics:{shape:"S30"},OptOut:{},RequestId:{},User:{shape:"S31"}}},S2w:{type:"map",key:{},value:{shape:"Sz"}},S2y:{type:"structure",members:{AppVersion:{},Locale:{},Make:{},Model:{},ModelVersion:{},Platform:{},PlatformVersion:{},Timezone:{}}},S2z:{type:"structure",members:{City:{},Country:{},Latitude:{type:"double"},Longitude:{type:"double"},PostalCode:{},Region:{}}},S30:{type:"map",key:{},value:{type:"double"}},S31:{type:"structure",members:{UserAttributes:{shape:"S2w"},UserId:{}}},S34:{type:"structure",members:{ApplicationId:{},DestinationStreamArn:{},ExternalId:{},LastModifiedDate:{},LastUpdatedBy:{},RoleArn:{}},required:[]},S37:{type:"structure",members:{ApplicationId:{},CreationDate:{},Credential:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},Version:{type:"integer"}},required:[]},S3c:{type:"structure",members:{ApplicationId:{},CreationDate:{},Enabled:{type:"boolean"},HasCredential:{type:"boolean"},Id:{},IsArchived:{type:"boolean"},LastModifiedBy:{},LastModifiedDate:{},Platform:{},PromotionalMessagesPerSecond:{type:"integer"},SenderId:{},ShortCode:{},TransactionalMessagesPerSecond:{type:"integer"},Version:{type:"integer"}},required:[]},S3f:{type:"structure",members:{Item:{type:"list",member:{shape:"S2v"}}},required:[]},S3v:{type:"structure",members:{ApplicationId:{},CampaignHook:{shape:"Sl"},LastModifiedDate:{},Limits:{shape:"Sn"},QuietTime:{shape:"Sk"}},required:[]},S4d:{type:"structure",members:{Item:{type:"list",member:{shape:"Sp"}},NextToken:{}},required:[]},S4w:{type:"structure",members:{Item:{type:"list",member:{shape:"Sx"}},NextToken:{}},required:[]},S54:{type:"structure",members:{Item:{type:"list",member:{shape:"S15"}},NextToken:{}},required:[]},S5g:{type:"structure",members:{Item:{type:"list",member:{shape:"S20"}},NextToken:{}},required:[]},S62:{type:"map",key:{},value:{}},S6j:{type:"map",key:{},value:{type:"structure",members:{BodyOverride:{},Context:{shape:"S62"},RawContent:{},Substitutions:{shape:"S2w"},TitleOverride:{}}}},S6l:{type:"structure",members:{ADMMessage:{type:"structure",members:{Action:{},Body:{},ConsolidationKey:{},Data:{shape:"S62"},ExpiresAfter:{},IconReference:{},ImageIconUrl:{},ImageUrl:{},MD5:{},RawContent:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},Title:{},Url:{}}},APNSMessage:{type:"structure",members:{Action:{},Badge:{type:"integer"},Body:{},Category:{},CollapseId:{},Data:{shape:"S62"},MediaUrl:{},PreferredAuthenticationMethod:{},Priority:{},RawContent:{},SilentPush:{type:"boolean"},Sound:{},Substitutions:{shape:"S2w"},ThreadId:{},TimeToLive:{type:"integer"},Title:{},Url:{}}},BaiduMessage:{type:"structure",members:{Action:{},Body:{},Data:{shape:"S62"},IconReference:{},ImageIconUrl:{},ImageUrl:{},RawContent:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},TimeToLive:{type:"integer"},Title:{},Url:{}}},DefaultMessage:{type:"structure",members:{Body:{},Substitutions:{shape:"S2w"}}},DefaultPushNotificationMessage:{type:"structure",members:{Action:{},Body:{},Data:{shape:"S62"},SilentPush:{type:"boolean"},Substitutions:{shape:"S2w"},Title:{},Url:{}}},GCMMessage:{type:"structure",members:{Action:{},Body:{},CollapseKey:{},Data:{shape:"S62"},IconReference:{},ImageIconUrl:{},ImageUrl:{},Priority:{},RawContent:{},RestrictedPackageName:{},SilentPush:{type:"boolean"},SmallImageIconUrl:{},Sound:{},Substitutions:{shape:"S2w"},TimeToLive:{type:"integer"},Title:{},Url:{}}},SMSMessage:{type:"structure",members:{Body:{},Keyword:{},MessageType:{},OriginationNumber:{},SenderId:{},Substitutions:{shape:"S2w"}}}},required:[]},S6v:{type:"map",key:{},value:{type:"structure",members:{Address:{},DeliveryStatus:{},MessageId:{},StatusCode:{type:"integer"},StatusMessage:{},UpdatedToken:{}},required:[]}},S7y:{type:"structure",members:{Message:{},RequestID:{}}}}}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=n(31),s=n(62),a=new(n(1).ConsoleLogger)("Cache"),u=function(e){function t(t){var n=this,r=t?Object.assign({},o.defaultConfig,t):o.defaultConfig;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 i(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=o.getCurrTime(),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 o.getCurrTime()>=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),a.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;nt.priority?-1:e.priority5)a.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var s=this.fillCacheItem(r,t,i);if(s.byteSize>this.config.itemMaxSize)a.warn("Item with key: "+e+" you are trying to put into is too big!");else try{var u=this.config.storage.getItem(r);if(u&&this._removeItem(r,JSON.parse(u).byteSize),this._isCacheFull(s.byteSize)){var c=this._findValidKeys();if(this._isCacheFull(s.byteSize)){var l=this._sizeToPop(s.byteSize);this._popOutItems(c,l)}}this._setItem(r,s)}catch(e){a.warn("setItem failed! "+e)}}}else a.warn("The value of item should not be undefined!");else a.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){a.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 a.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 a.warn("getItem failed! "+e),null}},t.prototype.removeItem=function(e){a.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){a.warn("removeItem failed! "+e)}},t.prototype.clear=function(){a.log("Clear Cache");for(var e=[],t=0;t=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},t.getCurrTime=function(){return(new Date).getTime()},t.isInteger=function(e){return Number.isInteger?Number.isInteger(e):function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}(e)};var i={},o=function(){function e(){}return e.clear=function(){i={}},e.getItem=function(e){return i[e]||null},e.setItem=function(e,t){i[e]=t},e.removeItem=function(e){delete i[e]},e}();t.CacheObject=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e){this.key=e||"",this.prevNode=null,this.nextNode=null}}(),i=function(){function e(){this.head=new r,this.tail=new r,this.hashtable={},this.length=0,this.head.nextNode=this.tail,this.tail.prevNode=this.head}return e.prototype.insertNodeToHead=function(e){var t=this.head.nextNode;this.head.nextNode=e,e.nextNode=t,e.prevNode=this.head,t.prevNode=e,this.length=this.length+1},e.prototype.removeNode=function(e){e.prevNode.nextNode=e.nextNode,e.nextNode.prevNode=e.prevNode,e.prevNode=null,e.nextNode=null,this.length=this.length-1},e.prototype.isEmpty=function(){return 0===this.length},e.prototype.refresh=function(e){var t=this.hashtable[e];this.removeNode(t),this.insertNodeToHead(t)},e.prototype.insertItem=function(e){var t=new r(e);this.hashtable[e]=t,this.insertNodeToHead(t)},e.prototype.getLastItem=function(){return this.tail.prevNode.key},e.prototype.removeItem=function(e){var t=this.hashtable[e];this.removeNode(t),delete this.hashtable[e]},e.prototype.getSize=function(){return this.length},e.prototype.containsKey=function(e){return e in this.hashtable},e.prototype.clearList=function(){for(var e=0,t=Object.keys(this.hashtable);e=n.expires},t.prototype._removeItem=function(e,t){this.cacheList[t].removeItem(e),this._decreaseCurSizeInBytes(JSON.parse(o.CacheObject.getItem(e)).byteSize),o.CacheObject.removeItem(e)},t.prototype._setItem=function(e,t,n){this.cacheList[n].insertItem(e),this._increaseCurSizeInBytes(t.byteSize),o.CacheObject.setItem(e,JSON.stringify(t))},t.prototype._isCacheFull=function(e){return this.curSizeInBytes+e>this.config.capacityInBytes},t.prototype.containsKey=function(e){for(var t=this.config.keyPrefix+e,n=0;n5)a.warn("Invalid parameter: priority due to out or range. It should be within 1 and 5.");else{var s=this.fillCacheItem(r,t,i);if(s.byteSize>this.config.itemMaxSize)a.warn("Item with key: "+e+" you are trying to put into is too big!");else{var u=this.containsKey(e);-1!==u&&this._removeItem(r,u-1);for(var c=this.maxPriority-1;this._isCacheFull(s.byteSize)&&c>=0;)if(this.cacheList[c].isEmpty())c-=1;else{var l=this.cacheList[c].getLastItem();this._removeItem(l,c)}this._setItem(r,s,Number(s.priority)-1)}}}else a.warn("The value of item should not be undefined!");else a.warn("Invalid key: should not be empty or 'CurSize'")},t.prototype.getItem=function(e,t){var n=null,r=this.config.keyPrefix+e;if(r===this.config.keyPrefix||r===this.cacheCurSizeKey)return a.warn("Invalid key: should not be empty or 'CurSize'"),null;var i=this.containsKey(e);if(-1!==i){if(!this._isExpired(r)){n=o.CacheObject.getItem(r);var s=JSON.parse(n);return this.cacheList[s.priority-1].refresh(r),s.data}this._removeItem(r,i-1)}if(t&&void 0!==t.callback){var u=t.callback();return null!==u&&this.setItem(e,u,t),u}return null},t.prototype.removeItem=function(e){var t=this.config.keyPrefix+e,n=this.containsKey(e);-1!==n&&this._removeItem(t,n-1)},t.prototype.clear=function(){for(var e=0;ea)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=h,u=m,i=d;var y=(1e4*(268435455&(h+=122192928e5))+m)%4294967296;l[c++]=y>>>24&255,l[c++]=y>>>16&255,l[c++]=y>>>8&255,l[c++]=255&y;var v=h/4294967296*1e4&268435455;l[c++]=v>>>8&255,l[c++]=255&v,l[c++]=v>>>24&15|16,l[c++]=v>>>16&255,l[c++]=d>>>8|128,l[c++]=255&d;for(var b=0;b<6;++b)l[c+b]=p[b];return t||s(l)}},function(e,t,n){var r=n(63),i=n(64);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});var r=n(180);t.PageViewTracker=r.default;var i=n(182);t.EventTracker=i.default;var o=n(188);t.SessionTracker=o.default},function(e,t,n){"use strict";var r=this&&this.__awaiter||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){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,a)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||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=(i=s.trys).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]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]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]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]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]r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,a=o.words,c=0;c0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]1&&(e="Multiple configuration errors:\n"+t.join("\n")),e)throw r.util.error(new Error,{name:"InvalidEndpoint",message:e})},shouldDisableBodySigning:function(e){var t=this.getSignerClass();return!0===this.config.s3DisableBodySigning&&t===r.Signers.V4&&"https:"===e.httpRequest.endpoint.protocol},setupRequestListeners:function(e){e.addListener("validate",this.validateScheme),e.addListener("validate",this.validateBucketEndpoint),e.addListener("validate",this.correctBucketRegionFromCache),e.addListener("validate",this.validateBucketName,!0),e.addListener("build",this.addContentType),e.addListener("build",this.populateURI),e.addListener("build",this.computeContentMd5),e.addListener("build",this.computeSseCustomerKeyMd5),e.addListener("afterBuild",this.addExpect100Continue),e.removeListener("validate",r.EventListeners.Core.VALIDATE_REGION),e.addListener("extractError",this.extractError),e.onAsync("extractError",this.requestBucketRegion),e.addListener("extractData",this.extractData),e.addListener("extractData",r.util.hoistPayloadMember),e.addListener("beforePresign",this.prepareSignedUrl),r.util.isBrowser()&&e.onAsync("retry",this.reqRegionForNetworkingError),this.shouldDisableBodySigning(e)&&(e.removeListener("afterBuild",r.EventListeners.Core.COMPUTE_SHA256),e.addListener("afterBuild",this.disableBodySigning))},validateScheme:function(e){var t=e.params,n=e.httpRequest.endpoint.protocol;if((t.SSECustomerKey||t.CopySourceSSECustomerKey)&&"https:"!==n){throw r.util.error(new Error,{code:"ConfigError",message:"Cannot send SSE keys over HTTP. Set 'sslEnabled'to 'true' in your configuration"})}},validateBucketEndpoint:function(e){if(!e.params.Bucket&&e.service.config.s3BucketEndpoint){throw r.util.error(new Error,{code:"ConfigError",message:"Cannot send requests to root API with `s3BucketEndpoint` set."})}},validateBucketName:function(e){var t=e.service.getSignatureVersion(e),n=e.params&&e.params.Bucket,i=e.params&&e.params.Key,o=n&&n.indexOf("/");if(n&&o>=0)if("string"==typeof i){e.params=r.util.copy(e.params);var s=n.substr(o+1)||"";e.params.Key=s+"/"+i,e.params.Bucket=n.substr(0,o)}else if("v4"===t){var a="Bucket names cannot contain forward slashes. Bucket: "+n;throw r.util.error(new Error,{code:"InvalidBucket",message:a})}},isValidAccelerateOperation:function(e){return-1===["createBucket","deleteBucket","listBuckets"].indexOf(e)},populateURI:function(e){var t=e.httpRequest,n=e.params.Bucket,r=e.service,i=t.endpoint;if(n&&!r.pathStyleBucketName(n)){r.config.useAccelerateEndpoint&&r.isValidAccelerateOperation(e.operation)?r.config.useDualstack?i.hostname=n+".s3-accelerate.dualstack.amazonaws.com":i.hostname=n+".s3-accelerate.amazonaws.com":r.config.s3BucketEndpoint||(i.hostname=n+"."+i.hostname);var o=i.port;i.host=80!==o&&443!==o?i.hostname+":"+i.port:i.hostname,t.virtualHostedBucket=n,r.removeVirtualHostedBucketFromPath(e)}},removeVirtualHostedBucketFromPath:function(e){var t=e.httpRequest,n=t.virtualHostedBucket;if(n&&t.path){if(e.params&&e.params.Key&&0===t.path.indexOf("/"+r.util.uriEscapePath(e.params.Key)))return;t.path=t.path.replace(new RegExp("/"+n),""),"/"!==t.path[0]&&(t.path="/"+t.path)}},addExpect100Continue:function(e){var t=e.httpRequest.headers["Content-Length"];r.util.isNode()&&t>=1048576&&(e.httpRequest.headers.Expect="100-continue")},addContentType:function(e){var t=e.httpRequest;if("GET"!==t.method&&"HEAD"!==t.method){t.headers["Content-Type"]||(t.headers["Content-Type"]="application/octet-stream");var n=t.headers["Content-Type"];if(r.util.isBrowser())if("string"!=typeof t.body||n.match(/;\s*charset=/)){t.headers["Content-Type"]=n.replace(/(;\s*charset=)(.+)$/,function(e,t,n){return t+n.toUpperCase()})}else{t.headers["Content-Type"]+="; charset=UTF-8"}}else delete t.headers["Content-Type"]},computableChecksumOperations:{putBucketCors:!0,putBucketLifecycle:!0,putBucketLifecycleConfiguration:!0,putBucketTagging:!0,deleteObjects:!0,putBucketReplication:!0},willComputeChecksums:function(e){if(this.computableChecksumOperations[e.operation])return!0;if(!this.config.computeChecksums)return!1;if(!r.util.Buffer.isBuffer(e.httpRequest.body)&&"string"!=typeof e.httpRequest.body)return!1;var t=e.service.api.operations[e.operation].input.members;return!(!e.service.shouldDisableBodySigning(e)||Object.prototype.hasOwnProperty.call(e.httpRequest.headers,"presigned-expires")||!t.ContentMD5||e.params.ContentMD5)||!(e.service.getSignerClass(e)===r.Signers.V4&&t.ContentMD5&&!t.ContentMD5.required)&&(!(!t.ContentMD5||e.params.ContentMD5)||void 0)},computeContentMd5:function(e){if(e.service.willComputeChecksums(e)){var t=r.util.crypto.md5(e.httpRequest.body,"base64");e.httpRequest.headers["Content-MD5"]=t}},computeSseCustomerKeyMd5:function(e){r.util.each({SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"},function(t,n){if(e.params[t]){var i=r.util.crypto.md5(e.params[t],"base64");e.httpRequest.headers[n]=i}})},pathStyleBucketName:function(e){return!!this.config.s3ForcePathStyle||!this.config.s3BucketEndpoint&&(!this.dnsCompatibleBucketName(e)||!(!this.config.sslEnabled||!e.match(/\./)))},dnsCompatibleBucketName:function(e){var t=e,n=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/),r=new RegExp(/(\d+\.){3}\d+/),i=new RegExp(/\.\./);return!(!t.match(n)||t.match(r)||t.match(i))},successfulResponse:function(e){var t=e.request,n=e.httpResponse;return(!o[t.operation]||!n.body.toString().match(""))&&n.statusCode<300},retryableError:function(e,t){return!(!o[t.operation]||200!==e.statusCode)||(!t._requestRegionForBucket||!t.service.bucketRegionCache[t._requestRegionForBucket])&&(!(!e||"RequestTimeout"!==e.code)||(e&&-1!=s.indexOf(e.code)&&e.region&&e.region!=t.httpRequest.region?(t.httpRequest.region=e.region,301===e.statusCode&&t.service.updateReqBucketRegion(t),!0):r.Service.prototype.retryableError.call(this,e,t)))},updateReqBucketRegion:function(e,t){var n=e.httpRequest;if("string"==typeof t&&t.length&&(n.region=t),n.endpoint.host.match(/s3(?!-accelerate).*\.amazonaws\.com$/)){var i=e.service,o=i.config,s=o.s3BucketEndpoint;s&&delete o.s3BucketEndpoint;var a=r.util.copy(o);delete a.endpoint,a.region=n.region,n.endpoint=new r.S3(a).endpoint,i.populateURI(e),o.s3BucketEndpoint=s,n.headers.Host=n.endpoint.host,"validate"===e._asm.currentState&&(e.removeListener("build",i.populateURI),e.addListener("build",i.removeVirtualHostedBucketFromPath))}},extractData:function(e){var t=e.request;if("getBucketLocation"===t.operation){var n=e.httpResponse.body.toString().match(/>(.+)<\/Location/);delete e.data._,e.data.LocationConstraint=n?n[1]:""}var r=t.params.Bucket||null;if("deleteBucket"!==t.operation||"string"!=typeof r||e.error){var i=(e.httpResponse.headers||{})["x-amz-bucket-region"]||null;if(!i&&"createBucket"===t.operation&&!e.error){var o=t.params.CreateBucketConfiguration;i=o?"EU"===o.LocationConstraint?"eu-west-1":o.LocationConstraint:"us-east-1"}i&&r&&i!==t.service.bucketRegionCache[r]&&(t.service.bucketRegionCache[r]=i)}else t.service.clearBucketRegionCache(r);t.service.extractRequestIds(e)},extractError:function(e){var t,n={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"},i=e.request,o=e.httpResponse.statusCode,s=e.httpResponse.body||"",a=(e.httpResponse.headers||{})["x-amz-bucket-region"]||null,u=i.params.Bucket||null,c=i.service.bucketRegionCache;if(a&&u&&a!==c[u]&&(c[u]=a),n[o]&&0===s.length)u&&!a&&(t=c[u]||null)!==i.httpRequest.region&&(a=t),e.error=r.util.error(new Error,{code:n[o],message:null,region:a});else{var l=(new r.XML.Parser).parse(s.toString());l.Region&&!a?(a=l.Region,u&&a!==c[u]&&(c[u]=a)):!u||a||l.Region||(t=c[u]||null)!==i.httpRequest.region&&(a=t),e.error=r.util.error(new Error,{code:l.Code||o,message:l.Message||null,region:a})}i.service.extractRequestIds(e)},requestBucketRegion:function(e,t){var n=e.error,i=e.request,o=i.params.Bucket||null;if(!n||!o||n.region||"listObjects"===i.operation||r.util.isNode()&&"headBucket"===i.operation||400===n.statusCode&&"headObject"!==i.operation||-1===s.indexOf(n.code))return t();var a=r.util.isNode()?"headBucket":"listObjects",u={Bucket:o};"listObjects"===a&&(u.MaxKeys=0);var c=i.service[a](u);c._requestRegionForBucket=o,c.send(function(){var e=i.service.bucketRegionCache[o]||null;n.region=e,t()})},reqRegionForNetworkingError:function(e,t){if(!r.util.isBrowser())return t();var n=e.error,i=e.request,o=i.params.Bucket;if(!n||"NetworkingError"!==n.code||!o||"us-east-1"===i.httpRequest.region)return t();var s=i.service,a=s.bucketRegionCache,u=a[o]||null;if(u&&u!==i.httpRequest.region)s.updateReqBucketRegion(i,u),t();else if(s.dnsCompatibleBucketName(o))if(i.httpRequest.virtualHostedBucket){var c=s.listObjects({Bucket:o,MaxKeys:0});s.updateReqBucketRegion(c,"us-east-1"),c._requestRegionForBucket=o,c.send(function(){var e=s.bucketRegionCache[o]||null;e&&e!==i.httpRequest.region&&s.updateReqBucketRegion(i,e),t()})}else t();else s.updateReqBucketRegion(i,"us-east-1"),"us-east-1"!==a[o]&&(a[o]="us-east-1"),t()},bucketRegionCache:{},clearBucketRegionCache:function(e){var t=this.bucketRegionCache;e?"string"==typeof e&&(e=[e]):e=Object.keys(t);for(var n=0;n=1&&t.doneParts===t.numParts&&t.finishMultiPart()}))}n&&t.fillQueue.call(t)},abort:function(){this.cleanup(r.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1}))},validateBody:function(){if(this.body=this.service.config.params.Body,"string"==typeof this.body)this.body=new r.util.Buffer(this.body);else if(!this.body)throw new Error("params.Body is required");this.sliceFn=r.util.arraySliceFn(this.body)},bindServiceObject:function(e){e=e||{};if(this.service){var t=this.service,n=r.util.copy(t.config);n.signatureVersion=t.getSignatureVersion(),this.service=new t.constructor.__super__(n),this.service.config.params=r.util.merge(this.service.config.params||{},e)}else this.service=new r.S3({params:e})},adjustTotalBytes:function(){try{this.totalBytes=i(this.body)}catch(e){}if(this.totalBytes){var e=Math.ceil(this.totalBytes/this.maxTotalParts);e>this.partSize&&(this.partSize=e)}else this.totalBytes=void 0},isDoneChunking:!1,partPos:0,totalChunkedBytes:0,totalUploadedBytes:0,totalBytes:void 0,numParts:0,totalPartNumbers:0,activeParts:0,doneParts:0,parts:null,completeInfo:null,failed:!1,multipartReq:null,partBuffers:null,partBufferLength:0,fillBuffer:function(){var e=i(this.body);if(0===e)return this.isDoneChunking=!0,this.numParts=1,void this.nextChunk(this.body);for(;this.activeParts=this.queueSize)){var e=this.body.read(this.partSize-this.partBufferLength)||this.body.read();if(e&&(this.partBuffers.push(e),this.partBufferLength+=e.length,this.totalChunkedBytes+=e.length),this.partBufferLength>=this.partSize){var t=1===this.partBuffers.length?this.partBuffers[0]:o.concat(this.partBuffers);if(this.partBuffers=[],this.partBufferLength=0,t.length>this.partSize){var n=t.slice(this.partSize);this.partBuffers.push(n),this.partBufferLength+=n.length,t=t.slice(0,this.partSize)}this.nextChunk(t)}this.isDoneChunking&&!this.isDoneSending&&(t=1===this.partBuffers.length?this.partBuffers[0]:o.concat(this.partBuffers),this.partBuffers=[],this.partBufferLength=0,this.totalBytes=this.totalChunkedBytes,this.isDoneSending=!0,(0===this.numParts||t.length>0)&&(this.numParts++,this.nextChunk(t))),this.body.read(0)}},nextChunk:function(e){var t=this;if(t.failed)return null;var n=++t.totalPartNumbers;if(t.isDoneChunking&&1===n){var i={Body:e};this.tags&&(i.Tagging=this.getTaggingHeader());var o=t.service.putObject(i);return o._managedUpload=t,o.on("httpUploadProgress",t.progress).send(t.finishSinglePart),null}if(t.service.config.params.ContentMD5){var s=r.util.error(new Error("The Content-MD5 you specified is invalid for multi-part uploads."),{code:"InvalidDigest",retryable:!1});return t.cleanup(s),null}if(t.completeInfo[n]&&null!==t.completeInfo[n].ETag)return null;t.activeParts++,t.service.config.params.UploadId?t.uploadPart(e,n):t.multipartReq?t.queueChunks(e,n):(t.multipartReq=t.service.createMultipartUpload(),t.multipartReq.on("success",function(e){t.service.config.params.UploadId=e.data.UploadId,t.multipartReq=null}),t.queueChunks(e,n),t.multipartReq.on("error",function(e){t.cleanup(e)}),t.multipartReq.send())},getTaggingHeader:function(){for(var e=[],t=0;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]2&&void 0!==arguments[2]?arguments[2]:r,a=void 0,u=Array.isArray(e),c=[e],l=-1,p=[],d=void 0,f=void 0,h=void 0,m=[],g=[],y=e;do{var v=++l===c.length,b=v&&0!==p.length;if(v){if(f=0===g.length?void 0:m[m.length-1],d=h,h=g.pop(),b){if(u)d=d.slice();else{var S={};for(var _ in d)d.hasOwnProperty(_)&&(S[_]=d[_]);d=S}for(var E=0,I=0;I0||(0,o.default)(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||(0,o.default)(0,"column in locationOffset is 1-indexed and must be positive")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new r.GraphQLError("Syntax Error: "+n,void 0,e,[t])};var r=n(34)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.locatedError=function(e,t,n){if(e&&Array.isArray(e.path))return e;return new r.GraphQLError(e&&e.message,e&&e.nodes||t,e&&e.source,e&&e.positions,n,e)};var r=n(34)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});var l=String.prototype.charCodeAt,p=String.prototype.slice;function d(e,t,n,r,i,o,s){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=s,this.prev=o,this.next=null}function f(e){return isNaN(e)?c.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'+("00"+e.toString(16).toUpperCase()).slice(-4)+'"'}function h(e,t){var n=e.source,r=n.body,o=r.length,a=function(e,t,n){var r=e.length,i=t;for(;i=o)return new d(c.EOF,o,o,u,h,t);var y=l.call(r,a);if(y<32&&9!==y&&10!==y&&13!==y)throw(0,i.syntaxError)(n,a,"Cannot contain the invalid character "+f(y)+".");switch(y){case 33:return new d(c.BANG,a,a+1,u,h,t);case 35:return function(e,t,n,r,i){var o=e.body,s=void 0,a=t;do{s=l.call(o,++a)}while(null!==s&&(s>31||9===s));return new d(c.COMMENT,t,a,n,r,i,p.call(o,t+1,a))}(n,a,u,h,t);case 36:return new d(c.DOLLAR,a,a+1,u,h,t);case 38:return new d(c.AMP,a,a+1,u,h,t);case 40:return new d(c.PAREN_L,a,a+1,u,h,t);case 41:return new d(c.PAREN_R,a,a+1,u,h,t);case 46:if(46===l.call(r,a+1)&&46===l.call(r,a+2))return new d(c.SPREAD,a,a+3,u,h,t);break;case 58:return new d(c.COLON,a,a+1,u,h,t);case 61:return new d(c.EQUALS,a,a+1,u,h,t);case 64:return new d(c.AT,a,a+1,u,h,t);case 91:return new d(c.BRACKET_L,a,a+1,u,h,t);case 93:return new d(c.BRACKET_R,a,a+1,u,h,t);case 123:return new d(c.BRACE_L,a,a+1,u,h,t);case 124:return new d(c.PIPE,a,a+1,u,h,t);case 125:return new d(c.BRACE_R,a,a+1,u,h,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,i){var o=e.body,s=o.length,a=t+1,u=0;for(;a!==s&&null!==(u=l.call(o,a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new d(c.NAME,t,a,n,r,i,p.call(o,t,a))}(n,a,u,h,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,o,s){var a=e.body,u=n,h=t,g=!1;45===u&&(u=l.call(a,++h));if(48===u){if((u=l.call(a,++h))>=48&&u<=57)throw(0,i.syntaxError)(e,h,"Invalid number, unexpected digit after 0: "+f(u)+".")}else h=m(e,h,u),u=l.call(a,h);46===u&&(g=!0,u=l.call(a,++h),h=m(e,h,u),u=l.call(a,h));69!==u&&101!==u||(g=!0,43!==(u=l.call(a,++h))&&45!==u||(u=l.call(a,++h)),h=m(e,h,u));return new d(g?c.FLOAT:c.INT,t,h,r,o,s,p.call(a,t,h))}(n,a,y,u,h,t);case 34:return 34===l.call(r,a+1)&&34===l.call(r,a+2)?function(e,t,n,r,o){var a=e.body,u=t+3,h=u,m=0,g="";for(;u=48&&s<=57){do{s=l.call(r,++o)}while(s>=48&&s<=57);return o}throw(0,i.syntaxError)(e,o,"Invalid number, expected digit but got: "+f(s)+".")}function g(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}d.prototype.toJSON=d.prototype.inspect=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}},function(e,t,n){"use strict";function r(e){for(var t=0;t0&&i(t[0]);)t.shift();for(;t.length>0&&i(t[t.length-1]);)t.pop();return t.join("\n")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Kind=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",VARIABLE:"Variable",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension",DIRECTIVE_DEFINITION:"DirectiveDefinition"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DirectiveLocation=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1,i=!1,o=arguments[1];return new n(function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})})}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach(function(e){return e.unsubscribe()}),o.unsubscribe()}})}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=p(t,c);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return f(i)&&i.constructor===n?i:new n(function(e){return i.subscribe(e)})}if(s("iterator")&&(r=p(t,u)))return new n(function(e){m(function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var s,a=r.call(t)[Symbol.iterator]();!(n=(s=a.next()).done);n=!0){var u=s.value;if(e.next(u),e.closed)return}}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}e.complete()}})});if(Array.isArray(t))return new n(function(e){m(function(){if(!e.closed){for(var n=0;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]