diff --git a/README.md b/README.md index 86e7672420..2bbddebe1c 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ to work with the new major version. To use the SDK in the browser, simply add the following script tag to your HTML pages: - + The AWS SDK is also compatible with [browserify](http://browserify.org). diff --git a/dist/aws-sdk.js b/dist/aws-sdk.js index e8d411138a..03b3bd7860 100644 --- a/dist/aws-sdk.js +++ b/dist/aws-sdk.js @@ -1,4 +1,4 @@ -// AWS SDK for JavaScript v2.1.36 +// AWS SDK for JavaScript v2.1.37 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o> 1, - nBits = -7, - i = isLE ? (nBytes - 1) : 0, - d = isLE ? -1 : 1, - s = buffer[offset + i]; - - i += d; - - e = s & ((1 << (-nBits)) - 1); - s >>= (-nBits); - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8); - - m = e & ((1 << (-nBits)) - 1); - e >>= (-nBits); - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8); +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} if (e === 0) { - e = 1 - eBias; + e = 1 - eBias } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity); + return m ? NaN : ((s ? -1 : 1) * Infinity) } else { - m = m + Math.pow(2, mLen); - e = e - eBias; + m = m + Math.pow(2, mLen) + e = e - eBias } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); -}; + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} -exports.write = function(buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c, - eLen = nBytes * 8 - mLen - 1, - eMax = (1 << eLen) - 1, - eBias = eMax >> 1, - rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0), - i = isLE ? 0 : (nBytes - 1), - d = isLE ? 1 : -1, - s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0; +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - value = Math.abs(value); + value = Math.abs(value) if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; + m = isNaN(value) ? 1 : 0 + e = eMax } else { - e = Math.floor(Math.log(value) / Math.LN2); + e = Math.floor(Math.log(value) / Math.LN2) if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; + e-- + c *= 2 } if (e + eBias >= 1) { - value += rt / c; + value += rt / c } else { - value += rt * Math.pow(2, 1 - eBias); + value += rt * Math.pow(2, 1 - eBias) } if (value * c >= 2) { - e++; - c /= 2; + e++ + c /= 2 } if (e + eBias >= eMax) { - m = 0; - e = eMax; + m = 0 + e = eMax } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 } } - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8); + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - e = (e << mLen) | m; - eLen += mLen; - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8); + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - buffer[offset + i - d] |= s * 128; -}; + buffer[offset + i - d] |= s * 128 +} },{}],57:[function(require,module,exports){ var Buffer = require('buffer').Buffer; diff --git a/dist/aws-sdk.min.js b/dist/aws-sdk.min.js index 4e50e3f73f..55e4b19da3 100644 --- a/dist/aws-sdk.min.js +++ b/dist/aws-sdk.min.js @@ -1,9 +1,17 @@ -// AWS SDK for JavaScript v2.1.36 +// AWS SDK for JavaScript v2.1.37 // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // License at https://sdk.amazonaws.com/js/BUNDLE_LICENSE.txt -!function e(t,r,a){function o(i,s){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(n)return n(i,!0);throw new Error("Cannot find module '"+i+"'")}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){var r=t[i][1][e];return o(r?r:e)},c,c.exports,e,t,r,a)}return r[i].exports}for(var n="function"==typeof require&&require,i=0;ithis.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},get:function(e){var t=this;this.needsRefresh()?this.refresh(function(r){r||(t.expired=!1),e&&e(r)}):e&&e()},refresh:function(e){this.expired=!1,e()}})},{"./core":3}],5:[function(e){var t=e("../core");t.CognitoIdentityCredentials=t.util.inherit(t.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(e){t.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this.identityId=null,this.loadCachedId()},refresh:function(e){var t=this;t.createClients(),t.data=null,t.identityId=null,t.getId(function(r){r?(t.clearCachedId(),e(r)):t.params.RoleArn?t.getCredentialsFromSTS(e):t.getCredentialsForIdentity(e)})},clearCachedId:function(){this.identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId;delete this.storage[this.localStorageKey.id+e],delete this.storage[this.localStorageKey.providers+e]},getId:function(e){var t=this;return"string"==typeof t.params.IdentityId?e(null,t.params.IdentityId):void t.cognito.getId(function(r,a){!r&&a.IdentityId?(t.params.IdentityId=a.IdentityId,e(null,a.IdentityId)):e(r)})},loadCredentials:function(e,t){e&&t&&(t.expired=!1,t.accessKeyId=e.Credentials.AccessKeyId,t.secretAccessKey=e.Credentials.SecretKey,t.sessionToken=e.Credentials.SessionToken,t.expireTime=e.Credentials.Expiration)},getCredentialsForIdentity:function(e){var t=this;t.cognito.getCredentialsForIdentity(function(r,a){r?t.clearCachedId():(t.cacheId(a),t.data=a,t.loadCredentials(t.data,t)),e(r)})},getCredentialsFromSTS:function(e){var t=this;t.cognito.getOpenIdToken(function(r,a){r?(t.clearCachedId(),e(r)):(t.cacheId(a),t.params.WebIdentityToken=a.Token,t.webIdentityCredentials.refresh(function(r){r?t.clearCachedId():(t.data=t.webIdentityCredentials.data,t.sts.credentialsFrom(t.data,t)),e(r)}))})},loadCachedId:function(){var e=this;if(t.util.isBrowser()&&!e.params.IdentityId){var r=e.getStorage("id");if(r&&e.params.Logins){var a=Object.keys(e.params.Logins),o=(e.getStorage("providers")||"").split(","),n=o.filter(function(e){return-1!==a.indexOf(e)});0!==n.length&&(e.params.IdentityId=r)}else r&&(e.params.IdentityId=r)}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new t.WebIdentityCredentials(this.params),this.cognito=this.cognito||new t.CognitoIdentity({params:this.params}),this.sts=this.sts||new t.STS},cacheId:function(e){this.identityId=e.IdentityId,this.params.IdentityId=this.identityId,t.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId]},setStorage:function(e,t){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId]=t}catch(r){}},storage:function(){try{return t.util.isBrowser()&&"object"==typeof window.localStorage?window.localStorage:{}}catch(e){return{}}}()})},{"../core":3}],6:[function(e){var t=e("../core");t.CredentialProviderChain=t.util.inherit(t.Credentials,{constructor:function(e){this.providers=e?e:t.CredentialProviderChain.defaultProviders.slice(0)},resolve:function(e){function t(o,n){if(!o&&n||r===a.length)return void e(o,n);var i=a[r++];n="function"==typeof i?i.call():i,n.get?n.get(function(e){t(e,e?null:n)}):t(null,n)}if(0===this.providers.length)return e(new Error("No providers")),this;var r=0,a=this.providers.slice(0);return t(),this}}),t.CredentialProviderChain.defaultProviders=[]},{"../core":3}],7:[function(e){var t=e("../core");t.SAMLCredentials=t.util.inherit(t.Credentials,{constructor:function(e){t.Credentials.call(this),this.expired=!0,this.params=e},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.assumeRoleWithSAML(function(r,a){r||t.service.credentialsFrom(a,t),e(r)})},createClients:function(){this.service=this.service||new t.STS({params:this.params})}})},{"../core":3}],8:[function(e){var t=e("../core");t.TemporaryCredentials=t.util.inherit(t.Credentials,{constructor:function(e){t.Credentials.call(this),this.loadMasterCredentials(),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.config.credentials=t.masterCredentials;var r=t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken;r.call(t.service,function(r,a){r||t.service.credentialsFrom(a,t),e(r)})},loadMasterCredentials:function(){for(this.masterCredentials=t.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials},createClients:function(){this.service=this.service||new t.STS({params:this.params})}})},{"../core":3}],9:[function(e){var t=e("../core");t.WebIdentityCredentials=t.util.inherit(t.Credentials,{constructor:function(e){t.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.assumeRoleWithWebIdentity(function(r,a){t.data=null,r||(t.data=a,t.service.credentialsFrom(a,t)),e(r)})},createClients:function(){this.service=this.service||new t.STS({params:this.params})}})},{"../core":3}],10:[function(e){var t=e("./core"),r=e("./sequential_executor");t.EventListeners={Core:{}},t.EventListeners={Core:(new r).addNamedListeners(function(e,r){r("VALIDATE_CREDENTIALS","validate",function(e,r){return e.service.api.signatureVersion?void e.service.config.getCredentials(function(a){a&&(e.response.error=t.util.error(a,{code:"CredentialsError",message:"Missing credentials in config"})),r()}):r()}),e("VALIDATE_REGION","validate",function(e){e.service.config.region||e.service.isGlobalEndpoint||(e.response.error=t.util.error(new Error,{code:"ConfigError",message:"Missing region in config"}))}),e("VALIDATE_PARAMETERS","validate",function(e){var r=e.service.api.operations[e.operation].input;(new t.ParamValidator).validate(r,e.params)}),r("COMPUTE_SHA256","afterBuild",function(e,r){if(e.haltHandlersOnError(),!e.service.api.signatureVersion)return r();if(e.service.getSignerClass(e)===t.Signers.V4){var a=e.httpRequest.body||"";t.util.computeSha256(a,function(t,a){t?r(t):(e.httpRequest.headers["X-Amz-Content-Sha256"]=a,r())})}else r()}),e("SET_CONTENT_LENGTH","afterBuild",function(e){if(void 0===e.httpRequest.headers["Content-Length"]){var r=t.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=r}}),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 t.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(e){e?r(e):i()}):i()}),e("HTTP_HEADERS","httpHeaders",function(e,r,a){a.httpResponse.statusCode=e,a.httpResponse.headers=r,a.httpResponse.body=new t.util.Buffer(""),a.httpResponse.buffers=[],a.httpResponse.numBytes=0}),e("HTTP_DATA","httpData",function(e,r){if(e){if(t.util.isNode()){r.httpResponse.numBytes+=e.length;var a=r.httpResponse.headers["content-length"],o={loaded:r.httpResponse.numBytes,total:a};r.request.emit("httpDownloadProgress",[o,r])}r.httpResponse.buffers.push(new t.util.Buffer(e))}}),e("HTTP_DONE","httpDone",function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var r=t.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=r}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("REDIRECT","retry",function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new t.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){if(e.error)if(e.error.redirect&&e.redirectCount=this.HEADERS_RECEIVED&&!m){try{p.responseType="arraybuffer"}catch(e){}u.statusCode=p.status,u.headers=i.parseHeaders(p.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers),m=!0}this.readyState===this.DONE&&i.finishRequest(p,u)},!1),p.upload.addEventListener("progress",function(e){u.emit("sendProgress",e)}),p.addEventListener("progress",function(e){u.emit("receiveProgress",e)},!1),p.addEventListener("timeout",function(){n(t.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),p.addEventListener("error",function(){n(t.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),o(u),p.open(e.method,c,a.xhrAsync!==!1),t.util.each(e.headers,function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&p.setRequestHeader(e,t)}),a.timeout&&a.xhrAsync!==!1&&(p.timeout=a.timeout),a.xhrWithCredentials&&(p.withCredentials=!0);try{p.send(e.body)}catch(l){if(!e.body||"object"!=typeof e.body.buffer)throw l;p.send(e.body.buffer)}return u},parseHeaders:function(e){var r={};return t.util.arrayEach(e.split(/\r?\n/),function(e){var t=e.split(":",1)[0],a=e.substring(t.length+2);t.length>0&&(r[t.toLowerCase()]=a)}),r},finishRequest:function(e,r){var a;if("arraybuffer"===e.responseType&&e.response){var o=e.response;a=new t.util.Buffer(o.byteLength);for(var n=new Uint8Array(o),i=0;i1)){if(1===this.errors.length)throw this.errors[0];return!0}var o=this.errors.join("\n* ");if(this.errors.length>1)throw o="There were "+this.errors.length+" validation errors:\n* "+o,t.util.error(new Error(o),{code:"MultipleValidationErrors",errors:this.errors}) -},validateStructure:function(e,t,r){this.validateType(r,t,["object"],"structure");for(var a,o=0;e.required&&o0){var a=JSON.parse(r.body.toString());(a.__type||a.code)&&(t.code=(a.__type||a.code).split("#").pop()),t.message="RequestEntityTooLarge"===t.code?"Request body must be less than 1 MB":a.message||a.Message||null}else t.statusCode=r.statusCode,t.message=r.statusCode.toString();e.error=n.error(new Error,t)}function o(e){var t=e.httpResponse.body.toString()||"{}";if(e.request.service.config.convertResponseTypes===!1)e.data=JSON.parse(t);else{var r=e.request.service.api.operations[e.request.operation],a=r.output||{},o=new s;e.data=o.parse(t,a)}}var n=e("../util"),i=e("../json/builder"),s=e("../json/parser");t.exports={buildRequest:r,extractError:a,extractData:o}},{"../json/builder":13,"../json/parser":14,"../util":51}],23:[function(e,t){function r(e){var t=e.service.api.operations[e.operation],r=e.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:e.service.api.apiVersion,Action:t.name};var a=new s;a.serialize(e.params,t.input,function(e,t){r.params[e]=t}),r.body=i.queryParamsToString(r.params)}function a(e){var t,r=e.httpResponse.body.toString();t=r.match("=0?"&":"?";var i=[];u.arrayEach(Object.keys(o).sort(),function(e){Array.isArray(o[e])||(o[e]=[o[e]]);for(var t=0;t0){t=new i.XML.Parser;var m=t.parse(a.toString(),n);s.update(e.data,m)}}var i=e("../core"),s=e("../util"),u=e("./rest");t.exports={buildRequest:a,extractError:o,extractData:n}},{"../core":3,"../util":51,"./rest":24}],27:[function(e,t){function r(){}function a(e){return e.isQueryName||"ec2"!==e.api.protocol?e.name:e.name[0].toUpperCase()+e.name.substr(1)}function o(e,t,r,o){u.each(r.members,function(r,n){var i=t[r];if(null!==i&&void 0!==i){var u=a(n);u=e?e+"."+u:u,s(u,i,n,o)}})}function n(e,t,r,a){var o=1;u.each(t,function(t,n){var i=r.flattened?".":".entry.",u=i+o++ +".",c=u+(r.key.name||"key"),p=u+(r.value.name||"value");s(e+c,t,r.key,a),s(e+p,n,r.value,a)})}function i(e,t,r,o){var n=r.member||{};return 0===t.length?void o.call(this,e,null):void u.arrayEach(t,function(t,i){var u="."+(i+1);if("ec2"===r.api.protocol)u+="";else if(r.flattened){if(n.name){var c=e.split(".");c.pop(),c.push(a(n)),e=c.join(".")}}else u=".member"+u;s(e+u,t,n,o)})}function s(e,t,r,a){null!==t&&void 0!==t&&("structure"===r.type?o(e,t,r,a):"list"===r.type?i(e,t,r,a):"map"===r.type?n(e,t,r,a):a(e,r.toWireFormat(t).toString()))}var u=e("../util");r.prototype.serialize=function(e,t,r){o("",e,t,r)},t.exports=r},{"../util":51}],28:[function(e,t){function r(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}function a(e){var t=e.config.region,a=r(t),o=e.api.endpointPrefix;return[[t,o],[a,o],[t,"*"],[a,"*"],["*",o],["*","*"]].map(function(e){return e[0]&&e[1]?e.join("/"):null})}function o(e,t){i.each(t,function(t,r){"globalEndpoint"!==t&&(void 0===e.config[t]||null===e.config[t])&&(e.config[t]=r)})}function n(e){for(var t=a(e),r=0;re){r.removeListener("httpData",a.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",a.EventListeners.Core.HTTP_ERROR),r.on("httpError",function(e){n.error=e,n.error.retryable=!1});var i=n.httpResponse.createUnbufferedStream();2===a.HttpClient.streamsApiVersion?i.pipe(o):(i.on("data",function(e){o.emit("data",e)}),i.on("end",function(){o.emit("end")})),i.on("error",function(e){o.emit("error",e)})}}),this.on("error",function(e){o.emit("error",e)}),o},emitEvent:function(e,t,r){"function"==typeof t&&(r=t,t=null),r||(r=function(){}),t||(t=this.eventParameters(e,this.response));var o=a.SequentialExecutor.prototype.emit;o.call(this,e,t,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,t){return t||"function"!=typeof e||(t=e,e=null),(new a.Signers.Presign).sign(this.toGet(),e,t)},toUnauthenticated:function(){return this.removeListener("validate",a.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",a.EventListeners.Core.SIGN),this.toGet()},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}}),a.util.mixin(a.Request,a.SequentialExecutor)}).call(this,e("FWaASH"))},{"./core":3,"./state_machine":50,FWaASH:65}],31:[function(e){var t=e("./core"),r=t.util.inherit;t.ResourceWaiter=r({constructor:function(e,r){this.service=e,this.state=r,"object"==typeof this.state&&t.util.each.call(this,this.state,function(e,t){this.state=e,this.expectedValue=t}),this.loadWaiterConfig(this.state),this.expectedValue||(this.expectedValue=this.config.successValue)},service:null,state:null,expectedValue:null,config:null,waitDone:!1,Listeners:{retry:(new t.SequentialExecutor).addNamedListeners(function(e){e("RETRY_CHECK","retry",function(e){var t=e.request._waiter;e.error&&"ResourceNotReady"===e.error.code&&(e.error.retryDelay=1e3*t.config.interval)})}),output:(new t.SequentialExecutor).addNamedListeners(function(e){e("CHECK_OUT_ERROR","extractError",function(e){e.error&&e.request._waiter.setError(e,!0)}),e("CHECK_OUTPUT","extractData",function(e){var t=e.request._waiter,r=t.checkSuccess(e);r?e.error=null:t.setError(e,null===r?!1:!0)})}),error:(new t.SequentialExecutor).addNamedListeners(function(e){e("CHECK_ERROR","extractError",function(e){var t=e.request._waiter,r=t.checkError(e);r?(e.error=null,e.data={},e.request.removeAllListeners("extractData")):t.setError(e,null===r?!1:!0)}),e("CHECK_ERR_OUTPUT","extractData",function(e){e.request._waiter.setError(e,!0)})})},wait:function(e,t){"function"==typeof e&&(t=e,e=void 0);var r=this.service.makeRequest(this.config.operation,e),a=this.Listeners[this.config.successType];return r._waiter=this,r.response.maxRetries=this.config.maxAttempts,r.addListeners(this.Listeners.retry),a&&r.addListeners(a),t&&r.send(t),r},setError:function(e,r){e.data=null,e.error=t.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:r})},checkSuccess:function(e){if(!this.config.successPath)return e.httpResponse.statusCode<300;var r=t.util.jamespath.find(this.config.successPath,e.data);return this.config.failureValue&&this.config.failureValue.indexOf(r)>=0?null:this.expectedValue?r===this.expectedValue:r?!0:!1},checkError:function(e){var t=this.config.successValue;return"number"==typeof t?e.httpResponse.statusCode===t:e.error&&e.error.code===t},loadWaiterConfig:function(e,r){if(!this.service.api.waiters[e]){if(r)return;throw new t.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."})}this.config=this.service.api.waiters[e];var a=this.config;!function(){a.successType=a.successType||a.acceptorType,a.successPath=a.successPath||a.acceptorPath,a.successValue=a.successValue||a.acceptorValue,a.failureType=a.failureType||a.acceptorType,a.failurePath=a.failurePath||a.acceptorPath,a.failureValue=a.failureValue||a.acceptorValue}()}})},{"./core":3}],32:[function(e){var t=e("./core"),r=t.util.inherit;t.Response=r({constructor:function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new t.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function(e){var r,a=this.request.service,o=this.request.operation;try{r=a.paginationConfig(o,!0)}catch(n){this.error=n}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var i=t.util.copy(this.request.params);if(this.nextPageTokens){var s=r.inputToken;"string"==typeof s&&(s=[s]);for(var u=0;ue.partSize&&(e.partSize=r)}else e.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=this,t=o(e.body);if(0===t)return e.isDoneChunking=!0,e.numParts=1,void e.nextChunk(e.body);for(;e.activeParts=e.queueSize)){var t=e.body.read(e.partSize-e.partBufferLength)||e.body.read();if(t&&(e.partBuffers.push(t),e.partBufferLength+=t.length,e.totalChunkedBytes+=t.length),e.partBufferLength>=e.partSize){var a=r.concat(e.partBuffers);if(e.partBuffers=[],e.partBufferLength=0,a.length>e.partSize){var o=a.slice(e.partSize);e.partBuffers.push(o),e.partBufferLength+=o.length,a=a.slice(0,e.partSize)}e.nextChunk(a)}e.isDoneChunking&&!e.isDoneSending&&(a=r.concat(e.partBuffers),e.partBuffers=[],e.partBufferLength=0,e.totalBytes=e.totalChunkedBytes,e.isDoneSending=!0,(0===e.numParts||a.length>0)&&(e.numParts++,e.nextChunk(a))),e.body.read(0)}},nextChunk:function(e){var t=this;if(t.failed)return null;var r=++t.totalPartNumbers;if(t.isDoneChunking&&1===r){var a=t.service.putObject({Body:e});return a._managedUpload=t,a.on("httpUploadProgress",t.progress).send(t.finishSinglePart),null}t.activeParts++,t.service.config.params.UploadId?t.uploadPart(e,r):t.multipartReq?t.queueChunks(e,r):(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,r),t.multipartReq.on("error",function(e){t.cleanup(e)}),t.multipartReq.send())},uploadPart:function(e,t){var r=this,o={Body:e,ContentLength:a.util.string.byteLength(e),PartNumber:t},n={ETag:null,PartNumber:t};r.completeInfo.push(n);var i=r.service.uploadPart(o);r.parts[t]=i,i._lastUploadedBytes=0,i._managedUpload=r,i.on("httpUploadProgress",r.progress),i.send(function(e,t){if(delete r.parts[o.PartNumber],r.activeParts--,!(e||t&&t.ETag)){var i="No access to ETag property on response.";a.util.isBrowser()&&(i+=" Check CORS configuration to expose ETag header."),e=a.util.error(new Error(i),{code:"ETagMissing",retryable:!1})}return e?r.cleanup(e):(n.ETag=t.ETag,r.doneParts++,void(r.isDoneChunking&&r.doneParts===r.numParts?r.finishMultiPart():r.fillQueue.call(r)))})},queueChunks:function(e,t){var r=this;r.multipartReq.on("success",function(){r.uploadPart(e,t)})},cleanup:function(e){var t=this;t.failed||("function"==typeof t.body.removeAllListeners&&"function"==typeof t.body.resume&&(t.body.removeAllListeners("readable"),t.body.removeAllListeners("end"),t.body.resume()),t.service.config.params.UploadId&&!t.leavePartsOnError&&t.service.abortMultipartUpload().send(),a.util.each(t.parts,function(e,t){t.removeAllListeners("complete"),t.abort()}),t.parts={},t.callback(e),t.failed=!0)},finishMultiPart:function(){var e=this,t={MultipartUpload:{Parts:e.completeInfo}};e.service.completeMultipartUpload(t,function(t,r){return t?e.cleanup(t):void e.callback(t,r)})},finishSinglePart:function(e,t){var r=this.request._managedUpload,o=this.request.httpRequest,n=a.util.urlFormat(o.endpoint);return e?r.callback(e):(t.Location=n.substr(0,n.length-1)+o.path,void r.callback(e,t))},progress:function(e){var t=this._managedUpload;"putObject"===this.operation?e.part=1:(t.totalUploadedBytes+=e.loaded-this._lastUploadedBytes,this._lastUploadedBytes=e.loaded,e={loaded:t.totalUploadedBytes,total:t.totalBytes,part:this.params.PartNumber}),t.emit("httpUploadProgress",[e])}}),a.util.mixin(a.S3.ManagedUpload,a.SequentialExecutor),t.exports=a.S3.ManagedUpload}).call(this,e("buffer").Buffer)},{"../core":3,buffer:54}],34:[function(e,t){var r=e("./core");r.SequentialExecutor=r.util.inherit({constructor:function(){this._events={}},listeners:function(e){return this._events[e]?this._events[e].slice(0):[]},on:function(e,t){return this._events[e]?this._events[e].push(t):this._events[e]=[t],this},onAsync:function(e,t){return t._isAsync=!0,this.on(e,t)},removeListener:function(e,t){var r=this._events[e];if(r){for(var a=r.length,o=-1,n=0;a>n;++n)r[n]===t&&(o=n);o>-1&&r.splice(o,1)}return this},removeAllListeners:function(e){return e?delete this._events[e]:this._events={},this},emit:function(e,t,r){r||(r=function(){});var a=this.listeners(e),o=a.length;return this.callListeners(a,t,r),o>0},callListeners:function(e,t,a,o){function n(o){return o&&(s=r.util.error(s||new Error,o),i._haltHandlersOnError)?a.call(i,s):void i.callListeners(e,t,a,s)}for(var i=this,s=o||null;e.length>0;){var u=e.shift();if(u._isAsync)return void u.apply(i,t.concat([n]));try{u.apply(i,t)}catch(c){s=r.util.error(s||new Error,c)}if(s&&i._haltHandlersOnError)return void a.call(i,s)}a.call(i,s)},addListeners:function(e){var t=this;return e._events&&(e=e._events),r.util.each(e,function(e,a){"function"==typeof a&&(a=[a]),r.util.arrayEach(a,function(r){t.on(e,r)})}),t},addNamedListener:function(e,t,r){return this[e]=r,this.addListener(t,r),this},addNamedAsyncListener:function(e,t,r){return r._isAsync=!0,this.addNamedListener(e,t,r)},addNamedListeners:function(e){var t=this;return e(function(){t.addNamedListener.apply(t,arguments)},function(){t.addNamedAsyncListener.apply(t,arguments)}),this}}),r.SequentialExecutor.prototype.addListener=r.SequentialExecutor.prototype.on,t.exports=r.SequentialExecutor},{"./core":3}],35:[function(e){var t=e("./core"),r=e("./model/api"),a=e("./region_config"),o=t.util.inherit;t.Service=o({constructor:function(e){if(!this.loadServiceClass)throw t.util.error(new Error,"Service must be constructed with `new' operator");var r=this.loadServiceClass(e||{});return r?new r(e):void this.initialize(e)},initialize:function(e){var r=t.config[this.serviceIdentifier];this.config=new t.Config(t.config),r&&this.config.update(r,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||a(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint)},validateService:function(){},loadServiceClass:function(e){var r=e;if(t.util.isEmpty(this.api)){if(r.apiConfig)return t.Service.defineServiceApi(this.constructor,r.apiConfig);if(this.constructor.services){r=new t.Config(t.config),r.update(e,!0);var a=r.apiVersions[this.constructor.serviceIdentifier];return a=a||r.apiVersion,this.getLatestServiceClass(a)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&t.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?t.util.isType(e,Date)&&(e=t.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var r=Object.keys(this.constructor.services).sort(),a=null,o=r.length-1;o>=0;o--)if("*"!==r[o][r[o].length-1]&&(a=r[o]),r[o].substr(0,10)<=e)return a;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,makeRequest:function(e,r,a){if("function"==typeof r&&(a=r,r=null),r=r||{},this.config.params){var o=this.api.operations[e];o&&(r=t.util.copy(r),t.util.each(this.config.params,function(e,t){o.input.members[e]&&(void 0===r[e]||null===r[e])&&(r[e]=t)}))}var n=new t.Request(this,e,r);return this.addAllRequestListeners(n),a&&n.send(a),n},makeUnauthenticatedRequest:function(e,t,r){"function"==typeof t&&(r=t,t={});var a=this.makeRequest(e,t).toUnauthenticated();return r?a.send(r):a},waitFor:function(e,r,a){var o=new t.ResourceWaiter(this,e);return o.wait(r,a)},addAllRequestListeners:function(e){for(var r=[t.events,t.EventListeners.Core,this.serviceInterface(),t.EventListeners.CorePost],a=0;ar;++r)t[r]=30*Math.pow(2,r);return t},retryableError:function(e){return this.networkingError(e)?!0:this.expiredCredentialsError(e)?!0:this.throttledError(e)?!0:e.statusCode>=500?!0:!1},networkingError:function(e){return"NetworkingError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},throttledError:function(e){switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!=typeof e)return e;var t=e;return t=t.replace(/\{service\}/g,this.api.endpointPrefix),t=t.replace(/\{region\}/g,this.config.region),t=t.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new t.Endpoint(e,this.config)},paginationConfig:function(e,r){var a=this.api.operations[e].paginator;if(!a){if(r){var o=new Error;throw t.util.error(o,"No pagination configuration for "+e)}return null}return a}}),t.util.update(t.Service,{defineMethods:function(e){t.util.each(e.prototype.api.operations,function(t){e.prototype[t]||(e.prototype[t]=function(e,r){return this.makeRequest(t,e,r)})})},defineService:function(e,r,a){t.Service._serviceMap[e]=!0,Array.isArray(r)||(a=r,r=[]);var n=o(t.Service,a||{});if("string"==typeof e){t.Service.addVersions(n,r);var i=n.serviceIdentifier||e;n.serviceIdentifier=i}else n.prototype.api=e,t.Service.defineMethods(n);return n},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var r=0;rr;++r)t.push(0===r?0:50*Math.pow(2,r-1));return t}})},{"../core":3}],38:[function(e){var t=e("../core");t.util.update(t.EC2.prototype,{setupRequestListeners:function(e){e.removeListener("extractError",t.EventListeners.Query.EXTRACT_ERROR),e.addListener("extractError",this.extractError),"copySnapshot"===e.operation&&e.onAsync("validate",this.buildCopySnapshotPresignedUrl)},buildCopySnapshotPresignedUrl:function(e,r){if(e.params.PresignedUrl||e._subRequest)return r();e.params=t.util.copy(e.params),e.params.DestinationRegion=e.service.config.region;var a=t.util.copy(e.service.config);delete a.endpoint,a.region=e.params.SourceRegion;var o=new e.service.constructor(a),n=o[e.operation](e.params);n._subRequest=!0,n.presign(function(t,a){t?r(t):(e.params.PresignedUrl=a,r())})},extractError:function(e){var r=e.httpResponse,a=(new t.XML.Parser).parse(r.body.toString()||"");e.error=a.Errors?t.util.error(new Error,{code:a.Errors.Error.Code,message:a.Errors.Error.Message}):t.util.error(new Error,{code:r.statusCode,message:null})}})},{"../core":3}],39:[function(e){var t=e("../core");t.util.update(t.MachineLearning.prototype,{setupRequestListeners:function(e){"predict"===e.operation&&e.addListener("build",this.buildEndpoint)},buildEndpoint:function(e){var r=e.params.PredictEndpoint;r&&(e.httpRequest.endpoint=new t.Endpoint(r))}})},{"../core":3}],40:[function(e){var t=e("../core");e("../s3/managed_upload"),t.util.update(t.S3.prototype,{validateService:function(){if(this.config.region||(this.config.region="us-east-1"),!this.config.endpoint&&this.config.s3BucketEndpoint){var e="An endpoint must be provided when configuring `s3BucketEndpoint` to true.";throw t.util.error(new Error,{name:"InvalidEndpoint",message:e})}},setupRequestListeners:function(e){e.addListener("validate",this.validateScheme),e.addListener("validate",this.validateBucketEndpoint),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",t.EventListeners.Core.VALIDATE_REGION),e.addListener("extractError",this.extractError),e.addListener("extractData",this.extractData),e.addListener("extractData",t.util.hoistPayloadMember),e.addListener("beforePresign",this.prepareSignedUrl)},validateScheme:function(e){var r=e.params,a=e.httpRequest.endpoint.protocol,o=r.SSECustomerKey||r.CopySourceSSECustomerKey;if(o&&"https:"!==a){var n="Cannot send SSE keys over HTTP. Set 'sslEnabled'to 'true' in your configuration";throw t.util.error(new Error,{code:"ConfigError",message:n})}},validateBucketEndpoint:function(e){if(!e.params.Bucket&&e.service.config.s3BucketEndpoint){var r="Cannot send requests to root API with `s3BucketEndpoint` set.";throw t.util.error(new Error,{code:"ConfigError",message:r})}},populateURI:function(e){var t=e.httpRequest,r=e.params.Bucket;if(r&&!e.service.pathStyleBucketName(r)){if(!e.service.config.s3BucketEndpoint){t.endpoint.hostname=r+"."+t.endpoint.hostname;var a=t.endpoint.port;t.endpoint.host=80!==a&&443!==a?t.endpoint.hostname+":"+t.endpoint.port:t.endpoint.hostname}t.virtualHostedBucket=r,t.path=t.path.replace(new RegExp("/"+r),""),"/"!==t.path[0]&&(t.path="/"+t.path)}},addExpect100Continue:function(e){var r=e.httpRequest.headers["Content-Length"];t.util.isNode()&&r>=1048576&&(e.httpRequest.headers.Expect="100-continue")},addContentType:function(e){var r=e.httpRequest;if("GET"===r.method||"HEAD"===r.method)return void delete r.headers["Content-Type"];r.headers["Content-Type"]||(r.headers["Content-Type"]="application/octet-stream");var a=r.headers["Content-Type"];if(t.util.isBrowser())if("string"!=typeof r.body||a.match(/;\s*charset=/)){var o=function(e,t,r){return t+r.toUpperCase()};r.headers["Content-Type"]=a.replace(/(;\s*charset=)(.+)$/,o)}else{var n="; charset=UTF-8";r.headers["Content-Type"]+=n}},computableChecksumOperations:{putBucketCors:!0,putBucketLifecycle:!0,putBucketTagging:!0,deleteObjects:!0},willComputeChecksums:function(e){if(this.computableChecksumOperations[e.operation])return!0;if(!this.config.computeChecksums)return!1;if(!t.util.Buffer.isBuffer(e.httpRequest.body)&&"string"!=typeof e.httpRequest.body)return!1;var r=e.service.api.operations[e.operation].input.members;return e.service.getSignerClass(e)===t.Signers.V4&&r.ContentMD5&&!r.ContentMD5.required?!1:r.ContentMD5&&!e.params.ContentMD5?!0:void 0},computeContentMd5:function(e){if(e.service.willComputeChecksums(e)){var r=t.util.crypto.md5(e.httpRequest.body,"base64");e.httpRequest.headers["Content-MD5"]=r}},computeSseCustomerKeyMd5:function(e){var r={SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"};t.util.each(r,function(r,a){if(e.params[r]){var o=t.util.crypto.md5(e.params[r],"base64");e.httpRequest.headers[a]=o}})},pathStyleBucketName:function(e){return this.config.s3ForcePathStyle?!0:this.config.s3BucketEndpoint?!1:this.dnsCompatibleBucketName(e)?this.config.sslEnabled&&e.match(/\./)?!0:!1:!0},dnsCompatibleBucketName:function(e){var t=e,r=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/),a=new RegExp(/(\d+\.){3}\d+/),o=new RegExp(/\.\./);return!t.match(r)||t.match(a)||t.match(o)?!1:!0},successfulResponse:function(e){var t=e.request,r=e.httpResponse;return"completeMultipartUpload"===t.operation&&r.body.toString().match("")?!1:r.statusCode<300},retryableError:function(e,r){if("completeMultipartUpload"===r.operation&&200===e.statusCode)return!0;if(e&&"RequestTimeout"===e.code)return!0;var a=t.Service.prototype.retryableError;return a.call(this,e,r)},extractData:function(e){var t=e.request;if("getBucketLocation"===t.operation){var r=e.httpResponse.body.toString().match(/>(.+)<\/Location/);delete e.data._,e.data.LocationConstraint=r?r[1]:""}},extractError:function(e){var r={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"},a=e.httpResponse.statusCode,o=e.httpResponse.body||"";if(r[a]&&0===o.length)e.error=t.util.error(new Error,{code:r[e.httpResponse.statusCode],message:null});else{var n=(new t.XML.Parser).parse(o.toString());e.error=t.util.error(new Error,{code:n.Code||a,message:n.Message||null})}},getSignedUrl:function(e,r,a){r=t.util.copy(r||{});var o=r.Expires||900;delete r.Expires;var n=this.makeRequest(e,r);return n.presign(o,a)},prepareSignedUrl:function(e){e.addListener("validate",e.service.noPresignedContentLength),e.removeListener("build",e.service.addContentType),e.params.Body?e.addListener("afterBuild",t.EventListeners.Core.COMPUTE_SHA256):e.removeListener("build",e.service.computeContentMd5)},noPresignedContentLength:function(e){if(void 0!==e.params.ContentLength)throw t.util.error(new Error,{code:"UnexpectedParameter",message:"ContentLength is not supported in pre-signed URLs."})},createBucket:function(e,t){e||(e={});var r=this.endpoint.hostname;return r===this.api.globalEndpoint||e.CreateBucketConfiguration||(e.CreateBucketConfiguration={LocationConstraint:this.config.region}),this.makeRequest("createBucket",e,t)},upload:function(e,r,a){"function"==typeof r&&void 0===a&&(a=r,r=null),r=r||{},r=t.util.merge(r||{},{service:this,params:e});var o=new t.S3.ManagedUpload(r);return"function"==typeof a&&o.send(a),o}})},{"../core":3,"../s3/managed_upload":33}],41:[function(e){var t=e("../core");t.util.update(t.SQS.prototype,{setupRequestListeners:function(e){e.addListener("build",this.buildEndpoint),e.service.config.computeChecksums&&("sendMessage"===e.operation?e.addListener("extractData",this.verifySendMessageChecksum):"sendMessageBatch"===e.operation?e.addListener("extractData",this.verifySendMessageBatchChecksum):"receiveMessage"===e.operation&&e.addListener("extractData",this.verifyReceiveMessageChecksum))},verifySendMessageChecksum:function(e){if(e.data){var t=e.data.MD5OfMessageBody,r=this.params.MessageBody,a=this.service.calculateChecksum(r);if(a!==t){var o='Got "'+e.data.MD5OfMessageBody+'", expecting "'+a+'".';this.service.throwInvalidChecksumError(e,[e.data.MessageId],o)}}},verifySendMessageBatchChecksum:function(e){if(e.data){var r=this.service,a={},o=[],n=[];t.util.arrayEach(e.data.Successful,function(e){a[e.Id]=e}),t.util.arrayEach(this.params.Entries,function(e){if(a[e.Id]){var t=a[e.Id].MD5OfMessageBody,i=e.MessageBody;r.isChecksumValid(t,i)||(o.push(e.Id),n.push(a[e.Id].MessageId))}}),o.length>0&&r.throwInvalidChecksumError(e,n,"Invalid messages: "+o.join(", "))}},verifyReceiveMessageChecksum:function(e){if(e.data){var r=this.service,a=[];t.util.arrayEach(e.data.Messages,function(e){var t=e.MD5OfBody,o=e.Body;r.isChecksumValid(t,o)||a.push(e.MessageId)}),a.length>0&&r.throwInvalidChecksumError(e,a,"Invalid messages: "+a.join(", "))}},throwInvalidChecksumError:function(e,r,a){e.error=t.util.error(new Error,{retryable:!0,code:"InvalidChecksum",messageIds:r,message:e.request.operation+" returned an invalid MD5 response. "+a})},isChecksumValid:function(e,t){return this.calculateChecksum(t)===e},calculateChecksum:function(e){return t.util.crypto.md5(e,"hex")},buildEndpoint:function(e){var r=e.httpRequest.params.QueueUrl;if(r){e.httpRequest.endpoint=new t.Endpoint(r);var a=e.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);a&&(e.httpRequest.region=a[1])}}})},{"../core":3}],42:[function(e){var t=e("../core");t.util.update(t.STS.prototype,{credentialsFrom:function(e,r){return e?(r||(r=new t.TemporaryCredentials),r.expired=!1,r.accessKeyId=e.Credentials.AccessKeyId,r.secretAccessKey=e.Credentials.SecretAccessKey,r.sessionToken=e.Credentials.SessionToken,r.expireTime=e.Credentials.Expiration,r):null},assumeRoleWithWebIdentity:function(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,t)},assumeRoleWithSAML:function(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,t)}})},{"../core":3}],43:[function(e,t){function r(e){var t=e.httpRequest.headers[i];if(delete e.httpRequest.headers["User-Agent"],delete e.httpRequest.headers["X-Amz-User-Agent"],e.service.getSignerClass()===o.Signers.V4){if(t>604800){var r="Presigning does not support expiry time greater than a week with SigV4 signing.";throw o.util.error(new Error,{code:"InvalidExpiryTime",message:r,retryable:!1})}e.httpRequest.headers[i]=t}else{if(e.service.getSignerClass()!==o.Signers.S3)throw o.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});e.httpRequest.headers[i]=parseInt(o.util.date.unixTimestamp()+t,10).toString()}}function a(e){var t=e.httpRequest.endpoint,r=o.util.urlParse(e.httpRequest.path),a={};r.search&&(a=o.util.queryStringParse(r.search.substr(1))),o.util.each(e.httpRequest.headers,function(e,t){e===i&&(e="Expires"),a[e]=t}),delete e.httpRequest.headers[i];var n=a.Authorization.split(" ");if("AWS"===n[0])n=n[1].split(":"),a.AWSAccessKeyId=n[0],a.Signature=n[1];else if("AWS4-HMAC-SHA256"===n[0]){n.shift();var s=n.join(" "),u=s.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];a["X-Amz-Signature"]=u,delete a.Expires}delete a.Authorization,delete a.Host,t.pathname=r.pathname,t.search=o.util.queryParamsToString(a)}var o=e("../core"),n=o.util.inherit,i="presigned-expires";o.Signers.Presign=n({sign:function(e,t,n){if(e.httpRequest.headers[i]=t||3600,e.on("build",r),e.on("sign",a),e.removeListener("afterBuild",o.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",o.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!n){if(e.build(),e.response.error)throw e.response.error;return o.util.urlFormat(e.httpRequest.endpoint)}e.build(function(){this.response.error?n(this.response.error):n(null,o.util.urlFormat(e.httpRequest.endpoint))})}}),t.exports=o.Signers.Presign},{"../core":3}],44:[function(e){var t=e("../core"),r=t.util.inherit;t.Signers.RequestSigner=r({constructor:function(e){this.request=e}}),t.Signers.RequestSigner.getVersion=function(e){switch(e){case"v2":return t.Signers.V2;case"v3":return t.Signers.V3;case"v4":return t.Signers.V4;case"s3":return t.Signers.S3;case"v3https":return t.Signers.V3Https}throw new Error("Unknown signing version "+e)},e("./v2"),e("./v3"),e("./v3https"),e("./v4"),e("./s3"),e("./presign")},{"../core":3,"./presign":43,"./s3":45,"./v2":46,"./v3":47,"./v3https":48,"./v4":49}],45:[function(e,t){var r=e("../core"),a=r.util.inherit;r.Signers.S3=a(r.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function(e,t){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=r.util.date.rfc822(t)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var a=this.sign(e.secretAccessKey,this.stringToSign()),o="AWS "+e.accessKeyId+":"+a;this.request.headers.Authorization=o},stringToSign:function(){var e=this.request,t=[];t.push(e.method),t.push(e.headers["Content-MD5"]||""),t.push(e.headers["Content-Type"]||""),t.push(e.headers["presigned-expires"]||"");var r=this.canonicalizedAmzHeaders();return r&&t.push(r),t.push(this.canonicalizedResource()),t.join("\n")},canonicalizedAmzHeaders:function(){var e=[];r.util.each(this.request.headers,function(t){t.match(/^x-amz-/i)&&e.push(t)}),e.sort(function(e,t){return e.toLowerCase()=0?"&":"?";this.request.path+=i+r.util.queryParamsToString(o)},authorization:function(e,t){var r=[],a=this.credentialString(t);return r.push(this.algorithm+" Credential="+e.accessKeyId+"/"+a),r.push("SignedHeaders="+this.signedHeaders()),r.push("Signature="+this.signature(e,t)),r.join(", ")},signature:function(e,t){var a=o[this.serviceName],n=t.substr(0,8);if(!a||a.akid!==e.accessKeyId||a.region!==this.request.region||a.date!==n){var i=e.secretAccessKey,s=r.util.crypto.hmac("AWS4"+i,n,"buffer"),u=r.util.crypto.hmac(s,this.request.region,"buffer"),c=r.util.crypto.hmac(u,this.serviceName,"buffer"),p=r.util.crypto.hmac(c,"aws4_request","buffer");o[this.serviceName]={region:this.request.region,date:n,key:p,akid:e.accessKeyId}}var m=o[this.serviceName].key;return r.util.crypto.hmac(m,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,r){e.push([t,r])}),e.sort(function(e,t){return e[0].toLowerCase()=e.length)return t.push(null);var o=r+a;o>e.length&&(o=e.length),t.push(e.slice(r,o)),r=o},t},concat:function(e){var t,r=0,a=0,o=null;for(t=0;ta&&(a=e.length+a),r.push(e[a])}}),a=r),0===a.length?i.abort:void 0}),a.length>0?(r=a,i.abort):void 0}),r},find:function(e,t){return i.jamespath.query(e,t)[0]}},date:{getDate:function(){return a||(a=e("./core")),a.config.systemClockOffset?new Date((new Date).getTime()+a.config.systemClockOffset):new Date},iso8601:function(e){return void 0===e&&(e=i.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function(e){return void 0===e&&(e=i.date.getDate()),e.toUTCString()},unixTimestamp:function(e){return void 0===e&&(e=i.date.getDate()),e.getTime()/1e3},from:function(e){return new Date("number"==typeof e?1e3*e:e)},format:function(e,t){return t||(t="iso8601"),i.date[t](i.date.from(e))},parseTimestamp:function(e){if("number"==typeof e)return new Date(1e3*e);if(e.match(/^\d+$/))return new Date(1e3*e);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw i.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function(e){var t=i.crypto.crc32Table,r=-1; -"string"==typeof e&&(e=new n(e));for(var a=0;a>>8^t[255&(r^o)]}return(-1^r)>>>0},hmac:function(e,t,r,a){return r||(r="binary"),"buffer"===r&&(r=void 0),a||(a="sha256"),"string"==typeof t&&(t=new n(t)),o.createHmac(a,e).update(t).digest(r)},md5:function(e,t,r){return i.crypto.hash("md5",e,t,r)},sha256:function(e,t,r){return i.crypto.hash("sha256",e,t,r)},hash:function(e,t,r,a){var o=i.crypto.createHash(e);r||(r="binary"),"buffer"===r&&(r=void 0),"string"==typeof t&&(t=new n(t));var s=i.arraySliceFn(t),u=n.isBuffer(t);if(a&&"object"==typeof t&&"function"==typeof t.on&&!u)t.on("data",function(e){o.update(e)}),t.on("error",function(e){a(e)}),t.on("end",function(){a(null,o.digest(r))});else{if(!a||!s||u||"undefined"==typeof FileReader){i.isBrowser()&&"object"==typeof t&&!u&&(t=new n(new Uint8Array(t)));var c=o.update(t).digest(r);return a&&a(null,c),c}var p=0,m=524288,l=new FileReader;l.onerror=function(){a(new Error("Failed to read data."))},l.onload=function(){var e=new n(new Uint8Array(l.result));o.update(e),p+=e.length,l._continueReading()},l._continueReading=function(){if(p>=t.size)return void a(null,o.digest(r));var e=p+m;e>t.size&&(e=t.size),l.readAsArrayBuffer(s.call(t,p,e))},l._continueReading()}},toHex:function(e){for(var t=[],r=0;r0||o?n.root().toString():""},t.exports=r},{"../util":51,xmlbuilder:75}],54:[function(e,t,r){function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);var o=typeof e;if("base64"===t&&"string"===o)for(e=A(e);e.length%4!==0;)e+="=";var n;if("number"===o)n=q(e);else if("string"===o)n=a.byteLength(e,t);else{if("object"!==o)throw new Error("First argument needs to be a number, array or string.");n=q(e.length)}var i;a._useTypedArrays?i=a._augment(new Uint8Array(n)):(i=this,i.length=n,i._isBuffer=!0);var s;if(a._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(P(e))for(s=0;n>s;s++)i[s]=a.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===o)i.write(e,0,t);else if("number"===o&&!a._useTypedArrays&&!r)for(s=0;n>s;s++)i[s]=0;return i}function o(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o),o>n&&(o=n)):o=n;var i=t.length;G(i%2===0,"Invalid hex string"),o>i/2&&(o=i/2);for(var s=0;o>s;s++){var u=parseInt(t.substr(2*s,2),16);G(!isNaN(u),"Invalid hex string"),e[r+s]=u}return a._charsWritten=2*s,s}function n(e,t,r,o){var n=a._charsWritten=_(L(t),e,r,o);return n}function i(e,t,r,o){var n=a._charsWritten=_(M(t),e,r,o);return n}function s(e,t,r,a){return i(e,t,r,a)}function u(e,t,r,o){var n=a._charsWritten=_(U(t),e,r,o);return n}function c(e,t,r,o){var n=a._charsWritten=_(B(t),e,r,o);return n}function p(e,t,r){return K.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function m(e,t,r){var a="",o="";r=Math.min(e.length,r);for(var n=t;r>n;n++)e[n]<=127?(a+=V(o)+String.fromCharCode(e[n]),o=""):o+="%"+e[n].toString(16);return a+V(o)}function l(e,t,r){var a="";r=Math.min(e.length,r);for(var o=t;r>o;o++)a+=String.fromCharCode(e[o]);return a}function d(e,t,r){return l(e,t,r)}function y(e,t,r){var a=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>a)&&(r=a);for(var o="",n=t;r>n;n++)o+=w(e[n]);return o}function h(e,t,r){for(var a=e.slice(t,r),o="",n=0;n=o)){var n;return r?(n=e[t],o>t+1&&(n|=e[t+1]<<8)):(n=e[t]<<8,o>t+1&&(n|=e[t+1])),n}}function f(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+3=o)){var n;return r?(o>t+2&&(n=e[t+2]<<16),o>t+1&&(n|=e[t+1]<<8),n|=e[t],o>t+3&&(n+=e[t+3]<<24>>>0)):(o>t+1&&(n=e[t+1]<<16),o>t+2&&(n|=e[t+2]<<8),o>t+3&&(n|=e[t+3]),n+=e[t]<<24>>>0),n}}function g(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+1=o)){var n=b(e,t,r,!0),i=32768&n;return i?-1*(65535-n+1):n}}function N(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+3=o)){var n=f(e,t,r,!0),i=2147483648&n;return i?-1*(4294967295-n+1):n}}function S(e,t,r,a){return a||(G("boolean"==typeof r,"missing or invalid endian"),G(t+3=n))for(var i=0,s=Math.min(n-r,2);s>i;i++)e[r+i]=(t&255<<8*(a?i:1-i))>>>8*(a?i:1-i)}function k(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n))for(var i=0,s=Math.min(n-r,4);s>i;i++)e[r+i]=t>>>8*(a?i:3-i)&255}function R(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+1=n||(t>=0?v(e,t,r,a,o):v(e,65535+t+1,r,a,o))}function C(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n||(t>=0?k(e,t,r,a,o):k(e,4294967295+t+1,r,a,o))}function T(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n||j.write(e,t,r,a,23,4)}function D(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+7=n||j.write(e,t,r,a,52,8)}function A(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function E(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function q(e){return e=~~Math.ceil(+e),0>e?0:e}function x(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function P(e){return x(e)||a.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function w(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e){for(var t=[],r=0;r=a)t.push(e.charCodeAt(r));else{var o=r;a>=55296&&57343>=a&&r++;for(var n=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),i=0;i>8,a=t%256,o.push(a),o.push(r);return o}function U(e){return K.toByteArray(e)}function _(e,t,r,a){for(var o=0;a>o&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function V(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function F(e,t){G("number"==typeof e,"cannot write a non-number as a number"),G(e>=0,"specified a negative value for writing an unsigned value"),G(t>=e,"value is larger than maximum value for type"),G(Math.floor(e)===e,"value has a fractional component")}function z(e,t,r){G("number"==typeof e,"cannot write a non-number as a number"),G(t>=e,"value larger than maximum allowed value"),G(e>=r,"value smaller than minimum allowed value"),G(Math.floor(e)===e,"value has a fractional component")}function O(e,t,r){G("number"==typeof e,"cannot write a non-number as a number"),G(t>=e,"value larger than maximum allowed value"),G(e>=r,"value smaller than minimum allowed value")}function G(e,t){if(!e)throw new Error(t||"Failed assertion")}var K=e("base64-js"),j=e("ieee754");r.Buffer=a,r.SlowBuffer=a,r.INSPECT_MAX_BYTES=50,a.poolSize=8192,a._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(r){return!1}}(),a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},a.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=L(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=U(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},a.concat=function(e,t){if(G(x(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new a(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;rm&&(r=m)):r=m,a=String(a||"utf8").toLowerCase();var l;switch(a){case"hex":l=o(this,e,t,r);break;case"utf8":case"utf-8":l=n(this,e,t,r);break;case"ascii":l=i(this,e,t,r);break;case"binary":l=s(this,e,t,r);break;case"base64":l=u(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":l=c(this,e,t,r);break;default:throw new Error("Unknown encoding")}return l},a.prototype.toString=function(e,t,r){var a=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=a.length,r===t)return"";var o;switch(e){case"hex":o=y(a,t,r);break;case"utf8":case"utf-8":o=m(a,t,r);break;case"ascii":o=l(a,t,r);break;case"binary":o=d(a,t,r);break;case"base64":o=p(a,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":o=h(a,t,r);break;default:throw new Error("Unknown encoding")}return o},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.copy=function(e,t,r,o){var n=this;if(r||(r=0),o||0===o||(o=this.length),t||(t=0),o!==r&&0!==e.length&&0!==n.length){G(o>=r,"sourceEnd < sourceStart"),G(t>=0&&t=0&&r=0&&o<=n.length,"sourceEnd out of bounds"),o>this.length&&(o=this.length),e.length-ti||!a._useTypedArrays)for(var s=0;i>s;s++)e[s+t]=this[s+r];else e._set(this.subarray(r,r+i),t)}},a.prototype.slice=function(e,t){var r=this.length;if(e=E(e,r,0),t=E(t,r,r),a._useTypedArrays)return a._augment(this.subarray(e,t));for(var o=t-e,n=new a(o,void 0,!0),i=0;o>i;i++)n[i]=this[i+e];return n},a.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},a.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},a.prototype.readUInt8=function(e,t){return t||(G(void 0!==e&&null!==e,"missing offset"),G(e=this.length?void 0:this[e]},a.prototype.readUInt16LE=function(e,t){return b(this,e,!0,t)},a.prototype.readUInt16BE=function(e,t){return b(this,e,!1,t)},a.prototype.readUInt32LE=function(e,t){return f(this,e,!0,t)},a.prototype.readUInt32BE=function(e,t){return f(this,e,!1,t)},a.prototype.readInt8=function(e,t){if(t||(G(void 0!==e&&null!==e,"missing offset"),G(e=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},a.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},a.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},a.prototype.readInt32LE=function(e,t){return N(this,e,!0,t)},a.prototype.readInt32BE=function(e,t){return N(this,e,!1,t)},a.prototype.readFloatLE=function(e,t){return S(this,e,!0,t)},a.prototype.readFloatBE=function(e,t){return S(this,e,!1,t)},a.prototype.readDoubleLE=function(e,t){return I(this,e,!0,t)},a.prototype.readDoubleBE=function(e,t){return I(this,e,!1,t)},a.prototype.writeUInt8=function(e,t,r){r||(G(void 0!==e&&null!==e,"missing value"),G(void 0!==t&&null!==t,"missing offset"),G(t=this.length||(this[t]=e)},a.prototype.writeUInt16LE=function(e,t,r){v(this,e,t,!0,r)},a.prototype.writeUInt16BE=function(e,t,r){v(this,e,t,!1,r)},a.prototype.writeUInt32LE=function(e,t,r){k(this,e,t,!0,r)},a.prototype.writeUInt32BE=function(e,t,r){k(this,e,t,!1,r)},a.prototype.writeInt8=function(e,t,r){r||(G(void 0!==e&&null!==e,"missing value"),G(void 0!==t&&null!==t,"missing offset"),G(t=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},a.prototype.writeInt16LE=function(e,t,r){R(this,e,t,!0,r)},a.prototype.writeInt16BE=function(e,t,r){R(this,e,t,!1,r)},a.prototype.writeInt32LE=function(e,t,r){C(this,e,t,!0,r)},a.prototype.writeInt32BE=function(e,t,r){C(this,e,t,!1,r)},a.prototype.writeFloatLE=function(e,t,r){T(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){T(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){D(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){D(this,e,t,!1,r)},a.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),G("number"==typeof e&&!isNaN(e),"value is not a number"),G(r>=t,"end < start"),r!==t&&0!==this.length){G(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var a=t;r>a;a++)this[a]=e}},a.prototype.inspect=function(){for(var e=[],t=this.length,a=0;t>a;a++)if(e[a]=w(this[a]),a===r.INSPECT_MAX_BYTES){e[a+1]="...";break}return""},a.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(a._useTypedArrays)return new a(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var H=a.prototype;a._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=H.get,e.set=H.set,e.write=H.write,e.toString=H.toString,e.toLocaleString=H.toString,e.toJSON=H.toJSON,e.copy=H.copy,e.slice=H.slice,e.readUInt8=H.readUInt8,e.readUInt16LE=H.readUInt16LE,e.readUInt16BE=H.readUInt16BE,e.readUInt32LE=H.readUInt32LE,e.readUInt32BE=H.readUInt32BE,e.readInt8=H.readInt8,e.readInt16LE=H.readInt16LE,e.readInt16BE=H.readInt16BE,e.readInt32LE=H.readInt32LE,e.readInt32BE=H.readInt32BE,e.readFloatLE=H.readFloatLE,e.readFloatBE=H.readFloatBE,e.readDoubleLE=H.readDoubleLE,e.readDoubleBE=H.readDoubleBE,e.writeUInt8=H.writeUInt8,e.writeUInt16LE=H.writeUInt16LE,e.writeUInt16BE=H.writeUInt16BE,e.writeUInt32LE=H.writeUInt32LE,e.writeUInt32BE=H.writeUInt32BE,e.writeInt8=H.writeInt8,e.writeInt16LE=H.writeInt16LE,e.writeInt16BE=H.writeInt16BE,e.writeInt32LE=H.writeInt32LE,e.writeInt32BE=H.writeInt32BE,e.writeFloatLE=H.writeFloatLE,e.writeFloatBE=H.writeFloatBE,e.writeDoubleLE=H.writeDoubleLE,e.writeDoubleBE=H.writeDoubleBE,e.fill=H.fill,e.inspect=H.inspect,e.toArrayBuffer=H.toArrayBuffer,e}},{"base64-js":55,ieee754:56}],55:[function(e,t,r){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===i||t===m?62:t===s||t===l?63:u>t?-1:u+10>t?t-u+26+26:p+26>t?t-p:c+26>t?t-c+26:void 0}function r(e){function r(e){c[m++]=e}var a,o,i,s,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=e.length;u="="===e.charAt(p-2)?2:"="===e.charAt(p-1)?1:0,c=new n(3*e.length/4-u),i=u>0?e.length-4:e.length;var m=0;for(a=0,o=0;i>a;a+=4,o+=3)s=t(e.charAt(a))<<18|t(e.charAt(a+1))<<12|t(e.charAt(a+2))<<6|t(e.charAt(a+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=t(e.charAt(a))<<2|t(e.charAt(a+1))>>4,r(255&s)):1===u&&(s=t(e.charAt(a))<<10|t(e.charAt(a+1))<<4|t(e.charAt(a+2))>>2,r(s>>8&255),r(255&s)),c}function o(e){function t(e){return a.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var o,n,i,s=e.length%3,u="";for(o=0,i=e.length-s;i>o;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(n);switch(s){case 1:n=e[e.length-1],u+=t(n>>2),u+=t(n<<4&63),u+="==";break;case 2:n=(e[e.length-2]<<8)+e[e.length-1],u+=t(n>>10),u+=t(n>>4&63),u+=t(n<<2&63),u+="="}return u}var n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),p="A".charCodeAt(0),m="-".charCodeAt(0),l="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=o}("undefined"==typeof r?this.base64js={}:r)},{}],56:[function(e,t,r){r.read=function(e,t,r,a,o){var n,i,s=8*o-a-1,u=(1<>1,p=-7,m=r?o-1:0,l=r?-1:1,d=e[t+m];for(m+=l,n=d&(1<<-p)-1,d>>=-p,p+=s;p>0;n=256*n+e[t+m],m+=l,p-=8);for(i=n&(1<<-p)-1,n>>=-p,p+=a;p>0;i=256*i+e[t+m],m+=l,p-=8);if(0===n)n=1-c;else{if(n===u)return i?0/0:1/0*(d?-1:1);i+=Math.pow(2,a),n-=c}return(d?-1:1)*i*Math.pow(2,n-a)},r.write=function(e,t,r,a,o,n){var i,s,u,c=8*n-o-1,p=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:n-1,y=a?1:-1,h=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,i=p):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),t+=i+m>=1?l/u:l*Math.pow(2,1-m),t*u>=2&&(i++,u/=2),i+m>=p?(s=0,i=p):i+m>=1?(s=(t*u-1)*Math.pow(2,o),i+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;e[r+d]=255&s,d+=y,s/=256,o-=8);for(i=i<0;e[r+d]=255&i,d+=y,i/=256,c-=8);e[r+d-y]|=128*h}},{}],57:[function(e,t){function r(e,t){if(e.length%i!==0){var r=e.length+(i-e.length%i);e=n.concat([e,s],r)}for(var a=[],o=t?e.readInt32BE:e.readInt32LE,u=0;ud?t=e(t):t.lengthn;n++)a[n]=54^t[n],o[n]=92^t[n];var i=e(s.concat([a,r]));return e(s.concat([o,i]))}function o(e,t){e=e||"sha1";var r=l[e],o=[],i=0;return r||n("algorithm:",e,"is not yet supported"),{update:function(e){return s.isBuffer(e)||(e=new s(e)),o.push(e),i+=e.length,this},digest:function(e){var n=s.concat(o),i=t?a(r,t,n):r(n);return o=null,e?i.toString(e):i}}}function n(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function i(e,t){for(var r in e)t(e[r],r)}var s=e("buffer").Buffer,u=e("./sha"),c=e("./sha256"),p=e("./rng"),m=e("./md5"),l={sha1:u,sha256:c,md5:m},d=64,y=new s(d);y.fill(0),r.createHash=function(e){return o(e)},r.createHmac=function(e,t){return o(e,t)},r.randomBytes=function(e,t){if(!t||!t.call)return new s(p(e));try{t.call(this,void 0,new s(p(e)))}catch(r){t(r)}},i(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){r[e]=function(){n("sorry,",e,"is not implemented yet")}})},{"./md5":59,"./rng":60,"./sha":61,"./sha256":62,buffer:54}],59:[function(e,t){function r(e,t){e[t>>5]|=128<>>9<<4)+14]=t;for(var r=1732584193,a=-271733879,c=-1732584194,p=271733878,m=0;m>16)+(t>>16)+(r>>16);return a<<16|65535&r}function c(e,t){return e<>>32-t}var p=e("./helpers");t.exports=function(e){return p.hash(e,r,16)}},{"./helpers":57}],60:[function(e,t){!function(){var e,r,a=this;e=function(e){for(var t,t,r=new Array(e),a=0;e>a;a++)0==(3&a)&&(t=4294967296*Math.random()),r[a]=t>>>((3&a)<<3)&255;return r},a.crypto&&crypto.getRandomValues&&(r=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),t.exports=r||e}()},{}],61:[function(e,t){function r(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var r=Array(80),s=1732584193,u=-271733879,c=-1732584194,p=271733878,m=-1009589776,l=0;lg;g++){r[g]=16>g?e[l+g]:i(r[g-3]^r[g-8]^r[g-14]^r[g-16],1);var N=n(n(i(s,5),a(g,u,c,p)),n(n(m,r[g]),o(g)));m=p,p=c,c=i(u,30),u=s,s=N}s=n(s,d),u=n(u,y),c=n(c,h),p=n(p,b),m=n(m,f)}return Array(s,u,c,p,m)}function a(e,t,r,a){return 20>e?t&r|~t&a:40>e?t^r^a:60>e?t&r|t&a|r&a:t^r^a}function o(e){return 20>e?1518500249:40>e?1859775393:60>e?-1894007588:-899497514}function n(e,t){var r=(65535&e)+(65535&t),a=(e>>16)+(t>>16)+(r>>16);return a<<16|65535&r}function i(e,t){return e<>>32-t}var s=e("./helpers");t.exports=function(e){return s.hash(e,r,20,!0)}},{"./helpers":57}],62:[function(e,t){var r=e("./helpers"),a=function(e,t){var r=(65535&e)+(65535&t),a=(e>>16)+(t>>16)+(r>>16);return a<<16|65535&r},o=function(e,t){return e>>>t|e<<32-t},n=function(e,t){return e>>>t},i=function(e,t,r){return e&t^~e&r},s=function(e,t,r){return e&t^e&r^t&r},u=function(e){return o(e,2)^o(e,13)^o(e,22)},c=function(e){return o(e,6)^o(e,11)^o(e,25)},p=function(e){return o(e,7)^o(e,18)^n(e,3)},m=function(e){return o(e,17)^o(e,19)^n(e,10)},l=function(e,t){var r,o,n,l,d,y,h,b,f,g,N,S,I=new Array(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),v=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),k=new Array(64); -e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var f=0;fg;g++)k[g]=16>g?e[g+f]:a(a(a(m(k[g-2]),k[g-7]),p(k[g-15])),k[g-16]),N=a(a(a(a(b,c(d)),i(d,y,h)),I[g]),k[g]),S=a(u(r),s(r,o,n)),b=h,h=y,y=d,d=a(l,N),l=n,n=o,o=r,r=a(N,S);v[0]=a(r,v[0]),v[1]=a(o,v[1]),v[2]=a(n,v[2]),v[3]=a(l,v[3]),v[4]=a(d,v[4]),v[5]=a(y,v[5]),v[6]=a(h,v[6]),v[7]=a(b,v[7])}return v};t.exports=function(e){return r.hash(e,l,32,!0)}},{"./helpers":57}],63:[function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return"function"==typeof e}function o(e){return"number"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],i(r))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,s=new Array(o-1),u=1;o>u;u++)s[u-1]=arguments[u];r.apply(this,s)}else if(n(r)){for(o=arguments.length,s=new Array(o-1),u=1;o>u;u++)s[u-1]=arguments[u];for(c=r.slice(),o=c.length,u=0;o>u;u++)c[u].apply(this,s)}return!0},r.prototype.addListener=function(e,t){var o;if(!a(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,a(t.listener)?t.listener:t),this._events[e]?n(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,n(this._events[e])&&!this._events[e].warned){var o;o=i(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,o&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),o||(o=!0,t.apply(this,arguments))}if(!a(t))throw TypeError("listener must be a function");var o=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,o,i,s;if(!a(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,o=-1,r===t||a(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(r)){for(s=i;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(0>o)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],a(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?a(e._events[t])?1:e._events[t].length:0}},{}],64:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],65:[function(e,t){function r(){}var a=t.exports={};a.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var a=r.shift();a()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),a.title="browser",a.browser=!0,a.env={},a.argv=[],a.on=r,a.addListener=r,a.once=r,a.off=r,a.removeListener=r,a.removeAllListeners=r,a.emit=r,a.binding=function(){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(){throw new Error("process.chdir is not supported")}},{}],66:[function(e,t,r){(function(e){!function(a){function o(e){throw RangeError(w[e])}function n(e,t){for(var r=e.length;r--;)e[r]=t(e[r]);return e}function i(e,t){return n(e.split(P),t).join(".")}function s(e){for(var t,r,a=[],o=0,n=e.length;n>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&n>o?(r=e.charCodeAt(o++),56320==(64512&r)?a.push(((1023&t)<<10)+(1023&r)+65536):(a.push(t),o--)):a.push(t);return a}function u(e){return n(e,function(e){var t="";return e>65535&&(e-=65536,t+=B(e>>>10&1023|55296),e=56320|1023&e),t+=B(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:v}function p(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function m(e,t,r){var a=0;for(e=r?M(e/T):e>>1,e+=M(e/t);e>L*R>>1;a+=v)e=M(e/L);return M(a+(L+1)*e/(e+C))}function l(e){var t,r,a,n,i,s,p,l,d,y,h=[],b=e.length,f=0,g=A,N=D;for(r=e.lastIndexOf(E),0>r&&(r=0),a=0;r>a;++a)e.charCodeAt(a)>=128&&o("not-basic"),h.push(e.charCodeAt(a));for(n=r>0?r+1:0;b>n;){for(i=f,s=1,p=v;n>=b&&o("invalid-input"),l=c(e.charCodeAt(n++)),(l>=v||l>M((I-f)/s))&&o("overflow"),f+=l*s,d=N>=p?k:p>=N+R?R:p-N,!(d>l);p+=v)y=v-d,s>M(I/y)&&o("overflow"),s*=y;t=h.length+1,N=m(f-i,t,0==i),M(f/t)>I-g&&o("overflow"),g+=M(f/t),f%=t,h.splice(f++,0,g)}return u(h)}function d(e){var t,r,a,n,i,u,c,l,d,y,h,b,f,g,N,S=[];for(e=s(e),b=e.length,t=A,r=0,i=D,u=0;b>u;++u)h=e[u],128>h&&S.push(B(h));for(a=n=S.length,n&&S.push(E);b>a;){for(c=I,u=0;b>u;++u)h=e[u],h>=t&&c>h&&(c=h);for(f=a+1,c-t>M((I-r)/f)&&o("overflow"),r+=(c-t)*f,t=c,u=0;b>u;++u)if(h=e[u],t>h&&++r>I&&o("overflow"),h==t){for(l=r,d=v;y=i>=d?k:d>=i+R?R:d-i,!(y>l);d+=v)N=l-y,g=v-y,S.push(B(p(y+N%g,0))),l=M(N/g);S.push(B(p(l,0))),i=m(r,f,a==n),r=0,++a}++r,++t}return S.join("")}function y(e){return i(e,function(e){return q.test(e)?l(e.slice(4).toLowerCase()):e})}function h(e){return i(e,function(e){return x.test(e)?"xn--"+d(e):e})}var b="object"==typeof r&&r,f="object"==typeof t&&t&&t.exports==b&&t,g="object"==typeof e&&e;(g.global===g||g.window===g)&&(a=g);var N,S,I=2147483647,v=36,k=1,R=26,C=38,T=700,D=72,A=128,E="-",q=/^xn--/,x=/[^ -~]/,P=/\x2E|\u3002|\uFF0E|\uFF61/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=v-k,M=Math.floor,B=String.fromCharCode;if(N={version:"1.2.4",ucs2:{decode:s,encode:u},decode:l,encode:d,toASCII:h,toUnicode:y},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return N});else if(b&&!b.nodeType)if(f)f.exports=N;else for(S in N)N.hasOwnProperty(S)&&(b[S]=N[S]);else a.punycode=N}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],67:[function(e,t){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,o,n){t=t||"&",o=o||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(t);var u=1e3;n&&"number"==typeof n.maxKeys&&(u=n.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var p=0;c>p;++p){var m,l,d,y,h=e[p].replace(s,"%20"),b=h.indexOf(o);b>=0?(m=h.substr(0,b),l=h.substr(b+1)):(m=h,l=""),d=decodeURIComponent(m),y=decodeURIComponent(l),r(i,d)?a(i[d])?i[d].push(y):i[d]=[i[d],y]:i[d]=y}return i};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],68:[function(e,t){"use strict";function r(e,t){if(e.map)return e.map(t);for(var r=[],a=0;a",'"',"`"," ","\r","\n"," "],b=["{","}","|","\\","^","`"].concat(h),f=["'"].concat(b),g=["%","/","?",";","#"].concat(f),N=["/","?","#"],S=255,I=/^[a-z0-9A-Z_-]{0,63}$/,v=/^([a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=e("querystring");a.prototype.parse=function(e,t,r){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e;a=a.trim();var o=d.exec(a);if(o){o=o[0];var n=o.toLowerCase();this.protocol=n,a=a.substr(o.length)}if(r||o||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var i="//"===a.substr(0,2);!i||o&&R[o]||(a=a.substr(2),this.slashes=!0)}if(!R[o]&&(i||o&&!C[o])){for(var s=-1,c=0;cp)&&(s=p)}var m,y;y=-1===s?a.lastIndexOf("@"):a.lastIndexOf("@",s),-1!==y&&(m=a.slice(0,y),a=a.slice(y+1),this.auth=decodeURIComponent(m)),s=-1;for(var c=0;cp)&&(s=p)}-1===s&&(s=a.length),this.host=a.slice(0,s),a=a.slice(s),this.parseHost(),this.hostname=this.hostname||"";var h="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!h)for(var b=this.hostname.split(/\./),c=0,D=b.length;D>c;c++){var A=b[c];if(A&&!A.match(I)){for(var E="",q=0,x=A.length;x>q;q++)E+=A.charCodeAt(q)>127?"x":A[q];if(!E.match(I)){var P=b.slice(0,c),w=b.slice(c+1),L=A.match(v);L&&(P.push(L[1]),w.unshift(L[2])),w.length&&(a="/"+w.join(".")+a),this.hostname=P.join(".");break}}}if(this.hostname=this.hostname.length>S?"":this.hostname.toLowerCase(),!h){for(var M=this.hostname.split("."),B=[],c=0;cc;c++){var F=f[c],z=encodeURIComponent(F);z===F&&(z=escape(F)),a=a.split(F).join(z)}var O=a.indexOf("#");-1!==O&&(this.hash=a.substr(O),a=a.slice(0,O));var G=a.indexOf("?");if(-1!==G?(this.search=a.substr(G),this.query=a.substr(G+1),t&&(this.query=T.parse(this.query)),a=a.slice(0,G)):t&&(this.search="",this.query={}),a&&(this.pathname=a),C[n]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var _=this.pathname||"",U=this.search||"";this.path=_+U}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",a=this.hash||"",o=!1,n="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(n=T.stringify(this.query));var i=this.search||n&&"?"+n||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||C[t])&&o!==!1?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),a&&"#"!==a.charAt(0)&&(a="#"+a),i&&"?"!==i.charAt(0)&&(i="?"+i),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),i=i.replace("#","%23"),t+o+r+i+a},a.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(u(e)){var t=new a;t.parse(e,!1,!0),e=t}var r=new a;if(Object.keys(this).forEach(function(e){r[e]=this[e]},this),r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(r[t]=e[t])}),C[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(e.protocol&&e.protocol!==r.protocol){if(!C[e.protocol])return Object.keys(e).forEach(function(t){r[t]=e[t]}),r.href=r.format(),r;if(r.protocol=e.protocol,e.host||R[e.protocol])r.pathname=e.pathname;else{for(var o=(e.pathname||"").split("/");o.length&&!(e.host=o.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),r.pathname=o.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var n=r.pathname||"",i=r.search||"";r.path=n+i}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=c||s||r.host&&e.pathname,d=l,y=r.pathname&&r.pathname.split("/")||[],o=e.pathname&&e.pathname.split("/")||[],h=r.protocol&&!C[r.protocol];if(h&&(r.hostname="",r.port=null,r.host&&(""===y[0]?y[0]=r.host:y.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===o[0]?o[0]=e.host:o.unshift(e.host)),e.host=null),l=l&&(""===o[0]||""===y[0])),c)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,y=o;else if(o.length)y||(y=[]),y.pop(),y=y.concat(o),r.search=e.search,r.query=e.query;else if(!m(e.search)){if(h){r.hostname=r.host=y.shift();var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.host=r.hostname=b.shift())}return r.search=e.search,r.query=e.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var f=y.slice(-1)[0],g=(r.host||e.host)&&("."===f||".."===f)||""===f,N=0,S=y.length;S>=0;S--)f=y[S],"."==f?y.splice(S,1):".."===f?(y.splice(S,1),N++):N&&(y.splice(S,1),N--);if(!l&&!d)for(;N--;N)y.unshift("..");!l||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),g&&"/"!==y.join("/").substr(-1)&&y.push("");var I=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(h){r.hostname=r.host=I?"":y.length?y.shift():"";var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.host=r.hostname=b.shift())}return l=l||r.host&&y.length,l&&!I&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:66,querystring:69}],71:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],72:[function(e,t,r){(function(t,a){function o(e,t){var a={seen:[],stylize:i};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),h(t)?a.showHidden=t:t&&r._extend(a,t),I(a.showHidden)&&(a.showHidden=!1),I(a.depth)&&(a.depth=2),I(a.colors)&&(a.colors=!1),I(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=n),u(a,e,a.depth)}function n(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function i(e){return e}function s(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,t,a){if(e.customInspect&&t&&T(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(a,e);return N(o)||(o=u(e,o,a)),o}var n=c(e,t);if(n)return n;var i=Object.keys(t),h=s(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),C(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return p(t);if(0===i.length){if(T(t)){var b=t.name?": "+t.name:"";return e.stylize("[Function"+b+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(R(t))return e.stylize(Date.prototype.toString.call(t),"date");if(C(t))return p(t)}var f="",g=!1,S=["{","}"];if(y(t)&&(g=!0,S=["[","]"]),T(t)){var I=t.name?": "+t.name:"";f=" [Function"+I+"]"}if(v(t)&&(f=" "+RegExp.prototype.toString.call(t)),R(t)&&(f=" "+Date.prototype.toUTCString.call(t)),C(t)&&(f=" "+p(t)),0===i.length&&(!g||0==t.length))return S[0]+f+S[1];if(0>a)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=g?m(e,t,a,h,i):i.map(function(r){return l(e,t,a,h,r,g)}),e.seen.pop(),d(k,f,S)}function c(e,t){if(I(t))return e.stylize("undefined","undefined");if(N(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,r,a,o){for(var n=[],i=0,s=t.length;s>i;++i)n.push(x(t,String(i))?l(e,t,r,a,String(i),!0):"");return o.forEach(function(o){o.match(/^\d+$/)||n.push(l(e,t,r,a,o,!0))}),n}function l(e,t,r,a,o,n){var i,s,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),x(a,o)||(i="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=b(r)?u(e,c.value,null):u(e,c.value,r-1),s.indexOf("\n")>-1&&(s=n?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),I(i)){if(n&&o.match(/^\d+$/))return s;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+s}function d(e,t,r){var a=0,o=e.reduce(function(e,t){return a++,t.indexOf("\n")>=0&&a++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function b(e){return null===e}function f(e){return null==e}function g(e){return"number"==typeof e}function N(e){return"string"==typeof e}function S(e){return"symbol"==typeof e}function I(e){return void 0===e}function v(e){return k(e)&&"[object RegExp]"===A(e)}function k(e){return"object"==typeof e&&null!==e}function R(e){return k(e)&&"[object Date]"===A(e)}function C(e){return k(e)&&("[object Error]"===A(e)||e instanceof Error)}function T(e){return"function"==typeof e}function D(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function A(e){return Object.prototype.toString.call(e)}function E(e){return 10>e?"0"+e.toString(10):e.toString(10)}function q(){var e=new Date,t=[E(e.getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;r.format=function(e){if(!N(e)){for(var t=[],r=0;r=n)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(t){return"[Circular]"}default:return e}}),s=a[r];n>r;s=a[++r])i+=b(s)||!k(s)?" "+s:" "+o(s);return i},r.deprecate=function(e,o){function n(){if(!i){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),i=!0}return e.apply(this,arguments)}if(I(a.process))return function(){return r.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var i=!1;return n};var w,L={};r.debuglog=function(e){if(I(w)&&(w=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(w)){var a=t.pid;L[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,a,t)}}else L[e]=function(){};return L[e]},r.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=y,r.isBoolean=h,r.isNull=b,r.isNullOrUndefined=f,r.isNumber=g,r.isString=N,r.isSymbol=S,r.isUndefined=I,r.isRegExp=v,r.isObject=k,r.isDate=R,r.isError=C,r.isFunction=T,r.isPrimitive=D,r.isBuffer=e("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",q(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e}}).call(this,e("FWaASH"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":71,FWaASH:65,inherits:64}],73:[function(e,t){(function(){var r,a;a=e("./XMLFragment"),r=function(){function e(e,t,r){var o,n,i;if(this.children=[],this.rootObject=null,this.is(e,"Object")&&(i=[e,t],t=i[0],r=i[1],e=null),null!=e&&(e=""+e||"",null==t&&(t={version:"1.0"})),null!=t&&null==t.version)throw new Error("Version number is required");if(null!=t){if(t.version=""+t.version||"",!t.version.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t.version);if(o={version:t.version},null!=t.encoding){if(t.encoding=""+t.encoding||"",!t.encoding.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/))throw new Error("Invalid encoding: "+t.encoding);o.encoding=t.encoding}null!=t.standalone&&(o.standalone=t.standalone?"yes":"no"),n=new a(this,"?xml",o),this.children.push(n)}null!=r&&(o={},null!=e&&(o.name=e),null!=r.ext&&(r.ext=""+r.ext||"",o.ext=r.ext),n=new a(this,"!DOCTYPE",o),this.children.push(n)),null!=e&&this.begin(e)}return e.prototype.begin=function(t,r,o){var n,i;if(null==t)throw new Error("Root element needs a name");return this.rootObject&&(this.children=[],this.rootObject=null),null!=r?(n=new e(t,r,o),n.root()):(t=""+t||"",i=new a(this,t,{}),i.isRoot=!0,i.documentObject=this,this.children.push(i),this.rootObject=i,i)},e.prototype.root=function(){return this.rootObject},e.prototype.end=function(e){return toString(e)},e.prototype.toString=function(e){var t,r,a,o,n;for(r="",n=this.children,a=0,o=n.length;o>a;a++)t=n[a],r+=t.toString(e);return r},e.prototype.is=function(e,t){var r;return r=Object.prototype.toString.call(e).slice(8,-1),null!=e&&r===t},e}(),t.exports=r}).call(this)},{"./XMLFragment":74}],74:[function(e,t){(function(){var e,r={}.hasOwnProperty;e=function(){function e(e,t,r,a){this.isRoot=!1,this.documentObject=null,this.parent=e,this.name=t,this.attributes=r,this.value=a,this.children=[]}return e.prototype.element=function(t,a,o){var n,i,s,u,c;if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(u=[o,a],a=u[0],o=u[1]):this.is(a,"String")&&(c=[{},a],a=c[0],o=c[1]);for(i in a)r.call(a,i)&&(s=a[i],s=""+s||"",a[i]=this.escape(s));return n=new e(this,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),this.children.push(n),n},e.prototype.insertBefore=function(t,a,o){var n,i,s,u,c,p;if(this.isRoot)throw new Error("Cannot insert elements at root level");if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(c=[o,a],a=c[0],o=c[1]):this.is(a,"String")&&(p=[{},a],a=p[0],o=p[1]);for(s in a)r.call(a,s)&&(u=a[s],u=""+u||"",a[s]=this.escape(u));return n=new e(this.parent,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),i=this.parent.children.indexOf(this),this.parent.children.splice(i,0,n),n},e.prototype.insertAfter=function(t,a,o){var n,i,s,u,c,p;if(this.isRoot)throw new Error("Cannot insert elements at root level");if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(c=[o,a],a=c[0],o=c[1]):this.is(a,"String")&&(p=[{},a],a=p[0],o=p[1]);for(s in a)r.call(a,s)&&(u=a[s],u=""+u||"",a[s]=this.escape(u));return n=new e(this.parent,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),i=this.parent.children.indexOf(this),this.parent.children.splice(i+1,0,n),n},e.prototype.remove=function(){var e,t;if(this.isRoot)throw new Error("Cannot remove the root element");return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat(t=[])),t,this.parent},e.prototype.text=function(t){var r;if(null==t)throw new Error("Missing element text");return t=""+t||"",t=this.escape(t),this.assertLegalChar(t),r=new e(this,"",{},t),this.children.push(r),this},e.prototype.cdata=function(t){var r;if(null==t)throw new Error("Missing CDATA text");if(t=""+t||"",this.assertLegalChar(t),t.match(/]]>/))throw new Error("Invalid CDATA text: "+t);return r=new e(this,"",{},""),this.children.push(r),this},e.prototype.comment=function(t){var r;if(null==t)throw new Error("Missing comment text");if(t=""+t||"",t=this.escape(t),this.assertLegalChar(t),t.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return r=new e(this,"",{},""),this.children.push(r),this},e.prototype.raw=function(t){var r;if(null==t)throw new Error("Missing raw text");return t=""+t||"",r=new e(this,"",{},t),this.children.push(r),this},e.prototype.up=function(){if(this.isRoot)throw new Error("This node has no parent. Use doc() if you need to get the document object.");return this.parent},e.prototype.root=function(){var e;if(this.isRoot)return this;for(e=this.parent;!e.isRoot;)e=e.parent;return e},e.prototype.document=function(){return this.root().documentObject},e.prototype.end=function(e){return this.document().toString(e)},e.prototype.prev=function(){var e;if(this.isRoot)throw new Error("Root node has no siblings");if(e=this.parent.children.indexOf(this),1>e)throw new Error("Already at the first node");return this.parent.children[e-1]},e.prototype.next=function(){var e;if(this.isRoot)throw new Error("Root node has no siblings");if(e=this.parent.children.indexOf(this),-1===e||e===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[e+1]},e.prototype.clone=function(t){var r;return r=new e(this.parent,this.name,this.attributes,this.value),t&&this.children.forEach(function(e){var a;return a=e.clone(t),a.parent=r,r.children.push(a)}),r},e.prototype.importXMLBuilder=function(e){var t;return t=e.root().clone(!0),t.parent=this,this.children.push(t),t.isRoot=!1,this},e.prototype.attribute=function(e,t){var r;if(null==e)throw new Error("Missing attribute name");if(null==t)throw new Error("Missing attribute value");return e=""+e||"",t=""+t||"",null==(r=this.attributes)&&(this.attributes={}),this.attributes[e]=this.escape(t),this},e.prototype.removeAttribute=function(e){if(null==e)throw new Error("Missing attribute name");return e=""+e||"",delete this.attributes[e],this},e.prototype.toString=function(e,t){var r,a,o,n,i,s,u,c,p,m,l,d;s=null!=e&&e.pretty||!1,n=null!=e&&e.indent||" ",i=null!=e&&e.newline||"\n",t||(t=0),c=new Array(t+1).join(n),u="",s&&(u+=c),u+=null==this.value?"<"+this.name:""+this.value,l=this.attributes;for(r in l)a=l[r],u+="!DOCTYPE"===this.name?" "+a:" "+r+'="'+a+'"';if(0===this.children.length)null==this.value&&(u+="?xml"===this.name?"?>":"!DOCTYPE"===this.name?">":"/>"),s&&(u+=i);else if(s&&1===this.children.length&&this.children[0].value)u+=">",u+=this.children[0].value,u+="",u+=i;else{for(u+=">",s&&(u+=i),d=this.children,p=0,m=d.length;m>p;p++)o=d[p],u+=o.toString(e,t+1);s&&(u+=c),u+="",s&&(u+=i)}return u},e.prototype.escape=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},e.prototype.assertLegalChar=function(e){var t,r;if(t=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/,r=e.match(t))throw new Error("Invalid character ("+r+") in string: "+e)},e.prototype.is=function(e,t){var r;return r=Object.prototype.toString.call(e).slice(8,-1),null!=e&&r===t},e.prototype.ele=function(e,t,r){return this.element(e,t,r)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.att=function(e,t){return this.attribute(e,t)},e.prototype.com=function(e){return this.comment(e)},e.prototype.doc=function(){return this.document()},e.prototype.e=function(e,t,r){return this.element(e,t,r)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.a=function(e,t){return this.attribute(e,t)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.u=function(){return this.up()},e}(),t.exports=e}).call(this)},{}],75:[function(e,t){(function(){var r;r=e("./XMLBuilder"),t.exports.create=function(e,t,a){return null!=e?new r(e,t,a).root():new r}}).call(this)},{"./XMLBuilder":73}]},{},[1]); +!function e(t,r,a){function o(i,s){if(!r[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(n)return n(i,!0);throw new Error("Cannot find module '"+i+"'")}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){var r=t[i][1][e];return o(r?r:e)},c,c.exports,e,t,r,a)}return r[i].exports}for(var n="function"==typeof require&&require,i=0;ithis.expireTime?!0:this.expired||!this.accessKeyId||!this.secretAccessKey},get:function(e){var t=this;this.needsRefresh()?this.refresh(function(r){r||(t.expired=!1),e&&e(r)}):e&&e()},refresh:function(e){this.expired=!1,e()}})},{"./core":3}],5:[function(e,t,r){var a=e("../core");a.CognitoIdentityCredentials=a.util.inherit(a.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(e){a.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this.identityId=null,this.loadCachedId()},refresh:function(e){var t=this;t.createClients(),t.data=null,t.identityId=null,t.getId(function(r){r?(t.clearCachedId(),e(r)):t.params.RoleArn?t.getCredentialsFromSTS(e):t.getCredentialsForIdentity(e)})},clearCachedId:function(){this.identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId;delete this.storage[this.localStorageKey.id+e],delete this.storage[this.localStorageKey.providers+e]},getId:function(e){var t=this;return"string"==typeof t.params.IdentityId?e(null,t.params.IdentityId):void t.cognito.getId(function(r,a){!r&&a.IdentityId?(t.params.IdentityId=a.IdentityId,e(null,a.IdentityId)):e(r)})},loadCredentials:function(e,t){e&&t&&(t.expired=!1,t.accessKeyId=e.Credentials.AccessKeyId,t.secretAccessKey=e.Credentials.SecretKey,t.sessionToken=e.Credentials.SessionToken,t.expireTime=e.Credentials.Expiration)},getCredentialsForIdentity:function(e){var t=this;t.cognito.getCredentialsForIdentity(function(r,a){r?t.clearCachedId():(t.cacheId(a),t.data=a,t.loadCredentials(t.data,t)),e(r)})},getCredentialsFromSTS:function(e){var t=this;t.cognito.getOpenIdToken(function(r,a){r?(t.clearCachedId(),e(r)):(t.cacheId(a),t.params.WebIdentityToken=a.Token,t.webIdentityCredentials.refresh(function(r){r?t.clearCachedId():(t.data=t.webIdentityCredentials.data,t.sts.credentialsFrom(t.data,t)),e(r)}))})},loadCachedId:function(){var e=this;if(a.util.isBrowser()&&!e.params.IdentityId){var t=e.getStorage("id");if(t&&e.params.Logins){var r=Object.keys(e.params.Logins),o=(e.getStorage("providers")||"").split(","),n=o.filter(function(e){return-1!==r.indexOf(e)});0!==n.length&&(e.params.IdentityId=t)}else t&&(e.params.IdentityId=t)}},createClients:function(){this.webIdentityCredentials=this.webIdentityCredentials||new a.WebIdentityCredentials(this.params),this.cognito=this.cognito||new a.CognitoIdentity({params:this.params}),this.sts=this.sts||new a.STS},cacheId:function(e){this.identityId=e.IdentityId,this.params.IdentityId=this.identityId,a.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId]},setStorage:function(e,t){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId]=t}catch(r){}},storage:function(){try{return a.util.isBrowser()&&"object"==typeof window.localStorage?window.localStorage:{}}catch(e){return{}}}()})},{"../core":3}],6:[function(e,t,r){var a=e("../core");a.CredentialProviderChain=a.util.inherit(a.Credentials,{constructor:function(e){e?this.providers=e:this.providers=a.CredentialProviderChain.defaultProviders.slice(0)},resolve:function(e){function t(o,n){if(!o&&n||r===a.length)return void e(o,n);var i=a[r++];n="function"==typeof i?i.call():i,n.get?n.get(function(e){t(e,e?null:n)}):t(null,n)}if(0===this.providers.length)return e(new Error("No providers")),this;var r=0,a=this.providers.slice(0);return t(),this}}),a.CredentialProviderChain.defaultProviders=[]},{"../core":3}],7:[function(e,t,r){var a=e("../core");a.SAMLCredentials=a.util.inherit(a.Credentials,{constructor:function(e){a.Credentials.call(this),this.expired=!0,this.params=e},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.assumeRoleWithSAML(function(r,a){r||t.service.credentialsFrom(a,t),e(r)})},createClients:function(){this.service=this.service||new a.STS({params:this.params})}})},{"../core":3}],8:[function(e,t,r){var a=e("../core");a.TemporaryCredentials=a.util.inherit(a.Credentials,{constructor:function(e){a.Credentials.call(this),this.loadMasterCredentials(),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.config.credentials=t.masterCredentials;var r=t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken;r.call(t.service,function(r,a){r||t.service.credentialsFrom(a,t),e(r)})},loadMasterCredentials:function(){for(this.masterCredentials=a.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials},createClients:function(){this.service=this.service||new a.STS({params:this.params})}})},{"../core":3}],9:[function(e,t,r){var a=e("../core");a.WebIdentityCredentials=a.util.inherit(a.Credentials,{constructor:function(e){a.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null},refresh:function(e){var t=this;t.createClients(),e||(e=function(e){if(e)throw e}),t.service.assumeRoleWithWebIdentity(function(r,a){t.data=null,r||(t.data=a,t.service.credentialsFrom(a,t)),e(r)})},createClients:function(){this.service=this.service||new a.STS({params:this.params})}})},{"../core":3}],10:[function(e,t,r){var a=e("./core"),o=e("./sequential_executor");a.EventListeners={Core:{}},a.EventListeners={Core:(new o).addNamedListeners(function(e,t){t("VALIDATE_CREDENTIALS","validate",function(e,t){return e.service.api.signatureVersion?void e.service.config.getCredentials(function(r){r&&(e.response.error=a.util.error(r,{code:"CredentialsError",message:"Missing credentials in config"})),t()}):t()}),e("VALIDATE_REGION","validate",function(e){e.service.config.region||e.service.isGlobalEndpoint||(e.response.error=a.util.error(new Error,{code:"ConfigError",message:"Missing region in config"}))}),e("VALIDATE_PARAMETERS","validate",function(e){var t=e.service.api.operations[e.operation].input;(new a.ParamValidator).validate(t,e.params)}),t("COMPUTE_SHA256","afterBuild",function(e,t){if(e.haltHandlersOnError(),!e.service.api.signatureVersion)return t();if(e.service.getSignerClass(e)===a.Signers.V4){var r=e.httpRequest.body||"";a.util.computeSha256(r,function(r,a){r?t(r):(e.httpRequest.headers["X-Amz-Content-Sha256"]=a,t())})}else t()}),e("SET_CONTENT_LENGTH","afterBuild",function(e){if(void 0===e.httpRequest.headers["Content-Length"]){var t=a.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=t}}),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 a.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],function(e){e?t(e):i()}):i()}),e("HTTP_HEADERS","httpHeaders",function(e,t,r){r.httpResponse.statusCode=e,r.httpResponse.headers=t,r.httpResponse.body=new a.util.Buffer(""),r.httpResponse.buffers=[],r.httpResponse.numBytes=0}),e("HTTP_DATA","httpData",function(e,t){if(e){if(a.util.isNode()){t.httpResponse.numBytes+=e.length;var r=t.httpResponse.headers["content-length"],o={loaded:t.httpResponse.numBytes,total:r};t.request.emit("httpDownloadProgress",[o,t])}t.httpResponse.buffers.push(new a.util.Buffer(e))}}),e("HTTP_DONE","httpDone",function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=a.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("REDIRECT","retry",function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new a.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){if(e.error)if(e.error.redirect&&e.redirectCount=this.HEADERS_RECEIVED&&!m){try{p.responseType="arraybuffer"}catch(e){}u.statusCode=p.status,u.headers=i.parseHeaders(p.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers),m=!0}this.readyState===this.DONE&&i.finishRequest(p,u)},!1),p.upload.addEventListener("progress",function(e){u.emit("sendProgress",e)}),p.addEventListener("progress",function(e){u.emit("receiveProgress",e)},!1),p.addEventListener("timeout",function(){n(a.util.error(new Error("Timeout"),{code:"TimeoutError"}))},!1),p.addEventListener("error",function(){n(a.util.error(new Error("Network Failure"),{code:"NetworkingError"}))},!1),r(u),p.open(e.method,c,t.xhrAsync!==!1),a.util.each(e.headers,function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&p.setRequestHeader(e,t)}),t.timeout&&t.xhrAsync!==!1&&(p.timeout=t.timeout),t.xhrWithCredentials&&(p.withCredentials=!0);try{p.send(e.body)}catch(l){if(!e.body||"object"!=typeof e.body.buffer)throw l;p.send(e.body.buffer)}return u},parseHeaders:function(e){var t={};return a.util.arrayEach(e.split(/\r?\n/),function(e){var r=e.split(":",1)[0],a=e.substring(r.length+2);r.length>0&&(t[r.toLowerCase()]=a)}),t},finishRequest:function(e,t){var r;if("arraybuffer"===e.responseType&&e.response){var o=e.response;r=new a.util.Buffer(o.byteLength);for(var n=new Uint8Array(o),i=0;i1)){if(1===this.errors.length)throw this.errors[0];return!0}var o=this.errors.join("\n* ");if(this.errors.length>1)throw o="There were "+this.errors.length+" validation errors:\n* "+o,a.util.error(new Error(o),{code:"MultipleValidationErrors",errors:this.errors})},validateStructure:function(e,t,r){this.validateType(r,t,["object"],"structure");for(var a,o=0;e.required&&o0){var a=JSON.parse(r.body.toString());(a.__type||a.code)&&(t.code=(a.__type||a.code).split("#").pop()),"RequestEntityTooLarge"===t.code?t.message="Request body must be less than 1 MB":t.message=a.message||a.Message||null}else t.statusCode=r.statusCode,t.message=r.statusCode.toString();e.error=i.error(new Error,t)}function n(e){var t=e.httpResponse.body.toString()||"{}";if(e.request.service.config.convertResponseTypes===!1)e.data=JSON.parse(t);else{var r=e.request.service.api.operations[e.request.operation],a=r.output||{},o=new u;e.data=o.parse(t,a)}}var i=e("../util"),s=e("../json/builder"),u=e("../json/parser");t.exports={buildRequest:a,extractError:o,extractData:n}},{"../json/builder":13,"../json/parser":14,"../util":51}],23:[function(e,t,r){function a(e){var t=e.service.api.operations[e.operation],r=e.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:e.service.api.apiVersion,Action:t.name};var a=new u;a.serialize(e.params,t.input,function(e,t){r.params[e]=t}),r.body=s.queryParamsToString(r.params)}function o(e){var t,r=e.httpResponse.body.toString();t=r.match("=0?"&":"?";var i=[];c.arrayEach(Object.keys(o).sort(),function(e){Array.isArray(o[e])||(o[e]=[o[e]]);for(var t=0;t0){t=new s.XML.Parser;var m=t.parse(a.toString(),n);u.update(e.data,m)}}var s=e("../core"),u=e("../util"),c=e("./rest");t.exports={buildRequest:o,extractError:n,extractData:i}},{"../core":3,"../util":51,"./rest":24}],27:[function(e,t,r){function a(){}function o(e){return e.isQueryName||"ec2"!==e.api.protocol?e.name:e.name[0].toUpperCase()+e.name.substr(1)}function n(e,t,r,a){c.each(r.members,function(r,n){var i=t[r];if(null!==i&&void 0!==i){var s=o(n);s=e?e+"."+s:s,u(s,i,n,a)}})}function i(e,t,r,a){var o=1;c.each(t,function(t,n){var i=r.flattened?".":".entry.",s=i+o++ +".",c=s+(r.key.name||"key"),p=s+(r.value.name||"value");u(e+c,t,r.key,a),u(e+p,n,r.value,a)})}function s(e,t,r,a){var n=r.member||{};return 0===t.length?void a.call(this,e,null):void c.arrayEach(t,function(t,i){var s="."+(i+1);if("ec2"===r.api.protocol)s+="";else if(r.flattened){if(n.name){var c=e.split(".");c.pop(),c.push(o(n)),e=c.join(".")}}else s=".member"+s;u(e+s,t,n,a)})}function u(e,t,r,a){null!==t&&void 0!==t&&("structure"===r.type?n(e,t,r,a):"list"===r.type?s(e,t,r,a):"map"===r.type?i(e,t,r,a):a(e,r.toWireFormat(t).toString()))}var c=e("../util");a.prototype.serialize=function(e,t,r){n("",e,t,r)},t.exports=a},{"../util":51}],28:[function(e,t,r){function a(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}function o(e){var t=e.config.region,r=a(t),o=e.api.endpointPrefix;return[[t,o],[r,o],[t,"*"],[r,"*"],["*",o],["*","*"]].map(function(e){return e[0]&&e[1]?e.join("/"):null})}function n(e,t){s.each(t,function(t,r){"globalEndpoint"!==t&&(void 0===e.config[t]||null===e.config[t])&&(e.config[t]=r)})}function i(e){for(var t=o(e),r=0;re){r.removeListener("httpData",a.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",a.EventListeners.Core.HTTP_ERROR),r.on("httpError",function(e){n.error=e,n.error.retryable=!1});var i=n.httpResponse.createUnbufferedStream();2===a.HttpClient.streamsApiVersion?i.pipe(o):(i.on("data",function(e){o.emit("data",e)}),i.on("end",function(){o.emit("end")})),i.on("error",function(e){o.emit("error",e)})}}),this.on("error",function(e){o.emit("error",e)}),o},emitEvent:function(e,t,r){"function"==typeof t&&(r=t,t=null),r||(r=function(){}),t||(t=this.eventParameters(e,this.response));var o=a.SequentialExecutor.prototype.emit;o.call(this,e,t,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,t){return t||"function"!=typeof e||(t=e,e=null),(new a.Signers.Presign).sign(this.toGet(),e,t)},toUnauthenticated:function(){return this.removeListener("validate",a.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",a.EventListeners.Core.SIGN),this.toGet()},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}}),a.util.mixin(a.Request,a.SequentialExecutor)}).call(this,e("FWaASH"))},{"./core":3,"./state_machine":50,FWaASH:65}],31:[function(e,t,r){var a=e("./core"),o=a.util.inherit;a.ResourceWaiter=o({constructor:function(e,t){this.service=e,this.state=t,"object"==typeof this.state&&a.util.each.call(this,this.state,function(e,t){this.state=e,this.expectedValue=t}),this.loadWaiterConfig(this.state),this.expectedValue||(this.expectedValue=this.config.successValue)},service:null,state:null,expectedValue:null,config:null,waitDone:!1,Listeners:{retry:(new a.SequentialExecutor).addNamedListeners(function(e){e("RETRY_CHECK","retry",function(e){var t=e.request._waiter;e.error&&"ResourceNotReady"===e.error.code&&(e.error.retryDelay=1e3*t.config.interval)})}),output:(new a.SequentialExecutor).addNamedListeners(function(e){e("CHECK_OUT_ERROR","extractError",function(e){e.error&&e.request._waiter.setError(e,!0)}),e("CHECK_OUTPUT","extractData",function(e){var t=e.request._waiter,r=t.checkSuccess(e);r?e.error=null:t.setError(e,null===r?!1:!0)})}),error:(new a.SequentialExecutor).addNamedListeners(function(e){e("CHECK_ERROR","extractError",function(e){var t=e.request._waiter,r=t.checkError(e);r?(e.error=null,e.data={},e.request.removeAllListeners("extractData")):t.setError(e,null===r?!1:!0)}),e("CHECK_ERR_OUTPUT","extractData",function(e){e.request._waiter.setError(e,!0)})})},wait:function(e,t){"function"==typeof e&&(t=e,e=void 0);var r=this.service.makeRequest(this.config.operation,e),a=this.Listeners[this.config.successType];return r._waiter=this,r.response.maxRetries=this.config.maxAttempts,r.addListeners(this.Listeners.retry),a&&r.addListeners(a),t&&r.send(t),r},setError:function(e,t){e.data=null,e.error=a.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:t})},checkSuccess:function(e){if(!this.config.successPath)return e.httpResponse.statusCode<300;var t=a.util.jamespath.find(this.config.successPath,e.data);return this.config.failureValue&&this.config.failureValue.indexOf(t)>=0?null:this.expectedValue?t===this.expectedValue:t?!0:!1},checkError:function(e){var t=this.config.successValue;return"number"==typeof t?e.httpResponse.statusCode===t:e.error&&e.error.code===t},loadWaiterConfig:function(e,t){if(!this.service.api.waiters[e]){if(t)return;throw new a.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."})}this.config=this.service.api.waiters[e];var r=this.config;!function(){r.successType=r.successType||r.acceptorType,r.successPath=r.successPath||r.acceptorPath,r.successValue=r.successValue||r.acceptorValue,r.failureType=r.failureType||r.acceptorType,r.failurePath=r.failurePath||r.acceptorPath,r.failureValue=r.failureValue||r.acceptorValue}()}})},{"./core":3}],32:[function(e,t,r){var a=e("./core"),o=a.util.inherit;a.Response=o({constructor:function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new a.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function(e){var t,r=this.request.service,o=this.request.operation;try{t=r.paginationConfig(o,!0)}catch(n){this.error=n}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var i=a.util.copy(this.request.params);if(this.nextPageTokens){var s=t.inputToken;"string"==typeof s&&(s=[s]);for(var u=0;ue.partSize&&(e.partSize=r)}else e.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=this,t=o(e.body);if(0===t)return e.isDoneChunking=!0,e.numParts=1,void e.nextChunk(e.body);for(;e.activeParts=e.queueSize)){var t=e.body.read(e.partSize-e.partBufferLength)||e.body.read();if(t&&(e.partBuffers.push(t),e.partBufferLength+=t.length,e.totalChunkedBytes+=t.length),e.partBufferLength>=e.partSize){var a=r.concat(e.partBuffers);if(e.partBuffers=[],e.partBufferLength=0,a.length>e.partSize){var o=a.slice(e.partSize);e.partBuffers.push(o),e.partBufferLength+=o.length,a=a.slice(0,e.partSize)}e.nextChunk(a)}e.isDoneChunking&&!e.isDoneSending&&(a=r.concat(e.partBuffers),e.partBuffers=[],e.partBufferLength=0,e.totalBytes=e.totalChunkedBytes,e.isDoneSending=!0,(0===e.numParts||a.length>0)&&(e.numParts++,e.nextChunk(a))),e.body.read(0)}},nextChunk:function(e){var t=this;if(t.failed)return null;var r=++t.totalPartNumbers;if(t.isDoneChunking&&1===r){var a=t.service.putObject({Body:e});return a._managedUpload=t,a.on("httpUploadProgress",t.progress).send(t.finishSinglePart),null}t.activeParts++,t.service.config.params.UploadId?t.uploadPart(e,r):t.multipartReq?t.queueChunks(e,r):(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,r),t.multipartReq.on("error",function(e){t.cleanup(e)}),t.multipartReq.send())},uploadPart:function(e,t){var r=this,o={Body:e,ContentLength:a.util.string.byteLength(e),PartNumber:t},n={ETag:null,PartNumber:t};r.completeInfo.push(n);var i=r.service.uploadPart(o);r.parts[t]=i,i._lastUploadedBytes=0,i._managedUpload=r,i.on("httpUploadProgress",r.progress),i.send(function(e,t){if(delete r.parts[o.PartNumber],r.activeParts--,!(e||t&&t.ETag)){var i="No access to ETag property on response.";a.util.isBrowser()&&(i+=" Check CORS configuration to expose ETag header."),e=a.util.error(new Error(i),{code:"ETagMissing",retryable:!1})}return e?r.cleanup(e):(n.ETag=t.ETag,r.doneParts++,void(r.isDoneChunking&&r.doneParts===r.numParts?r.finishMultiPart():r.fillQueue.call(r)))})},queueChunks:function(e,t){var r=this;r.multipartReq.on("success",function(){r.uploadPart(e,t)})},cleanup:function(e){var t=this;t.failed||("function"==typeof t.body.removeAllListeners&&"function"==typeof t.body.resume&&(t.body.removeAllListeners("readable"),t.body.removeAllListeners("end"),t.body.resume()),t.service.config.params.UploadId&&!t.leavePartsOnError&&t.service.abortMultipartUpload().send(),a.util.each(t.parts,function(e,t){t.removeAllListeners("complete"),t.abort()}),t.parts={},t.callback(e),t.failed=!0)},finishMultiPart:function(){var e=this,t={MultipartUpload:{Parts:e.completeInfo}};e.service.completeMultipartUpload(t,function(t,r){return t?e.cleanup(t):void e.callback(t,r)})},finishSinglePart:function(e,t){var r=this.request._managedUpload,o=this.request.httpRequest,n=a.util.urlFormat(o.endpoint);return e?r.callback(e):(t.Location=n.substr(0,n.length-1)+o.path,void r.callback(e,t))},progress:function(e){var t=this._managedUpload;"putObject"===this.operation?e.part=1:(t.totalUploadedBytes+=e.loaded-this._lastUploadedBytes,this._lastUploadedBytes=e.loaded,e={loaded:t.totalUploadedBytes,total:t.totalBytes,part:this.params.PartNumber}),t.emit("httpUploadProgress",[e])}}),a.util.mixin(a.S3.ManagedUpload,a.SequentialExecutor),t.exports=a.S3.ManagedUpload}).call(this,e("buffer").Buffer)},{"../core":3,buffer:54}],34:[function(e,t,r){var a=e("./core"); +a.SequentialExecutor=a.util.inherit({constructor:function(){this._events={}},listeners:function(e){return this._events[e]?this._events[e].slice(0):[]},on:function(e,t){return this._events[e]?this._events[e].push(t):this._events[e]=[t],this},onAsync:function(e,t){return t._isAsync=!0,this.on(e,t)},removeListener:function(e,t){var r=this._events[e];if(r){for(var a=r.length,o=-1,n=0;a>n;++n)r[n]===t&&(o=n);o>-1&&r.splice(o,1)}return this},removeAllListeners:function(e){return e?delete this._events[e]:this._events={},this},emit:function(e,t,r){r||(r=function(){});var a=this.listeners(e),o=a.length;return this.callListeners(a,t,r),o>0},callListeners:function(e,t,r,o){function n(o){return o&&(s=a.util.error(s||new Error,o),i._haltHandlersOnError)?r.call(i,s):void i.callListeners(e,t,r,s)}for(var i=this,s=o||null;e.length>0;){var u=e.shift();if(u._isAsync)return void u.apply(i,t.concat([n]));try{u.apply(i,t)}catch(c){s=a.util.error(s||new Error,c)}if(s&&i._haltHandlersOnError)return void r.call(i,s)}r.call(i,s)},addListeners:function(e){var t=this;return e._events&&(e=e._events),a.util.each(e,function(e,r){"function"==typeof r&&(r=[r]),a.util.arrayEach(r,function(r){t.on(e,r)})}),t},addNamedListener:function(e,t,r){return this[e]=r,this.addListener(t,r),this},addNamedAsyncListener:function(e,t,r){return r._isAsync=!0,this.addNamedListener(e,t,r)},addNamedListeners:function(e){var t=this;return e(function(){t.addNamedListener.apply(t,arguments)},function(){t.addNamedAsyncListener.apply(t,arguments)}),this}}),a.SequentialExecutor.prototype.addListener=a.SequentialExecutor.prototype.on,t.exports=a.SequentialExecutor},{"./core":3}],35:[function(e,t,r){var a=e("./core"),o=e("./model/api"),n=e("./region_config"),i=a.util.inherit;a.Service=i({constructor:function(e){if(!this.loadServiceClass)throw a.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});return t?new t(e):void this.initialize(e)},initialize:function(e){var t=a.config[this.serviceIdentifier];this.config=new a.Config(a.config),t&&this.config.update(t,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||n(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint)},validateService:function(){},loadServiceClass:function(e){var t=e;if(a.util.isEmpty(this.api)){if(t.apiConfig)return a.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){t=new a.Config(a.config),t.update(e,!0);var r=t.apiVersions[this.constructor.serviceIdentifier];return r=r||t.apiVersion,this.getLatestServiceClass(r)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&a.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?a.util.isType(e,Date)&&(e=a.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(),r=null,o=t.length-1;o>=0;o--)if("*"!==t[o][t[o].length-1]&&(r=t[o]),t[o].substr(0,10)<=e)return r;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,makeRequest:function(e,t,r){if("function"==typeof t&&(r=t,t=null),t=t||{},this.config.params){var o=this.api.operations[e];o&&(t=a.util.copy(t),a.util.each(this.config.params,function(e,r){o.input.members[e]&&(void 0===t[e]||null===t[e])&&(t[e]=r)}))}var n=new a.Request(this,e,t);return this.addAllRequestListeners(n),r&&n.send(r),n},makeUnauthenticatedRequest:function(e,t,r){"function"==typeof t&&(r=t,t={});var a=this.makeRequest(e,t).toUnauthenticated();return r?a.send(r):a},waitFor:function(e,t,r){var o=new a.ResourceWaiter(this,e);return o.wait(t,r)},addAllRequestListeners:function(e){for(var t=[a.events,a.EventListeners.Core,this.serviceInterface(),a.EventListeners.CorePost],r=0;rr;++r)t[r]=30*Math.pow(2,r);return t},retryableError:function(e){return this.networkingError(e)?!0:this.expiredCredentialsError(e)?!0:this.throttledError(e)?!0:e.statusCode>=500?!0:!1},networkingError:function(e){return"NetworkingError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},throttledError:function(e){switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!=typeof e)return e;var t=e;return t=t.replace(/\{service\}/g,this.api.endpointPrefix),t=t.replace(/\{region\}/g,this.config.region),t=t.replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new a.Endpoint(e,this.config)},paginationConfig:function(e,t){var r=this.api.operations[e].paginator;if(!r){if(t){var o=new Error;throw a.util.error(o,"No pagination configuration for "+e)}return null}return r}}),a.util.update(a.Service,{defineMethods:function(e){a.util.each(e.prototype.api.operations,function(t){e.prototype[t]||(e.prototype[t]=function(e,r){return this.makeRequest(t,e,r)})})},defineService:function(e,t,r){a.Service._serviceMap[e]=!0,Array.isArray(t)||(r=t,t=[]);var o=i(a.Service,r||{});if("string"==typeof e){a.Service.addVersions(o,t);var n=o.serviceIdentifier||e;o.serviceIdentifier=n}else o.prototype.api=e,a.Service.defineMethods(o);return o},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var r=0;rr;++r)0===r?t.push(0):t.push(50*Math.pow(2,r-1));return t}})},{"../core":3}],38:[function(e,t,r){var a=e("../core");a.util.update(a.EC2.prototype,{setupRequestListeners:function(e){e.removeListener("extractError",a.EventListeners.Query.EXTRACT_ERROR),e.addListener("extractError",this.extractError),"copySnapshot"===e.operation&&e.onAsync("validate",this.buildCopySnapshotPresignedUrl)},buildCopySnapshotPresignedUrl:function(e,t){if(e.params.PresignedUrl||e._subRequest)return t();e.params=a.util.copy(e.params),e.params.DestinationRegion=e.service.config.region;var r=a.util.copy(e.service.config);delete r.endpoint,r.region=e.params.SourceRegion;var o=new e.service.constructor(r),n=o[e.operation](e.params);n._subRequest=!0,n.presign(function(r,a){r?t(r):(e.params.PresignedUrl=a,t())})},extractError:function(e){var t=e.httpResponse,r=(new a.XML.Parser).parse(t.body.toString()||"");r.Errors?e.error=a.util.error(new Error,{code:r.Errors.Error.Code,message:r.Errors.Error.Message}):e.error=a.util.error(new Error,{code:t.statusCode,message:null})}})},{"../core":3}],39:[function(e,t,r){var a=e("../core");a.util.update(a.MachineLearning.prototype,{setupRequestListeners:function(e){"predict"===e.operation&&e.addListener("build",this.buildEndpoint)},buildEndpoint:function(e){var t=e.params.PredictEndpoint;t&&(e.httpRequest.endpoint=new a.Endpoint(t))}})},{"../core":3}],40:[function(e,t,r){var a=e("../core");e("../s3/managed_upload"),a.util.update(a.S3.prototype,{validateService:function(){if(this.config.region||(this.config.region="us-east-1"),!this.config.endpoint&&this.config.s3BucketEndpoint){var e="An endpoint must be provided when configuring `s3BucketEndpoint` to true.";throw a.util.error(new Error,{name:"InvalidEndpoint",message:e})}},setupRequestListeners:function(e){e.addListener("validate",this.validateScheme),e.addListener("validate",this.validateBucketEndpoint),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",a.EventListeners.Core.VALIDATE_REGION),e.addListener("extractError",this.extractError),e.addListener("extractData",this.extractData),e.addListener("extractData",a.util.hoistPayloadMember),e.addListener("beforePresign",this.prepareSignedUrl)},validateScheme:function(e){var t=e.params,r=e.httpRequest.endpoint.protocol,o=t.SSECustomerKey||t.CopySourceSSECustomerKey;if(o&&"https:"!==r){var n="Cannot send SSE keys over HTTP. Set 'sslEnabled'to 'true' in your configuration";throw a.util.error(new Error,{code:"ConfigError",message:n})}},validateBucketEndpoint:function(e){if(!e.params.Bucket&&e.service.config.s3BucketEndpoint){var t="Cannot send requests to root API with `s3BucketEndpoint` set.";throw a.util.error(new Error,{code:"ConfigError",message:t})}},populateURI:function(e){var t=e.httpRequest,r=e.params.Bucket;if(r&&!e.service.pathStyleBucketName(r)){if(!e.service.config.s3BucketEndpoint){t.endpoint.hostname=r+"."+t.endpoint.hostname;var a=t.endpoint.port;80!==a&&443!==a?t.endpoint.host=t.endpoint.hostname+":"+t.endpoint.port:t.endpoint.host=t.endpoint.hostname}t.virtualHostedBucket=r,t.path=t.path.replace(new RegExp("/"+r),""),"/"!==t.path[0]&&(t.path="/"+t.path)}},addExpect100Continue:function(e){var t=e.httpRequest.headers["Content-Length"];a.util.isNode()&&t>=1048576&&(e.httpRequest.headers.Expect="100-continue")},addContentType:function(e){var t=e.httpRequest;if("GET"===t.method||"HEAD"===t.method)return void delete t.headers["Content-Type"];t.headers["Content-Type"]||(t.headers["Content-Type"]="application/octet-stream");var r=t.headers["Content-Type"];if(a.util.isBrowser())if("string"!=typeof t.body||r.match(/;\s*charset=/)){var o=function(e,t,r){return t+r.toUpperCase()};t.headers["Content-Type"]=r.replace(/(;\s*charset=)(.+)$/,o)}else{var n="; charset=UTF-8";t.headers["Content-Type"]+=n}},computableChecksumOperations:{putBucketCors:!0,putBucketLifecycle:!0,putBucketTagging:!0,deleteObjects:!0},willComputeChecksums:function(e){if(this.computableChecksumOperations[e.operation])return!0;if(!this.config.computeChecksums)return!1;if(!a.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.getSignerClass(e)===a.Signers.V4&&t.ContentMD5&&!t.ContentMD5.required?!1:t.ContentMD5&&!e.params.ContentMD5?!0:void 0},computeContentMd5:function(e){if(e.service.willComputeChecksums(e)){var t=a.util.crypto.md5(e.httpRequest.body,"base64");e.httpRequest.headers["Content-MD5"]=t}},computeSseCustomerKeyMd5:function(e){var t={SSECustomerKey:"x-amz-server-side-encryption-customer-key-MD5",CopySourceSSECustomerKey:"x-amz-copy-source-server-side-encryption-customer-key-MD5"};a.util.each(t,function(t,r){if(e.params[t]){var o=a.util.crypto.md5(e.params[t],"base64");e.httpRequest.headers[r]=o}})},pathStyleBucketName:function(e){return this.config.s3ForcePathStyle?!0:this.config.s3BucketEndpoint?!1:this.dnsCompatibleBucketName(e)?this.config.sslEnabled&&e.match(/\./)?!0:!1:!0},dnsCompatibleBucketName:function(e){var t=e,r=new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/),a=new RegExp(/(\d+\.){3}\d+/),o=new RegExp(/\.\./);return!t.match(r)||t.match(a)||t.match(o)?!1:!0},successfulResponse:function(e){var t=e.request,r=e.httpResponse;return"completeMultipartUpload"===t.operation&&r.body.toString().match("")?!1:r.statusCode<300},retryableError:function(e,t){if("completeMultipartUpload"===t.operation&&200===e.statusCode)return!0;if(e&&"RequestTimeout"===e.code)return!0;var r=a.Service.prototype.retryableError;return r.call(this,e,t)},extractData:function(e){var t=e.request;if("getBucketLocation"===t.operation){var r=e.httpResponse.body.toString().match(/>(.+)<\/Location/);delete e.data._,r?e.data.LocationConstraint=r[1]:e.data.LocationConstraint=""}},extractError:function(e){var t={304:"NotModified",403:"Forbidden",400:"BadRequest",404:"NotFound"},r=e.httpResponse.statusCode,o=e.httpResponse.body||"";if(t[r]&&0===o.length)e.error=a.util.error(new Error,{code:t[e.httpResponse.statusCode],message:null});else{var n=(new a.XML.Parser).parse(o.toString());e.error=a.util.error(new Error,{code:n.Code||r,message:n.Message||null})}},getSignedUrl:function(e,t,r){t=a.util.copy(t||{});var o=t.Expires||900;delete t.Expires;var n=this.makeRequest(e,t);return n.presign(o,r)},prepareSignedUrl:function(e){e.addListener("validate",e.service.noPresignedContentLength),e.removeListener("build",e.service.addContentType),e.params.Body?e.addListener("afterBuild",a.EventListeners.Core.COMPUTE_SHA256):e.removeListener("build",e.service.computeContentMd5)},noPresignedContentLength:function(e){if(void 0!==e.params.ContentLength)throw a.util.error(new Error,{code:"UnexpectedParameter",message:"ContentLength is not supported in pre-signed URLs."})},createBucket:function(e,t){e||(e={});var r=this.endpoint.hostname;return r===this.api.globalEndpoint||e.CreateBucketConfiguration||(e.CreateBucketConfiguration={LocationConstraint:this.config.region}),this.makeRequest("createBucket",e,t)},upload:function(e,t,r){"function"==typeof t&&void 0===r&&(r=t,t=null),t=t||{},t=a.util.merge(t||{},{service:this,params:e});var o=new a.S3.ManagedUpload(t);return"function"==typeof r&&o.send(r),o}})},{"../core":3,"../s3/managed_upload":33}],41:[function(e,t,r){var a=e("../core");a.util.update(a.SQS.prototype,{setupRequestListeners:function(e){e.addListener("build",this.buildEndpoint),e.service.config.computeChecksums&&("sendMessage"===e.operation?e.addListener("extractData",this.verifySendMessageChecksum):"sendMessageBatch"===e.operation?e.addListener("extractData",this.verifySendMessageBatchChecksum):"receiveMessage"===e.operation&&e.addListener("extractData",this.verifyReceiveMessageChecksum))},verifySendMessageChecksum:function(e){if(e.data){var t=e.data.MD5OfMessageBody,r=this.params.MessageBody,a=this.service.calculateChecksum(r);if(a!==t){var o='Got "'+e.data.MD5OfMessageBody+'", expecting "'+a+'".';this.service.throwInvalidChecksumError(e,[e.data.MessageId],o)}}},verifySendMessageBatchChecksum:function(e){if(e.data){var t=this.service,r={},o=[],n=[];a.util.arrayEach(e.data.Successful,function(e){r[e.Id]=e}),a.util.arrayEach(this.params.Entries,function(e){if(r[e.Id]){var a=r[e.Id].MD5OfMessageBody,i=e.MessageBody;t.isChecksumValid(a,i)||(o.push(e.Id),n.push(r[e.Id].MessageId))}}),o.length>0&&t.throwInvalidChecksumError(e,n,"Invalid messages: "+o.join(", "))}},verifyReceiveMessageChecksum:function(e){if(e.data){var t=this.service,r=[];a.util.arrayEach(e.data.Messages,function(e){var a=e.MD5OfBody,o=e.Body;t.isChecksumValid(a,o)||r.push(e.MessageId)}),r.length>0&&t.throwInvalidChecksumError(e,r,"Invalid messages: "+r.join(", "))}},throwInvalidChecksumError:function(e,t,r){e.error=a.util.error(new Error,{retryable:!0,code:"InvalidChecksum",messageIds:t,message:e.request.operation+" returned an invalid MD5 response. "+r})},isChecksumValid:function(e,t){return this.calculateChecksum(t)===e},calculateChecksum:function(e){return a.util.crypto.md5(e,"hex")},buildEndpoint:function(e){var t=e.httpRequest.params.QueueUrl;if(t){e.httpRequest.endpoint=new a.Endpoint(t);var r=e.httpRequest.endpoint.host.match(/^sqs\.(.+?)\./);r&&(e.httpRequest.region=r[1])}}})},{"../core":3}],42:[function(e,t,r){var a=e("../core");a.util.update(a.STS.prototype,{credentialsFrom:function(e,t){return e?(t||(t=new a.TemporaryCredentials),t.expired=!1,t.accessKeyId=e.Credentials.AccessKeyId,t.secretAccessKey=e.Credentials.SecretAccessKey,t.sessionToken=e.Credentials.SessionToken,t.expireTime=e.Credentials.Expiration,t):null},assumeRoleWithWebIdentity:function(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,t)},assumeRoleWithSAML:function(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,t)}})},{"../core":3}],43:[function(e,t,r){function a(e){var t=e.httpRequest.headers[s];if(delete e.httpRequest.headers["User-Agent"],delete e.httpRequest.headers["X-Amz-User-Agent"],e.service.getSignerClass()===n.Signers.V4){if(t>604800){var r="Presigning does not support expiry time greater than a week with SigV4 signing.";throw n.util.error(new Error,{code:"InvalidExpiryTime",message:r,retryable:!1})}e.httpRequest.headers[s]=t}else{if(e.service.getSignerClass()!==n.Signers.S3)throw n.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});e.httpRequest.headers[s]=parseInt(n.util.date.unixTimestamp()+t,10).toString()}}function o(e){var t=e.httpRequest.endpoint,r=n.util.urlParse(e.httpRequest.path),a={};r.search&&(a=n.util.queryStringParse(r.search.substr(1))),n.util.each(e.httpRequest.headers,function(e,t){e===s&&(e="Expires"),a[e]=t}),delete e.httpRequest.headers[s];var o=a.Authorization.split(" ");if("AWS"===o[0])o=o[1].split(":"),a.AWSAccessKeyId=o[0],a.Signature=o[1];else if("AWS4-HMAC-SHA256"===o[0]){o.shift();var i=o.join(" "),u=i.match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];a["X-Amz-Signature"]=u,delete a.Expires}delete a.Authorization,delete a.Host,t.pathname=r.pathname,t.search=n.util.queryParamsToString(a)}var n=e("../core"),i=n.util.inherit,s="presigned-expires";n.Signers.Presign=i({sign:function(e,t,r){if(e.httpRequest.headers[s]=t||3600,e.on("build",a),e.on("sign",o),e.removeListener("afterBuild",n.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",n.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!r){if(e.build(),e.response.error)throw e.response.error;return n.util.urlFormat(e.httpRequest.endpoint)}e.build(function(){this.response.error?r(this.response.error):r(null,n.util.urlFormat(e.httpRequest.endpoint))})}}),t.exports=n.Signers.Presign},{"../core":3}],44:[function(e,t,r){var a=e("../core"),o=a.util.inherit;a.Signers.RequestSigner=o({constructor:function(e){this.request=e}}),a.Signers.RequestSigner.getVersion=function(e){switch(e){case"v2":return a.Signers.V2;case"v3":return a.Signers.V3;case"v4":return a.Signers.V4;case"s3":return a.Signers.S3;case"v3https":return a.Signers.V3Https}throw new Error("Unknown signing version "+e)},e("./v2"),e("./v3"),e("./v3https"),e("./v4"),e("./s3"),e("./presign")},{"../core":3,"./presign":43,"./s3":45,"./v2":46,"./v3":47,"./v3https":48,"./v4":49}],45:[function(e,t,r){var a=e("../core"),o=a.util.inherit;a.Signers.S3=o(a.Signers.RequestSigner,{subResources:{acl:1,cors:1,lifecycle:1,"delete":1,location:1,logging:1,notification:1,partNumber:1,policy:1,requestPayment:1,restore:1,tagging:1,torrent:1,uploadId:1,uploads:1,versionId:1,versioning:1,versions:1,website:1},responseHeaders:{"response-content-type":1,"response-content-language":1,"response-expires":1,"response-cache-control":1,"response-content-disposition":1,"response-content-encoding":1},addAuthorization:function(e,t){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=a.util.date.rfc822(t)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var r=this.sign(e.secretAccessKey,this.stringToSign()),o="AWS "+e.accessKeyId+":"+r;this.request.headers.Authorization=o},stringToSign:function(){var e=this.request,t=[];t.push(e.method),t.push(e.headers["Content-MD5"]||""),t.push(e.headers["Content-Type"]||""),t.push(e.headers["presigned-expires"]||"");var r=this.canonicalizedAmzHeaders();return r&&t.push(r),t.push(this.canonicalizedResource()),t.join("\n")},canonicalizedAmzHeaders:function(){var e=[];a.util.each(this.request.headers,function(t){t.match(/^x-amz-/i)&&e.push(t)}),e.sort(function(e,t){return e.toLowerCase()=0?"&":"?";this.request.path+=n+a.util.queryParamsToString(o)},authorization:function(e,t){var r=[],a=this.credentialString(t);return r.push(this.algorithm+" Credential="+e.accessKeyId+"/"+a),r.push("SignedHeaders="+this.signedHeaders()),r.push("Signature="+this.signature(e,t)),r.join(", ")},signature:function(e,t){var r=n[this.serviceName],o=t.substr(0,8);if(!r||r.akid!==e.accessKeyId||r.region!==this.request.region||r.date!==o){var i=e.secretAccessKey,s=a.util.crypto.hmac("AWS4"+i,o,"buffer"),u=a.util.crypto.hmac(s,this.request.region,"buffer"),c=a.util.crypto.hmac(u,this.serviceName,"buffer"),p=a.util.crypto.hmac(c,"aws4_request","buffer");n[this.serviceName]={region:this.request.region,date:o,key:p,akid:e.accessKeyId}}var m=n[this.serviceName].key;return a.util.crypto.hmac(m,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=a.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=[];a.util.each.call(this,this.request.headers,function(t,r){e.push([t,r])}),e.sort(function(e,t){return e[0].toLowerCase()=e.length)return t.push(null);var o=r+a;o>e.length&&(o=e.length),t.push(e.slice(r,o)),r=o},t},concat:function(e){var t,r=0,a=0,o=null;for(t=0;ta&&(a=e.length+a),r.push(e[a])}}),a=r),0===a.length?i.abort:void 0}),a.length>0?(r=a,i.abort):void 0}),r},find:function(e,t){return i.jamespath.query(e,t)[0]}},date:{getDate:function(){return a||(a=e("./core")),a.config.systemClockOffset?new Date((new Date).getTime()+a.config.systemClockOffset):new Date},iso8601:function(e){return void 0===e&&(e=i.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function(e){return void 0===e&&(e=i.date.getDate()),e.toUTCString()},unixTimestamp:function(e){return void 0===e&&(e=i.date.getDate()),e.getTime()/1e3},from:function(e){return"number"==typeof e?new Date(1e3*e):new Date(e)},format:function(e,t){return t||(t="iso8601"),i.date[t](i.date.from(e))},parseTimestamp:function(e){if("number"==typeof e)return new Date(1e3*e);if(e.match(/^\d+$/))return new Date(1e3*e);if(e.match(/^\d{4}/))return new Date(e);if(e.match(/^\w{3},/))return new Date(e);throw i.error(new Error("unhandled timestamp format: "+e),{code:"TimestampParserError"})}},crypto:{crc32Table:[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],crc32:function(e){var t=i.crypto.crc32Table,r=-1;"string"==typeof e&&(e=new n(e));for(var a=0;a>>8^t[255&(r^o)]}return(-1^r)>>>0},hmac:function(e,t,r,a){return r||(r="binary"),"buffer"===r&&(r=void 0),a||(a="sha256"),"string"==typeof t&&(t=new n(t)),o.createHmac(a,e).update(t).digest(r)},md5:function(e,t,r){return i.crypto.hash("md5",e,t,r)},sha256:function(e,t,r){return i.crypto.hash("sha256",e,t,r)},hash:function(e,t,r,a){var o=i.crypto.createHash(e);r||(r="binary"),"buffer"===r&&(r=void 0),"string"==typeof t&&(t=new n(t));var s=i.arraySliceFn(t),u=n.isBuffer(t);if(a&&"object"==typeof t&&"function"==typeof t.on&&!u)t.on("data",function(e){o.update(e)}),t.on("error",function(e){a(e)}),t.on("end",function(){a(null,o.digest(r))});else{if(!a||!s||u||"undefined"==typeof FileReader){i.isBrowser()&&"object"==typeof t&&!u&&(t=new n(new Uint8Array(t)));var c=o.update(t).digest(r);return a&&a(null,c),c}var p=0,m=524288,l=new FileReader;l.onerror=function(){a(new Error("Failed to read data."))},l.onload=function(){var e=new n(new Uint8Array(l.result));o.update(e),p+=e.length,l._continueReading()},l._continueReading=function(){if(p>=t.size)return void a(null,o.digest(r));var e=p+m;e>t.size&&(e=t.size),l.readAsArrayBuffer(s.call(t,p,e))},l._continueReading()}},toHex:function(e){for(var t=[],r=0;r0||a?n.root().toString():""},t.exports=a},{"../util":51,xmlbuilder:75}],54:[function(e,t,r){function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);var o=typeof e;if("base64"===t&&"string"===o)for(e=A(e);e.length%4!==0;)e+="=";var n;if("number"===o)n=E(e);else if("string"===o)n=a.byteLength(e,t);else{if("object"!==o)throw new Error("First argument needs to be a number, array or string.");n=E(e.length)}var i;a._useTypedArrays?i=a._augment(new Uint8Array(n)):(i=this,i.length=n,i._isBuffer=!0);var s;if(a._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(P(e))for(s=0;n>s;s++)a.isBuffer(e)?i[s]=e.readUInt8(s):i[s]=e[s];else if("string"===o)i.write(e,0,t);else if("number"===o&&!a._useTypedArrays&&!r)for(s=0;n>s;s++)i[s]=0;return i}function o(e,t,r,o){r=Number(r)||0;var n=e.length-r;o?(o=Number(o),o>n&&(o=n)):o=n;var i=t.length;G(i%2===0,"Invalid hex string"),o>i/2&&(o=i/2);for(var s=0;o>s;s++){var u=parseInt(t.substr(2*s,2),16);G(!isNaN(u),"Invalid hex string"),e[r+s]=u}return a._charsWritten=2*s,s}function n(e,t,r,o){var n=a._charsWritten=_(L(t),e,r,o);return n}function i(e,t,r,o){var n=a._charsWritten=_(M(t),e,r,o);return n}function s(e,t,r,a){return i(e,t,r,a)}function u(e,t,r,o){var n=a._charsWritten=_(U(t),e,r,o);return n}function c(e,t,r,o){var n=a._charsWritten=_(B(t),e,r,o);return n}function p(e,t,r){return 0===t&&r===e.length?K.fromByteArray(e):K.fromByteArray(e.slice(t,r))}function m(e,t,r){var a="",o="";r=Math.min(e.length,r);for(var n=t;r>n;n++)e[n]<=127?(a+=V(o)+String.fromCharCode(e[n]),o=""):o+="%"+e[n].toString(16);return a+V(o)}function l(e,t,r){var a="";r=Math.min(e.length,r);for(var o=t;r>o;o++)a+=String.fromCharCode(e[o]);return a}function d(e,t,r){return l(e,t,r)}function y(e,t,r){var a=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>a)&&(r=a);for(var o="",n=t;r>n;n++)o+=w(e[n]);return o}function h(e,t,r){for(var a=e.slice(t,r),o="",n=0;n=o)){var n;return r?(n=e[t],o>t+1&&(n|=e[t+1]<<8)):(n=e[t]<<8,o>t+1&&(n|=e[t+1])),n}}function f(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+3=o)){var n;return r?(o>t+2&&(n=e[t+2]<<16),o>t+1&&(n|=e[t+1]<<8),n|=e[t],o>t+3&&(n+=e[t+3]<<24>>>0)):(o>t+1&&(n=e[t+1]<<16),o>t+2&&(n|=e[t+2]<<8),o>t+3&&(n|=e[t+3]),n+=e[t]<<24>>>0),n}}function g(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+1=o)){var n=b(e,t,r,!0),i=32768&n;return i?-1*(65535-n+1):n}}function N(e,t,r,a){a||(G("boolean"==typeof r,"missing or invalid endian"),G(void 0!==t&&null!==t,"missing offset"),G(t+3=o)){var n=f(e,t,r,!0),i=2147483648&n;return i?-1*(4294967295-n+1):n}}function S(e,t,r,a){return a||(G("boolean"==typeof r,"missing or invalid endian"),G(t+3=n))for(var i=0,s=Math.min(n-r,2);s>i;i++)e[r+i]=(t&255<<8*(a?i:1-i))>>>8*(a?i:1-i)}function k(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n))for(var i=0,s=Math.min(n-r,4);s>i;i++)e[r+i]=t>>>8*(a?i:3-i)&255}function R(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+1=n||(t>=0?v(e,t,r,a,o):v(e,65535+t+1,r,a,o))}function C(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n||(t>=0?k(e,t,r,a,o):k(e,4294967295+t+1,r,a,o))}function T(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+3=n||j.write(e,t,r,a,23,4)}function D(e,t,r,a,o){o||(G(void 0!==t&&null!==t,"missing value"),G("boolean"==typeof a,"missing or invalid endian"),G(void 0!==r&&null!==r,"missing offset"),G(r+7=n||j.write(e,t,r,a,52,8)}function A(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e,t,r){return"number"!=typeof e?r:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function E(e){return e=~~Math.ceil(+e),0>e?0:e}function x(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function P(e){return x(e)||a.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function w(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e){for(var t=[],r=0;r=a)t.push(e.charCodeAt(r));else{var o=r;a>=55296&&57343>=a&&r++;for(var n=encodeURIComponent(e.slice(o,r+1)).substr(1).split("%"),i=0;i>8,a=t%256,o.push(a),o.push(r);return o}function U(e){return K.toByteArray(e)}function _(e,t,r,a){for(var o=0;a>o&&!(o+r>=t.length||o>=e.length);o++)t[o+r]=e[o];return o}function V(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function z(e,t){G("number"==typeof e,"cannot write a non-number as a number"),G(e>=0,"specified a negative value for writing an unsigned value"),G(t>=e,"value is larger than maximum value for type"),G(Math.floor(e)===e,"value has a fractional component")}function F(e,t,r){G("number"==typeof e,"cannot write a non-number as a number"),G(t>=e,"value larger than maximum allowed value"),G(e>=r,"value smaller than minimum allowed value"),G(Math.floor(e)===e,"value has a fractional component")}function O(e,t,r){G("number"==typeof e,"cannot write a non-number as a number"),G(t>=e,"value larger than maximum allowed value"),G(e>=r,"value smaller than minimum allowed value")}function G(e,t){if(!e)throw new Error(t||"Failed assertion")}var K=e("base64-js"),j=e("ieee754");r.Buffer=a,r.SlowBuffer=a,r.INSPECT_MAX_BYTES=50,a.poolSize=8192,a._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(r){return!1}}(),a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},a.byteLength=function(e,t){var r;switch(e+="",t||"utf8"){case"hex":r=e.length/2;break;case"utf8":case"utf-8":r=L(e).length;break;case"ascii":case"binary":case"raw":r=e.length;break;case"base64":r=U(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=2*e.length;break;default:throw new Error("Unknown encoding")}return r},a.concat=function(e,t){if(G(x(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new a(0);if(1===e.length)return e[0];var r;if("number"!=typeof t)for(t=0,r=0;rm&&(r=m)):r=m,a=String(a||"utf8").toLowerCase();var l;switch(a){case"hex":l=o(this,e,t,r);break;case"utf8":case"utf-8":l=n(this,e,t,r);break;case"ascii":l=i(this,e,t,r);break;case"binary":l=s(this,e,t,r);break;case"base64":l=u(this,e,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":l=c(this,e,t,r);break;default:throw new Error("Unknown encoding")}return l},a.prototype.toString=function(e,t,r){var a=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,r=void 0!==r?Number(r):r=a.length,r===t)return"";var o;switch(e){case"hex":o=y(a,t,r);break;case"utf8":case"utf-8":o=m(a,t,r);break;case"ascii":o=l(a,t,r);break;case"binary":o=d(a,t,r);break;case"base64":o=p(a,t,r);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":o=h(a,t,r);break;default:throw new Error("Unknown encoding")}return o},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.copy=function(e,t,r,o){var n=this;if(r||(r=0),o||0===o||(o=this.length),t||(t=0),o!==r&&0!==e.length&&0!==n.length){G(o>=r,"sourceEnd < sourceStart"),G(t>=0&&t=0&&r=0&&o<=n.length,"sourceEnd out of bounds"),o>this.length&&(o=this.length),e.length-ti||!a._useTypedArrays)for(var s=0;i>s;s++)e[s+t]=this[s+r];else e._set(this.subarray(r,r+i),t)}},a.prototype.slice=function(e,t){var r=this.length;if(e=q(e,r,0),t=q(t,r,r),a._useTypedArrays)return a._augment(this.subarray(e,t));for(var o=t-e,n=new a(o,void 0,!0),i=0;o>i;i++)n[i]=this[i+e];return n},a.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},a.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},a.prototype.readUInt8=function(e,t){return t||(G(void 0!==e&&null!==e,"missing offset"),G(e=this.length?void 0:this[e]},a.prototype.readUInt16LE=function(e,t){return b(this,e,!0,t)},a.prototype.readUInt16BE=function(e,t){return b(this,e,!1,t)},a.prototype.readUInt32LE=function(e,t){return f(this,e,!0,t)},a.prototype.readUInt32BE=function(e,t){return f(this,e,!1,t)},a.prototype.readInt8=function(e,t){if(t||(G(void 0!==e&&null!==e,"missing offset"),G(e=this.length)){var r=128&this[e];return r?-1*(255-this[e]+1):this[e]}},a.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},a.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},a.prototype.readInt32LE=function(e,t){return N(this,e,!0,t)},a.prototype.readInt32BE=function(e,t){return N(this,e,!1,t)},a.prototype.readFloatLE=function(e,t){return S(this,e,!0,t)},a.prototype.readFloatBE=function(e,t){return S(this,e,!1,t)},a.prototype.readDoubleLE=function(e,t){return I(this,e,!0,t)},a.prototype.readDoubleBE=function(e,t){return I(this,e,!1,t)},a.prototype.writeUInt8=function(e,t,r){r||(G(void 0!==e&&null!==e,"missing value"),G(void 0!==t&&null!==t,"missing offset"),G(t=this.length||(this[t]=e)},a.prototype.writeUInt16LE=function(e,t,r){v(this,e,t,!0,r)},a.prototype.writeUInt16BE=function(e,t,r){v(this,e,t,!1,r)},a.prototype.writeUInt32LE=function(e,t,r){k(this,e,t,!0,r)},a.prototype.writeUInt32BE=function(e,t,r){k(this,e,t,!1,r)},a.prototype.writeInt8=function(e,t,r){r||(G(void 0!==e&&null!==e,"missing value"),G(void 0!==t&&null!==t,"missing offset"),G(t=this.length||(e>=0?this.writeUInt8(e,t,r):this.writeUInt8(255+e+1,t,r))},a.prototype.writeInt16LE=function(e,t,r){R(this,e,t,!0,r)},a.prototype.writeInt16BE=function(e,t,r){R(this,e,t,!1,r)},a.prototype.writeInt32LE=function(e,t,r){C(this,e,t,!0,r)},a.prototype.writeInt32BE=function(e,t,r){C(this,e,t,!1,r)},a.prototype.writeFloatLE=function(e,t,r){T(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){T(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){D(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){D(this,e,t,!1,r)},a.prototype.fill=function(e,t,r){if(e||(e=0),t||(t=0),r||(r=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),G("number"==typeof e&&!isNaN(e),"value is not a number"),G(r>=t,"end < start"),r!==t&&0!==this.length){G(t>=0&&t=0&&r<=this.length,"end out of bounds");for(var a=t;r>a;a++)this[a]=e}},a.prototype.inspect=function(){for(var e=[],t=this.length,a=0;t>a;a++)if(e[a]=w(this[a]),a===r.INSPECT_MAX_BYTES){e[a+1]="...";break}return""},a.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(a._useTypedArrays)return new a(this).buffer;for(var e=new Uint8Array(this.length),t=0,r=e.length;r>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var H=a.prototype;a._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=H.get,e.set=H.set,e.write=H.write,e.toString=H.toString,e.toLocaleString=H.toString,e.toJSON=H.toJSON,e.copy=H.copy,e.slice=H.slice,e.readUInt8=H.readUInt8,e.readUInt16LE=H.readUInt16LE,e.readUInt16BE=H.readUInt16BE,e.readUInt32LE=H.readUInt32LE,e.readUInt32BE=H.readUInt32BE,e.readInt8=H.readInt8,e.readInt16LE=H.readInt16LE,e.readInt16BE=H.readInt16BE,e.readInt32LE=H.readInt32LE,e.readInt32BE=H.readInt32BE,e.readFloatLE=H.readFloatLE,e.readFloatBE=H.readFloatBE,e.readDoubleLE=H.readDoubleLE,e.readDoubleBE=H.readDoubleBE,e.writeUInt8=H.writeUInt8,e.writeUInt16LE=H.writeUInt16LE,e.writeUInt16BE=H.writeUInt16BE,e.writeUInt32LE=H.writeUInt32LE,e.writeUInt32BE=H.writeUInt32BE,e.writeInt8=H.writeInt8,e.writeInt16LE=H.writeInt16LE,e.writeInt16BE=H.writeInt16BE,e.writeInt32LE=H.writeInt32LE,e.writeInt32BE=H.writeInt32BE,e.writeFloatLE=H.writeFloatLE,e.writeFloatBE=H.writeFloatBE,e.writeDoubleLE=H.writeDoubleLE,e.writeDoubleBE=H.writeDoubleBE,e.fill=H.fill,e.inspect=H.inspect,e.toArrayBuffer=H.toArrayBuffer,e}},{"base64-js":55,ieee754:56}],55:[function(e,t,r){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===i||t===m?62:t===s||t===l?63:u>t?-1:u+10>t?t-u+26+26:p+26>t?t-p:c+26>t?t-c+26:void 0}function r(e){function r(e){c[m++]=e}var a,o,i,s,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=e.length;u="="===e.charAt(p-2)?2:"="===e.charAt(p-1)?1:0,c=new n(3*e.length/4-u),i=u>0?e.length-4:e.length;var m=0;for(a=0,o=0;i>a;a+=4,o+=3)s=t(e.charAt(a))<<18|t(e.charAt(a+1))<<12|t(e.charAt(a+2))<<6|t(e.charAt(a+3)),r((16711680&s)>>16),r((65280&s)>>8),r(255&s);return 2===u?(s=t(e.charAt(a))<<2|t(e.charAt(a+1))>>4,r(255&s)):1===u&&(s=t(e.charAt(a))<<10|t(e.charAt(a+1))<<4|t(e.charAt(a+2))>>2,r(s>>8&255),r(255&s)),c}function o(e){function t(e){return a.charAt(e)}function r(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var o,n,i,s=e.length%3,u="";for(o=0,i=e.length-s;i>o;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],u+=r(n);switch(s){case 1:n=e[e.length-1],u+=t(n>>2),u+=t(n<<4&63),u+="==";break;case 2:n=(e[e.length-2]<<8)+e[e.length-1],u+=t(n>>10),u+=t(n>>4&63),u+=t(n<<2&63),u+="="}return u}var n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),p="A".charCodeAt(0),m="-".charCodeAt(0),l="_".charCodeAt(0);e.toByteArray=r,e.fromByteArray=o}("undefined"==typeof r?this.base64js={}:r)},{}],56:[function(e,t,r){r.read=function(e,t,r,a,o){var n,i,s=8*o-a-1,u=(1<>1,p=-7,m=r?o-1:0,l=r?-1:1,d=e[t+m];for(m+=l,n=d&(1<<-p)-1,d>>=-p,p+=s;p>0;n=256*n+e[t+m],m+=l,p-=8);for(i=n&(1<<-p)-1,n>>=-p,p+=a;p>0;i=256*i+e[t+m],m+=l,p-=8);if(0===n)n=1-c;else{if(n===u)return i?NaN:(d?-1:1)*(1/0);i+=Math.pow(2,a),n-=c}return(d?-1:1)*i*Math.pow(2,n-a)},r.write=function(e,t,r,a,o,n){var i,s,u,c=8*n-o-1,p=(1<>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:n-1,y=a?1:-1,h=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,i=p):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),t+=i+m>=1?l/u:l*Math.pow(2,1-m),t*u>=2&&(i++,u/=2),i+m>=p?(s=0,i=p):i+m>=1?(s=(t*u-1)*Math.pow(2,o),i+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,o),i=0));o>=8;e[r+d]=255&s,d+=y,s/=256,o-=8);for(i=i<0;e[r+d]=255&i,d+=y,i/=256,c-=8);e[r+d-y]|=128*h}},{}],57:[function(e,t,r){function a(e,t){if(e.length%s!==0){var r=e.length+(s-e.length%s);e=i.concat([e,u],r)}for(var a=[],o=t?e.readInt32BE:e.readInt32LE,n=0;nd?t=e(t):t.lengthn;n++)a[n]=54^t[n],o[n]=92^t[n];var i=e(s.concat([a,r]));return e(s.concat([o,i]))}function o(e,t){e=e||"sha1";var r=l[e],o=[],i=0;return r||n("algorithm:",e,"is not yet supported"),{update:function(e){return s.isBuffer(e)||(e=new s(e)),o.push(e),i+=e.length,this},digest:function(e){var n=s.concat(o),i=t?a(r,t,n):r(n);return o=null,e?i.toString(e):i}}}function n(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function i(e,t){for(var r in e)t(e[r],r)}var s=e("buffer").Buffer,u=e("./sha"),c=e("./sha256"),p=e("./rng"),m=e("./md5"),l={sha1:u,sha256:c,md5:m},d=64,y=new s(d);y.fill(0),r.createHash=function(e){return o(e)},r.createHmac=function(e,t){return o(e,t)},r.randomBytes=function(e,t){if(!t||!t.call)return new s(p(e));try{t.call(this,void 0,new s(p(e))); +}catch(r){t(r)}},i(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(e){r[e]=function(){n("sorry,",e,"is not implemented yet")}})},{"./md5":59,"./rng":60,"./sha":61,"./sha256":62,buffer:54}],59:[function(e,t,r){function a(e,t){e[t>>5]|=128<>>9<<4)+14]=t;for(var r=1732584193,a=-271733879,o=-1732584194,p=271733878,m=0;m>16)+(t>>16)+(r>>16);return a<<16|65535&r}function p(e,t){return e<>>32-t}var m=e("./helpers");t.exports=function(e){return m.hash(e,a,16)}},{"./helpers":57}],60:[function(e,t,r){!function(){var e,r,a=this;e=function(e){for(var t,t,r=new Array(e),a=0;e>a;a++)0==(3&a)&&(t=4294967296*Math.random()),r[a]=t>>>((3&a)<<3)&255;return r},a.crypto&&crypto.getRandomValues&&(r=function(e){var t=new Uint8Array(e);return crypto.getRandomValues(t),t}),t.exports=r||e}()},{}],61:[function(e,t,r){function a(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var r=Array(80),a=1732584193,u=-271733879,c=-1732584194,p=271733878,m=-1009589776,l=0;lg;g++){16>g?r[g]=e[l+g]:r[g]=s(r[g-3]^r[g-8]^r[g-14]^r[g-16],1);var N=i(i(s(a,5),o(g,u,c,p)),i(i(m,r[g]),n(g)));m=p,p=c,c=s(u,30),u=a,a=N}a=i(a,d),u=i(u,y),c=i(c,h),p=i(p,b),m=i(m,f)}return Array(a,u,c,p,m)}function o(e,t,r,a){return 20>e?t&r|~t&a:40>e?t^r^a:60>e?t&r|t&a|r&a:t^r^a}function n(e){return 20>e?1518500249:40>e?1859775393:60>e?-1894007588:-899497514}function i(e,t){var r=(65535&e)+(65535&t),a=(e>>16)+(t>>16)+(r>>16);return a<<16|65535&r}function s(e,t){return e<>>32-t}var u=e("./helpers");t.exports=function(e){return u.hash(e,a,20,!0)}},{"./helpers":57}],62:[function(e,t,r){var a=e("./helpers"),o=function(e,t){var r=(65535&e)+(65535&t),a=(e>>16)+(t>>16)+(r>>16);return a<<16|65535&r},n=function(e,t){return e>>>t|e<<32-t},i=function(e,t){return e>>>t},s=function(e,t,r){return e&t^~e&r},u=function(e,t,r){return e&t^e&r^t&r},c=function(e){return n(e,2)^n(e,13)^n(e,22)},p=function(e){return n(e,6)^n(e,11)^n(e,25)},m=function(e){return n(e,7)^n(e,18)^i(e,3)},l=function(e){return n(e,17)^n(e,19)^i(e,10)},d=function(e,t){var r,a,n,i,d,y,h,b,f,g,N,S,I=new Array(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),v=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),k=new Array(64);e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var f=0;fg;g++)16>g?k[g]=e[g+f]:k[g]=o(o(o(l(k[g-2]),k[g-7]),m(k[g-15])),k[g-16]),N=o(o(o(o(b,p(d)),s(d,y,h)),I[g]),k[g]),S=o(c(r),u(r,a,n)),b=h,h=y,y=d,d=o(i,N),i=n,n=a,a=r,r=o(N,S);v[0]=o(r,v[0]),v[1]=o(a,v[1]),v[2]=o(n,v[2]),v[3]=o(i,v[3]),v[4]=o(d,v[4]),v[5]=o(y,v[5]),v[6]=o(h,v[6]),v[7]=o(b,v[7])}return v};t.exports=function(e){return a.hash(e,d,32,!0)}},{"./helpers":57}],63:[function(e,t,r){function a(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function n(e){return"number"==typeof e}function i(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0,a.defaultMaxListeners=10,a.prototype.setMaxListeners=function(e){if(!n(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},a.prototype.emit=function(e){var t,r,a,n,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[e],s(r))return!1;if(o(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(a=arguments.length,n=new Array(a-1),u=1;a>u;u++)n[u-1]=arguments[u];r.apply(this,n)}else if(i(r)){for(a=arguments.length,n=new Array(a-1),u=1;a>u;u++)n[u-1]=arguments[u];for(c=r.slice(),a=c.length,u=0;a>u;u++)c[u].apply(this,n)}return!0},a.prototype.addListener=function(e,t){var r;if(!o(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?i(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,i(this._events[e])&&!this._events[e].warned){var r;r=s(this._maxListeners)?a.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},a.prototype.on=a.prototype.addListener,a.prototype.once=function(e,t){function r(){this.removeListener(e,r),a||(a=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var a=!1;return r.listener=t,this.on(e,r),this},a.prototype.removeListener=function(e,t){var r,a,n,s;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],n=r.length,a=-1,r===t||o(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=n;s-->0;)if(r[s]===t||r[s].listener&&r[s].listener===t){a=s;break}if(0>a)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},a.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],o(r))this.removeListener(e,r);else for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},a.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},a.listenerCount=function(e,t){var r;return r=e._events&&e._events[t]?o(e._events[t])?1:e._events[t].length:0}},{}],64:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],65:[function(e,t,r){function a(){}var o=t.exports={};o.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var r=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),r.length>0)){var a=r.shift();a()}},!0),function(e){r.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=a,o.addListener=a,o.once=a,o.off=a,o.removeListener=a,o.removeAllListeners=a,o.emit=a,o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],66:[function(e,t,r){(function(e){!function(a){function o(e){throw RangeError(w[e])}function n(e,t){for(var r=e.length;r--;)e[r]=t(e[r]);return e}function i(e,t){return n(e.split(P),t).join(".")}function s(e){for(var t,r,a=[],o=0,n=e.length;n>o;)t=e.charCodeAt(o++),t>=55296&&56319>=t&&n>o?(r=e.charCodeAt(o++),56320==(64512&r)?a.push(((1023&t)<<10)+(1023&r)+65536):(a.push(t),o--)):a.push(t);return a}function u(e){return n(e,function(e){var t="";return e>65535&&(e-=65536,t+=B(e>>>10&1023|55296),e=56320|1023&e),t+=B(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:v}function p(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function m(e,t,r){var a=0;for(e=r?M(e/T):e>>1,e+=M(e/t);e>L*R>>1;a+=v)e=M(e/L);return M(a+(L+1)*e/(e+C))}function l(e){var t,r,a,n,i,s,p,l,d,y,h=[],b=e.length,f=0,g=A,N=D;for(r=e.lastIndexOf(q),0>r&&(r=0),a=0;r>a;++a)e.charCodeAt(a)>=128&&o("not-basic"),h.push(e.charCodeAt(a));for(n=r>0?r+1:0;b>n;){for(i=f,s=1,p=v;n>=b&&o("invalid-input"),l=c(e.charCodeAt(n++)),(l>=v||l>M((I-f)/s))&&o("overflow"),f+=l*s,d=N>=p?k:p>=N+R?R:p-N,!(d>l);p+=v)y=v-d,s>M(I/y)&&o("overflow"),s*=y;t=h.length+1,N=m(f-i,t,0==i),M(f/t)>I-g&&o("overflow"),g+=M(f/t),f%=t,h.splice(f++,0,g)}return u(h)}function d(e){var t,r,a,n,i,u,c,l,d,y,h,b,f,g,N,S=[];for(e=s(e),b=e.length,t=A,r=0,i=D,u=0;b>u;++u)h=e[u],128>h&&S.push(B(h));for(a=n=S.length,n&&S.push(q);b>a;){for(c=I,u=0;b>u;++u)h=e[u],h>=t&&c>h&&(c=h);for(f=a+1,c-t>M((I-r)/f)&&o("overflow"),r+=(c-t)*f,t=c,u=0;b>u;++u)if(h=e[u],t>h&&++r>I&&o("overflow"),h==t){for(l=r,d=v;y=i>=d?k:d>=i+R?R:d-i,!(y>l);d+=v)N=l-y,g=v-y,S.push(B(p(y+N%g,0))),l=M(N/g);S.push(B(p(l,0))),i=m(r,f,a==n),r=0,++a}++r,++t}return S.join("")}function y(e){return i(e,function(e){return E.test(e)?l(e.slice(4).toLowerCase()):e})}function h(e){return i(e,function(e){return x.test(e)?"xn--"+d(e):e})}var b="object"==typeof r&&r,f="object"==typeof t&&t&&t.exports==b&&t,g="object"==typeof e&&e;(g.global===g||g.window===g)&&(a=g);var N,S,I=2147483647,v=36,k=1,R=26,C=38,T=700,D=72,A=128,q="-",E=/^xn--/,x=/[^ -~]/,P=/\x2E|\u3002|\uFF0E|\uFF61/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=v-k,M=Math.floor,B=String.fromCharCode;if(N={version:"1.2.4",ucs2:{decode:s,encode:u},decode:l,encode:d,toASCII:h,toUnicode:y},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return N});else if(b&&!b.nodeType)if(f)f.exports=N;else for(S in N)N.hasOwnProperty(S)&&(b[S]=N[S]);else a.punycode=N}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],67:[function(e,t,r){"use strict";function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var s=/\+/g;e=e.split(t);var u=1e3;n&&"number"==typeof n.maxKeys&&(u=n.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var p=0;c>p;++p){var m,l,d,y,h=e[p].replace(s,"%20"),b=h.indexOf(r);b>=0?(m=h.substr(0,b),l=h.substr(b+1)):(m=h,l=""),d=decodeURIComponent(m),y=decodeURIComponent(l),a(i,d)?o(i[d])?i[d].push(y):i[d]=[i[d],y]:i[d]=y}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],68:[function(e,t,r){"use strict";function a(e,t){if(e.map)return e.map(t);for(var r=[],a=0;a",'"',"`"," ","\r","\n"," "],b=["{","}","|","\\","^","`"].concat(h),f=["'"].concat(b),g=["%","/","?",";","#"].concat(f),N=["/","?","#"],S=255,I=/^[a-z0-9A-Z_-]{0,63}$/,v=/^([a-z0-9A-Z_-]{0,63})(.*)$/,k={javascript:!0,"javascript:":!0},R={javascript:!0,"javascript:":!0},C={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=e("querystring");a.prototype.parse=function(e,t,r){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e;a=a.trim();var o=d.exec(a);if(o){o=o[0];var n=o.toLowerCase();this.protocol=n,a=a.substr(o.length)}if(r||o||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var i="//"===a.substr(0,2);!i||o&&R[o]||(a=a.substr(2),this.slashes=!0)}if(!R[o]&&(i||o&&!C[o])){for(var s=-1,c=0;cp)&&(s=p)}var m,y;y=-1===s?a.lastIndexOf("@"):a.lastIndexOf("@",s),-1!==y&&(m=a.slice(0,y),a=a.slice(y+1),this.auth=decodeURIComponent(m)),s=-1;for(var c=0;cp)&&(s=p)}-1===s&&(s=a.length),this.host=a.slice(0,s),a=a.slice(s),this.parseHost(),this.hostname=this.hostname||"";var h="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!h)for(var b=this.hostname.split(/\./),c=0,D=b.length;D>c;c++){var A=b[c];if(A&&!A.match(I)){for(var q="",E=0,x=A.length;x>E;E++)q+=A.charCodeAt(E)>127?"x":A[E];if(!q.match(I)){var P=b.slice(0,c),w=b.slice(c+1),L=A.match(v);L&&(P.push(L[1]),w.unshift(L[2])),w.length&&(a="/"+w.join(".")+a),this.hostname=P.join(".");break}}}if(this.hostname.length>S?this.hostname="":this.hostname=this.hostname.toLowerCase(),!h){for(var M=this.hostname.split("."),B=[],c=0;cc;c++){var z=f[c],F=encodeURIComponent(z);F===z&&(F=escape(z)),a=a.split(z).join(F)}var O=a.indexOf("#");-1!==O&&(this.hash=a.substr(O),a=a.slice(0,O));var G=a.indexOf("?");if(-1!==G?(this.search=a.substr(G),this.query=a.substr(G+1),t&&(this.query=T.parse(this.query)),a=a.slice(0,G)):t&&(this.search="",this.query={}),a&&(this.pathname=a),C[n]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var _=this.pathname||"",U=this.search||"";this.path=_+U}return this.href=this.format(),this},a.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",a=this.hash||"",o=!1,n="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(n=T.stringify(this.query));var i=this.search||n&&"?"+n||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||C[t])&&o!==!1?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),a&&"#"!==a.charAt(0)&&(a="#"+a),i&&"?"!==i.charAt(0)&&(i="?"+i),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),i=i.replace("#","%23"),t+o+r+i+a},a.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},a.prototype.resolveObject=function(e){if(u(e)){var t=new a;t.parse(e,!1,!0),e=t}var r=new a;if(Object.keys(this).forEach(function(e){r[e]=this[e]},this),r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(r[t]=e[t])}),C[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(e.protocol&&e.protocol!==r.protocol){if(!C[e.protocol])return Object.keys(e).forEach(function(t){r[t]=e[t]}),r.href=r.format(),r;if(r.protocol=e.protocol,e.host||R[e.protocol])r.pathname=e.pathname;else{for(var o=(e.pathname||"").split("/");o.length&&!(e.host=o.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==o[0]&&o.unshift(""),o.length<2&&o.unshift(""),r.pathname=o.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var n=r.pathname||"",i=r.search||"";r.path=n+i}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var s=r.pathname&&"/"===r.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),l=c||s||r.host&&e.pathname,d=l,y=r.pathname&&r.pathname.split("/")||[],o=e.pathname&&e.pathname.split("/")||[],h=r.protocol&&!C[r.protocol];if(h&&(r.hostname="",r.port=null,r.host&&(""===y[0]?y[0]=r.host:y.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===o[0]?o[0]=e.host:o.unshift(e.host)),e.host=null),l=l&&(""===o[0]||""===y[0])),c)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,y=o;else if(o.length)y||(y=[]),y.pop(),y=y.concat(o),r.search=e.search,r.query=e.query;else if(!m(e.search)){if(h){r.hostname=r.host=y.shift();var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.host=r.hostname=b.shift())}return r.search=e.search,r.query=e.query,p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!y.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var f=y.slice(-1)[0],g=(r.host||e.host)&&("."===f||".."===f)||""===f,N=0,S=y.length;S>=0;S--)f=y[S],"."==f?y.splice(S,1):".."===f?(y.splice(S,1),N++):N&&(y.splice(S,1),N--);if(!l&&!d)for(;N--;N)y.unshift("..");!l||""===y[0]||y[0]&&"/"===y[0].charAt(0)||y.unshift(""),g&&"/"!==y.join("/").substr(-1)&&y.push("");var I=""===y[0]||y[0]&&"/"===y[0].charAt(0);if(h){r.hostname=r.host=I?"":y.length?y.shift():"";var b=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;b&&(r.auth=b.shift(),r.host=r.hostname=b.shift())}return l=l||r.host&&y.length,l&&!I&&y.unshift(""),y.length?r.pathname=y.join("/"):(r.pathname=null,r.path=null),p(r.pathname)&&p(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},a.prototype.parseHost=function(){var e=this.host,t=y.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:66,querystring:69}],71:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],72:[function(e,t,r){(function(t,a){function o(e,t){var a={seen:[],stylize:i};return arguments.length>=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),h(t)?a.showHidden=t:t&&r._extend(a,t),I(a.showHidden)&&(a.showHidden=!1),I(a.depth)&&(a.depth=2),I(a.colors)&&(a.colors=!1),I(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=n),u(a,e,a.depth)}function n(e,t){var r=o.styles[t];return r?"["+o.colors[r][0]+"m"+e+"["+o.colors[r][1]+"m":e}function i(e,t){return e}function s(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function u(e,t,a){if(e.customInspect&&t&&T(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(a,e);return N(o)||(o=u(e,o,a)),o}var n=c(e,t);if(n)return n;var i=Object.keys(t),h=s(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),C(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return p(t);if(0===i.length){if(T(t)){var b=t.name?": "+t.name:"";return e.stylize("[Function"+b+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(R(t))return e.stylize(Date.prototype.toString.call(t),"date");if(C(t))return p(t)}var f="",g=!1,S=["{","}"];if(y(t)&&(g=!0,S=["[","]"]),T(t)){var I=t.name?": "+t.name:"";f=" [Function"+I+"]"}if(v(t)&&(f=" "+RegExp.prototype.toString.call(t)),R(t)&&(f=" "+Date.prototype.toUTCString.call(t)),C(t)&&(f=" "+p(t)),0===i.length&&(!g||0==t.length))return S[0]+f+S[1];if(0>a)return v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=g?m(e,t,a,h,i):i.map(function(r){return l(e,t,a,h,r,g)}),e.seen.pop(),d(k,f,S)}function c(e,t){if(I(t))return e.stylize("undefined","undefined");if(N(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function m(e,t,r,a,o){for(var n=[],i=0,s=t.length;s>i;++i)x(t,String(i))?n.push(l(e,t,r,a,String(i),!0)):n.push("");return o.forEach(function(o){o.match(/^\d+$/)||n.push(l(e,t,r,a,o,!0))}),n}function l(e,t,r,a,o,n){var i,s,c;if(c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},c.get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),x(a,o)||(i="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=b(r)?u(e,c.value,null):u(e,c.value,r-1),s.indexOf("\n")>-1&&(s=n?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),I(i)){if(n&&o.match(/^\d+$/))return s;i=JSON.stringify(""+o),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+s}function d(e,t,r){var a=0,o=e.reduce(function(e,t){return a++,t.indexOf("\n")>=0&&a++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function y(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function b(e){return null===e}function f(e){return null==e}function g(e){return"number"==typeof e}function N(e){return"string"==typeof e}function S(e){return"symbol"==typeof e}function I(e){return void 0===e}function v(e){return k(e)&&"[object RegExp]"===A(e)}function k(e){return"object"==typeof e&&null!==e}function R(e){return k(e)&&"[object Date]"===A(e)}function C(e){return k(e)&&("[object Error]"===A(e)||e instanceof Error)}function T(e){return"function"==typeof e}function D(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function A(e){return Object.prototype.toString.call(e)}function q(e){return 10>e?"0"+e.toString(10):e.toString(10)}function E(){var e=new Date,t=[q(e.getHours()),q(e.getMinutes()),q(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=/%[sdj%]/g;r.format=function(e){if(!N(e)){for(var t=[],r=0;r=n)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(t){return"[Circular]"}default:return e}}),s=a[r];n>r;s=a[++r])i+=b(s)||!k(s)?" "+s:" "+o(s);return i},r.deprecate=function(e,o){function n(){if(!i){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),i=!0}return e.apply(this,arguments)}if(I(a.process))return function(){return r.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var i=!1;return n};var w,L={};r.debuglog=function(e){if(I(w)&&(w=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(w)){var a=t.pid;L[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,a,t)}}else L[e]=function(){};return L[e]},r.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=y,r.isBoolean=h,r.isNull=b,r.isNullOrUndefined=f,r.isNumber=g,r.isString=N,r.isSymbol=S,r.isUndefined=I,r.isRegExp=v,r.isObject=k,r.isDate=R,r.isError=C,r.isFunction=T,r.isPrimitive=D,r.isBuffer=e("./support/isBuffer");var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];r.log=function(){console.log("%s - %s",E(),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e}}).call(this,e("FWaASH"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":71,FWaASH:65,inherits:64}],73:[function(e,t,r){(function(){var r,a;a=e("./XMLFragment"),r=function(){function e(e,t,r){var o,n,i;if(this.children=[],this.rootObject=null,this.is(e,"Object")&&(i=[e,t],t=i[0],r=i[1],e=null),null!=e&&(e=""+e||"",null==t&&(t={version:"1.0"})),null!=t&&null==t.version)throw new Error("Version number is required");if(null!=t){if(t.version=""+t.version||"",!t.version.match(/1\.[0-9]+/))throw new Error("Invalid version number: "+t.version);if(o={version:t.version},null!=t.encoding){if(t.encoding=""+t.encoding||"",!t.encoding.match(/[A-Za-z](?:[A-Za-z0-9._-]|-)*/))throw new Error("Invalid encoding: "+t.encoding);o.encoding=t.encoding}null!=t.standalone&&(o.standalone=t.standalone?"yes":"no"),n=new a(this,"?xml",o),this.children.push(n)}null!=r&&(o={},null!=e&&(o.name=e),null!=r.ext&&(r.ext=""+r.ext||"",o.ext=r.ext),n=new a(this,"!DOCTYPE",o),this.children.push(n)),null!=e&&this.begin(e)}return e.prototype.begin=function(t,r,o){var n,i;if(null==t)throw new Error("Root element needs a name");return this.rootObject&&(this.children=[],this.rootObject=null),null!=r?(n=new e(t,r,o),n.root()):(t=""+t||"",i=new a(this,t,{}),i.isRoot=!0,i.documentObject=this,this.children.push(i),this.rootObject=i,i)},e.prototype.root=function(){return this.rootObject},e.prototype.end=function(e){return toString(e)},e.prototype.toString=function(e){var t,r,a,o,n;for(r="",n=this.children,a=0,o=n.length;o>a;a++)t=n[a],r+=t.toString(e);return r},e.prototype.is=function(e,t){var r;return r=Object.prototype.toString.call(e).slice(8,-1),null!=e&&r===t},e}(),t.exports=r}).call(this)},{"./XMLFragment":74}],74:[function(e,t,r){(function(){var e,r={}.hasOwnProperty;e=function(){function e(e,t,r,a){this.isRoot=!1,this.documentObject=null,this.parent=e,this.name=t,this.attributes=r,this.value=a,this.children=[]}return e.prototype.element=function(t,a,o){var n,i,s,u,c;if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(u=[o,a],a=u[0],o=u[1]):this.is(a,"String")&&(c=[{},a],a=c[0],o=c[1]);for(i in a)r.call(a,i)&&(s=a[i],s=""+s||"",a[i]=this.escape(s));return n=new e(this,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),this.children.push(n),n},e.prototype.insertBefore=function(t,a,o){var n,i,s,u,c,p;if(this.isRoot)throw new Error("Cannot insert elements at root level");if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(c=[o,a],a=c[0],o=c[1]):this.is(a,"String")&&(p=[{},a],a=p[0],o=p[1]);for(s in a)r.call(a,s)&&(u=a[s],u=""+u||"",a[s]=this.escape(u));return n=new e(this.parent,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),i=this.parent.children.indexOf(this),this.parent.children.splice(i,0,n),n},e.prototype.insertAfter=function(t,a,o){var n,i,s,u,c,p;if(this.isRoot)throw new Error("Cannot insert elements at root level");if(null==t)throw new Error("Missing element name");t=""+t||"",this.assertLegalChar(t),null==a&&(a={}),this.is(a,"String")&&this.is(o,"Object")?(c=[o,a],a=c[0],o=c[1]):this.is(a,"String")&&(p=[{},a],a=p[0],o=p[1]);for(s in a)r.call(a,s)&&(u=a[s],u=""+u||"", +a[s]=this.escape(u));return n=new e(this.parent,t,a),null!=o&&(o=""+o||"",o=this.escape(o),this.assertLegalChar(o),n.raw(o)),i=this.parent.children.indexOf(this),this.parent.children.splice(i+1,0,n),n},e.prototype.remove=function(){var e,t;if(this.isRoot)throw new Error("Cannot remove the root element");return e=this.parent.children.indexOf(this),[].splice.apply(this.parent.children,[e,e-e+1].concat(t=[])),t,this.parent},e.prototype.text=function(t){var r;if(null==t)throw new Error("Missing element text");return t=""+t||"",t=this.escape(t),this.assertLegalChar(t),r=new e(this,"",{},t),this.children.push(r),this},e.prototype.cdata=function(t){var r;if(null==t)throw new Error("Missing CDATA text");if(t=""+t||"",this.assertLegalChar(t),t.match(/]]>/))throw new Error("Invalid CDATA text: "+t);return r=new e(this,"",{},""),this.children.push(r),this},e.prototype.comment=function(t){var r;if(null==t)throw new Error("Missing comment text");if(t=""+t||"",t=this.escape(t),this.assertLegalChar(t),t.match(/--/))throw new Error("Comment text cannot contain double-hypen: "+t);return r=new e(this,"",{},""),this.children.push(r),this},e.prototype.raw=function(t){var r;if(null==t)throw new Error("Missing raw text");return t=""+t||"",r=new e(this,"",{},t),this.children.push(r),this},e.prototype.up=function(){if(this.isRoot)throw new Error("This node has no parent. Use doc() if you need to get the document object.");return this.parent},e.prototype.root=function(){var e;if(this.isRoot)return this;for(e=this.parent;!e.isRoot;)e=e.parent;return e},e.prototype.document=function(){return this.root().documentObject},e.prototype.end=function(e){return this.document().toString(e)},e.prototype.prev=function(){var e;if(this.isRoot)throw new Error("Root node has no siblings");if(e=this.parent.children.indexOf(this),1>e)throw new Error("Already at the first node");return this.parent.children[e-1]},e.prototype.next=function(){var e;if(this.isRoot)throw new Error("Root node has no siblings");if(e=this.parent.children.indexOf(this),-1===e||e===this.parent.children.length-1)throw new Error("Already at the last node");return this.parent.children[e+1]},e.prototype.clone=function(t){var r;return r=new e(this.parent,this.name,this.attributes,this.value),t&&this.children.forEach(function(e){var a;return a=e.clone(t),a.parent=r,r.children.push(a)}),r},e.prototype.importXMLBuilder=function(e){var t;return t=e.root().clone(!0),t.parent=this,this.children.push(t),t.isRoot=!1,this},e.prototype.attribute=function(e,t){var r;if(null==e)throw new Error("Missing attribute name");if(null==t)throw new Error("Missing attribute value");return e=""+e||"",t=""+t||"",null==(r=this.attributes)&&(this.attributes={}),this.attributes[e]=this.escape(t),this},e.prototype.removeAttribute=function(e){if(null==e)throw new Error("Missing attribute name");return e=""+e||"",delete this.attributes[e],this},e.prototype.toString=function(e,t){var r,a,o,n,i,s,u,c,p,m,l,d;s=null!=e&&e.pretty||!1,n=null!=e&&e.indent||" ",i=null!=e&&e.newline||"\n",t||(t=0),c=new Array(t+1).join(n),u="",s&&(u+=c),u+=null==this.value?"<"+this.name:""+this.value,l=this.attributes;for(r in l)a=l[r],u+="!DOCTYPE"===this.name?" "+a:" "+r+'="'+a+'"';if(0===this.children.length)null==this.value&&(u+="?xml"===this.name?"?>":"!DOCTYPE"===this.name?">":"/>"),s&&(u+=i);else if(s&&1===this.children.length&&this.children[0].value)u+=">",u+=this.children[0].value,u+="",u+=i;else{for(u+=">",s&&(u+=i),d=this.children,p=0,m=d.length;m>p;p++)o=d[p],u+=o.toString(e,t+1);s&&(u+=c),u+="",s&&(u+=i)}return u},e.prototype.escape=function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},e.prototype.assertLegalChar=function(e){var t,r;if(t=/[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/,r=e.match(t))throw new Error("Invalid character ("+r+") in string: "+e)},e.prototype.is=function(e,t){var r;return r=Object.prototype.toString.call(e).slice(8,-1),null!=e&&r===t},e.prototype.ele=function(e,t,r){return this.element(e,t,r)},e.prototype.txt=function(e){return this.text(e)},e.prototype.dat=function(e){return this.cdata(e)},e.prototype.att=function(e,t){return this.attribute(e,t)},e.prototype.com=function(e){return this.comment(e)},e.prototype.doc=function(){return this.document()},e.prototype.e=function(e,t,r){return this.element(e,t,r)},e.prototype.t=function(e){return this.text(e)},e.prototype.d=function(e){return this.cdata(e)},e.prototype.a=function(e,t){return this.attribute(e,t)},e.prototype.c=function(e){return this.comment(e)},e.prototype.r=function(e){return this.raw(e)},e.prototype.u=function(){return this.up()},e}(),t.exports=e}).call(this)},{}],75:[function(e,t,r){(function(){var r;r=e("./XMLBuilder"),t.exports.create=function(e,t,a){return null!=e?new r(e,t,a).root():new r}}).call(this)},{"./XMLBuilder":73}]},{},[1]); diff --git a/doc-src/guide/browser-building.md b/doc-src/guide/browser-building.md index 34706653c8..3a5b60a9df 100644 --- a/doc-src/guide/browser-building.md +++ b/doc-src/guide/browser-building.md @@ -22,7 +22,7 @@ First, clone the repository from GitHub and cd into the directory: ```bash git clone git://github.com/aws/aws-sdk-js cd aws-sdk-js -git checkout v2.1.36 +git checkout v2.1.37 ``` After you have cloned the repository, you need to download the dependency modules diff --git a/doc-src/guide/browser-examples.md b/doc-src/guide/browser-examples.md index 76e2780e04..23034361ac 100644 --- a/doc-src/guide/browser-examples.md +++ b/doc-src/guide/browser-examples.md @@ -7,7 +7,7 @@ and authenticated with the correct credentials. The common preamble code can be summarized as follows: - + + You can also download this package by clicking the following link: -[aws-sdk-2.1.36.min.js](https://sdk.amazonaws.com/js/aws-sdk-2.1.36.min.js) +[aws-sdk-2.1.37.min.js](https://sdk.amazonaws.com/js/aws-sdk-2.1.37.min.js) ## Using Bower diff --git a/lib/core.js b/lib/core.js index e53a969eef..a2c0d262c4 100644 --- a/lib/core.js +++ b/lib/core.js @@ -17,7 +17,7 @@ AWS.util.update(AWS, { /** * @constant */ - VERSION: '2.1.36', + VERSION: '2.1.37', /** * @api private diff --git a/package.json b/package.json index 3be7f3d50f..95f696ab84 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "aws-sdk", "description": "AWS SDK for JavaScript", - "version": "2.1.36", + "version": "2.1.37", "author": { "name":"Amazon Web Services", "email":"",