/*! For license information please see kvs.js.LICENSE.txt */ !function webpackUniversalModuleDefinition(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return(()=>{var e={9348:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.MASTER="MASTER",e.VIEWER="VIEWER"}(t.Role||(t.Role={}))},1055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(655),i=n.__importDefault(r(3460)),o=r(2434),s=function(){function SigV4RequestSigner(e,t,r){void 0===r&&(r=SigV4RequestSigner.DEFAULT_SERVICE),this.region=e,this.credentials=t,this.service=r}return SigV4RequestSigner.prototype.getSignedURL=function(e,t,r){return void 0===r&&(r=new Date),n.__awaiter(this,void 0,void 0,(function(){var i,s,a,u,c,l,p,f,h,d,m,y,v,b,S,E,w,A,C,_,R,I,x;return n.__generator(this,(function(n){switch(n.label){case 0:return"function"!=typeof this.credentials.getPromise?[3,2]:[4,this.credentials.getPromise()];case 1:n.sent(),n.label=2;case 2:if(o.validateValueNonNil(this.credentials.accessKeyId,"credentials.accessKeyId"),o.validateValueNonNil(this.credentials.secretAccessKey,"credentials.secretAccessKey"),i=SigV4RequestSigner.getDateTimeString(r),s=SigV4RequestSigner.getDateString(r),u=(a="wss")+"://",!e.startsWith(u))throw new Error("Endpoint '"+e+"' is not a secure WebSocket endpoint. It should start with '"+u+"'.");if(e.includes("?"))throw new Error("Endpoint '"+e+"' should not contain any query parameters.");return(c=e.indexOf("/",u.length))<0?(l=e.substring(u.length),p="/"):(l=e.substring(u.length,c),p=e.substring(c)),f=["host"].join(";"),h="GET",d=s+"/"+this.region+"/"+this.service+"/aws4_request",m=Object.assign({},t,{"X-Amz-Algorithm":SigV4RequestSigner.DEFAULT_ALGORITHM,"X-Amz-Credential":this.credentials.accessKeyId+"/"+d,"X-Amz-Date":i,"X-Amz-Expires":"299","X-Amz-SignedHeaders":f}),this.credentials.sessionToken&&Object.assign(m,{"X-Amz-Security-Token":this.credentials.sessionToken}),y=SigV4RequestSigner.createQueryString(m),v={host:l},b=SigV4RequestSigner.createHeadersString(v),[4,SigV4RequestSigner.sha256("")];case 3:return S=n.sent(),E=[h,p,y,b,f,S].join("\n"),[4,SigV4RequestSigner.sha256(E)];case 4:return w=n.sent(),A=[SigV4RequestSigner.DEFAULT_ALGORITHM,i,d,w].join("\n"),[4,this.getSignatureKey(s)];case 5:return C=n.sent(),I=(R=SigV4RequestSigner).toHex,[4,SigV4RequestSigner.hmac(C,A)];case 6:return[4,I.apply(R,[n.sent()])];case 7:return _=n.sent(),x=Object.assign({},m,{"X-Amz-Signature":_}),[2,a+"://"+l+p+"?"+SigV4RequestSigner.createQueryString(x)]}}))}))},SigV4RequestSigner.prototype.getSignatureKey=function(e){return n.__awaiter(this,void 0,void 0,(function(){var t,r,i;return n.__generator(this,(function(n){switch(n.label){case 0:return[4,SigV4RequestSigner.hmac("AWS4"+this.credentials.secretAccessKey,e)];case 1:return t=n.sent(),[4,SigV4RequestSigner.hmac(t,this.region)];case 2:return r=n.sent(),[4,SigV4RequestSigner.hmac(r,this.service)];case 3:return i=n.sent(),[4,SigV4RequestSigner.hmac(i,"aws4_request")];case 4:return[2,n.sent()]}}))}))},SigV4RequestSigner.createHeadersString=function(e){return Object.keys(e).map((function(t){return t+":"+e[t]+"\n"})).join()},SigV4RequestSigner.createQueryString=function(e){return Object.keys(e).sort().map((function(t){return t+"="+encodeURIComponent(e[t])})).join("&")},SigV4RequestSigner.getDateTimeString=function(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z").replace(/[:\-]/g,"")},SigV4RequestSigner.getDateString=function(e){return this.getDateTimeString(e).substring(0,8)},SigV4RequestSigner.sha256=function(e){return n.__awaiter(this,void 0,void 0,(function(){var t;return n.__generator(this,(function(r){switch(r.label){case 0:return[4,i.default.subtle.digest({name:"SHA-256"},this.toUint8Array(e))];case 1:return t=r.sent(),[2,this.toHex(t)]}}))}))},SigV4RequestSigner.hmac=function(e,t){return n.__awaiter(this,void 0,void 0,(function(){var r,o,s;return n.__generator(this,(function(n){switch(n.label){case 0:return r="string"==typeof e?this.toUint8Array(e).buffer:e,o=this.toUint8Array(t).buffer,[4,i.default.subtle.importKey("raw",r,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"])];case 1:return s=n.sent(),[4,i.default.subtle.sign({name:"HMAC",hash:{name:"SHA-256"}},s,o)];case 2:return[2,n.sent()]}}))}))},SigV4RequestSigner.toUint8Array=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0,i=e.length;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i,o=r(655),s=r(7187),a=r(9348),u=r(1055),c=o.__importDefault(r(971)),l=r(2434);!function(e){e.SDP_ANSWER="SDP_ANSWER",e.SDP_OFFER="SDP_OFFER",e.ICE_CANDIDATE="ICE_CANDIDATE"}(n||(n={})),function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(i||(i={}));var p=function(e){function SignalingClient(t){var r=e.call(this)||this;return r.websocket=null,r.readyState=i.CLOSED,r.pendingIceCandidatesByClientId={},r.hasReceivedRemoteSDPByClientId={},l.validateValueNonNil(t,"SignalingClientConfig"),l.validateValueNonNil(t.role,"role"),t.role===a.Role.VIEWER?l.validateValueNonNil(t.clientId,"clientId"):l.validateValueNil(t.clientId,"clientId"),l.validateValueNonNil(t.channelARN,"channelARN"),l.validateValueNonNil(t.region,"region"),l.validateValueNonNil(t.channelEndpoint,"channelEndpoint"),r.config=o.__assign({},t),t.requestSigner?r.requestSigner=t.requestSigner:(l.validateValueNonNil(t.credentials,"credentials"),r.requestSigner=new u.SigV4RequestSigner(t.region,t.credentials)),r.dateProvider=new c.default(t.systemClockOffset||0),r.onOpen=r.onOpen.bind(r),r.onMessage=r.onMessage.bind(r),r.onError=r.onError.bind(r),r.onClose=r.onClose.bind(r),r}return o.__extends(SignalingClient,e),SignalingClient.prototype.open=function(){var e=this;if(this.readyState!==i.CLOSED)throw new Error("Client is already open, opening, or closing");this.readyState=i.CONNECTING,this.asyncOpen().then().catch((function(t){return e.onError(t)}))},SignalingClient.prototype.asyncOpen=function(){return o.__awaiter(this,void 0,void 0,(function(){var e,t;return o.__generator(this,(function(r){switch(r.label){case 0:return e={"X-Amz-ChannelARN":this.config.channelARN},this.config.role===a.Role.VIEWER&&(e["X-Amz-ClientId"]=this.config.clientId),[4,this.requestSigner.getSignedURL(this.config.channelEndpoint,e,this.dateProvider.getDate())];case 1:return t=r.sent(),this.readyState!==i.CONNECTING?[2]:(this.websocket=new WebSocket(t),this.websocket.addEventListener("open",this.onOpen),this.websocket.addEventListener("message",this.onMessage),this.websocket.addEventListener("error",this.onError),this.websocket.addEventListener("close",this.onClose),[2])}}))}))},SignalingClient.prototype.close=function(){null!==this.websocket?(this.readyState=i.CLOSING,this.websocket.close()):this.readyState!==i.CLOSED&&this.onClose()},SignalingClient.prototype.sendSdpOffer=function(e,t){this.sendMessage(n.SDP_OFFER,e.toJSON(),t)},SignalingClient.prototype.sendSdpAnswer=function(e,t){this.sendMessage(n.SDP_ANSWER,e.toJSON(),t)},SignalingClient.prototype.sendIceCandidate=function(e,t){this.sendMessage(n.ICE_CANDIDATE,e.toJSON(),t)},SignalingClient.prototype.sendMessage=function(e,t,r){if(this.readyState!==i.OPEN)throw new Error("Could not send message because the connection to the signaling service is not open.");this.validateRecipientClientId(r),this.websocket.send(JSON.stringify({action:e,messagePayload:SignalingClient.serializeJSONObjectAsBase64String(t),recipientClientId:r||void 0}))},SignalingClient.prototype.cleanupWebSocket=function(){null!==this.websocket&&(this.websocket.removeEventListener("open",this.onOpen),this.websocket.removeEventListener("message",this.onMessage),this.websocket.removeEventListener("error",this.onError),this.websocket.removeEventListener("close",this.onClose),this.websocket=null)},SignalingClient.prototype.onOpen=function(){this.readyState=i.OPEN,this.emit("open")},SignalingClient.prototype.onMessage=function(e){var t,r;try{t=JSON.parse(e.data),r=SignalingClient.parseJSONObjectFromBase64String(t.messagePayload)}catch(e){return}var i=t.messageType,o=t.senderClientId;switch(i){case n.SDP_OFFER:return this.emit("sdpOffer",r,o),void this.emitPendingIceCandidates(o);case n.SDP_ANSWER:return this.emit("sdpAnswer",r,o),void this.emitPendingIceCandidates(o);case n.ICE_CANDIDATE:return void this.emitOrQueueIceCandidate(r,o)}},SignalingClient.parseJSONObjectFromBase64String=function(e){return JSON.parse(atob(e))},SignalingClient.serializeJSONObjectAsBase64String=function(e){return btoa(JSON.stringify(e))},SignalingClient.prototype.emitOrQueueIceCandidate=function(e,t){var r=t||SignalingClient.DEFAULT_CLIENT_ID;this.hasReceivedRemoteSDPByClientId[r]?this.emit("iceCandidate",e,t):(this.pendingIceCandidatesByClientId[r]||(this.pendingIceCandidatesByClientId[r]=[]),this.pendingIceCandidatesByClientId[r].push(e))},SignalingClient.prototype.emitPendingIceCandidates=function(e){var t=this,r=e||SignalingClient.DEFAULT_CLIENT_ID;this.hasReceivedRemoteSDPByClientId[r]=!0;var n=this.pendingIceCandidatesByClientId[r];n&&(delete this.pendingIceCandidatesByClientId[r],n.forEach((function(r){t.emit("iceCandidate",r,e)})))},SignalingClient.prototype.validateRecipientClientId=function(e){if(this.config.role===a.Role.MASTER&&!e)throw new Error("Missing recipient client id. As the MASTER, all messages must be sent with a recipient client id.");if(this.config.role===a.Role.VIEWER&&e)throw new Error("Unexpected recipient client id. As the VIEWER, messages must not be sent with a recipient client id.")},SignalingClient.prototype.onError=function(e){this.emit("error",e)},SignalingClient.prototype.onClose=function(){this.readyState=i.CLOSED,this.cleanupWebSocket(),this.emit("close")},SignalingClient.DEFAULT_CLIENT_ID="MASTER",SignalingClient}(s.EventEmitter);t.SignalingClient=p},8099:(e,t,r)=>{"use strict";var n=r(4155);var i=r(9348);t.uU=i.Role;var o=r(7466);t._r=o.SignalingClient,r(1055).SigV4RequestSigner,n.env.PACKAGE_VERSION},971:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function DateProvider(e){this.clockOffsetMs=e}return DateProvider.prototype.getDate=function(){return new Date(Date.now()+this.clockOffsetMs)},DateProvider}();t.default=r},2434:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateValueNonNil=function validateValueNonNil(e,t){if(null===e)throw new Error(t+" cannot be null");if(void 0===e)throw new Error(t+" cannot be undefined");if(""===e)throw new Error(t+" cannot be empty")},t.validateValueNil=function validateValueNil(e,t){if(null!=e&&""!==e)throw new Error(t+" should be null")}},6105:(e,t,r)=>{r(7321);var n=r(9614),i=n.Service,o=n.apiLoader;o.services.cognitoidentity={},n.CognitoIdentity=i.defineService("cognitoidentity",["2014-06-30"]),Object.defineProperty(o.services.cognitoidentity,"2014-06-30",{get:function get(){var e=r(7377);return e.paginators=r(5010).o,e},enumerable:!0,configurable:!0}),e.exports=n.CognitoIdentity},9670:(e,t,r)=>{r(7321);var n=r(9614),i=n.Service,o=n.apiLoader;o.services.kinesisvideo={},n.KinesisVideo=i.defineService("kinesisvideo",["2017-09-30"]),Object.defineProperty(o.services.kinesisvideo,"2017-09-30",{get:function get(){var e=r(6305);return e.paginators=r(61).o,e},enumerable:!0,configurable:!0}),e.exports=n.KinesisVideo},618:(e,t,r)=>{r(7321);var n=r(9614),i=n.Service,o=n.apiLoader;o.services.kinesisvideosignalingchannels={},n.KinesisVideoSignalingChannels=i.defineService("kinesisvideosignalingchannels",["2019-12-04"]),Object.defineProperty(o.services.kinesisvideosignalingchannels,"2019-12-04",{get:function get(){var e=r(9769);return e.paginators=r(1939).o,e},enumerable:!0,configurable:!0}),e.exports=n.KinesisVideoSignalingChannels},3568:(e,t,r)=>{r(7321);var n=r(9614),i=n.Service,o=n.apiLoader;o.services.sts={},n.STS=i.defineService("sts",["2011-06-15"]),r(4456),Object.defineProperty(o.services.sts,"2011-06-15",{get:function get(){var e=r(753);return e.paginators=r(3639).o,e},enumerable:!0,configurable:!0}),e.exports=n.STS},6862:e=>{function apiLoader(e,t){if(!apiLoader.services.hasOwnProperty(e))throw new Error("InvalidService: Failed to load api for "+e);return apiLoader.services[e][t]}apiLoader.services={},e.exports=apiLoader},7821:(e,t,r)=>{var n=r(9790),i=r(5610),o=r(4314),s=r(1365);e.exports={createHash:function createHash(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 createHmac(e,t){if("md5"===(e=e.toLowerCase()))return new n(i,t);if("sha256"===e)return new n(s,t);if("sha1"===e)return new n(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")}}},6323:(e,t,r)=>{var n=r(8764).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]"];e.exports={isEmptyData:function isEmptyData(e){return"string"==typeof e?0===e.length:0===e.byteLength},convertToBuffer:function convertToBuffer(e){return"string"==typeof e&&(e=new n(e,"utf8")),ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}}},9790:(e,t,r)=>{var n=r(6323);function Hmac(e,t){this.hash=new e,this.outer=new e;var r=function bufferFromSecret(e,t){var r=n.convertToBuffer(t);if(r.byteLength>e.BLOCK_SIZE){var i=new e;i.update(r),r=i.digest()}var o=new Uint8Array(e.BLOCK_SIZE);return o.set(r),o}(e,t),i=new Uint8Array(e.BLOCK_SIZE);i.set(r);for(var o=0;o{var n=r(6323),i=r(8764).Buffer,o=64;function Md5(){this.state=[1732584193,4023233417,2562383102,271733878],this.buffer=new DataView(new ArrayBuffer(o)),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}function cmn(e,t,r,n,i,o){return((t=(t+e&4294967295)+(n+o&4294967295)&4294967295)<>>32-i)+r&4294967295}function ff(e,t,r,n,i,o,s){return cmn(t&r|~t&n,e,t,i,o,s)}function gg(e,t,r,n,i,o,s){return cmn(t&n|r&~n,e,t,i,o,s)}function hh(e,t,r,n,i,o,s){return cmn(t^r^n,e,t,i,o,s)}function ii(e,t,r,n,i,o,s){return cmn(r^(t|~n),e,t,i,o,s)}e.exports=Md5,Md5.BLOCK_SIZE=o,Md5.prototype.update=function(e){if(n.isEmptyData(e))return this;if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=n.convertToBuffer(e),r=0,i=t.byteLength;for(this.bytesHashed+=i;i>0;)this.buffer.setUint8(this.bufferLength++,t[r++]),i--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},Md5.prototype.digest=function(e){if(!this.finished){var t=this,r=t.buffer,n=t.bufferLength,s=8*t.bytesHashed;if(r.setUint8(this.bufferLength++,128),n%o>=56){for(var a=this.bufferLength;a>>0,!0),r.setUint32(60,Math.floor(s/4294967296),!0),this.hashBuffer(),this.finished=!0}var u=new DataView(new ArrayBuffer(16));for(a=0;a<4;a++)u.setUint32(4*a,this.state[a],!0);var c=new i(u.buffer,u.byteOffset,u.byteLength);return e?c.toString(e):c},Md5.prototype.hashBuffer=function(){var e=this.buffer,t=this.state,r=t[0],n=t[1],i=t[2],o=t[3];r=ff(r,n,i,o,e.getUint32(0,!0),7,3614090360),o=ff(o,r,n,i,e.getUint32(4,!0),12,3905402710),i=ff(i,o,r,n,e.getUint32(8,!0),17,606105819),n=ff(n,i,o,r,e.getUint32(12,!0),22,3250441966),r=ff(r,n,i,o,e.getUint32(16,!0),7,4118548399),o=ff(o,r,n,i,e.getUint32(20,!0),12,1200080426),i=ff(i,o,r,n,e.getUint32(24,!0),17,2821735955),n=ff(n,i,o,r,e.getUint32(28,!0),22,4249261313),r=ff(r,n,i,o,e.getUint32(32,!0),7,1770035416),o=ff(o,r,n,i,e.getUint32(36,!0),12,2336552879),i=ff(i,o,r,n,e.getUint32(40,!0),17,4294925233),n=ff(n,i,o,r,e.getUint32(44,!0),22,2304563134),r=ff(r,n,i,o,e.getUint32(48,!0),7,1804603682),o=ff(o,r,n,i,e.getUint32(52,!0),12,4254626195),i=ff(i,o,r,n,e.getUint32(56,!0),17,2792965006),r=gg(r,n=ff(n,i,o,r,e.getUint32(60,!0),22,1236535329),i,o,e.getUint32(4,!0),5,4129170786),o=gg(o,r,n,i,e.getUint32(24,!0),9,3225465664),i=gg(i,o,r,n,e.getUint32(44,!0),14,643717713),n=gg(n,i,o,r,e.getUint32(0,!0),20,3921069994),r=gg(r,n,i,o,e.getUint32(20,!0),5,3593408605),o=gg(o,r,n,i,e.getUint32(40,!0),9,38016083),i=gg(i,o,r,n,e.getUint32(60,!0),14,3634488961),n=gg(n,i,o,r,e.getUint32(16,!0),20,3889429448),r=gg(r,n,i,o,e.getUint32(36,!0),5,568446438),o=gg(o,r,n,i,e.getUint32(56,!0),9,3275163606),i=gg(i,o,r,n,e.getUint32(12,!0),14,4107603335),n=gg(n,i,o,r,e.getUint32(32,!0),20,1163531501),r=gg(r,n,i,o,e.getUint32(52,!0),5,2850285829),o=gg(o,r,n,i,e.getUint32(8,!0),9,4243563512),i=gg(i,o,r,n,e.getUint32(28,!0),14,1735328473),r=hh(r,n=gg(n,i,o,r,e.getUint32(48,!0),20,2368359562),i,o,e.getUint32(20,!0),4,4294588738),o=hh(o,r,n,i,e.getUint32(32,!0),11,2272392833),i=hh(i,o,r,n,e.getUint32(44,!0),16,1839030562),n=hh(n,i,o,r,e.getUint32(56,!0),23,4259657740),r=hh(r,n,i,o,e.getUint32(4,!0),4,2763975236),o=hh(o,r,n,i,e.getUint32(16,!0),11,1272893353),i=hh(i,o,r,n,e.getUint32(28,!0),16,4139469664),n=hh(n,i,o,r,e.getUint32(40,!0),23,3200236656),r=hh(r,n,i,o,e.getUint32(52,!0),4,681279174),o=hh(o,r,n,i,e.getUint32(0,!0),11,3936430074),i=hh(i,o,r,n,e.getUint32(12,!0),16,3572445317),n=hh(n,i,o,r,e.getUint32(24,!0),23,76029189),r=hh(r,n,i,o,e.getUint32(36,!0),4,3654602809),o=hh(o,r,n,i,e.getUint32(48,!0),11,3873151461),i=hh(i,o,r,n,e.getUint32(60,!0),16,530742520),r=ii(r,n=hh(n,i,o,r,e.getUint32(8,!0),23,3299628645),i,o,e.getUint32(0,!0),6,4096336452),o=ii(o,r,n,i,e.getUint32(28,!0),10,1126891415),i=ii(i,o,r,n,e.getUint32(56,!0),15,2878612391),n=ii(n,i,o,r,e.getUint32(20,!0),21,4237533241),r=ii(r,n,i,o,e.getUint32(48,!0),6,1700485571),o=ii(o,r,n,i,e.getUint32(12,!0),10,2399980690),i=ii(i,o,r,n,e.getUint32(40,!0),15,4293915773),n=ii(n,i,o,r,e.getUint32(4,!0),21,2240044497),r=ii(r,n,i,o,e.getUint32(32,!0),6,1873313359),o=ii(o,r,n,i,e.getUint32(60,!0),10,4264355552),i=ii(i,o,r,n,e.getUint32(24,!0),15,2734768916),n=ii(n,i,o,r,e.getUint32(52,!0),21,1309151649),r=ii(r,n,i,o,e.getUint32(16,!0),6,4149444226),o=ii(o,r,n,i,e.getUint32(44,!0),10,3174756917),i=ii(i,o,r,n,e.getUint32(8,!0),15,718787259),n=ii(n,i,o,r,e.getUint32(36,!0),21,3951481745),t[0]=r+t[0]&4294967295,t[1]=n+t[1]&4294967295,t[2]=i+t[2]&4294967295,t[3]=o+t[3]&4294967295}},4314:(e,t,r)=>{var n=r(8764).Buffer,i=r(6323);new Uint32Array([1518500249,1859775393,-1894007588,-899497514]),Math.pow(2,53);function Sha1(){this.h0=1732584193,this.h1=4023233417,this.h2=2562383102,this.h3=271733878,this.h4=3285377520,this.block=new Uint32Array(80),this.offset=0,this.shift=24,this.totalLength=0}e.exports=Sha1,Sha1.BLOCK_SIZE=64,Sha1.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=(e=i.convertToBuffer(e)).length;this.totalLength+=8*t;for(var r=0;r14||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 r=new n(20),i=new DataView(r.buffer);return i.setUint32(0,this.h0,!1),i.setUint32(4,this.h1,!1),i.setUint32(8,this.h2,!1),i.setUint32(12,this.h3,!1),i.setUint32(16,this.h4,!1),e?r.toString(e):r},Sha1.prototype.processBlock=function processBlock(){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 r,n,i=this.h0,o=this.h1,s=this.h2,a=this.h3,u=this.h4;for(e=0;e<80;e++){e<20?(r=a^o&(s^a),n=1518500249):e<40?(r=o^s^a,n=1859775393):e<60?(r=o&s|a&(o|s),n=2400959708):(r=o^s^a,n=3395469782);var c=(i<<5|i>>>27)+r+u+n+(0|this.block[e]);u=a,a=s,s=o<<30|o>>>2,o=i,i=c}for(this.h0=this.h0+i|0,this.h1=this.h1+o|0,this.h2=this.h2+s|0,this.h3=this.h3+a|0,this.h4=this.h4+u|0,this.offset=0,e=0;e<16;e++)this.block[e]=0}},1365:(e,t,r)=>{var n=r(8764).Buffer,i=r(6323),o=64,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;function Sha256(){this.state=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}e.exports=Sha256,Sha256.BLOCK_SIZE=o,Sha256.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");if(i.isEmptyData(e))return this;var t=0,r=(e=i.convertToBuffer(e)).byteLength;if(this.bytesHashed+=r,8*this.bytesHashed>a)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;r>0;)this.buffer[this.bufferLength++]=e[t++],r--,this.bufferLength===o&&(this.hashBuffer(),this.bufferLength=0);return this},Sha256.prototype.digest=function(e){if(!this.finished){var t=8*this.bytesHashed,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),i=this.bufferLength;if(r.setUint8(this.bufferLength++,128),i%o>=56){for(var s=this.bufferLength;s>>24&255,a[4*s+1]=this.state[s]>>>16&255,a[4*s+2]=this.state[s]>>>8&255,a[4*s+3]=this.state[s]>>>0&255;return e?a.toString(e):a},Sha256.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,r=t[0],n=t[1],i=t[2],a=t[3],u=t[4],c=t[5],l=t[6],p=t[7],f=0;f>>17|h<<15)^(h>>>19|h<<13)^h>>>10,m=((h=this.temp[f-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;this.temp[f]=(d+this.temp[f-7]|0)+(m+this.temp[f-16]|0)}var y=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&c^~u&l)|0)+(p+(s[f]+this.temp[f]|0)|0)|0,v=((r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10))+(r&n^r&i^n&i)|0;p=l,l=c,c=u,u=a+y|0,a=i,i=n,n=r,r=y+v|0}t[0]+=r,t[1]+=n,t[2]+=i,t[3]+=a,t[4]+=u,t[5]+=c,t[6]+=l,t[7]+=p}},7321:(e,t,r)=>{var n=r(2662);n.crypto.lib=r(7821),n.Buffer=r(8764).Buffer,n.url=r(8575),n.querystring=r(7673),n.realClock=r(1414),n.environment="js",n.createEventStream=r(2403).createEventStream,n.isBrowser=function(){return!0},n.isNode=function(){return!1};var i=r(9614);if(e.exports=i,r(4465),r(3227),r(6662),r(91),r(7719),r(7372),r(6986),i.XML.Parser=r(5106),r(2631),void 0===o)var o={browser:!0}},2709:(e,t,r)=>{var n,i=r(9614);r(4465),r(3227),i.Config=i.util.inherit({constructor:function Config(e){void 0===e&&(e={}),e=this.extractCredentials(e),i.util.each.call(this,this.keys,(function(t,r){this.set(t,e[t],r)}))},getCredentials:function getCredentials(e){var t=this;function finish(r){e(r,r?null:t.credentials)}function credError(e,t){return new i.util.error(t||new Error,{code:"CredentialsError",message:e,name:"CredentialsError"})}t.credentials?"function"==typeof t.credentials.get?function getAsyncCredentials(){t.credentials.get((function(e){e&&(e=credError("Could not load credentials from "+t.credentials.constructor.name,e)),finish(e)}))}():function getStaticCredentials(){var e=null;t.credentials.accessKeyId&&t.credentials.secretAccessKey||(e=credError("Missing credentials")),finish(e)}():t.credentialProvider?t.credentialProvider.resolve((function(e,r){e&&(e=credError("Could not load credentials from any providers",e)),t.credentials=r,finish(e)})):finish(credError("No credentials to load"))},update:function update(e,t){t=t||!1,e=this.extractCredentials(e),i.util.each.call(this,e,(function(e,r){(t||Object.prototype.hasOwnProperty.call(this.keys,e)||i.Service.hasService(e))&&this.set(e,r)}))},loadFromPath:function loadFromPath(e){this.clear();var t=JSON.parse(i.util.readFileSync(e)),r=new i.FileSystemCredentials(e),n=new i.CredentialProviderChain;return n.providers.unshift(r),n.resolve((function(e,r){if(e)throw e;t.credentials=r})),this.constructor(t),this},clear:function clear(){i.util.each.call(this,this.keys,(function(e){delete this[e]})),this.set("credentials",void 0),this.set("credentialProvider",void 0)},set:function set(e,t,r){void 0===t?(void 0===r&&(r=this.keys[e]),this[e]="function"==typeof r?r.call(this):r):"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,s3UsEast1RegionalEndpoint:"legacy",s3UseArnRegion:void 0,computeChecksums:!0,convertResponseTypes:!0,correctClockSkew:!1,customUserAgent:null,dynamoDbCrc32:!0,systemClockOffset:0,signatureVersion:null,signatureCache:!0,retryDelayOptions:{},useAccelerateEndpoint:!1,clientSideMonitoring:!1,endpointDiscoveryEnabled:void 0,endpointCacheSize:1e3,hostPrefixEnabled:!0,stsRegionalEndpoints:"legacy"},extractCredentials:function extractCredentials(e){return e.accessKeyId&&e.secretAccessKey&&((e=i.util.copy(e)).credentials=new i.Credentials(e)),e},setPromisesDependency:function setPromisesDependency(e){n=e,null===e&&"function"==typeof Promise&&(n=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,n)},getPromisesDependency:function getPromisesDependency(){return n}}),i.config=new i.Config},5456:(e,t,r)=>{var n=r(4155),i=r(9614);function validateRegionalEndpointsFlagValue(e,t){if("string"==typeof e){if(["legacy","regional"].indexOf(e.toLowerCase())>=0)return e.toLowerCase();throw i.util.error(new Error,t)}}e.exports=function resolveRegionalEndpointsFlag(e,t){var r;if((e=e||{})[t.clientConfig]&&(r=validateRegionalEndpointsFlagValue(e[t.clientConfig],{code:"InvalidConfiguration",message:'invalid "'+t.clientConfig+'" configuration. Expect "legacy" or "regional". Got "'+e[t.clientConfig]+'".'})))return r;if(!i.util.isNode())return r;if(Object.prototype.hasOwnProperty.call(n.env,t.env)&&(r=validateRegionalEndpointsFlagValue(n.env[t.env],{code:"InvalidEnvironmentalVariable",message:"invalid "+t.env+' environmental variable. Expect "legacy" or "regional". Got "'+n.env[t.env]+'".'})))return r;var o={};try{o=i.util.getProfilesFromSharedConfig(i.util.iniLoader)[n.env.AWS_PROFILE||i.util.defaultProfile]}catch(e){}return o&&Object.prototype.hasOwnProperty.call(o,t.sharedConfig)&&(r=validateRegionalEndpointsFlagValue(o[t.sharedConfig],{code:"InvalidConfiguration",message:"invalid "+t.sharedConfig+' profile config. Expect "legacy" or "regional". Got "'+o[t.sharedConfig]+'".'})),r}},9614:(e,t,r)=>{var n={util:r(2662)};({}).toString(),e.exports=n,n.util.update(n,{VERSION:"2.995.0",Signers:{},Protocol:{Json:r(6933),Query:r(293),Rest:r(6225),RestJson:r(3699),RestXml:r(1674)},XML:{Builder:r(2369),Parser:null},JSON:{Builder:r(3658),Parser:r(2622)},Model:{Api:r(5863),Operation:r(6797),Shape:r(8136),Paginator:r(7937),ResourceWaiter:r(306)},apiLoader:r(6862),EndpointCache:r(5101).$}),r(6380),r(173),r(2709),r(6344),r(2274),r(3682),r(3975),r(2413),r(2604),r(5479),n.events=new n.SequentialExecutor,n.util.memoizedProperty(n,"endpointCache",(function(){return new n.EndpointCache(n.config.endpointCacheSize)}),!0)},4465:(e,t,r)=>{var n=r(9614);n.Credentials=n.util.inherit({constructor:function Credentials(){if(n.util.hideProperties(this,["secretAccessKey"]),this.expired=!1,this.expireTime=null,this.refreshCallbacks=[],1===arguments.length&&"object"==typeof 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 needsRefresh(){var e=n.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 get(e){var t=this;this.needsRefresh()?this.refresh((function(r){r||(t.expired=!1),e&&e(r)})):e&&e()},refresh:function refresh(e){this.expired=!1,e()},coalesceRefresh:function coalesceRefresh(e,t){var r=this;1===r.refreshCallbacks.push(e)&&r.load((function onLoad(e){n.util.arrayEach(r.refreshCallbacks,(function(r){t?r(e):n.util.defer((function(){r(e)}))})),r.refreshCallbacks.length=0}))},load:function load(e){e()}}),n.Credentials.addPromisesToClass=function addPromisesToClass(e){this.prototype.getPromise=n.util.promisifyMethod("get",e),this.prototype.refreshPromise=n.util.promisifyMethod("refresh",e)},n.Credentials.deletePromisesFromClass=function deletePromisesFromClass(){delete this.prototype.getPromise,delete this.prototype.refreshPromise},n.util.addPromises(n.Credentials)},91:(e,t,r)=>{var n=r(9614),i=r(3568);n.ChainableTemporaryCredentials=n.util.inherit(n.Credentials,{constructor:function ChainableTemporaryCredentials(e){n.Credentials.call(this),e=e||{},this.errorCode="ChainableTemporaryCredentialsProviderFailure",this.expired=!0,this.tokenCodeFn=null;var t=n.util.copy(e.params)||{};if(t.RoleArn&&(t.RoleSessionName=t.RoleSessionName||"temporary-credentials"),t.SerialNumber){if(!e.tokenCodeFn||"function"!=typeof e.tokenCodeFn)throw new n.util.error(new Error("tokenCodeFn must be a function when params.SerialNumber is given"),{code:this.errorCode});this.tokenCodeFn=e.tokenCodeFn}var r=n.util.merge({params:t,credentials:e.masterCredentials||n.config.credentials},e.stsConfig||{});this.service=new i(r)},refresh:function refresh(e){this.coalesceRefresh(e||n.util.fn.callback)},load:function load(e){var t=this,r=t.service.config.params.RoleArn?"assumeRole":"getSessionToken";this.getTokenCode((function(n,i){var o={};n?e(n):(i&&(o.TokenCode=i),t.service[r](o,(function(r,n){r||t.service.credentialsFrom(n,t),e(r)})))}))},getTokenCode:function getTokenCode(e){var t=this;this.tokenCodeFn?this.tokenCodeFn(this.service.config.params.SerialNumber,(function(r,i){if(r){var o=r;return r instanceof Error&&(o=r.message),void e(n.util.error(new Error("Error fetching MFA token: "+o),{code:t.errorCode}))}e(null,i)})):e(null)}})},7372:(e,t,r)=>{var n=r(9614),i=r(6105),o=r(3568);n.CognitoIdentityCredentials=n.util.inherit(n.Credentials,{localStorageKey:{id:"aws.cognito.identity-id.",providers:"aws.cognito.identity-providers."},constructor:function CognitoIdentityCredentials(e,t){n.Credentials.call(this),this.expired=!0,this.params=e,this.data=null,this._identityId=null,this._clientConfig=n.util.copy(t||{}),this.loadCachedId();var r=this;Object.defineProperty(this,"identityId",{get:function(){return r.loadCachedId(),r._identityId||r.params.IdentityId},set:function(e){r._identityId=e}})},refresh:function refresh(e){this.coalesceRefresh(e||n.util.fn.callback)},load:function load(e){var t=this;t.createClients(),t.data=null,t._identityId=null,t.getId((function(r){r?(t.clearIdOnNotAuthorized(r),e(r)):t.params.RoleArn?t.getCredentialsFromSTS(e):t.getCredentialsForIdentity(e)}))},clearCachedId:function clearCache(){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 clearIdOnNotAuthorized(e){"NotAuthorizedException"==e.code&&this.clearCachedId()},getId:function getId(e){var t=this;if("string"==typeof t.params.IdentityId)return e(null,t.params.IdentityId);t.cognito.getId((function(r,n){!r&&n.IdentityId?(t.params.IdentityId=n.IdentityId,e(null,n.IdentityId)):e(r)}))},loadCredentials:function loadCredentials(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 getCredentialsForIdentity(e){var t=this;t.cognito.getCredentialsForIdentity((function(r,n){r?t.clearIdOnNotAuthorized(r):(t.cacheId(n),t.data=n,t.loadCredentials(t.data,t)),e(r)}))},getCredentialsFromSTS:function getCredentialsFromSTS(e){var t=this;t.cognito.getOpenIdToken((function(r,n){r?(t.clearIdOnNotAuthorized(r),e(r)):(t.cacheId(n),t.params.WebIdentityToken=n.Token,t.webIdentityCredentials.refresh((function(r){r||(t.data=t.webIdentityCredentials.data,t.sts.credentialsFrom(t.data,t)),e(r)})))}))},loadCachedId:function loadCachedId(){var e=this;if(n.util.isBrowser()&&!e.params.IdentityId){var t=e.getStorage("id");if(t&&e.params.Logins){var r=Object.keys(e.params.Logins);0!==(e.getStorage("providers")||"").split(",").filter((function(e){return-1!==r.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 n.WebIdentityCredentials(this.params,e),!this.cognito){var t=n.util.merge({},e);t.params=this.params,this.cognito=new i(t)}this.sts=this.sts||new o(e)},cacheId:function cacheId(e){this._identityId=e.IdentityId,this.params.IdentityId=this._identityId,n.util.isBrowser()&&(this.setStorage("id",e.IdentityId),this.params.Logins&&this.setStorage("providers",Object.keys(this.params.Logins).join(",")))},getStorage:function getStorage(e){return this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]},setStorage:function setStorage(e,t){try{this.storage[this.localStorageKey[e]+this.params.IdentityPoolId+(this.params.LoginId||"")]=t}catch(e){}},storage:function(){try{var e=n.util.isBrowser()&&null!==window.localStorage&&"object"==typeof window.localStorage?window.localStorage:{};return e["aws.test-storage"]="foobar",delete e["aws.test-storage"],e}catch(e){return{}}}()})},3227:(e,t,r)=>{var n=r(9614);n.CredentialProviderChain=n.util.inherit(n.Credentials,{constructor:function CredentialProviderChain(e){this.providers=e||n.CredentialProviderChain.defaultProviders.slice(0),this.resolveCallbacks=[]},resolve:function resolve(e){var t=this;if(0===t.providers.length)return e(new Error("No providers")),t;if(1===t.resolveCallbacks.push(e)){var r=0,i=t.providers.slice(0);!function resolveNext(e,o){if(!e&&o||r===i.length)return n.util.arrayEach(t.resolveCallbacks,(function(t){t(e,o)})),void(t.resolveCallbacks.length=0);var s=i[r++];(o="function"==typeof s?s.call():s).get?o.get((function(e){resolveNext(e,e?null:o)})):resolveNext(null,o)}()}return t}}),n.CredentialProviderChain.defaultProviders=[],n.CredentialProviderChain.addPromisesToClass=function addPromisesToClass(e){this.prototype.resolvePromise=n.util.promisifyMethod("resolve",e)},n.CredentialProviderChain.deletePromisesFromClass=function deletePromisesFromClass(){delete this.prototype.resolvePromise},n.util.addPromises(n.CredentialProviderChain)},6986:(e,t,r)=>{var n=r(9614),i=r(3568);n.SAMLCredentials=n.util.inherit(n.Credentials,{constructor:function SAMLCredentials(e){n.Credentials.call(this),this.expired=!0,this.params=e},refresh:function refresh(e){this.coalesceRefresh(e||n.util.fn.callback)},load:function load(e){var t=this;t.createClients(),t.service.assumeRoleWithSAML((function(r,n){r||t.service.credentialsFrom(n,t),e(r)}))},createClients:function(){this.service=this.service||new i({params:this.params})}})},6662:(e,t,r)=>{var n=r(9614),i=r(3568);n.TemporaryCredentials=n.util.inherit(n.Credentials,{constructor:function TemporaryCredentials(e,t){n.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 refresh(e){this.coalesceRefresh(e||n.util.fn.callback)},load:function load(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(r,n){r||t.service.credentialsFrom(n,t),e(r)}))}))},loadMasterCredentials:function loadMasterCredentials(e){for(this.masterCredentials=e||n.config.credentials;this.masterCredentials.masterCredentials;)this.masterCredentials=this.masterCredentials.masterCredentials;"function"!=typeof this.masterCredentials.get&&(this.masterCredentials=new n.Credentials(this.masterCredentials))},createClients:function(){this.service=this.service||new i({params:this.params})}})},7719:(e,t,r)=>{var n=r(9614),i=r(3568);n.WebIdentityCredentials=n.util.inherit(n.Credentials,{constructor:function WebIdentityCredentials(e,t){n.Credentials.call(this),this.expired=!0,this.params=e,this.params.RoleSessionName=this.params.RoleSessionName||"web-identity",this.data=null,this._clientConfig=n.util.copy(t||{})},refresh:function refresh(e){this.coalesceRefresh(e||n.util.fn.callback)},load:function load(e){var t=this;t.createClients(),t.service.assumeRoleWithWebIdentity((function(r,n){t.data=null,r||(t.data=n,t.service.credentialsFrom(n,t)),e(r)}))},createClients:function(){if(!this.service){var e=n.util.merge({},this._clientConfig);e.params=this.params,this.service=new i(e)}}})},3320:(e,t,r)=>{var n=r(4155),i=r(9614),o=r(2662),s=["AWS_ENABLE_ENDPOINT_DISCOVERY","AWS_ENDPOINT_DISCOVERY_ENABLED"];function getCacheKey(e){var t=e.service,r=t.api||{},n=(r.operations,{});return t.config.region&&(n.region=t.config.region),r.serviceId&&(n.serviceId=r.serviceId),t.config.credentials.accessKeyId&&(n.accessKeyId=t.config.credentials.accessKeyId),n}function marshallCustomIdentifiersHelper(e,t,r){r&&null!=t&&"structure"===r.type&&r.required&&r.required.length>0&&o.arrayEach(r.required,(function(n){var i=r.members[n];if(!0===i.endpointDiscoveryId){var o=i.isLocationName?i.name:n;e[o]=String(t[n])}else marshallCustomIdentifiersHelper(e,t[n],i)}))}function marshallCustomIdentifiers(e,t){var r={};return marshallCustomIdentifiersHelper(r,e.params,t),r}function optionalDiscoverEndpoint(e){var t=e.service,r=t.api,n=r.operations?r.operations[e.operation]:void 0,s=marshallCustomIdentifiers(e,n?n.input:void 0),a=getCacheKey(e);Object.keys(s).length>0&&(a=o.update(a,s),n&&(a.operation=n.name));var u=i.endpointCache.get(a);if(!u||1!==u.length||""!==u[0].Address)if(u&&u.length>0)e.httpRequest.updateEndpoint(u[0].Address);else{var c=t.makeRequest(r.endpointOperation,{Operation:n.name,Identifiers:s});addApiVersionHeader(c),c.removeListener("validate",i.EventListeners.Core.VALIDATE_PARAMETERS),c.removeListener("retry",i.EventListeners.Core.RETRY_CHECK),i.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}]),c.send((function(e,t){t&&t.Endpoints?i.endpointCache.put(a,t.Endpoints):e&&i.endpointCache.put(a,[{Address:"",CachePeriodInMinutes:1}])}))}}var a={};function requiredDiscoverEndpoint(e,t){var r=e.service,n=r.api,s=n.operations?n.operations[e.operation]:void 0,u=s?s.input:void 0,c=marshallCustomIdentifiers(e,u),l=getCacheKey(e);Object.keys(c).length>0&&(l=o.update(l,c),s&&(l.operation=s.name));var p=i.EndpointCache.getKeyString(l),f=i.endpointCache.get(p);if(f&&1===f.length&&""===f[0].Address)return a[p]||(a[p]=[]),void a[p].push({request:e,callback:t});if(f&&f.length>0)e.httpRequest.updateEndpoint(f[0].Address),t();else{var h=r.makeRequest(n.endpointOperation,{Operation:s.name,Identifiers:c});h.removeListener("validate",i.EventListeners.Core.VALIDATE_PARAMETERS),addApiVersionHeader(h),i.endpointCache.put(p,[{Address:"",CachePeriodInMinutes:60}]),h.send((function(r,n){if(r){if(e.response.error=o.error(r,{retryable:!1}),i.endpointCache.remove(l),a[p]){var s=a[p];o.arrayEach(s,(function(e){e.request.response.error=o.error(r,{retryable:!1}),e.callback()})),delete a[p]}}else if(n&&(i.endpointCache.put(p,n.Endpoints),e.httpRequest.updateEndpoint(n.Endpoints[0].Address),a[p])){s=a[p];o.arrayEach(s,(function(e){e.request.httpRequest.updateEndpoint(n.Endpoints[0].Address),e.callback()})),delete a[p]}t()}))}}function addApiVersionHeader(e){var t=e.service.api.apiVersion;t&&!e.httpRequest.headers["x-amz-api-version"]&&(e.httpRequest.headers["x-amz-api-version"]=t)}function invalidateCachedEndpoints(e){var t=e.error,r=e.httpResponse;if(t&&("InvalidEndpointException"===t.code||421===r.statusCode)){var n=e.request,s=n.service.api.operations||{},a=marshallCustomIdentifiers(n,s[n.operation]?s[n.operation].input:void 0),u=getCacheKey(n);Object.keys(a).length>0&&(u=o.update(u,a),s[n.operation]&&(u.operation=s[n.operation].name)),i.endpointCache.remove(u)}}function isFalsy(e){return["false","0"].indexOf(e)>=0}e.exports={discoverEndpoint:function discoverEndpoint(e,t){var r=e.service||{};if(function hasCustomEndpoint(e){if(e._originalConfig&&e._originalConfig.endpoint&&!0===e._originalConfig.endpointDiscoveryEnabled)throw o.error(new Error,{code:"ConfigurationException",message:"Custom endpoint is supplied; endpointDiscoveryEnabled must not be true."});var t=i.config[e.serviceIdentifier]||{};return Boolean(i.config.endpoint||t.endpoint||e._originalConfig&&e._originalConfig.endpoint)}(r)||e.isPresigned())return t();var a=(r.api.operations||{})[e.operation],u=a?a.endpointDiscoveryRequired:"NULL",c=function resolveEndpointDiscoveryConfig(e){var t=e.service||{};if(void 0!==t.config.endpointDiscoveryEnabled)return t.config.endpointDiscoveryEnabled;if(!o.isBrowser()){for(var r=0;r{var n=r(7550).eventMessageChunker,i=r(3851).parseEvent;e.exports={createEventStream:function createEventStream(e,t,r){for(var o=n(e),s=[],a=0;a{e.exports={eventMessageChunker:function eventMessageChunker(e){for(var t=[],r=0;r{var n=r(9614).util,i=n.buffer.toBuffer;function Int64(e){if(8!==e.length)throw new Error("Int64 buffers must be exactly 8 bytes");n.Buffer.isBuffer(e)||(e=i(e)),this.bytes=e}function negate(e){for(var t=0;t<8;t++)e[t]^=255;for(t=7;t>-1&&(e[t]++,0===e[t]);t--);}Int64.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),r=7,n=Math.abs(Math.round(e));r>-1&&n>0;r--,n/=256)t[r]=n;return e<0&&negate(t),new Int64(t)},Int64.prototype.valueOf=function(){var e=this.bytes.slice(0),t=128&e[0];return t&&negate(e),parseInt(e.toString("hex"),16)*(t?-1:1)},Int64.prototype.toString=function(){return String(this.valueOf())},e.exports={Int64}},3851:(e,t,r)=>{var n=r(9524).parseMessage;e.exports={parseEvent:function parseEvent(e,t,r){var i=n(t),o=i.headers[":message-type"];if(o){if("error"===o.value)throw function parseError(e){var t=e.headers[":error-code"],r=e.headers[":error-message"],n=new Error(r.value||r);return n.code=n.name=t.value||t,n}(i);if("event"!==o.value)return}var s=i.headers[":event-type"],a=r.members[s.value];if(a){var u={},c=a.eventPayloadMemberName;if(c){var l=a.members[c];"binary"===l.type?u[c]=i.body:u[c]=e.parse(i.body.toString(),l)}for(var p=a.eventHeaderMemberNames,f=0;f{var n=r(1231).Int64,i=r(4441).splitMessage,o="boolean";function parseHeaders(e){for(var t={},r=0;r{var n=r(9614).util,i=n.buffer.toBuffer;e.exports={splitMessage:function splitMessage(e){if(n.Buffer.isBuffer(e)||(e=i(e)),e.length<16)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(8);if(t!==n.crypto.crc32(e.slice(0,8)))throw new Error("The prelude checksum specified in the message ("+t+") does not match the calculated CRC32 checksum.");var r=e.readUInt32BE(e.length-4);if(r!==n.crypto.crc32(e.slice(0,e.length-4)))throw new Error("The message checksum did not match the expected value of "+r);var o=12+e.readUInt32BE(4);return{headers:e.slice(12,o),body:e.slice(o,e.length-4)}}}},2274:(e,t,r)=>{var n=r(9614),i=r(6380),o=r(3320).discoverEndpoint;n.EventListeners={Core:{}},n.EventListeners={Core:(new i).addNamedListeners((function(e,t){t("VALIDATE_CREDENTIALS","validate",(function VALIDATE_CREDENTIALS(e,t){if(!e.service.api.signatureVersion&&!e.service.config.signatureVersion)return t();e.service.config.getCredentials((function(r){r&&(e.response.error=n.util.error(r,{code:"CredentialsError",message:"Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1"})),t()}))})),e("VALIDATE_REGION","validate",(function VALIDATE_REGION(e){if(!e.service.isGlobalEndpoint){var t=new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);e.service.config.region?t.test(e.service.config.region)||(e.response.error=n.util.error(new Error,{code:"ConfigError",message:"Invalid region in config"})):e.response.error=n.util.error(new Error,{code:"ConfigError",message:"Missing region in config"})}})),e("BUILD_IDEMPOTENCY_TOKENS","validate",(function BUILD_IDEMPOTENCY_TOKENS(e){if(e.service.api.operations){var t=e.service.api.operations[e.operation];if(t){var r=t.idempotentMembers;if(r.length){for(var i=n.util.copy(e.params),o=0,s=r.length;o=0)return e.httpRequest.headers["X-Amz-Content-Sha256"]="UNSIGNED-PAYLOAD",t();n.util.computeSha256(o,(function(r,n){r?t(r):(e.httpRequest.headers["X-Amz-Content-Sha256"]=n,t())}))}else t()}})),e("SET_CONTENT_LENGTH","afterBuild",(function SET_CONTENT_LENGTH(e){var t=function getOperationAuthtype(e){if(!e.service.api.operations)return"";var t=e.service.api.operations[e.operation];return t?t.authtype:""}(e),r=n.util.getRequestPayloadShape(e);if(void 0===e.httpRequest.headers["Content-Length"])try{var i=n.util.string.byteLength(e.httpRequest.body);e.httpRequest.headers["Content-Length"]=i}catch(n){if(r&&r.isStreaming){if(r.requiresLength)throw n;if(t.indexOf("unsigned-body")>=0)return void(e.httpRequest.headers["Transfer-Encoding"]="chunked");throw n}throw n}})),e("SET_HTTP_HOST","afterBuild",(function SET_HTTP_HOST(e){e.httpRequest.headers.Host=e.httpRequest.endpoint.host})),e("RESTART","restart",(function RESTART(){var e=this.response.error;e&&e.retryable&&(this.httpRequest=new n.HttpRequest(this.service.endpoint,this.service.region),this.response.retryCount=600?this.emit("sign",[this],(function(e){e?t(e):executeSend()})):executeSend()})),e("HTTP_HEADERS","httpHeaders",(function HTTP_HEADERS(e,t,r,i){r.httpResponse.statusCode=e,r.httpResponse.statusMessage=i,r.httpResponse.headers=t,r.httpResponse.body=n.util.buffer.toBuffer(""),r.httpResponse.buffers=[],r.httpResponse.numBytes=0;var o=t.date||t.Date,s=r.request.service;if(o){var a=Date.parse(o);s.config.correctClockSkew&&s.isClockSkewed(a)&&s.applyClockOffset(a)}})),e("HTTP_DATA","httpData",(function HTTP_DATA(e,t){if(e){if(n.util.isNode()){t.httpResponse.numBytes+=e.length;var r=t.httpResponse.headers["content-length"],i={loaded:t.httpResponse.numBytes,total:r};t.request.emit("httpDownloadProgress",[i,t])}t.httpResponse.buffers.push(n.util.buffer.toBuffer(e))}})),e("HTTP_DONE","httpDone",(function HTTP_DONE(e){if(e.httpResponse.buffers&&e.httpResponse.buffers.length>0){var t=n.util.buffer.concat(e.httpResponse.buffers);e.httpResponse.body=t}delete e.httpResponse.numBytes,delete e.httpResponse.buffers})),e("FINALIZE_ERROR","retry",(function FINALIZE_ERROR(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 INVALIDATE_CREDENTIALS(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 EXPIRED_SIGNATURE(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 CLOCK_SKEWED(e){e.error&&this.service.clockSkewError(e.error)&&this.service.config.correctClockSkew&&(e.error.retryable=!0)})),e("REDIRECT","retry",(function REDIRECT(e){e.error&&e.error.statusCode>=300&&e.error.statusCode<400&&e.httpResponse.headers.location&&(this.httpRequest.endpoint=new n.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 RETRY_CHECK(e){e.error&&(e.error.redirect&&e.redirectCount=0?(e.error=null,setTimeout(t,r)):t()}))})),CorePost:(new i).addNamedListeners((function(e){e("EXTRACT_REQUEST_ID","extractData",n.util.extractRequestId),e("EXTRACT_REQUEST_ID","extractError",n.util.extractRequestId),e("ENOTFOUND_ERROR","httpError",(function ENOTFOUND_ERROR(e){if("NetworkingError"===e.code&&function isDNSError(e){return"ENOTFOUND"===e.errno||"number"==typeof e.errno&&"function"==typeof n.util.getSystemErrorName&&["EAI_NONAME","EAI_NODATA"].indexOf(n.util.getSystemErrorName(e.errno)>=0)}(e)){var t="Inaccessible host: `"+e.hostname+"' at port `"+e.port+"'. This service may not be available in the `"+e.region+"' region.";this.response.error=n.util.error(new Error(t),{code:"UnknownEndpoint",region:e.region,hostname:e.hostname,retryable:!0,originalError:e})}}))})),Logger:(new i).addNamedListeners((function(e){e("LOG_REQUEST","complete",(function LOG_REQUEST(e){var t=e.request,i=t.service.config.logger;if(i){var o=function buildMessage(){var o=(e.request.service.getSkewCorrectedDate().getTime()-t.startTime.getTime())/1e3,s=!!i.isTTY,a=e.httpResponse.statusCode,u=t.params;t.service.api.operations&&t.service.api.operations[t.operation]&&t.service.api.operations[t.operation].input&&(u=filterSensitiveLog(t.service.api.operations[t.operation].input,t.params));var c=r(9539).inspect(u,!0,null),l="";return s&&(l+=""),l+="[AWS "+t.service.serviceIdentifier+" "+a,l+=" "+o.toString()+"s "+e.retryCount+" retries]",s&&(l+=""),l+=" "+n.util.string.lowerFirst(t.operation),l+="("+c+")",s&&(l+=""),l}();"function"==typeof i.log?i.log(o):"function"==typeof i.write&&i.write(o+"\n")}function filterSensitiveLog(e,t){if(!t)return t;if(e.isSensitive)return"***SensitiveInformation***";switch(e.type){case"structure":var r={};return n.util.each(t,(function(t,n){Object.prototype.hasOwnProperty.call(e.members,t)?r[t]=filterSensitiveLog(e.members[t],n):r[t]=n})),r;case"list":var i=[];return n.util.arrayEach(t,(function(t,r){i.push(filterSensitiveLog(e.member,t))})),i;case"map":var o={};return n.util.each(t,(function(t,r){o[t]=filterSensitiveLog(e.value,r)})),o;default:return t}}}))})),Json:(new i).addNamedListeners((function(e){var t=r(6933);e("BUILD","build",t.buildRequest),e("EXTRACT_DATA","extractData",t.extractData),e("EXTRACT_ERROR","extractError",t.extractError)})),Rest:(new i).addNamedListeners((function(e){var t=r(6225);e("BUILD","build",t.buildRequest),e("EXTRACT_DATA","extractData",t.extractData),e("EXTRACT_ERROR","extractError",t.extractError)})),RestJson:(new i).addNamedListeners((function(e){var t=r(3699);e("BUILD","build",t.buildRequest),e("EXTRACT_DATA","extractData",t.extractData),e("EXTRACT_ERROR","extractError",t.extractError)})),RestXml:(new i).addNamedListeners((function(e){var t=r(1674);e("BUILD","build",t.buildRequest),e("EXTRACT_DATA","extractData",t.extractData),e("EXTRACT_ERROR","extractError",t.extractError)})),Query:(new i).addNamedListeners((function(e){var t=r(293);e("BUILD","build",t.buildRequest),e("EXTRACT_DATA","extractData",t.extractData),e("EXTRACT_ERROR","extractError",t.extractError)}))}},6344:(e,t,r)=>{var n=r(9614),i=n.util.inherit;n.Endpoint=i({constructor:function Endpoint(e,t){if(n.util.hideProperties(this,["slashes","auth","hash","search","query"]),null==e)throw new Error("Invalid endpoint: "+e);if("string"!=typeof e)return n.util.copy(e);e.match(/^http/)||(e=((t&&void 0!==t.sslEnabled?t.sslEnabled:n.config.sslEnabled)?"https":"http")+"://"+e);n.util.update(this,n.util.urlParse(e)),this.port?this.port=parseInt(this.port,10):this.port="https:"===this.protocol?443:80}}),n.HttpRequest=i({constructor:function HttpRequest(e,t){e=new n.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 setUserAgent(){this._userAgent=this.headers[this.getUserAgentHeaderName()]=n.util.userAgent()},getUserAgentHeaderName:function getUserAgentHeaderName(){return(n.util.isBrowser()?"X-Amz-":"")+"User-Agent"},appendToUserAgent:function appendToUserAgent(e){"string"==typeof e&&e&&(this._userAgent+=" "+e),this.headers[this.getUserAgentHeaderName()]=this._userAgent},getUserAgent:function getUserAgent(){return this._userAgent},pathname:function pathname(){return this.path.split("?",1)[0]},search:function search(){var e=this.path.split("?",2)[1];return e?(e=n.util.queryStringParse(e),n.util.queryParamsToString(e)):""},updateEndpoint:function updateEndpoint(e){var t=new n.Endpoint(e);this.endpoint=t,this.path=t.path||"/",this.headers.Host&&(this.headers.Host=t.host)}}),n.HttpResponse=i({constructor:function HttpResponse(){this.statusCode=void 0,this.headers={},this.body=void 0,this.streaming=!1,this.stream=null},createUnbufferedStream:function createUnbufferedStream(){return this.streaming=!0,this.stream}}),n.HttpClient=i({}),n.HttpClient.getInstance=function getInstance(){return void 0===this.singleton&&(this.singleton=new this),this.singleton}},2631:(e,t,r)=>{var n=r(9614),i=r(7187).EventEmitter;r(6344),n.XHRClient=n.util.inherit({handleRequest:function handleRequest(e,t,r,o){var s=this,a=e.endpoint,u=new i,c=a.protocol+"//"+a.hostname;80!==a.port&&443!==a.port&&(c+=":"+a.port),c+=e.path;var l=new XMLHttpRequest,p=!1;e.stream=l,l.addEventListener("readystatechange",(function(){try{if(0===l.status)return}catch(e){return}this.readyState>=this.HEADERS_RECEIVED&&!p&&(u.statusCode=l.status,u.headers=s.parseHeaders(l.getAllResponseHeaders()),u.emit("headers",u.statusCode,u.headers,l.statusText),p=!0),this.readyState===this.DONE&&s.finishRequest(l,u)}),!1),l.upload.addEventListener("progress",(function(e){u.emit("sendProgress",e)})),l.addEventListener("progress",(function(e){u.emit("receiveProgress",e)}),!1),l.addEventListener("timeout",(function(){o(n.util.error(new Error("Timeout"),{code:"TimeoutError"}))}),!1),l.addEventListener("error",(function(){o(n.util.error(new Error("Network Failure"),{code:"NetworkingError"}))}),!1),l.addEventListener("abort",(function(){o(n.util.error(new Error("Request aborted"),{code:"RequestAbortedError"}))}),!1),r(u),l.open(e.method,c,!1!==t.xhrAsync),n.util.each(e.headers,(function(e,t){"Content-Length"!==e&&"User-Agent"!==e&&"Host"!==e&&l.setRequestHeader(e,t)})),t.timeout&&!1!==t.xhrAsync&&(l.timeout=t.timeout),t.xhrWithCredentials&&(l.withCredentials=!0);try{l.responseType="arraybuffer"}catch(e){}try{e.body?l.send(e.body):l.send()}catch(t){if(!e.body||"object"!=typeof e.body.buffer)throw t;l.send(e.body.buffer)}return u},parseHeaders:function parseHeaders(e){var t={};return n.util.arrayEach(e.split(/\r?\n/),(function(e){var r=e.split(":",1)[0],n=e.substring(r.length+2);r.length>0&&(t[r.toLowerCase()]=n)})),t},finishRequest:function finishRequest(e,t){var r;if("arraybuffer"===e.responseType&&e.response){var i=e.response;r=new n.util.Buffer(i.byteLength);for(var o=new Uint8Array(i),s=0;s{var n=r(2662);function JsonBuilder(){}function translate(e,t){if(t&&null!=e)switch(t.type){case"structure":return function translateStructure(e,t){if(t.isDocument)return e;var r={};return n.each(e,(function(e,n){var i=t.members[e];if(i){if("body"!==i.location)return;var o=i.isLocationName?i.name:e,s=translate(n,i);void 0!==s&&(r[o]=s)}})),r}(e,t);case"map":return function translateMap(e,t){var r={};return n.each(e,(function(e,n){var i=translate(n,t.value);void 0!==i&&(r[e]=i)})),r}(e,t);case"list":return function translateList(e,t){var r=[];return n.arrayEach(e,(function(e){var n=translate(e,t.member);void 0!==n&&r.push(n)})),r}(e,t);default:return function translateScalar(e,t){return t.toWireFormat(e)}(e,t)}}JsonBuilder.prototype.build=function(e,t){return JSON.stringify(translate(e,t))},e.exports=JsonBuilder},2622:(e,t,r)=>{var n=r(2662);function JsonParser(){}function translate(e,t){if(t&&void 0!==e)switch(t.type){case"structure":return function translateStructure(e,t){if(null==e)return;if(t.isDocument)return e;var r={},i=t.members;return n.each(i,(function(t,n){var i=n.isLocationName?n.name:t;if(Object.prototype.hasOwnProperty.call(e,i)){var o=translate(e[i],n);void 0!==o&&(r[t]=o)}})),r}(e,t);case"map":return function translateMap(e,t){if(null==e)return;var r={};return n.each(e,(function(e,n){var i=translate(n,t.value);r[e]=void 0===i?null:i})),r}(e,t);case"list":return function translateList(e,t){if(null==e)return;var r=[];return n.arrayEach(e,(function(e){var n=translate(e,t.member);void 0===n?r.push(null):r.push(n)})),r}(e,t);default:return function translateScalar(e,t){return t.toType(e)}(e,t)}}JsonParser.prototype.parse=function(e,t){return translate(JSON.parse(e),t)},e.exports=JsonParser},5863:(e,t,r)=>{var n=r(4351),i=r(6797),o=r(8136),s=r(7937),a=r(306),u=r(7752),c=r(2662),l=c.property,p=c.memoizedProperty;e.exports=function Api(e,t){var r=this;e=e||{},(t=t||{}).api=this,e.metadata=e.metadata||{};var f=t.serviceIdentifier;delete t.serviceIdentifier,l(this,"isApi",!0,!1),l(this,"apiVersion",e.metadata.apiVersion),l(this,"endpointPrefix",e.metadata.endpointPrefix),l(this,"signingName",e.metadata.signingName),l(this,"globalEndpoint",e.metadata.globalEndpoint),l(this,"signatureVersion",e.metadata.signatureVersion),l(this,"jsonVersion",e.metadata.jsonVersion),l(this,"targetPrefix",e.metadata.targetPrefix),l(this,"protocol",e.metadata.protocol),l(this,"timestampFormat",e.metadata.timestampFormat),l(this,"xmlNamespaceUri",e.metadata.xmlNamespace),l(this,"abbreviation",e.metadata.serviceAbbreviation),l(this,"fullName",e.metadata.serviceFullName),l(this,"serviceId",e.metadata.serviceId),f&&u[f]&&l(this,"xmlNoDefaultLists",u[f].xmlNoDefaultLists,!1),p(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})),l(this,"operations",new n(e.operations,t,(function(e,r){return new i(e,r,t)}),c.string.lowerFirst,(function addEndpointOperation(e,t){!0===t.endpointoperation&&l(r,"endpointOperation",c.string.lowerFirst(e)),t.endpointdiscovery&&!r.hasRequiredEndpointDiscovery&&l(r,"hasRequiredEndpointDiscovery",!0===t.endpointdiscovery.required)}))),l(this,"shapes",new n(e.shapes,t,(function(e,r){return o.create(r,t)}))),l(this,"paginators",new n(e.paginators,t,(function(e,r){return new s(e,r,t)}))),l(this,"waiters",new n(e.waiters,t,(function(e,r){return new a(e,r,t)}),c.string.lowerFirst)),t.documentation&&(l(this,"documentation",e.documentation),l(this,"documentationUrl",e.documentationUrl))}},4351:(e,t,r)=>{var n=r(2662).memoizedProperty;function memoize(e,t,r,i){n(this,i(e),(function(){return r(e,t)}))}e.exports=function Collection(e,t,r,n,i){for(var o in n=n||String,e)Object.prototype.hasOwnProperty.call(e,o)&&(memoize.call(this,o,e[o],r,n),i&&i(o,e[o]))}},6797:(e,t,r)=>{var n=r(8136),i=r(2662),o=i.property,s=i.memoizedProperty;e.exports=function Operation(e,t,r){var i=this;r=r||{},o(this,"name",t.name||e),o(this,"api",r.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"),o(this,"httpChecksumRequired",t.httpChecksumRequired,!1),s(this,"input",(function(){return t.input?n.create(t.input,r):new n.create({type:"structure"},r)})),s(this,"output",(function(){return t.output?n.create(t.output,r):new n.create({type:"structure"},r)})),s(this,"errors",(function(){var e=[];if(!t.errors)return null;for(var i=0;i{var n=r(2662).property;e.exports=function Paginator(e,t){n(this,"inputToken",t.input_token),n(this,"limitKey",t.limit_key),n(this,"moreResults",t.more_results),n(this,"outputToken",t.output_token),n(this,"resultKey",t.result_key)}},306:(e,t,r)=>{var n=r(2662),i=n.property;e.exports=function ResourceWaiter(e,t,r){r=r||{},i(this,"name",e),i(this,"api",r.api,!1),t.operation&&i(this,"operation",n.string.lowerFirst(t.operation));var o=this;["type","description","delay","maxAttempts","acceptors"].forEach((function(e){var r=t[e];r&&i(o,e,r)}))}},8136:(e,t,r)=>{var n=r(4351),i=r(2662);function property(e,t,r){null!=r&&i.property.apply(this,arguments)}function memoizedProperty(e,t){e.constructor.prototype[t]||i.memoizedProperty.apply(this,arguments)}function Shape(e,t,r){t=t||{},property(this,"shape",e.shape),property(this,"api",t.api,!1),property(this,"type",e.type),property(this,"enum",e.enum),property(this,"min",e.min),property(this,"max",e.max),property(this,"pattern",e.pattern),property(this,"location",e.location||this.location||"body"),property(this,"name",this.name||e.xmlName||e.queryName||e.locationName||r),property(this,"isStreaming",e.streaming||this.isStreaming||!1),property(this,"requiresLength",e.requiresLength,!1),property(this,"isComposite",e.isComposite||!1),property(this,"isShape",!0,!1),property(this,"isQueryName",Boolean(e.queryName),!1),property(this,"isLocationName",Boolean(e.locationName),!1),property(this,"isIdempotent",!0===e.idempotencyToken),property(this,"isJsonValue",!0===e.jsonvalue),property(this,"isSensitive",!0===e.sensitive||e.prototype&&!0===e.prototype.sensitive),property(this,"isEventStream",Boolean(e.eventstream),!1),property(this,"isEvent",Boolean(e.event),!1),property(this,"isEventPayload",Boolean(e.eventpayload),!1),property(this,"isEventHeader",Boolean(e.eventheader),!1),property(this,"isTimestampFormatSet",Boolean(e.timestampFormat)||e.prototype&&!0===e.prototype.isTimestampFormatSet,!1),property(this,"endpointDiscoveryId",Boolean(e.endpointdiscoveryid),!1),property(this,"hostLabel",Boolean(e.hostLabel),!1),t.documentation&&(property(this,"documentation",e.documentation),property(this,"documentationUrl",e.documentationUrl)),e.xmlAttribute&&property(this,"isXmlAttribute",e.xmlAttribute||!1),property(this,"defaultValue",null),this.toWireFormat=function(e){return null==e?"":e},this.toType=function(e){return e}}function CompositeShape(e){Shape.apply(this,arguments),property(this,"isComposite",!0),e.flattened&&property(this,"flattened",e.flattened||!1)}function StructureShape(e,t){var r=this,i=null,o=!this.isShape;CompositeShape.apply(this,arguments),o&&(property(this,"defaultValue",(function(){return{}})),property(this,"members",{}),property(this,"memberNames",[]),property(this,"required",[]),property(this,"isRequired",(function(){return!1})),property(this,"isDocument",Boolean(e.document))),e.members&&(property(this,"members",new n(e.members,t,(function(e,r){return Shape.create(r,t,e)}))),memoizedProperty(this,"memberNames",(function(){return e.xmlOrder||Object.keys(e.members)})),e.event&&(memoizedProperty(this,"eventPayloadMemberName",(function(){for(var e=r.members,t=r.memberNames,n=0,i=t.length;n-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 BinaryShape(){Shape.apply(this,arguments),this.toType=function(e){var t=i.base64.decode(e);if(this.isSensitive&&i.isNode()&&"function"==typeof i.Buffer.alloc){var r=i.Buffer.alloc(t.length,t);t.fill(0),t=r}return t},this.toWireFormat=i.base64.encode}function Base64Shape(){BinaryShape.apply(this,arguments)}function BooleanShape(){Shape.apply(this,arguments),this.toType=function(e){return"boolean"==typeof e?e:null==e?null:"true"===e}}Shape.normalizedTypes={character:"string",double:"float",long:"integer",short:"integer",biginteger:"integer",bigdecimal:"float",blob:"binary"},Shape.types={structure:StructureShape,list:ListShape,map:MapShape,boolean:BooleanShape,timestamp:function TimestampShape(e){var t=this;if(Shape.apply(this,arguments),e.timestampFormat)property(this,"timestampFormat",e.timestampFormat);else if(t.isTimestampFormatSet&&this.timestampFormat)property(this,"timestampFormat",this.timestampFormat);else if("header"===this.location)property(this,"timestampFormat","rfc822");else if("querystring"===this.location)property(this,"timestampFormat","iso8601");else if(this.api)switch(this.api.protocol){case"json":case"rest-json":property(this,"timestampFormat","unixTimestamp");break;case"rest-xml":case"query":case"ec2":property(this,"timestampFormat","iso8601")}this.toType=function(e){return null==e?null:"function"==typeof e.toUTCString?e:"string"==typeof e||"number"==typeof e?i.date.parseTimestamp(e):null},this.toWireFormat=function(e){return i.date.format(e,t.timestampFormat)}},float:function FloatShape(){Shape.apply(this,arguments),this.toType=function(e){return null==e?null:parseFloat(e)},this.toWireFormat=this.toType},integer:function IntegerShape(){Shape.apply(this,arguments),this.toType=function(e){return null==e?null:parseInt(e,10)},this.toWireFormat=this.toType},string:StringShape,base64:Base64Shape,binary:BinaryShape},Shape.resolve=function resolve(e,t){if(e.shape){var r=t.api.shapes[e.shape];if(!r)throw new Error("Cannot find shape reference: "+e.shape);return r}return null},Shape.create=function create(e,t,r){if(e.isShape)return e;var n=Shape.resolve(e,t);if(n){var i=Object.keys(e);t.documentation||(i=i.filter((function(e){return!e.match(/documentation/)})));var InlineShape=function(){n.constructor.call(this,e,t,r)};return InlineShape.prototype=n,new InlineShape}e.type||(e.members?e.type="structure":e.member?e.type="list":e.key?e.type="map":e.type="string");var o=e.type;if(Shape.normalizedTypes[e.type]&&(e.type=Shape.normalizedTypes[e.type]),Shape.types[e.type])return new Shape.types[e.type](e,t,r);throw new Error("Unrecognized shape type: "+o)},Shape.shapes={StructureShape,ListShape,MapShape,StringShape,BooleanShape,Base64Shape},e.exports=Shape},5479:(e,t,r)=>{var n=r(9614);n.ParamValidator=n.util.inherit({constructor:function ParamValidator(e){!0!==e&&void 0!==e||(e={min:!0}),this.validation=e},validate:function validate(e,t,r){if(this.errors=[],this.validateMember(e,t||{},r||"params"),this.errors.length>1){var i=this.errors.join("\n* ");throw i="There were "+this.errors.length+" validation errors:\n* "+i,n.util.error(new Error(i),{code:"MultipleValidationErrors",errors:this.errors})}if(1===this.errors.length)throw this.errors[0];return!0},fail:function fail(e,t){this.errors.push(n.util.error(new Error(t),{code:e}))},validateStructure:function validateStructure(e,t,r){var n;this.validateType(t,r,["object"],"structure");for(var i=0;e.required&&i= 1, but found "'+t+'" for '+r)},validatePattern:function validatePattern(e,t,r){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 "+r))},validateRange:function validateRange(e,t,r,n){this.validation.min&&void 0!==e.min&&t= "+e.min+", but found "+t+" for "+r),this.validation.max&&void 0!==e.max&&t>e.max&&this.fail("MaxRangeError","Expected "+n+" <= "+e.max+", but found "+t+" for "+r)},validateEnum:function validateRange(e,t,r){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 "+r)},validateType:function validateType(e,t,r,i){if(null==e)return!1;for(var o=!1,s=0;s{var n=r(2662),i=r(9614);e.exports={populateHostPrefix:function populateHostPrefix(e){if(!e.service.config.hostPrefixEnabled)return e;var t=e.service.api.operations[e.operation];if(function hasEndpointDiscover(e){var t=e.service.api,r=t.operations[e.operation],i=t.endpointOperation&&t.endpointOperation===n.string.lowerFirst(r.name);return"NULL"!==r.endpointDiscoveryRequired||!0===i}(e))return e;if(t.endpoint&&t.endpoint.hostPrefix){var r=function expandHostPrefix(e,t,r){return n.each(r.members,(function(r,i){if(!0===i.hostLabel){if("string"!=typeof t[r]||""===t[r])throw n.error(new Error,{message:"Parameter "+r+" should be a non-empty string.",code:"InvalidParameter"});var o=new RegExp("\\{"+r+"\\}","g");e=e.replace(o,t[r])}})),e}(t.endpoint.hostPrefix,e.params,t.input);!function prependEndpointPrefix(e,t){e.host&&(e.host=t+e.host);e.hostname&&(e.hostname=t+e.hostname)}(e.httpRequest.endpoint,r),function validateHostname(e){var t=e.split("."),r=/^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]$/;n.arrayEach(t,(function(e){if(!e.length||e.length<1||e.length>63)throw n.error(new Error,{code:"ValidationError",message:"Hostname label length should be between 1 to 63 characters, inclusive."});if(!r.test(e))throw i.util.error(new Error,{code:"ValidationError",message:e+" is not hostname compatible."})}))}(e.httpRequest.endpoint.hostname)}return e}}},6933:(e,t,r)=>{var n=r(2662),i=r(3658),o=r(2622),s=r(987).populateHostPrefix;e.exports={buildRequest:function buildRequest(e){var t=e.httpRequest,r=e.service.api,n=r.targetPrefix+"."+r.operations[e.operation].name,o=r.jsonVersion||"1.0",a=r.operations[e.operation].input,u=new i;1===o&&(o="1.0"),t.body=u.build(e.params||{},a),t.headers["Content-Type"]="application/x-amz-json-"+o,t.headers["X-Amz-Target"]=n,s(e)},extractError:function extractError(e){var t={},r=e.httpResponse;if(t.code=r.headers["x-amzn-errortype"]||"UnknownError","string"==typeof t.code&&(t.code=t.code.split(":")[0]),r.body.length>0)try{var i=JSON.parse(r.body.toString()),o=i.__type||i.code||i.Code;o&&(t.code=o.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=r.statusCode,t.message=r.statusMessage}else t.statusCode=r.statusCode,t.message=r.statusCode.toString();e.error=n.error(new Error,t)},extractData:function extractData(e){var t=e.httpResponse.body.toString()||"{}";if(!1===e.request.service.config.convertResponseTypes)e.data=JSON.parse(t);else{var r=e.request.service.api.operations[e.request.operation].output||{},n=new o;e.data=n.parse(t,r)}}}},293:(e,t,r)=>{var n=r(9614),i=r(2662),o=r(864),s=r(8136),a=r(987).populateHostPrefix;e.exports={buildRequest:function buildRequest(e){var t=e.service.api.operations[e.operation],r=e.httpRequest;r.headers["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8",r.params={Version:e.service.api.apiVersion,Action:t.name},(new o).serialize(e.params,t.input,(function(e,t){r.params[e]=t})),r.body=i.queryParamsToString(r.params),a(e)},extractError:function extractError(e){var t,r=e.httpResponse.body.toString();if(r.match("{var n=r(2662),i=r(987).populateHostPrefix;function generateURI(e,t,r,i){var o=[e,t].join("/");o=o.replace(/\/+/g,"/");var s={},a=!1;if(n.each(r.members,(function(e,t){var r=i[e];if(null!=r)if("uri"===t.location){var u=new RegExp("\\{"+t.name+"(\\+)?\\}");o=o.replace(u,(function(e,t){return(t?n.uriEscapePath:n.uriEscape)(String(r))}))}else"querystring"===t.location&&(a=!0,"list"===t.type?s[t.name]=r.map((function(e){return n.uriEscape(t.member.toWireFormat(e).toString())})):"map"===t.type?n.each(r,(function(e,t){Array.isArray(t)?s[e]=t.map((function(e){return n.uriEscape(String(e))})):s[e]=n.uriEscape(String(t))})):s[t.name]=n.uriEscape(t.toWireFormat(r).toString()))})),a){o+=o.indexOf("?")>=0?"&":"?";var u=[];n.arrayEach(Object.keys(s).sort(),(function(e){Array.isArray(s[e])||(s[e]=[s[e]]);for(var t=0;t{var n=r(2662),i=r(6225),o=r(6933),s=r(3658),a=r(2622);function applyContentTypeHeader(e,t){e.service.api.operations[e.operation].input;if(!e.httpRequest.headers["Content-Type"]){var r=t?"binary/octet-stream":"application/json";e.httpRequest.headers["Content-Type"]=r}}e.exports={buildRequest:function buildRequest(e){i.buildRequest(e),["HEAD","DELETE"].indexOf(e.httpRequest.method)<0&&function populateBody(e){var t=new s,r=e.service.api.operations[e.operation].input;if(r.payload){var n,i=r.members[r.payload];if(void 0===(n=e.params[r.payload]))return;"structure"===i.type?(e.httpRequest.body=t.build(n,i),applyContentTypeHeader(e)):(e.httpRequest.body=n,("binary"===i.type||i.isStreaming)&&applyContentTypeHeader(e,!0))}else{var o=t.build(e.params,r);"{}"===o&&"GET"===e.httpRequest.method||(e.httpRequest.body=o),applyContentTypeHeader(e)}}(e)},extractError:function extractError(e){o.extractError(e)},extractData:function extractData(e){i.extractData(e);var t=e.request,r=t.service.api.operations[t.operation],s=t.service.api.operations[t.operation].output||{};if(r.hasEventOutput,s.payload){var u=s.members[s.payload],c=e.httpResponse.body;if(u.isEventStream)l=new a,e.data[payload]=n.createEventStream(2===AWS.HttpClient.streamsApiVersion?e.httpResponse.stream:c,l,u);else if("structure"===u.type||"list"===u.type){var l=new a;e.data[s.payload]=l.parse(c,u)}else"binary"===u.type||u.isStreaming?e.data[s.payload]=c:e.data[s.payload]=u.toType(c)}else{var p=e.data;o.extractData(e),e.data=n.merge(p,e.data)}}}},1674:(e,t,r)=>{var n=r(9614),i=r(2662),o=r(6225);e.exports={buildRequest:function buildRequest(e){o.buildRequest(e),["GET","HEAD"].indexOf(e.httpRequest.method)<0&&function populateBody(e){var t=e.service.api.operations[e.operation].input,r=new n.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 u=a.name;e.httpRequest.body=r.toXML(o,a,u,!0)}else e.httpRequest.body=o}else e.httpRequest.body=r.toXML(o,t,t.name||t.shape||i.string.upperFirst(e.operation)+"Request")}(e)},extractError:function extractError(e){var t;o.extractError(e);try{t=(new n.XML.Parser).parse(e.httpResponse.body.toString())}catch(r){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 extractData(e){var t;o.extractData(e);var r=e.request,s=e.httpResponse.body,a=r.service.api.operations[r.operation],u=a.output,c=(a.hasEventOutput,u.payload);if(c){var l=u.members[c];l.isEventStream?(t=new n.XML.Parser,e.data[c]=i.createEventStream(2===n.HttpClient.streamsApiVersion?e.httpResponse.stream:e.httpResponse.body,t,l)):"structure"===l.type?(t=new n.XML.Parser,e.data[c]=t.parse(s.toString(),l)):"binary"===l.type||l.isStreaming?e.data[c]=s:e.data[c]=l.toType(s)}else if(s.length>0){var p=(t=new n.XML.Parser).parse(s.toString(),u);i.update(e.data,p)}}}},864:(e,t,r)=>{var n=r(2662);function QueryParamSerializer(){}function ucfirst(e){return e.isQueryName||"ec2"!==e.api.protocol?e.name:e.name[0].toUpperCase()+e.name.substr(1)}function serializeStructure(e,t,r,i){n.each(r.members,(function(r,n){var o=t[r];if(null!=o){var s=ucfirst(n);serializeMember(s=e?e+"."+s:s,o,n,i)}}))}function serializeMember(e,t,r,i){null!=t&&("structure"===r.type?serializeStructure(e,t,r,i):"list"===r.type?function serializeList(e,t,r,i){var o=r.member||{};0!==t.length?n.arrayEach(t,(function(t,n){var s="."+(n+1);if("ec2"===r.api.protocol)s+="";else if(r.flattened){if(o.name){var a=e.split(".");a.pop(),a.push(ucfirst(o)),e=a.join(".")}}else s="."+(o.name?o.name:"member")+s;serializeMember(e+s,t,o,i)})):i.call(this,e,null)}(e,t,r,i):"map"===r.type?function serializeMap(e,t,r,i){var o=1;n.each(t,(function(t,n){var s=(r.flattened?".":".entry.")+o+++".",a=s+(r.key.name||"key"),u=s+(r.value.name||"value");serializeMember(e+a,t,r.key,i),serializeMember(e+u,n,r.value,i)}))}(e,t,r,i):i(e,r.toWireFormat(t).toString()))}QueryParamSerializer.prototype.serialize=function(e,t,r){serializeStructure("",e,t,r)},e.exports=QueryParamSerializer},1414:e=>{e.exports={now:function now(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}}},1404:(e,t,r)=>{var n=r(2662),i=r(738);function applyConfig(e,t){n.each(t,(function(t,r){"globalEndpoint"!==t&&(void 0!==e.config[t]&&null!==e.config[t]||(e.config[t]=r))}))}e.exports={configureEndpoint:function configureEndpoint(e){for(var t=function derivedKeys(e){var t=e.config.region,r=function generateRegionPrefix(e){if(!e)return null;var t=e.split("-");return t.length<3?null:t.slice(0,t.length-2).join("-")+"-*"}(t),n=e.api.endpointPrefix;return[[t,n],[r,n],[t,"*"],[r,"*"],["*",n],["*","*"]].map((function(e){return e[0]&&e[1]?e.join("/"):null}))}(e),r=0;r{var n=r(4155),i=r(9614),o=r(1793),s=i.util.inherit,a=i.util.domain,u=r(4509),c={success:1,error:1,complete:1};var l=new o;l.setupStates=function(){var transition=function(e,t){var r=this;r._haltHandlersOnError=!1,r.emit(r._asm.currentState,(function(e){if(e)if(function isTerminalState(e){return Object.prototype.hasOwnProperty.call(c,e._asm.currentState)}(r)){if(!(a&&r.domain instanceof a.Domain))throw e;e.domainEmitter=r,e.domain=r.domain,e.domainThrown=!1,r.domain.emit("error",e)}else r.response.error=e,t(e);else t(r.response.error)}))};this.addState("validate","build","error",transition),this.addState("build","afterBuild","restart",transition),this.addState("afterBuild","sign","restart",transition),this.addState("sign","send","retry",transition),this.addState("retry","afterRetry","afterRetry",transition),this.addState("afterRetry","sign","error",transition),this.addState("send","validateResponse","retry",transition),this.addState("validateResponse","extractData","extractError",transition),this.addState("extractError","extractData","retry",transition),this.addState("extractData","success","retry",transition),this.addState("restart","build","error",transition),this.addState("success","complete","complete",transition),this.addState("error","complete","complete",transition),this.addState("complete",null,null,transition)},l.setupStates(),i.Request=s({constructor:function Request(e,t,r){var n=e.endpoint,s=e.config.region,u=e.config.customUserAgent;e.isGlobalEndpoint&&(s=e.signingRegion?e.signingRegion:"us-east-1"),this.domain=a&&a.active,this.service=e,this.operation=t,this.params=r||{},this.httpRequest=new i.HttpRequest(n,s),this.httpRequest.appendToUserAgent(u),this.startTime=e.getSkewCorrectedDate(),this.response=new i.Response(this),this._asm=new o(l.states,"validate"),this._haltHandlersOnError=!1,i.SequentialExecutor.call(this),this.emit=this.emitEvent},send:function send(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 build(e){return this.runTo("send",e)},runTo:function runTo(e,t){return this._asm.runTo(e,t,this),this},abort:function abort(){return this.removeAllListeners("validateResponse"),this.removeAllListeners("extractError"),this.on("validateResponse",(function addAbortedError(e){e.error=i.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 eachPage(e){e=i.util.fn.makeAsync(e,3),this.on("complete",(function wrappedCallback(t){e.call(t,t.error,t.data,(function(r){!1!==r&&(t.hasNextPage()?t.nextPage().on("complete",wrappedCallback).send():e.call(t,null,null,i.util.fn.noop))}))})).send()},eachItem:function eachItem(e){var t=this;this.eachPage((function wrappedCallback(r,n){if(r)return e(r,null);if(null===n)return e(null,null);var o=t.service.paginationConfig(t.operation).resultKey;Array.isArray(o)&&(o=o[0]);var s=u.search(n,o),a=!0;return i.util.arrayEach(s,(function(t){if(!1===(a=e(null,t)))return i.util.abort})),a}))},isPageable:function isPageable(){return!!this.service.paginationConfig(this.operation)},createReadStream:function createReadStream(){var e=i.util.stream,t=this,r=null;return 2===i.HttpClient.streamsApiVersion?(r=new e.PassThrough,n.nextTick((function(){t.send()}))):((r=new e.Stream).readable=!0,r.sent=!1,r.on("newListener",(function(e){r.sent||"data"!==e||(r.sent=!0,n.nextTick((function(){t.send()})))}))),this.on("error",(function(e){r.emit("error",e)})),this.on("httpHeaders",(function streamHeaders(n,o,s){if(n<300){t.removeListener("httpData",i.EventListeners.Core.HTTP_DATA),t.removeListener("httpError",i.EventListeners.Core.HTTP_ERROR),t.on("httpError",(function streamHttpError(e){s.error=e,s.error.retryable=!1}));var a,u=!1;if("HEAD"!==t.httpRequest.method&&(a=parseInt(o["content-length"],10)),void 0!==a&&!isNaN(a)&&a>=0){u=!0;var c=0}var l=function checkContentLengthAndEmit(){u&&c!==a?r.emit("error",i.util.error(new Error("Stream content length mismatch. Received "+c+" of "+a+" bytes."),{code:"StreamContentLengthMismatch"})):2===i.HttpClient.streamsApiVersion?r.end():r.emit("end")},p=s.httpResponse.createUnbufferedStream();if(2===i.HttpClient.streamsApiVersion)if(u){var f=new e.PassThrough;f._write=function(t){return t&&t.length&&(c+=t.length),e.PassThrough.prototype._write.apply(this,arguments)},f.on("end",l),r.on("error",(function(e){u=!1,p.unpipe(f),f.emit("end"),f.end()})),p.pipe(f).pipe(r,{end:!1})}else p.pipe(r);else u&&p.on("data",(function(e){e&&e.length&&(c+=e.length)})),p.on("data",(function(e){r.emit("data",e)})),p.on("end",l);p.on("error",(function(e){u=!1,r.emit("error",e)}))}})),r},emitEvent:function emit(e,t,r){"function"==typeof t&&(r=t,t=null),r||(r=function(){}),t||(t=this.eventParameters(e,this.response)),i.SequentialExecutor.prototype.emit.call(this,e,t,(function(e){e&&(this.response.error=e),r.call(this,e)}))},eventParameters:function eventParameters(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 presign(e,t){return t||"function"!=typeof e||(t=e,e=null),(new i.Signers.Presign).sign(this.toGet(),e,t)},isPresigned:function isPresigned(){return Object.prototype.hasOwnProperty.call(this.httpRequest.headers,"presigned-expires")},toUnauthenticated:function toUnauthenticated(){return this._unAuthenticated=!0,this.removeListener("validate",i.EventListeners.Core.VALIDATE_CREDENTIALS),this.removeListener("sign",i.EventListeners.Core.SIGN),this},toGet:function toGet(){return"query"!==this.service.api.protocol&&"ec2"!==this.service.api.protocol||(this.removeListener("build",this.buildAsGet),this.addListener("build",this.buildAsGet)),this},buildAsGet:function buildAsGet(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 haltHandlersOnError(){this._haltHandlersOnError=!0}}),i.Request.addPromisesToClass=function addPromisesToClass(e){this.prototype.promise=function promise(){var t=this;return this.httpRequest.appendToUserAgent("promise"),new e((function(e,r){t.on("complete",(function(t){t.error?r(t.error):e(Object.defineProperty(t.data||{},"$response",{value:t}))})),t.runTo()}))}},i.Request.deletePromisesFromClass=function deletePromisesFromClass(){delete this.prototype.promise},i.util.addPromises(i.Request),i.util.mixin(i.Request,i.SequentialExecutor)},2413:(e,t,r)=>{var n=r(9614),i=n.util.inherit,o=r(4509);function CHECK_ACCEPTORS(e){var t=e.request._waiter,r=t.config.acceptors,n=!1,i="retry";r.forEach((function(r){if(!n){var o=t.matchers[r.matcher];o&&o(e,r.expected,r.argument)&&(n=!0,i=r.state)}})),!n&&e.error&&(i="failure"),"success"===i?t.setSuccess(e):t.setError(e,"retry"===i)}n.ResourceWaiter=i({constructor:function constructor(e,t){this.service=e,this.state=t,this.loadWaiterConfig(this.state)},service:null,state:null,config:null,matchers:{path:function(e,t,r){try{var n=o.search(e.data,r)}catch(e){return!1}return o.strictDeepEqual(n,t)},pathAll:function(e,t,r){try{var n=o.search(e.data,r)}catch(e){return!1}Array.isArray(n)||(n=[n]);var i=n.length;if(!i)return!1;for(var s=0;s{var n=r(9614),i=n.util.inherit,o=r(4509);n.Response=i({constructor:function Response(e){this.request=e,this.data=null,this.error=null,this.retryCount=0,this.redirectCount=0,this.httpResponse=new n.HttpResponse,e&&(this.maxRetries=e.service.numRetries(),this.maxRedirects=e.service.config.maxRedirects)},nextPage:function nextPage(e){var t,r=this.request.service,i=this.request.operation;try{t=r.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=n.util.copy(this.request.params);if(this.nextPageTokens){var s=t.inputToken;"string"==typeof s&&(s=[s]);for(var a=0;a{var n=r(9614);n.SequentialExecutor=n.util.inherit({constructor:function SequentialExecutor(){this._events={}},listeners:function listeners(e){return this._events[e]?this._events[e].slice(0):[]},on:function on(e,t,r){return this._events[e]?r?this._events[e].unshift(t):this._events[e].push(t):this._events[e]=[t],this},onAsync:function onAsync(e,t,r){return t._isAsync=!0,this.on(e,t,r)},removeListener:function removeListener(e,t){var r=this._events[e];if(r){for(var n=r.length,i=-1,o=0;o-1&&r.splice(i,1)}return this},removeAllListeners:function removeAllListeners(e){return e?delete this._events[e]:this._events={},this},emit:function emit(e,t,r){r||(r=function(){});var n=this.listeners(e),i=n.length;return this.callListeners(n,t,r),i>0},callListeners:function callListeners(e,t,r,i){var o=this,s=i||null;function callNextListener(i){if(i&&(s=n.util.error(s||new Error,i),o._haltHandlersOnError))return r.call(o,s);o.callListeners(e,t,r,s)}for(;e.length>0;){var a=e.shift();if(a._isAsync)return void a.apply(o,t.concat([callNextListener]));try{a.apply(o,t)}catch(e){s=n.util.error(s||new Error,e)}if(s&&o._haltHandlersOnError)return void r.call(o,s)}r.call(o,s)},addListeners:function addListeners(e){var t=this;return e._events&&(e=e._events),n.util.each(e,(function(e,r){"function"==typeof r&&(r=[r]),n.util.arrayEach(r,(function(r){t.on(e,r)}))})),t},addNamedListener:function addNamedListener(e,t,r,n){return this[e]=r,this.addListener(t,r,n),this},addNamedAsyncListener:function addNamedAsyncListener(e,t,r,n){return r._isAsync=!0,this.addNamedListener(e,t,r,n)},addNamedListeners:function addNamedListeners(e){var t=this;return e((function(){t.addNamedListener.apply(t,arguments)}),(function(){t.addNamedAsyncListener.apply(t,arguments)})),this}}),n.SequentialExecutor.prototype.addListener=n.SequentialExecutor.prototype.on,e.exports=n.SequentialExecutor},173:(e,t,r)=>{var n=r(4155),i=r(9614),o=r(5863),s=r(1404),a=i.util.inherit,u=0;i.Service=a({constructor:function Service(e){if(!this.loadServiceClass)throw i.util.error(new Error,"Service must be constructed with `new' operator");var t=this.loadServiceClass(e||{});if(t){var r=i.util.copy(e),n=new t(e);return Object.defineProperty(n,"_originalConfig",{get:function(){return r},enumerable:!1,configurable:!0}),n._clientId=++u,n}this.initialize(e)},initialize:function initialize(e){var t=i.config[this.serviceIdentifier];if(this.config=new i.Config(i.config),t&&this.config.update(t,!0),e&&this.config.update(e,!0),this.validateService(),this.config.endpoint||s.configureEndpoint(this),this.config.endpoint=this.endpointFromTemplate(this.config.endpoint),this.setEndpoint(this.config.endpoint),i.SequentialExecutor.call(this),i.Service.addDefaultMonitoringListeners(this),(this.config.clientSideMonitoring||i.Service._clientSideMonitoring)&&this.publisher){var r=this.publisher;this.addNamedListener("PUBLISH_API_CALL","apiCall",(function PUBLISH_API_CALL(e){n.nextTick((function(){r.eventHandler(e)}))})),this.addNamedListener("PUBLISH_API_ATTEMPT","apiCallAttempt",(function PUBLISH_API_ATTEMPT(e){n.nextTick((function(){r.eventHandler(e)}))}))}},validateService:function validateService(){},loadServiceClass:function loadServiceClass(e){var t=e;if(i.util.isEmpty(this.api)){if(t.apiConfig)return i.Service.defineServiceApi(this.constructor,t.apiConfig);if(this.constructor.services){(t=new i.Config(i.config)).update(e,!0);var r=t.apiVersions[this.constructor.serviceIdentifier];return r=r||t.apiVersion,this.getLatestServiceClass(r)}return null}return null},getLatestServiceClass:function getLatestServiceClass(e){return e=this.getLatestServiceVersion(e),null===this.constructor.services[e]&&i.Service.defineServiceApi(this.constructor,e),this.constructor.services[e]},getLatestServiceVersion:function getLatestServiceVersion(e){if(!this.constructor.services||0===this.constructor.services.length)throw new Error("No services defined on "+this.constructor.serviceIdentifier);if(e?i.util.isType(e,Date)&&(e=i.util.date.iso8601(e).split("T")[0]):e="latest",Object.hasOwnProperty(this.constructor.services,e))return e;for(var t=Object.keys(this.constructor.services).sort(),r=null,n=t.length-1;n>=0;n--)if("*"!==t[n][t[n].length-1]&&(r=t[n]),t[n].substr(0,10)<=e)return r;throw new Error("Could not find "+this.constructor.serviceIdentifier+" API to satisfy version constraint `"+e+"'")},api:{},defaultRetryCount:3,customizeRequests:function customizeRequests(e){if(e){if("function"!=typeof e)throw new Error("Invalid callback type '"+typeof e+"' provided in customizeRequests");this.customRequestHandler=e}else this.customRequestHandler=null},makeRequest:function makeRequest(e,t,r){if("function"==typeof t&&(r=t,t=null),t=t||{},this.config.params){var n=this.api.operations[e];n&&(t=i.util.copy(t),i.util.each(this.config.params,(function(e,r){n.input.members[e]&&(void 0!==t[e]&&null!==t[e]||(t[e]=r))})))}var o=new i.Request(this,e,t);return this.addAllRequestListeners(o),this.attachMonitoringEmitter(o),r&&o.send(r),o},makeUnauthenticatedRequest:function makeUnauthenticatedRequest(e,t,r){"function"==typeof t&&(r=t,t={});var n=this.makeRequest(e,t).toUnauthenticated();return r?n.send(r):n},waitFor:function waitFor(e,t,r){return new i.ResourceWaiter(this,e).wait(t,r)},addAllRequestListeners:function addAllRequestListeners(e){for(var t=[i.events,i.EventListeners.Core,this.serviceInterface(),i.EventListeners.CorePost],r=0;r299?(i.code&&(r.FinalAwsException=i.code),i.message&&(r.FinalAwsExceptionMessage=i.message)):((i.code||i.name)&&(r.FinalSdkException=i.code||i.name),i.message&&(r.FinalSdkExceptionMessage=i.message))}return r},apiAttemptEvent:function apiAttemptEvent(e){var t=e.service.api.operations[e.operation],r={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()},n=e.response;return n.httpResponse.statusCode&&(r.HttpStatusCode=n.httpResponse.statusCode),!e._unAuthenticated&&e.service.config.credentials&&e.service.config.credentials.accessKeyId&&(r.AccessKey=e.service.config.credentials.accessKeyId),n.httpResponse.headers?(e.httpRequest.headers["x-amz-security-token"]&&(r.SessionToken=e.httpRequest.headers["x-amz-security-token"]),n.httpResponse.headers["x-amzn-requestid"]&&(r.XAmznRequestId=n.httpResponse.headers["x-amzn-requestid"]),n.httpResponse.headers["x-amz-request-id"]&&(r.XAmzRequestId=n.httpResponse.headers["x-amz-request-id"]),n.httpResponse.headers["x-amz-id-2"]&&(r.XAmzId2=n.httpResponse.headers["x-amz-id-2"]),r):r},attemptFailEvent:function attemptFailEvent(e){var t=this.apiAttemptEvent(e),r=e.response,n=r.error;return r.httpResponse.statusCode>299?(n.code&&(t.AwsException=n.code),n.message&&(t.AwsExceptionMessage=n.message)):((n.code||n.name)&&(t.SdkException=n.code||n.name),n.message&&(t.SdkExceptionMessage=n.message)),t},attachMonitoringEmitter:function attachMonitoringEmitter(e){var t,r,n,o,s,a,u=0,c=this;e.on("validate",(function(){o=i.util.realClock.now(),a=Date.now()}),true),e.on("sign",(function(){r=i.util.realClock.now(),t=Date.now(),s=e.httpRequest.region,u++}),true),e.on("validateResponse",(function(){n=Math.round(i.util.realClock.now()-r)})),e.addNamedListener("API_CALL_ATTEMPT","success",(function API_CALL_ATTEMPT(){var r=c.apiAttemptEvent(e);r.Timestamp=t,r.AttemptLatency=n>=0?n:0,r.Region=s,c.emit("apiCallAttempt",[r])})),e.addNamedListener("API_CALL_ATTEMPT_RETRY","retry",(function API_CALL_ATTEMPT_RETRY(){var o=c.attemptFailEvent(e);o.Timestamp=t,n=n||Math.round(i.util.realClock.now()-r),o.AttemptLatency=n>=0?n:0,o.Region=s,c.emit("apiCallAttempt",[o])})),e.addNamedListener("API_CALL","complete",(function API_CALL(){var t=c.apiCallEvent(e);if(t.AttemptCount=u,!(t.AttemptCount<=0)){t.Timestamp=a;var r=Math.round(i.util.realClock.now()-o);t.Latency=r>=0?r:0;var n=e.response;n.error&&n.error.retryable&&"number"==typeof n.retryCount&&"number"==typeof n.maxRetries&&n.retryCount>=n.maxRetries&&(t.MaxRetriesExceeded=1),c.emit("apiCall",[t])}}))},setupRequestListeners:function setupRequestListeners(e){},getSigningName:function getSigningName(){return this.api.signingName||this.api.endpointPrefix},getSignerClass:function getSignerClass(e){var t,r=null,n="";e&&(n=(r=(e.service.api.operations||{})[e.operation]||null)?r.authtype:"");return t=this.config.signatureVersion?this.config.signatureVersion:"v4"===n||"v4-unsigned-body"===n?"v4":this.api.signatureVersion,i.Signers.RequestSigner.getVersion(t)},serviceInterface:function serviceInterface(){switch(this.api.protocol){case"ec2":case"query":return i.EventListeners.Query;case"json":return i.EventListeners.Json;case"rest-json":return i.EventListeners.RestJson;case"rest-xml":return i.EventListeners.RestXml}if(this.api.protocol)throw new Error("Invalid service `protocol' "+this.api.protocol+" in API config")},successfulResponse:function successfulResponse(e){return e.httpResponse.statusCode<300},numRetries:function numRetries(){return void 0!==this.config.maxRetries?this.config.maxRetries:this.defaultRetryCount},retryDelays:function retryDelays(e,t){return i.util.calculateRetryDelay(e,this.config.retryDelayOptions,t)},retryableError:function retryableError(e){return!!this.timeoutError(e)||(!!this.networkingError(e)||(!!this.expiredCredentialsError(e)||(!!this.throttledError(e)||e.statusCode>=500)))},networkingError:function networkingError(e){return"NetworkingError"===e.code},timeoutError:function timeoutError(e){return"TimeoutError"===e.code},expiredCredentialsError:function expiredCredentialsError(e){return"ExpiredTokenException"===e.code},clockSkewError:function clockSkewError(e){switch(e.code){case"RequestTimeTooSkewed":case"RequestExpired":case"InvalidSignatureException":case"SignatureDoesNotMatch":case"AuthFailure":case"RequestInTheFuture":return!0;default:return!1}},getSkewCorrectedDate:function getSkewCorrectedDate(){return new Date(Date.now()+this.config.systemClockOffset)},applyClockOffset:function applyClockOffset(e){e&&(this.config.systemClockOffset=e-Date.now())},isClockSkewed:function isClockSkewed(e){if(e)return Math.abs(this.getSkewCorrectedDate().getTime()-e)>=3e5},throttledError:function throttledError(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":case"EC2ThrottledException":return!0;default:return!1}},endpointFromTemplate:function endpointFromTemplate(e){if("string"!=typeof e)return e;var t=e;return t=(t=(t=t.replace(/\{service\}/g,this.api.endpointPrefix)).replace(/\{region\}/g,this.config.region)).replace(/\{scheme\}/g,this.config.sslEnabled?"https":"http")},setEndpoint:function setEndpoint(e){this.endpoint=new i.Endpoint(e,this.config)},paginationConfig:function paginationConfig(e,t){var r=this.api.operations[e].paginator;if(!r){if(t){var n=new Error;throw i.util.error(n,"No pagination configuration for "+e)}return null}return r}}),i.util.update(i.Service,{defineMethods:function defineMethods(e){i.util.each(e.prototype.api.operations,(function iterator(t){e.prototype[t]||("none"===e.prototype.api.operations[t].authtype?e.prototype[t]=function(e,r){return this.makeUnauthenticatedRequest(t,e,r)}:e.prototype[t]=function(e,r){return this.makeRequest(t,e,r)})}))},defineService:function defineService(e,t,r){i.Service._serviceMap[e]=!0,Array.isArray(t)||(r=t,t=[]);var n=a(i.Service,r||{});if("string"==typeof e){i.Service.addVersions(n,t);var o=n.serviceIdentifier||e;n.serviceIdentifier=o}else n.prototype.api=e,i.Service.defineMethods(n);if(i.SequentialExecutor.call(this.prototype),!this.prototype.publisher&&i.util.clientSideMonitoring){var s=i.util.clientSideMonitoring.Publisher,u=(0,i.util.clientSideMonitoring.configProvider)();this.prototype.publisher=new s(u),u.enabled&&(i.Service._clientSideMonitoring=!0)}return i.SequentialExecutor.call(n.prototype),i.Service.addDefaultMonitoringListeners(n.prototype),n},addVersions:function addVersions(e,t){Array.isArray(t)||(t=[t]),e.services=e.services||{};for(var r=0;r{var n=r(9614),i=r(5456);n.util.update(n.STS.prototype,{credentialsFrom:function credentialsFrom(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 assumeRoleWithWebIdentity(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithWebIdentity",e,t)},assumeRoleWithSAML:function assumeRoleWithSAML(e,t){return this.makeUnauthenticatedRequest("assumeRoleWithSAML",e,t)},setupRequestListeners:function setupRequestListeners(e){e.addListener("validate",this.optInRegionalEndpoint,!0)},optInRegionalEndpoint:function optInRegionalEndpoint(e){var t=e.service,r=t.config;if(r.stsRegionalEndpoints=i(t._originalConfig,{env:"AWS_STS_REGIONAL_ENDPOINTS",sharedConfig:"sts_regional_endpoints",clientConfig:"stsRegionalEndpoints"}),"regional"===r.stsRegionalEndpoints&&t.isGlobalEndpoint){if(!r.region)throw n.util.error(new Error,{code:"ConfigError",message:"Missing region in config"});var o=r.endpoint.indexOf(".amazonaws.com"),s=r.endpoint.substring(0,o)+"."+r.region+r.endpoint.substring(o);e.httpRequest.updateEndpoint(s),e.httpRequest.region=r.region}}})},9688:(e,t,r)=>{var n=r(9614),i=n.util.inherit,o="presigned-expires";function signedUrlBuilder(e){var t=e.httpRequest.headers[o],r=e.service.getSignerClass(e);if(delete e.httpRequest.headers["User-Agent"],delete e.httpRequest.headers["X-Amz-User-Agent"],r===n.Signers.V4){if(t>604800){throw n.util.error(new Error,{code:"InvalidExpiryTime",message:"Presigning does not support expiry time greater than a week with SigV4 signing.",retryable:!1})}e.httpRequest.headers[o]=t}else{if(r!==n.Signers.S3)throw n.util.error(new Error,{message:"Presigning only supports S3 or SigV4 signing.",code:"UnsupportedSigner",retryable:!1});var i=e.service?e.service.getSkewCorrectedDate():n.util.date.getDate();e.httpRequest.headers[o]=parseInt(n.util.date.unixTimestamp(i)+t,10).toString()}}function signedUrlSigner(e){var t=e.httpRequest.endpoint,r=n.util.urlParse(e.httpRequest.path),i={};r.search&&(i=n.util.queryStringParse(r.search.substr(1)));var s=e.httpRequest.headers.Authorization.split(" ");if("AWS"===s[0])s=s[1].split(":"),i.Signature=s.pop(),i.AWSAccessKeyId=s.join(":"),n.util.each(e.httpRequest.headers,(function(e,t){e===o&&(e="Expires"),0===e.indexOf("x-amz-meta-")&&(delete i[e],e=e.toLowerCase()),i[e]=t})),delete e.httpRequest.headers[o],delete i.Authorization,delete i.Host;else if("AWS4-HMAC-SHA256"===s[0]){s.shift();var a=s.join(" ").match(/Signature=(.*?)(?:,|\s|\r?\n|$)/)[1];i["X-Amz-Signature"]=a,delete i.Expires}t.pathname=r.pathname,t.search=n.util.queryParamsToString(i)}n.Signers.Presign=i({sign:function sign(e,t,r){if(e.httpRequest.headers[o]=t||3600,e.on("build",signedUrlBuilder),e.on("sign",signedUrlSigner),e.removeListener("afterBuild",n.EventListeners.Core.SET_CONTENT_LENGTH),e.removeListener("afterBuild",n.EventListeners.Core.COMPUTE_SHA256),e.emit("beforePresign",[e]),!r){if(e.build(),e.response.error)throw e.response.error;return n.util.urlFormat(e.httpRequest.endpoint)}e.build((function(){this.response.error?r(this.response.error):r(null,n.util.urlFormat(e.httpRequest.endpoint))}))}}),e.exports=n.Signers.Presign},2604:(e,t,r)=>{var n=r(9614),i=n.util.inherit;n.Signers.RequestSigner=i({constructor:function RequestSigner(e){this.request=e},setServiceClientId:function setServiceClientId(e){this.serviceClientId=e},getServiceClientId:function getServiceClientId(){return this.serviceClientId}}),n.Signers.RequestSigner.getVersion=function getVersion(e){switch(e){case"v2":return n.Signers.V2;case"v3":return n.Signers.V3;case"s3v4":case"v4":return n.Signers.V4;case"s3":return n.Signers.S3;case"v3https":return n.Signers.V3Https}throw new Error("Unknown signing version "+e)},r(7194),r(6342),r(416),r(7203),r(1190),r(9688)},1190:(e,t,r)=>{var n=r(9614),i=n.util.inherit;n.Signers.S3=i(n.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 addAuthorization(e,t){this.request.headers["presigned-expires"]||(this.request.headers["X-Amz-Date"]=n.util.date.rfc822(t)),e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken);var r=this.sign(e.secretAccessKey,this.stringToSign()),i="AWS "+e.accessKeyId+":"+r;this.request.headers.Authorization=i},stringToSign:function stringToSign(){var e=this.request,t=[];t.push(e.method),t.push(e.headers["Content-MD5"]||""),t.push(e.headers["Content-Type"]||""),t.push(e.headers["presigned-expires"]||"");var r=this.canonicalizedAmzHeaders();return r&&t.push(r),t.push(this.canonicalizedResource()),t.join("\n")},canonicalizedAmzHeaders:function canonicalizedAmzHeaders(){var e=[];n.util.each(this.request.headers,(function(t){t.match(/^x-amz-/i)&&e.push(t)})),e.sort((function(e,t){return e.toLowerCase(){var n=r(9614),i=n.util.inherit;n.Signers.V2=i(n.Signers.RequestSigner,{addAuthorization:function addAuthorization(e,t){t||(t=n.util.date.getDate());var r=this.request;r.params.Timestamp=n.util.date.iso8601(t),r.params.SignatureVersion="2",r.params.SignatureMethod="HmacSHA256",r.params.AWSAccessKeyId=e.accessKeyId,e.sessionToken&&(r.params.SecurityToken=e.sessionToken),delete r.params.Signature,r.params.Signature=this.signature(e),r.body=n.util.queryParamsToString(r.params),r.headers["Content-Length"]=r.body.length},signature:function signature(e){return n.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},stringToSign:function stringToSign(){var e=[];return e.push(this.request.method),e.push(this.request.endpoint.host.toLowerCase()),e.push(this.request.pathname()),e.push(n.util.queryParamsToString(this.request.params)),e.join("\n")}}),e.exports=n.Signers.V2},6342:(e,t,r)=>{var n=r(9614),i=n.util.inherit;n.Signers.V3=i(n.Signers.RequestSigner,{addAuthorization:function addAuthorization(e,t){var r=n.util.date.rfc822(t);this.request.headers["X-Amz-Date"]=r,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken),this.request.headers["X-Amzn-Authorization"]=this.authorization(e,r)},authorization:function authorization(e){return"AWS3 AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,SignedHeaders="+this.signedHeaders()+",Signature="+this.signature(e)},signedHeaders:function signedHeaders(){var e=[];return n.util.arrayEach(this.headersToSign(),(function iterator(t){e.push(t.toLowerCase())})),e.sort().join(";")},canonicalHeaders:function canonicalHeaders(){var e=this.request.headers,t=[];return n.util.arrayEach(this.headersToSign(),(function iterator(r){t.push(r.toLowerCase().trim()+":"+String(e[r]).trim())})),t.sort().join("\n")+"\n"},headersToSign:function headersToSign(){var e=[];return n.util.each(this.request.headers,(function iterator(t){("Host"===t||"Content-Encoding"===t||t.match(/^X-Amz/i))&&e.push(t)})),e},signature:function signature(e){return n.util.crypto.hmac(e.secretAccessKey,this.stringToSign(),"base64")},stringToSign:function stringToSign(){var e=[];return e.push(this.request.method),e.push("/"),e.push(""),e.push(this.canonicalHeaders()),e.push(this.request.body),n.util.crypto.sha256(e.join("\n"))}}),e.exports=n.Signers.V3},416:(e,t,r)=>{var n=r(9614),i=n.util.inherit;r(6342),n.Signers.V3Https=i(n.Signers.V3,{authorization:function authorization(e){return"AWS3-HTTPS AWSAccessKeyId="+e.accessKeyId+",Algorithm=HmacSHA256,Signature="+this.signature(e)},stringToSign:function stringToSign(){return this.request.headers["X-Amz-Date"]}}),e.exports=n.Signers.V3Https},7203:(e,t,r)=>{var n=r(9614),i=r(6914),o=n.util.inherit,s="presigned-expires";n.Signers.V4=o(n.Signers.RequestSigner,{constructor:function V4(e,t,r){n.Signers.RequestSigner.call(this,e),this.serviceName=t,r=r||{},this.signatureCache="boolean"!=typeof r.signatureCache||r.signatureCache,this.operation=r.operation,this.signatureVersion=r.signatureVersion},algorithm:"AWS4-HMAC-SHA256",addAuthorization:function addAuthorization(e,t){var r=n.util.date.iso8601(t).replace(/[:\-]|\.\d{3}/g,"");this.isPresigned()?this.updateForPresigned(e,r):this.addHeaders(e,r),this.request.headers.Authorization=this.authorization(e,r)},addHeaders:function addHeaders(e,t){this.request.headers["X-Amz-Date"]=t,e.sessionToken&&(this.request.headers["x-amz-security-token"]=e.sessionToken)},updateForPresigned:function updateForPresigned(e,t){var r=this.credentialString(t),i={"X-Amz-Date":t,"X-Amz-Algorithm":this.algorithm,"X-Amz-Credential":e.accessKeyId+"/"+r,"X-Amz-Expires":this.request.headers[s],"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"]),n.util.each.call(this,this.request.headers,(function(e,t){if(e!==s&&this.isSignableHeader(e)){var r=e.toLowerCase();0===r.indexOf("x-amz-meta-")?i[r]=t:0===r.indexOf("x-amz-")&&(i[e]=t)}}));var o=this.request.path.indexOf("?")>=0?"&":"?";this.request.path+=o+n.util.queryParamsToString(i)},authorization:function authorization(e,t){var r=[],n=this.credentialString(t);return r.push(this.algorithm+" Credential="+e.accessKeyId+"/"+n),r.push("SignedHeaders="+this.signedHeaders()),r.push("Signature="+this.signature(e,t)),r.join(", ")},signature:function signature(e,t){var r=i.getSigningKey(e,t.substr(0,8),this.request.region,this.serviceName,this.signatureCache);return n.util.crypto.hmac(r,this.stringToSign(t),"hex")},stringToSign:function stringToSign(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 canonicalString(){var e=[],t=this.request.pathname();return"s3"!==this.serviceName&&"s3v4"!==this.signatureVersion&&(t=n.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 canonicalHeaders(){var e=[];n.util.each.call(this,this.request.headers,(function(t,r){e.push([t,r])})),e.sort((function(e,t){return e[0].toLowerCase()-1&&!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",s,"expect","x-amzn-trace-id"],isSignableHeader:function isSignableHeader(e){return 0===e.toLowerCase().indexOf("x-amz-")||this.unsignableHeaders.indexOf(e)<0},isPresigned:function isPresigned(){return!!this.request.headers[s]}}),e.exports=n.Signers.V4},6914:(e,t,r)=>{var n=r(9614),i={},o=[],s="aws4_request";e.exports={createScope:function createScope(e,t,r){return[e.substr(0,8),t,r,s].join("/")},getSigningKey:function getSigningKey(e,t,r,a,u){var c=[n.util.crypto.hmac(e.secretAccessKey,e.accessKeyId,"base64"),t,r,a].join("_");if((u=!1!==u)&&c in i)return i[c];var l=n.util.crypto.hmac("AWS4"+e.secretAccessKey,t,"buffer"),p=n.util.crypto.hmac(l,r,"buffer"),f=n.util.crypto.hmac(p,a,"buffer"),h=n.util.crypto.hmac(f,s,"buffer");return u&&(i[c]=h,o.push(c),o.length>50&&delete i[o.shift()]),h},emptyCache:function emptyCache(){i={},o=[]}}},1793:e=>{function AcceptorStateMachine(e,t){this.currentState=t||null,this.states=e||{}}AcceptorStateMachine.prototype.runTo=function runTo(e,t,r,n){"function"==typeof e&&(n=r,r=t,t=e,e=null);var i=this,o=i.states[i.currentState];o.fn.call(r||i,n,(function(n){if(n){if(!o.fail)return t?t.call(r,n):null;i.currentState=o.fail}else{if(!o.accept)return t?t.call(r):null;i.currentState=o.accept}if(i.currentState===e)return t?t.call(r,n):null;i.runTo(e,t,r,n)}))},AcceptorStateMachine.prototype.addState=function addState(e,t,r,n){return"function"==typeof t?(n=t,t=null,r=null):"function"==typeof r&&(n=r,r=null),this.currentState||(this.currentState=e),this.states[e]={accept:t,fail:r,fn:n},this},e.exports=AcceptorStateMachine},2662:(e,t,r)=>{var n,i=r(4155),o={environment:"nodejs",engine:function engine(){if(o.isBrowser()&&"undefined"!=typeof navigator)return navigator.userAgent;var engine=i.platform+"/"+i.version;return i.env.AWS_EXECUTION_ENV&&(engine+=" exec-env/"+i.env.AWS_EXECUTION_ENV),engine},userAgent:function userAgent(){var e=o.environment,t="aws-sdk-"+e+"/"+r(9614).VERSION;return"nodejs"===e&&(t+=" "+o.engine()),t},uriEscape:function uriEscape(e){var t=encodeURIComponent(e);return t=(t=t.replace(/[^A-Za-z0-9_.~\-%]+/g,escape)).replace(/[*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))},uriEscapePath:function uriEscapePath(e){var t=[];return o.arrayEach(e.split("/"),(function(e){t.push(o.uriEscape(e))})),t.join("/")},urlParse:function urlParse(e){return o.url.parse(e)},urlFormat:function urlFormat(e){return o.url.format(e)},queryStringParse:function queryStringParse(e){return o.querystring.parse(e)},queryParamsToString:function queryParamsToString(e){var t=[],r=o.uriEscape,n=Object.keys(e).sort();return o.arrayEach(n,(function(n){var i=e[n],s=r(n),a=s+"=";if(Array.isArray(i)){var u=[];o.arrayEach(i,(function(e){u.push(r(e))})),a=s+"="+u.sort().join("&"+s+"=")}else null!=i&&(a=s+"="+r(i));t.push(a)})),t.join("&")},readFileSync:function readFileSync(e){return o.isBrowser()?null:r(8022).readFileSync(e,"utf-8")},base64:{encode:function encode64(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 decode64(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,r){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,r);var n=new o.Buffer(e);return void 0!==t&&"function"==typeof n.fill&&n.fill(t,void 0,void 0,r),n},toStream:function toStream(e){o.Buffer.isBuffer(e)||(e=o.buffer.toBuffer(e));var t=new o.stream.Readable,r=0;return t._read=function(n){if(r>=e.length)return t.push(null);var i=r+n;i>e.length&&(i=e.length),t.push(e.slice(r,i)),r=i},t},concat:function(e){var t,r,n=0,i=0;for(r=0;r>>8^t[255&(r^e.readUInt8(n))]}return(-1^r)>>>0},hmac:function hmac(e,t,r,n){return r||(r="binary"),"buffer"===r&&(r=void 0),n||(n="sha256"),"string"==typeof t&&(t=o.buffer.toBuffer(t)),o.crypto.lib.createHmac(n,e).update(t).digest(r)},md5:function md5(e,t,r){return o.crypto.hash("md5",e,t,r)},sha256:function sha256(e,t,r){return o.crypto.hash("sha256",e,t,r)},hash:function(e,t,r,n){var i=o.crypto.createHash(e);r||(r="binary"),"buffer"===r&&(r=void 0),"string"==typeof t&&(t=o.buffer.toBuffer(t));var s=o.arraySliceFn(t),a=o.Buffer.isBuffer(t);if(o.isBrowser()&&"undefined"!=typeof ArrayBuffer&&t&&t.buffer instanceof ArrayBuffer&&(a=!0),n&&"object"==typeof t&&"function"==typeof t.on&&!a)t.on("data",(function(e){i.update(e)})),t.on("error",(function(e){n(e)})),t.on("end",(function(){n(null,i.digest(r))}));else{if(!n||!s||a||"undefined"==typeof FileReader){o.isBrowser()&&"object"==typeof t&&!a&&(t=new o.Buffer(new Uint8Array(t)));var u=i.update(t).digest(r);return n&&n(null,u),u}var c=0,l=new FileReader;l.onerror=function(){n(new Error("Failed to read data."))},l.onload=function(){var e=new o.Buffer(new Uint8Array(l.result));i.update(e),c+=e.length,l._continueReading()},l._continueReading=function(){if(c>=t.size)n(null,i.digest(r));else{var e=c+524288;e>t.size&&(e=t.size),l.readAsArrayBuffer(s.call(t,c,e))}},l._continueReading()}},toHex:function toHex(e){for(var t=[],r=0;r=3e5,!1),n.config.isClockSkewed},applyClockOffset:function applyClockOffset(e){e&&(n.config.systemClockOffset=e-(new Date).getTime())},extractRequestId:function extractRequestId(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 addPromises(e,t){var r=!1;void 0===t&&n&&n.config&&(t=n.config.getPromisesDependency()),void 0===t&&"undefined"!=typeof Promise&&(t=Promise),"function"!=typeof t&&(r=!0),Array.isArray(e)||(e=[e]);for(var i=0;i=0)return a++,void setTimeout(sendRequest,i+(e.retryAfter||0))}r(e)},sendRequest=function(){var t="";i.handleRequest(e,s,(function(e){e.on("data",(function(e){t+=e.toString()})),e.on("end",(function(){var n=e.statusCode;if(n<300)r(null,t);else{var i=1e3*parseInt(e.headers["retry-after"],10)||0,s=o.error(new Error,{statusCode:n,retryable:n>=500||429===n});i&&s.retryable&&(s.retryAfter=i),errCallback(s)}}))}),errCallback)};n.util.defer(sendRequest)},uuid:{v4:function uuidV4(){return r(8122).v4()}},convertPayloadToString:function convertPayloadToString(e){var t=e.request,r=t.operation,n=t.service.api.operations[r].output||{};n.payload&&e.data[n.payload]&&(e.data[n.payload]=e.data[n.payload].toString())},defer:function defer(e){"object"==typeof i&&"function"==typeof i.nextTick?i.nextTick(e):"function"==typeof setImmediate?setImmediate(e):setTimeout(e,0)},getRequestPayloadShape:function getRequestPayloadShape(e){var t=e.service.api.operations;if(t){var r=(t||{})[e.operation];if(r&&r.input&&r.input.payload)return r.input.members[r.input.payload]}},getProfilesFromSharedConfig:function getProfilesFromSharedConfig(e,t){var r={},n={};if(i.env[o.configOptInEnv])n=e.loadFrom({isConfig:!0,filename:i.env[o.sharedConfigFileEnv]});var s={};try{s=e.loadFrom({filename:t||i.env[o.configOptInEnv]&&i.env[o.sharedCredentialsFileEnv]})}catch(e){if(!i.env[o.configOptInEnv])throw e}for(var a=0,u=Object.keys(n);a=6},parse:function parseARN(e){var t=e.split(":");return{partition:t[1],service:t[2],region:t[3],accountId:t[4],resource:t.slice(5).join(":")}},build:function buildARN(e){if(void 0===e.service||void 0===e.region||void 0===e.accountId||void 0===e.resource)throw o.error(new Error("Input ARN object is invalid"));return"arn:"+(e.partition||"aws")+":"+e.service+":"+e.region+":"+e.accountId+":"+e.resource}},defaultProfile:"default",configOptInEnv:"AWS_SDK_LOAD_CONFIG",sharedCredentialsFileEnv:"AWS_SHARED_CREDENTIALS_FILE",sharedConfigFileEnv:"AWS_CONFIG_FILE",imdsDisabledEnv:"AWS_EC2_METADATA_DISABLED"};e.exports=o},5106:(e,t,r)=>{var n=r(2662),i=r(8136);function DomXmlParser(){}function getElementByTagName(e,t){for(var r=e.getElementsByTagName(t),n=0,i=r.length;n{var n=r(2662),i=r(8700).XmlNode,o=r(5009).XmlText;function XmlBuilder(){}function serialize(e,t,r){switch(r.type){case"structure":return function serializeStructure(e,t,r){n.arrayEach(r.memberNames,(function(n){var o=r.members[n];if("body"===o.location){var s=t[n],a=o.name;if(null!=s)if(o.isXmlAttribute)e.addAttribute(a,s);else if(o.flattened)serialize(e,s,o);else{var u=new i(a);e.addChildNode(u),applyNamespaces(u,o),serialize(u,s,o)}}}))}(e,t,r);case"map":return function serializeMap(e,t,r){var o=r.key.name||"key",s=r.value.name||"value";n.each(t,(function(t,n){var a=new i(r.flattened?r.name:"entry");e.addChildNode(a);var u=new i(o),c=new i(s);a.addChildNode(u),a.addChildNode(c),serialize(u,t,r.key),serialize(c,n,r.value)}))}(e,t,r);case"list":return function serializeList(e,t,r){r.flattened?n.arrayEach(t,(function(t){var n=r.member.name||r.name,o=new i(n);e.addChildNode(o),serialize(o,t,r.member)})):n.arrayEach(t,(function(t){var n=r.member.name||"member",o=new i(n);e.addChildNode(o),serialize(o,t,r.member)}))}(e,t,r);default:return function serializeScalar(e,t,r){e.addChildNode(new o(r.toWireFormat(t)))}(e,t,r)}}function applyNamespaces(e,t,r){var n,i="xmlns";t.xmlNamespaceUri?(n=t.xmlNamespaceUri,t.xmlNamespacePrefix&&(i+=":"+t.xmlNamespacePrefix)):r&&t.api.xmlNamespaceUri&&(n=t.api.xmlNamespaceUri),n&&e.addAttribute(i,n)}XmlBuilder.prototype.toXML=function(e,t,r,n){var o=new i(r);return applyNamespaces(o,t,!0),serialize(o,e,t),o.children.length>0||n?o.toString():""},e.exports=XmlBuilder},5373:e=>{e.exports={escapeAttribute:function escapeAttribute(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(//g,">").replace(/"/g,""")}}},5077:e=>{e.exports={escapeElement:function escapeElement(e){return e.replace(/&/g,"&").replace(//g,">").replace(/\r/g," ").replace(/\n/g," ").replace(/\u0085/g,"…").replace(/\u2028/,"
")}}},8700:(e,t,r)=>{var n=r(5373).escapeAttribute;function XmlNode(e,t){void 0===t&&(t=[]),this.name=e,this.children=t,this.attributes={}}XmlNode.prototype.addAttribute=function(e,t){return this.attributes[e]=t,this},XmlNode.prototype.addChildNode=function(e){return this.children.push(e),this},XmlNode.prototype.removeAttribute=function(e){return delete this.attributes[e],this},XmlNode.prototype.toString=function(){for(var e=Boolean(this.children.length),t="<"+this.name,r=this.attributes,i=0,o=Object.keys(r);i"+this.children.map((function(e){return e.toString()})).join("")+"":"/>")},e.exports={XmlNode}},5009:(e,t,r)=>{var n=r(5077).escapeElement;function XmlText(e){this.value=e}XmlText.prototype.toString=function(){return n(""+this.value)},e.exports={XmlText}},8122:(e,t,r)=>{var n=r(6367),i=r(1846),o=i;o.v1=n,o.v4=i,e.exports=o},8367:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function bytesToUuid(e,r){var n=r||0,i=t;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("")}},8390:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function whatwgRNG(){return t(r),r}}else{var n=new Array(16);e.exports=function mathRNG(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},6367:(e,t,r)=>{var n,i,o=r(8390),s=r(8367),a=0,u=0;e.exports=function v1(e,t,r){var c=t&&r||0,l=t||[],p=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:i;if(null==p||null==f){var h=o();null==p&&(p=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==f&&(f=i=16383&(h[6]<<8|h[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,y=d-a+(m-u)/1e4;if(y<0&&void 0===e.clockseq&&(f=f+1&16383),(y<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,u=m,i=f;var v=(1e4*(268435455&(d+=122192928e5))+m)%4294967296;l[c++]=v>>>24&255,l[c++]=v>>>16&255,l[c++]=v>>>8&255,l[c++]=255&v;var b=d/4294967296*1e4&268435455;l[c++]=b>>>8&255,l[c++]=255&b,l[c++]=b>>>24&15|16,l[c++]=b>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var S=0;S<6;++S)l[c+S]=p[S];return t||s(l)}},1846:(e,t,r)=>{var n=r(8390),i=r(8367);e.exports=function v4(e,t,r){var o=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();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)}},5101:(e,t,r)=>{"use strict";var n=r(9697),i=function(){function EndpointCache(e){void 0===e&&(e=1e3),this.maxSize=e,this.cache=new n.LRUCache(e)}return Object.defineProperty(EndpointCache.prototype,"size",{get:function(){return this.cache.length},enumerable:!0,configurable:!0}),EndpointCache.prototype.put=function(e,t){var r="string"!=typeof e?EndpointCache.getKeyString(e):e,n=this.populateValue(t);this.cache.put(r,n)},EndpointCache.prototype.get=function(e){var t="string"!=typeof e?EndpointCache.getKeyString(e):e,r=Date.now(),n=this.cache.get(t);if(n){for(var i=n.length-1;i>=0;i--){n[i].Expire{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function r(e,t){this.key=e,this.value=t},n=function(){function LRUCache(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(LRUCache.prototype,"length",{get:function(){return this.size},enumerable:!0,configurable:!0}),LRUCache.prototype.prependToList=function(e){this.headerNode?(this.headerNode.prev=e,e.next=this.headerNode):this.tailNode=e,this.headerNode=e,this.size++},LRUCache.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}},LRUCache.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--},LRUCache.prototype.get=function(e){if(this.nodeMap[e]){var t=this.nodeMap[e];return this.detachFromList(t),this.prependToList(t),t.value}},LRUCache.prototype.remove=function(e){if(this.nodeMap[e]){var t=this.nodeMap[e];this.detachFromList(t),delete this.nodeMap[e]}},LRUCache.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)},LRUCache.prototype.empty=function(){for(var e=Object.keys(this.nodeMap),t=0;t{"use strict";t.byteLength=function byteLength(e){var t=getLens(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function toByteArray(e){var t,r,o=getLens(e),s=o[0],a=o[1],u=new i(function _byteLength(e,t,r){return 3*(t+r)/4-r}(0,s,a)),c=0,l=a>0?s-4:s;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t);1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t);return u},t.fromByteArray=function fromByteArray(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function encodeChunk(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(e,t,r)=>{"use strict";var n=r(9742),i=r(645),o=r(5826);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),n=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function read(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,p=0;pi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(p=l);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)>127&&(p=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&l)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(p=c);break;case 4:o=e[i+1],a=e[i+2],u=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&u)&&(c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&c<1114112&&(p=c)}null===p?(p=65533,f=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),i+=f}return function decodeCodePointsArray(e){var t=e.length;if(t<=s)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},Buffer.prototype.compare=function compare(e,t,r,n,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),l=0;li)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var s=4096;function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,i,o){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function objectWriteUInt32(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,o){return o||checkIEEE754(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,o){return o||checkIEEE754(e,0,r,8),i.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},Buffer.prototype.readUInt8=function readUInt8(e,t){return t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e|=0,t|=0,r||checkOffset(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},Buffer.prototype.readInt8=function readInt8(e,t){return t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return t||checkOffset(e,4,this.length),i.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return t||checkOffset(e,8,this.length),i.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){(e=+e,t|=0,r|=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,255,0),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var o=r-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+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t|=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function base64ToBytes(e){return n.toByteArray(function base64clean(e){if((e=function stringtrim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(a,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function blitBuffer(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),o=i(n("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function callBind(e){var t=a(n,s,arguments);if(u&&c){var r=u(t,"length");r.configurable&&c(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var p=function applyBind(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:p}):e.exports.apply=p},7187:e=>{function EventEmitter(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function isFunction(e){return"function"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isUndefined(e){return void 0===e}e.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.prototype.setMaxListeners=function(e){if(!function isNumber(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},EventEmitter.prototype.emit=function(e){var t,r,n,i,o,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||isObject(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var a=new Error('Uncaught, unspecified "error" event. ('+t+")");throw a.context=t,a}if(isUndefined(r=this._events[e]))return!1;if(isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(isObject(r))for(i=Array.prototype.slice.call(arguments,1),n=(s=r.slice()).length,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.once=function(e,t){if(!isFunction(t))throw TypeError("listener must be a function");var r=!1;function g(){this.removeListener(e,g),r||(r=!0,t.apply(this,arguments))}return g.listener=t,this.on(e,g),this},EventEmitter.prototype.removeListener=function(e,t){var r,n,i,o;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,n=-1,r===t||isFunction(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(isObject(r)){for(o=i;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){n=o;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},EventEmitter.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(isFunction(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},EventEmitter.prototype.listeners=function(e){return this._events&&this._events[e]?isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},EventEmitter.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(isFunction(t))return 1;if(t)return t.length}return 0},EventEmitter.listenerCount=function(e,t){return e.listenerCount(t)}},9804:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function forEach(e,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var s=0;s{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function bind(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),binder=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},u=Math.max(0,o.length-a.length),c=[],l=0;l{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,getEvalledConstructor=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},a=Object.getOwnPropertyDescriptor;if(a)try{a({},"")}catch(e){a=null}var throwTypeError=function(){throw new s},u=a?function(){try{return throwTypeError}catch(e){try{return a(arguments,"callee").get}catch(e){return throwTypeError}}}():throwTypeError,c=r(1405)(),l=Object.getPrototypeOf||function(e){return e.__proto__},p={},f="undefined"==typeof Uint8Array?n:l(Uint8Array),h={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":c?l([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c?l(l([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c?l((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c?l((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c?l(""[Symbol.iterator]()):n,"%Symbol%":c?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":f,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},d=function doEval(e){var t;if("%AsyncFunction%"===e)t=getEvalledConstructor("async function () {}");else if("%GeneratorFunction%"===e)t=getEvalledConstructor("function* () {}");else if("%AsyncGeneratorFunction%"===e)t=getEvalledConstructor("async function* () {}");else if("%AsyncGenerator%"===e){var r=doEval("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if("%AsyncIteratorPrototype%"===e){var n=doEval("%AsyncGenerator%");n&&(t=l(n.prototype))}return h[e]=t,t},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},y=r(8612),v=r(7642),b=y.call(Function.call,Array.prototype.concat),S=y.call(Function.apply,Array.prototype.splice),E=y.call(Function.call,String.prototype.replace),w=y.call(Function.call,String.prototype.slice),A=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,_=function stringToPath(e){var t=w(e,0,1),r=w(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,A,(function(e,t,r,i){n[n.length]=r?E(i,C,"$1"):t||e})),n},R=function getBaseIntrinsic(e,t){var r,n=e;if(v(m,n)&&(n="%"+(r=m[n])[0]+"%"),v(h,n)){var o=h[n];if(o===p&&(o=d(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');var r=_(e),n=r.length>0?r[0]:"",o=R("%"+n+"%",t),u=o.name,c=o.value,l=!1,p=o.alias;p&&(n=p[0],S(r,b([0,1],p)));for(var f=1,d=!0;f=r.length){var A=a(c,m);c=(d=!!A)&&"get"in A&&!("originalValue"in A.get)?A.get:c[m]}else d=v(c,m),c=c[m];d&&!l&&(h[u]=c)}}return c}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function hasNativeSymbols(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},5419:e=>{"use strict";e.exports=function hasSymbols(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6410:(e,t,r)=>{"use strict";var n=r(5419);e.exports=function hasToStringTagShams(){return n()&&!!Symbol.toStringTag}},7642:(e,t,r)=>{"use strict";var n=r(8612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,p=r?i-1:0,f=r?-1:1,h=e[t+p];for(p+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+p],p+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+p],p+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=c}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+p>=1?f/u:f*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=l?(a=0,s=l):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=d,a/=256,i-=8);for(s=s<0;e[r+h]=255&s,h+=d,s/=256,c-=8);e[r+h-d]|=128*m}},5717:e=>{"function"==typeof Object.create?e.exports=function inherits(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype,e.prototype=new TempCtor,e.prototype.constructor=e}}},2584:(e,t,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function isArguments(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function isArguments(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},8662:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;e.exports=function isGeneratorFunction(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!u)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&u(t)}return u(e)===n}},5692:(e,t,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("Array.prototype.indexOf",!0)||function indexOf(e,t){for(var r=0;r-1}return!!h&&function tryAllTypedArrays(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5826:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},4509:(e,t)=>{!function(e){"use strict";function isArray(e){return null!==e&&"[object Array]"===Object.prototype.toString.call(e)}function isObject(e){return null!==e&&"[object Object]"===Object.prototype.toString.call(e)}function strictDeepEqual(e,t){if(e===t)return!0;if(Object.prototype.toString.call(e)!==Object.prototype.toString.call(t))return!1;if(!0===isArray(e)){if(e.length!==t.length)return!1;for(var r=0;r":!0,"=":!0,"!":!0},B={" ":!0,"\t":!0,"\n":!0};function isNum(e){return e>="0"&&e<="9"||"-"===e}function Lexer(){}Lexer.prototype={tokenize:function(e){var t,r,n,i,a=[];for(this._current=0;this._current="a"&&i<="z"||i>="A"&&i<="Z"||"_"===i)t=this._current,r=this._consumeUnquotedIdentifier(e),a.push({type:o,value:r,start:t});else if(void 0!==N[e[this._current]])a.push({type:N[e[this._current]],value:e[this._current],start:this._current}),this._current++;else if(isNum(e[this._current]))n=this._consumeNumber(e),a.push(n);else if("["===e[this._current])n=this._consumeLBracket(e),a.push(n);else if('"'===e[this._current])t=this._current,r=this._consumeQuotedIdentifier(e),a.push({type:s,value:r,start:t});else if("'"===e[this._current])t=this._current,r=this._consumeRawStringLiteral(e),a.push({type:L,value:r,start:t});else if("`"===e[this._current]){t=this._current;var u=this._consumeLiteral(e);a.push({type:L,value:u,start:t})}else if(void 0!==U[e[this._current]])a.push(this._consumeOperator(e));else if(void 0!==B[e[this._current]])this._current++;else if("&"===e[this._current])t=this._current,this._current++,"&"===e[this._current]?(this._current++,a.push({type:v,value:"&&",start:t})):a.push({type:d,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++,a.push({type:y,value:"||",start:t})):a.push({type:m,value:"|",start:t})}return a},_consumeUnquotedIdentifier:function(e){var t,r=this._current;for(this._current++;this._current="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||"_"===t);)this._current++;return e.slice(r,this._current)},_consumeQuotedIdentifier:function(e){var t=this._current;this._current++;for(var r=e.length;'"'!==e[this._current]&&this._current"===r?"="===e[this._current]?(this._current++,{type:w,value:">=",start:t}):{type:S,value:">",start:t}:"="===r&&"="===e[this._current]?(this._current++,{type:b,value:"==",start:t}):void 0},_consumeLiteral:function(e){this._current++;for(var r,n=this._current,i=e.length;"`"!==e[this._current]&&this._current=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 q={};function Parser(){}function TreeInterpreter(e){this.runtime=e}function Runtime(e){this._interpreter=e,this.functionTable={abs:{_func:this._functionAbs,_signature:[{types:[r]}]},avg:{_func:this._functionAvg,_signature:[{types:[8]}]},ceil:{_func:this._functionCeil,_signature:[{types:[r]}]},contains:{_func:this._functionContains,_signature:[{types:[n,3]},{types:[1]}]},ends_with:{_func:this._functionEndsWith,_signature:[{types:[n]},{types:[n]}]},floor:{_func:this._functionFloor,_signature:[{types:[r]}]},length:{_func:this._functionLength,_signature:[{types:[n,3,4]}]},map:{_func:this._functionMap,_signature:[{types:[6]},{types:[3]}]},max:{_func:this._functionMax,_signature:[{types:[8,9]}]},merge:{_func:this._functionMerge,_signature:[{types:[4],variadic:!0}]},max_by:{_func:this._functionMaxBy,_signature:[{types:[3]},{types:[6]}]},sum:{_func:this._functionSum,_signature:[{types:[8]}]},starts_with:{_func:this._functionStartsWith,_signature:[{types:[n]},{types:[n]}]},min:{_func:this._functionMin,_signature:[{types:[8,9]}]},min_by:{_func:this._functionMinBy,_signature:[{types:[3]},{types:[6]}]},type:{_func:this._functionType,_signature:[{types:[1]}]},keys:{_func:this._functionKeys,_signature:[{types:[4]}]},values:{_func:this._functionValues,_signature:[{types:[4]}]},sort:{_func:this._functionSort,_signature:[{types:[9,8]}]},sort_by:{_func:this._functionSortBy,_signature:[{types:[3]},{types:[6]}]},join:{_func:this._functionJoin,_signature:[{types:[n]},{types:[9]}]},reverse:{_func:this._functionReverse,_signature:[{types:[n,3]}]},to_array:{_func:this._functionToArray,_signature:[{types:[1]}]},to_string:{_func:this._functionToString,_signature:[{types:[1]}]},to_number:{_func:this._functionToNumber,_signature:[{types:[1]}]},not_null:{_func:this._functionNotNull,_signature:[{types:[1],variadic:!0}]}}}q.EOF=0,q.UnquotedIdentifier=0,q.QuotedIdentifier=0,q.Rbracket=0,q.Rparen=0,q.Comma=0,q.Rbrace=0,q.Number=0,q.Current=0,q.Expref=0,q.Pipe=1,q.Or=2,q.And=3,q.EQ=5,q.GT=5,q.LT=5,q.GTE=5,q.LTE=5,q.NE=5,q.Flatten=9,q.Star=20,q.Filter=21,q.Dot=40,q.Not=45,q.Lbrace=50,q.Lbracket=55,q.Lparen=60,Parser.prototype={parse:function(e){this._loadTokens(e),this.index=0;var t=this.expression(0);if(this._lookahead(0)!==i){var r=this._lookaheadToken(0),n=new Error("Unexpected token type: "+r.type+", value: "+r.value);throw n.name="ParserError",n}return t},_loadTokens:function(e){var t=(new Lexer).tokenize(e);t.push({type:i,value:"",start:e.length}),this.tokens=t},expression:function(e){var t=this._lookaheadToken(0);this._advance();for(var r=this.nud(t),n=this._lookahead(0);e=0?this.expression(e):t===P?(this._match(P),this._parseMultiselectList()):t===k?(this._match(k),this._parseMultiselectHash()):void 0},_parseProjectionRHS:function(e){var t;if(q[this._lookahead(0)]<10)t={type:"Identity"};else if(this._lookahead(0)===P)t=this.expression(e);else if(this._lookahead(0)===I)t=this.expression(e);else{if(this._lookahead(0)!==x){var r=this._lookaheadToken(0),n=new Error("Sytanx error, unexpected token: "+r.value+"("+r.type+")");throw n.name="ParserError",n}this._match(x),t=this._parseDotRHS(e)}return t},_parseMultiselectList:function(){for(var e=[];this._lookahead(0)!==a;){var t=this.expression(0);if(e.push(t),this._lookahead(0)===c&&(this._match(c),this._lookahead(0)===a))throw new Error("Unexpected token Rbracket")}return this._match(a),{type:"MultiSelectList",children:e}},_parseMultiselectHash:function(){for(var e,t,r,n=[],i=[o,s];;){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(l),r={type:"KeyValuePair",name:t,value:this.expression(0)},n.push(r),this._lookahead(0)===c)this._match(c);else if(this._lookahead(0)===p){this._match(p);break}}return{type:"MultiSelectHash",children:n}}},TreeInterpreter.prototype={search:function(e,t){return this.visit(e,t)},visit:function(e,t){var r,n,i,o,s,a,u,c,l;switch(e.type){case"Field":return null===t?null:isObject(t)?void 0===(a=t[e.name])?null:a:null;case"Subexpression":for(i=this.visit(e.children[0],t),l=1;l0)for(l=v;lR;l+=I)i.push(t[l]);return i;case"Projection":var x=this.visit(e.children[0],t);if(!isArray(x))return null;for(c=[],l=0;ls;break;case w:i=o>=s;break;case E:i=o=e&&(t=r<0?e-1:e),t}},Runtime.prototype={callFunction:function(e,t){var r=this.functionTable[e];if(void 0===r)throw new Error("Unknown function: "+e+"()");return this._validateArgs(e,t,r._signature),r._func.call(this,t)},_validateArgs:function(e,t,r){var n,i,o,s;if(r[r.length-1].variadic){if(t.length=0;i--)r+=t[i];return r}var o=e[0].slice(0);return o.reverse(),o},_functionAbs:function(e){return Math.abs(e[0])},_functionCeil:function(e){return Math.ceil(e[0])},_functionAvg:function(e){for(var t=0,r=e[0],n=0;n=0},_functionFloor:function(e){return Math.floor(e[0])},_functionLength:function(e){return isObject(e[0])?Object.keys(e[0]).length:e[0].length},_functionMap:function(e){for(var t=[],r=this._interpreter,n=e[0],i=e[1],o=0;o0){if(this._getTypeName(e[0][0])===r)return Math.max.apply(Math,e[0]);for(var t=e[0],n=t[0],i=1;i0){if(this._getTypeName(e[0][0])===r)return Math.min.apply(Math,e[0]);for(var t=e[0],n=t[0],i=1;in?1:ru&&(u=i,t=s[c]);return t},_functionMinBy:function(e){for(var t,i,o=e[1],s=e[0],a=this.createKeyFunction(o,[r,n]),u=1/0,c=0;c{var t,r,n=e.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{r="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){r=defaultClearTimeout}}();var i,o=[],s=!1,a=-1;function cleanUpNextTick(){s&&i&&(s=!1,i.length?o=i.concat(o):a=-1,o.length&&drainQueue())}function drainQueue(){if(!s){var e=runTimeout(cleanUpNextTick);s=!0;for(var t=o.length;t;){for(i=o,o=[];++a1)for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function error(e){throw RangeError(f[e])}function map(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function mapDomain(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+map((e=e.replace(p,".")).split("."),t).join(".")}function ucs2decode(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=d(e)})).join("")}function digitToBasic(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function adapt(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=u)e=h(e/35);return h(n+36*e/(e+38))}function decode(e){var t,r,n,i,o,s,c,l,p,f,d,m=[],y=e.length,v=0,b=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&error("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=y&&error("invalid-input"),((l=(d=e.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||l>h((a-v)/s))&&error("overflow"),v+=l*s,!(l<(p=c<=S?1:c>=S+26?26:c-S));c+=u)s>h(a/(f=u-p))&&error("overflow"),s*=f;S=adapt(v-o,t=m.length+1,0==o),h(v/t)>a-b&&error("overflow"),b+=h(v/t),v%=t,m.splice(v++,0,b)}return ucs2encode(m)}function encode(e){var t,r,n,i,o,s,c,l,p,f,m,y,v,b,S,E=[];for(y=(e=ucs2decode(e)).length,t=128,r=0,o=72,s=0;s=t&&mh((a-r)/(v=n+1))&&error("overflow"),r+=(c-t)*v,t=c,s=0;sa&&error("overflow"),m==t){for(l=r,p=u;!(l<(f=p<=o?1:p>=o+26?26:p-o));p+=u)S=l-f,b=u-f,E.push(d(digitToBasic(f+S%b,0))),l=h(S/b);E.push(d(digitToBasic(l,0))),o=adapt(r,v,n==i),r=0,++n}++r,++t}return E.join("")}s={version:"1.3.2",ucs2:{decode:ucs2decode,encode:ucs2encode},decode,encode,toASCII:function toASCII(e){return mapDomain(e,(function(e){return l.test(e)?"xn--"+encode(e):e}))},toUnicode:function toUnicode(e){return mapDomain(e,(function(e){return c.test(e)?decode(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return s}.call(t,r,t,e))||(e.exports=n)}()},2587:e=>{"use strict";function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,n){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var o=/\+/g;e=e.split(t);var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=e.length;s>0&&a>s&&(a=s);for(var u=0;u=0?(c=h.substr(0,d),l=h.substr(d+1)):(c=h,l=""),p=decodeURIComponent(c),f=decodeURIComponent(l),hasOwnProperty(i,p)?Array.isArray(i[p])?i[p].push(f):i[p]=[i[p],f]:i[p]=f}return i}},2361:e=>{"use strict";var stringifyPrimitive=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,n){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(n){var i=encodeURIComponent(stringifyPrimitive(n))+r;return Array.isArray(e[n])?e[n].map((function(e){return i+encodeURIComponent(stringifyPrimitive(e))})).join(t):i+encodeURIComponent(stringifyPrimitive(e[n]))})).join(t):n?encodeURIComponent(stringifyPrimitive(n))+r+encodeURIComponent(stringifyPrimitive(e)):""}},7673:(e,t,r)=>{"use strict";t.decode=t.parse=r(2587),t.encode=t.stringify=r(2361)},655:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__extends:()=>__extends,__assign:()=>__assign,__rest:()=>__rest,__decorate:()=>__decorate,__param:()=>__param,__metadata:()=>__metadata,__awaiter:()=>__awaiter,__generator:()=>__generator,__createBinding:()=>__createBinding,__exportStar:()=>__exportStar,__values:()=>__values,__read:()=>__read,__spread:()=>__spread,__spreadArrays:()=>__spreadArrays,__await:()=>__await,__asyncGenerator:()=>__asyncGenerator,__asyncDelegator:()=>__asyncDelegator,__asyncValues:()=>__asyncValues,__makeTemplateObject:()=>__makeTemplateObject,__importStar:()=>__importStar,__importDefault:()=>__importDefault,__classPrivateFieldGet:()=>__classPrivateFieldGet,__classPrivateFieldSet:()=>__classPrivateFieldSet});var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){function __(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return __assign=Object.assign||function __assign(e){for(var t,r=1,n=arguments.length;r=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function __param(e,t){return function(r,n){t(r,n,e)}}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))}function __generator(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function verb(o){return function(a){return function step(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function __spread(){for(var e=[],t=0;t1||resume(e,t)}))})}function resume(e,t){try{!function step(e){e.value instanceof __await?Promise.resolve(e.value.v).then(fulfill,reject):settle(o[0][2],e)}(i[e](t))}catch(e){settle(o[0][3],e)}}function fulfill(e){resume("next",e)}function reject(e){resume("throw",e)}function settle(e,t){e(t),o.shift(),o.length&&resume(o[0][0],o[0][1])}}function __asyncDelegator(e){var t,r;return t={},verb("next"),verb("throw",(function(e){throw e})),verb("return"),t[Symbol.iterator]=function(){return this},t;function verb(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:__await(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function __asyncValues(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=__values(e),t={},verb("next"),verb("throw"),verb("return"),t[Symbol.asyncIterator]=function(){return this},t);function verb(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function settle(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}function __makeTemplateObject(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function __importStar(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function __importDefault(e){return e&&e.__esModule?e:{default:e}}function __classPrivateFieldGet(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function __classPrivateFieldSet(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},8575:(e,t,r)=>{var n=r(4971);function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=urlParse,t.resolve=function urlResolve(e,t){return urlParse(e,!1,!0).resolve(t)},t.resolveObject=function urlResolveObject(e,t){return e?urlParse(e,!1,!0).resolveObject(t):t},t.format=function urlFormat(e){isString(e)&&(e=urlParse(e));return e instanceof Url?e.format():Url.prototype.format.call(e)},t.Url=Url;var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),a=["'"].concat(s),u=["%","/","?",";","#"].concat(a),c=["/","?","#"],l=/^[a-z0-9A-Z_-]{0,63}$/,p=/^([a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(7673);function urlParse(e,t,r){if(e&&isObject(e)&&e instanceof Url)return e;var n=new Url;return n.parse(e,t,r),n}function isString(e){return"string"==typeof e}function isObject(e){return"object"==typeof e&&null!==e}function isNull(e){return null===e}Url.prototype.parse=function(e,t,r){if(!isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e;o=o.trim();var s=i.exec(o);if(s){var y=(s=s[0]).toLowerCase();this.protocol=y,o=o.substr(s.length)}if(r||s||o.match(/^\/\/[^@\/]+@[^@\/]+/)){var v="//"===o.substr(0,2);!v||s&&h[s]||(o=o.substr(2),this.slashes=!0)}if(!h[s]&&(v||s&&!d[s])){for(var b,S,E=-1,w=0;w127?x+="x":x+=I[T];if(!x.match(l)){var P=_.slice(0,w),O=_.slice(w+1),L=I.match(p);L&&(P.push(L[1]),O.unshift(L[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=P.join(".");break}}}if(this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),!C){var N=this.hostname.split("."),U=[];for(w=0;w0)&&r.host.split("@"))&&(r.auth=b.shift(),r.host=r.hostname=b.shift());return r.search=e.search,r.query=e.query,isNull(r.pathname)&&isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!l.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var f=l.slice(-1)[0],m=(r.host||e.host)&&("."===f||".."===f)||""===f,y=0,v=l.length;v>=0;v--)"."==(f=l[v])?l.splice(v,1):".."===f?(l.splice(v,1),y++):y&&(l.splice(v,1),y--);if(!u&&!c)for(;y--;y)l.unshift("..");!u||""===l[0]||l[0]&&"/"===l[0].charAt(0)||l.unshift(""),m&&"/"!==l.join("/").substr(-1)&&l.push("");var b,S=""===l[0]||l[0]&&"/"===l[0].charAt(0);p&&(r.hostname=r.host=S?"":l.length?l.shift():"",(b=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=b.shift(),r.host=r.hostname=b.shift()));return(u=u||r.host&&l.length)&&!S&&l.unshift(""),l.length?r.pathname=l.join("/"):(r.pathname=null,r.path=null),isNull(r.pathname)&&isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},Url.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},384:e=>{e.exports=function isBuffer(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},5955:(e,t,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function uncurryThis(e){return e.call.bind(e)}var a="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,c=uncurryThis(Object.prototype.toString),l=uncurryThis(Number.prototype.valueOf),p=uncurryThis(String.prototype.valueOf),f=uncurryThis(Boolean.prototype.valueOf);if(a)var h=uncurryThis(BigInt.prototype.valueOf);if(u)var d=uncurryThis(Symbol.prototype.valueOf);function checkBoxedPrimitive(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function isMapToString(e){return"[object Map]"===c(e)}function isSetToString(e){return"[object Set]"===c(e)}function isWeakMapToString(e){return"[object WeakMap]"===c(e)}function isWeakSetToString(e){return"[object WeakSet]"===c(e)}function isArrayBufferToString(e){return"[object ArrayBuffer]"===c(e)}function isArrayBuffer(e){return"undefined"!=typeof ArrayBuffer&&(isArrayBufferToString.working?isArrayBufferToString(e):e instanceof ArrayBuffer)}function isDataViewToString(e){return"[object DataView]"===c(e)}function isDataView(e){return"undefined"!=typeof DataView&&(isDataViewToString.working?isDataViewToString(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function isPromise(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function isArrayBufferView(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||isDataView(e)},t.isUint8Array=function isUint8Array(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function isUint8ClampedArray(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function isUint16Array(e){return"Uint16Array"===o(e)},t.isUint32Array=function isUint32Array(e){return"Uint32Array"===o(e)},t.isInt8Array=function isInt8Array(e){return"Int8Array"===o(e)},t.isInt16Array=function isInt16Array(e){return"Int16Array"===o(e)},t.isInt32Array=function isInt32Array(e){return"Int32Array"===o(e)},t.isFloat32Array=function isFloat32Array(e){return"Float32Array"===o(e)},t.isFloat64Array=function isFloat64Array(e){return"Float64Array"===o(e)},t.isBigInt64Array=function isBigInt64Array(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function isBigUint64Array(e){return"BigUint64Array"===o(e)},isMapToString.working="undefined"!=typeof Map&&isMapToString(new Map),t.isMap=function isMap(e){return"undefined"!=typeof Map&&(isMapToString.working?isMapToString(e):e instanceof Map)},isSetToString.working="undefined"!=typeof Set&&isSetToString(new Set),t.isSet=function isSet(e){return"undefined"!=typeof Set&&(isSetToString.working?isSetToString(e):e instanceof Set)},isWeakMapToString.working="undefined"!=typeof WeakMap&&isWeakMapToString(new WeakMap),t.isWeakMap=function isWeakMap(e){return"undefined"!=typeof WeakMap&&(isWeakMapToString.working?isWeakMapToString(e):e instanceof WeakMap)},isWeakSetToString.working="undefined"!=typeof WeakSet&&isWeakSetToString(new WeakSet),t.isWeakSet=function isWeakSet(e){return isWeakSetToString(e)},isArrayBufferToString.working="undefined"!=typeof ArrayBuffer&&isArrayBufferToString(new ArrayBuffer),t.isArrayBuffer=isArrayBuffer,isDataViewToString.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&isDataViewToString(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=isDataView;var m="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function isSharedArrayBufferToString(e){return"[object SharedArrayBuffer]"===c(e)}function isSharedArrayBuffer(e){return void 0!==m&&(void 0===isSharedArrayBufferToString.working&&(isSharedArrayBufferToString.working=isSharedArrayBufferToString(new m)),isSharedArrayBufferToString.working?isSharedArrayBufferToString(e):e instanceof m)}function isNumberObject(e){return checkBoxedPrimitive(e,l)}function isStringObject(e){return checkBoxedPrimitive(e,p)}function isBooleanObject(e){return checkBoxedPrimitive(e,f)}function isBigIntObject(e){return a&&checkBoxedPrimitive(e,h)}function isSymbolObject(e){return u&&checkBoxedPrimitive(e,d)}t.isSharedArrayBuffer=isSharedArrayBuffer,t.isAsyncFunction=function isAsyncFunction(e){return"[object AsyncFunction]"===c(e)},t.isMapIterator=function isMapIterator(e){return"[object Map Iterator]"===c(e)},t.isSetIterator=function isSetIterator(e){return"[object Set Iterator]"===c(e)},t.isGeneratorObject=function isGeneratorObject(e){return"[object Generator]"===c(e)},t.isWebAssemblyCompiledModule=function isWebAssemblyCompiledModule(e){return"[object WebAssembly.Module]"===c(e)},t.isNumberObject=isNumberObject,t.isStringObject=isStringObject,t.isBooleanObject=isBooleanObject,t.isBigIntObject=isBigIntObject,t.isSymbolObject=isSymbolObject,t.isBoxedPrimitive=function isBoxedPrimitive(e){return isNumberObject(e)||isStringObject(e)||isBooleanObject(e)||isBigIntObject(e)||isSymbolObject(e)},t.isAnyArrayBuffer=function isAnyArrayBuffer(e){return"undefined"!=typeof Uint8Array&&(isArrayBuffer(e)||isSharedArrayBuffer(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9539:(e,t,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function getOwnPropertyDescriptors(e){for(var t=Object.keys(e),r={},n=0;n=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),isBoolean(r)?n.showHidden=r:r&&t._extend(n,r),isUndefined(n.showHidden)&&(n.showHidden=!1),isUndefined(n.depth)&&(n.depth=2),isUndefined(n.colors)&&(n.colors=!1),isUndefined(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=stylizeWithColor),formatValue(n,e,n.depth)}function stylizeWithColor(e,t){var r=inspect.styles[t];return r?"["+inspect.colors[r][0]+"m"+e+"["+inspect.colors[r][1]+"m":e}function stylizeNoColor(e,t){return e}function formatValue(e,r,n){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return isString(i)||(i=formatValue(e,i,n)),i}var o=function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}(e,r);if(o)return o;var s=Object.keys(r),a=function arrayToHash(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),isError(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return formatError(r);if(0===s.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,l="",p=!1,f=["{","}"];(isArray(r)&&(p=!0,f=["[","]"]),isFunction(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(l=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(l=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(l=" "+formatError(r)),0!==s.length||p&&0!=r.length?n<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=p?function formatArray(e,t,r,n,i){for(var o=[],s=0,a=t.length;s=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,f)):f[0]+l+f[1]}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatProperty(e,t,r,n,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")),hasOwnProperty(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=isNull(r)?formatValue(e,u.value,null):formatValue(e,u.value,r-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")),isUndefined(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 isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=inspect,inspect.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]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(5955),t.isArray=isArray,t.isBoolean=isBoolean,t.isNull=isNull,t.isNullOrUndefined=function isNullOrUndefined(e){return null==e},t.isNumber=isNumber,t.isString=isString,t.isSymbol=function isSymbol(e){return"symbol"==typeof e},t.isUndefined=isUndefined,t.isRegExp=isRegExp,t.types.isRegExp=isRegExp,t.isObject=isObject,t.isDate=isDate,t.types.isDate=isDate,t.isError=isError,t.types.isNativeError=isError,t.isFunction=isFunction,t.isPrimitive=function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var c=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,t=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),c[e.getMonth()],t].join(" ")}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",timestamp(),t.format.apply(t,arguments))},t.inherits=r(5717),t._extend=function(e,t){if(!t||!isObject(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var l="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function callbackifyOnRejected(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function promisify(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(l&&e[l]){var t;if("function"!=typeof(t=e[l]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,l,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("String.prototype.slice"),p={},f=r(882),h=Object.getPrototypeOf;a&&f&&h&&n(c,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var r=h(t),n=f(r,Symbol.toStringTag);if(!n){var i=h(r);n=f(i,Symbol.toStringTag)}p[e]=n.get}}}));var d=r(5692);e.exports=function whichTypedArray(e){return!!d(e)&&(a&&Symbol.toStringTag in e?function tryAllTypedArrays(e){var t=!1;return n(p,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):l(s(e),8,-1))}},8022:()=>{},3083:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function availableTypedArrays(){for(var e=[],t=0;t{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%");if(n)try{n([],"length")}catch(e){n=null}e.exports=n},3460:(e,t,r)=>{"use strict";var n,i;r.r(t),r.d(t,{default:()=>o}),n="undefined"!=typeof self?self:void 0,i=function(e){if("function"!=typeof Promise)throw"Promise support required";var t=e.crypto||e.msCrypto;if(t){var r=t.subtle||t.webkitSubtle;if(r){var n=e.Crypto||t.constructor||Object,i=e.SubtleCrypto||r.constructor||Object,o=(e.CryptoKey||e.Key,e.navigator.userAgent.indexOf("Edge/")>-1),s=!!e.msCrypto&&!o,a=!t.subtle&&!!t.webkitSubtle;if(s||a){var u={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},c={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach((function(e){var n=r[e];r[e]=function(i,o,u){var c,l,p,f,h=[].slice.call(arguments);switch(e){case"generateKey":c=alg(i),l=o,p=u;break;case"importKey":c=alg(u),l=h[3],p=h[4],"jwk"===i&&((o=b2jwk(o)).alg||(o.alg=jwkAlg(c)),o.key_ops||(o.key_ops="oct"!==o.kty?"d"in o?p.filter(isPrvKeyUse):p.filter(isPubKeyUse):p.slice()),h[1]=jwk2b(o));break;case"unwrapKey":c=h[4],l=h[5],p=h[6],h[2]=u._key}if("generateKey"===e&&"HMAC"===c.name&&c.hash)return c.length=c.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[c.hash.name],r.importKey("raw",t.getRandomValues(new Uint8Array(c.length+7>>3)),c,l,p);if(a&&"generateKey"===e&&"RSASSA-PKCS1-v1_5"===c.name&&(!c.modulusLength||c.modulusLength>=2048))return(i=alg(i)).name="RSAES-PKCS1-v1_5",delete i.hash,r.generateKey(i,!0,["encrypt","decrypt"]).then((function(e){return Promise.all([r.exportKey("jwk",e.publicKey),r.exportKey("jwk",e.privateKey)])})).then((function(e){return e[0].alg=e[1].alg=jwkAlg(c),e[0].key_ops=p.filter(isPubKeyUse),e[1].key_ops=p.filter(isPrvKeyUse),Promise.all([r.importKey("jwk",e[0],c,!0,e[0].key_ops),r.importKey("jwk",e[1],c,l,e[1].key_ops)])})).then((function(e){return{publicKey:e[0],privateKey:e[1]}}));if((a||s&&"SHA-1"===(c.hash||{}).name)&&"importKey"===e&&"jwk"===i&&"HMAC"===c.name&&"oct"===o.kty)return r.importKey("raw",s2b(a2s(o.k)),u,h[3],h[4]);if(a&&"importKey"===e&&("spki"===i||"pkcs8"===i))return r.importKey("jwk",pkcs2jwk(o),u,h[3],h[4]);if(s&&"unwrapKey"===e)return r.decrypt(h[3],u,o).then((function(e){return r.importKey(i,e,h[4],h[5],h[6])}));try{f=n.apply(r,h)}catch(e){return Promise.reject(e)}return s&&(f=new Promise((function(e,t){f.onabort=f.onerror=function(e){t(e)},f.oncomplete=function(t){e(t.target.result)}}))),f=f.then((function(e){return"HMAC"===c.name&&(c.length||(c.length=8*e.algorithm.length)),0==c.name.search("RSA")&&(c.modulusLength||(c.modulusLength=(e.publicKey||e).algorithm.modulusLength),c.publicExponent||(c.publicExponent=(e.publicKey||e).algorithm.publicExponent)),e=e.publicKey&&e.privateKey?{publicKey:new CryptoKey(e.publicKey,c,l,p.filter(isPubKeyUse)),privateKey:new CryptoKey(e.privateKey,c,l,p.filter(isPrvKeyUse))}:new CryptoKey(e,c,l,p)}))}})),["exportKey","wrapKey"].forEach((function(e){var t=r[e];r[e]=function(n,i,o){var u,c=[].slice.call(arguments);switch(e){case"exportKey":c[1]=i._key;break;case"wrapKey":c[1]=i._key,c[2]=o._key}if((a||s&&"SHA-1"===(i.algorithm.hash||{}).name)&&"exportKey"===e&&"jwk"===n&&"HMAC"===i.algorithm.name&&(c[0]="raw"),!a||"exportKey"!==e||"spki"!==n&&"pkcs8"!==n||(c[0]="jwk"),s&&"wrapKey"===e)return r.exportKey(n,i).then((function(e){return"jwk"===n&&(e=s2b(unescape(encodeURIComponent(JSON.stringify(b2jwk(e)))))),r.encrypt(c[3],o,e)}));try{u=t.apply(r,c)}catch(e){return Promise.reject(e)}return s&&(u=new Promise((function(e,t){u.onabort=u.onerror=function(e){t(e)},u.oncomplete=function(t){e(t.target.result)}}))),"exportKey"===e&&"jwk"===n&&(u=u.then((function(e){return(a||s&&"SHA-1"===(i.algorithm.hash||{}).name)&&"HMAC"===i.algorithm.name?{kty:"oct",alg:jwkAlg(i.algorithm),key_ops:i.usages.slice(),ext:!0,k:s2a(b2s(e))}:((e=b2jwk(e)).alg||(e.alg=jwkAlg(i.algorithm)),e.key_ops||(e.key_ops="public"===i.type?i.usages.filter(isPubKeyUse):"private"===i.type?i.usages.filter(isPrvKeyUse):i.usages.slice()),e)}))),!a||"exportKey"!==e||"spki"!==n&&"pkcs8"!==n||(u=u.then((function(e){return e=jwk2pkcs(b2jwk(e))}))),u}})),["encrypt","decrypt","sign","verify"].forEach((function(e){var t=r[e];r[e]=function(n,i,o,a){if(s&&(!o.byteLength||a&&!a.byteLength))throw new Error("Empy input is not allowed");var u,c=[].slice.call(arguments),l=alg(n);if(s&&"decrypt"===e&&"AES-GCM"===l.name){var p=n.tagLength>>3;c[2]=(o.buffer||o).slice(0,o.byteLength-p),n.tag=(o.buffer||o).slice(o.byteLength-p)}c[1]=i._key;try{u=t.apply(r,c)}catch(e){return Promise.reject(e)}return s&&(u=new Promise((function(t,r){u.onabort=u.onerror=function(e){r(e)},u.oncomplete=function(r){if(r=r.target.result,"encrypt"===e&&r instanceof AesGcmEncryptResult){var n=r.ciphertext,i=r.tag;(r=new Uint8Array(n.byteLength+i.byteLength)).set(new Uint8Array(n),0),r.set(new Uint8Array(i),n.byteLength),r=r.buffer}t(r)}}))),u}})),s){var l=r.digest;r.digest=function(e,t){if(!t.byteLength)throw new Error("Empy input is not allowed");var n;try{n=l.call(r,e,t)}catch(e){return Promise.reject(e)}return n=new Promise((function(e,t){n.onabort=n.onerror=function(e){t(e)},n.oncomplete=function(t){e(t.target.result)}}))},e.crypto=Object.create(t,{getRandomValues:{value:function(e){return t.getRandomValues(e)}},subtle:{value:r}}),e.CryptoKey=CryptoKey}a&&(t.subtle=r,e.Crypto=n,e.SubtleCrypto=i,e.CryptoKey=CryptoKey)}}}function s2a(e){return btoa(e).replace(/\=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function a2s(e){return e=(e+="===").slice(0,-e.length%4),atob(e.replace(/-/g,"+").replace(/_/g,"/"))}function s2b(e){for(var t=new Uint8Array(e.length),r=0;r2&&(r=!0,t.shift());var n={ext:!0};if("1.2.840.113549.1.1.1"!==t[0][0])throw new TypeError("Unsupported key type");var i=["n","e","d","p","q","dp","dq","qi"],o=b2der(t[1]);r&&o.shift();for(var s=0;s2&&(n=!0,o.unshift(new Uint8Array([0]))),r[0][0]="1.2.840.113549.1.1.1",t=o,r.push(new Uint8Array(der2b(t)).buffer),n?r.unshift(new Uint8Array([0])):r[1]={tag:3,value:r[1]},new Uint8Array(der2b(r)).buffer}function b2der(e,t){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),t||(t={pos:0,end:e.length}),t.end-t.pos<2||t.end>e.length)throw new RangeError("Malformed DER");var r,n=e[t.pos++],i=e[t.pos++];if(i>=128){if(i&=127,t.end-t.pos=128){var a=n;for(n=4,t.splice(i,0,a>>24&255,a>>16&255,a>>8&255,255&a);n>1&&!(a>>24);)a<<=8,n--;n<4&&t.splice(i,4-n),n|=128}return t.splice(i-2,2,r,n),t}function CryptoKey(e,t,r,n){Object.defineProperties(this,{_key:{value:e},type:{value:e.type,enumerable:!0},extractable:{value:void 0===r?e.extractable:r,enumerable:!0},algorithm:{value:void 0===t?e.algorithm:t,enumerable:!0},usages:{value:void 0===n?e.usages:n,enumerable:!0}})}function isPubKeyUse(e){return"verify"===e||"encrypt"===e||"wrapKey"===e}function isPrvKeyUse(e){return"sign"===e||"decrypt"===e||"unwrapKey"===e}},"function"==typeof define&&define.amd?define([],(function(){return i(n)})):"object"==typeof module&&module.exports?module.exports=i(n):i(n);const o=window.crypto},7377:e=>{"use strict";e.exports=JSON.parse('{"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"}}}}},"authtype":"none"},"GetId":{"input":{"type":"structure","required":["IdentityPoolId"],"members":{"AccountId":{},"IdentityPoolId":{},"Logins":{"shape":"S10"}}},"output":{"type":"structure","members":{"IdentityId":{}}},"authtype":"none"},"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":{}}},"authtype":"none"},"GetOpenIdTokenForDeveloperIdentity":{"input":{"type":"structure","required":["IdentityPoolId","Logins"],"members":{"IdentityPoolId":{},"IdentityId":{},"Logins":{"shape":"S10"},"PrincipalTags":{"shape":"S1s"},"TokenDuration":{"type":"long"}}},"output":{"type":"structure","members":{"IdentityId":{},"Token":{}}}},"GetPrincipalTagAttributeMap":{"input":{"type":"structure","required":["IdentityPoolId","IdentityProviderName"],"members":{"IdentityPoolId":{},"IdentityProviderName":{}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"IdentityProviderName":{},"UseDefaults":{"type":"boolean"},"PrincipalTags":{"shape":"S1s"}}}},"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"}}}},"SetPrincipalTagAttributeMap":{"input":{"type":"structure","required":["IdentityPoolId","IdentityProviderName"],"members":{"IdentityPoolId":{},"IdentityProviderName":{},"UseDefaults":{"type":"boolean"},"PrincipalTags":{"shape":"S1s"}}},"output":{"type":"structure","members":{"IdentityPoolId":{},"IdentityProviderName":{},"UseDefaults":{"type":"boolean"},"PrincipalTags":{"shape":"S1s"}}}},"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"}}},"authtype":"none"},"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":{}}}}}}}}},"S1s":{"type":"map","key":{},"value":{}}}}')},5010:e=>{"use strict";e.exports=JSON.parse('{"o":{"ListIdentityPools":{"input_token":"NextToken","limit_key":"MaxResults","output_token":"NextToken","result_key":"IdentityPools"}}}')},9769:e=>{"use strict";e.exports=JSON.parse('{"version":"2.0","metadata":{"apiVersion":"2019-12-04","endpointPrefix":"kinesisvideo","protocol":"rest-json","serviceAbbreviation":"Amazon Kinesis Video Signaling Channels","serviceFullName":"Amazon Kinesis Video Signaling Channels","serviceId":"Kinesis Video Signaling","signatureVersion":"v4","uid":"kinesis-video-signaling-2019-12-04"},"operations":{"GetIceServerConfig":{"http":{"requestUri":"/v1/get-ice-server-config"},"input":{"type":"structure","required":["ChannelARN"],"members":{"ChannelARN":{},"ClientId":{},"Service":{},"Username":{}}},"output":{"type":"structure","members":{"IceServerList":{"type":"list","member":{"type":"structure","members":{"Uris":{"type":"list","member":{}},"Username":{},"Password":{},"Ttl":{"type":"integer"}}}}}}},"SendAlexaOfferToMaster":{"http":{"requestUri":"/v1/send-alexa-offer-to-master"},"input":{"type":"structure","required":["ChannelARN","SenderClientId","MessagePayload"],"members":{"ChannelARN":{},"SenderClientId":{},"MessagePayload":{}}},"output":{"type":"structure","members":{"Answer":{}}}}},"shapes":{}}')},1939:e=>{"use strict";e.exports={o:{}}},6305:e=>{"use strict";e.exports=JSON.parse('{"version":"2.0","metadata":{"apiVersion":"2017-09-30","endpointPrefix":"kinesisvideo","protocol":"rest-json","serviceAbbreviation":"Kinesis Video","serviceFullName":"Amazon Kinesis Video Streams","serviceId":"Kinesis Video","signatureVersion":"v4","uid":"kinesisvideo-2017-09-30"},"operations":{"CreateSignalingChannel":{"http":{"requestUri":"/createSignalingChannel"},"input":{"type":"structure","required":["ChannelName"],"members":{"ChannelName":{},"ChannelType":{},"SingleMasterConfiguration":{"shape":"S4"},"Tags":{"type":"list","member":{"shape":"S7"}}}},"output":{"type":"structure","members":{"ChannelARN":{}}}},"CreateStream":{"http":{"requestUri":"/createStream"},"input":{"type":"structure","required":["StreamName"],"members":{"DeviceName":{},"StreamName":{},"MediaType":{},"KmsKeyId":{},"DataRetentionInHours":{"type":"integer"},"Tags":{"shape":"Si"}}},"output":{"type":"structure","members":{"StreamARN":{}}}},"DeleteSignalingChannel":{"http":{"requestUri":"/deleteSignalingChannel"},"input":{"type":"structure","required":["ChannelARN"],"members":{"ChannelARN":{},"CurrentVersion":{}}},"output":{"type":"structure","members":{}}},"DeleteStream":{"http":{"requestUri":"/deleteStream"},"input":{"type":"structure","required":["StreamARN"],"members":{"StreamARN":{},"CurrentVersion":{}}},"output":{"type":"structure","members":{}}},"DescribeSignalingChannel":{"http":{"requestUri":"/describeSignalingChannel"},"input":{"type":"structure","members":{"ChannelName":{},"ChannelARN":{}}},"output":{"type":"structure","members":{"ChannelInfo":{"shape":"Sr"}}}},"DescribeStream":{"http":{"requestUri":"/describeStream"},"input":{"type":"structure","members":{"StreamName":{},"StreamARN":{}}},"output":{"type":"structure","members":{"StreamInfo":{"shape":"Sw"}}}},"GetDataEndpoint":{"http":{"requestUri":"/getDataEndpoint"},"input":{"type":"structure","required":["APIName"],"members":{"StreamName":{},"StreamARN":{},"APIName":{}}},"output":{"type":"structure","members":{"DataEndpoint":{}}}},"GetSignalingChannelEndpoint":{"http":{"requestUri":"/getSignalingChannelEndpoint"},"input":{"type":"structure","required":["ChannelARN"],"members":{"ChannelARN":{},"SingleMasterChannelEndpointConfiguration":{"type":"structure","members":{"Protocols":{"type":"list","member":{}},"Role":{}}}}},"output":{"type":"structure","members":{"ResourceEndpointList":{"type":"list","member":{"type":"structure","members":{"Protocol":{},"ResourceEndpoint":{}}}}}}},"ListSignalingChannels":{"http":{"requestUri":"/listSignalingChannels"},"input":{"type":"structure","members":{"MaxResults":{"type":"integer"},"NextToken":{},"ChannelNameCondition":{"type":"structure","members":{"ComparisonOperator":{},"ComparisonValue":{}}}}},"output":{"type":"structure","members":{"ChannelInfoList":{"type":"list","member":{"shape":"Sr"}},"NextToken":{}}}},"ListStreams":{"http":{"requestUri":"/listStreams"},"input":{"type":"structure","members":{"MaxResults":{"type":"integer"},"NextToken":{},"StreamNameCondition":{"type":"structure","members":{"ComparisonOperator":{},"ComparisonValue":{}}}}},"output":{"type":"structure","members":{"StreamInfoList":{"type":"list","member":{"shape":"Sw"}},"NextToken":{}}}},"ListTagsForResource":{"http":{"requestUri":"/ListTagsForResource"},"input":{"type":"structure","required":["ResourceARN"],"members":{"NextToken":{},"ResourceARN":{}}},"output":{"type":"structure","members":{"NextToken":{},"Tags":{"shape":"Si"}}}},"ListTagsForStream":{"http":{"requestUri":"/listTagsForStream"},"input":{"type":"structure","members":{"NextToken":{},"StreamARN":{},"StreamName":{}}},"output":{"type":"structure","members":{"NextToken":{},"Tags":{"shape":"Si"}}}},"TagResource":{"http":{"requestUri":"/TagResource"},"input":{"type":"structure","required":["ResourceARN","Tags"],"members":{"ResourceARN":{},"Tags":{"type":"list","member":{"shape":"S7"}}}},"output":{"type":"structure","members":{}}},"TagStream":{"http":{"requestUri":"/tagStream"},"input":{"type":"structure","required":["Tags"],"members":{"StreamARN":{},"StreamName":{},"Tags":{"shape":"Si"}}},"output":{"type":"structure","members":{}}},"UntagResource":{"http":{"requestUri":"/UntagResource"},"input":{"type":"structure","required":["ResourceARN","TagKeyList"],"members":{"ResourceARN":{},"TagKeyList":{"shape":"S1v"}}},"output":{"type":"structure","members":{}}},"UntagStream":{"http":{"requestUri":"/untagStream"},"input":{"type":"structure","required":["TagKeyList"],"members":{"StreamARN":{},"StreamName":{},"TagKeyList":{"shape":"S1v"}}},"output":{"type":"structure","members":{}}},"UpdateDataRetention":{"http":{"requestUri":"/updateDataRetention"},"input":{"type":"structure","required":["CurrentVersion","Operation","DataRetentionChangeInHours"],"members":{"StreamName":{},"StreamARN":{},"CurrentVersion":{},"Operation":{},"DataRetentionChangeInHours":{"type":"integer"}}},"output":{"type":"structure","members":{}}},"UpdateSignalingChannel":{"http":{"requestUri":"/updateSignalingChannel"},"input":{"type":"structure","required":["ChannelARN","CurrentVersion"],"members":{"ChannelARN":{},"CurrentVersion":{},"SingleMasterConfiguration":{"shape":"S4"}}},"output":{"type":"structure","members":{}}},"UpdateStream":{"http":{"requestUri":"/updateStream"},"input":{"type":"structure","required":["CurrentVersion"],"members":{"StreamName":{},"StreamARN":{},"CurrentVersion":{},"DeviceName":{},"MediaType":{}}},"output":{"type":"structure","members":{}}}},"shapes":{"S4":{"type":"structure","members":{"MessageTtlSeconds":{"type":"integer"}}},"S7":{"type":"structure","required":["Key","Value"],"members":{"Key":{},"Value":{}}},"Si":{"type":"map","key":{},"value":{}},"Sr":{"type":"structure","members":{"ChannelName":{},"ChannelARN":{},"ChannelType":{},"ChannelStatus":{},"CreationTime":{"type":"timestamp"},"SingleMasterConfiguration":{"shape":"S4"},"Version":{}}},"Sw":{"type":"structure","members":{"DeviceName":{},"StreamName":{},"StreamARN":{},"MediaType":{},"KmsKeyId":{},"Version":{},"Status":{},"CreationTime":{"type":"timestamp"},"DataRetentionInHours":{"type":"integer"}}},"S1v":{"type":"list","member":{}}}}')},61:e=>{"use strict";e.exports=JSON.parse('{"o":{"ListSignalingChannels":{"input_token":"NextToken","limit_key":"MaxResults","output_token":"NextToken","result_key":"ChannelInfoList"},"ListStreams":{"input_token":"NextToken","limit_key":"MaxResults","output_token":"NextToken","result_key":"StreamInfoList"}}}')},7752:e=>{"use strict";e.exports=JSON.parse('{"acm":{"name":"ACM","cors":true},"apigateway":{"name":"APIGateway","cors":true},"applicationautoscaling":{"prefix":"application-autoscaling","name":"ApplicationAutoScaling","cors":true},"appstream":{"name":"AppStream"},"autoscaling":{"name":"AutoScaling","cors":true},"batch":{"name":"Batch"},"budgets":{"name":"Budgets"},"clouddirectory":{"name":"CloudDirectory","versions":["2016-05-10*"]},"cloudformation":{"name":"CloudFormation","cors":true},"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*","2019-03-26*"],"cors":true},"cloudhsm":{"name":"CloudHSM","cors":true},"cloudsearch":{"name":"CloudSearch"},"cloudsearchdomain":{"name":"CloudSearchDomain"},"cloudtrail":{"name":"CloudTrail","cors":true},"cloudwatch":{"prefix":"monitoring","name":"CloudWatch","cors":true},"cloudwatchevents":{"prefix":"events","name":"CloudWatchEvents","versions":["2014-02-03*"],"cors":true},"cloudwatchlogs":{"prefix":"logs","name":"CloudWatchLogs","cors":true},"codebuild":{"name":"CodeBuild","cors":true},"codecommit":{"name":"CodeCommit","cors":true},"codedeploy":{"name":"CodeDeploy","cors":true},"codepipeline":{"name":"CodePipeline","cors":true},"cognitoidentity":{"prefix":"cognito-identity","name":"CognitoIdentity","cors":true},"cognitoidentityserviceprovider":{"prefix":"cognito-idp","name":"CognitoIdentityServiceProvider","cors":true},"cognitosync":{"prefix":"cognito-sync","name":"CognitoSync","cors":true},"configservice":{"prefix":"config","name":"ConfigService","cors":true},"cur":{"name":"CUR","cors":true},"datapipeline":{"name":"DataPipeline"},"devicefarm":{"name":"DeviceFarm","cors":true},"directconnect":{"name":"DirectConnect","cors":true},"directoryservice":{"prefix":"ds","name":"DirectoryService"},"discovery":{"name":"Discovery"},"dms":{"name":"DMS"},"dynamodb":{"name":"DynamoDB","cors":true},"dynamodbstreams":{"prefix":"streams.dynamodb","name":"DynamoDBStreams","cors":true},"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":true},"ecr":{"name":"ECR","cors":true},"ecs":{"name":"ECS","cors":true},"efs":{"prefix":"elasticfilesystem","name":"EFS","cors":true},"elasticache":{"name":"ElastiCache","versions":["2012-11-15*","2014-03-24*","2014-07-15*","2014-09-30*"],"cors":true},"elasticbeanstalk":{"name":"ElasticBeanstalk","cors":true},"elb":{"prefix":"elasticloadbalancing","name":"ELB","cors":true},"elbv2":{"prefix":"elasticloadbalancingv2","name":"ELBv2","cors":true},"emr":{"prefix":"elasticmapreduce","name":"EMR","cors":true},"es":{"name":"ES"},"elastictranscoder":{"name":"ElasticTranscoder","cors":true},"firehose":{"name":"Firehose","cors":true},"gamelift":{"name":"GameLift","cors":true},"glacier":{"name":"Glacier"},"health":{"name":"Health"},"iam":{"name":"IAM","cors":true},"importexport":{"name":"ImportExport"},"inspector":{"name":"Inspector","versions":["2015-08-18*"],"cors":true},"iot":{"name":"Iot","cors":true},"iotdata":{"prefix":"iot-data","name":"IotData","cors":true},"kinesis":{"name":"Kinesis","cors":true},"kinesisanalytics":{"name":"KinesisAnalytics"},"kms":{"name":"KMS","cors":true},"lambda":{"name":"Lambda","cors":true},"lexruntime":{"prefix":"runtime.lex","name":"LexRuntime","cors":true},"lightsail":{"name":"Lightsail"},"machinelearning":{"name":"MachineLearning","cors":true},"marketplacecommerceanalytics":{"name":"MarketplaceCommerceAnalytics","cors":true},"marketplacemetering":{"prefix":"meteringmarketplace","name":"MarketplaceMetering"},"mturk":{"prefix":"mturk-requester","name":"MTurk","cors":true},"mobileanalytics":{"name":"MobileAnalytics","cors":true},"opsworks":{"name":"OpsWorks","cors":true},"opsworkscm":{"name":"OpsWorksCM"},"organizations":{"name":"Organizations"},"pinpoint":{"name":"Pinpoint"},"polly":{"name":"Polly","cors":true},"rds":{"name":"RDS","versions":["2014-09-01*"],"cors":true},"redshift":{"name":"Redshift","cors":true},"rekognition":{"name":"Rekognition","cors":true},"resourcegroupstaggingapi":{"name":"ResourceGroupsTaggingAPI"},"route53":{"name":"Route53","cors":true},"route53domains":{"name":"Route53Domains","cors":true},"s3":{"name":"S3","dualstackAvailable":true,"cors":true},"s3control":{"name":"S3Control","dualstackAvailable":true,"xmlNoDefaultLists":true},"servicecatalog":{"name":"ServiceCatalog","cors":true},"ses":{"prefix":"email","name":"SES","cors":true},"shield":{"name":"Shield"},"simpledb":{"prefix":"sdb","name":"SimpleDB"},"sms":{"name":"SMS"},"snowball":{"name":"Snowball"},"sns":{"name":"SNS","cors":true},"sqs":{"name":"SQS","cors":true},"ssm":{"name":"SSM","cors":true},"storagegateway":{"name":"StorageGateway","cors":true},"stepfunctions":{"prefix":"states","name":"StepFunctions"},"sts":{"name":"STS","cors":true},"support":{"name":"Support"},"swf":{"name":"SWF"},"xray":{"name":"XRay","cors":true},"waf":{"name":"WAF","cors":true},"wafregional":{"prefix":"waf-regional","name":"WAFRegional"},"workdocs":{"name":"WorkDocs","cors":true},"workspaces":{"name":"WorkSpaces"},"codestar":{"name":"CodeStar"},"lexmodelbuildingservice":{"prefix":"lex-models","name":"LexModelBuildingService","cors":true},"marketplaceentitlementservice":{"prefix":"entitlement.marketplace","name":"MarketplaceEntitlementService"},"athena":{"name":"Athena","cors":true},"greengrass":{"name":"Greengrass"},"dax":{"name":"DAX"},"migrationhub":{"prefix":"AWSMigrationHub","name":"MigrationHub"},"cloudhsmv2":{"name":"CloudHSMV2","cors":true},"glue":{"name":"Glue"},"mobile":{"name":"Mobile"},"pricing":{"name":"Pricing","cors":true},"costexplorer":{"prefix":"ce","name":"CostExplorer","cors":true},"mediaconvert":{"name":"MediaConvert"},"medialive":{"name":"MediaLive"},"mediapackage":{"name":"MediaPackage"},"mediastore":{"name":"MediaStore"},"mediastoredata":{"prefix":"mediastore-data","name":"MediaStoreData","cors":true},"appsync":{"name":"AppSync"},"guardduty":{"name":"GuardDuty"},"mq":{"name":"MQ"},"comprehend":{"name":"Comprehend","cors":true},"iotjobsdataplane":{"prefix":"iot-jobs-data","name":"IoTJobsDataPlane"},"kinesisvideoarchivedmedia":{"prefix":"kinesis-video-archived-media","name":"KinesisVideoArchivedMedia","cors":true},"kinesisvideomedia":{"prefix":"kinesis-video-media","name":"KinesisVideoMedia","cors":true},"kinesisvideo":{"name":"KinesisVideo","cors":true},"sagemakerruntime":{"prefix":"runtime.sagemaker","name":"SageMakerRuntime"},"sagemaker":{"name":"SageMaker"},"translate":{"name":"Translate","cors":true},"resourcegroups":{"prefix":"resource-groups","name":"ResourceGroups","cors":true},"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":true},"acmpca":{"prefix":"acm-pca","name":"ACMPCA"},"fms":{"name":"FMS"},"secretsmanager":{"name":"SecretsManager","cors":true},"iotanalytics":{"name":"IoTAnalytics","cors":true},"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":true},"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":true},"personalizeevents":{"prefix":"personalize-events","name":"PersonalizeEvents","cors":true},"personalizeruntime":{"prefix":"personalize-runtime","name":"PersonalizeRuntime","cors":true},"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":true},"forecastqueryservice":{"prefix":"forecastquery","name":"ForecastQueryService","cors":true},"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"},"marketplacecatalog":{"prefix":"marketplace-catalog","name":"MarketplaceCatalog"},"dataexchange":{"name":"DataExchange"},"sesv2":{"name":"SESV2"},"migrationhubconfig":{"prefix":"migrationhub-config","name":"MigrationHubConfig"},"connectparticipant":{"name":"ConnectParticipant"},"appconfig":{"name":"AppConfig"},"iotsecuretunneling":{"name":"IoTSecureTunneling"},"wafv2":{"name":"WAFV2"},"elasticinference":{"prefix":"elastic-inference","name":"ElasticInference"},"imagebuilder":{"name":"Imagebuilder"},"schemas":{"name":"Schemas"},"accessanalyzer":{"name":"AccessAnalyzer"},"codegurureviewer":{"prefix":"codeguru-reviewer","name":"CodeGuruReviewer"},"codeguruprofiler":{"name":"CodeGuruProfiler"},"computeoptimizer":{"prefix":"compute-optimizer","name":"ComputeOptimizer"},"frauddetector":{"name":"FraudDetector"},"kendra":{"name":"Kendra"},"networkmanager":{"name":"NetworkManager"},"outposts":{"name":"Outposts"},"augmentedairuntime":{"prefix":"sagemaker-a2i-runtime","name":"AugmentedAIRuntime"},"ebs":{"name":"EBS"},"kinesisvideosignalingchannels":{"prefix":"kinesis-video-signaling","name":"KinesisVideoSignalingChannels","cors":true},"detective":{"name":"Detective"},"codestarconnections":{"prefix":"codestar-connections","name":"CodeStarconnections"},"synthetics":{"name":"Synthetics"},"iotsitewise":{"name":"IoTSiteWise"},"macie2":{"name":"Macie2"},"codeartifact":{"name":"CodeArtifact"},"honeycode":{"name":"Honeycode"},"ivs":{"name":"IVS"},"braket":{"name":"Braket"},"identitystore":{"name":"IdentityStore"},"appflow":{"name":"Appflow"},"redshiftdata":{"prefix":"redshift-data","name":"RedshiftData"},"ssoadmin":{"prefix":"sso-admin","name":"SSOAdmin"},"timestreamquery":{"prefix":"timestream-query","name":"TimestreamQuery"},"timestreamwrite":{"prefix":"timestream-write","name":"TimestreamWrite"},"s3outposts":{"name":"S3Outposts"},"databrew":{"name":"DataBrew"},"servicecatalogappregistry":{"prefix":"servicecatalog-appregistry","name":"ServiceCatalogAppRegistry"},"networkfirewall":{"prefix":"network-firewall","name":"NetworkFirewall"},"mwaa":{"name":"MWAA"},"amplifybackend":{"name":"AmplifyBackend"},"appintegrations":{"name":"AppIntegrations"},"connectcontactlens":{"prefix":"connect-contact-lens","name":"ConnectContactLens"},"devopsguru":{"prefix":"devops-guru","name":"DevOpsGuru"},"ecrpublic":{"prefix":"ecr-public","name":"ECRPUBLIC"},"lookoutvision":{"name":"LookoutVision"},"sagemakerfeaturestoreruntime":{"prefix":"sagemaker-featurestore-runtime","name":"SageMakerFeatureStoreRuntime"},"customerprofiles":{"prefix":"customer-profiles","name":"CustomerProfiles"},"auditmanager":{"name":"AuditManager"},"emrcontainers":{"prefix":"emr-containers","name":"EMRcontainers"},"healthlake":{"name":"HealthLake"},"sagemakeredge":{"prefix":"sagemaker-edge","name":"SagemakerEdge"},"amp":{"name":"Amp"},"greengrassv2":{"name":"GreengrassV2"},"iotdeviceadvisor":{"name":"IotDeviceAdvisor"},"iotfleethub":{"name":"IoTFleetHub"},"iotwireless":{"name":"IoTWireless"},"location":{"name":"Location","cors":true},"wellarchitected":{"name":"WellArchitected"},"lexmodelsv2":{"prefix":"models.lex.v2","name":"LexModelsV2"},"lexruntimev2":{"prefix":"runtime.lex.v2","name":"LexRuntimeV2","cors":true},"fis":{"name":"Fis"},"lookoutmetrics":{"name":"LookoutMetrics"},"mgn":{"name":"Mgn"},"lookoutequipment":{"name":"LookoutEquipment"},"nimble":{"name":"Nimble"},"finspace":{"name":"Finspace"},"finspacedata":{"prefix":"finspace-data","name":"Finspacedata"},"ssmcontacts":{"prefix":"ssm-contacts","name":"SSMContacts"},"ssmincidents":{"prefix":"ssm-incidents","name":"SSMIncidents"},"applicationcostprofiler":{"name":"ApplicationCostProfiler"},"apprunner":{"name":"AppRunner"},"proton":{"name":"Proton"},"route53recoverycluster":{"prefix":"route53-recovery-cluster","name":"Route53RecoveryCluster"},"route53recoverycontrolconfig":{"prefix":"route53-recovery-control-config","name":"Route53RecoveryControlConfig"},"route53recoveryreadiness":{"prefix":"route53-recovery-readiness","name":"Route53RecoveryReadiness"},"chimesdkidentity":{"prefix":"chime-sdk-identity","name":"ChimeSDKIdentity"},"chimesdkmessaging":{"prefix":"chime-sdk-messaging","name":"ChimeSDKMessaging"},"snowdevicemanagement":{"prefix":"snow-device-management","name":"SnowDeviceManagement"},"memorydb":{"name":"MemoryDB"},"opensearch":{"name":"OpenSearch"},"kafkaconnect":{"name":"KafkaConnect"}}')},753:e=>{"use strict";e.exports=JSON.parse('{"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"},"Tags":{"shape":"S8"},"TransitiveTagKeys":{"type":"list","member":{}},"ExternalId":{},"SerialNumber":{},"TokenCode":{},"SourceIdentity":{}}},"output":{"resultWrapper":"AssumeRoleResult","type":"structure","members":{"Credentials":{"shape":"Si"},"AssumedRoleUser":{"shape":"Sn"},"PackedPolicySize":{"type":"integer"},"SourceIdentity":{}}}},"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":"Si"},"AssumedRoleUser":{"shape":"Sn"},"PackedPolicySize":{"type":"integer"},"Subject":{},"SubjectType":{},"Issuer":{},"Audience":{},"NameQualifier":{},"SourceIdentity":{}}}},"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":"Si"},"SubjectFromWebIdentityToken":{},"AssumedRoleUser":{"shape":"Sn"},"PackedPolicySize":{"type":"integer"},"Provider":{},"Audience":{},"SourceIdentity":{}}}},"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"},"Tags":{"shape":"S8"}}},"output":{"resultWrapper":"GetFederationTokenResult","type":"structure","members":{"Credentials":{"shape":"Si"},"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":"Si"}}}}},"shapes":{"S4":{"type":"list","member":{"type":"structure","members":{"arn":{}}}},"S8":{"type":"list","member":{"type":"structure","required":["Key","Value"],"members":{"Key":{},"Value":{}}}},"Si":{"type":"structure","required":["AccessKeyId","SecretAccessKey","SessionToken","Expiration"],"members":{"AccessKeyId":{},"SecretAccessKey":{},"SessionToken":{},"Expiration":{"type":"timestamp"}}},"Sn":{"type":"structure","required":["AssumedRoleId","Arn"],"members":{"AssumedRoleId":{},"Arn":{}}}}}')},3639:e=>{"use strict";e.exports={o:{}}},738:e=>{"use strict";e.exports=JSON.parse('{"rules":{"*/*":{"endpoint":"{service}.{region}.amazonaws.com"},"cn-*/*":{"endpoint":"{service}.{region}.amazonaws.com.cn"},"us-iso-*/*":{"endpoint":"{service}.{region}.c2s.ic.gov"},"us-isob-*/*":{"endpoint":"{service}.{region}.sc2s.sgov.gov"},"*/budgets":"globalSSL","*/cloudfront":"globalSSL","*/sts":"globalSSL","*/importexport":{"endpoint":"{service}.amazonaws.com","signatureVersion":"v2","globalEndpoint":true},"*/route53":"globalSSL","cn-*/route53":{"endpoint":"{service}.amazonaws.com.cn","globalEndpoint":true,"signingRegion":"cn-northwest-1"},"us-gov-*/route53":"globalGovCloud","*/waf":"globalSSL","*/iam":"globalSSL","cn-*/iam":{"endpoint":"{service}.cn-north-1.amazonaws.com.cn","globalEndpoint":true,"signingRegion":"cn-north-1"},"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":true,"signingRegion":"us-east-1"},"globalGovCloud":{"endpoint":"{service}.us-gov.amazonaws.com","globalEndpoint":true,"signingRegion":"us-gov-west-1"},"s3signature":{"endpoint":"{service}.{region}.amazonaws.com","signatureVersion":"s3"}}}')}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";__webpack_require__.r(r),__webpack_require__.d(r,{AWS_ACCESS_KEY_ID:()=>m,AWS_REGION:()=>d,AWS_SECRET_ACCESS_KEY:()=>y,Role:()=>s.uU,destroyKVConnection:()=>destroyKVConnection,gKVS:()=>v,playVideo:()=>playVideo,runKVConnection:()=>runKVConnection,setupKVClient:()=>setupKVClient,setupKVConnection:()=>setupKVConnection,stopVideo:()=>stopVideo});var e,t=__webpack_require__(9670),n=__webpack_require__.n(t),i=__webpack_require__(618),o=__webpack_require__.n(i),s=__webpack_require__(8099),a=new Uint8Array(16);function rng(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(a)}const u=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const c=function validate(e){return"string"==typeof e&&u.test(e)};for(var l=[],p=0;p<256;++p)l.push((p+256).toString(16).substr(1));const f=function stringify(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!c(r))throw TypeError("Stringified UUID is invalid");return r};const h=function v4(e,t,r){var n=(e=e||{}).random||(e.rng||rng)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return f(n)},d="ap-northeast-1",m="AKIA4T2TWS6BGPOCM2X2",y="XwjaFd8TQjUgqL8iowMorevQ8VxLEbh7WfljQStT";var __awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};const v={clientId:"viewer-"+h(),videoClient:null,channelInfos:new Map([[s.uU.MASTER,new Map],[s.uU.VIEWER,new Map]]),connections:new Map};function setupKVClient(e,t,r){v.videoClient=new(n())({region:e,accessKeyId:t,secretAccessKey:r})}function setupKVConnection(e,t,r=null){return __awaiter(this,void 0,void 0,(function*(){const n=v.channelInfos.get(e);if(null==n)throw new Error("Unknown Role");n.has(t)||n.set(t,yield function fetchKVChannelInfo(e,t){return __awaiter(this,void 0,void 0,(function*(){if(null==v.videoClient)throw new Error("Call setupKVClient() first");const r=v.videoClient.config.region,n=v.videoClient.config.credentials.accessKeyId,i=v.videoClient.config.credentials.secretAccessKey,{ResourceEndpointList:s}=yield v.videoClient.getSignalingChannelEndpoint({ChannelARN:t,SingleMasterChannelEndpointConfiguration:{Protocols:["WSS","HTTPS"],Role:e}}).promise();if(null==s)throw new Error;const a=s.reduce(((e,t)=>(null!=t.Protocol&&null!=t.ResourceEndpoint&&(e[t.Protocol]=t.ResourceEndpoint),e)),{}),u=new(o())({region:r,accessKeyId:n,secretAccessKey:i,endpoint:a.HTTPS}),{IceServerList:c}=yield u.getIceServerConfig({ChannelARN:t}).promise();if(null==c)throw new Error;const l=[{urls:`stun:stun.kinesisvideo.${r}.amazonaws.com:443`},...c.filter((e=>null!=e.Uris)).map((e=>({urls:e.Uris,username:e.Username,credential:e.Password})))],p={role:e,channelARN:t,endpointsByProtocol:a,iceServers:l};if(null==v.channelInfos.get(e))throw new Error("Unknown Role");return p}))}(e,t));const i=n.get(t),s=h(),a={uuid:s,channelInfo:i,video:document.createElement("video"),signalingClient:null,peerMaster:null,peerViewers:new Map,localStream:r};return setKVSignalingClient(a),v.connections.set(s,a),s}))}function setKVSignalingClient(e){if(null==v.videoClient)throw new Error("Call setupKVClient() first");const t=v.videoClient.config.region,r=v.videoClient.config.credentials.accessKeyId,n=v.videoClient.config.credentials.secretAccessKey,{role:i,channelARN:o,endpointsByProtocol:a}=e.channelInfo,u=new s._r({channelARN:o,channelEndpoint:a.WSS,clientId:i==s.uU.MASTER?void 0:v.clientId,role:i,region:t,credentials:{accessKeyId:r,secretAccessKey:n}});if(e.signalingClient=u,i==s.uU.MASTER)!function setSignalingClientEventMaster(e){const{signalingClient:t,peerViewers:r}=e;if(null==t)throw new Error("internal error");t.on("open",(()=>__awaiter(this,void 0,void 0,(function*(){console.log("signaling client open")})))),t.on("sdpAnswer",(e=>__awaiter(this,void 0,void 0,(function*(){console.warn("waiting offer")})))),t.on("sdpOffer",((n,i)=>__awaiter(this,void 0,void 0,(function*(){console.log("got Offer, remoteId=",i),r.has(i)&&(console.info("Replacing existing peerViewer",i),r.get(i).close(),r.delete(i));const o=prepareNewPeer(e.channelInfo.iceServers,t,(()=>{e.peerViewers.delete(i)}),i);r.set(i,o);const s=e.localStream;s?s.getTracks().forEach((e=>o.addTrack(e,s))):o.addTransceiver&&(o.addTransceiver("video",{direction:"inactive"}),o.addTransceiver("audio",{direction:"inactive"})),yield o.setRemoteDescription(n),yield o.setLocalDescription(yield o.createAnswer()),console.log("sending answer, remoteId=",i),t.sendSdpAnswer(o.localDescription,i)})))),t.on("iceCandidate",((e,t)=>{console.log("got iceCandidate from",t),r.has(t)?r.get(t).addIceCandidate(e):console.error("peer NOT EXIST for id=",t)})),t.on("close",(()=>{console.warn("signalingClient close"),setKVSignalingClient(e),console.warn("reconnection set")})),t.on("error",(e=>{console.error("signalingClient error",e)}))}(e);else{if(i!=s.uU.VIEWER)throw new Error("NotImplemented");!function setSignalingClientEventViewer(e){const t=e.signalingClient;if(null==t)throw new Error("internal error");t.on("open",(()=>__awaiter(this,void 0,void 0,(function*(){console.log("signaling client open"),e.peerMaster?console.warn("WARN: peer ALREADY exist"):e.peerMaster=prepareNewPeer(e.channelInfo.iceServers,t,(()=>{e.peerMaster=null,destroyKVConnection(e.uuid)}),void 0,e.video),e.peerMaster.addTransceiver&&(e.peerMaster.addTransceiver("video",{direction:"recvonly"}),e.peerMaster.addTransceiver("audio",{direction:"recvonly"}));const r=yield e.peerMaster.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});yield e.peerMaster.setLocalDescription(r),console.log("send offer"),t.sendSdpOffer(e.peerMaster.localDescription)})))),t.on("sdpAnswer",(t=>__awaiter(this,void 0,void 0,(function*(){var r;const n=null===(r=e.peerMaster)||void 0===r?void 0:r.signalingState;[void 0,"stable","closed"].includes(n)?console.log(`Ignoring sdpAnswer because peerMaster is in signalingState: ${n}`):(console.log("got answer"),yield e.peerMaster.setRemoteDescription(t))})))),t.on("iceCandidate",(t=>{console.log("got iceCandidate"),e.peerMaster.addIceCandidate(t)})),t.on("close",(()=>{console.warn("signalingClient close"),setKVSignalingClient(e),console.warn("reconnection set")})),t.on("error",(e=>{console.error("signalingClient error",e)}))}(e)}}function prepareNewPeer(e,t,r=null,n,i){const o=new RTCPeerConnection({iceServers:e});return o.addEventListener("icecandidate",(({candidate:e})=>{e&&(console.log("send iceCandidate"),t.sendIceCandidate(e,n))})),o.addEventListener("track",(e=>{console.log("on track"),null==i||i.srcObject||playVideo(i,e.streams[0],1)})),o.addEventListener("iceconnectionstatechange",(e=>{console.log("on iceconnectionstatechange. iceState:",o.iceConnectionState," signalingState:",o.signalingState),"failed"===o.iceConnectionState&&(console.warn("remote peer closed"),o.close(),null!=i&&stopVideo(i),r&&r())})),o}function playVideo(e,t,r=0){return __awaiter(this,void 0,void 0,(function*(){e.srcObject=t,yield e.play().catch((e=>console.error(e))),r>=0&&(e.volume=r)}))}function stopVideo(e){e.srcObject&&(e.pause(),e.srcObject=null)}function runKVConnection(e){const t=v.connections.get(e);if(null==t)throw new Error("ValueError");if(null==t.signalingClient)throw new Error("internal error");t.signalingClient.open()}function destroyKVConnection(e){if(console.log("-- stop Viewer --"),!v.connections.has(e))return;const t=v.connections.get(e);null!=t.video&&stopVideo(t.video),t.signalingClient&&t.signalingClient.close(),t.peerMaster&&(t.peerMaster.close(),t.peerMaster=null);for(const e of t.peerViewers.values())e.close();t.peerViewers.clear(),t.localStream&&(t.localStream.getTracks().forEach((e=>e.stop())),t.localStream=null),v.connections.delete(e)}console.log("clientId=",v.clientId)})(),r})()}));