-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamazon-connect-chat.js
2 lines (2 loc) · 293 KB
/
amazon-connect-chat.js
1
2
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function o(e){return function(e,t){var n,r,s,a,c,u,l,p,h,f=1,d=e.length,m="";for(r=0;r<d;r++)if("string"==typeof e[r])m+=e[r];else if("object"==typeof e[r]){if((a=e[r]).keys)for(n=t[f],s=0;s<a.keys.length;s++){if(null==n)throw new Error(o('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[s],a.keys[s-1]));n=n[a.keys[s]]}else n=a.param_no?t[a.param_no]:t[f++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&n instanceof Function&&(n=n()),i.numeric_arg.test(a.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(o("[sprintf] expecting number but found %T",n));switch(i.number.test(a.type)&&(p=n>=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?m+=n:(!i.number.test(a.type)||p&&!a.sign?h="":(h=p?"+":"-",n=n.toString().replace(i.sign,"")),u=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",l=a.width-(h+n).length,c=a.width&&l>0?u.repeat(l):"",m+=a.align?h+n+c:"0"===u?h+c+n:c+h+n)}return m}(function(e){if(a[e])return a[e];var t,n=e,r=[],o=0;for(;n;){if(null!==(t=i.text.exec(n)))r.push(t[0]);else if(null!==(t=i.modulo.exec(n)))r.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){o|=1;var s=[],c=t[2],u=[];if(null===(u=i.key.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(c=c.substring(u[0].length));)if(null!==(u=i.key_access.exec(c)))s.push(u[1]);else{if(null===(u=i.index_access.exec(c)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}t[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return a[e]=r}(e),arguments)}function s(e,t){return o.apply(null,[e].concat(t||[]))}var a=Object.create(null);t.sprintf=o,t.vsprintf=s,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(r=function(){return{sprintf:o,vsprintf:s}}.call(t,n,t,e))||(e.exports=r))}()},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function a(e){var t="function"==typeof Map?new Map:void 0;return(a=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),u(r,e)})(e)}function c(e,t,n){return(c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&u(i,n.prototype),i}).apply(null,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var p=function(e){function t(e){var n;return i(this,t),(n=o(this,l(t).call(this,e))).name="ValueError",console.log("EXCEPTION: "+n.name+" MESSAGE: "+n.message),n}return s(t,e),t}(a(Error)),h=function(e){function t(e){var n;return i(this,t),(n=o(this,l(t).call(this,e))).name="UnImplementedMethod",console.log("EXCEPTION: "+n.name+" MESSAGE: "+n.message),n}return s(t,e),t}(a(Error)),f=function(e){function t(e,n){var r;return i(this,t),(r=o(this,l(t).call(this,e))).name="IllegalArgument",r.argument=n,console.log("EXCEPTION: "+r.name+" MESSAGE: "+r.message),r}return s(t,e),t}(a(Error));a(Error),a(Error);function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var m=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{key:"update",value:function(e){var t=e||{};this.region=t.region||this.region,this.endpointOverride=t.endpoint||this.endpointOverride,this.reconnect=!1!==t.reconnect}},{key:"getRegion",value:function(){return this.region}},{key:"getEndpointOverride",value:function(){return this.endpointOverride}}])&&d(t.prototype,n),r&&d(t,r),e}()),g={"us-west-2":{invokeUrl:"https://participant.connect.us-west-2.amazonaws.com"},"us-east-1":{invokeUrl:"https://participant.connect.us-east-1.amazonaws.com"},"ap-south-1":{invokeUrl:"https://participant.connect.ap-south-1.amazonaws.com"},"ap-southeast-1":{invokeUrl:"https://participant.connect.ap-southeast-1.amazonaws.com"},"ap-southeast-2":{invokeUrl:"https://participant.connect.ap-southeast-2.amazonaws.com"},"ap-northeast-1":{invokeUrl:"https://participant.connect.ap-northeast-1.amazonaws.com"},"eu-central-1":{invokeUrl:"https://participant.connect.eu-central-1.amazonaws.com"},"eu-west-2":{invokeUrl:"https://participant.connect.eu-west-2.amazonaws.com"}},y={AGENT:"AGENT",CUSTOMER:"CUSTOMER"},v="INCOMING_MESSAGE",b="INCOMING_TYPING",w="CONNECTION_ESTABLISHED",S="CONNECTION_LOST",E="CONNECTION_BROKEN",C="CHAT_ENDED",_={textPlain:"text/plain",connectionAcknowledged:"application/vnd.amazonaws.connect.event.connection.acknowledged",typing:"application/vnd.amazonaws.connect.event.typing",participantJoined:"application/vnd.amazonaws.connect.event.participant.joined",participantLeft:"application/vnd.amazonaws.connect.event.participant.left",transferSucceeded:"application/vnd.amazonaws.connect.event.transfer.succeeded",transferFailed:"application/vnd.amazonaws.connect.event.transfer.failed",chatEnded:"application/vnd.amazonaws.connect.event.chat.ended"},k=15,T="ASCENDING",x="BACKWARD",R="NULL",A="CLIENT_LOGGER",I="DEBUG",P="us-west-2",O=n(1);function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var N={assertTrue:function(e,t){if(!e)throw new p(t)},assertNotNull:function(e,t){return N.assertTrue(null!==e&&void 0!==L(e),Object(O.sprintf)("%s must be provided",t||"A value")),e},now:function(){return(new Date).getTime()},isString:function(e){return"string"==typeof e},randomId:function(){return Object(O.sprintf)("%s-%s",N.now(),Math.random().toString(36).slice(2))},assertIsNonEmptyString:function(e,t){if(!e||"string"!=typeof e)throw new f(t+" is not a non-empty string!")},assertIsList:function(e,t){if(!Array.isArray(e))throw new f(t+" is not an array")},assertIsEnum:function(e,t,n){var r;for(r=0;r<t.length;r++)if(t[r]===e)return;throw new f(n+" passed is not valid. Allowed values are: "+t)},makeEnum:function(e){var t={};return e.forEach((function(e){var n=e.replace(/\.?([a-z]+)_?/g,(function(e,t){return t.toUpperCase()+"_"})).replace(/_$/,"");t[n]=e})),t},contains:function(e,t){return e instanceof Array?null!==N.find(e,(function(e){return e===t})):t in e},find:function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},containsValue:function(e,t){return e instanceof Array?null!==N.find(e,(function(e){return e===t})):null!==N.find(N.values(e),(function(e){return e===t}))},isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},values:function(e){var t=[];for(var n in N.assertNotNull(e,"map"),e)t.push(e[n]);return t},isObject:function(e){return!("object"!==L(e)||null===e)},assertIsObject:function(e,t){if(!N.isObject(e))throw new f(t+" is not an object!")},delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))},asyncWhileInterval:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,o=new Date;return t(r)?e(r).catch((function(i){var s=Math.max(0,n-(new Date).valueOf()+o.valueOf());return N.delay(s).then((function(){return N.asyncWhileInterval(e,t,n,r+1,i)}))})):Promise.reject(i||new Error("async while aborted"))}},q=N;function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e,t){return(U=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function H(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),e}var z=function(){function e(){B(this,e)}return H(e,[{key:"debug",value:function(e){}},{key:"info",value:function(e){}},{key:"warn",value:function(e){}},{key:"error",value:function(e){}}]),e}(),W={DEBUG:10,INFO:20,WARN:30,ERROR:40},V=function(){function e(){B(this,e),this.updateLoggerConfig(),this.consoleLoggerWrapper=X()}return H(e,[{key:"writeToClientLogger",value:function(e,t){if(this.hasClientLogger())switch(e){case W.DEBUG:return this._clientLogger.debug(t);case W.INFO:return this._clientLogger.info(t);case W.WARN:return this._clientLogger.warn(t);case W.ERROR:return this._clientLogger.error(t)}}},{key:"isLevelEnabled",value:function(e){return e>=this._level}},{key:"hasClientLogger",value:function(){return null!==this._clientLogger}},{key:"getLogger",value:function(e){var t=e.prefix||"";return this._logsDestination===I?this.consoleLoggerWrapper:new K(t)}},{key:"updateLoggerConfig",value:function(e){var t=e||{};this._level=t.level||W.INFO,this._clientLogger=t.logger||null,this._logsDestination=R,t.debug&&(this._logsDestination=I),t.logger&&(this._logsDestination=A)}}]),e}(),G=function(){function e(){B(this,e)}return H(e,[{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),K=function(e){function t(e){var n;return B(this,t),(n=j(this,M(t).call(this))).prefix=e||"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&U(e,t)}(t,e),H(t,[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(W.DEBUG,t)}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(W.INFO,t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(W.WARN,t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(W.ERROR,t)}},{key:"_shouldLog",value:function(e){return Y.hasClientLogger()&&Y.isLevelEnabled(e)}},{key:"_writeToClientLogger",value:function(e,t){Y.writeToClientLogger(e,t)}},{key:"_log",value:function(e,t){if(this._shouldLog(e)){var n=this._convertToSingleStatement(t);this._writeToClientLogger(e,n)}}},{key:"_convertToSingleStatement",value:function(e){var t="";this.prefix&&(t+=this.prefix+" ");for(var n=0;n<e.length;n++){var r=e[n];t+=this._convertToString(r)+" "}return t}},{key:"_convertToString",value:function(e){try{if(!e)return"";if(q.isString(e))return e;if(q.isObject(e)&&q.isFunction(e.toString)){var t=e.toString();if("[object Object]"!==t)return t}return JSON.stringify(e)}catch(t){return console.error("Error while converting argument to string",e,t),""}}}]),t}(G),X=function(){var e=new G;return e.debug=console.debug.bind(window.console),e.info=console.info.bind(window.console),e.warn=console.warn.bind(window.console),e.error=console.error.bind(window.console),e},Y=new V;n(6);function J(e){return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){return!t||"object"!==J(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Q(e){return(Q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Z(e,t){return(Z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ne(e,t,n){return t&&te(e.prototype,t),n&&te(e,n),e}var re=function(){function e(){ee(this,e),this.clientCache={}}return ne(e,[{key:"getCachedClient",value:function(e){var t=Object.assign({},e),n=e.region||m.getRegion()||P;if(t.region=n,this.clientCache[n])return this.clientCache[n];var r=this._createAwsClient(t);return this.clientCache[n]=r,r}},{key:"_createAwsClient",value:function(e){var t=e.region,n=m.getEndpointOverride(),r=g[t];return n&&(r.invokeUrl=n),new ie({endpoint:r.invokeUrl,region:t})}}]),e}(),ie=function(e){function t(e){var n;ee(this,t),n=$(this,Q(t).call(this));var r=new AWS.Credentials("",""),i=new AWS.Config({region:e.region,endpoint:e.endpoint,credentials:r});return n.chatClient=new AWS.ConnectParticipant(i),n.invokeUrl=e.endpoint,n.logger=Y.getLogger({prefix:"ChatClient"}),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Z(e,t)}(t,e),ne(t,[{key:"createParticipantConnection",value:function(e,t){var n=this,r={Type:t,ParticipantToken:e},i=n.chatClient.createParticipantConnection(r);return n._sendRequest(i).then((function(e){return n.logger.info("successfully create connection request"),e})).catch((function(e){return n.logger.error("error when creating connection request"),Promise.reject(e)}))}},{key:"disconnectParticipant",value:function(e){var t=this,n={ConnectionToken:e},r=t.chatClient.disconnectParticipant(n);return t._sendRequest(r).then((function(e){return t.logger.info("successfully disconnect participant"),e})).catch((function(e){return t.logger.error("error when disconnecting participant"),Promise.reject(e)}))}},{key:"getTranscript",value:function(e,t){var n=this,r={MaxResults:t.maxResults,NextToken:t.nextToken,ScanDirection:t.scanDirection,SortOrder:t.sortOrder,StartPosition:{Id:t.startPosition.id,AbsoluteTime:t.startPosition.absoluteTime,MostRecent:t.startPosition.mostRecent},ConnectionToken:e};t.contactId&&(r.ContactId=t.contactId);var i=n.chatClient.getTranscript(r);return n._sendRequest(i).then((function(e){return n.logger.info("successfully get transcript"),e})).catch((function(e){return n.logger.error("error when getting transcript"),Promise.reject(e)}))}},{key:"sendMessage",value:function(e,t,n){var r=this,i={Content:t,ContentType:n,ConnectionToken:e},o=r.chatClient.sendMessage(i);return r._sendRequest(o).then((function(e){return r.logger.info("successfully send message"),e})).catch((function(e){return r.logger.error("error when sending message"),Promise.reject(e)}))}},{key:"sendEvent",value:function(e,t,n){var r=this,i={ConnectionToken:e,ContentType:t,Content:n},o=r.chatClient.sendEvent(i);return r._sendRequest(o).then((function(e){return r.logger.info("successfully send event"),e})).catch((function(e){return r.logger.error("error when sending event"),Promise.reject(e)}))}},{key:"_sendRequest",value:function(e){return new Promise((function(t,n){e.on("success",(function(e){t(e)})).on("error",(function(e){var t={type:e.code,message:e.message,stack:e.stack?e.stack.split("\n"):[]};n(t)})).send()}))}}]),t}(function(){function e(){ee(this,e)}return ne(e,[{key:"sendMessage",value:function(e,t,n){throw new h("sendTextMessage in ChatClient")}},{key:"disconnectParticipant",value:function(e){throw new h("disconnectParticipant in ChatClient")}},{key:"sendEvent",value:function(e,t,n){throw new h("sendEvent in ChatClient")}},{key:"createParticipantConnection",value:function(e,t){throw new h("createParticipantConnection in ChatClient")}}]),e}()),oe=new re;function se(e){return(se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ae(e,t){return!t||"object"!==se(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ce(e){return(ce=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ue(e,t){return(ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function he(e,t,n){return t&&pe(e.prototype,t),n&&pe(e,n),e}var fe=function(e){function t(){return le(this,t),ae(this,ce(t).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ue(e,t)}(t,e),he(t,[{key:"validateChatDetails",value:function(e){q.assertIsObject(e,"chatDetails"),q.assertIsNonEmptyString(e.contactId,"chatDetails.contactId"),q.assertIsNonEmptyString(e.participantId,"chatDetails.participantId"),e.connectionDetails?(q.assertIsObject(e.connectionDetails,"chatDetails.connectionDetails"),q.assertIsNonEmptyString(e.connectionDetails.PreSignedConnectionUrl,"chatDetails.connectionDetails.PreSignedConnectionUrl"),q.assertIsNonEmptyString(e.connectionDetails.ConnectionId,"chatDetails.connectionDetails.ConnectionId"),q.assertIsNonEmptyString(e.connectionDetails.connectionToken,"chatDetails.connectionDetails.connectionToken")):e.participantToken&&q.assertIsNonEmptyString(e.participantToken,"chatDetails.participantToken")}},{key:"validateInitiateChatResponse",value:function(){return!0}},{key:"normalizeChatDetails",value:function(e){var t={};if(t.contactId=e.ContactId||e.contactId,t.participantId=e.ParticipantId||e.participantId,t.initialContactId=e.InitialContactId||e.initialContactId||t.contactId||t.ContactId,e.participantToken||e.ParticipantToken)return t.participantToken=e.ParticipantToken||e.participantToken,this.validateChatDetails(t),t;if(e.ChatConnectionAttributes&&e.ChatConnectionAttributes.ParticipantCredentials){this.validateInitiateChatResponse(e);var n={};return n.connectionToken=e.ChatConnectionAttributes.ParticipantCredentials.ConnectionAuthenticationToken,n.ConnectionId=e.ChatConnectionAttributes.ConnectionId,n.PreSignedConnectionUrl=e.ChatConnectionAttributes.PreSignedConnectionUrl,t.connectionDetails=n,t}return this.validateChatDetails(t),t}}]),t}(function(){function e(){le(this,e)}return he(e,[{key:"validateNewControllerDetails",value:function(e){return!0}},{key:"validateSendMessage",value:function(e){if(!q.isString(e.message))throw new f(e.message+"is not a valid message");this.validateContentType(e.contentType)}},{key:"validateContentType",value:function(e){q.assertIsEnum(e,Object.values(_),"contentType")}},{key:"validateConnectChat",value:function(e){return!0}},{key:"validateLogger",value:function(e){q.assertIsObject(e,"logger"),["debug","info","warn","error"].forEach((function(t){if(!q.isFunction(e[t]))throw new f(t+" should be a valid function on the passed logger object!")}))}},{key:"validateSendEvent",value:function(e){this.validateContentType(e.contentType)}},{key:"validateGetMessages",value:function(e){return!0}}]),e}());function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var me={NeverStarted:"NeverStarted",Starting:"Starting",Connected:"Connected",ConnectionLost:"ConnectionLost",Ended:"Ended"},ge="ConnectionLost",ye="ConnectionGained",ve="Ended",be="IncomingMessage",we="WEBSOCKET",Se="CONNECTION_CREDENTIALS",Ee=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.connectionDetailsProvider=t,this.isStarted=!1}var t,n,r;return t=e,(n=[{key:"startConnectionTokenPolling",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:432e5;t||this.connectionDetailsProvider.fetchConnectionToken().then((function(){var t=e.getConnectionTokenExpiry(),r=(new Date).getTime();n=t-r-6e4})),this.timeout=setTimeout(this.startConnectionTokenPolling.bind(this),n)}},{key:"start",value:function(){this.isStarted||(this.isStarted=!0,this.startConnectionTokenPolling(!0,this.getConnectionTokenExpiry()))}},{key:"end",value:function(){clearTimeout(this.timeout)}},{key:"getConnectionToken",value:function(){return this.connectionDetailsProvider.getConnectionToken()}},{key:"getConnectionTokenExpiry",value:function(){return new Date(this.connectionDetailsProvider.getConnectionTokenExpiry()).getTime()}}])&&de(t.prototype,n),r&&de(t,r),e}(),Ce=function(e,t,n){this.subMap=e,this.id=q.randomId(),this.eventName=t,this.f=n};Ce.prototype.unsubscribe=function(){this.subMap.unsubscribe(this.eventName,this.id)};var _e=function(){this.subIdMap={},this.subEventNameMap={}};_e.prototype.subscribe=function(e,t){var n=new Ce(this,e,t);this.subIdMap[n.id]=n;var r=this.subEventNameMap[e]||[];return r.push(n),this.subEventNameMap[e]=r,function(){return n.unsubscribe()}},_e.prototype.unsubscribe=function(e,t){q.contains(this.subEventNameMap,e)&&(this.subEventNameMap[e]=this.subEventNameMap[e].filter((function(e){return e.id!==t})),this.subEventNameMap[e].length<1&&delete this.subEventNameMap[e]),q.contains(this.subIdMap,t)&&delete this.subIdMap[t]},_e.prototype.getAllSubscriptions=function(){return q.values(this.subEventNameMap).reduce((function(e,t){return e.concat(t)}),[])},_e.prototype.getSubscriptions=function(e){return this.subEventNameMap[e]||[]};var ke=function(e){var t=e||{};this.subMap=new _e,this.logEvents=t.logEvents||!1};function Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}ke.prototype.subscribe=function(e,t){return q.assertNotNull(e,"eventName"),q.assertNotNull(t,"f"),q.assertTrue(q.isFunction(t),"f must be a function"),this.subMap.subscribe(e,t)},ke.prototype.subscribeAll=function(e){return q.assertNotNull(e,"f"),q.assertTrue(q.isFunction(e),"f must be a function"),this.subMap.subscribe("<<all>>",e)},ke.prototype.getSubscriptions=function(e){return this.subMap.getSubscriptions(e)},ke.prototype.trigger=function(e,t){q.assertNotNull(e,"eventName");var n=this,r=this.subMap.getSubscriptions("<<all>>"),i=this.subMap.getSubscriptions(e);r.concat(i).forEach((function(r){try{r.f(t||null,e,n)}catch(e){}}))},ke.prototype.triggerAsync=function(e,t){var n=this;setTimeout((function(){return n.trigger(e,t)}),0)},ke.prototype.bridge=function(){var e=this;return function(t,n){e.trigger(n,t)}},ke.prototype.unsubscribeAll=function(){this.subMap.getAllSubscriptions().forEach((function(e){e.unsubscribe()}))};var xe=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.chatClient=n,this.participantToken=t||null,this.connectionDetails=null,this.connectionToken=null,this.connectionTokenExpiry=null}var t,n,r;return t=e,(n=[{key:"getConnectionToken",value:function(){return this.connectionToken}},{key:"getConnectionTokenExpiry",value:function(){return this.connectionTokenExpiry}},{key:"getConnectionDetails",value:function(){return this.connectionDetails}},{key:"fetchConnectionDetails",value:function(){var e=this;return this._fetchConnectionDetails().then((function(){return e.connectionDetails}))}},{key:"fetchConnectionToken",value:function(){var e=this;return this._fetchConnectionDetails().then((function(){return e.connectionToken}))}},{key:"_handleCreateParticipantConnectionResponse",value:function(e){this.connectionDetails={url:e.Websocket.Url,expiry:e.Websocket.ConnectionExpiry},this.connectionToken=e.ConnectionCredentials.ConnectionToken,this.connectionTokenExpiry=e.ConnectionCredentials.Expiry}},{key:"_fetchConnectionDetails",value:function(){var e=this;return this.participantToken?this.chatClient.createParticipantConnection(this.participantToken,[we,Se]).then((function(t){return e._handleCreateParticipantConnectionResponse(t.data)})).catch((function(e){return Promise.reject({reason:"Failed to fetch connectionDetails with createParticipantConnection",_debug:e})})):Promise.reject({reason:"Failed to fetch connectionDetails.",_debug:new f("Failed to fetch connectionDetails.")})}}])&&Te(t.prototype,n),r&&Te(t,r),e}(),Re=n(4);function Ae(e){return(Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oe(e,t,n){return t&&Pe(e.prototype,t),n&&Pe(e,n),e}function Le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ne(e,t,n){return(Ne="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=qe(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function qe(e){return(qe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function De(e,t){return(De=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var je=function(e){function t(e,n,r,i){var o;return Ie(this,t),(o=function(e,t){return!t||"object"!==Ae(t)&&"function"!=typeof t?Le(e):t}(this,qe(t).call(this,r))).cleanUpBaseInstance=!i,o.tryCleanup(),t.baseInstance||(t.baseInstance=new Me(r,i)),o.contactId=e,o.initialContactId=n,o.status=null,o.eventBus=new ke,o.subscriptions=[t.baseInstance.onEnded(o.handleEnded.bind(Le(o))),t.baseInstance.onConnectionGain(o.handleConnectionGain.bind(Le(o))),t.baseInstance.onConnectionLost(o.handleConnectionLost.bind(Le(o))),t.baseInstance.onMessage(o.handleMessage.bind(Le(o)))],o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&De(e,t)}(t,e),Oe(t,[{key:"start",value:function(){return Ne(qe(t.prototype),"start",this).call(this),t.baseInstance.start()}},{key:"end",value:function(){Ne(qe(t.prototype),"end",this).call(this),this.eventBus.unsubscribeAll(),this.subscriptions.forEach((function(e){return e()})),this.status=me.Ended,this.tryCleanup()}},{key:"tryCleanup",value:function(){t.baseInstance&&this.cleanUpBaseInstance&&(t.baseInstance.end(),t.baseInstance=null)}},{key:"getStatus",value:function(){return this.status||t.baseInstance.getStatus()}},{key:"onEnded",value:function(e){return this.eventBus.subscribe(ve,e)}},{key:"handleEnded",value:function(){this.eventBus.trigger(ve,{})}},{key:"onConnectionGain",value:function(e){return this.eventBus.subscribe(ye,e)}},{key:"handleConnectionGain",value:function(){this.eventBus.trigger(ye,{})}},{key:"onConnectionLost",value:function(e){return this.eventBus.subscribe(ge,e)}},{key:"handleConnectionLost",value:function(){this.eventBus.trigger(ge,{})}},{key:"onMessage",value:function(e){return this.eventBus.subscribe(be,e)}},{key:"handleMessage",value:function(e){e.InitialContactId!==this.initialContactId&&e.ContactId!==this.contactId||this.eventBus.trigger(be,e)}}]),t}(Ee);je.baseInstance=null;var Me=function(){function e(t,n){Ie(this,e),this.status=me.NeverStarted,this.eventBus=new ke,this.logger=Y.getLogger({prefix:"LPC WebSockets: "}),this.initWebsocketManager(n,t)}return Oe(e,[{key:"initWebsocketManager",value:function(e,t){this.websocketManager=e||Re.a.create(),this.websocketManager.subscribeTopics(["aws/chat"]),this.subscriptions=[this.websocketManager.onMessage("aws/chat",this.handleMessage.bind(this)),this.websocketManager.onConnectionGain(this.handleConnectionGain.bind(this)),this.websocketManager.onConnectionLost(this.handleConnectionLost.bind(this)),this.websocketManager.onInitFailure(this.handleEnded.bind(this))],e||this.websocketManager.init((function(){return t.fetchConnectionDetails().then((function(e){return{webSocketTransport:{url:e.url,expiry:e.expiry}}}))}))}},{key:"end",value:function(){this.websocketManager.closeWebSocket(),this.eventBus.unsubscribeAll(),this.subscriptions.forEach((function(e){return e()}))}},{key:"start",value:function(){return this.status===me.NeverStarted&&(this.status=me.Starting),Promise.resolve()}},{key:"onEnded",value:function(e){return this.eventBus.subscribe(ve,e)}},{key:"handleEnded",value:function(){this.status=me.Ended,this.eventBus.trigger(ve,{})}},{key:"onConnectionGain",value:function(e){return this.eventBus.subscribe(ye,e)}},{key:"handleConnectionGain",value:function(){this.status=me.Connected,this.eventBus.trigger(ye,{})}},{key:"onConnectionLost",value:function(e){return this.eventBus.subscribe(ge,e)}},{key:"handleConnectionLost",value:function(){this.status=me.ConnectionLost,this.eventBus.trigger(ge,{})}},{key:"onMessage",value:function(e){return this.eventBus.subscribe(be,e)}},{key:"handleMessage",value:function(e){var t;try{t=JSON.parse(e.content),this.eventBus.trigger(be,t)}catch(t){this.logger.error("Wrong message format: ",e)}}},{key:"getStatus",value:function(){return this.status}}]),e}(),Ue=je;function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Fe="NeverEstablished",He="Establishing",ze="Established",We="Broken",Ve=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.logger=Y.getLogger({prefix:"ContactId-"+t.chatDetails.contactId+": "}),this.argsValidator=new fe,this.pubsub=new ke,this.sessionType=t.sessionType,this.connectionDetails=t.chatDetails.connectionDetails,this.initialContactId=t.chatDetails.initialContactId,this.contactId=t.chatDetails.contactId,this.participantId=t.chatDetails.participantId,this.chatClient=t.chatClient,this.participantToken=t.chatDetails.participantToken,this.websocketManager=t.websocketManager,this._participantDisconnected=!1,this.sessionMetadata={}}var t,n,r;return t=e,(n=[{key:"subscribe",value:function(e,t){this.pubsub.subscribe(e,t),this.logger.info("Subscribed successfully to eventName: ",e)}},{key:"handleRequestSuccess",value:function(e,t,n){var r=this;return function(i){return i.metadata=e,r.logger.debug("".concat(n," successful! Response: "),i," / Request: ",t),i}}},{key:"handleRequestFailure",value:function(e,t,n){var r=this;return function(i){return i.metadata=e,r.logger.debug("".concat(n," failed! Error: "),i," / Request: ",t),Promise.reject(i)}}},{key:"sendMessage",value:function(e){var t=e.metadata||null;this.argsValidator.validateSendMessage(e);var n=this.connectionHelper.getConnectionToken();return this.chatClient.sendMessage(n,e.message,e.contentType).then(this.handleRequestSuccess(t,e,"sendMessage")).catch(this.handleRequestFailure(t,e,"sendMessage"))}},{key:"sendEvent",value:function(e){var t=e.metadata||null;this.argsValidator.validateSendEvent(e);var n=this.connectionHelper.getConnectionToken(),r=e.content||null;return this.chatClient.sendEvent(n,e.contentType,r).then(this.handleRequestSuccess(t,e,"sendEvent")).catch(this.handleRequestFailure(t,e,"sendEvent"))}},{key:"getTranscript",value:function(e){if(this.connectionHelper.getStatus()===me.Ended)return Promise.reject("AccessDeniedException");var t=e.metadata||null,n={startPosition:e.startPosition||{},scanDirection:e.scanDirection||x,sortOrder:e.sortOrder||T,maxResults:e.maxResults||k};e.nextToken&&(n.nextToken=e.nextToken),e.contactId&&(n.contactId=e.contactId);var r=this.connectionHelper.getConnectionToken();return this.chatClient.getTranscript(r,n).then(this.handleRequestSuccess(t,n,"getTranscript")).catch(this.handleRequestFailure(t,n,"getTranscript"))}},{key:"connect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.sessionMetadata=e.metadata||null,this.argsValidator.validateConnectChat(e);var t=this._getConnectionDetailsProvider();return t.fetchConnectionToken().then(this._initConnectionHelper.bind(this,t)).then(this._onConnectSuccess.bind(this),this._onConnectFailure.bind(this))}},{key:"_initConnectionHelper",value:function(e){return this.connectionHelper=new Ue(this.contactId,this.initialContactId,e,this.websocketManager),this.connectionHelper.onEnded(this._handleEndedConnection.bind(this)),this.connectionHelper.onConnectionLost(this._handleLostConnection.bind(this)),this.connectionHelper.onConnectionGain(this._handleGainedConnection.bind(this)),this.connectionHelper.onMessage(this._handleIncomingMessage.bind(this)),this.connectionHelper.start()}},{key:"_getConnectionDetailsProvider",value:function(){return new xe(this.participantToken,this.chatClient)}},{key:"_handleEndedConnection",value:function(e){this._forwardChatEvent(E,{data:e,chatDetails:this.getChatDetails()})}},{key:"_handleLostConnection",value:function(e){this._forwardChatEvent(S,{data:e,chatDetails:this.getChatDetails()})}},{key:"_handleGainedConnection",value:function(e){this._forwardChatEvent(w,{data:e,chatDetails:this.getChatDetails()})}},{key:"_handleIncomingMessage",value:function(e){try{var t=e.ContentType===_.typing?b:v;this._forwardChatEvent(t,{data:e,chatDetails:this.getChatDetails()}),e.ContentType===_.chatEnded&&(this._forwardChatEvent(C,{data:null,chatDetails:this.getChatDetails()}),this.breakConnection())}catch(t){this.logger.error("Error occured while handling message from Connection. eventData: ",e," Causing exception: ",t)}}},{key:"_forwardChatEvent",value:function(e,t){this.logger.debug("Triggering event for subscribers:",e,t),this.pubsub.triggerAsync(e,t)}},{key:"_onConnectSuccess",value:function(e){this.logger.info("Connect successful!");var t={_debug:e,connectSuccess:!0,connectCalled:!0,metadata:this.sessionMetadata},n=Object.assign({chatDetails:this.getChatDetails()},t);return this.pubsub.triggerAsync(w,n),this._shouldAcknowledgeContact()&&this.sendEvent({contentType:_.connectionAcknowledged}),t}},{key:"_onConnectFailure",value:function(e){var t={_debug:e,connectSuccess:!1,connectCalled:!0,metadata:this.sessionMetadata};return this.logger.error("Connect Failed with data: ",t),Promise.reject(t)}},{key:"_shouldAcknowledgeContact",value:function(){return this.sessionType===y.AGENT}},{key:"breakConnection",value:function(){return this.connectionHelper?this.connectionHelper.end():Promise.resolve()}},{key:"cleanUpOnParticipantDisconnect",value:function(){this.pubsub.unsubscribeAll()}},{key:"disconnectParticipant",value:function(){var e=this,t=this.connectionHelper.getConnectionToken();return this.chatClient.disconnectParticipant(t).then((function(t){return e.logger.info("disconnect participant successful"),e._participantDisconnected=!0,e.cleanUpOnParticipantDisconnect(),e.breakConnection(),t}),(function(t){return e.logger.error("disconnect participant failed with error: ",t),Promise.reject(t)}))}},{key:"getChatDetails",value:function(){return{initialContactId:this.initialContactId,contactId:this.contactId,participantId:this.participantId,participantToken:this.participantToken,connectionDetails:this.connectionDetails}}},{key:"_convertConnectionHelperStatus",value:function(e){switch(e){case me.NeverStarted:return Fe;case me.Starting:return He;case me.Ended:case me.ConnectionLost:return We;case me.Connected:return ze}this.logger.error("Reached invalid state. Unknown connectionHelperStatus: ",e)}},{key:"getConnectionStatus",value:function(){return this._convertConnectionHelperStatus(this.connectionHelper.getStatus())}}])&&Be(t.prototype,n),r&&Be(t,r),e}();function Ge(e){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ke(e,t){return!t||"object"!==Ge(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Xe(e){return(Xe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ye(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Je(e,t)}function Je(e,t){return(Je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ze(e,t,n){return t&&Qe(e.prototype,t),n&&Qe(e,n),e}n.d(t,"a",(function(){return ot}));var et=function(e){function t(){var e;return $e(this,t),(e=Ke(this,Xe(t).call(this))).argsValidator=new fe,e}return Ye(t,e),Ze(t,[{key:"createChatSession",value:function(e,t,n,r){var i=this._createChatController(e,t,n,r);if(e===y.AGENT)return new nt(i);if(e===y.CUSTOMER)return new rt(i);throw new f("Unkown value for session type, Allowed values are: "+Object.values(y),e)}},{key:"_createChatController",value:function(e,t,n,r){var i={sessionType:e,chatDetails:this.argsValidator.normalizeChatDetails(t),chatClient:oe.getCachedClient(n),websocketManager:r};return new Ve(i)}}]),t}(function(){function e(){$e(this,e)}return Ze(e,[{key:"createAgentChatController",value:function(e,t){throw new h("createAgentChatController in ChatControllerFactory.")}},{key:"createCustomerChatController",value:function(e,t){throw new h("createCustomerChatController in ChatControllerFactory.")}}]),e}()),tt=function(){function e(t){$e(this,e),this.controller=t}return Ze(e,[{key:"onMessage",value:function(e){this.controller.subscribe(v,e)}},{key:"onTyping",value:function(e){this.controller.subscribe(b,e)}},{key:"onConnectionBroken",value:function(e){this.controller.subscribe(E,e)}},{key:"onConnectionEstablished",value:function(e){this.controller.subscribe(w,e)}},{key:"onEnded",value:function(e){this.controller.subscribe(C,e)}},{key:"sendMessage",value:function(e){return this.controller.sendMessage(e)}},{key:"connect",value:function(e){return this.controller.connect(e)}},{key:"sendEvent",value:function(e){return this.controller.sendEvent(e)}},{key:"getTranscript",value:function(e){return this.controller.getTranscript(e)}},{key:"getChatDetails",value:function(){return this.controller.getChatDetails()}}]),e}(),nt=function(e){function t(e){return $e(this,t),Ke(this,Xe(t).call(this,e))}return Ye(t,e),Ze(t,[{key:"cleanUpOnParticipantDisconnect",value:function(){return this.controller.cleanUpOnParticipantDisconnect()}}]),t}(tt),rt=function(e){function t(e){return $e(this,t),Ke(this,Xe(t).call(this,e))}return Ye(t,e),Ze(t,[{key:"disconnectParticipant",value:function(){return this.controller.disconnectParticipant()}}]),t}(tt),it=new et,ot={create:function(e){var t=e.options||{},n=e.type||y.AGENT;return it.createChatSession(n,e.chatDetails,t,e.websocketManager)},setGlobalConfig:function(e){var t=e.loggerConfig;m.update(e),Y.updateLoggerConfig(t)},LogLevel:W,Logger:z,SessionTypes:y}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.connect=e.connect||{};var r=connect.WebSocketManager;!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==n(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(i,o,function(t){return e[t]}.bind(null,o));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){var i=r(1);function o(e){return(o="function"==typeof Symbol&&"symbol"==n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}var s={assertTrue:function(e,t){if(!e)throw new Error(t)},assertNotNull:function(e,t){return s.assertTrue(null!==e&&void 0!==o(e),Object(i.sprintf)("%s must be provided",t||"A value")),e},isNonEmptyString:function(e){return"string"==typeof e&&e.length>0},assertIsList:function(e,t){if(!Array.isArray(e))throw new Error(t+" is not an array")},isFunction:function(e){return!!(e&&e.constructor&&e.call&&e.apply)},isObject:function(e){return!("object"!==o(e)||null===e)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e}},a=new RegExp("^(wss://)\\w*");s.validWSUrl=function(e){return a.test(e)},s.assertIsObject=function(e,t){if(!s.isObject(e))throw new Error(t+" is not an object!")};var c=s,u="DEBUG",l="aws/subscribe",p="aws/heartbeat";function h(e){return(h="function"==typeof Symbol&&"symbol"==n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)})(e)}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),e}var v=function(){function e(){m(this,e)}return y(e,[{key:"debug",value:function(e){}},{key:"info",value:function(e){}},{key:"warn",value:function(e){}},{key:"error",value:function(e){}}]),e}(),b={DEBUG:10,INFO:20,WARN:30,ERROR:40},w=function(){function e(){m(this,e),this.updateLoggerConfig(),this.consoleLoggerWrapper=C()}return y(e,[{key:"writeToClientLogger",value:function(e,t){if(this.hasClientLogger())switch(e){case b.DEBUG:return this._clientLogger.debug(t);case b.INFO:return this._clientLogger.info(t);case b.WARN:return this._clientLogger.warn(t);case b.ERROR:return this._clientLogger.error(t)}}},{key:"isLevelEnabled",value:function(e){return e>=this._level}},{key:"hasClientLogger",value:function(){return null!==this._clientLogger}},{key:"getLogger",value:function(e){var t=e.prefix||"";return this._logsDestination===u?this.consoleLoggerWrapper:new E(t)}},{key:"updateLoggerConfig",value:function(e){var t=e||{};this._level=t.level||b.INFO,this._clientLogger=t.logger||null,this._logsDestination="NULL",t.debug&&(this._logsDestination=u),t.logger&&(this._logsDestination="CLIENT_LOGGER")}}]),e}(),S=function(){function e(){m(this,e)}return y(e,[{key:"debug",value:function(){}},{key:"info",value:function(){}},{key:"warn",value:function(){}},{key:"error",value:function(){}}]),e}(),E=function(e){function t(e){var n;return m(this,t),(n=function(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,f(t).call(this))).prefix=e||"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(t,S),y(t,[{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(b.DEBUG,t)}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(b.INFO,t)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(b.WARN,t)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._log(b.ERROR,t)}},{key:"_shouldLog",value:function(e){return _.hasClientLogger()&&_.isLevelEnabled(e)}},{key:"_writeToClientLogger",value:function(e,t){_.writeToClientLogger(e,t)}},{key:"_log",value:function(e,t){if(this._shouldLog(e)){var n=this._convertToSingleStatement(t);this._writeToClientLogger(e,n)}}},{key:"_convertToSingleStatement",value:function(e){var t="";this.prefix&&(t+=this.prefix+" ");for(var n=0;n<e.length;n++){var r=e[n];t+=this._convertToString(r)+" "}return t}},{key:"_convertToString",value:function(e){try{if(!e)return"";if(c.isString(e))return e;if(c.isObject(e)&&c.isFunction(e.toString)){var t=e.toString();if("[object Object]"!==t)return t}return JSON.stringify(e)}catch(t){return console.error("Error while converting argument to string",e,t),""}}}]),t}(),C=function(){var e=new S;return e.debug=console.debug,e.info=console.info,e.warn=console.warn,e.error=console.error,e},_=new w;r.d(t,"a",(function(){return T}));var k=function(){var e=_.getLogger({}),t=null,n={reconnectWebSocket:!1,websocketInitFailed:!1,linearConnectAttempt:0,exponentialConnectAttempt:0,exponentialBackOffTime:1e3,linearTimeoutHandle:null,exponentialTimeoutHandle:null,lifeTimeTimeoutHandle:null},r={pendingResponse:!1,intervalHandle:null},i={initFailure:new Set,getWebSocketTransport:null,subscriptionUpdate:new Set,subscriptionFailure:new Set,topic:new Map,allMessage:new Set,connectionGain:new Set,connectionLost:new Set},o={connConfig:null,promiseHandle:null,promiseCompleted:!1},s={subscribed:new Set,pending:new Set},a=new Set([l,"aws/unsubscribe",p]),u=navigator.onLine,h=setInterval((function(){u!==navigator.onLine&&(u=navigator.onLine)&&(!t||t.readyState>1)&&(e.info("Network online, Connecting to websocket"),T())}),250),f=function(e,t){e.forEach((function(e){e(t)}))},d=function(){if(r.pendingResponse)return e.warn("Heartbeat response not received"),clearInterval(r.intervalHandle),r.pendingResponse=!1,void S();e.debug("Sending heartbeat"),t.send(C(p)),r.pendingResponse=!0},m=function(){n.linearConnectAttempt=0,n.exponentialConnectAttempt=0,n.exponentialBackOffTime=1e3,r.pendingResponse=!1,n.reconnectWebSocket=!1,clearTimeout(n.lifeTimeTimeoutHandle),clearInterval(r.intervalHandle),clearTimeout(n.linearTimeoutHandle),clearTimeout(n.exponentialTimeoutHandle)},g=function(){try{if(e.info("WebSocket connection established!"),f(i.connectionGain),m(),s.subscribed.size>0||s.pending.size>0){var a=Array.from(s.subscribed.values());a=a.concat(Array.from(s.pending.values())),s.subscribed.clear(),t.send(C(l,{topics:a}))}d(),r.intervalHandle=setInterval(d,1e4),n.lifeTimeTimeoutHandle=setTimeout((function(){e.debug("Starting scheduled WebSocket manager reconnect"),S()}),Date.parse(o.connConfig.webSocketTransport.expiry)-Date.now())}catch(t){e.error("Error after establishing web socket connection, error: ",t)}},y=function(t){n.linearConnectAttempt<=1&&f(i.connectionLost),e.info("Socket connection is closed. event: ",t),n.reconnectWebSocket&&x()},v=function(t){e.error("WebSocketManager Error, error_event: ",t),S()},b=function(t){var n=JSON.parse(t.data);switch(n.topic){case l:e.info("Subscription Message received from webSocket server",t.data),"success"===n.content.status?(n.content.topics.forEach((function(e){s.subscribed.add(e),s.pending.delete(e)})),f(i.subscriptionUpdate,n)):f(i.subscriptionFailure,n);break;case p:e.debug("Heartbeat response received"),r.pendingResponse=!1;break;default:if(n.topic){if(0===i.allMessage.size&&0===i.topic.size)return void e.warn("No registered callback listener for Topic",n);f(i.allMessage,n),i.topic.has(n.topic)&&f(i.topic.get(n.topic),n)}else n.message?e.warn("WebSocketManager Message Error",n):e.warn("Invalid incoming message",n)}},w=function(e){return!(!t||t.readyState===WebSocket.CLOSED||(t.close(1e3,e),0))},S=function(){if(u)if(clearTimeout(n.lifeTimeTimeoutHandle),clearInterval(r.intervalHandle),n.linearConnectAttempt<3){n.linearConnectAttempt++;var t=Math.floor(2e3*(1+Math.random()));e.debug("Starting Linear WebSocket reconnect, Attempt : #"+n.linearConnectAttempt+" with delay "+t+" ms"),n.linearTimeoutHandle=setTimeout((function(){n.reconnectWebSocket=!0,T()}),t)}else if(n.exponentialConnectAttempt<3){n.exponentialConnectAttempt++,n.exponentialBackOffTime*=2;var i=Math.floor(n.exponentialBackOffTime*(1+Math.random()));e.debug("Starting Exponential WebSocket reconnect, Attempt : #"+n.exponentialConnectAttempt+" with delay "+i+" sec."),o.promiseCompleted=!1,o.connConfig=null,n.exponentialTimeoutHandle=setTimeout((function(){n.reconnectWebSocket=!0,T()}),i)}else o.promiseCompleted&&(e.error("Could not connect to WebSocket after several attempts"),E());else w("Network Offline, Closing WebSocket Manager")},E=function(){m(),w("Terminating WebSocket Manager"),e.error("WebSocket Initialization failed"),n.websocketInitFailed=!0,clearInterval(h),f(i.initFailure)},C=function(e,t){return JSON.stringify({topic:e,content:t})},k=function(t){return!!(c.isObject(t)&&c.isObject(t.webSocketTransport)&&c.isNonEmptyString(t.webSocketTransport.url)&&c.validWSUrl(t.webSocketTransport.url)&&c.isNonEmptyString(t.webSocketTransport.expiry)&&Date.parse(t.webSocketTransport.expiry)-Date.now()>=36e5)||(e.error("Invalid WebSocket Connection Configuration",t),!1)},T=function(){n.websocketInitFailed||(o.connConfig=null,o.promiseCompleted=!1,o.promiseHandle=i.getWebSocketTransport(),o.promiseHandle.then((function(t){o.promiseCompleted=!0,e.debug("Successfully fetched webSocket connection configuration"),k(t)?(o.connConfig=t,u&&(w("Restarting WebSocket Manager")||x())):E()}),(function(t){o.promiseCompleted=!0,e.error("Failed to fetch webSocket connection configuration",t),S()})))},x=function(){if(!n.websocketInitFailed){e.debug("Initializing Websocket Manager");try{k(o.connConfig)?((t=new WebSocket(o.connConfig.webSocketTransport.url)).addEventListener("open",g),t.addEventListener("message",b),t.addEventListener("error",v),t.addEventListener("close",y)):o.promiseCompleted&&E()}catch(t){e.error("Error Initializing web-socket-manager",t),E()}}};this.init=function(t){c.assertTrue(c.isFunction(t),"transportHandle must be a function"),null===i.getWebSocketTransport?(i.getWebSocketTransport=t,T()):e.warn("Web Socket Manager was already initialized")},this.onInitFailure=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.initFailure.add(e),n.websocketInitFailed&&e(),function(){return i.initFailure.delete(e)}},this.onConnectionGain=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.connectionGain.add(e),t&&t.readyState===WebSocket.OPEN&&e(),function(){return i.connectionGain.delete(e)}},this.onConnectionLost=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.connectionLost.add(e),t&&t.readyState===WebSocket.CLOSED&&e(),function(){return i.connectionLost.delete(e)}},this.onSubscriptionUpdate=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.subscriptionUpdate.add(e),function(){return i.subscriptionUpdate.delete(e)}},this.onSubscriptionFailure=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.subscriptionFailure.add(e),function(){return i.subscriptionFailure.delete(e)}},this.onMessage=function(e,t){return c.assertNotNull(e,"topicName"),c.assertTrue(c.isFunction(t),"cb must be a function"),i.topic.has(e)?i.topic.get(e).add(t):i.topic.set(e,new Set([t])),function(){return i.topic.get(e).delete(t)}},this.onAllMessage=function(e){return c.assertTrue(c.isFunction(e),"cb must be a function"),i.allMessage.add(e),function(){return i.allMessage.delete(e)}},this.subscribeTopics=function(e){c.assertNotNull(e,"topics"),c.assertIsList(e),e.forEach((function(e){s.pending.add(e)})),t&&t.readyState===WebSocket.OPEN&&t.send(C(l,{topics:e}))},this.sendMessage=function(n){if(c.assertIsObject(n,"payload"),void 0===n.topic||a.has(n.topic))e.warn("Cannot send message, Invalid topic",n);else{try{n=JSON.stringify(n)}catch(t){return void e.warn("Error stringify message",n)}t&&t.readyState===WebSocket.OPEN?t.send(n):e.warn("Cannot send message, web socket connection is not open")}},this.closeWebSocket=function(){m(),clearInterval(h),w("User request to close WebSocket")}},T={create:function(){return new k},setGlobalConfig:function(e){var t=e.loggerConfig;_.updateLoggerConfig(t)},LogLevel:b,Logger:v}},function(e,t,r){var i;!function(){var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function s(e){return function(e,t){var r,i,a,c,u,l,p,h,f,d=1,m=e.length,g="";for(i=0;i<m;i++)if("string"==typeof e[i])g+=e[i];else if("object"==n(e[i])){if((c=e[i]).keys)for(r=t[d],a=0;a<c.keys.length;a++){if(null==r)throw new Error(s('[sprintf] Cannot access property "%s" of undefined value "%s"',c.keys[a],c.keys[a-1]));r=r[c.keys[a]]}else r=c.param_no?t[c.param_no]:t[d++];if(o.not_type.test(c.type)&&o.not_primitive.test(c.type)&&r instanceof Function&&(r=r()),o.numeric_arg.test(c.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(s("[sprintf] expecting number but found %T",r));switch(o.number.test(c.type)&&(h=r>=0),c.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,c.width?parseInt(c.width):0);break;case"e":r=c.precision?parseFloat(r).toExponential(c.precision):parseFloat(r).toExponential();break;case"f":r=c.precision?parseFloat(r).toFixed(c.precision):parseFloat(r);break;case"g":r=c.precision?String(Number(r.toPrecision(c.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=c.precision?r.substring(0,c.precision):r;break;case"t":r=String(!!r),r=c.precision?r.substring(0,c.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=c.precision?r.substring(0,c.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=c.precision?r.substring(0,c.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}o.json.test(c.type)?g+=r:(!o.number.test(c.type)||h&&!c.sign?f="":(f=h?"+":"-",r=r.toString().replace(o.sign,"")),l=c.pad_char?"0"===c.pad_char?"0":c.pad_char.charAt(1):" ",p=c.width-(f+r).length,u=c.width&&p>0?l.repeat(p):"",g+=c.align?f+r+u:"0"===l?f+u+r:u+f+r)}return g}(function(e){if(c[e])return c[e];for(var t,n=e,r=[],i=0;n;){if(null!==(t=o.text.exec(n)))r.push(t[0]);else if(null!==(t=o.modulo.exec(n)))r.push("%");else{if(null===(t=o.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){i|=1;var s=[],a=t[2],u=[];if(null===(u=o.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(u[1]);""!==(a=a.substring(u[0].length));)if(null!==(u=o.key_access.exec(a)))s.push(u[1]);else{if(null===(u=o.index_access.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(u[1])}t[2]=s}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return c[e]=r}(e),arguments)}function a(e,t){return s.apply(null,[e].concat(t||[]))}var c=Object.create(null);t.sprintf=s,t.vsprintf=a,"undefined"!=typeof window&&(window.sprintf=s,window.vsprintf=a,void 0===(i=function(){return{sprintf:s,vsprintf:a}}.call(t,r,t,e))||(e.exports=i))}()},function(e,t,n){n.r(t),function(e){n.d(t,"WebSocketManager",(function(){return i}));var r=n(0);e.connect=e.connect||{},connect.WebSocketManager=r.a,connect.testnum=1;var i=r.a}.call(this,n(3))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":n(window))&&(r=window)}e.exports=r}]);var i=connect.WebSocketManager;connect.WebSocketManager=r,t.a=i}).call(this,n(0))},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"ChatSession",(function(){return i}));var r=n(2);e.connect=e.connect||{},connect.ChatSession=r.a;var i=r.a}.call(this,n(0))},function(e,t,n){(function(r){var i,o;function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){if(!c&&"function"==typeof i&&i)return i(a,!0);if(s)return s(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,(function(e){return o(t[a][1][e]||e)}),l,l.exports,e,t,n,r)}return n[a].exports}for(var s="function"==typeof i&&i,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){t.exports={version:"2.0",metadata:{apiVersion:"2014-06-30",endpointPrefix:"cognito-identity",jsonVersion:"1.1",protocol:"json",serviceFullName:"Amazon Cognito Identity",serviceId:"Cognito Identity",signatureVersion:"v4",targetPrefix:"AWSCognitoIdentityService",uid:"cognito-identity-2014-06-30"},operations:{CreateIdentityPool:{input:{type:"structure",required:["IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},output:{shape:"Sk"}},DeleteIdentities:{input:{type:"structure",required:["IdentityIdsToDelete"],members:{IdentityIdsToDelete:{type:"list",member:{}}}},output:{type:"structure",members:{UnprocessedIdentityIds:{type:"list",member:{type:"structure",members:{IdentityId:{},ErrorCode:{}}}}}}},DeleteIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}}},DescribeIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{}}},output:{shape:"Sv"}},DescribeIdentityPool:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{shape:"Sk"}},GetCredentialsForIdentity:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"},CustomRoleArn:{}}},output:{type:"structure",members:{IdentityId:{},Credentials:{type:"structure",members:{AccessKeyId:{},SecretKey:{},SessionToken:{},Expiration:{type:"timestamp"}}}}}},GetId:{input:{type:"structure",required:["IdentityPoolId"],members:{AccountId:{},IdentityPoolId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{}}}},GetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{}}},output:{type:"structure",members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},GetOpenIdToken:{input:{type:"structure",required:["IdentityId"],members:{IdentityId:{},Logins:{shape:"S10"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},GetOpenIdTokenForDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId","Logins"],members:{IdentityPoolId:{},IdentityId:{},Logins:{shape:"S10"},TokenDuration:{type:"long"}}},output:{type:"structure",members:{IdentityId:{},Token:{}}}},ListIdentities:{input:{type:"structure",required:["IdentityPoolId","MaxResults"],members:{IdentityPoolId:{},MaxResults:{type:"integer"},NextToken:{},HideDisabled:{type:"boolean"}}},output:{type:"structure",members:{IdentityPoolId:{},Identities:{type:"list",member:{shape:"Sv"}},NextToken:{}}}},ListIdentityPools:{input:{type:"structure",required:["MaxResults"],members:{MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityPools:{type:"list",member:{type:"structure",members:{IdentityPoolId:{},IdentityPoolName:{}}}},NextToken:{}}}},ListTagsForResource:{input:{type:"structure",required:["ResourceArn"],members:{ResourceArn:{}}},output:{type:"structure",members:{Tags:{shape:"Sh"}}}},LookupDeveloperIdentity:{input:{type:"structure",required:["IdentityPoolId"],members:{IdentityPoolId:{},IdentityId:{},DeveloperUserIdentifier:{},MaxResults:{type:"integer"},NextToken:{}}},output:{type:"structure",members:{IdentityId:{},DeveloperUserIdentifierList:{type:"list",member:{}},NextToken:{}}}},MergeDeveloperIdentities:{input:{type:"structure",required:["SourceUserIdentifier","DestinationUserIdentifier","DeveloperProviderName","IdentityPoolId"],members:{SourceUserIdentifier:{},DestinationUserIdentifier:{},DeveloperProviderName:{},IdentityPoolId:{}}},output:{type:"structure",members:{IdentityId:{}}}},SetIdentityPoolRoles:{input:{type:"structure",required:["IdentityPoolId","Roles"],members:{IdentityPoolId:{},Roles:{shape:"S1c"},RoleMappings:{shape:"S1e"}}}},TagResource:{input:{type:"structure",required:["ResourceArn","Tags"],members:{ResourceArn:{},Tags:{shape:"Sh"}}},output:{type:"structure",members:{}}},UnlinkDeveloperIdentity:{input:{type:"structure",required:["IdentityId","IdentityPoolId","DeveloperProviderName","DeveloperUserIdentifier"],members:{IdentityId:{},IdentityPoolId:{},DeveloperProviderName:{},DeveloperUserIdentifier:{}}}},UnlinkIdentity:{input:{type:"structure",required:["IdentityId","Logins","LoginsToRemove"],members:{IdentityId:{},Logins:{shape:"S10"},LoginsToRemove:{shape:"Sw"}}}},UntagResource:{input:{type:"structure",required:["ResourceArn","TagKeys"],members:{ResourceArn:{},TagKeys:{type:"list",member:{}}}},output:{type:"structure",members:{}}},UpdateIdentityPool:{input:{shape:"Sk"},output:{shape:"Sk"}}},shapes:{S5:{type:"map",key:{},value:{}},S9:{type:"list",member:{}},Sb:{type:"list",member:{type:"structure",members:{ProviderName:{},ClientId:{},ServerSideTokenCheck:{type:"boolean"}}}},Sg:{type:"list",member:{}},Sh:{type:"map",key:{},value:{}},Sk:{type:"structure",required:["IdentityPoolId","IdentityPoolName","AllowUnauthenticatedIdentities"],members:{IdentityPoolId:{},IdentityPoolName:{},AllowUnauthenticatedIdentities:{type:"boolean"},AllowClassicFlow:{type:"boolean"},SupportedLoginProviders:{shape:"S5"},DeveloperProviderName:{},OpenIdConnectProviderARNs:{shape:"S9"},CognitoIdentityProviders:{shape:"Sb"},SamlProviderARNs:{shape:"Sg"},IdentityPoolTags:{shape:"Sh"}}},Sv:{type:"structure",members:{IdentityId:{},Logins:{shape:"Sw"},CreationDate:{type:"timestamp"},LastModifiedDate:{type:"timestamp"}}},Sw:{type:"list",member:{}},S10:{type:"map",key:{},value:{}},S1c:{type:"map",key:{},value:{}},S1e:{type:"map",key:{},value:{type:"structure",required:["Type"],members:{Type:{},AmbiguousRoleResolution:{},RulesConfiguration:{type:"structure",required:["Rules"],members:{Rules:{type:"list",member:{type:"structure",required:["Claim","MatchType","Value","RoleARN"],members:{Claim:{},MatchType:{},Value:{},RoleARN:{}}}}}}}}}}}},{}],2:[function(e,t,n){t.exports={pagination:{}}},{}],3:[function(e,t,n){t.exports={version:"2.0",metadata:{apiVersion:"2018-09-07",endpointPrefix:"participant.connect",jsonVersion:"1.1",protocol:"rest-json",serviceAbbreviation:"Amazon Connect Participant",serviceFullName:"Amazon Connect Participant Service",serviceId:"ConnectParticipant",signatureVersion:"v4",signingName:"execute-api",uid:"connectparticipant-2018-09-07"},operations:{CreateParticipantConnection:{http:{requestUri:"/participant/connection"},input:{type:"structure",required:["Type","ParticipantToken"],members:{Type:{type:"list",member:{}},ParticipantToken:{location:"header",locationName:"X-Amz-Bearer"}}},output:{type:"structure",members:{Websocket:{type:"structure",members:{Url:{},ConnectionExpiry:{}}},ConnectionCredentials:{type:"structure",members:{ConnectionToken:{},Expiry:{}}}}}},DisconnectParticipant:{http:{requestUri:"/participant/disconnect"},input:{type:"structure",required:["ConnectionToken"],members:{ClientToken:{idempotencyToken:!0},ConnectionToken:{location:"header",locationName:"X-Amz-Bearer"}}},output:{type:"structure",members:{}}},GetTranscript:{http:{requestUri:"/participant/transcript"},input:{type:"structure",required:["ConnectionToken"],members:{ContactId:{},MaxResults:{type:"integer"},NextToken:{},ScanDirection:{},SortOrder:{},StartPosition:{type:"structure",members:{Id:{},AbsoluteTime:{},MostRecent:{type:"integer"}}},ConnectionToken:{location:"header",locationName:"X-Amz-Bearer"}}},output:{type:"structure",members:{InitialContactId:{},Transcript:{type:"list",member:{type:"structure",members:{AbsoluteTime:{},Content:{},ContentType:{},Id:{},Type:{},ParticipantId:{},DisplayName:{},ParticipantRole:{}}}},NextToken:{}}}},SendEvent:{http:{requestUri:"/participant/event"},input:{type:"structure",required:["ContentType","ConnectionToken"],members:{ContentType:{},Content:{},ClientToken:{idempotencyToken:!0},ConnectionToken:{location:"header",locationName:"X-Amz-Bearer"}}},output:{type:"structure",members:{Id:{},AbsoluteTime:{}}}},SendMessage:{http:{requestUri:"/participant/message"},input:{type:"structure",required:["ContentType","Content","ConnectionToken"],members:{ContentType:{},Content:{},ClientToken:{idempotencyToken:!0},ConnectionToken:{location:"header",locationName:"X-Amz-Bearer"}}},output:{type:"structure",members:{Id:{},AbsoluteTime:{}}}}},shapes:{}}},{}],4:[function(e,t,n){t.exports={pagination:{GetTranscript:{input_token:"NextToken",output_token:"NextToken",limit_key:"MaxResults"}}}},{}],5:[function(e,t,n){t.exports={acm:{name:"ACM",cors:!0},apigateway:{name:"APIGateway",cors:!0},applicationautoscaling:{prefix:"application-autoscaling",name:"ApplicationAutoScaling",cors:!0},appstream:{name:"AppStream"},autoscaling:{name:"AutoScaling",cors:!0},batch:{name:"Batch"},budgets:{name:"Budgets"},clouddirectory:{name:"CloudDirectory",versions:["2016-05-10*"]},cloudformation:{name:"CloudFormation",cors:!0},cloudfront:{name:"CloudFront",versions:["2013-05-12*","2013-11-11*","2014-05-31*","2014-10-21*","2014-11-06*","2015-04-17*","2015-07-27*","2015-09-17*","2016-01-13*","2016-01-28*","2016-08-01*","2016-08-20*","2016-09-07*","2016-09-29*","2016-11-25*","2017-03-25*","2017-10-30*","2018-06-18*","2018-11-05*"],cors:!0},cloudhsm:{name:"CloudHSM",cors:!0},cloudsearch:{name:"CloudSearch"},cloudsearchdomain:{name:"CloudSearchDomain"},cloudtrail:{name:"CloudTrail",cors:!0},cloudwatch:{prefix:"monitoring",name:"CloudWatch",cors:!0},cloudwatchevents:{prefix:"events",name:"CloudWatchEvents",versions:["2014-02-03*"],cors:!0},cloudwatchlogs:{prefix:"logs",name:"CloudWatchLogs",cors:!0},codebuild:{name:"CodeBuild",cors:!0},codecommit:{name:"CodeCommit",cors:!0},codedeploy:{name:"CodeDeploy",cors:!0},codepipeline:{name:"CodePipeline",cors:!0},cognitoidentity:{prefix:"cognito-identity",name:"CognitoIdentity",cors:!0},cognitoidentityserviceprovider:{prefix:"cognito-idp",name:"CognitoIdentityServiceProvider",cors:!0},cognitosync:{prefix:"cognito-sync",name:"CognitoSync",cors:!0},configservice:{prefix:"config",name:"ConfigService",cors:!0},cur:{name:"CUR",cors:!0},datapipeline:{name:"DataPipeline"},devicefarm:{name:"DeviceFarm",cors:!0},directconnect:{name:"DirectConnect",cors:!0},directoryservice:{prefix:"ds",name:"DirectoryService"},discovery:{name:"Discovery"},dms:{name:"DMS"},dynamodb:{name:"DynamoDB",cors:!0},dynamodbstreams:{prefix:"streams.dynamodb",name:"DynamoDBStreams",cors:!0},ec2:{name:"EC2",versions:["2013-06-15*","2013-10-15*","2014-02-01*","2014-05-01*","2014-06-15*","2014-09-01*","2014-10-01*","2015-03-01*","2015-04-15*","2015-10-01*","2016-04-01*","2016-09-15*"],cors:!0},ecr:{name:"ECR",cors:!0},ecs:{name:"ECS",cors:!0},efs:{prefix:"elasticfilesystem",name:"EFS",cors:!0},elasticache:{name:"ElastiCache",versions:["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],cors:!0},elasticbeanstalk:{name:"ElasticBeanstalk",cors:!0},elb:{prefix:"elasticloadbalancing",name:"ELB",cors:!0},elbv2:{prefix:"elasticloadbalancingv2",name:"ELBv2",cors:!0},emr:{prefix:"elasticmapreduce",name:"EMR",cors:!0},es:{name:"ES"},elastictranscoder:{name:"ElasticTranscoder",cors:!0},firehose:{name:"Firehose",cors:!0},gamelift:{name:"GameLift",cors:!0},glacier:{name:"Glacier"},health:{name:"Health"},iam:{name:"IAM",cors:!0},importexport:{name:"ImportExport"},inspector:{name:"Inspector",versions:["2015-08-18*"],cors:!0},iot:{name:"Iot",cors:!0},iotdata:{prefix:"iot-data",name:"IotData",cors:!0},kinesis:{name:"Kinesis",cors:!0},kinesisanalytics:{name:"KinesisAnalytics"},kms:{name:"KMS",cors:!0},lambda:{name:"Lambda",cors:!0},lexruntime:{prefix:"runtime.lex",name:"LexRuntime",cors:!0},lightsail:{name:"Lightsail"},machinelearning:{name:"MachineLearning",cors:!0},marketplacecommerceanalytics:{name:"MarketplaceCommerceAnalytics",cors:!0},marketplacemetering:{prefix:"meteringmarketplace",name:"MarketplaceMetering"},mturk:{prefix:"mturk-requester",name:"MTurk",cors:!0},mobileanalytics:{name:"MobileAnalytics",cors:!0},opsworks:{name:"OpsWorks",cors:!0},opsworkscm:{name:"OpsWorksCM"},organizations:{name:"Organizations"},pinpoint:{name:"Pinpoint"},polly:{name:"Polly",cors:!0},rds:{name:"RDS",versions:["2014-09-01*"],cors:!0},redshift:{name:"Redshift",cors:!0},rekognition:{name:"Rekognition",cors:!0},resourcegroupstaggingapi:{name:"ResourceGroupsTaggingAPI"},route53:{name:"Route53",cors:!0},route53domains:{name:"Route53Domains",cors:!0},s3:{name:"S3",dualstackAvailable:!0,cors:!0},s3control:{name:"S3Control",dualstackAvailable:!0},servicecatalog:{name:"ServiceCatalog",cors:!0},ses:{prefix:"email",name:"SES",cors:!0},shield:{name:"Shield"},simpledb:{prefix:"sdb",name:"SimpleDB"},sms:{name:"SMS"},snowball:{name:"Snowball"},sns:{name:"SNS",cors:!0},sqs:{name:"SQS",cors:!0},ssm:{name:"SSM",cors:!0},storagegateway:{name:"StorageGateway",cors:!0},stepfunctions:{prefix:"states",name:"StepFunctions"},sts:{name:"STS",cors:!0},support:{name:"Support"},swf:{name:"SWF"},xray:{name:"XRay",cors:!0},waf:{name:"WAF",cors:!0},wafregional:{prefix:"waf-regional",name:"WAFRegional"},workdocs:{name:"WorkDocs",cors:!0},workspaces:{name:"WorkSpaces"},codestar:{name:"CodeStar"},lexmodelbuildingservice:{prefix:"lex-models",name:"LexModelBuildingService",cors:!0},marketplaceentitlementservice:{prefix:"entitlement.marketplace",name:"MarketplaceEntitlementService"},athena:{name:"Athena"},greengrass:{name:"Greengrass"},dax:{name:"DAX"},migrationhub:{prefix:"AWSMigrationHub",name:"MigrationHub"},cloudhsmv2:{name:"CloudHSMV2"},glue:{name:"Glue"},mobile:{name:"Mobile"},pricing:{name:"Pricing",cors:!0},costexplorer:{prefix:"ce",name:"CostExplorer",cors:!0},mediaconvert:{name:"MediaConvert"},medialive:{name:"MediaLive"},mediapackage:{name:"MediaPackage"},mediastore:{name:"MediaStore"},mediastoredata:{prefix:"mediastore-data",name:"MediaStoreData",cors:!0},appsync:{name:"AppSync"},guardduty:{name:"GuardDuty"},mq:{name:"MQ"},comprehend:{name:"Comprehend",cors:!0},iotjobsdataplane:{prefix:"iot-jobs-data",name:"IoTJobsDataPlane"},kinesisvideoarchivedmedia:{prefix:"kinesis-video-archived-media",name:"KinesisVideoArchivedMedia",cors:!0},kinesisvideomedia:{prefix:"kinesis-video-media",name:"KinesisVideoMedia",cors:!0},kinesisvideo:{name:"KinesisVideo",cors:!0},sagemakerruntime:{prefix:"runtime.sagemaker",name:"SageMakerRuntime"},sagemaker:{name:"SageMaker"},translate:{name:"Translate",cors:!0},resourcegroups:{prefix:"resource-groups",name:"ResourceGroups",cors:!0},alexaforbusiness:{name:"AlexaForBusiness"},cloud9:{name:"Cloud9"},serverlessapplicationrepository:{prefix:"serverlessrepo",name:"ServerlessApplicationRepository"},servicediscovery:{name:"ServiceDiscovery"},workmail:{name:"WorkMail"},autoscalingplans:{prefix:"autoscaling-plans",name:"AutoScalingPlans"},transcribeservice:{prefix:"transcribe",name:"TranscribeService"},connect:{name:"Connect",cors:!0},acmpca:{prefix:"acm-pca",name:"ACMPCA"},fms:{name:"FMS"},secretsmanager:{name:"SecretsManager",cors:!0},iotanalytics:{name:"IoTAnalytics",cors:!0},iot1clickdevicesservice:{prefix:"iot1click-devices",name:"IoT1ClickDevicesService"},iot1clickprojects:{prefix:"iot1click-projects",name:"IoT1ClickProjects"},pi:{name:"PI"},neptune:{name:"Neptune"},mediatailor:{name:"MediaTailor"},eks:{name:"EKS"},macie:{name:"Macie"},dlm:{name:"DLM"},signer:{name:"Signer"},chime:{name:"Chime"},pinpointemail:{prefix:"pinpoint-email",name:"PinpointEmail"},ram:{name:"RAM"},route53resolver:{name:"Route53Resolver"},pinpointsmsvoice:{prefix:"sms-voice",name:"PinpointSMSVoice"},quicksight:{name:"QuickSight"},rdsdataservice:{prefix:"rds-data",name:"RDSDataService"},amplify:{name:"Amplify"},datasync:{name:"DataSync"},robomaker:{name:"RoboMaker"},transfer:{name:"Transfer"},globalaccelerator:{name:"GlobalAccelerator"},comprehendmedical:{name:"ComprehendMedical",cors:!0},kinesisanalyticsv2:{name:"KinesisAnalyticsV2"},mediaconnect:{name:"MediaConnect"},fsx:{name:"FSx"},securityhub:{name:"SecurityHub"},appmesh:{name:"AppMesh",versions:["2018-10-01*"]},licensemanager:{prefix:"license-manager",name:"LicenseManager"},kafka:{name:"Kafka"},apigatewaymanagementapi:{name:"ApiGatewayManagementApi"},apigatewayv2:{name:"ApiGatewayV2"},docdb:{name:"DocDB"},backup:{name:"Backup"},worklink:{name:"WorkLink"},textract:{name:"Textract"},managedblockchain:{name:"ManagedBlockchain"},mediapackagevod:{prefix:"mediapackage-vod",name:"MediaPackageVod"},groundstation:{name:"GroundStation"},iotthingsgraph:{name:"IoTThingsGraph"},iotevents:{name:"IoTEvents"},ioteventsdata:{prefix:"iotevents-data",name:"IoTEventsData"},personalize:{name:"Personalize",cors:!0},personalizeevents:{prefix:"personalize-events",name:"PersonalizeEvents",cors:!0},personalizeruntime:{prefix:"personalize-runtime",name:"PersonalizeRuntime",cors:!0},applicationinsights:{prefix:"application-insights",name:"ApplicationInsights"},servicequotas:{prefix:"service-quotas",name:"ServiceQuotas"},ec2instanceconnect:{prefix:"ec2-instance-connect",name:"EC2InstanceConnect"},eventbridge:{name:"EventBridge"},lakeformation:{name:"LakeFormation"},forecastservice:{prefix:"forecast",name:"ForecastService",cors:!0},forecastqueryservice:{prefix:"forecastquery",name:"ForecastQueryService",cors:!0},qldb:{name:"QLDB"},qldbsession:{prefix:"qldb-session",name:"QLDBSession"},workmailmessageflow:{name:"WorkMailMessageFlow"},codestarnotifications:{prefix:"codestar-notifications",name:"CodeStarNotifications"},savingsplans:{name:"SavingsPlans"},sso:{name:"SSO"},ssooidc:{prefix:"sso-oidc",name:"SSOOIDC"},connectparticipant:{name:"ConnectParticipant"}}},{}],6:[function(e,t,n){t.exports={version:"2.0",metadata:{apiVersion:"2011-06-15",endpointPrefix:"sts",globalEndpoint:"sts.amazonaws.com",protocol:"query",serviceAbbreviation:"AWS STS",serviceFullName:"AWS Security Token Service",serviceId:"STS",signatureVersion:"v4",uid:"sts-2011-06-15",xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/"},operations:{AssumeRole:{input:{type:"structure",required:["RoleArn","RoleSessionName"],members:{RoleArn:{},RoleSessionName:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"},ExternalId:{},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"AssumeRoleResult",type:"structure",members:{Credentials:{shape:"Sc"},AssumedRoleUser:{shape:"Sh"},PackedPolicySize:{type:"integer"}}}},AssumeRoleWithSAML:{input:{type:"structure",required:["RoleArn","PrincipalArn","SAMLAssertion"],members:{RoleArn:{},PrincipalArn:{},SAMLAssertion:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithSAMLResult",type:"structure",members:{Credentials:{shape:"Sc"},AssumedRoleUser:{shape:"Sh"},PackedPolicySize:{type:"integer"},Subject:{},SubjectType:{},Issuer:{},Audience:{},NameQualifier:{}}}},AssumeRoleWithWebIdentity:{input:{type:"structure",required:["RoleArn","RoleSessionName","WebIdentityToken"],members:{RoleArn:{},RoleSessionName:{},WebIdentityToken:{},ProviderId:{},PolicyArns:{shape:"S4"},Policy:{},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"AssumeRoleWithWebIdentityResult",type:"structure",members:{Credentials:{shape:"Sc"},SubjectFromWebIdentityToken:{},AssumedRoleUser:{shape:"Sh"},PackedPolicySize:{type:"integer"},Provider:{},Audience:{}}}},DecodeAuthorizationMessage:{input:{type:"structure",required:["EncodedMessage"],members:{EncodedMessage:{}}},output:{resultWrapper:"DecodeAuthorizationMessageResult",type:"structure",members:{DecodedMessage:{}}}},GetAccessKeyInfo:{input:{type:"structure",required:["AccessKeyId"],members:{AccessKeyId:{}}},output:{resultWrapper:"GetAccessKeyInfoResult",type:"structure",members:{Account:{}}}},GetCallerIdentity:{input:{type:"structure",members:{}},output:{resultWrapper:"GetCallerIdentityResult",type:"structure",members:{UserId:{},Account:{},Arn:{}}}},GetFederationToken:{input:{type:"structure",required:["Name"],members:{Name:{},Policy:{},PolicyArns:{shape:"S4"},DurationSeconds:{type:"integer"}}},output:{resultWrapper:"GetFederationTokenResult",type:"structure",members:{Credentials:{shape:"Sc"},FederatedUser:{type:"structure",required:["FederatedUserId","Arn"],members:{FederatedUserId:{},Arn:{}}},PackedPolicySize:{type:"integer"}}}},GetSessionToken:{input:{type:"structure",members:{DurationSeconds:{type:"integer"},SerialNumber:{},TokenCode:{}}},output:{resultWrapper:"GetSessionTokenResult",type:"structure",members:{Credentials:{shape:"Sc"}}}}},shapes:{S4:{type:"list",member:{type:"structure",members:{arn:{}}}},Sc:{type:"structure",required:["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],members:{AccessKeyId:{},SecretAccessKey:{},SessionToken:{},Expiration:{type:"timestamp"}}},Sh:{type:"structure",required:["AssumedRoleId","Arn"],members:{AssumedRoleId:{},Arn:{}}}}}},{}],7:[function(e,t,n){arguments[4][2][0].apply(n,arguments)},{dup:2}],8:[function(e,t,n){e("../lib/node_loader");var r=e("../lib/core"),i=r.Service,o=r.apiLoader;o.services.cognitoidentity={},r.CognitoIdentity=i.defineService("cognitoidentity",["2014-06-30"]),e("../lib/services/cognitoidentity"),Object.defineProperty(o.services.cognitoidentity,"2014-06-30",{get:function(){var t=e("../apis/cognito-identity-2014-06-30.min.json");return t.paginators=e("../apis/cognito-identity-2014-06-30.paginators.json").pagination,t},enumerable:!0,configurable:!0}),t.exports=r.CognitoIdentity},{"../apis/cognito-identity-2014-06-30.min.json":1,"../apis/cognito-identity-2014-06-30.paginators.json":2,"../lib/core":19,"../lib/node_loader":17,"../lib/services/cognitoidentity":61}],9:[function(e,t,n){e("../lib/node_loader");var r=e("../lib/core"),i=r.Service,o=r.apiLoader;o.services.sts={},r.STS=i.defineService("sts",["2011-06-15"]),e("../lib/services/sts"),Object.defineProperty(o.services.sts,"2011-06-15",{get:function(){var t=e("../apis/sts-2011-06-15.min.json");return t.paginators=e("../apis/sts-2011-06-15.paginators.json").pagination,t},enumerable:!0,configurable:!0}),t.exports=r.STS},{"../apis/sts-2011-06-15.min.json":6,"../apis/sts-2011-06-15.paginators.json":7,"../lib/core":19,"../lib/node_loader":17,"../lib/services/sts":62}],10:[function(e,t,n){function r(e,t){if(!r.services.hasOwnProperty(e))throw new Error("InvalidService: Failed to load api for "+e);return r.services[e][t]}r.services={},t.exports=r},{}],11:[function(e,t,n){var r=e("./browserHmac"),i=e("./browserMd5"),o=e("./browserSha1"),s=e("./browserSha256");t.exports={createHash:function(e){if("md5"===(e=e.toLowerCase()))return new i;if("sha256"===e)return new s;if("sha1"===e)return new o;throw new Error("Hash algorithm "+e+" is not supported in the browser SDK")},createHmac:function(e,t){if("md5"===(e=e.toLowerCase()))return new r(i,t);if("sha256"===e)return new r(s,t);if("sha1"===e)return new r(o,t);throw new Error("HMAC algorithm "+e+" is not supported in the browser SDK")},createSign:function(){throw new Error("createSign is not implemented in the browser")}}},{"./browserHmac":13,"./browserMd5":14,"./browserSha1":15,"./browserSha256":16}],12:[function(e,t,n){var r=e("buffer/").Buffer;"undefined"!=typeof ArrayBuffer&&void 0===ArrayBuffer.isView&&(ArrayBuffer.isView=function(e){return i.indexOf(Object.prototype.toString.call(e))>-1});var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"];t.exports={isEmptyData:function(e){return"string"==typeof e?0===e.length:0===e.byteLength},convertToBuffer:function(e){return"string"==typeof e&&(e=new r(e,"utf8")),ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}},{"buffer/":81}],13:[function(e,t,n){function r(e,t){this.hash=new e,this.outer=new e;var n=i(e,t),r=new Uint8Array(e.BLOCK_SIZE);r.set(n);for(var o=0;o<e.BLOCK_SIZE;o++)n[o]^=54,r[o]^=92;this.hash.update(n),this.outer.update(r);for(o=0;o<n.byteLength;o++)n[o]=0}function i(e,t){var n=o.convertToBuffer(t);if(n.byteLength>e.BLOCK_SIZE){var r=new e;r.update(n),n=r.digest()}var i=new Uint8Array(e.BLOCK_SIZE);return i.set(n),i}var o=e("./browserHashUtils");t.exports=r,r.prototype.update=function(e){if(o.isEmptyData(e)||this.error)return this;try{this.hash.update(o.convertToBuffer(e))}catch(e){this.error=e}return this},r.prototype.digest=function(e){return this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest(e)}},{"./browserHashUtils":12}],14:[function(e,t,n){function r(){this.state=[1732584193,4023233417,2562383102,271733878],this.buffer=new DataView(new ArrayBuffer(p)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}function i(e,t,n,r,i,o){return((t=(t+e&4294967295)+(r+o&4294967295)&4294967295)<<i|t>>>32-i)+n&4294967295}function o(e,t,n,r,o,s,a){return i(t&n|~t&r,e,t,o,s,a)}function s(e,t,n,r,o,s,a){return i(t&r|n&~r,e,t,o,s,a)}function a(e,t,n,r,o,s,a){return i(t^n^r,e,t,o,s,a)}function c(e,t,n,r,o,s,a){return i(n^(t|~r),e,t,o,s,a)}var u=e("./browserHashUtils"),l=e("buffer/").Buffer,p=64;t.exports=r,r.BLOCK_SIZE=p,r.prototype.update=function(e){if(u.isEmptyData(e))return this;if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=u.convertToBuffer(e),n=0,r=t.byteLength;for(this.bytesHashed+=r;r>0;)this.buffer.setUint8(this.bufferLength++,t[n++]),r--,this.bufferLength===p&&(this.hashBuffer(),this.bufferLength=0);return this},r.prototype.digest=function(e){if(!this.finished){var t=this,n=t.buffer,r=t.bufferLength,i=8*t.bytesHashed;if(n.setUint8(this.bufferLength++,128),r%p>=p-8){for(var o=this.bufferLength;o<p;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<p-8;o++)n.setUint8(o,0);n.setUint32(p-8,i>>>0,!0),n.setUint32(p-4,Math.floor(i/4294967296),!0),this.hashBuffer(),this.finished=!0}var s=new DataView(new ArrayBuffer(16));for(o=0;o<4;o++)s.setUint32(4*o,this.state[o],!0);var a=new l(s.buffer,s.byteOffset,s.byteLength);return e?a.toString(e):a},r.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],u=t[3];n=o(n,r,i,u,e.getUint32(0,!0),7,3614090360),u=o(u,n,r,i,e.getUint32(4,!0),12,3905402710),i=o(i,u,n,r,e.getUint32(8,!0),17,606105819),r=o(r,i,u,n,e.getUint32(12,!0),22,3250441966),n=o(n,r,i,u,e.getUint32(16,!0),7,4118548399),u=o(u,n,r,i,e.getUint32(20,!0),12,1200080426),i=o(i,u,n,r,e.getUint32(24,!0),17,2821735955),r=o(r,i,u,n,e.getUint32(28,!0),22,4249261313),n=o(n,r,i,u,e.getUint32(32,!0),7,1770035416),u=o(u,n,r,i,e.getUint32(36,!0),12,2336552879),i=o(i,u,n,r,e.getUint32(40,!0),17,4294925233),r=o(r,i,u,n,e.getUint32(44,!0),22,2304563134),n=o(n,r,i,u,e.getUint32(48,!0),7,1804603682),u=o(u,n,r,i,e.getUint32(52,!0),12,4254626195),i=o(i,u,n,r,e.getUint32(56,!0),17,2792965006),n=s(n,r=o(r,i,u,n,e.getUint32(60,!0),22,1236535329),i,u,e.getUint32(4,!0),5,4129170786),u=s(u,n,r,i,e.getUint32(24,!0),9,3225465664),i=s(i,u,n,r,e.getUint32(44,!0),14,643717713),r=s(r,i,u,n,e.getUint32(0,!0),20,3921069994),n=s(n,r,i,u,e.getUint32(20,!0),5,3593408605),u=s(u,n,r,i,e.getUint32(40,!0),9,38016083),i=s(i,u,n,r,e.getUint32(60,!0),14,3634488961),r=s(r,i,u,n,e.getUint32(16,!0),20,3889429448),n=s(n,r,i,u,e.getUint32(36,!0),5,568446438),u=s(u,n,r,i,e.getUint32(56,!0),9,3275163606),i=s(i,u,n,r,e.getUint32(12,!0),14,4107603335),r=s(r,i,u,n,e.getUint32(32,!0),20,1163531501),n=s(n,r,i,u,e.getUint32(52,!0),5,2850285829),u=s(u,n,r,i,e.getUint32(8,!0),9,4243563512),i=s(i,u,n,r,e.getUint32(28,!0),14,1735328473),n=a(n,r=s(r,i,u,n,e.getUint32(48,!0),20,2368359562),i,u,e.getUint32(20,!0),4,4294588738),u=a(u,n,r,i,e.getUint32(32,!0),11,2272392833),i=a(i,u,n,r,e.getUint32(44,!0),16,1839030562),r=a(r,i,u,n,e.getUint32(56,!0),23,4259657740),n=a(n,r,i,u,e.getUint32(4,!0),4,2763975236),u=a(u,n,r,i,e.getUint32(16,!0),11,1272893353),i=a(i,u,n,r,e.getUint32(28,!0),16,4139469664),r=a(r,i,u,n,e.getUint32(40,!0),23,3200236656),n=a(n,r,i,u,e.getUint32(52,!0),4,681279174),u=a(u,n,r,i,e.getUint32(0,!0),11,3936430074),i=a(i,u,n,r,e.getUint32(12,!0),16,3572445317),r=a(r,i,u,n,e.getUint32(24,!0),23,76029189),n=a(n,r,i,u,e.getUint32(36,!0),4,3654602809),u=a(u,n,r,i,e.getUint32(48,!0),11,3873151461),i=a(i,u,n,r,e.getUint32(60,!0),16,530742520),n=c(n,r=a(r,i,u,n,e.getUint32(8,!0),23,3299628645),i,u,e.getUint32(0,!0),6,4096336452),u=c(u,n,r,i,e.getUint32(28,!0),10,1126891415),i=c(i,u,n,r,e.getUint32(56,!0),15,2878612391),r=c(r,i,u,n,e.getUint32(20,!0),21,4237533241),n=c(n,r,i,u,e.getUint32(48,!0),6,1700485571),u=c(u,n,r,i,e.getUint32(12,!0),10,2399980690),i=c(i,u,n,r,e.getUint32(40,!0),15,4293915773),r=c(r,i,u,n,e.getUint32(4,!0),21,2240044497),n=c(n,r,i,u,e.getUint32(32,!0),6,1873313359),u=c(u,n,r,i,e.getUint32(60,!0),10,4264355552),i=c(i,u,n,r,e.getUint32(24,!0),15,2734768916),r=c(r,i,u,n,e.getUint32(52,!0),21,1309151649),n=c(n,r,i,u,e.getUint32(16,!0),6,4149444226),u=c(u,n,r,i,e.getUint32(44,!0),10,3174756917),i=c(i,u,n,r,e.getUint32(8,!0),15,718787259),r=c(r,i,u,n,e.getUint32(36,!0),21,3951481745),t[0]=n+t[0]&4294967295,t[1]=r+t[1]&4294967295,t[2]=i+t[2]&4294967295,t[3]=u+t[3]&4294967295}},{"./browserHashUtils":12,"buffer/":81}],15:[function(e,t,n){function r(){this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=new Uint32Array(80),this.offset=0,this.shift=24,this.totalLength=0}var i=e("buffer/").Buffer,o=e("./browserHashUtils");new Uint32Array([1518500249,1859775393,-1894007588,-899497514]),Math.pow(2,53),t.exports=r,r.BLOCK_SIZE=64,r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(o.isEmptyData(e))return this;var t=(e=o.convertToBuffer(e)).length;this.totalLength+=8*t;for(var n=0;n<t;n++)this.write(e[n]);return this},r.prototype.write=function(e){this.block[this.offset]|=(255&e)<<this.shift,this.shift?this.shift-=8:(this.offset++,this.shift=24),16===this.offset&&this.processBlock()},r.prototype.digest=function(e){this.write(128),(this.offset>14||14===this.offset&&this.shift<24)&&this.processBlock(),this.offset=14,this.shift=24,this.write(0),this.write(0),this.write(this.totalLength>0xffffffffff?this.totalLength/1099511627776:0),this.write(this.totalLength>4294967295?this.totalLength/4294967296:0);for(var t=24;t>=0;t-=8)this.write(this.totalLength>>t);var n=new i(20),r=new DataView(n.buffer);return r.setUint32(0,this.h0,!1),r.setUint32(4,this.h1,!1),r.setUint32(8,this.h2,!1),r.setUint32(12,this.h3,!1),r.setUint32(16,this.h4,!1),e?n.toString(e):n},r.prototype.processBlock=function(){for(var e=16;e<80;e++){var t=this.block[e-3]^this.block[e-8]^this.block[e-14]^this.block[e-16];this.block[e]=t<<1|t>>>31}var n,r,i=this.h0,o=this.h1,s=this.h2,a=this.h3,c=this.h4;for(e=0;e<80;e++){e<20?(n=a^o&(s^a),r=1518500249):e<40?(n=o^s^a,r=1859775393):e<60?(n=o&s|a&(o|s),r=2400959708):(n=o^s^a,r=3395469782);var u=(i<<5|i>>>27)+n+c+r+(0|this.block[e]);c=a,a=s,s=o<<30|o>>>2,o=i,i=u}for(this.h0=this.h0+i|0,this.h1=this.h1+o|0,this.h2=this.h2+s|0,this.h3=this.h3+a|0,this.h4=this.h4+c|0,this.offset=0,e=0;e<16;e++)this.block[e]=0}},{"./browserHashUtils":12,"buffer/":81}],16:[function(e,t,n){function r(){this.state=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}var i=e("buffer/").Buffer,o=e("./browserHashUtils"),s=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=Math.pow(2,53)-1;t.exports=r,r.BLOCK_SIZE=64,r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(o.isEmptyData(e))return this;var t=0,n=(e=o.convertToBuffer(e)).byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>a)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0);return this},r.prototype.digest=function(e){if(!this.finished){var t=8*this.bytesHashed,n=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),r=this.bufferLength;if(n.setUint8(this.bufferLength++,128),r%64>=56){for(var o=this.bufferLength;o<64;o++)n.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(o=this.bufferLength;o<56;o++)n.setUint8(o,0);n.setUint32(56,Math.floor(t/4294967296),!0),n.setUint32(60,t),this.hashBuffer(),this.finished=!0}var s=new i(32);for(o=0;o<8;o++)s[4*o]=this.state[o]>>>24&255,s[4*o+1]=this.state[o]>>>16&255,s[4*o+2]=this.state[o]>>>8&255,s[4*o+3]=this.state[o]>>>0&255;return e?s.toString(e):s},r.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],c=t[5],u=t[6],l=t[7],p=0;p<64;p++){if(p<16)this.temp[p]=(255&e[4*p])<<24|(255&e[4*p+1])<<16|(255&e[4*p+2])<<8|255&e[4*p+3];else{var h=this.temp[p-2],f=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,d=((h=this.temp[p-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[p]=(f+this.temp[p-7]|0)+(d+this.temp[p-16]|0)}var m=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&u)|0)+(l+(s[p]+this.temp[p]|0)|0)|0,g=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&r^n&i^r&i)|0;l=u,u=c,c=a,a=o+m|0,o=i,i=r,r=n,n=m+g|0}t[0]+=n,t[1]+=r,t[2]+=i,t[3]+=o,t[4]+=a,t[5]+=c,t[6]+=u,t[7]+=l}},{"./browserHashUtils":12,"buffer/":81}],17:[function(e,t,n){(function(n){var r=e("./util");r.crypto.lib=e("./browserCryptoLib"),r.Buffer=e("buffer/").Buffer,r.url=e("url/"),r.querystring=e("querystring/"),r.realClock=e("./realclock/browserClock"),r.environment="js",r.createEventStream=e("./event-stream/buffered-create-event-stream").createEventStream,r.isBrowser=function(){return!0},r.isNode=function(){return!1};var i=e("./core");if(t.exports=i,e("./credentials"),e("./credentials/credential_provider_chain"),e("./credentials/temporary_credentials"),e("./credentials/chainable_temporary_credentials"),e("./credentials/web_identity_credentials"),e("./credentials/cognito_identity_credentials"),e("./credentials/saml_credentials"),i.XML.Parser=e("./xml/browser_parser"),e("./http/xhr"),void 0===n)n={browser:!0}}).call(this,e("_process"))},{"./browserCryptoLib":11,"./core":19,"./credentials":20,"./credentials/chainable_temporary_credentials":21,"./credentials/cognito_identity_credentials":22,"./credentials/credential_provider_chain":23,"./credentials/saml_credentials":24,"./credentials/temporary_credentials":25,"./credentials/web_identity_credentials":26,"./event-stream/buffered-create-event-stream":28,"./http/xhr":36,"./realclock/browserClock":53,"./util":72,"./xml/browser_parser":73,_process:86,"buffer/":81,"querystring/":93,"url/":95}],18:[function(e,t,n){var r,i=e("./core");e("./credentials"),e("./credentials/credential_provider_chain"),i.Config=i.util.inherit({constructor:function(e){void 0===e&&(e={}),e=this.extractCredentials(e),i.util.each.call(this,this.keys,(function(t,n){this.set(t,e[t],n)}))},getCredentials:function(e){function t(t){e(t,t?null:r.credentials)}function n(e,t){return new i.util.error(t||new Error,{code:"CredentialsError",message:e,name:"CredentialsError"})}var r=this;r.credentials?"function"==typeof r.credentials.get?r.credentials.get((function(e){e&&(e=n("Could not load credentials from "+r.credentials.constructor.name,e)),t(e)})):function(){var e=null;r.credentials.accessKeyId&&r.credentials.secretAccessKey||(e=n("Missing credentials")),t(e)}():r.credentialProvider?r.credentialProvider.resolve((function(e,i){e&&(e=n("Could not load credentials from any providers",e)),r.credentials=i,t(e)})):t(n("No credentials to load"))},update:function(e,t){t=t||!1,e=this.extractCredentials(e),i.util.each.call(this,e,(function(e,n){(t||Object.prototype.hasOwnProperty.call(this.keys,e)||i.Service.hasService(e))&&this.set(e,n)}))},loadFromPath:function(e){this.clear();var t=JSON.parse(i.util.readFileSync(e)),n=new i.FileSystemCredentials(e),r=new i.CredentialProviderChain;return r.providers.unshift(n),r.resolve((function(e,n){if(e)throw e;t.credentials=n})),this.constructor(t),this},clear:function(){i.util.each.call(this,this.keys,(function(e){delete this[e]})),this.set("credentials",void 0),this.set("credentialProvider",void 0)},set:function(e,t,n){void 0===t?(void 0===n&&(n=this.keys[e]),this[e]="function"==typeof n?n.call(this):n):"httpOptions"===e&&this[e]?this[e]=i.util.merge(this[e],t):this[e]=t},keys:{credentials:null,credentialProvider:null,region:null,logger:null,apiVersions:{},apiVersion:null,endpoint:void 0,httpOptions:{timeout:12e4},maxRetries:void 0,maxRedirects:10,paramValidation:!0,sslEnabled:!0,s3ForcePathStyle:!1,s3BucketEndpoint:!1,s3DisableBodySigning:!0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:!1,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:null},extractCredentials:function(e){return e.accessKeyId&&e.secretAccessKey&&((e=i.util.copy(e)).credentials=new i.Credentials(e)),e},setPromisesDependency:function(e){r=e,null===e&&"function"==typeof Promise&&(r=Promise);var t=[i.Request,i.Credentials,i.CredentialProviderChain];i.S3&&(t.push(i.S3),i.S3.ManagedUpload&&t.push(i.S3.ManagedUpload)),i.util.addPromises(t,r)},getPromisesDependency:function(){return r}}),i.config=new i.Config},{"./core":19,"./credentials":20,"./credentials/credential_provider_chain":23}],19:[function(e,t,n){var r={util:e("./util")};({}).toString(),t.exports=r,r.util.update(r,{VERSION:"2.569.0",Signers:{},Protocol:{Json:e("./protocol/json"),Query:e("./protocol/query"),Rest:e("./protocol/rest"),RestJson:e("./protocol/rest_json"),RestXml:e("./protocol/rest_xml")},XML:{Builder:e("./xml/builder"),Parser:null},JSON:{Builder:e("./json/builder"),Parser:e("./json/parser")},Model:{Api:e("./model/api"),Operation:e("./model/operation"),Shape:e("./model/shape"),Paginator:e("./model/paginator"),ResourceWaiter:e("./model/resource_waiter")},apiLoader:e("./api_loader"),EndpointCache:e("../vendor/endpoint-cache").EndpointCache}),e("./sequential_executor"),e("./service"),e("./config"),e("./http"),e("./event_listeners"),e("./request"),e("./response"),e("./resource_waiter"),e("./signers/request_signer"),e("./param_validator"),r.events=new r.SequentialExecutor,r.util.memoizedProperty(r,"endpointCache",(function(){return new r.EndpointCache(r.config.endpointCacheSize)}),!0)},{"../vendor/endpoint-cache":104,"./api_loader":10,"./config":18,"./event_listeners":34,"./http":35,"./json/builder":37,"./json/parser":38,"./model/api":39,"./model/operation":41,"./model/paginator":42,"./model/resource_waiter":43,"./model/shape":44,"./param_validator":45,"./protocol/json":47,"./protocol/query":48,"./protocol/rest":49,"./protocol/rest_json":50,"./protocol/rest_xml":51,"./request":56,"./resource_waiter":57,"./response":58,"./sequential_executor":59,"./service":60,"./signers/request_signer":64,"./util":72,"./xml/builder":74}],20:[function(e,t,n){var r=e("./core");r.Credentials=r.util.inherit({constructor:function(){if(r.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],1===arguments.length&&"object"==s(arguments[0])){var e=arguments[0].credentials||arguments[0];this.accessKeyId=e.accessKeyId,this.secretAccessKey=e.secretAccessKey,this.sessionToken=e.sessionToken}else this.accessKeyId=arguments[0],this.secretAccessKey=arguments[1],this.sessionToken=arguments[2]},expiryWindow:15,needsRefresh:function(){var e=r.util.date.getDate().getTime(),t=new Date(e+1e3*this.expiryWindow);return!!(this.expireTime&&t>this.expireTime)||this.expired||!this.accessKeyId||!this.secretAccessKey},get:function(e){var t=this;this.needsRefresh()?this.refresh((function(n){n||(t.expired=!1),e&&e(n)})):e&&e()},refresh:function(e){this.expired=!1,e()},coalesceRefresh:function(e,t){var n=this;1===n.refreshCallbacks.push(e)&&n.load((function(e){r.util.arrayEach(n.refreshCallbacks,(function(n){t?n(e):r.util.defer((function(){n(e)}))})),n.refreshCallbacks.length=0}))},load:function(e){e()}}),r.Credentials.addPromisesToClass=function(e){this.prototype.getPromise=r.util.promisifyMethod("get",e),this.prototype.refreshPromise=r.util.promisifyMethod("refresh",e)},r.Credentials.deletePromisesFromClass=function(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},r.util.addPromises(r.Credentials)},{"./core":19}],21:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.ChainableTemporaryCredentials=r.util.inherit(r.Credentials,{constructor:function(e){r.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var t=r.util.copy(e.params)||{};if(t.RoleArn&&(t.RoleSessionName=t.RoleSessionName||"temporary-credentials"),t.SerialNumber){if(!e.tokenCodeFn||"function"!=typeof e.tokenCodeFn)throw new r.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var n=r.util.merge({params:t,credentials:e.masterCredentials||r.config.credentials},e.stsConfig||{});this.service=new i(n)},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this,n=t.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode((function(r,i){var o={};r?e(r):(i&&(o.TokenCode=i),t.service[n](o,(function(n,r){n||t.service.credentialsFrom(r,t),e(n)})))}))},getTokenCode:function(e){var t=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,(function(n,i){if(n){var o=n;return n instanceof Error&&(o=n.message),void e(r.util.error(new Error("Error fetching MFA token: "+o),{code:t.errorCode}))}e(null,i)})):e(null)}})},{"../../clients/sts":9,"../core":19}],22:[function(e,t,n){var r=e("../core"),i=e("../../clients/cognitoidentity"),o=e("../../clients/sts");r.CognitoIdentityCredentials=r.util.inherit(r.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function(e,t){r.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=r.util.copy(t||{}),this.loadCachedId();var n=this;Object.defineProperty(this,"identityId",{get:function(){return n.loadCachedId(),n._identityId||n.params.IdentityId},set:function(e){n._identityId=e}})},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.data=null,t._identityId=null,t.getId((function(n){n?(t.clearIdOnNotAuthorized(n),e(n)):t.params.RoleArn?t.getCredentialsFromSTS(e):t.getCredentialsForIdentity(e)}))},clearCachedId:function(){this._identityId=null,delete this.params.IdentityId;var e=this.params.IdentityPoolId,t=this.params.LoginId||"";delete this.storage[this.localStorageKey.id+e+t],delete this.storage[this.localStorageKey.providers+e+t]},clearIdOnNotAuthorized:function(e){"NotAuthorizedException"==e.code&&this.clearCachedId()},getId:function(e){var t=this;if("string"==typeof t.params.IdentityId)return e(null,t.params.IdentityId);t.cognito.getId((function(n,r){!n&&r.IdentityId?(t.params.IdentityId=r.IdentityId,e(null,r.IdentityId)):e(n)}))},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(n,r){n?t.clearIdOnNotAuthorized(n):(t.cacheId(r),t.data=r,t.loadCredentials(t.data,t)),e(n)}))},getCredentialsFromSTS:function(e){var t=this;t.cognito.getOpenIdToken((function(n,r){n?(t.clearIdOnNotAuthorized(n),e(n)):(t.cacheId(r),t.params.WebIdentityToken=r.Token,t.webIdentityCredentials.refresh((function(n){n||(t.data=t.webIdentityCredentials.data,t.sts.credentialsFrom(t.data,t)),e(n)})))}))},loadCachedId:function(){var e=this;if(r.util.isBrowser()&&!e.params.IdentityId){var t=e.getStorage("id");if(t&&e.params.Logins){var n=Object.keys(e.params.Logins);0!==(e.getStorage("providers")||"").split(",").filter((function(e){return-1!==n.indexOf(e)})).length&&(e.params.IdentityId=t)}else t&&(e.params.IdentityId=t)}},createClients:function(){var e=this._clientConfig;if(this.webIdentityCredentials=this.webIdentityCredentials||new r.WebIdentityCredentials(this.params,e),!this.cognito){var t=r.util.merge({},e);t.params=this.params,this.cognito=new i(t)}this.sts=this.sts||new o(e)},cacheId:function(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,r.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+(this.params.LoginId||"")]},setStorage:function(e,t){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=t}catch(e){}},storage:function(){try{var e=r.util.isBrowser()&&null!==window.localStorage&&"object"==s(window.localStorage)?window.localStorage:{};return e["aws.test-storage"]="foobar",delete e["aws.test-storage"],e}catch(e){return{}}}()})},{"../../clients/cognitoidentity":8,"../../clients/sts":9,"../core":19}],23:[function(e,t,n){var r=e("../core");r.CredentialProviderChain=r.util.inherit(r.Credentials,{constructor:function(e){this.providers=e||r.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},resolve:function(e){var t=this;if(0===t.providers.length)return e(new Error("No providers")),t;if(1===t.resolveCallbacks.push(e)){var n=0,i=t.providers.slice(0);!function e(o,s){if(!o&&s||n===i.length)return r.util.arrayEach(t.resolveCallbacks,(function(e){e(o,s)})),void(t.resolveCallbacks.length=0);var a=i[n++];(s="function"==typeof a?a.call():a).get?s.get((function(t){e(t,t?null:s)})):e(null,s)}()}return t}}),r.CredentialProviderChain.defaultProviders=[],r.CredentialProviderChain.addPromisesToClass=function(e){this.prototype.resolvePromise=r.util.promisifyMethod("resolve",e)},r.CredentialProviderChain.deletePromisesFromClass=function(){delete this.prototype.resolvePromise},r.util.addPromises(r.CredentialProviderChain)},{"../core":19}],24:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.SAMLCredentials=r.util.inherit(r.Credentials,{constructor:function(e){r.Credentials.call(this),this.expired=!0,this.params=e},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.service.assumeRoleWithSAML((function(n,r){n||t.service.credentialsFrom(r,t),e(n)}))},createClients:function(){this.service=this.service||new i({params:this.params})}})},{"../../clients/sts":9,"../core":19}],25:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.TemporaryCredentials=r.util.inherit(r.Credentials,{constructor:function(e,t){r.Credentials.call(this),this.loadMasterCredentials(t),this.expired=!0,this.params=e||{},this.params.RoleArn&&(this.params.RoleSessionName=this.params.RoleSessionName||"temporary-credentials")},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.masterCredentials.get((function(){t.service.config.credentials=t.masterCredentials,(t.params.RoleArn?t.service.assumeRole:t.service.getSessionToken).call(t.service,(function(n,r){n||t.service.credentialsFrom(r,t),e(n)}))}))},loadMasterCredentials:function(e){for(this.masterCredentials=e||r.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;"function"!=typeof this.masterCredentials.get&&(this.masterCredentials=new r.Credentials(this.masterCredentials))},createClients:function(){this.service=this.service||new i({params:this.params})}})},{"../../clients/sts":9,"../core":19}],26:[function(e,t,n){var r=e("../core"),i=e("../../clients/sts");r.WebIdentityCredentials=r.util.inherit(r.Credentials,{constructor:function(e,t){r.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=r.util.copy(t||{})},refresh:function(e){this.coalesceRefresh(e||r.util.fn.callback)},load:function(e){var t=this;t.createClients(),t.service.assumeRoleWithWebIdentity((function(n,r){t.data=null,n||(t.data=r,t.service.credentialsFrom(r,t)),e(n)}))},createClients:function(){if(!this.service){var e=r.util.merge({},this._clientConfig);e.params=this.params,this.service=new i(e)}}})},{"../../clients/sts":9,"../core":19}],27:[function(e,t,n){(function(n){function r(e){var t=e.service,n=t.api||{},r={};return t.config.region&&(r.region=t.config.region),n.serviceId&&(r.serviceId=n.serviceId),t.config.credentials.accessKeyId&&(r.accessKeyId=t.config.credentials.accessKeyId),r}function i(e,t){var n={};return function e(t,n,r){r&&null!=n&&"structure"===r.type&&r.required&&r.required.length>0&&h.arrayEach(r.required,(function(i){var o=r.members[i];if(!0===o.endpointDiscoveryId){var s=o.isLocationName?o.name:i;t[s]=String(n[i])}else e(t,n[i],o)}))}(n,e.params,t),n}function o(e){var t=e.service,n=t.api,o=n.operations?n.operations[e.operation]:void 0,s=i(e,o?o.input:void 0),c=r(e);Object.keys(s).length>0&&(c=h.update(c,s),o&&(c.operation=o.name));var u=p.endpointCache.get(c);if(!u||1!==u.length||""!==u[0].Address)if(u&&u.length>0)e.httpRequest.updateEndpoint(u[0].Address);else{var l=t.makeRequest(n.endpointOperation,{Operation:o.name,Identifiers:s});a(l),l.removeListener("validate",p.EventListeners.Core.VALIDATE_PARAMETERS),l.removeListener("retry",p.EventListeners.Core.RETRY_CHECK),p.endpointCache.put(c,[{Address:"",CachePeriodInMinutes:1}]),l.send((function(e,t){t&&t.Endpoints?p.endpointCache.put(c,t.Endpoints):e&&p.endpointCache.put(c,[{Address:"",CachePeriodInMinutes:1}])}))}}function s(e,t){var n=e.service,o=n.api,s=o.operations?o.operations[e.operation]:void 0,c=s?s.input:void 0,u=i(e,c),l=r(e);Object.keys(u).length>0&&(l=h.update(l,u),s&&(l.operation=s.name));var f=p.EndpointCache.getKeyString(l),m=p.endpointCache.get(f);if(m&&1===m.length&&""===m[0].Address)return d[f]||(d[f]=[]),void d[f].push({request:e,callback:t});if(m&&m.length>0)e.httpRequest.updateEndpoint(m[0].Address),t();else{var g=n.makeRequest(o.endpointOperation,{Operation:s.name,Identifiers:u});g.removeListener("validate",p.EventListeners.Core.VALIDATE_PARAMETERS),a(g),p.endpointCache.put(f,[{Address:"",CachePeriodInMinutes:60}]),g.send((function(n,r){if(n){var i={code:"EndpointDiscoveryException",message:"Request cannot be fulfilled without specifying an endpoint",retryable:!1};if(e.response.error=h.error(n,i),p.endpointCache.remove(l),d[f]){var o=d[f];h.arrayEach(o,(function(e){e.request.response.error=h.error(n,i),e.callback()})),delete d[f]}}else if(r&&(p.endpointCache.put(f,r.Endpoints),e.httpRequest.updateEndpoint(r.Endpoints[0].Address),d[f])){o=d[f];h.arrayEach(o,(function(e){e.request.httpRequest.updateEndpoint(r.Endpoints[0].Address),e.callback()})),delete d[f]}t()}))}}function a(e){var t=e.service.api.apiVersion;t&&!e.httpRequest.headers["x-amz-api-version"]&&(e.httpRequest.headers["x-amz-api-version"]=t)}function c(e){var t=e.error,n=e.httpResponse;if(t&&("InvalidEndpointException"===t.code||421===n.statusCode)){var o=e.request,s=o.service.api.operations||{},a=i(o,s[o.operation]?s[o.operation].input:void 0),c=r(o);Object.keys(a).length>0&&(c=h.update(c,a),s[o.operation]&&(c.operation=s[o.operation].name)),p.endpointCache.remove(c)}}function u(e){return["false","0"].indexOf(e)>=0}function l(e){if(!0===(e.service||{}).config.endpointDiscoveryEnabled)return!0;if(h.isBrowser())return!1;for(var t=0;t<f.length;t++){var r=f[t];if(Object.prototype.hasOwnProperty.call(n.env,r)){if(""===n.env[r]||void 0===n.env[r])throw h.error(new Error,{code:"ConfigurationException",message:"environmental variable "+r+" cannot be set to nothing"});if(!u(n.env[r]))return!0}}var i={};try{i=p.util.iniLoader?p.util.iniLoader.loadFrom({isConfig:!0,filename:n.env[p.util.sharedConfigFileEnv]}):{}}catch(e){}var o=i[n.env.AWS_PROFILE||p.util.defaultProfile]||{};if(Object.prototype.hasOwnProperty.call(o,"endpoint_discovery_enabled")){if(void 0===o.endpoint_discovery_enabled)throw h.error(new Error,{code:"ConfigurationException",message:"config file entry 'endpoint_discovery_enabled' cannot be set to nothing"});if(!u(o.endpoint_discovery_enabled))return!0}return!1}var p=e("./core"),h=e("./util"),f=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"],d={};t.exports={discoverEndpoint:function(e,t){var n=e.service||{};if(function(e){if(e._originalConfig&&e._originalConfig.endpoint&&!0===e._originalConfig.endpointDiscoveryEnabled)throw h.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var t=p.config[e.serviceIdentifier]||{};return Boolean(p.config.endpoint||t.endpoint||e._originalConfig&&e._originalConfig.endpoint)}(n)||e.isPresigned())return t();if(!l(e))return t();e.httpRequest.appendToUserAgent("endpoint-discovery");var r=(n.api.operations||{})[e.operation];switch(r?r.endpointDiscoveryRequired:"NULL"){case"OPTIONAL":o(e),e.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",c),t();break;case"REQUIRED":e.addNamedListener("INVALIDATE_CACHED_ENDPOINTS","extractError",c),s(e,t);break;case"NULL":default:t()}},requiredDiscoverEndpoint:s,optionalDiscoverEndpoint:o,marshallCustomIdentifiers:i,getCacheKey:r,invalidateCachedEndpoint:c}}).call(this,e("_process"))},{"./core":19,"./util":72,_process:86}],28:[function(e,t,n){var r=e("../event-stream/event-message-chunker").eventMessageChunker,i=e("./parse-event").parseEvent;t.exports={createEventStream:function(e,t,n){for(var o=r(e),s=[],a=0;a<o.length;a++)s.push(i(t,o[a],n));return s}}},{"../event-stream/event-message-chunker":29,"./parse-event":31}],29:[function(e,t,n){t.exports={eventMessageChunker:function(e){for(var t=[],n=0;n<e.length;){var r=e.readInt32BE(n),i=e.slice(n,r+n);n+=r,t.push(i)}return t}}},{}],30:[function(e,t,n){function r(e){if(8!==e.length)throw new Error("Int64 buffers must be exactly 8 bytes");o.Buffer.isBuffer(e)||(e=s(e)),this.bytes=e}function i(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&0==++e[t];t--);}var o=e("../core").util,s=o.buffer.toBuffer;r.fromNumber=function(e){if(e>0x8000000000000000||e<-0x8000000000000000)throw new Error(e+" is too large (or, if negative, too small) to represent as an Int64");for(var t=new Uint8Array(8),n=7,o=Math.abs(Math.round(e));n>-1&&o>0;n--,o/=256)t[n]=o;return e<0&&i(t),new r(t)},r.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&i(e),parseInt(e.toString("hex"),16)*(t?-1:1)},r.prototype.toString=function(){return String(this.valueOf())},t.exports={Int64:r}},{"../core":19}],31:[function(e,t,n){var r=e("./parse-message").parseMessage;t.exports={parseEvent:function(e,t,n){var i=r(t),o=i.headers[":message-type"];if(o){if("error"===o.value)throw function(e){var t=e.headers[":error-code"],n=e.headers[":error-message"],r=new Error(n.value||n);return r.code=r.name=t.value||t,r}(i);if("event"!==o.value)return}var s=i.headers[":event-type"],a=n.members[s.value];if(a){var c={},u=a.eventPayloadMemberName;if(u){var l=a.members[u];"binary"===l.type?c[u]=i.body:c[u]=e.parse(i.body.toString(),l)}for(var p=a.eventHeaderMemberNames,h=0;h<p.length;h++){var f=p[h];i.headers[f]&&(c[f]=a.members[f].toType(i.headers[f].value))}var d={};return d[s.value]=c,d}}}},{"./parse-message":32}],32:[function(e,t,n){function r(e){for(var t={},n=0;n<e.length;){var r=e.readUInt8(n++),o=e.slice(n,n+r).toString();switch(n+=r,e.readUInt8(n++)){case 0:t[o]={type:s,value:!0};break;case 1:t[o]={type:s,value:!1};break;case 2:t[o]={type:a,value:e.readInt8(n++)};break;case 3:t[o]={type:c,value:e.readInt16BE(n)},n+=2;break;case 4:t[o]={type:u,value:e.readInt32BE(n)},n+=4;break;case 5:t[o]={type:l,value:new i(e.slice(n,n+8))},n+=8;break;case 6:var m=e.readUInt16BE(n);n+=2,t[o]={type:p,value:e.slice(n,n+m)},n+=m;break;case 7:var g=e.readUInt16BE(n);n+=2,t[o]={type:h,value:e.slice(n,n+g).toString()},n+=g;break;case 8:t[o]={type:f,value:new Date(new i(e.slice(n,n+8)).valueOf())},n+=8;break;case 9:var y=e.slice(n,n+16).toString("hex");n+=16,t[o]={type:d,value:y.substr(0,8)+"-"+y.substr(8,4)+"-"+y.substr(12,4)+"-"+y.substr(16,4)+"-"+y.substr(20)};break;default:throw new Error("Unrecognized header type tag")}}return t}var i=e("./int64").Int64,o=e("./split-message").splitMessage,s="boolean",a="byte",c="short",u="integer",l="long",p="binary",h="string",f="timestamp",d="uuid";t.exports={parseMessage:function(e){var t=o(e);return{headers:r(t.headers),body:t.body}}}},{"./int64":30,"./split-message":33}],33:[function(e,t,n){var r=e("../core").util,i=r.buffer.toBuffer,o=4,s=2*o,a=4,c=s+2*a;t.exports={splitMessage:function(e){if(r.Buffer.isBuffer(e)||(e=i(e)),e.length<c)throw new Error("Provided message too short to accommodate event stream message overhead");if(e.length!==e.readUInt32BE(0))throw new Error("Reported message length does not match received message length");var t=e.readUInt32BE(s);if(t!==r.crypto.crc32(e.slice(0,s)))throw new Error("The prelude checksum specified in the message ("+t+") does not match the calculated CRC32 checksum.");var n=e.readUInt32BE(e.length-a);if(n!==r.crypto.crc32(e.slice(0,e.length-a)))throw new Error("The message checksum did not match the expected value of "+n);var u=s+a,l=u+e.readUInt32BE(o);return{headers:e.slice(u,l),body:e.slice(l,e.length-a)}}}},{"../core":19}],34:[function(e,t,n){var r=e("./core"),i=e("./sequential_executor"),o=e("./discover_endpoint").discoverEndpoint;r.EventListeners={Core:{}},r.EventListeners={Core:(new i).addNamedListeners((function(e,t){t("VALIDATE_CREDENTIALS","validate",(function(e,t){if(!e.service.api.signatureVersion&&!e.service.config.signatureVersion)return t();e.service.config.getCredentials((function(n){n&&(e.response.error=r.util.error(n,{code:"CredentialsError",message:"Missing credentials in config"})),t()}))})),e("VALIDATE_REGION","validate",(function(e){e.service.config.region||e.service.isGlobalEndpoint||(e.response.error=r.util.error(new Error,{code:"ConfigError",message:"Missing region in config"}))})),e("BUILD_IDEMPOTENCY_TOKENS","validate",(function(e){if(e.service.api.operations){var t=e.service.api.operations[e.operation];if(t){var n=t.idempotentMembers;if(n.length){for(var i=r.util.copy(e.params),o=0,s=n.length;o<s;o++)i[n[o]]||(i[n[o]]=r.util.uuid.v4());e.params=i}}}})),e("VALIDATE_PARAMETERS","validate",(function(e){if(e.service.api.operations){var t=e.service.api.operations[e.operation].input,n=e.service.config.paramValidation;new r.ParamValidator(n).validate(t,e.params)}})),t("COMPUTE_SHA256","afterBuild",(function(e,t){if(e.haltHandlersOnError(),e.service.api.operations){var n=e.service.api.operations[e.operation],i=n?n.authtype:"";if(!e.service.api.signatureVersion&&!i&&!e.service.config.signatureVersion)return t();if(e.service.getSignerClass(e)===r.Signers.V4){var o=e.httpRequest.body||"";if(i.indexOf("unsigned-body")>=0)return e.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",t();r.util.computeSha256(o,(function(n,r){n?t(n):(e.httpRequest.headers["X-Amz-Content-Sha256"]=r,t())}))}else t()}})),e("SET_CONTENT_LENGTH","afterBuild",(function(e){var t=function(e){if(!e.service.api.operations)return"";var t=e.service.api.operations[e.operation];return t?t.authtype:""}(e),n=r.util.getRequestPayloadShape(e);if(void 0===e.httpRequest.headers["Content-Length"])try{var i=r.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=i}catch(r){if(n&&n.isStreaming){if(n.requiresLength)throw r;if(t.indexOf("unsigned-body")>=0)return void(e.httpRequest.headers["Transfer-Encoding"]="chunked");throw r}throw 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 r.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount<this.service.config.maxRetries?this.response.retryCount++:this.response.error=null)})),t("DISCOVER_ENDPOINT","sign",o,!0),t("SIGN","sign",(function(e,t){var n=e.service,r=(e.service.api.operations||{})[e.operation],i=r?r.authtype:"";if(!n.api.signatureVersion&&!i&&!n.config.signatureVersion)return t();n.config.getCredentials((function(i,o){if(i)return e.response.error=i,t();try{var s=n.getSkewCorrectedDate(),a=new(n.getSignerClass(e))(e.httpRequest,n.api.signingName||n.api.endpointPrefix,{signatureCache:n.config.signatureCache,operation:r,signatureVersion:n.api.signatureVersion});a.setServiceClientId(n._clientId),delete e.httpRequest.headers.Authorization,delete e.httpRequest.headers.Date,delete e.httpRequest.headers["X-Amz-Date"],a.addAuthorization(o,s),e.signedAt=s}catch(t){e.response.error=t}t()}))})),e("VALIDATE_RESPONSE","validateResponse",(function(e){this.service.successfulResponse(e,this)?(e.data={},e.error=null):(e.data=null,e.error=r.util.error(new Error,{code:"UnknownError",message:"An unknown error occurred."}))})),t("SEND","send",(function(e,t){function n(n){e.httpResponse.stream=n;var i=e.request.httpRequest.stream,o=e.request.service,s=o.api,a=e.request.operation,c=s.operations[a]||{};n.on("headers",(function(i,s,a){if(e.request.emit("httpHeaders",[i,s,e,a]),!e.httpResponse.streaming)if(2===r.HttpClient.streamsApiVersion){if(c.hasEventOutput&&o.successfulResponse(e))return e.request.emit("httpDone"),void t();n.on("readable",(function(){var t=n.read();null!==t&&e.request.emit("httpData",[t,e])}))}else n.on("data",(function(t){e.request.emit("httpData",[t,e])}))})),n.on("end",(function(){if(!i||!i.didCallback){if(2===r.HttpClient.streamsApiVersion&&c.hasEventOutput&&o.successfulResponse(e))return;e.request.emit("httpDone"),t()}}))}function i(n){if("RequestAbortedError"!==n.code){var i="TimeoutError"===n.code?n.code:"NetworkingError";n=r.util.error(n,{code:i,region:e.request.httpRequest.region,hostname:e.request.httpRequest.endpoint.hostname,retryable:!0})}e.error=n,e.request.emit("httpError",[e.error,e],(function(){t()}))}function o(){var t=r.HttpClient.getInstance(),o=e.request.service.config.httpOptions||{};try{!function(t){t.on("sendProgress",(function(t){e.request.emit("httpUploadProgress",[t,e])})),t.on("receiveProgress",(function(t){e.request.emit("httpDownloadProgress",[t,e])}))}(t.handleRequest(e.request.httpRequest,o,n,i))}catch(e){i(e)}}e.httpResponse._abortCallback=t,e.error=null,e.data=null,(e.request.service.getSkewCorrectedDate()-this.signedAt)/1e3>=600?this.emit("sign",[this],(function(e){e?t(e):o()})):o()})),e("HTTP_HEADERS","httpHeaders",(function(e,t,n,i){n.httpResponse.statusCode=e,n.httpResponse.statusMessage=i,n.httpResponse.headers=t,n.httpResponse.body=r.util.buffer.toBuffer(""),n.httpResponse.buffers=[],n.httpResponse.numBytes=0;var o=t.date||t.Date,s=n.request.service;if(o){var a=Date.parse(o);s.config.correctClockSkew&&s.isClockSkewed(a)&&s.applyClockOffset(a)}})),e("HTTP_DATA","httpData",(function(e,t){if(e){if(r.util.isNode()){t.httpResponse.numBytes+=e.length;var n=t.httpResponse.headers["content-length"],i={loaded:t.httpResponse.numBytes,total:n};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(r.util.buffer.toBuffer(e))}})),e("HTTP_DONE","httpDone",(function(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=r.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes,delete e.httpResponse.buffers})),e("FINALIZE_ERROR","retry",(function(e){e.httpResponse.statusCode&&(e.error.statusCode=e.httpResponse.statusCode,void 0===e.error.retryable&&(e.error.retryable=this.service.retryableError(e.error,this)))})),e("INVALIDATE_CREDENTIALS","retry",(function(e){if(e.error)switch(e.error.code){case"RequestExpired":case"ExpiredTokenException":case"ExpiredToken":e.error.retryable=!0,e.request.service.config.credentials.expired=!0}})),e("EXPIRED_SIGNATURE","retry",(function(e){var t=e.error;t&&"string"==typeof t.code&&"string"==typeof t.message&&t.code.match(/Signature/)&&t.message.match(/expired/)&&(e.error.retryable=!0)})),e("CLOCK_SKEWED","retry",(function(e){e.error&&this.service.clockSkewError(e.error)&&this.service.config.correctClockSkew&&(e.error.retryable=!0)})),e("REDIRECT","retry",(function(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new r.Endpoint(e.httpResponse.headers.location),this.httpRequest.headers.Host=this.httpRequest.endpoint.host,e.error.redirect=!0,e.error.retryable=!0)})),e("RETRY_CHECK","retry",(function(e){e.error&&(e.error.redirect&&e.redirectCount<e.maxRedirects?e.error.retryDelay=0:e.retryCount<e.maxRetries&&(e.error.retryDelay=this.service.retryDelays(e.retryCount,e.error)||0))})),t("RESET_RETRY_STATE","afterRetry",(function(e,t){var n,r=!1;e.error&&(n=e.error.retryDelay||0,e.error.retryable&&e.retryCount<e.maxRetries?(e.retryCount++,r=!0):e.error.redirect&&e.redirectCount<e.maxRedirects&&(e.redirectCount++,r=!0)),r&&n>=0?(e.error=null,setTimeout(t,n)):t()}))})),CorePost:(new i).addNamedListeners((function(e){e("EXTRACT_REQUEST_ID","extractData",r.util.extractRequestId),e("EXTRACT_REQUEST_ID","extractError",r.util.extractRequestId),e("ENOTFOUND_ERROR","httpError",(function(e){if("NetworkingError"===e.code&&"ENOTFOUND"===e.errno){var t="Inaccessible host: `"+e.hostname+"'. This service may not be available in the `"+e.region+"' region.";this.response.error=r.util.error(new Error(t),{code:"UnknownEndpoint",region:e.region,hostname:e.hostname,retryable:!0,originalError:e})}}))})),Logger:(new i).addNamedListeners((function(t){t("LOG_REQUEST","complete",(function(t){var n=t.request,i=n.service.config.logger;if(i){var o=function(){var o=(t.request.service.getSkewCorrectedDate().getTime()-n.startTime.getTime())/1e3,s=!!i.isTTY,a=t.httpResponse.statusCode,c=n.params;n.service.api.operations&&n.service.api.operations[n.operation]&&n.service.api.operations[n.operation].input&&(c=function e(t,n){if(!n)return n;switch(t.type){case"structure":var i={};return r.util.each(n,(function(n,r){Object.prototype.hasOwnProperty.call(t.members,n)?i[n]=e(t.members[n],r):i[n]=r})),i;case"list":var o=[];return r.util.arrayEach(n,(function(n,r){o.push(e(t.member,n))})),o;case"map":var s={};return r.util.each(n,(function(n,r){s[n]=e(t.value,r)})),s;default:return t.isSensitive?"***SensitiveInformation***":n}}(n.service.api.operations[n.operation].input,n.params));var u=e("util").inspect(c,!0,null),l="";return s&&(l+="[33m"),l+="[AWS "+n.service.serviceIdentifier+" "+a,l+=" "+o.toString()+"s "+t.retryCount+" retries]",s&&(l+="[0;1m"),l+=" "+r.util.string.lowerFirst(n.operation),l+="("+u+")",s&&(l+="[0m"),l}();"function"==typeof i.log?i.log(o):"function"==typeof i.write&&i.write(o+"\n")}}))})),Json:(new i).addNamedListeners((function(t){var n=e("./protocol/json");t("BUILD","build",n.buildRequest),t("EXTRACT_DATA","extractData",n.extractData),t("EXTRACT_ERROR","extractError",n.extractError)})),Rest:(new i).addNamedListeners((function(t){var n=e("./protocol/rest");t("BUILD","build",n.buildRequest),t("EXTRACT_DATA","extractData",n.extractData),t("EXTRACT_ERROR","extractError",n.extractError)})),RestJson:(new i).addNamedListeners((function(t){var n=e("./protocol/rest_json");t("BUILD","build",n.buildRequest),t("EXTRACT_DATA","extractData",n.extractData),t("EXTRACT_ERROR","extractError",n.extractError)})),RestXml:(new i).addNamedListeners((function(t){var n=e("./protocol/rest_xml");t("BUILD","build",n.buildRequest),t("EXTRACT_DATA","extractData",n.extractData),t("EXTRACT_ERROR","extractError",n.extractError)})),Query:(new i).addNamedListeners((function(t){var n=e("./protocol/query");t("BUILD","build",n.buildRequest),t("EXTRACT_DATA","extractData",n.extractData),t("EXTRACT_ERROR","extractError",n.extractError)}))}},{"./core":19,"./discover_endpoint":27,"./protocol/json":47,"./protocol/query":48,"./protocol/rest":49,"./protocol/rest_json":50,"./protocol/rest_xml":51,"./sequential_executor":59,util:98}],35:[function(e,t,n){var r=e("./core"),i=r.util.inherit;r.Endpoint=i({constructor:function(e,t){if(r.util.hideProperties(this,["slashes","auth","hash","search","query"]),null==e)throw new Error("Invalid endpoint: "+e);if("string"!=typeof e)return r.util.copy(e);e.match(/^http/)||(e=((t&&void 0!==t.sslEnabled?t.sslEnabled:r.config.sslEnabled)?"https":"http")+"://"+e),r.util.update(this,r.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port="https:"===this.protocol?443:80}}),r.HttpRequest=i({constructor:function(e,t){e=new r.Endpoint(e),this.method="POST",this.path=e.path||"/",this.headers={},this.body="",this.endpoint=e,this.region=t,this._userAgent="",this.setUserAgent()},setUserAgent:function(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=r.util.userAgent()},getUserAgentHeaderName:function(){return(r.util.isBrowser()?"X-Amz-":"")+"User-Agent"},appendToUserAgent:function(e){"string"==typeof e&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},getUserAgent:function(){return this._userAgent},pathname:function(){return this.path.split("?",1)[0]},search:function(){var e=this.path.split("?",2)[1];return e?(e=r.util.queryStringParse(e),r.util.queryParamsToString(e)):""},updateEndpoint:function(e){var t=new r.Endpoint(e);this.endpoint=t,this.path=t.path||"/"}}),r.HttpResponse=i({constructor:function(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},createUnbufferedStream:function(){return this.streaming=!0,this.stream}}),r.HttpClient=i({}),r.HttpClient.getInstance=function(){return void 0===this.singleton&&(this.singleton=new this),this.singleton}},{"./core":19}],36:[function(e,t,n){var r=e("../core"),i=e("events").EventEmitter;e("../http"),r.XHRClient=r.util.inherit({handleRequest:function(e,t,n,o){var a=this,c=e.endpoint,u=new i,l=c.protocol+"//"+c.hostname;80!==c.port&&443!==c.port&&(l+=":"+c.port),l+=e.path;var p=new XMLHttpRequest,h=!1;e.stream=p,p.addEventListener("readystatechange",(function(){try{if(0===p.status)return}catch(e){return}this.readyState>=this.HEADERS_RECEIVED&&!h&&(u.statusCode=p.status,u.headers=a.parseHeaders(p.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers,p.statusText),h=!0),this.readyState===this.DONE&&a.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(){o(r.util.error(new Error("Timeout"),{code:"TimeoutError"}))}),!1),p.addEventListener("error",(function(){o(r.util.error(new Error("Network Failure"),{code:"NetworkingError"}))}),!1),p.addEventListener("abort",(function(){o(r.util.error(new Error("Request aborted"),{code:"RequestAbortedError"}))}),!1),n(u),p.open(e.method,l,!1!==t.xhrAsync),r.util.each(e.headers,(function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&p.setRequestHeader(e,t)})),t.timeout&&!1!==t.xhrAsync&&(p.timeout=t.timeout),t.xhrWithCredentials&&(p.withCredentials=!0);try{p.responseType="arraybuffer"}catch(e){}try{e.body?p.send(e.body):p.send()}catch(t){if(!e.body||"object"!=s(e.body.buffer))throw t;p.send(e.body.buffer)}return u},parseHeaders:function(e){var t={};return r.util.arrayEach(e.split(/\r?\n/),(function(e){var n=e.split(":",1)[0],r=e.substring(n.length+2);n.length>0&&(t[n.toLowerCase()]=r)})),t},finishRequest:function(e,t){var n;if("arraybuffer"===e.responseType&&e.response){var i=e.response;n=new r.util.Buffer(i.byteLength);for(var o=new Uint8Array(i),s=0;s<n.length;++s)n[s]=o[s]}try{n||"string"!=typeof e.responseText||(n=new r.util.Buffer(e.responseText))}catch(e){}n&&t.emit("data",n),t.emit("end")}}),r.HttpClient.prototype=r.XHRClient.prototype,r.HttpClient.streamsApiVersion=1},{"../core":19,"../http":35,events:82}],37:[function(e,t,n){function r(){}function i(e,t){if(t&&null!=e)switch(t.type){case"structure":return function(e,t){var n={};return o.each(e,(function(e,r){var o=t.members[e];if(o){if("body"!==o.location)return;var s=o.isLocationName?o.name:e,a=i(r,o);void 0!==a&&(n[s]=a)}})),n}(e,t);case"map":return function(e,t){var n={};return o.each(e,(function(e,r){var o=i(r,t.value);void 0!==o&&(n[e]=o)})),n}(e,t);case"list":return function(e,t){var n=[];return o.arrayEach(e,(function(e){var r=i(e,t.member);void 0!==r&&n.push(r)})),n}(e,t);default:return function(e,t){return t.toWireFormat(e)}(e,t)}}var o=e("../util");r.prototype.build=function(e,t){return JSON.stringify(i(e,t))},t.exports=r},{"../util":72}],38:[function(e,t,n){function r(){}function i(e,t){if(t&&void 0!==e)switch(t.type){case"structure":return function(e,t){if(null!=e){var n={},r=t.members;return o.each(r,(function(t,r){var o=r.isLocationName?r.name:t;if(Object.prototype.hasOwnProperty.call(e,o)){var s=i(e[o],r);void 0!==s&&(n[t]=s)}})),n}}(e,t);case"map":return function(e,t){if(null!=e){var n={};return o.each(e,(function(e,r){var o=i(r,t.value);n[e]=void 0===o?null:o})),n}}(e,t);case"list":return function(e,t){if(null!=e){var n=[];return o.arrayEach(e,(function(e){var r=i(e,t.member);void 0===r?n.push(null):n.push(r)})),n}}(e,t);default:return function(e,t){return t.toType(e)}(e,t)}}var o=e("../util");r.prototype.parse=function(e,t){return i(JSON.parse(e),t)},t.exports=r},{"../util":72}],39:[function(e,t,n){var r=e("./collection"),i=e("./operation"),o=e("./shape"),s=e("./paginator"),a=e("./resource_waiter"),c=e("../util"),u=c.property,l=c.memoizedProperty;t.exports=function(e,t){var n=this;e=e||{},(t=t||{}).api=this,e.metadata=e.metadata||{},u(this,"isApi",!0,!1),u(this,"apiVersion",e.metadata.apiVersion),u(this,"endpointPrefix",e.metadata.endpointPrefix),u(this,"signingName",e.metadata.signingName),u(this,"globalEndpoint",e.metadata.globalEndpoint),u(this,"signatureVersion",e.metadata.signatureVersion),u(this,"jsonVersion",e.metadata.jsonVersion),u(this,"targetPrefix",e.metadata.targetPrefix),u(this,"protocol",e.metadata.protocol),u(this,"timestampFormat",e.metadata.timestampFormat),u(this,"xmlNamespaceUri",e.metadata.xmlNamespace),u(this,"abbreviation",e.metadata.serviceAbbreviation),u(this,"fullName",e.metadata.serviceFullName),u(this,"serviceId",e.metadata.serviceId),l(this,"className",(function(){var t=e.metadata.serviceAbbreviation||e.metadata.serviceFullName;return t?("ElasticLoadBalancing"===(t=t.replace(/^Amazon|AWS\s*|\(.*|\s+|\W+/g,""))&&(t="ELB"),t):null})),u(this,"operations",new r(e.operations,t,(function(e,n){return new i(e,n,t)}),c.string.lowerFirst,(function(e,t){!0===t.endpointoperation&&u(n,"endpointOperation",c.string.lowerFirst(e))}))),u(this,"shapes",new r(e.shapes,t,(function(e,n){return o.create(n,t)}))),u(this,"paginators",new r(e.paginators,t,(function(e,n){return new s(e,n,t)}))),u(this,"waiters",new r(e.waiters,t,(function(e,n){return new a(e,n,t)}),c.string.lowerFirst)),t.documentation&&(u(this,"documentation",e.documentation),u(this,"documentationUrl",e.documentationUrl))}},{"../util":72,"./collection":40,"./operation":41,"./paginator":42,"./resource_waiter":43,"./shape":44}],40:[function(e,t,n){function r(e,t,n,r){i(this,r(e),(function(){return n(e,t)}))}var i=e("../util").memoizedProperty;t.exports=function(e,t,n,i,o){for(var s in i=i||String,e)Object.prototype.hasOwnProperty.call(e,s)&&(r.call(this,s,e[s],n,i),o&&o(s,e[s]))}},{"../util":72}],41:[function(e,t,n){var r=e("./shape"),i=e("../util"),o=i.property,s=i.memoizedProperty;t.exports=function(e,t,n){var i=this;n=n||{},o(this,"name",t.name||e),o(this,"api",n.api,!1),t.http=t.http||{},o(this,"endpoint",t.endpoint),o(this,"httpMethod",t.http.method||"POST"),o(this,"httpPath",t.http.requestUri||"/"),o(this,"authtype",t.authtype||""),o(this,"endpointDiscoveryRequired",t.endpointdiscovery?t.endpointdiscovery.required?"REQUIRED":"OPTIONAL":"NULL"),s(this,"input",(function(){return t.input?r.create(t.input,n):new r.create({type:"structure"},n)})),s(this,"output",(function(){return t.output?r.create(t.output,n):new r.create({type:"structure"},n)})),s(this,"errors",(function(){var e=[];if(!t.errors)return null;for(var i=0;i<t.errors.length;i++)e.push(r.create(t.errors[i],n));return e})),s(this,"paginator",(function(){return n.api.paginators[e]})),n.documentation&&(o(this,"documentation",t.documentation),o(this,"documentationUrl",t.documentationUrl)),s(this,"idempotentMembers",(function(){var e=[],t=i.input,n=t.members;if(!t.members)return e;for(var r in n)n.hasOwnProperty(r)&&!0===n[r].isIdempotent&&e.push(r);return e})),s(this,"hasEventOutput",(function(){return function(e){var t=e.members,n=e.payload;if(!e.members)return!1;if(n)return t[n].isEventStream;for(var r in t)if(!t.hasOwnProperty(r)&&!0===t[r].isEventStream)return!0;return!1}(i.output)}))}},{"../util":72,"./shape":44}],42:[function(e,t,n){var r=e("../util").property;t.exports=function(e,t){r(this,"inputToken",t.input_token),r(this,"limitKey",t.limit_key),r(this,"moreResults",t.more_results),r(this,"outputToken",t.output_token),r(this,"resultKey",t.result_key)}},{"../util":72}],43:[function(e,t,n){var r=e("../util"),i=r.property;t.exports=function(e,t,n){n=n||{},i(this,"name",e),i(this,"api",n.api,!1),t.operation&&i(this,"operation",r.string.lowerFirst(t.operation));var o=this;["type","description","delay","maxAttempts","acceptors"].forEach((function(e){var n=t[e];n&&i(o,e,n)}))}},{"../util":72}],44:[function(e,t,n){function r(e,t,n){null!=n&&g.property.apply(this,arguments)}function i(e,t){e.constructor.prototype[t]||g.memoizedProperty.apply(this,arguments)}function o(e,t,n){t=t||{},r(this,"shape",e.shape),r(this,"api",t.api,!1),r(this,"type",e.type),r(this,"enum",e.enum),r(this,"min",e.min),r(this,"max",e.max),r(this,"pattern",e.pattern),r(this,"location",e.location||this.location||"body"),r(this,"name",this.name||e.xmlName||e.queryName||e.locationName||n),r(this,"isStreaming",e.streaming||this.isStreaming||!1),r(this,"requiresLength",e.requiresLength,!1),r(this,"isComposite",e.isComposite||!1),r(this,"isShape",!0,!1),r(this,"isQueryName",Boolean(e.queryName),!1),r(this,"isLocationName",Boolean(e.locationName),!1),r(this,"isIdempotent",!0===e.idempotencyToken),r(this,"isJsonValue",!0===e.jsonvalue),r(this,"isSensitive",!0===e.sensitive||e.prototype&&!0===e.prototype.sensitive),r(this,"isEventStream",Boolean(e.eventstream),!1),r(this,"isEvent",Boolean(e.event),!1),r(this,"isEventPayload",Boolean(e.eventpayload),!1),r(this,"isEventHeader",Boolean(e.eventheader),!1),r(this,"isTimestampFormatSet",Boolean(e.timestampFormat)||e.prototype&&!0===e.prototype.isTimestampFormatSet,!1),r(this,"endpointDiscoveryId",Boolean(e.endpointdiscoveryid),!1),r(this,"hostLabel",Boolean(e.hostLabel),!1),t.documentation&&(r(this,"documentation",e.documentation),r(this,"documentationUrl",e.documentationUrl)),e.xmlAttribute&&r(this,"isXmlAttribute",e.xmlAttribute||!1),r(this,"defaultValue",null),this.toWireFormat=function(e){return null==e?"":e},this.toType=function(e){return e}}function a(e){o.apply(this,arguments),r(this,"isComposite",!0),e.flattened&&r(this,"flattened",e.flattened||!1)}function c(e,t){var n=this,c=null,u=!this.isShape;a.apply(this,arguments),u&&(r(this,"defaultValue",(function(){return{}})),r(this,"members",{}),r(this,"memberNames",[]),r(this,"required",[]),r(this,"isRequired",(function(){return!1}))),e.members&&(r(this,"members",new m(e.members,t,(function(e,n){return o.create(n,t,e)}))),i(this,"memberNames",(function(){return e.xmlOrder||Object.keys(e.members)})),e.event&&(i(this,"eventPayloadMemberName",(function(){for(var e=n.members,t=n.memberNames,r=0,i=t.length;r<i;r++)if(e[t[r]].isEventPayload)return t[r]})),i(this,"eventHeaderMemberNames",(function(){for(var e=n.members,t=n.memberNames,r=[],i=0,o=t.length;i<o;i++)e[t[i]].isEventHeader&&r.push(t[i]);return r})))),e.required&&(r(this,"required",e.required),r(this,"isRequired",(function(t){if(!c){c={};for(var n=0;n<e.required.length;n++)c[e.required[n]]=!0}return c[t]}),!1,!0)),r(this,"resultWrapper",e.resultWrapper||null),e.payload&&r(this,"payload",e.payload),"string"==typeof e.xmlNamespace?r(this,"xmlNamespaceUri",e.xmlNamespace):"object"==s(e.xmlNamespace)&&(r(this,"xmlNamespacePrefix",e.xmlNamespace.prefix),r(this,"xmlNamespaceUri",e.xmlNamespace.uri))}function u(e,t){var n=this,s=!this.isShape;if(a.apply(this,arguments),s&&r(this,"defaultValue",(function(){return[]})),e.member&&i(this,"member",(function(){return o.create(e.member,t)})),this.flattened){var c=this.name;i(this,"name",(function(){return n.member.name||c}))}}function l(e,t){var n=!this.isShape;a.apply(this,arguments),n&&(r(this,"defaultValue",(function(){return{}})),r(this,"key",o.create({type:"string"},t)),r(this,"value",o.create({type:"string"},t))),e.key&&i(this,"key",(function(){return o.create(e.key,t)})),e.value&&i(this,"value",(function(){return o.create(e.value,t)}))}function p(){o.apply(this,arguments);var e=["rest-xml","query","ec2"];this.toType=function(t){return t=this.api&&e.indexOf(this.api.protocol)>-1?t||"":t,this.isJsonValue?JSON.parse(t):t&&"function"==typeof t.toString?t.toString():t},this.toWireFormat=function(e){return this.isJsonValue?JSON.stringify(e):e}}function h(){o.apply(this,arguments),this.toType=function(e){var t=g.base64.decode(e);if(this.isSensitive&&g.isNode()&&"function"==typeof g.Buffer.alloc){var n=g.Buffer.alloc(t.length,t);t.fill(0),t=n}return t},this.toWireFormat=g.base64.encode}function f(){h.apply(this,arguments)}function d(){o.apply(this,arguments),this.toType=function(e){return"boolean"==typeof e?e:null==e?null:"true"===e}}var m=e("./collection"),g=e("../util");o.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"},o.types={structure:c,list:u,map:l,boolean:d,timestamp:function(e){var t=this;if(o.apply(this,arguments),e.timestampFormat)r(this,"timestampFormat",e.timestampFormat);else if(t.isTimestampFormatSet&&this.timestampFormat)r(this,"timestampFormat",this.timestampFormat);else if("header"===this.location)r(this,"timestampFormat","rfc822");else if("querystring"===this.location)r(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":r(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":r(this,"timestampFormat","iso8601")}this.toType=function(e){return null==e?null:"function"==typeof e.toUTCString?e:"string"==typeof e||"number"==typeof e?g.date.parseTimestamp(e):null},this.toWireFormat=function(e){return g.date.format(e,t.timestampFormat)}},float:function(){o.apply(this,arguments),this.toType=function(e){return null==e?null:parseFloat(e)},this.toWireFormat=this.toType},integer:function(){o.apply(this,arguments),this.toType=function(e){return null==e?null:parseInt(e,10)},this.toWireFormat=this.toType},string:p,base64:f,binary:h},o.resolve=function(e,t){if(e.shape){var n=t.api.shapes[e.shape];if(!n)throw new Error("Cannot find shape reference: "+e.shape);return n}return null},o.create=function(e,t,n){if(e.isShape)return e;var r=o.resolve(e,t);if(r){var i=Object.keys(e);t.documentation||(i=i.filter((function(e){return!e.match(/documentation/)})));var s=function(){r.constructor.call(this,e,t,n)};return s.prototype=r,new s}e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var a=e.type;if(o.normalizedTypes[e.type]&&(e.type=o.normalizedTypes[e.type]),o.types[e.type])return new o.types[e.type](e,t,n);throw new Error("Unrecognized shape type: "+a)},o.shapes={StructureShape:c,ListShape:u,MapShape:l,StringShape:p,BooleanShape:d,Base64Shape:f},t.exports=o},{"../util":72,"./collection":40}],45:[function(e,t,n){var r=e("./core");r.ParamValidator=r.util.inherit({constructor:function(e){!0!==e&&void 0!==e||(e={min:!0}),this.validation=e},validate:function(e,t,n){if(this.errors=[],this.validateMember(e,t||{},n||"params"),this.errors.length>1){var i=this.errors.join("\n* ");throw i="There were "+this.errors.length+" validation errors:\n* "+i,r.util.error(new Error(i),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function(e,t){this.errors.push(r.util.error(new Error(t),{code:e}))},validateStructure:function(e,t,n){this.validateType(t,n,["object"],"structure");for(var r,i=0;e.required&&i<e.required.length;i++){var o=t[r=e.required[i]];null!=o||this.fail("MissingRequiredParameter","Missing required key '"+r+"' in "+n)}for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r],a=e.members[r];if(void 0!==a){var c=[n,r].join(".");this.validateMember(a,s,c)}else this.fail("UnexpectedParameter","Unexpected key '"+r+"' found in "+n)}return!0},validateMember:function(e,t,n){switch(e.type){case"structure":return this.validateStructure(e,t,n);case"list":return this.validateList(e,t,n);case"map":return this.validateMap(e,t,n);default:return this.validateScalar(e,t,n)}},validateList:function(e,t,n){if(this.validateType(t,n,[Array])){this.validateRange(e,t.length,n,"list member count");for(var r=0;r<t.length;r++)this.validateMember(e.member,t[r],n+"["+r+"]")}},validateMap:function(e,t,n){if(this.validateType(t,n,["object"],"map")){var r=0;for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(this.validateMember(e.key,i,n+"[key='"+i+"']"),this.validateMember(e.value,t[i],n+"['"+i+"']"),r++);this.validateRange(e,r,n,"map member count")}},validateScalar:function(e,t,n){switch(e.type){case null:case void 0:case"string":return this.validateString(e,t,n);case"base64":case"binary":return this.validatePayload(t,n);case"integer":case"float":return this.validateNumber(e,t,n);case"boolean":return this.validateType(t,n,["boolean"]);case"timestamp":return this.validateType(t,n,[Date,/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,"number"],"Date object, ISO-8601 string, or a UNIX timestamp");default:return this.fail("UnkownType","Unhandled type "+e.type+" for "+n)}},validateString:function(e,t,n){var r=["string"];e.isJsonValue&&(r=r.concat(["number","object","boolean"])),null!==t&&this.validateType(t,n,r)&&(this.validateEnum(e,t,n),this.validateRange(e,t.length,n,"string length"),this.validatePattern(e,t,n),this.validateUri(e,t,n))},validateUri:function(e,t,n){"uri"===e.location&&0===t.length&&this.fail("UriParameterError",'Expected uri parameter to have length >= 1, but found "'+t+'" for '+n)},validatePattern:function(e,t,n){this.validation.pattern&&void 0!==e.pattern&&(new RegExp(e.pattern).test(t)||this.fail("PatternMatchError",'Provided value "'+t+'" does not match regex pattern /'+e.pattern+"/ for "+n))},validateRange:function(e,t,n,r){this.validation.min&&void 0!==e.min&&t<e.min&&this.fail("MinRangeError","Expected "+r+" >= "+e.min+", but found "+t+" for "+n),this.validation.max&&void 0!==e.max&&t>e.max&&this.fail("MaxRangeError","Expected "+r+" <= "+e.max+", but found "+t+" for "+n)},validateEnum:function(e,t,n){this.validation.enum&&void 0!==e.enum&&-1===e.enum.indexOf(t)&&this.fail("EnumError","Found string value of "+t+", but expected "+e.enum.join("|")+" for "+n)},validateType:function(e,t,n,i){if(null==e)return!1;for(var o=!1,a=0;a<n.length;a++){if("string"==typeof n[a]){if(s(e)===n[a])return!0}else if(n[a]instanceof RegExp){if((e||"").toString().match(n[a]))return!0}else{if(e instanceof n[a])return!0;if(r.util.isType(e,n[a]))return!0;i||o||(n=n.slice()),n[a]=r.util.typeName(n[a])}o=!0}var c=i;c||(c=n.join(", ").replace(/,([^,]+)$/,", or$1"));var u=c.match(/^[aeiou]/i)?"n":"";return this.fail("InvalidParameterType","Expected "+t+" to be a"+u+" "+c),!1},validateNumber:function(e,t,n){if(null!=t){if("string"==typeof t){var r=parseFloat(t);r.toString()===t&&(t=r)}this.validateType(t,n,["number"])&&this.validateRange(e,t,n,"numeric value")}},validatePayload:function(e,t){if(null!=e&&"string"!=typeof e&&(!e||"number"!=typeof e.byteLength)){if(r.util.isNode()){var n=r.util.stream.Stream;if(r.util.Buffer.isBuffer(e)||e instanceof n)return}else if(void 0!==("undefined"==typeof Blob?"undefined":s(Blob))&&e instanceof Blob)return;var i=["Buffer","Stream","File","Blob","ArrayBuffer","DataView"];if(e)for(var o=0;o<i.length;o++){if(r.util.isType(e,i[o]))return;if(r.util.typeName(e.constructor)===i[o])return}this.fail("InvalidParameterType","Expected "+t+" to be a string, Buffer, Stream, Blob, or typed array object")}}})},{"./core":19}],46:[function(e,t,n){var r=e("../util"),i=e("../core");t.exports={populateHostPrefix:function(e){if(!e.service.config.hostPrefixEnabled)return e;var t=e.service.api.operations[e.operation];if(function(e){var t=e.service.api,n=t.operations[e.operation],i=t.endpointOperation&&t.endpointOperation===r.string.lowerFirst(n.name);return"NULL"!==n.endpointDiscoveryRequired||!0===i}(e))return e;if(t.endpoint&&t.endpoint.hostPrefix){var n=function(e,t,n){return r.each(n.members,(function(n,i){if(!0===i.hostLabel){if("string"!=typeof t[n]||""===t[n])throw r.error(new Error,{message:"Parameter "+n+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+n+"\\}","g");e=e.replace(o,t[n])}})),e}(t.endpoint.hostPrefix,e.params,t.input);(function(e,t){e.host&&(e.host=t+e.host),e.hostname&&(e.hostname=t+e.hostname)})(e.httpRequest.endpoint,n),function(e){var t=e.split("."),n=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;r.arrayEach(t,(function(e){if(!e.length||e.length<1||e.length>63)throw r.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!n.test(e))throw i.util.error(new Error,{code:"ValidationError",message:e+" is not hostname compatible."})}))}(e.httpRequest.endpoint.hostname)}return e}}},{"../core":19,"../util":72}],47:[function(e,t,n){var r=e("../util"),i=e("../json/builder"),o=e("../json/parser"),s=e("./helpers").populateHostPrefix;t.exports={buildRequest:function(e){var t=e.httpRequest,n=e.service.api,r=n.targetPrefix+"."+n.operations[e.operation].name,o=n.jsonVersion||"1.0",a=n.operations[e.operation].input,c=new i;1===o&&(o="1.0"),t.body=c.build(e.params||{},a),t.headers["Content-Type"]="application/x-amz-json-"+o,t.headers["X-Amz-Target"]=r,s(e)},extractError:function(e){var t={},n=e.httpResponse;if(t.code=n.headers["x-amzn-errortype"]||"UnknownError","string"==typeof t.code&&(t.code=t.code.split(":")[0]),n.body.length>0)try{var i=JSON.parse(n.body.toString());(i.__type||i.code)&&(t.code=(i.__type||i.code).split("#").pop()),"RequestEntityTooLarge"===t.code?t.message="Request body must be less than 1 MB":t.message=i.message||i.Message||null}catch(i){t.statusCode=n.statusCode,t.message=n.statusMessage}else t.statusCode=n.statusCode,t.message=n.statusCode.toString();e.error=r.error(new Error,t)},extractData:function(e){var t=e.httpResponse.body.toString()||"{}";if(!1===e.request.service.config.convertResponseTypes)e.data=JSON.parse(t);else{var n=e.request.service.api.operations[e.request.operation].output||{},r=new o;e.data=r.parse(t,n)}}}},{"../json/builder":37,"../json/parser":38,"../util":72,"./helpers":46}],48:[function(e,t,n){var r=e("../core"),i=e("../util"),o=e("../query/query_param_serializer"),s=e("../model/shape"),a=e("./helpers").populateHostPrefix;t.exports={buildRequest:function(e){var t=e.service.api.operations[e.operation],n=e.httpRequest;n.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",n.params={Version:e.service.api.apiVersion,Action:t.name},(new o).serialize(e.params,t.input,(function(e,t){n.params[e]=t})),n.body=i.queryParamsToString(n.params),a(e)},extractError:function(e){var t,n=e.httpResponse.body.toString();if(n.match("<UnknownOperationException"))t={Code:"UnknownOperation",Message:"Unknown operation "+e.request.operation};else try{t=(new r.XML.Parser).parse(n)}catch(n){t={Code:e.httpResponse.statusCode,Message:e.httpResponse.statusMessage}}t.requestId&&!e.requestId&&(e.requestId=t.requestId),t.Errors&&(t=t.Errors),t.Error&&(t=t.Error),t.Code?e.error=i.error(new Error,{code:t.Code,message:t.Message}):e.error=i.error(new Error,{code:e.httpResponse.statusCode,message:null})},extractData:function(e){var t=e.request,n=t.service.api.operations[t.operation].output||{},o=n;if(o.resultWrapper){var a=s.create({type:"structure"});a.members[o.resultWrapper]=n,a.memberNames=[o.resultWrapper],i.property(n,"name",n.resultWrapper),n=a}var c=new r.XML.Parser;if(n&&n.members&&!n.members._XAMZRequestId){var u=s.create({type:"string"},{api:{protocol:"query"}},"requestId");n.members._XAMZRequestId=u}var l=c.parse(e.httpResponse.body.toString(),n);e.requestId=l._XAMZRequestId||l.requestId,l._XAMZRequestId&&delete l._XAMZRequestId,o.resultWrapper&&l[o.resultWrapper]&&(i.update(l,l[o.resultWrapper]),delete l[o.resultWrapper]),e.data=l}}},{"../core":19,"../model/shape":44,"../query/query_param_serializer":52,"../util":72,"./helpers":46}],49:[function(e,t,n){function r(e,t,n,r){var o=[e,t].join("/");o=o.replace(/\/+/g,"/");var s={},a=!1;if(i.each(n.members,(function(e,t){var n=r[e];if(null!=n)if("uri"===t.location){var c=new RegExp("\\{"+t.name+"(\\+)?\\}");o=o.replace(c,(function(e,t){return(t?i.uriEscapePath:i.uriEscape)(String(n))}))}else"querystring"===t.location&&(a=!0,"list"===t.type?s[t.name]=n.map((function(e){return i.uriEscape(t.member.toWireFormat(e).toString())})):"map"===t.type?i.each(n,(function(e,t){Array.isArray(t)?s[e]=t.map((function(e){return i.uriEscape(String(e))})):s[e]=i.uriEscape(String(t))})):s[t.name]=i.uriEscape(t.toWireFormat(n).toString()))})),a){o+=o.indexOf("?")>=0?"&":"?";var c=[];i.arrayEach(Object.keys(s).sort(),(function(e){Array.isArray(s[e])||(s[e]=[s[e]]);for(var t=0;t<s[e].length;t++)c.push(i.uriEscape(String(e))+"="+s[e][t])})),o+=c.join("&")}return o}var i=e("../util"),o=e("./helpers").populateHostPrefix;t.exports={buildRequest:function(e){(function(e){e.httpRequest.method=e.service.api.operations[e.operation].httpMethod})(e),function(e){var t=e.service.api.operations[e.operation],n=t.input,i=r(e.httpRequest.endpoint.path,t.httpPath,n,e.params);e.httpRequest.path=i}(e),function(e){var t=e.service.api.operations[e.operation];i.each(t.input.members,(function(t,n){var r=e.params[t];null!=r&&("headers"===n.location&&"map"===n.type?i.each(r,(function(t,r){e.httpRequest.headers[n.name+t]=r})):"header"===n.location&&(r=n.toWireFormat(r).toString(),n.isJsonValue&&(r=i.base64.encode(r)),e.httpRequest.headers[n.name]=r))}))}(e),o(e)},extractError:function(){},extractData:function(e){var t=e.request,n={},r=e.httpResponse,o=t.service.api.operations[t.operation].output,s={};i.each(r.headers,(function(e,t){s[e.toLowerCase()]=t})),i.each(o.members,(function(e,t){var o=(t.name||e).toLowerCase();if("headers"===t.location&&"map"===t.type){n[e]={};var a=t.isLocationName?t.name:"",c=new RegExp("^"+a+"(.+)","i");i.each(r.headers,(function(t,r){var i=t.match(c);null!==i&&(n[e][i[1]]=r)}))}else if("header"===t.location){if(void 0!==s[o]){var u=t.isJsonValue?i.base64.decode(s[o]):s[o];n[e]=t.toType(u)}}else"statusCode"===t.location&&(n[e]=parseInt(r.statusCode,10))})),e.data=n},generateURI:r}},{"../util":72,"./helpers":46}],50:[function(e,t,n){function r(e,t){if(e.service.api.operations[e.operation].input,!e.httpRequest.headers["Content-Type"]){var n=t?"binary/octet-stream":"application/json";e.httpRequest.headers["Content-Type"]=n}}var i=e("../util"),o=e("./rest"),s=e("./json"),a=e("../json/builder"),c=e("../json/parser");t.exports={buildRequest:function(e){o.buildRequest(e),["HEAD","DELETE"].indexOf(e.httpRequest.method)<0&&function(e){var t=new a,n=e.service.api.operations[e.operation].input;if(n.payload){var i,o=n.members[n.payload];if(void 0===(i=e.params[n.payload]))return;"structure"===o.type?(e.httpRequest.body=t.build(i,o),r(e)):(e.httpRequest.body=i,("binary"===o.type||o.isStreaming)&&r(e,!0))}else{var s=t.build(e.params,n);"{}"===s&&"GET"===e.httpRequest.method||(e.httpRequest.body=s),r(e)}}(e)},extractError:function(e){s.extractError(e)},extractData:function(e){o.extractData(e);var t=e.request,n=t.service.api.operations[t.operation],r=t.service.api.operations[t.operation].output||{};if(n.hasEventOutput,r.payload){var a=r.members[r.payload],u=e.httpResponse.body;if(a.isEventStream)l=new c,e.data[payload]=i.createEventStream(2===AWS.HttpClient.streamsApiVersion?e.httpResponse.stream:u,l,a);else if("structure"===a.type||"list"===a.type){var l=new c;e.data[r.payload]=l.parse(u,a)}else"binary"===a.type||a.isStreaming?e.data[r.payload]=u:e.data[r.payload]=a.toType(u)}else{var p=e.data;s.extractData(e),e.data=i.merge(p,e.data)}}}},{"../json/builder":37,"../json/parser":38,"../util":72,"./json":47,"./rest":49}],51:[function(e,t,n){var r=e("../core"),i=e("../util"),o=e("./rest");t.exports={buildRequest:function(e){o.buildRequest(e),["GET","HEAD"].indexOf(e.httpRequest.method)<0&&function(e){var t=e.service.api.operations[e.operation].input,n=new r.XML.Builder,o=e.params,s=t.payload;if(s){var a=t.members[s];if(void 0===(o=o[s]))return;if("structure"===a.type){var c=a.name;e.httpRequest.body=n.toXML(o,a,c,!0)}else e.httpRequest.body=o}else e.httpRequest.body=n.toXML(o,t,t.name||t.shape||i.string.upperFirst(e.operation)+"Request")}(e)},extractError:function(e){var t;o.extractError(e);try{t=(new r.XML.Parser).parse(e.httpResponse.body.toString())}catch(n){t={Code:e.httpResponse.statusCode,Message:e.httpResponse.statusMessage}}t.Errors&&(t=t.Errors),t.Error&&(t=t.Error),t.Code?e.error=i.error(new Error,{code:t.Code,message:t.Message}):e.error=i.error(new Error,{code:e.httpResponse.statusCode,message:null})},extractData:function(e){o.extractData(e);var t,n=e.request,s=e.httpResponse.body,a=n.service.api.operations[n.operation],c=a.output,u=(a.hasEventOutput,c.payload);if(u){var l=c.members[u];l.isEventStream?(t=new r.XML.Parser,e.data[u]=i.createEventStream(2===r.HttpClient.streamsApiVersion?e.httpResponse.stream:e.httpResponse.body,t,l)):"structure"===l.type?(t=new r.XML.Parser,e.data[u]=t.parse(s.toString(),l)):"binary"===l.type||l.isStreaming?e.data[u]=s:e.data[u]=l.toType(s)}else if(s.length>0){var p=(t=new r.XML.Parser).parse(s.toString(),c);i.update(e.data,p)}}}},{"../core":19,"../util":72,"./rest":49}],52:[function(e,t,n){function r(){}function i(e){return e.isQueryName||"ec2"!==e.api.protocol?e.name:e.name[0].toUpperCase()+e.name.substr(1)}function o(e,t,n,r){a.each(n.members,(function(n,o){var a=t[n];if(null!=a){var c=i(o);s(c=e?e+"."+c:c,a,o,r)}}))}function s(e,t,n,r){null!=t&&("structure"===n.type?o(e,t,n,r):"list"===n.type?function(e,t,n,r){var o=n.member||{};0!==t.length?a.arrayEach(t,(function(t,a){var c="."+(a+1);if("ec2"===n.api.protocol)c+="";else if(n.flattened){if(o.name){var u=e.split(".");u.pop(),u.push(i(o)),e=u.join(".")}}else c="."+(o.name?o.name:"member")+c;s(e+c,t,o,r)})):r.call(this,e,null)}(e,t,n,r):"map"===n.type?function(e,t,n,r){var i=1;a.each(t,(function(t,o){var a=(n.flattened?".":".entry.")+i+++".",c=a+(n.key.name||"key"),u=a+(n.value.name||"value");s(e+c,t,n.key,r),s(e+u,o,n.value,r)}))}(e,t,n,r):r(e,n.toWireFormat(t).toString()))}var a=e("../util");r.prototype.serialize=function(e,t,n){o("",e,t,n)},t.exports=r},{"../util":72}],53:[function(e,t,n){t.exports={now:function(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}}},{}],54:[function(e,t,n){function r(e){var t=e.config.region,n=function(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}(t),r=e.api.endpointPrefix;return[[t,r],[n,r],[t,"*"],[n,"*"],["*",r],["*","*"]].map((function(e){return e[0]&&e[1]?e.join("/"):null}))}function i(e,t){o.each(t,(function(t,n){"globalEndpoint"!==t&&(void 0!==e.config[t]&&null!==e.config[t]||(e.config[t]=n))}))}var o=e("./util"),s=e("./region_config_data.json");t.exports=function(e){for(var t=r(e),n=0;n<t.length;n++){var a=t[n];if(a&&Object.prototype.hasOwnProperty.call(s.rules,a)){var c=s.rules[a];return"string"==typeof c&&(c=s.patterns[c]),e.config.useDualstack&&o.isDualstackAvailable(e)&&((c=o.copy(c)).endpoint="{service}.dualstack.{region}.amazonaws.com"),e.isGlobalEndpoint=!!c.globalEndpoint,c.signatureVersion||(c.signatureVersion="v4"),void i(e,c)}}}},{"./region_config_data.json":55,"./util":72}],55:[function(e,t,n){t.exports={rules:{"*/*":{endpoint:"{service}.{region}.amazonaws.com"},"cn-*/*":{endpoint:"{service}.{region}.amazonaws.com.cn"},"*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/iam":"globalSSL","*/sts":"globalSSL","*/importexport":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2",globalEndpoint:!0},"*/route53":{endpoint:"https://{service}.amazonaws.com",signatureVersion:"v3https",globalEndpoint:!0},"*/waf":"globalSSL","us-gov-*/iam":"globalGovCloud","us-gov-*/sts":{endpoint:"{service}.{region}.amazonaws.com"},"us-gov-west-1/s3":"s3signature","us-west-1/s3":"s3signature","us-west-2/s3":"s3signature","eu-west-1/s3":"s3signature","ap-southeast-1/s3":"s3signature","ap-southeast-2/s3":"s3signature","ap-northeast-1/s3":"s3signature","sa-east-1/s3":"s3signature","us-east-1/s3":{endpoint:"{service}.amazonaws.com",signatureVersion:"s3"},"us-east-1/sdb":{endpoint:"{service}.amazonaws.com",signatureVersion:"v2"},"*/sdb":{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"v2"}},patterns:{globalSSL:{endpoint:"https://{service}.amazonaws.com",globalEndpoint:!0},globalGovCloud:{endpoint:"{service}.us-gov.amazonaws.com"},s3signature:{endpoint:"{service}.{region}.amazonaws.com",signatureVersion:"s3"}}}},{}],56:[function(e,t,n){(function(t){var n=e("./core"),r=e("./state_machine"),i=n.util.inherit,o=n.util.domain,s=e("jmespath"),a={success:1,error:1,complete:1},c=new r;c.setupStates=function(){var e=function(e,t){var n=this;n._haltHandlersOnError=!1,n.emit(n._asm.currentState,(function(e){if(e)if(function(e){return Object.prototype.hasOwnProperty.call(a,e._asm.currentState)}(n)){if(!(o&&n.domain instanceof o.Domain))throw e;e.domainEmitter=n,e.domain=n.domain,e.domainThrown=!1,n.domain.emit("error",e)}else n.response.error=e,t(e);else t(n.response.error)}))};this.addState("validate","build","error",e),this.addState("build","afterBuild","restart",e),this.addState("afterBuild","sign","restart",e),this.addState("sign","send","retry",e),this.addState("retry","afterRetry","afterRetry",e),this.addState("afterRetry","sign","error",e),this.addState("send","validateResponse","retry",e),this.addState("validateResponse","extractData","extractError",e),this.addState("extractError","extractData","retry",e),this.addState("extractData","success","retry",e),this.addState("restart","build","error",e),this.addState("success","complete","complete",e),this.addState("error","complete","complete",e),this.addState("complete",null,null,e)},c.setupStates(),n.Request=i({constructor:function(e,t,i){var s=e.endpoint,a=e.config.region,u=e.config.customUserAgent;e.isGlobalEndpoint&&(a="us-east-1"),this.domain=o&&o.active,this.service=e,this.operation=t,this.params=i||{},this.httpRequest=new n.HttpRequest(s,a),this.httpRequest.appendToUserAgent(u),this.startTime=e.getSkewCorrectedDate(),this.response=new n.Response(this),this._asm=new r(c.states,"validate"),this._haltHandlersOnError=!1,n.SequentialExecutor.call(this),this.emit=this.emitEvent},send:function(e){return e&&(this.httpRequest.appendToUserAgent("callback"),this.on("complete",(function(t){e.call(t,t.error,t.data)}))),this.runTo(),this.response},build:function(e){return this.runTo("send",e)},runTo:function(e,t){return this._asm.runTo(e,t,this),this},abort:function(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",(function(e){e.error=n.util.error(new Error("Request aborted by user"),{code:"RequestAbortedError",retryable:!1})})),this.httpRequest.stream&&!this.httpRequest.stream.didCallback&&(this.httpRequest.stream.abort(),this.httpRequest._abortCallback?this.httpRequest._abortCallback():this.removeAllListeners("send")),this},eachPage:function(e){e=n.util.fn.makeAsync(e,3),this.on("complete",(function t(r){e.call(r,r.error,r.data,(function(i){!1!==i&&(r.hasNextPage()?r.nextPage().on("complete",t).send():e.call(r,null,null,n.util.fn.noop))}))})).send()},eachItem:function(e){var t=this;this.eachPage((function(r,i){if(r)return e(r,null);if(null===i)return e(null,null);var o=t.service.paginationConfig(t.operation).resultKey;Array.isArray(o)&&(o=o[0]);var a=s.search(i,o),c=!0;return n.util.arrayEach(a,(function(t){if(!1===(c=e(null,t)))return n.util.abort})),c}))},isPageable:function(){return!!this.service.paginationConfig(this.operation)},createReadStream:function(){var e=n.util.stream,r=this,i=null;return 2===n.HttpClient.streamsApiVersion?(i=new e.PassThrough,t.nextTick((function(){r.send()}))):((i=new e.Stream).readable=!0,i.sent=!1,i.on("newListener",(function(e){i.sent||"data"!==e||(i.sent=!0,t.nextTick((function(){r.send()})))}))),this.on("error",(function(e){i.emit("error",e)})),this.on("httpHeaders",(function(t,o,s){if(t<300){r.removeListener("httpData",n.EventListeners.Core.HTTP_DATA),r.removeListener("httpError",n.EventListeners.Core.HTTP_ERROR),r.on("httpError",(function(e){s.error=e,s.error.retryable=!1}));var a,c=!1;if("HEAD"!==r.httpRequest.method&&(a=parseInt(o["content-length"],10)),void 0!==a&&!isNaN(a)&&a>=0){c=!0;var u=0}var l=function(){c&&u!==a?i.emit("error",n.util.error(new Error("Stream content length mismatch. Received "+u+" of "+a+" bytes."),{code:"StreamContentLengthMismatch"})):2===n.HttpClient.streamsApiVersion?i.end():i.emit("end")},p=s.httpResponse.createUnbufferedStream();if(2===n.HttpClient.streamsApiVersion)if(c){var h=new e.PassThrough;h._write=function(t){return t&&t.length&&(u+=t.length),e.PassThrough.prototype._write.apply(this,arguments)},h.on("end",l),i.on("error",(function(e){c=!1,p.unpipe(h),h.emit("end"),h.end()})),p.pipe(h).pipe(i,{end:!1})}else p.pipe(i);else c&&p.on("data",(function(e){e&&e.length&&(u+=e.length)})),p.on("data",(function(e){i.emit("data",e)})),p.on("end",l);p.on("error",(function(e){c=!1,i.emit("error",e)}))}})),i},emitEvent:function(e,t,r){"function"==typeof t&&(r=t,t=null),r||(r=function(){}),t||(t=this.eventParameters(e,this.response)),n.SequentialExecutor.prototype.emit.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 n.Signers.Presign).sign(this.toGet(),e,t)},isPresigned:function(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function(){return this._unAuthenticated=!0,this.removeListener("validate",n.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",n.EventListeners.Core.SIGN),this},toGet:function(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function(e){e.httpRequest.method="GET",e.httpRequest.path=e.service.endpoint.path+"?"+e.httpRequest.body,e.httpRequest.body="",delete e.httpRequest.headers["Content-Length"],delete e.httpRequest.headers["Content-Type"]},haltHandlersOnError:function(){this._haltHandlersOnError=!0}}),n.Request.addPromisesToClass=function(e){this.prototype.promise=function(){var t=this;return this.httpRequest.appendToUserAgent("promise"),new e((function(e,n){t.on("complete",(function(t){t.error?n(t.error):e(Object.defineProperty(t.data||{},"$response",{value:t}))})),t.runTo()}))}},n.Request.deletePromisesFromClass=function(){delete this.prototype.promise},n.util.addPromises(n.Request),n.util.mixin(n.Request,n.SequentialExecutor)}).call(this,e("_process"))},{"./core":19,"./state_machine":71,_process:86,jmespath:85}],57:[function(e,t,n){function r(e){var t=e.request._waiter,n=t.config.acceptors,r=!1,i="retry";n.forEach((function(n){if(!r){var o=t.matchers[n.matcher];o&&o(e,n.expected,n.argument)&&(r=!0,i=n.state)}})),!r&&e.error&&(i="failure"),"success"===i?t.setSuccess(e):t.setError(e,"retry"===i)}var i=e("./core"),o=i.util.inherit,s=e("jmespath");i.ResourceWaiter=o({constructor:function(e,t){this.service=e,this.state=t,this.loadWaiterConfig(this.state)},service:null,state:null,config:null,matchers:{path:function(e,t,n){try{var r=s.search(e.data,n)}catch(e){return!1}return s.strictDeepEqual(r,t)},pathAll:function(e,t,n){try{var r=s.search(e.data,n)}catch(e){return!1}Array.isArray(r)||(r=[r]);var i=r.length;if(!i)return!1;for(var o=0;o<i;o++)if(!s.strictDeepEqual(r[o],t))return!1;return!0},pathAny:function(e,t,n){try{var r=s.search(e.data,n)}catch(e){return!1}Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++)if(s.strictDeepEqual(r[o],t))return!0;return!1},status:function(e,t){var n=e.httpResponse.statusCode;return"number"==typeof n&&n===t},error:function(e,t){return"string"==typeof t&&e.error?t===e.error.code:t===!!e.error}},listeners:(new i.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.delay||0))})),e("CHECK_OUTPUT","extractData",r),e("CHECK_ERROR","extractError",r)})),wait:function(e,t){"function"==typeof e&&(t=e,e=void 0),e&&e.$waiter&&("number"==typeof(e=i.util.copy(e)).$waiter.delay&&(this.config.delay=e.$waiter.delay),"number"==typeof e.$waiter.maxAttempts&&(this.config.maxAttempts=e.$waiter.maxAttempts),delete e.$waiter);var n=this.service.makeRequest(this.config.operation,e);return n._waiter=this,n.response.maxRetries=this.config.maxAttempts,n.addListeners(this.listeners),t&&n.send(t),n},setSuccess:function(e){e.error=null,e.data=e.data||{},e.request.removeAllListeners("extractData")},setError:function(e,t){e.data=null,e.error=i.util.error(e.error||new Error,{code:"ResourceNotReady",message:"Resource is not in the state "+this.state,retryable:t})},loadWaiterConfig:function(e){if(!this.service.api.waiters[e])throw new i.util.error(new Error,{code:"StateNotFoundError",message:"State "+e+" not found."});this.config=i.util.copy(this.service.api.waiters[e])}})},{"./core":19,jmespath:85}],58:[function(e,t,n){var r=e("./core"),i=r.util.inherit,o=e("jmespath");r.Response=i({constructor:function(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new r.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function(e){var t,n=this.request.service,i=this.request.operation;try{t=n.paginationConfig(i,!0)}catch(e){this.error=e}if(!this.hasNextPage()){if(e)e(this.error,null);else if(this.error)throw this.error;return null}var o=r.util.copy(this.request.params);if(this.nextPageTokens){var s=t.inputToken;"string"==typeof s&&(s=[s]);for(var a=0;a<s.length;a++)o[s[a]]=this.nextPageTokens[a];return n.makeRequest(this.request.operation,o,e)}return e?e(null,null):null},hasNextPage:function(){return this.cacheNextPageTokens(),!!this.nextPageTokens||void 0===this.nextPageTokens&&void 0},cacheNextPageTokens:function(){if(Object.prototype.hasOwnProperty.call(this,"nextPageTokens"))return this.nextPageTokens;this.nextPageTokens=void 0;var e=this.request.service.paginationConfig(this.request.operation);if(!e)return this.nextPageTokens;if(this.nextPageTokens=null,e.moreResults&&!o.search(this.data,e.moreResults))return this.nextPageTokens;var t=e.outputToken;return"string"==typeof t&&(t=[t]),r.util.arrayEach.call(this,t,(function(e){var t=o.search(this.data,e);t&&(this.nextPageTokens=this.nextPageTokens||[],this.nextPageTokens.push(t))})),this.nextPageTokens}})},{"./core":19,jmespath:85}],59:[function(e,t,n){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,n){return this._events[e]?n?this._events[e].unshift(t):this._events[e].push(t):this._events[e]=[t],this},onAsync:function(e,t,n){return t._isAsync=!0,this.on(e,t,n)},removeListener:function(e,t){var n=this._events[e];if(n){for(var r=n.length,i=-1,o=0;o<r;++o)n[o]===t&&(i=o);i>-1&&n.splice(i,1)}return this},removeAllListeners:function(e){return e?delete this._events[e]:this._events={},this},emit:function(e,t,n){n||(n=function(){});var r=this.listeners(e),i=r.length;return this.callListeners(r,t,n),i>0},callListeners:function(e,t,n,i){function o(i){if(i&&(a=r.util.error(a||new Error,i),s._haltHandlersOnError))return n.call(s,a);s.callListeners(e,t,n,a)}for(var s=this,a=i||null;e.length>0;){var c=e.shift();if(c._isAsync)return void c.apply(s,t.concat([o]));try{c.apply(s,t)}catch(e){a=r.util.error(a||new Error,e)}if(a&&s._haltHandlersOnError)return void n.call(s,a)}n.call(s,a)},addListeners:function(e){var t=this;return e._events&&(e=e._events),r.util.each(e,(function(e,n){"function"==typeof n&&(n=[n]),r.util.arrayEach(n,(function(n){t.on(e,n)}))})),t},addNamedListener:function(e,t,n,r){return this[e]=n,this.addListener(t,n,r),this},addNamedAsyncListener:function(e,t,n,r){return n._isAsync=!0,this.addNamedListener(e,t,n,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":19}],60:[function(e,t,n){(function(n){var r=e("./core"),i=e("./model/api"),o=e("./region_config"),a=r.util.inherit,c=0;r.Service=a({constructor:function(e){if(!this.loadServiceClass)throw r.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});if(t){var n=r.util.copy(e),i=new t(e);return Object.defineProperty(i,"_originalConfig",{get:function(){return n},enumerable:!1,configurable:!0}),i._clientId=++c,i}this.initialize(e)},initialize:function(e){var t=r.config[this.serviceIdentifier];if(this.config=new r.Config(r.config),t&&this.config.update(t,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||o(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),r.SequentialExecutor.call(this),r.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||r.Service._clientSideMonitoring)&&this.publisher){var i=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",(function(e){n.nextTick((function(){i.eventHandler(e)}))})),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",(function(e){n.nextTick((function(){i.eventHandler(e)}))}))}},validateService:function(){},loadServiceClass:function(e){var t=e;if(r.util.isEmpty(this.api)){if(t.apiConfig)return r.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){(t=new r.Config(r.config)).update(e,!0);var n=t.apiVersions[this.constructor.serviceIdentifier];return n=n||t.apiVersion,this.getLatestServiceClass(n)}return null}return null},getLatestServiceClass:function(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&r.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},getLatestServiceVersion:function(e){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?r.util.isType(e,Date)&&(e=r.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var t=Object.keys(this.constructor.services).sort(),n=null,i=t.length-1;i>=0;i--)if("*"!==t[i][t[i].length-1]&&(n=t[i]),t[i].substr(0,10)<=e)return n;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,customizeRequests:function(e){if(e){if("function"!=typeof e)throw new Error("Invalid callback type '"+s(e)+"' provided in customizeRequests");this.customRequestHandler=e}else this.customRequestHandler=null},makeRequest:function(e,t,n){if("function"==typeof t&&(n=t,t=null),t=t||{},this.config.params){var i=this.api.operations[e];i&&(t=r.util.copy(t),r.util.each(this.config.params,(function(e,n){i.input.members[e]&&(void 0!==t[e]&&null!==t[e]||(t[e]=n))})))}var o=new r.Request(this,e,t);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),n&&o.send(n),o},makeUnauthenticatedRequest:function(e,t,n){"function"==typeof t&&(n=t,t={});var r=this.makeRequest(e,t).toUnauthenticated();return n?r.send(n):r},waitFor:function(e,t,n){return new r.ResourceWaiter(this,e).wait(t,n)},addAllRequestListeners:function(e){for(var t=[r.events,r.EventListeners.Core,this.serviceInterface(),r.EventListeners.CorePost],n=0;n<t.length;n++)t[n]&&e.addListeners(t[n]);this.config.paramValidation||e.removeListener("validate",r.EventListeners.Core.VALIDATE_PARAMETERS),this.config.logger&&e.addListeners(r.EventListeners.Logger),this.setupRequestListeners(e),"function"==typeof this.constructor.prototype.customRequestHandler&&this.constructor.prototype.customRequestHandler(e),Object.prototype.hasOwnProperty.call(this,"customRequestHandler")&&"function"==typeof this.customRequestHandler&&this.customRequestHandler(e)},apiCallEvent:function(e){var t=e.service.api.operations[e.operation],n={Type:"ApiCall",Api:t?t.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Region:e.httpRequest.region,MaxRetriesExceeded:0,UserAgent:e.httpRequest.getUserAgent()},r=e.response;if(r.httpResponse.statusCode&&(n.FinalHttpStatusCode=r.httpResponse.statusCode),r.error){var i=r.error;r.httpResponse.statusCode>299?(i.code&&(n.FinalAwsException=i.code),i.message&&(n.FinalAwsExceptionMessage=i.message)):((i.code||i.name)&&(n.FinalSdkException=i.code||i.name),i.message&&(n.FinalSdkExceptionMessage=i.message))}return n},apiAttemptEvent:function(e){var t=e.service.api.operations[e.operation],n={Type:"ApiCallAttempt",Api:t?t.name:e.operation,Version:1,Service:e.service.api.serviceId||e.service.api.endpointPrefix,Fqdn:e.httpRequest.endpoint.hostname,UserAgent:e.httpRequest.getUserAgent()},r=e.response;return r.httpResponse.statusCode&&(n.HttpStatusCode=r.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(n.AccessKey=e.service.config.credentials.accessKeyId),r.httpResponse.headers?(e.httpRequest.headers["x-amz-security-token"]&&(n.SessionToken=e.httpRequest.headers["x-amz-security-token"]),r.httpResponse.headers["x-amzn-requestid"]&&(n.XAmznRequestId=r.httpResponse.headers["x-amzn-requestid"]),r.httpResponse.headers["x-amz-request-id"]&&(n.XAmzRequestId=r.httpResponse.headers["x-amz-request-id"]),r.httpResponse.headers["x-amz-id-2"]&&(n.XAmzId2=r.httpResponse.headers["x-amz-id-2"]),n):n},attemptFailEvent:function(e){var t=this.apiAttemptEvent(e),n=e.response,r=n.error;return n.httpResponse.statusCode>299?(r.code&&(t.AwsException=r.code),r.message&&(t.AwsExceptionMessage=r.message)):((r.code||r.name)&&(t.SdkException=r.code||r.name),r.message&&(t.SdkExceptionMessage=r.message)),t},attachMonitoringEmitter:function(e){var t,n,i,o,s,a,c=0,u=this;e.on("validate",(function(){o=r.util.realClock.now(),a=Date.now()}),!0),e.on("sign",(function(){n=r.util.realClock.now(),t=Date.now(),s=e.httpRequest.region,c++}),!0),e.on("validateResponse",(function(){i=Math.round(r.util.realClock.now()-n)})),e.addNamedListener("API_CALL_ATTEMPT","success",(function(){var n=u.apiAttemptEvent(e);n.Timestamp=t,n.AttemptLatency=i>=0?i:0,n.Region=s,u.emit("apiCallAttempt",[n])})),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",(function(){var o=u.attemptFailEvent(e);o.Timestamp=t,i=i||Math.round(r.util.realClock.now()-n),o.AttemptLatency=i>=0?i:0,o.Region=s,u.emit("apiCallAttempt",[o])})),e.addNamedListener("API_CALL","complete",(function(){var t=u.apiCallEvent(e);if(t.AttemptCount=c,!(t.AttemptCount<=0)){t.Timestamp=a;var n=Math.round(r.util.realClock.now()-o);t.Latency=n>=0?n:0;var i=e.response;"number"==typeof i.retryCount&&"number"==typeof i.maxRetries&&i.retryCount>=i.maxRetries&&(t.MaxRetriesExceeded=1),u.emit("apiCall",[t])}}))},setupRequestListeners:function(e){},getSignerClass:function(e){var t,n=null,i="";return e&&(i=(n=(e.service.api.operations||{})[e.operation]||null)?n.authtype:""),t=this.config.signatureVersion?this.config.signatureVersion:"v4"===i||"v4-unsigned-body"===i?"v4":this.api.signatureVersion,r.Signers.RequestSigner.getVersion(t)},serviceInterface:function(){switch(this.api.protocol){case"ec2":case"query":return r.EventListeners.Query;case"json":return r.EventListeners.Json;case"rest-json":return r.EventListeners.RestJson;case"rest-xml":return r.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},successfulResponse:function(e){return e.httpResponse.statusCode<300},numRetries:function(){return void 0!==this.config.maxRetries?this.config.maxRetries:this.defaultRetryCount},retryDelays:function(e,t){return r.util.calculateRetryDelay(e,this.config.retryDelayOptions,t)},retryableError:function(e){return!!this.timeoutError(e)||!!this.networkingError(e)||!!this.expiredCredentialsError(e)||!!this.throttledError(e)||e.statusCode>=500},networkingError:function(e){return"NetworkingError"===e.code},timeoutError:function(e){return"TimeoutError"===e.code},expiredCredentialsError:function(e){return"ExpiredTokenException"===e.code},clockSkewError:function(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},getSkewCorrectedDate:function(){return new Date(Date.now()+this.config.systemClockOffset)},applyClockOffset:function(e){e&&(this.config.systemClockOffset=e-Date.now())},isClockSkewed:function(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e4},throttledError:function(e){if(429===e.statusCode)return!0;switch(e.code){case"ProvisionedThroughputExceededException":case"Throttling":case"ThrottlingException":case"RequestLimitExceeded":case"RequestThrottled":case"RequestThrottledException":case"TooManyRequestsException":case"TransactionInProgressException":return!0;default:return!1}},endpointFromTemplate:function(e){if("string"!=typeof e)return e;var t=e;return(t=(t=t.replace(/\{service\}/g,this.api.endpointPrefix)).replace(/\{region\}/g,this.config.region)).replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function(e){this.endpoint=new r.Endpoint(e,this.config)},paginationConfig:function(e,t){var n=this.api.operations[e].paginator;if(!n){if(t){var i=new Error;throw r.util.error(i,"No pagination configuration for "+e)}return null}return n}}),r.util.update(r.Service,{defineMethods:function(e){r.util.each(e.prototype.api.operations,(function(t){e.prototype[t]||("none"===e.prototype.api.operations[t].authtype?e.prototype[t]=function(e,n){return this.makeUnauthenticatedRequest(t,e,n)}:e.prototype[t]=function(e,n){return this.makeRequest(t,e,n)})}))},defineService:function(e,t,n){r.Service._serviceMap[e]=!0,Array.isArray(t)||(n=t,t=[]);var i=a(r.Service,n||{});if("string"==typeof e){r.Service.addVersions(i,t);var o=i.serviceIdentifier||e;i.serviceIdentifier=o}else i.prototype.api=e,r.Service.defineMethods(i);if(r.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&r.util.clientSideMonitoring){var s=r.util.clientSideMonitoring.Publisher,c=(0,r.util.clientSideMonitoring.configProvider)();this.prototype.publisher=new s(c),c.enabled&&(r.Service._clientSideMonitoring=!0)}return r.SequentialExecutor.call(i.prototype),r.Service.addDefaultMonitoringListeners(i.prototype),i},addVersions:function(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var n=0;n<t.length;n++)void 0===e.services[t[n]]&&(e.services[t[n]]=null);e.apiVersions=Object.keys(e.services).sort()},defineServiceApi:function(e,t,n){function o(e){e.isApi?s.prototype.api=e:s.prototype.api=new i(e)}var s=a(e,{serviceIdentifier:e.serviceIdentifier});if("string"==typeof t){if(n)o(n);else try{o(r.apiLoader(e.serviceIdentifier,t))}catch(n){throw r.util.error(n,{message:"Could not find API configuration "+e.serviceIdentifier+"-"+t})}Object.prototype.hasOwnProperty.call(e.services,t)||(e.apiVersions=e.apiVersions.concat(t).sort()),e.services[t]=s}else o(t);return r.Service.defineMethods(s),s},hasService:function(e){return Object.prototype.hasOwnProperty.call(r.Service._serviceMap,e)},addDefaultMonitoringListeners:function(e){e.addNamedListener("MONITOR_EVENTS_BUBBLE","apiCallAttempt",(function(t){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCallAttempt",[t])})),e.addNamedListener("CALL_EVENTS_BUBBLE","apiCall",(function(t){var n=Object.getPrototypeOf(e);n._events&&n.emit("apiCall",[t])}))},_serviceMap:{}}),r.util.mixin(r.Service,r.SequentialExecutor),t.exports=r.Service}).call(this,e("_process"))},{"./core":19,"./model/api":39,"./region_config":54,_process:86}],61:[function(e,t,n){var r=e("../core");r.util.update(r.CognitoIdentity.prototype,{getOpenIdToken:function(e,t){return this.makeUnauthenticatedRequest("getOpenIdToken",e,t)},getId:function(e,t){return this.makeUnauthenticatedRequest("getId",e,t)},getCredentialsForIdentity:function(e,t){return this.makeUnauthenticatedRequest("getCredentialsForIdentity",e,t)}})},{"../core":19}],62:[function(e,t,n){(function(t){var n=e("../core"),r=e("../region_config");n.util.update(n.STS.prototype,{credentialsFrom:function(e,t){return e?(t||(t=new n.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)},validateRegionalEndpointsFlagValue:function(e,t){if(!("string"==typeof e&&["legacy","regional"].indexOf(e.toLowerCase())>=0))throw n.util.error(new Error,t);this.config.stsRegionalEndpoints=e.toLowerCase()},validateRegionalEndpointsFlag:function(){var e=this.config;if(e.stsRegionalEndpoints&&this.validateRegionalEndpointsFlagValue(e.stsRegionalEndpoints,{code:"InvalidConfiguration",message:'invalid "stsRegionalEndpoints" configuration. Expect "legacy" or "regional". Got "'+e.stsRegionalEndpoints+'".'}),n.util.isNode()){if(Object.prototype.hasOwnProperty.call(t.env,"AWS_STS_REGIONAL_ENDPOINTS")){var r=t.env.AWS_STS_REGIONAL_ENDPOINTS;this.validateRegionalEndpointsFlagValue(r,{code:"InvalidEnvironmentalVariable",message:'invalid AWS_STS_REGIONAL_ENDPOINTS environmental variable. Expect "legacy" or "regional". Got "'+t.env.AWS_STS_REGIONAL_ENDPOINTS+'".'})}var i={};try{i=n.util.getProfilesFromSharedConfig(n.util.iniLoader)[t.env.AWS_PROFILE||n.util.defaultProfile]}catch(e){}if(i&&Object.prototype.hasOwnProperty.call(i,"sts_regional_endpoints")){var o=i.sts_regional_endpoints;this.validateRegionalEndpointsFlagValue(o,{code:"InvalidConfiguration",message:'invalid sts_regional_endpoints profile config. Expect "legacy" or "regional". Got "'+i.sts_regional_endpoints+'".'})}}},optInRegionalEndpoint:function(){this.validateRegionalEndpointsFlag();var e=this.config;if("regional"===e.stsRegionalEndpoints){if(r(this),!this.isGlobalEndpoint)return;if(this.isGlobalEndpoint=!1,!e.region)throw n.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var t=e.endpoint.indexOf(".amazonaws.com");e.endpoint=e.endpoint.substring(0,t)+"."+e.region+e.endpoint.substring(t)}},validateService:function(){this.optInRegionalEndpoint()}})}).call(this,e("_process"))},{"../core":19,"../region_config":54,_process:86}],63:[function(e,t,n){function r(e){var t=e.httpRequest.headers[a],n=e.service.getSignerClass(e);if(delete e.httpRequest.headers["User-Agent"],delete e.httpRequest.headers["X-Amz-User-Agent"],n===o.Signers.V4){if(t>604800)throw o.util.error(new Error,{code:"InvalidExpiryTime",message:"Presigning does not support expiry time greater than a week with SigV4 signing.",retryable:!1});e.httpRequest.headers[a]=t}else{if(n!==o.Signers.S3)throw o.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});var r=e.service?e.service.getSkewCorrectedDate():o.util.date.getDate();e.httpRequest.headers[a]=parseInt(o.util.date.unixTimestamp(r)+t,10).toString()}}function i(e){var t=e.httpRequest.endpoint,n=o.util.urlParse(e.httpRequest.path),r={};n.search&&(r=o.util.queryStringParse(n.search.substr(1)));var i=e.httpRequest.headers.Authorization.split(" ");if("AWS"===i[0])i=i[1].split(":"),r.AWSAccessKeyId=i[0],r.Signature=i[1],o.util.each(e.httpRequest.headers,(function(e,t){e===a&&(e="Expires"),0===e.indexOf("x-amz-meta-")&&(delete r[e],e=e.toLowerCase()),r[e]=t})),delete e.httpRequest.headers[a],delete r.Authorization,delete r.Host;else if("AWS4-HMAC-SHA256"===i[0]){i.shift();var s=i.join(" ").match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];r["X-Amz-Signature"]=s,delete r.Expires}t.pathname=n.pathname,t.search=o.util.queryParamsToString(r)}var o=e("../core"),s=o.util.inherit,a="presigned-expires";o.Signers.Presign=s({sign:function(e,t,n){if(e.httpRequest.headers[a]=t||3600,e.on("build",r),e.on("sign",i),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":19}],64:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.RequestSigner=i({constructor:function(e){this.request=e},setServiceClientId:function(e){this.serviceClientId=e},getServiceClientId:function(){return this.serviceClientId}}),r.Signers.RequestSigner.getVersion=function(e){switch(e){case"v2":return r.Signers.V2;case"v3":return r.Signers.V3;case"s3v4":case"v4":return r.Signers.V4;case"s3":return r.Signers.S3;case"v3https":return r.Signers.V3Https}throw new Error("Unknown signing version "+e)},e("./v2"),e("./v3"),e("./v3https"),e("./v4"),e("./s3"),e("./presign")},{"../core":19,"./presign":63,"./s3":65,"./v2":66,"./v3":67,"./v3https":68,"./v4":69}],65:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.S3=i(r.Signers.RequestSigner,{subResources:{acl:1,accelerate:1,analytics:1,cors:1,lifecycle:1,delete:1,inventory:1,location:1,logging:1,metrics:1,notification:1,partNumber:1,policy:1,requestPayment:1,replication: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 n=this.sign(e.secretAccessKey,this.stringToSign()),i="AWS "+e.accessKeyId+":"+n;this.request.headers.Authorization=i},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 n=this.canonicalizedAmzHeaders();return n&&t.push(n),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()<t.toLowerCase()?-1:1}));var t=[];return r.util.arrayEach.call(this,e,(function(e){t.push(e.toLowerCase()+":"+String(this.request.headers[e]))})),t.join("\n")},canonicalizedResource:function(){var e=this.request,t=e.path.split("?"),n=t[0],i=t[1],o="";if(e.virtualHostedBucket&&(o+="/"+e.virtualHostedBucket),o+=n,i){var s=[];r.util.arrayEach.call(this,i.split("&"),(function(e){var t=e.split("=")[0],n=e.split("=")[1];if(this.subResources[t]||this.responseHeaders[t]){var r={name:t};void 0!==n&&(this.subResources[t]?r.value=n:r.value=decodeURIComponent(n)),s.push(r)}})),s.sort((function(e,t){return e.name<t.name?-1:1})),s.length&&(i=[],r.util.arrayEach(s,(function(e){void 0===e.value?i.push(e.name):i.push(e.name+"="+e.value)})),o+="?"+i.join("&"))}return o},sign:function(e,t){return r.util.crypto.hmac(e,t,"base64","sha1")}}),t.exports=r.Signers.S3},{"../core":19}],66:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.V2=i(r.Signers.RequestSigner,{addAuthorization:function(e,t){t||(t=r.util.date.getDate());var n=this.request;n.params.Timestamp=r.util.date.iso8601(t),n.params.SignatureVersion="2",n.params.SignatureMethod="HmacSHA256",n.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(n.params.SecurityToken=e.sessionToken),delete n.params.Signature,n.params.Signature=this.signature(e),n.body=r.util.queryParamsToString(n.params),n.headers["Content-Length"]=n.body.length},signature:function(e){return r.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},stringToSign:function(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(r.util.queryParamsToString(this.request.params)),e.join("\n")}}),t.exports=r.Signers.V2},{"../core":19}],67:[function(e,t,n){var r=e("../core"),i=r.util.inherit;r.Signers.V3=i(r.Signers.RequestSigner,{addAuthorization:function(e,t){var n=r.util.date.rfc822(t);this.request.headers["X-Amz-Date"]=n,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken),this.request.headers["X-Amzn-Authorization"]=this.authorization(e,n)},authorization:function(e){return"AWS3 AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,SignedHeaders="+this.signedHeaders()+",Signature="+this.signature(e)},signedHeaders:function(){var e=[];return r.util.arrayEach(this.headersToSign(),(function(t){e.push(t.toLowerCase())})),e.sort().join(";")},canonicalHeaders:function(){var e=this.request.headers,t=[];return r.util.arrayEach(this.headersToSign(),(function(n){t.push(n.toLowerCase().trim()+":"+String(e[n]).trim())})),t.sort().join("\n")+"\n"},headersToSign:function(){var e=[];return r.util.each(this.request.headers,(function(t){("Host"===t||"Content-Encoding"===t||t.match(/^X-Amz/i))&&e.push(t)})),e},signature:function(e){return r.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},stringToSign:function(){var e=[];return e.push(this.request.method),e.push("/"),e.push(""),e.push(this.canonicalHeaders()),e.push(this.request.body),r.util.crypto.sha256(e.join("\n"))}}),t.exports=r.Signers.V3},{"../core":19}],68:[function(e,t,n){var r=e("../core"),i=r.util.inherit;e("./v3"),r.Signers.V3Https=i(r.Signers.V3,{authorization:function(e){return"AWS3-HTTPS AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,Signature="+this.signature(e)},stringToSign:function(){return this.request.headers["X-Amz-Date"]}}),t.exports=r.Signers.V3Https},{"../core":19,"./v3":67}],69:[function(e,t,n){var r=e("../core"),i=e("./v4_credentials"),o=r.util.inherit;r.Signers.V4=o(r.Signers.RequestSigner,{constructor:function(e,t,n){r.Signers.RequestSigner.call(this,e),this.serviceName=t,n=n||{},this.signatureCache="boolean"!=typeof n.signatureCache||n.signatureCache,this.operation=n.operation,this.signatureVersion=n.signatureVersion},algorithm:"AWS4-HMAC-SHA256",addAuthorization:function(e,t){var n=r.util.date.iso8601(t).replace(/[:\-]|\.\d{3}/g,"");this.isPresigned()?this.updateForPresigned(e,n):this.addHeaders(e,n),this.request.headers.Authorization=this.authorization(e,n)},addHeaders:function(e,t){this.request.headers["X-Amz-Date"]=t,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken)},updateForPresigned:function(e,t){var n=this.credentialString(t),i={"X-Amz-Date":t,"X-Amz-Algorithm":this.algorithm,"X-Amz-Credential":e.accessKeyId+"/"+n,"X-Amz-Expires":this.request.headers["presigned-expires"],"X-Amz-SignedHeaders":this.signedHeaders()};e.sessionToken&&(i["X-Amz-Security-Token"]=e.sessionToken),this.request.headers["Content-Type"]&&(i["Content-Type"]=this.request.headers["Content-Type"]),this.request.headers["Content-MD5"]&&(i["Content-MD5"]=this.request.headers["Content-MD5"]),this.request.headers["Cache-Control"]&&(i["Cache-Control"]=this.request.headers["Cache-Control"]),r.util.each.call(this,this.request.headers,(function(e,t){if("presigned-expires"!==e&&this.isSignableHeader(e)){var n=e.toLowerCase();0===n.indexOf("x-amz-meta-")?i[n]=t:0===n.indexOf("x-amz-")&&(i[e]=t)}}));var o=this.request.path.indexOf("?")>=0?"&":"?";this.request.path+=o+r.util.queryParamsToString(i)},authorization:function(e,t){var n=[],r=this.credentialString(t);return n.push(this.algorithm+" Credential="+e.accessKeyId+"/"+r),n.push("SignedHeaders="+this.signedHeaders()),n.push("Signature="+this.signature(e,t)),n.join(", ")},signature:function(e,t){var n=i.getSigningKey(e,t.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return r.util.crypto.hmac(n,this.stringToSign(t),"hex")},stringToSign:function(e){var t=[];return t.push("AWS4-HMAC-SHA256"),t.push(e),t.push(this.credentialString(e)),t.push(this.hexEncodedHash(this.canonicalString())),t.join("\n")},canonicalString:function(){var e=[],t=this.request.pathname();return"s3"!==this.serviceName&&"s3v4"!==this.signatureVersion&&(t=r.util.uriEscapePath(t)),e.push(this.request.method),e.push(t),e.push(this.request.search()),e.push(this.canonicalHeaders()+"\n"),e.push(this.signedHeaders()),e.push(this.hexEncodedBodyHash()),e.join("\n")},canonicalHeaders:function(){var e=[];r.util.each.call(this,this.request.headers,(function(t,n){e.push([t,n])})),e.sort((function(e,t){return e[0].toLowerCase()<t[0].toLowerCase()?-1:1}));var t=[];return r.util.arrayEach.call(this,e,(function(e){var n=e[0].toLowerCase();if(this.isSignableHeader(n)){var i=e[1];if(null==i||"function"!=typeof i.toString)throw r.util.error(new Error("Header "+n+" contains invalid value"),{code:"InvalidHeader"});t.push(n+":"+this.canonicalHeaderValues(i.toString()))}})),t.join("\n")},canonicalHeaderValues:function(e){return e.replace(/\s+/g," ").replace(/^\s+|\s+$/g,"")},signedHeaders:function(){var e=[];return r.util.each.call(this,this.request.headers,(function(t){t=t.toLowerCase(),this.isSignableHeader(t)&&e.push(t)})),e.sort().join(";")},credentialString:function(e){return i.createScope(e.substr(0,8),this.request.region,this.serviceName)},hexEncodedHash:function(e){return r.util.crypto.sha256(e,"hex")},hexEncodedBodyHash:function(){var e=this.request;return this.isPresigned()&&"s3"===this.serviceName&&!e.body?"UNSIGNED-PAYLOAD":e.headers["X-Amz-Content-Sha256"]?e.headers["X-Amz-Content-Sha256"]:this.hexEncodedHash(this.request.body||"")},unsignableHeaders:["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id"],isSignableHeader:function(e){return 0===e.toLowerCase().indexOf("x-amz-")||this.unsignableHeaders.indexOf(e)<0},isPresigned:function(){return!!this.request.headers["presigned-expires"]}}),t.exports=r.Signers.V4},{"../core":19,"./v4_credentials":70}],70:[function(e,t,n){var r=e("../core"),i={},o=[];t.exports={createScope:function(e,t,n){return[e.substr(0,8),t,n,"aws4_request"].join("/")},getSigningKey:function(e,t,n,s,a){var c=[r.util.crypto.hmac(e.secretAccessKey,e.accessKeyId,"base64"),t,n,s].join("_");if((a=!1!==a)&&c in i)return i[c];var u=r.util.crypto.hmac("AWS4"+e.secretAccessKey,t,"buffer"),l=r.util.crypto.hmac(u,n,"buffer"),p=r.util.crypto.hmac(l,s,"buffer"),h=r.util.crypto.hmac(p,"aws4_request","buffer");return a&&(i[c]=h,o.push(c),o.length>50&&delete i[o.shift()]),h},emptyCache:function(){i={},o=[]}}},{"../core":19}],71:[function(e,t,n){function r(e,t){this.currentState=t||null,this.states=e||{}}r.prototype.runTo=function(e,t,n,r){"function"==typeof e&&(r=n,n=t,t=e,e=null);var i=this,o=i.states[i.currentState];o.fn.call(n||i,r,(function(r){if(r){if(!o.fail)return t?t.call(n,r):null;i.currentState=o.fail}else{if(!o.accept)return t?t.call(n):null;i.currentState=o.accept}if(i.currentState===e)return t?t.call(n,r):null;i.runTo(e,t,n,r)}))},r.prototype.addState=function(e,t,n,r){return"function"==typeof t?(r=t,t=null,n=null):"function"==typeof n&&(r=n,n=null),this.currentState||(this.currentState=e),this.states[e]={accept:t,fail:n,fn:r},this},t.exports=r},{}],72:[function(e,t,n){(function(n,r){var i,o={environment:"nodejs",engine:function(){if(o.isBrowser()&&"undefined"!=typeof navigator)return navigator.userAgent;var e=n.platform+"/"+n.version;return n.env.AWS_EXECUTION_ENV&&(e+=" exec-env/"+n.env.AWS_EXECUTION_ENV),e},userAgent:function(){var t=o.environment,n="aws-sdk-"+t+"/"+e("./core").VERSION;return"nodejs"===t&&(n+=" "+o.engine()),n},uriEscape:function(e){var t=encodeURIComponent(e);return(t=t.replace(/[^A-Za-z0-9_.~\-%]+/g,escape)).replace(/[*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},uriEscapePath:function(e){var t=[];return o.arrayEach(e.split("/"),(function(e){t.push(o.uriEscape(e))})),t.join("/")},urlParse:function(e){return o.url.parse(e)},urlFormat:function(e){return o.url.format(e)},queryStringParse:function(e){return o.querystring.parse(e)},queryParamsToString:function(e){var t=[],n=o.uriEscape,r=Object.keys(e).sort();return o.arrayEach(r,(function(r){var i=e[r],s=n(r),a=s+"=";if(Array.isArray(i)){var c=[];o.arrayEach(i,(function(e){c.push(n(e))})),a=s+"="+c.sort().join("&"+s+"=")}else null!=i&&(a=s+"="+n(i));t.push(a)})),t.join("&")},readFileSync:function(t){return o.isBrowser()?null:e("fs").readFileSync(t,"utf-8")},base64:{encode:function(e){if("number"==typeof e)throw o.error(new Error("Cannot base64 encode number "+e));return null==e?e:o.buffer.toBuffer(e).toString("base64")},decode:function(e){if("number"==typeof e)throw o.error(new Error("Cannot base64 decode number "+e));return null==e?e:o.buffer.toBuffer(e,"base64")}},buffer:{toBuffer:function(e,t){return"function"==typeof o.Buffer.from&&o.Buffer.from!==Uint8Array.from?o.Buffer.from(e,t):new o.Buffer(e,t)},alloc:function(e,t,n){if("number"!=typeof e)throw new Error("size passed to alloc must be a number.");if("function"==typeof o.Buffer.alloc)return o.Buffer.alloc(e,t,n);var r=new o.Buffer(e);return void 0!==t&&"function"==typeof r.fill&&r.fill(t,void 0,void 0,n),r},toStream:function(e){o.Buffer.isBuffer(e)||(e=o.buffer.toBuffer(e));var t=new o.stream.Readable,n=0;return t._read=function(r){if(n>=e.length)return t.push(null);var i=n+r;i>e.length&&(i=e.length),t.push(e.slice(n,i)),n=i},t},concat:function(e){var t,n,r=0,i=0;for(t=0;t<e.length;t++)r+=e[t].length;for(n=o.buffer.alloc(r),t=0;t<e.length;t++)e[t].copy(n,i),i+=e[t].length;return n}},string:{byteLength:function(t){if(null==t)return 0;if("string"==typeof t&&(t=o.buffer.toBuffer(t)),"number"==typeof t.byteLength)return t.byteLength;if("number"==typeof t.length)return t.length;if("number"==typeof t.size)return t.size;if("string"==typeof t.path)return e("fs").lstatSync(t.path).size;throw o.error(new Error("Cannot determine length of "+t),{object:t})},upperFirst:function(e){return e[0].toUpperCase()+e.substr(1)},lowerFirst:function(e){return e[0].toLowerCase()+e.substr(1)}},ini:{parse:function(e){var t,n={};return o.arrayEach(e.split(/\r?\n/),(function(e){var r=(e=e.split(/(^|\s)[;#]/)[0]).match(/^\s*\[([^\[\]]+)\]\s*$/);if(r)t=r[1];else if(t){var i=e.match(/^\s*(.+?)\s*=\s*(.+?)\s*$/);i&&(n[t]=n[t]||{},n[t][i[1]]=i[2])}})),n}},fn:{noop:function(){},callback:function(e){if(e)throw e},makeAsync:function(e,t){return t&&t<=e.length?e:function(){var t=Array.prototype.slice.call(arguments,0);t.pop()(e.apply(null,t))}}},date:{getDate:function(){return i||(i=e("./core")),i.config.systemClockOffset?new Date((new Date).getTime()+i.config.systemClockOffset):new Date},iso8601:function(e){return void 0===e&&(e=o.date.getDate()),e.toISOString().replace(/\.\d{3}Z$/,"Z")},rfc822:function(e){return void 0===e&&(e=o.date.getDate()),e.toUTCString()},unixTimestamp:function(e){return void 0===e&&(e=o.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"),o.date[t](o.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 o.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=o.crypto.crc32Table,n=-1;"string"==typeof e&&(e=o.buffer.toBuffer(e));for(var r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.readUInt8(r))];return(-1^n)>>>0},hmac:function(e,t,n,r){return n||(n="binary"),"buffer"===n&&(n=void 0),r||(r="sha256"),"string"==typeof t&&(t=o.buffer.toBuffer(t)),o.crypto.lib.createHmac(r,e).update(t).digest(n)},md5:function(e,t,n){return o.crypto.hash("md5",e,t,n)},sha256:function(e,t,n){return o.crypto.hash("sha256",e,t,n)},hash:function(e,t,n,r){var i=o.crypto.createHash(e);n||(n="binary"),"buffer"===n&&(n=void 0),"string"==typeof t&&(t=o.buffer.toBuffer(t));var a=o.arraySliceFn(t),c=o.Buffer.isBuffer(t);if(o.isBrowser()&&"undefined"!=typeof ArrayBuffer&&t&&t.buffer instanceof ArrayBuffer&&(c=!0),r&&"object"==s(t)&&"function"==typeof t.on&&!c)t.on("data",(function(e){i.update(e)})),t.on("error",(function(e){r(e)})),t.on("end",(function(){r(null,i.digest(n))}));else{if(!r||!a||c||"undefined"==typeof FileReader){o.isBrowser()&&"object"==s(t)&&!c&&(t=new o.Buffer(new Uint8Array(t)));var u=i.update(t).digest(n);return r&&r(null,u),u}var l=0,p=new FileReader;p.onerror=function(){r(new Error("Failed to read data."))},p.onload=function(){var e=new o.Buffer(new Uint8Array(p.result));i.update(e),l+=e.length,p._continueReading()},p._continueReading=function(){if(l>=t.size)r(null,i.digest(n));else{var e=l+524288;e>t.size&&(e=t.size),p.readAsArrayBuffer(a.call(t,l,e))}},p._continueReading()}},toHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push(("0"+e.charCodeAt(n).toString(16)).substr(-2,2));return t.join("")},createHash:function(e){return o.crypto.lib.createHash(e)}},abort:{},each:function(e,t){for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n))if(t.call(this,n,e[n])===o.abort)break}},arrayEach:function(e,t){for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n))if(t.call(this,e[n],parseInt(n,10))===o.abort)break}},update:function(e,t){return o.each(t,(function(t,n){e[t]=n})),e},merge:function(e,t){return o.update(o.copy(e),t)},copy:function(e){if(null==e)return e;var t={};for(var n in e)t[n]=e[n];return t},isEmpty:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},arraySliceFn:function(e){var t=e.slice||e.webkitSlice||e.mozSlice;return"function"==typeof t?t:null},isType:function(e,t){return"function"==typeof t&&(t=o.typeName(t)),Object.prototype.toString.call(e)==="[object "+t+"]"},typeName:function(e){if(Object.prototype.hasOwnProperty.call(e,"name"))return e.name;var t=e.toString(),n=t.match(/^\s*function (.+)\(/);return n?n[1]:t},error:function(e,t){var n=null;return"string"==typeof e.message&&""!==e.message&&("string"==typeof t||t&&t.message)&&((n=o.copy(e)).message=e.message),e.message=e.message||null,"string"==typeof t?e.message=t:"object"==s(t)&&null!==t&&(o.update(e,t),t.message&&(e.message=t.message),(t.code||t.name)&&(e.code=t.code||t.name),t.stack&&(e.stack=t.stack)),"function"==typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.time=new Date,n&&(e.originalError=n),e},inherit:function(e,t){var n=null;if(void 0===t)t=e,e=Object,n={};else{var r=function(){};r.prototype=e.prototype,n=new r}return t.constructor===Object&&(t.constructor=function(){if(e!==Object)return e.apply(this,arguments)}),t.constructor.prototype=n,o.update(t.constructor.prototype,t),t.constructor.__super__=e,t.constructor},mixin:function(){for(var e=arguments[0],t=1;t<arguments.length;t++)for(var n in arguments[t].prototype){var r=arguments[t].prototype[n];"constructor"!==n&&(e.prototype[n]=r)}return e},hideProperties:function(e,t){"function"==typeof Object.defineProperty&&o.arrayEach(t,(function(t){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0})}))},property:function(e,t,n,r,i){var o={configurable:!0,enumerable:void 0===r||r};"function"!=typeof n||i?(o.value=n,o.writable=!0):o.get=n,Object.defineProperty(e,t,o)},memoizedProperty:function(e,t,n,r){var i=null;o.property(e,t,(function(){return null===i&&(i=n()),i}),r)},hoistPayloadMember:function(e){var t=e.request,n=t.operation,r=t.service.api.operations[n],i=r.output;if(i.payload&&!r.hasEventOutput){var s=i.members[i.payload],a=e.data[i.payload];"structure"===s.type&&o.each(a,(function(t,n){o.property(e.data,t,n,!1)}))}},computeSha256:function(t,n){if(o.isNode()){var r=o.stream.Stream,i=e("fs");if("function"==typeof r&&t instanceof r){if("string"!=typeof t.path)return n(new Error("Non-file stream objects are not supported with SigV4"));var s={};"number"==typeof t.start&&(s.start=t.start),"number"==typeof t.end&&(s.end=t.end),t=i.createReadStream(t.path,s)}}o.crypto.sha256(t,"hex",(function(e,t){e?n(e):n(null,t)}))},isClockSkewed:function(e){if(e)return o.property(i.config,"isClockSkewed",Math.abs((new Date).getTime()-e)>=3e5,!1),i.config.isClockSkewed},applyClockOffset:function(e){e&&(i.config.systemClockOffset=e-(new Date).getTime())},extractRequestId:function(e){var t=e.httpResponse.headers["x-amz-request-id"]||e.httpResponse.headers["x-amzn-requestid"];!t&&e.data&&e.data.ResponseMetadata&&(t=e.data.ResponseMetadata.RequestId),t&&(e.requestId=t),e.error&&(e.error.requestId=t)},addPromises:function(e,t){var n=!1;void 0===t&&i&&i.config&&(t=i.config.getPromisesDependency()),void 0===t&&"undefined"!=typeof Promise&&(t=Promise),"function"!=typeof t&&(n=!0),Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var o=e[r];n?o.deletePromisesFromClass&&o.deletePromisesFromClass():o.addPromisesToClass&&o.addPromisesToClass(t)}},promisifyMethod:function(e,t){return function(){var n=this,r=Array.prototype.slice.call(arguments);return new t((function(t,i){r.push((function(e,n){e?i(e):t(n)})),n[e].apply(n,r)}))}},isDualstackAvailable:function(t){if(!t)return!1;var n=e("../apis/metadata.json");return"string"!=typeof t&&(t=t.serviceIdentifier),!("string"!=typeof t||!n.hasOwnProperty(t)||!n[t].dualstackAvailable)},calculateRetryDelay:function(e,t,n){t||(t={});var r=t.customBackoff||null;if("function"==typeof r)return r(e,n);var i="number"==typeof t.base?t.base:100;return Math.random()*(Math.pow(2,e)*i)},handleRequestWithRetries:function(e,t,n){t||(t={});var r=i.HttpClient.getInstance(),s=t.httpOptions||{},a=0,c=function(e){var r=t.maxRetries||0;e&&"TimeoutError"===e.code&&(e.retryable=!0);var i=o.calculateRetryDelay(a,t.retryDelayOptions,e);e&&e.retryable&&a<r&&i>=0?(a++,setTimeout(u,i+(e.retryAfter||0))):n(e)},u=function(){var t="";r.handleRequest(e,s,(function(e){e.on("data",(function(e){t+=e.toString()})),e.on("end",(function(){var r=e.statusCode;if(r<300)n(null,t);else{var i=1e3*parseInt(e.headers["retry-after"],10)||0,s=o.error(new Error,{retryable:r>=500||429===r});i&&s.retryable&&(s.retryAfter=i),c(s)}}))}),c)};i.util.defer(u)},uuid:{v4:function(){return e("uuid").v4()}},convertPayloadToString:function(e){var t=e.request,n=t.operation,r=t.service.api.operations[n].output||{};r.payload&&e.data[r.payload]&&(e.data[r.payload]=e.data[r.payload].toString())},defer:function(e){"object"==s(n)&&"function"==typeof n.nextTick?n.nextTick(e):"function"==typeof r?r(e):setTimeout(e,0)},getRequestPayloadShape:function(e){var t=e.service.api.operations;if(t){var n=(t||{})[e.operation];if(n&&n.input&&n.input.payload)return n.input.members[n.input.payload]}},getProfilesFromSharedConfig:function(e,t){var r={},i={};if(n.env[o.configOptInEnv])i=e.loadFrom({isConfig:!0,filename:n.env[o.sharedConfigFileEnv]});for(var s=e.loadFrom({filename:t||n.env[o.configOptInEnv]&&n.env[o.sharedCredentialsFileEnv]}),a=0,c=Object.keys(i);a<c.length;a++)r[c[a]]=i[c[a]];for(a=0,c=Object.keys(s);a<c.length;a++)r[c[a]]=s[c[a]];return r},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};t.exports=o}).call(this,e("_process"),e("timers").setImmediate)},{"../apis/metadata.json":5,"./core":19,_process:86,fs:80,timers:94,uuid:99}],73:[function(e,t,n){function r(){}function i(e,t){for(var n=e.getElementsByTagName(t),r=0,i=n.length;r<i;r++)if(n[r].parentNode===e)return n[r]}function o(e,t){switch(t||(t={}),t.type){case"structure":return s(e,t);case"map":return function(e,t){for(var n={},r=t.key.name||"key",s=t.value.name||"value",a=t.flattened?t.name:"entry",c=e.firstElementChild;c;){if(c.nodeName===a){var u=i(c,r).textContent,l=i(c,s);n[u]=o(l,t.value)}c=c.nextElementSibling}return n}(e,t);case"list":return function(e,t){for(var n=[],r=t.flattened?t.name:t.member.name||"member",i=e.firstElementChild;i;)i.nodeName===r&&n.push(o(i,t.member)),i=i.nextElementSibling;return n}(e,t);case void 0:case null:return function(e){if(null==e)return"";if(!e.firstElementChild)return null===e.parentNode.parentNode?{}:0===e.childNodes.length?"":e.textContent;for(var t={type:"structure",members:{}},n=e.firstElementChild;n;){var r=n.nodeName;Object.prototype.hasOwnProperty.call(t.members,r)?t.members[r].type="list":t.members[r]={name:r},n=n.nextElementSibling}return s(e,t)}(e);default:return function(e,t){if(e.getAttribute){var n=e.getAttribute("encoding");"base64"===n&&(t=new c.create({type:n}))}var r=e.textContent;return""===r&&(r=null),"function"==typeof t.toType?t.toType(r):r}(e,t)}}function s(e,t){var n={};return null===e?n:(a.each(t.members,(function(t,r){if(r.isXmlAttribute){if(Object.prototype.hasOwnProperty.call(e.attributes,r.name)){var s=e.attributes[r.name].value;n[t]=o({textContent:s},r)}}else{var a=r.flattened?e:i(e,r.name);a?n[t]=o(a,r):r.flattened||"list"!==r.type||(n[t]=r.defaultValue)}})),n)}var a=e("../util"),c=e("../model/shape");r.prototype.parse=function(e,t){if(""===e.replace(/^\s+/,""))return{};var n,r;try{if(window.DOMParser){try{n=(new DOMParser).parseFromString(e,"text/xml")}catch(e){throw a.error(new Error("Parse error in document"),{originalError:e,code:"XMLParserError",retryable:!0})}if(null===n.documentElement)throw a.error(new Error("Cannot parse empty document."),{code:"XMLParserError",retryable:!0});var s=n.getElementsByTagName("parsererror")[0];if(s&&(s.parentNode===n||"body"===s.parentNode.nodeName||s.parentNode.parentNode===n||"body"===s.parentNode.parentNode.nodeName)){var c=s.getElementsByTagName("div")[0]||s;throw a.error(new Error(c.textContent||"Parser error in document"),{code:"XMLParserError",retryable:!0})}}else{if(!window.ActiveXObject)throw new Error("Cannot load XML parser");if((n=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,!n.loadXML(e))throw a.error(new Error("Parse error in document"),{code:"XMLParserError",retryable:!0})}}catch(e){r=e}if(n&&n.documentElement&&!r){var u=o(n.documentElement,t),l=i(n.documentElement,"ResponseMetadata");return l&&(u.ResponseMetadata=o(l,{})),u}if(r)throw a.error(r||new Error,{code:"XMLParserError",retryable:!0});return{}},t.exports=r},{"../model/shape":44,"../util":72}],74:[function(e,t,n){function r(){}function i(e,t,n){switch(n.type){case"structure":return function(e,t,n){s.arrayEach(n.memberNames,(function(r){var s=n.members[r];if("body"===s.location){var c=t[r],u=s.name;if(null!=c)if(s.isXmlAttribute)e.addAttribute(u,c);else if(s.flattened)i(e,c,s);else{var l=new a(u);e.addChildNode(l),o(l,s),i(l,c,s)}}}))}(e,t,n);case"map":return function(e,t,n){var r=n.key.name||"key",o=n.value.name||"value";s.each(t,(function(t,s){var c=new a(n.flattened?n.name:"entry");e.addChildNode(c);var u=new a(r),l=new a(o);c.addChildNode(u),c.addChildNode(l),i(u,t,n.key),i(l,s,n.value)}))}(e,t,n);case"list":return function(e,t,n){n.flattened?s.arrayEach(t,(function(t){var r=n.member.name||n.name,o=new a(r);e.addChildNode(o),i(o,t,n.member)})):s.arrayEach(t,(function(t){var r=n.member.name||"member",o=new a(r);e.addChildNode(o),i(o,t,n.member)}))}(e,t,n);default:return function(e,t,n){e.addChildNode(new c(n.toWireFormat(t)))}(e,t,n)}}function o(e,t,n){var r,i="xmlns";t.xmlNamespaceUri?(r=t.xmlNamespaceUri,t.xmlNamespacePrefix&&(i+=":"+t.xmlNamespacePrefix)):n&&t.api.xmlNamespaceUri&&(r=t.api.xmlNamespaceUri),r&&e.addAttribute(i,r)}var s=e("../util"),a=e("./xml-node").XmlNode,c=e("./xml-text").XmlText;r.prototype.toXML=function(e,t,n,r){var s=new a(n);return o(s,t,!0),i(s,e,t),s.children.length>0||r?s.toString():""},t.exports=r},{"../util":72,"./xml-node":77,"./xml-text":78}],75:[function(e,t,n){t.exports={escapeAttribute:function(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],76:[function(e,t,n){t.exports={escapeElement:function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}},{}],77:[function(e,t,n){function r(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}var i=e("./escape-attribute").escapeAttribute;r.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},r.prototype.addChildNode=function(e){return this.children.push(e),this},r.prototype.removeAttribute=function(e){return delete this.attributes[e],this},r.prototype.toString=function(){for(var e=Boolean(this.children.length),t="<"+this.name,n=this.attributes,r=0,o=Object.keys(n);r<o.length;r++){var s=o[r],a=n[s];null!=a&&(t+=" "+s+'="'+i(""+a)+'"')}return t+(e?">"+this.children.map((function(e){return e.toString()})).join("")+"</"+this.name+">":"/>")},t.exports={XmlNode:r}},{"./escape-attribute":75}],78:[function(e,t,n){function r(e){this.value=e}var i=e("./escape-element").escapeElement;r.prototype.toString=function(){return i(""+this.value)},t.exports={XmlText:r}},{"./escape-element":76}],79:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function i(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function o(e,t,n){for(var r,o=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(i(r));return o.join("")}n.byteLength=function(e){var t=r(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){var t,n,i=r(e),o=i[0],s=i[1],u=new c(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,p=s>0?o-4:o;for(n=0;n<p;n+=4)t=a[e.charCodeAt(n)]<<18|a[e.charCodeAt(n+1)]<<12|a[e.charCodeAt(n+2)]<<6|a[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=a[e.charCodeAt(n)]<<2|a[e.charCodeAt(n+1)]>>4,u[l++]=255&t),1===s&&(t=a[e.charCodeAt(n)]<<10|a[e.charCodeAt(n+1)]<<4|a[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],a=0,c=n-r;a<c;a+=16383)i.push(o(e,a,a+16383>c?c:a+16383));return 1===r?(t=e[n-1],i.push(s[t>>2]+s[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"=")),i.join("")};for(var s=[],a=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=u.length;l<p;++l)s[l]=u[l],a[u.charCodeAt(l)]=l;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],80:[function(e,t,n){},{}],81:[function(e,t,n){(function(t,r){"use strict";function i(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(i()<t)throw new RangeError("Invalid typed array length");return r.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=r.prototype:(null===e&&(e=new r(t)),e.length=t),e}function r(e,t,n){if(!(r.TYPED_ARRAY_SUPPORT||this instanceof r))return new r(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return c(this,e)}return s(this,e,t,n)}function s(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,n,r):"string"==typeof t?u(e,t,n):h(e,t)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function c(e,t){if(a(t),e=o(e,t<0?0:0|f(t)),!r.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function u(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|d(t,n),s=(e=o(e,i)).write(t,n);return s!==i&&(e=e.slice(0,s)),e}function l(e,t){var n=t.length<0?0:0|f(t.length);e=o(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i),r.TYPED_ARRAY_SUPPORT?(e=t).__proto__=r.prototype:e=l(e,t),e}function h(e,t){if(r.isBuffer(t)){var n=0|f(t.length);return 0===(e=o(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?o(e,0):l(e,t);if("Buffer"===t.type&&W(t.data))return l(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function f(e){if(e>=i())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|e}function d(e,t){if(r.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(i)return U(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return x(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,o);if("number"==typeof t)return t&=255,r.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var s,a=1,c=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,c/=2,u/=2,n/=2}if(i){var l=-1;for(s=n;s<c;s++)if(o(e,s)===o(t,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*a}else-1!==l&&(s-=s-l),l=-1}else for(n+u>c&&(n=c-u),s=n;s>=0;s--){for(var p=!0,h=0;h<u;h++)if(o(e,s+h)!==o(t,h)){p=!1;break}if(p)return s}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function w(e,t,n,r){return F(U(t,e.length-n),e,n,r)}function S(e,t,n,r){return F(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return S(e,t,n,r)}function C(e,t,n,r){return F(B(t),e,n,r)}function _(e,t,n,r){return F(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?H.fromByteArray(e):H.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,s,a,c,u=e[i],l=null,p=u>239?4:u>223?3:u>191?2:1;if(i+p<=n)switch(p){case 1:u<128&&(l=u);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&u)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&u)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,p=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=p}return function(e){var t=e.length;if(t<=V)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=V));return n}(r)}function x(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function R(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function A(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=M(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,i,o,s){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function q(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||q(e,0,n,4),z.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,i){return i||q(e,0,n,8),z.write(e,t,n,r,52,8),n+8}function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return H.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function F(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}var H=e("base64-js"),z=e("ieee754"),W=e("isarray");n.Buffer=r,n.SlowBuffer=function(e){return+e!=e&&(e=0),r.alloc(+e)},n.INSPECT_MAX_BYTES=50,r.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),n.kMaxLength=i(),r.poolSize=8192,r._augment=function(e){return e.__proto__=r.prototype,e},r.from=function(e,t,n){return s(null,e,t,n)},r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0})),r.alloc=function(e,t,n){return function(e,t,n,r){return a(t),t<=0?o(e,t):void 0!==n?"string"==typeof r?o(e,t).fill(n,r):o(e,t).fill(n):o(e,t)}(null,e,t,n)},r.allocUnsafe=function(e){return c(null,e)},r.allocUnsafeSlow=function(e){return c(null,e)},r.isBuffer=function(e){return!(null==e||!e._isBuffer)},r.compare=function(e,t){if(!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==t[o]){n=e[o],i=t[o];break}return n<i?-1:i<n?1:0},r.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(e,t){if(!W(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return r.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=r.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!r.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,o),o+=s.length}return i},r.byteLength=d,r.prototype._isBuffer=!0,r.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},r.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},r.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},r.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):m.apply(this,arguments)},r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},r.prototype.compare=function(e,t,n,i,o){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),c=Math.min(s,a),u=this.slice(i,o),l=e.slice(t,n),p=0;p<c;++p)if(u[p]!==l[p]){s=u[p],a=l[p];break}return s<a?-1:a<s?1:0},r.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},r.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},r.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},r.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var V=4096;r.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),r.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=r.prototype;else{var o=t-e;n=new r(o,void 0);for(var s=0;s<o;++s)n[s]=this[s+e]}return n},r.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},r.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},r.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},r.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),z.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),z.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),z.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),z.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},r.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},r.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},r.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),r.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},r.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var o,s=i-n;if(this===e&&n<t&&t<i)for(o=s-1;o>=0;--o)e[o+t]=this[o+n];else if(s<1e3||!r.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},r.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=r.isBuffer(e)?e:U(new r(e,i).toString()),c=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%c]}return this};var G=/[^+\/0-9A-Za-z-_]/g}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"base64-js":79,buffer:81,ieee754:83,isarray:84}],82:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"object"==s(e)&&null!==e}function a(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(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,s,c,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(a(n=this._events[e]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),r=(u=n.slice()).length,c=0;c<r;c++)u[c].apply(this,s);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned&&(n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(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()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,s,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(n=this._events[e]).length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(a=s;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;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(i(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],83:[function(e,t,n){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,l=-7,p=n?i-1:0,h=n?-1:1,f=e[t+p];for(p+=h,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+p],p+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+e[t+p],p+=h,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=u}return(f?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,p=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,d=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+p>=1?h/c:h*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(t*c-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+f]=255&s,f+=d,s/=256,u-=8);e[n+f-d]|=128*m}},{}],84:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],85:[function(e,t,n){!function(e){"use strict";function t(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e,i){if(e===i)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(i))return!1;if(!0===t(e)){if(e.length!==i.length)return!1;for(var o=0;o<e.length;o++)if(!1===r(e[o],i[o]))return!1;return!0}if(!0===n(e)){var s={};for(var a in e)if(hasOwnProperty.call(e,a)){if(!1===r(e[a],i[a]))return!1;s[a]=!0}for(var c in i)if(hasOwnProperty.call(i,c)&&!0!==s[c])return!1;return!0}return!1}function i(e){if(""===e||!1===e||null===e)return!0;if(t(e)&&0===e.length)return!0;if(n(e)){for(var r in e)if(e.hasOwnProperty(r))return!1;return!0}return!1}function o(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||"_"===e}function s(e){return e>="0"&&e<="9"||"-"===e}function a(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||"_"===e}function c(){}function u(){}function l(e){this.runtime=e}function p(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[f]}]},avg:{_func:this._functionAvg,_signature:[{types:[b]}]},ceil:{_func:this._functionCeil,_signature:[{types:[f]}]},contains:{_func:this._functionContains,_signature:[{types:[m,g]},{types:[d]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[m]},{types:[m]}]},floor:{_func:this._functionFloor,_signature:[{types:[f]}]},length:{_func:this._functionLength,_signature:[{types:[m,g,y]}]},map:{_func:this._functionMap,_signature:[{types:[v]},{types:[g]}]},max:{_func:this._functionMax,_signature:[{types:[b,w]}]},merge:{_func:this._functionMerge,_signature:[{types:[y],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[g]},{types:[v]}]},sum:{_func:this._functionSum,_signature:[{types:[b]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[m]},{types:[m]}]},min:{_func:this._functionMin,_signature:[{types:[b,w]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[g]},{types:[v]}]},type:{_func:this._functionType,_signature:[{types:[d]}]},keys:{_func:this._functionKeys,_signature:[{types:[y]}]},values:{_func:this._functionValues,_signature:[{types:[y]}]},sort:{_func:this._functionSort,_signature:[{types:[w,b]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[g]},{types:[v]}]},join:{_func:this._functionJoin,_signature:[{types:[m]},{types:[w]}]},reverse:{_func:this._functionReverse,_signature:[{types:[m,g]}]},to_array:{_func:this._functionToArray,_signature:[{types:[d]}]},to_string:{_func:this._functionToString,_signature:[{types:[d]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[d]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[d],variadic:!0}]}}}var h;h="function"==typeof String.prototype.trimLeft?function(e){return e.trimLeft()}:function(e){return e.match(/^\s*(.*)/)[1]};var f=0,d=1,m=2,g=3,y=4,v=6,b=8,w=9,S={".":"Dot","*":"Star",",":"Comma",":":"Colon","{":"Lbrace","}":"Rbrace","]":"Rbracket","(":"Lparen",")":"Rparen","@":"Current"},E={"<":!0,">":!0,"=":!0,"!":!0},C={" ":!0,"\t":!0,"\n":!0};c.prototype={tokenize:function(e){var t,n,r,i=[];for(this._current=0;this._current<e.length;)if(o(e[this._current]))t=this._current,n=this._consumeUnquotedIdentifier(e),i.push({type:"UnquotedIdentifier",value:n,start:t});else if(void 0!==S[e[this._current]])i.push({type:S[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(s(e[this._current]))r=this._consumeNumber(e),i.push(r);else if("["===e[this._current])r=this._consumeLBracket(e),i.push(r);else if('"'===e[this._current])t=this._current,n=this._consumeQuotedIdentifier(e),i.push({type:"QuotedIdentifier",value:n,start:t});else if("'"===e[this._current])t=this._current,n=this._consumeRawStringLiteral(e),i.push({type:"Literal",value:n,start:t});else if("`"===e[this._current]){t=this._current;var a=this._consumeLiteral(e);i.push({type:"Literal",value:a,start:t})}else if(void 0!==E[e[this._current]])i.push(this._consumeOperator(e));else if(void 0!==C[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,i.push({type:"And",value:"&&",start:t})):i.push({type:"Expref",value:"&",start:t});else{if("|"!==e[this._current]){var c=new Error("Unknown character:"+e[this._current]);throw c.name="LexerError",c}t=this._current,this._current++,"|"===e[this._current]?(this._current++,i.push({type:"Or",value:"||",start:t})):i.push({type:"Pipe",value:"|",start:t})}return i},_consumeUnquotedIdentifier:function(e){var t=this._current;for(this._current++;this._current<e.length&&a(e[this._current]);)this._current++;return e.slice(t,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var n=e.length;'"'!==e[this._current]&&this._current<n;){var r=this._current;"\\"!==e[r]||"\\"!==e[r+1]&&'"'!==e[r+1]?r++:r+=2,this._current=r}return this._current++,JSON.parse(e.slice(t,this._current))},_consumeRawStringLiteral:function(e){var t=this._current;this._current++;for(var n=e.length;"'"!==e[this._current]&&this._current<n;){var r=this._current;"\\"!==e[r]||"\\"!==e[r+1]&&"'"!==e[r+1]?r++:r+=2,this._current=r}return this._current++,e.slice(t+1,this._current-1).replace("\\'","'")},_consumeNumber:function(e){var t=this._current;this._current++;for(var n=e.length;s(e[this._current])&&this._current<n;)this._current++;return{type:"Number",value:parseInt(e.slice(t,this._current)),start:t}},_consumeLBracket:function(e){var t=this._current;return this._current++,"?"===e[this._current]?(this._current++,{type:"Filter",value:"[?",start:t}):"]"===e[this._current]?(this._current++,{type:"Flatten",value:"[]",start:t}):{type:"Lbracket",value:"[",start:t}},_consumeOperator:function(e){var t=this._current,n=e[t];return this._current++,"!"===n?"="===e[this._current]?(this._current++,{type:"NE",value:"!=",start:t}):{type:"Not",value:"!",start:t}:"<"===n?"="===e[this._current]?(this._current++,{type:"LTE",value:"<=",start:t}):{type:"LT",value:"<",start:t}:">"===n?"="===e[this._current]?(this._current++,{type:"GTE",value:">=",start:t}):{type:"GT",value:">",start:t}:"="===n&&"="===e[this._current]?(this._current++,{type:"EQ",value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var t,n=this._current,r=e.length;"`"!==e[this._current]&&this._current<r;){var i=this._current;"\\"!==e[i]||"\\"!==e[i+1]&&"`"!==e[i+1]?i++:i+=2,this._current=i}var o=h(e.slice(n,this._current));return o=o.replace("\\`","`"),t=this._looksLikeJSON(o)?JSON.parse(o):JSON.parse('"'+o+'"'),this._current++,t},_looksLikeJSON:function(e){if(""===e)return!1;if('[{"'.indexOf(e[0])>=0)return!0;if(["true","false","null"].indexOf(e)>=0)return!0;if(!("-0123456789".indexOf(e[0])>=0))return!1;try{return JSON.parse(e),!0}catch(e){return!1}}};var _={EOF:0,UnquotedIdentifier:0,QuotedIdentifier:0,Rbracket:0,Rparen:0,Comma:0,Rbrace:0,Number:0,Current:0,Expref:0,Pipe:1,Or:2,And:3,EQ:5,GT:5,LT:5,GTE:5,LTE:5,NE:5,Flatten:9,Star:20,Filter:21,Dot:40,Not:45,Lbrace:50,Lbracket:55,Lparen:60};u.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if("EOF"!==this._lookahead(0)){var n=this._lookaheadToken(0),r=new Error("Unexpected token type: "+n.type+", value: "+n.value);throw r.name="ParserError",r}return t},_loadTokens:function(e){var t=(new c).tokenize(e);t.push({type:"EOF",value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var n=this.nud(t),r=this._lookahead(0);e<_[r];)this._advance(),n=this.led(r,n),r=this._lookahead(0);return n},_lookahead:function(e){return this.tokens[this.index+e].type},_lookaheadToken:function(e){return this.tokens[this.index+e]},_advance:function(){this.index++},nud:function(e){var t,n;switch(e.type){case"Literal":return{type:"Literal",value:e.value};case"UnquotedIdentifier":return{type:"Field",name:e.value};case"QuotedIdentifier":var r={type:"Field",name:e.value};if("Lparen"===this._lookahead(0))throw new Error("Quoted identifier not allowed for function names.");return r;case"Not":return{type:"NotExpression",children:[t=this.expression(_.Not)]};case"Star":return t=null,{type:"ValueProjection",children:[{type:"Identity"},t="Rbracket"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(_.Star)]};case"Filter":return this.led(e.type,{type:"Identity"});case"Lbrace":return this._parseMultiselectHash();case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[{type:"Identity"}]},t=this._parseProjectionRHS(_.Flatten)]};case"Lbracket":return"Number"===this._lookahead(0)||"Colon"===this._lookahead(0)?(t=this._parseIndexExpression(),this._projectIfSlice({type:"Identity"},t)):"Star"===this._lookahead(0)&&"Rbracket"===this._lookahead(1)?(this._advance(),this._advance(),{type:"Projection",children:[{type:"Identity"},t=this._parseProjectionRHS(_.Star)]}):this._parseMultiselectList();case"Current":return{type:"Current"};case"Expref":return{type:"ExpressionReference",children:[n=this.expression(_.Expref)]};case"Lparen":for(var i=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(n={type:"Current"},this._advance()):n=this.expression(0),i.push(n);return this._match("Rparen"),i[0];default:this._errorToken(e)}},led:function(e,t){var n;switch(e){case"Dot":var r=_.Dot;return"Star"!==this._lookahead(0)?{type:"Subexpression",children:[t,n=this._parseDotRHS(r)]}:(this._advance(),{type:"ValueProjection",children:[t,n=this._parseProjectionRHS(r)]});case"Pipe":return{type:"Pipe",children:[t,n=this.expression(_.Pipe)]};case"Or":return{type:"OrExpression",children:[t,n=this.expression(_.Or)]};case"And":return{type:"AndExpression",children:[t,n=this.expression(_.And)]};case"Lparen":for(var i,o=t.name,s=[];"Rparen"!==this._lookahead(0);)"Current"===this._lookahead(0)?(i={type:"Current"},this._advance()):i=this.expression(0),"Comma"===this._lookahead(0)&&this._match("Comma"),s.push(i);return this._match("Rparen"),{type:"Function",name:o,children:s};case"Filter":var a=this.expression(0);return this._match("Rbracket"),{type:"FilterProjection",children:[t,n="Flatten"===this._lookahead(0)?{type:"Identity"}:this._parseProjectionRHS(_.Filter),a]};case"Flatten":return{type:"Projection",children:[{type:"Flatten",children:[t]},this._parseProjectionRHS(_.Flatten)]};case"EQ":case"NE":case"GT":case"GTE":case"LT":case"LTE":return this._parseComparator(t,e);case"Lbracket":var c=this._lookaheadToken(0);return"Number"===c.type||"Colon"===c.type?(n=this._parseIndexExpression(),this._projectIfSlice(t,n)):(this._match("Star"),this._match("Rbracket"),{type:"Projection",children:[t,n=this._parseProjectionRHS(_.Star)]});default:this._errorToken(this._lookaheadToken(0))}},_match:function(e){if(this._lookahead(0)!==e){var t=this._lookaheadToken(0),n=new Error("Expected "+e+", got: "+t.type);throw n.name="ParserError",n}this._advance()},_errorToken:function(e){var t=new Error("Invalid token ("+e.type+'): "'+e.value+'"');throw t.name="ParserError",t},_parseIndexExpression:function(){if("Colon"===this._lookahead(0)||"Colon"===this._lookahead(1))return this._parseSliceExpression();var e={type:"Index",value:this._lookaheadToken(0).value};return this._advance(),this._match("Rbracket"),e},_projectIfSlice:function(e,t){var n={type:"IndexExpression",children:[e,t]};return"Slice"===t.type?{type:"Projection",children:[n,this._parseProjectionRHS(_.Star)]}:n},_parseSliceExpression:function(){for(var e=[null,null,null],t=0,n=this._lookahead(0);"Rbracket"!==n&&t<3;){if("Colon"===n)t++,this._advance();else{if("Number"!==n){var r=this._lookahead(0),i=new Error("Syntax error, unexpected token: "+r.value+"("+r.type+")");throw i.name="Parsererror",i}e[t]=this._lookaheadToken(0).value,this._advance()}n=this._lookahead(0)}return this._match("Rbracket"),{type:"Slice",children:e}},_parseComparator:function(e,t){return{type:"Comparator",name:t,children:[e,this.expression(_[t])]}},_parseDotRHS:function(e){var t=this._lookahead(0);return["UnquotedIdentifier","QuotedIdentifier","Star"].indexOf(t)>=0?this.expression(e):"Lbracket"===t?(this._match("Lbracket"),this._parseMultiselectList()):"Lbrace"===t?(this._match("Lbrace"),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(_[this._lookahead(0)]<10)t={type:"Identity"};else if("Lbracket"===this._lookahead(0))t=this.expression(e);else if("Filter"===this._lookahead(0))t=this.expression(e);else{if("Dot"!==this._lookahead(0)){var n=this._lookaheadToken(0),r=new Error("Sytanx error, unexpected token: "+n.value+"("+n.type+")");throw r.name="ParserError",r}this._match("Dot"),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];"Rbracket"!==this._lookahead(0);){var t=this.expression(0);if(e.push(t),"Comma"===this._lookahead(0)&&(this._match("Comma"),"Rbracket"===this._lookahead(0)))throw new Error("Unexpected token Rbracket")}return this._match("Rbracket"),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,n,r=[],i=["UnquotedIdentifier","QuotedIdentifier"];;){if(e=this._lookaheadToken(0),i.indexOf(e.type)<0)throw new Error("Expecting an identifier token, got: "+e.type);if(t=e.value,this._advance(),this._match("Colon"),n={type:"KeyValuePair",name:t,value:this.expression(0)},r.push(n),"Comma"===this._lookahead(0))this._match("Comma");else if("Rbrace"===this._lookahead(0)){this._match("Rbrace");break}}return{type:"MultiSelectHash",children:r}}},l.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,o){var s,a,c,u,l,p,h,f,d;switch(e.type){case"Field":return null===o?null:n(o)?void 0===(p=o[e.name])?null:p:null;case"Subexpression":for(c=this.visit(e.children[0],o),d=1;d<e.children.length;d++)if(null===(c=this.visit(e.children[1],c)))return null;return c;case"IndexExpression":return h=this.visit(e.children[0],o),this.visit(e.children[1],h);case"Index":if(!t(o))return null;var m=e.value;return m<0&&(m=o.length+m),void 0===(c=o[m])&&(c=null),c;case"Slice":if(!t(o))return null;var g=e.children.slice(0),y=this.computeSliceParams(o.length,g),v=y[0],b=y[1],w=y[2];if(c=[],w>0)for(d=v;d<b;d+=w)c.push(o[d]);else for(d=v;d>b;d+=w)c.push(o[d]);return c;case"Projection":var S=this.visit(e.children[0],o);if(!t(S))return null;for(f=[],d=0;d<S.length;d++)null!==(a=this.visit(e.children[1],S[d]))&&f.push(a);return f;case"ValueProjection":if(!n(S=this.visit(e.children[0],o)))return null;f=[];var E=function(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push(e[t[r]]);return n}(S);for(d=0;d<E.length;d++)null!==(a=this.visit(e.children[1],E[d]))&&f.push(a);return f;case"FilterProjection":if(!t(S=this.visit(e.children[0],o)))return null;var C=[],_=[];for(d=0;d<S.length;d++)i(s=this.visit(e.children[2],S[d]))||C.push(S[d]);for(var k=0;k<C.length;k++)null!==(a=this.visit(e.children[1],C[k]))&&_.push(a);return _;case"Comparator":switch(u=this.visit(e.children[0],o),l=this.visit(e.children[1],o),e.name){case"EQ":c=r(u,l);break;case"NE":c=!r(u,l);break;case"GT":c=u>l;break;case"GTE":c=u>=l;break;case"LT":c=u<l;break;case"LTE":c=u<=l;break;default:throw new Error("Unknown comparator: "+e.name)}return c;case"Flatten":var T=this.visit(e.children[0],o);if(!t(T))return null;var x=[];for(d=0;d<T.length;d++)t(a=T[d])?x.push.apply(x,a):x.push(a);return x;case"Identity":return o;case"MultiSelectList":if(null===o)return null;for(f=[],d=0;d<e.children.length;d++)f.push(this.visit(e.children[d],o));return f;case"MultiSelectHash":if(null===o)return null;var R;for(f={},d=0;d<e.children.length;d++)f[(R=e.children[d]).name]=this.visit(R.value,o);return f;case"OrExpression":return i(s=this.visit(e.children[0],o))&&(s=this.visit(e.children[1],o)),s;case"AndExpression":return!0===i(u=this.visit(e.children[0],o))?u:this.visit(e.children[1],o);case"NotExpression":return i(u=this.visit(e.children[0],o));case"Literal":return e.value;case"Pipe":return h=this.visit(e.children[0],o),this.visit(e.children[1],h);case"Current":return o;case"Function":var A=[];for(d=0;d<e.children.length;d++)A.push(this.visit(e.children[d],o));return this.runtime.callFunction(e.name,A);case"ExpressionReference":var I=e.children[0];return I.jmespathType="Expref",I;default:throw new Error("Unknown node type: "+e.type)}},computeSliceParams:function(e,t){var n=t[0],r=t[1],i=t[2],o=[null,null,null];if(null===i)i=1;else if(0===i){var s=new Error("Invalid slice, step cannot be 0");throw s.name="RuntimeError",s}var a=i<0;return n=null===n?a?e-1:0:this.capSliceRange(e,n,i),r=null===r?a?-1:e:this.capSliceRange(e,r,i),o[0]=n,o[1]=r,o[2]=i,o},capSliceRange:function(e,t,n){return t<0?(t+=e)<0&&(t=n<0?-1:0):t>=e&&(t=n<0?e-1:e),t}},p.prototype={callFunction:function(e,t){var n=this.functionTable[e];if(void 0===n)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,n._signature),n._func.call(this,t)},_validateArgs:function(e,t,n){var r;if(n[n.length-1].variadic){if(t.length<n.length)throw r=1===n.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes at least"+n.length+r+" but received "+t.length)}else if(t.length!==n.length)throw r=1===n.length?" argument":" arguments",new Error("ArgumentError: "+e+"() takes "+n.length+r+" but received "+t.length);for(var i,o,s,a=0;a<n.length;a++){s=!1,i=n[a].types,o=this._getTypeName(t[a]);for(var c=0;c<i.length;c++)if(this._typeMatches(o,i[c],t[a])){s=!0;break}if(!s)throw new Error("TypeError: "+e+"() expected argument "+(a+1)+" to be type "+i+" but received type "+o+" instead.")}},_typeMatches:function(e,t,n){if(t===d)return!0;if(t!==w&&t!==b&&t!==g)return e===t;if(t===g)return e===g;if(e===g){var r;t===b?r=f:t===w&&(r=m);for(var i=0;i<n.length;i++)if(!this._typeMatches(this._getTypeName(n[i]),r,n[i]))return!1;return!0}},_getTypeName:function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return m;case"[object Number]":return f;case"[object Array]":return g;case"[object Boolean]":return 5;case"[object Null]":return 7;case"[object Object]":return"Expref"===e.jmespathType?v:y}},_functionStartsWith:function(e){return 0===e[0].lastIndexOf(e[1])},_functionEndsWith:function(e){var t=e[0],n=e[1];return-1!==t.indexOf(n,t.length-n.length)},_functionReverse:function(e){if(this._getTypeName(e[0])===m){for(var t=e[0],n="",r=t.length-1;r>=0;r--)n+=t[r];return n}var i=e[0].slice(0);return i.reverse(),i},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,n=e[0],r=0;r<n.length;r++)t+=n[r];return t/n.length},_functionContains:function(e){return e[0].indexOf(e[1])>=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return n(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],n=this._interpreter,r=e[0],i=e[1],o=0;o<i.length;o++)t.push(n.visit(r,i[o]));return t},_functionMerge:function(e){for(var t={},n=0;n<e.length;n++){var r=e[n];for(var i in r)t[i]=r[i]}return t},_functionMax:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===f)return Math.max.apply(Math,e[0]);for(var t=e[0],n=t[0],r=1;r<t.length;r++)n.localeCompare(t[r])<0&&(n=t[r]);return n}return null},_functionMin:function(e){if(e[0].length>0){if(this._getTypeName(e[0][0])===f)return Math.min.apply(Math,e[0]);for(var t=e[0],n=t[0],r=1;r<t.length;r++)t[r].localeCompare(n)<0&&(n=t[r]);return n}return null},_functionSum:function(e){for(var t=0,n=e[0],r=0;r<n.length;r++)t+=n[r];return t},_functionType:function(e){switch(this._getTypeName(e[0])){case f:return"number";case m:return"string";case g:return"array";case y:return"object";case 5:return"boolean";case v:return"expref";case 7:return"null"}},_functionKeys:function(e){return Object.keys(e[0])},_functionValues:function(e){for(var t=e[0],n=Object.keys(t),r=[],i=0;i<n.length;i++)r.push(t[n[i]]);return r},_functionJoin:function(e){var t=e[0];return e[1].join(t)},_functionToArray:function(e){return this._getTypeName(e[0])===g?e[0]:[e[0]]},_functionToString:function(e){return this._getTypeName(e[0])===m?e[0]:JSON.stringify(e[0])},_functionToNumber:function(e){var t,n=this._getTypeName(e[0]);return n===f?e[0]:n!==m||(t=+e[0],isNaN(t))?null:t},_functionNotNull:function(e){for(var t=0;t<e.length;t++)if(7!==this._getTypeName(e[t]))return e[t];return null},_functionSort:function(e){var t=e[0].slice(0);return t.sort(),t},_functionSortBy:function(e){var t=e[0].slice(0);if(0===t.length)return t;var n=this._interpreter,r=e[1],i=this._getTypeName(n.visit(r,t[0]));if([f,m].indexOf(i)<0)throw new Error("TypeError");for(var o=this,s=[],a=0;a<t.length;a++)s.push([a,t[a]]);s.sort((function(e,t){var s=n.visit(r,e[1]),a=n.visit(r,t[1]);if(o._getTypeName(s)!==i)throw new Error("TypeError: expected "+i+", received "+o._getTypeName(s));if(o._getTypeName(a)!==i)throw new Error("TypeError: expected "+i+", received "+o._getTypeName(a));return s>a?1:s<a?-1:e[0]-t[0]}));for(var c=0;c<s.length;c++)t[c]=s[c][1];return t},_functionMaxBy:function(e){for(var t,n,r=e[1],i=e[0],o=this.createKeyFunction(r,[f,m]),s=-1/0,a=0;a<i.length;a++)(n=o(i[a]))>s&&(s=n,t=i[a]);return t},_functionMinBy:function(e){for(var t,n,r=e[1],i=e[0],o=this.createKeyFunction(r,[f,m]),s=1/0,a=0;a<i.length;a++)(n=o(i[a]))<s&&(s=n,t=i[a]);return t},createKeyFunction:function(e,t){var n=this,r=this._interpreter;return function(i){var o=r.visit(e,i);if(t.indexOf(n._getTypeName(o))<0){var s="TypeError: expected one of "+t+", received "+n._getTypeName(o);throw new Error(s)}return o}}},e.tokenize=function(e){return(new c).tokenize(e)},e.compile=function(e){return(new u).parse(e)},e.search=function(e,t){var n=new u,r=new p,i=new l(r);r._interpreter=i;var o=n.parse(t);return i.search(o,e)},e.strictDeepEqual=r}(void 0===n?this.jmespath={}:n)},{}],86:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(){m&&f&&(m=!1,f.length?d=f.concat(d):g=-1,d.length&&a())}function a(){if(!m){var e=o(s);m=!0;for(var t=d.length;t;){for(f=d,d=[];++g<t;)f&&f[g].run();g=-1,t=d.length}f=null,m=!1,function(e){if(p===clearTimeout)return clearTimeout(e);if((p===i||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,p,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{p="function"==typeof clearTimeout?clearTimeout:i}catch(e){p=i}}();var f,d=[],m=!1,g=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new c(e,t)),1!==d.length||m||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],87:[function(i,a,c){(function(r){!function(i){function u(e){throw RangeError(D[e])}function l(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function p(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+l((e=e.replace(q,".")).split("."),t).join(".")}function h(e){for(var t,n,r=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function f(e){return l(e,(function(e){var t="";return e>65535&&(t+=U((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+U(e)})).join("")}function d(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:k}function m(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function g(e,t,n){var r=0;for(e=n?M(e/A):e>>1,e+=M(e/t);e>j*x>>1;r+=k)e=M(e/j);return M(r+(j+1)*e/(e+R))}function y(e){var t,n,r,i,o,s,a,c,l,p,h=[],m=e.length,y=0,v=P,b=I;for((n=e.lastIndexOf(O))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&u("not-basic"),h.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<m;){for(o=y,s=1,a=k;i>=m&&u("invalid-input"),((c=d(e.charCodeAt(i++)))>=k||c>M((_-y)/s))&&u("overflow"),y+=c*s,!(c<(l=a<=b?T:a>=b+x?x:a-b));a+=k)s>M(_/(p=k-l))&&u("overflow"),s*=p;b=g(y-o,t=h.length+1,0==o),M(y/t)>_-v&&u("overflow"),v+=M(y/t),y%=t,h.splice(y++,0,v)}return f(h)}function v(e){var t,n,r,i,o,s,a,c,l,p,f,d,y,v,b,w=[];for(d=(e=h(e)).length,t=P,n=0,o=I,s=0;s<d;++s)(f=e[s])<128&&w.push(U(f));for(r=i=w.length,i&&w.push(O);r<d;){for(a=_,s=0;s<d;++s)(f=e[s])>=t&&f<a&&(a=f);for(a-t>M((_-n)/(y=r+1))&&u("overflow"),n+=(a-t)*y,t=a,s=0;s<d;++s)if((f=e[s])<t&&++n>_&&u("overflow"),f==t){for(c=n,l=k;!(c<(p=l<=o?T:l>=o+x?x:l-o));l+=k)b=c-p,v=k-p,w.push(U(m(p+b%v,0))),c=M(b/v);w.push(U(m(c,0))),o=g(n,y,r==i),n=0,++r}++n,++t}return w.join("")}var b="object"==s(c)&&c&&!c.nodeType&&c,w="object"==s(a)&&a&&!a.nodeType&&a,S="object"==s(r)&&r;S.global!==S&&S.window!==S&&S.self!==S||(i=S);var E,C,_=2147483647,k=36,T=1,x=26,R=38,A=700,I=72,P=128,O="-",L=/^xn--/,N=/[^\x20-\x7E]/,q=/[\x2E\u3002\uFF0E\uFF61]/g,D={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=k-T,M=Math.floor,U=String.fromCharCode;if(E={version:"1.3.2",ucs2:{decode:h,encode:f},decode:y,encode:v,toASCII:function(e){return p(e,(function(e){return N.test(e)?"xn--"+v(e):e}))},toUnicode:function(e){return p(e,(function(e){return L.test(e)?y(e.slice(4).toLowerCase()):e}))}},"object"==s(n(3))&&n(3))void 0===(o=function(){return E}.call(t,n,t,e))||(e.exports=o);else if(b&&w)if(a.exports==b)w.exports=E;else for(C in E)E.hasOwnProperty(C)&&(b[C]=E[C]);else i.punycode=E}(this)}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],88:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,o){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l<u;++l){var p,h,f,d,m=e[l].replace(a,"%20"),g=m.indexOf(n);g>=0?(p=m.substr(0,g),h=m.substr(g+1)):(p=m,h=""),f=decodeURIComponent(p),d=decodeURIComponent(h),r(s,f)?i(s[f])?s[f].push(d):s[f]=[s[f],d]:s[f]=d}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],89:[function(e,t,n){"use strict";function r(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r<e.length;r++)n.push(t(e[r],r));return n}var i=function(e){switch(s(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,c){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==s(e)?r(a(e),(function(s){var a=encodeURIComponent(i(s))+n;return o(e[s])?r(e[s],(function(e){return a+encodeURIComponent(i(e))})).join(t):a+encodeURIComponent(i(e[s]))})).join(t):c?encodeURIComponent(i(c))+n+encodeURIComponent(i(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}},{}],90:[function(e,t,n){"use strict";n.decode=n.parse=e("./decode"),n.encode=n.stringify=e("./encode")},{"./decode":88,"./encode":89}],91:[function(e,t,n){"use strict";function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,i){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=e.length;a>0&&c>a&&(c=a);for(var u=0;u<c;++u){var l,p,h,f,d=e[u].replace(s,"%20"),m=d.indexOf(n);m>=0?(l=d.substr(0,m),p=d.substr(m+1)):(l=d,p=""),h=decodeURIComponent(l),f=decodeURIComponent(p),r(o,h)?Array.isArray(o[h])?o[h].push(f):o[h]=[o[h],f]:o[h]=f}return o}},{}],92:[function(e,t,n){"use strict";var r=function(e){switch(s(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,i){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==s(e)?Object.keys(e).map((function(i){var o=encodeURIComponent(r(i))+n;return Array.isArray(e[i])?e[i].map((function(e){return o+encodeURIComponent(r(e))})).join(t):o+encodeURIComponent(r(e[i]))})).join(t):i?encodeURIComponent(r(i))+n+encodeURIComponent(r(e)):""}},{}],93:[function(e,t,n){arguments[4][90][0].apply(n,arguments)},{"./decode":91,"./encode":92,dup:90}],94:[function(e,t,n){(function(t,r){function i(e,t){this._id=e,this._clearFn=t}var o=e("process/browser.js").nextTick,s=Function.prototype.apply,a=Array.prototype.slice,c={},u=0;n.setTimeout=function(){return new i(s.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new i(s.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=u++,r=!(arguments.length<2)&&a.call(arguments,1);return c[t]=!0,o((function(){c[t]&&(r?e.apply(null,r):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof r?r:function(e){delete c[e]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":86,timers:94}],95:[function(e,t,n){function r(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(e,t,n){if(e&&a(e)&&e instanceof r)return e;var i=new r;return i.parse(e,t,n),i}function o(e){return"string"==typeof e}function a(e){return"object"==s(e)&&null!==e}function c(e){return null===e}var u=e("punycode");n.parse=i,n.resolve=function(e,t){return i(e,!1,!0).resolve(t)},n.resolveObject=function(e,t){return e?i(e,!1,!0).resolveObject(t):t},n.format=function(e){return o(e)&&(e=i(e)),e instanceof r?e.format():r.prototype.format.call(e)},n.Url=r;var l=/^([a-z0-9.+-]+:)/i,p=/:[0-9]*$/,h=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(h),d=["%","/","?",";","#"].concat(f),m=["/","?","#"],g=/^[a-z0-9A-Z_-]{0,63}$/,y=/^([a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},S=e("querystring");r.prototype.parse=function(e,t,n){if(!o(e))throw new TypeError("Parameter 'url' must be a string, not "+s(e));var r=e;r=r.trim();var i=l.exec(r);if(i){var a=(i=i[0]).toLowerCase();this.protocol=a,r=r.substr(i.length)}if(n||i||r.match(/^\/\/[^@\/]+@[^@\/]+/)){var c="//"===r.substr(0,2);!c||i&&b[i]||(r=r.substr(2),this.slashes=!0)}if(!b[i]&&(c||i&&!w[i])){for(var p=-1,h=0;h<m.length;h++){-1!==(_=r.indexOf(m[h]))&&(-1===p||_<p)&&(p=_)}var E,C;-1!==(C=-1===p?r.lastIndexOf("@"):r.lastIndexOf("@",p))&&(E=r.slice(0,C),r=r.slice(C+1),this.auth=decodeURIComponent(E)),p=-1;for(h=0;h<d.length;h++){var _;-1!==(_=r.indexOf(d[h]))&&(-1===p||_<p)&&(p=_)}-1===p&&(p=r.length),this.host=r.slice(0,p),r=r.slice(p),this.parseHost(),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var T=this.hostname.split(/\./),x=(h=0,T.length);h<x;h++){var R=T[h];if(R&&!R.match(g)){for(var A="",I=0,P=R.length;I<P;I++)R.charCodeAt(I)>127?A+="x":A+=R[I];if(!A.match(g)){var O=T.slice(0,h),L=T.slice(h+1),N=R.match(y);N&&(O.push(N[1]),L.unshift(N[2])),L.length&&(r="/"+L.join(".")+r),this.hostname=O.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!k){var q=this.hostname.split("."),D=[];for(h=0;h<q.length;++h){var j=q[h];D.push(j.match(/[^A-Za-z0-9_-]/)?"xn--"+u.encode(j):j)}this.hostname=D.join(".")}var M=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+M,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==r[0]&&(r="/"+r))}if(!v[a])for(h=0,x=f.length;h<x;h++){var B=f[h],F=encodeURIComponent(B);F===B&&(F=escape(B)),r=r.split(B).join(F)}var H=r.indexOf("#");-1!==H&&(this.hash=r.substr(H),r=r.slice(0,H));var z=r.indexOf("?");if(-1!==z?(this.search=r.substr(z),this.query=r.substr(z+1),t&&(this.query=S.parse(this.query)),r=r.slice(0,z)):t&&(this.search="",this.query={}),r&&(this.pathname=r),w[a]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"",j=this.search||"";this.path=M+j}return this.href=this.format(),this},r.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&a(this.query)&&Object.keys(this.query).length&&(o=S.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||w[t])&&!1!==i?(i="//"+(i||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):i||(i=""),r&&"#"!==r.charAt(0)&&(r="#"+r),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(n=n.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(s=s.replace("#","%23"))+r},r.prototype.resolve=function(e){return this.resolveObject(i(e,!1,!0)).format()},r.prototype.resolveObject=function(e){if(o(e)){var t=new r;t.parse(e,!1,!0),e=t}var n=new r;if(Object.keys(this).forEach((function(e){n[e]=this[e]}),this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach((function(t){"protocol"!==t&&(n[t]=e[t])})),w[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!w[e.protocol])return Object.keys(e).forEach((function(t){n[t]=e[t]})),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||b[e.protocol])n.pathname=e.pathname;else{for(var i=(e.pathname||"").split("/");i.length&&!(e.host=i.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==i[0]&&i.unshift(""),i.length<2&&i.unshift(""),n.pathname=i.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var s=n.pathname||"",a=n.search||"";n.path=s+a}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var u=n.pathname&&"/"===n.pathname.charAt(0),l=e.host||e.pathname&&"/"===e.pathname.charAt(0),p=l||u||n.host&&e.pathname,h=p,f=n.pathname&&n.pathname.split("/")||[],d=(i=e.pathname&&e.pathname.split("/")||[],n.protocol&&!w[n.protocol]);if(d&&(n.hostname="",n.port=null,n.host&&(""===f[0]?f[0]=n.host:f.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===i[0]?i[0]=e.host:i.unshift(e.host)),e.host=null),p=p&&(""===i[0]||""===f[0])),l)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,f=i;else if(i.length)f||(f=[]),f.pop(),f=f.concat(i),n.search=e.search,n.query=e.query;else if(!function(e){return null==e}(e.search)){if(d)n.hostname=n.host=f.shift(),(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift());return n.search=e.search,n.query=e.query,c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!f.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var m=f.slice(-1)[0],g=(n.host||e.host)&&("."===m||".."===m)||""===m,y=0,v=f.length;v>=0;v--)"."==(m=f[v])?f.splice(v,1):".."===m?(f.splice(v,1),y++):y&&(f.splice(v,1),y--);if(!p&&!h)for(;y--;y)f.unshift("..");!p||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),g&&"/"!==f.join("/").substr(-1)&&f.push("");var S,E=""===f[0]||f[0]&&"/"===f[0].charAt(0);d&&(n.hostname=n.host=E?"":f.length?f.shift():"",(S=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=S.shift(),n.host=n.hostname=S.shift()));return(p=p||n.host&&f.length)&&!E&&f.unshift(""),f.length?n.pathname=f.join("/"):(n.pathname=null,n.path=null),c(n.pathname)&&c(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},r.prototype.parseHost=function(){var e=this.host,t=p.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:87,querystring:90}],96:[function(e,t,n){"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 n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],97:[function(e,t,n){t.exports=function(e){return e&&"object"==s(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],98:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(t)?r.showHidden=t:t&&n._extend(r,t),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),c(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function c(e,t,r){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return g(i)||(i=c(e,i,r)),i}var o=u(e,t);if(o)return o;var s=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),S(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(E(t)){var f=t.name?": "+t.name:"";return e.stylize("[Function"+f+"]","special")}if(v(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return l(t)}var d,m="",y=!1,b=["{","}"];return h(t)&&(y=!0,b=["[","]"]),E(t)&&(m=" [Function"+(t.name?": "+t.name:"")+"]"),v(t)&&(m=" "+RegExp.prototype.toString.call(t)),w(t)&&(m=" "+Date.prototype.toUTCString.call(t)),S(t)&&(m=" "+l(t)),0!==s.length||y&&0!=t.length?r<0?v(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),d=y?function(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)T(t,String(s))?o.push(p(e,t,n,r,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(p(e,t,n,r,i,!0))})),o}(e,t,r,a,s):s.map((function(n){return p(e,t,r,a,n,y)})),e.seen.pop(),function(e,t,n){return e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(d,m,b)):b[0]+m+b[1]}function u(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):f(t)?e.stylize(""+t,"boolean"):d(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),T(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=d(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),y(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function h(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function d(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function v(e){return b(e)&&"[object RegExp]"===C(e)}function b(e){return"object"==s(e)&&null!==e}function w(e){return b(e)&&"[object Date]"===C(e)}function S(e){return b(e)&&("[object Error]"===C(e)||e instanceof Error)}function E(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}function k(){var e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var x=/%[sdj%]/g;n.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,s=String(e).replace(x,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),a=r[n];n<o;a=r[++n])d(a)||!b(a)?s+=" "+a:s+=" "+i(a);return s},n.deprecate=function(e,i){if(y(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),o=!0}return e.apply(this,arguments)}};var R,A={};n.debuglog=function(e){if(y(R)&&(R=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!A[e])if(new RegExp("\\b"+e+"\\b","i").test(R)){var r=t.pid;A[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else A[e]=function(){};return A[e]},n.inspect=i,i.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]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=f,n.isNull=d,n.isNullOrUndefined=function(e){return null==e},n.isNumber=m,n.isString=g,n.isSymbol=function(e){return"symbol"==s(e)},n.isUndefined=y,n.isRegExp=v,n.isObject=b,n.isDate=w,n.isError=S,n.isFunction=E,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==s(e)||void 0===e},n.isBuffer=e("./support/isBuffer");var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",k(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!b(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("_process"),void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":97,_process:86,inherits:96}],99:[function(e,t,n){var r=e("./v1"),i=e("./v4"),o=i;o.v1=r,o.v4=i,t.exports=o},{"./v1":102,"./v4":103}],100:[function(e,t,n){for(var r=[],i=0;i<256;++i)r[i]=(i+256).toString(16).substr(1);t.exports=function(e,t){var n=t||0,i=r;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},{}],101:[function(e,t,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var i=new Uint8Array(16);t.exports=function(){return r(i),i}}else{var o=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},{}],102:[function(e,t,n){var r,i,o=e("./lib/rng"),s=e("./lib/bytesToUuid"),a=0,c=0;t.exports=function(e,t,n){var u=t&&n||0,l=t||[],p=(e=e||{}).node||r,h=void 0!==e.clockseq?e.clockseq:i;if(null==p||null==h){var f=o();null==p&&(p=r=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==h&&(h=i=16383&(f[6]<<8|f[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:c+1,g=d-a+(m-c)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||d>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,c=m,i=h;var y=(1e4*(268435455&(d+=122192928e5))+m)%4294967296;l[u++]=y>>>24&255,l[u++]=y>>>16&255,l[u++]=y>>>8&255,l[u++]=255&y;var v=d/4294967296*1e4&268435455;l[u++]=v>>>8&255,l[u++]=255&v,l[u++]=v>>>24&15|16,l[u++]=v>>>16&255,l[u++]=h>>>8|128,l[u++]=255&h;for(var b=0;b<6;++b)l[u+b]=p[b];return t||s(l)}},{"./lib/bytesToUuid":100,"./lib/rng":101}],103:[function(e,t,n){var r=e("./lib/rng"),i=e("./lib/bytesToUuid");t.exports=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||r)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var a=0;a<16;++a)t[o+a]=s[a];return t||i(s)}},{"./lib/bytesToUuid":100,"./lib/rng":101}],104:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=e("./utils/LRU"),i=1e3,o=function(){function e(e){void 0===e&&(e=i),this.maxSize=e,this.cache=new r.LRUCache(e)}return Object.defineProperty(e.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),e.prototype.put=function(t,n){var r="string"!=typeof t?e.getKeyString(t):t,i=this.populateValue(n);this.cache.put(r,i)},e.prototype.get=function(t){var n="string"!=typeof t?e.getKeyString(t):t,r=Date.now(),i=this.cache.get(n);if(i)for(var o=0;o<i.length;o++){if(i[o].Expire<r)return void this.cache.remove(n)}return i},e.getKeyString=function(e){for(var t=[],n=Object.keys(e).sort(),r=0;r<n.length;r++){var i=n[r];void 0!==e[i]&&t.push(e[i])}return t.join(" ")},e.prototype.populateValue=function(e){var t=Date.now();return e.map((function(e){return{Address:e.Address||"",Expire:t+60*(e.CachePeriodInMinutes||1)*1e3}}))},e.prototype.empty=function(){this.cache.empty()},e.prototype.remove=function(t){var n="string"!=typeof t?e.getKeyString(t):t;this.cache.remove(n)},e}();n.EndpointCache=o},{"./utils/LRU":105}],105:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=function(e,t){this.key=e,this.value=t},i=function(){function e(e){if(this.nodeMap={},this.size=0,"number"!=typeof e||e<1)throw new Error("Cache size can only be positive number");this.sizeLimit=e}return Object.defineProperty(e.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),e.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},e.prototype.removeFromTail=function(){if(this.tailNode){var e=this.tailNode,t=e.prev;return t&&(t.next=void 0),e.prev=void 0,this.tailNode=t,this.size--,e}},e.prototype.detachFromList=function(e){this.headerNode===e&&(this.headerNode=e.next),this.tailNode===e&&(this.tailNode=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.next=void 0,e.prev=void 0,this.size--},e.prototype.get=function(e){if(this.nodeMap[e]){var t=this.nodeMap[e];return this.detachFromList(t),this.prependToList(t),t.value}},e.prototype.remove=function(e){if(this.nodeMap[e]){var t=this.nodeMap[e];this.detachFromList(t),delete this.nodeMap[e]}},e.prototype.put=function(e,t){if(this.nodeMap[e])this.remove(e);else if(this.size===this.sizeLimit){var n=this.removeFromTail().key;delete this.nodeMap[n]}var i=new r(e,t);this.nodeMap[e]=i,this.prependToList(i)},e.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),t=0;t<e.length;t++){var n=e[t],r=this.nodeMap[n];this.detachFromList(r),delete this.nodeMap[n]}},e}();n.LRUCache=i},{}],106:[function(e,t,n){e("./browser_loader");var r=e("./core");"undefined"!=typeof window&&(window.AWS=r),void 0!==t&&(t.exports=r),"undefined"!=typeof self&&(self.AWS=r),Object.prototype.hasOwnProperty.call(r,"ConnectParticipant")||(r.apiLoader.services.connectparticipant={},r.ConnectParticipant=r.Service.defineService("connectparticipant",["2018-09-07"])),r.apiLoader.services.connectparticipant["2018-09-07"]=e("../apis/connectparticipant-2018-09-07.min"),r.apiLoader.services.connectparticipant["2018-09-07"].paginators=e("../apis/connectparticipant-2018-09-07.paginators").pagination,Object.prototype.hasOwnProperty.call(r,"STS")||(r.apiLoader.services.sts={},r.STS=r.Service.defineService("sts",["2011-06-15"]),e("./services/sts")),r.apiLoader.services.sts=e("../apis/sts-2011-06-15.min")},{"../apis/connectparticipant-2018-09-07.min":3,"../apis/connectparticipant-2018-09-07.paginators":4,"../apis/sts-2011-06-15.min":6,"./browser_loader":17,"./core":19,"./services/sts":62}]},{},[106])}).call(this,n(0))}]);
//# sourceMappingURL=amazon-connect-chat.js.map