@twilio/mcs-client 0.6.1 → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builds/browser.js +251 -898
- package/builds/browser.js.map +1 -1
- package/builds/lib.d.ts +3 -41
- package/builds/lib.js +251 -873
- package/builds/lib.js.map +1 -1
- package/builds/twilio-mcs-client.js +2106 -10654
- package/builds/twilio-mcs-client.min.js +37 -24
- package/dist/client.js +7 -7
- package/dist/client.js.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/media.js +2 -2
- package/dist/media.js.map +1 -1
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
- package/dist/packages/mcs-client/package.json.js +1 -1
- package/dist/services/network.js +4 -4
- package/dist/services/network.js.map +1 -1
- package/dist/services/transport.js +4 -3
- package/dist/services/transport.js.map +1 -1
- package/package.json +21 -8
- package/CHANGELOG.md +0 -315
- package/dist/_virtual/rng-browser.js +0 -34
- package/dist/_virtual/rng-browser.js.map +0 -1
- package/dist/cancellable-promise.js +0 -98
- package/dist/cancellable-promise.js.map +0 -1
- package/dist/node_modules/uuid/index.js +0 -44
- package/dist/node_modules/uuid/index.js.map +0 -1
- package/dist/node_modules/uuid/lib/bytesToUuid.js +0 -60
- package/dist/node_modules/uuid/lib/bytesToUuid.js.map +0 -1
- package/dist/node_modules/uuid/lib/rng-browser.js +0 -65
- package/dist/node_modules/uuid/lib/rng-browser.js.map +0 -1
- package/dist/node_modules/uuid/v1.js +0 -146
- package/dist/node_modules/uuid/v1.js.map +0 -1
- package/dist/node_modules/uuid/v4.js +0 -66
- package/dist/node_modules/uuid/v4.js.map +0 -1
|
@@ -15,34 +15,47 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
|
15
15
|
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
|
|
17
17
|
*/
|
|
18
|
-
this.Twilio=this.Twilio||{},this.Twilio.McsClient=function(t){"use strict";var e=void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function r(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},o=function(t){return t&&t.Math==Math&&t},i=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n&&n)||function(){return this}()||Function("return this")(),a={},u=function(t){try{return!!t()}catch(t){return!0}},c=!u((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s={},l={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p=f&&!l.call({1:2},1);s.f=p?function(t){var e=f(this,t);return!!e&&e.enumerable}:l;var h,d,v=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},y={}.toString,g=function(t){return y.call(t).slice(8,-1)},m=g,b="".split,w=u((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==m(t)?b.call(t,""):Object(t)}:Object,x=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},S=w,k=x,A=function(t){return S(k(t))},E=function(t){return"object"==typeof t?null!==t:"function"==typeof t},O=i,j=function(t){return"function"==typeof t?t:void 0},T=function(t,e){return arguments.length<2?j(O[t]):O[t]&&O[t][e]},L=T("navigator","userAgent")||"",_=i,R=L,I=_.process,P=_.Deno,C=I&&I.versions||P&&P.version,D=C&&C.v8;D?d=(h=D.split("."))[0]<4?1:h[0]+h[1]:R&&(!(h=R.match(/Edge\/(\d+)/))||h[1]>=74)&&(h=R.match(/Chrome\/(\d+)/))&&(d=h[1]);var M=d&&+d,U=M,N=u,F=!!Object.getOwnPropertySymbols&&!N((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&U&&U<41})),q=F&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,B=T,$=q?function(t){return"symbol"==typeof t}:function(t){var e=B("Symbol");return"function"==typeof e&&Object(t)instanceof e},G=E,W={exports:{}},z=i,V=function(t,e){try{Object.defineProperty(z,t,{value:e,configurable:!0,writable:!0})}catch(r){z[t]=e}return e},H=V,Y="__core-js_shared__",J=i[Y]||H(Y,{}),K=J;(W.exports=function(t,e){return K[t]||(K[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.17.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var X=x,Z=function(t){return Object(X(t))},Q=Z,tt={}.hasOwnProperty,et=Object.hasOwn||function(t,e){return tt.call(Q(t),e)},rt=0,nt=Math.random(),ot=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++rt+nt).toString(36)},it=i,at=W.exports,ut=et,ct=ot,st=F,lt=q,ft=at("wks"),pt=it.Symbol,ht=lt?pt:pt&&pt.withoutSetter||ct,dt=function(t){return ut(ft,t)&&(st||"string"==typeof ft[t])||(st&&ut(pt,t)?ft[t]=pt[t]:ft[t]=ht("Symbol."+t)),ft[t]},vt=E,yt=$,gt=function(t,e){var r,n;if("string"===e&&"function"==typeof(r=t.toString)&&!G(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!G(n=r.call(t)))return n;if("string"!==e&&"function"==typeof(r=t.toString)&&!G(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},mt=dt("toPrimitive"),bt=function(t,e){if(!vt(t)||yt(t))return t;var r,n=t[mt];if(void 0!==n){if(void 0===e&&(e="default"),r=n.call(t,e),!vt(r)||yt(r))return r;throw TypeError("Can't convert object to primitive value")}return void 0===e&&(e="number"),gt(t,e)},wt=bt,xt=$,St=function(t){var e=wt(t,"string");return xt(e)?e:String(e)},kt=E,At=i.document,Et=kt(At)&&kt(At.createElement),Ot=function(t){return Et?At.createElement(t):{}},jt=Ot,Tt=!c&&!u((function(){return 7!=Object.defineProperty(jt("div"),"a",{get:function(){return 7}}).a})),Lt=c,_t=s,Rt=v,It=A,Pt=St,Ct=et,Dt=Tt,Mt=Object.getOwnPropertyDescriptor;a.f=Lt?Mt:function(t,e){if(t=It(t),e=Pt(e),Dt)try{return Mt(t,e)}catch(t){}if(Ct(t,e))return Rt(!_t.f.call(t,e),t[e])};var Ut={},Nt=E,Ft=function(t){if(!Nt(t))throw TypeError(String(t)+" is not an object");return t},qt=c,Bt=Tt,$t=Ft,Gt=St,Wt=Object.defineProperty;Ut.f=qt?Wt:function(t,e,r){if($t(t),e=Gt(e),$t(r),Bt)try{return Wt(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t};var zt=Ut,Vt=v,Ht=c?function(t,e,r){return zt.f(t,e,Vt(1,r))}:function(t,e,r){return t[e]=r,t},Yt={exports:{}},Jt=J,Kt=Function.toString;"function"!=typeof Jt.inspectSource&&(Jt.inspectSource=function(t){return Kt.call(t)});var Xt,Zt,Qt,te=Jt.inspectSource,ee=te,re=i.WeakMap,ne="function"==typeof re&&/native code/.test(ee(re)),oe=W.exports,ie=ot,ae=oe("keys"),ue=function(t){return ae[t]||(ae[t]=ie(t))},ce={},se=ne,le=E,fe=Ht,pe=et,he=J,de=ue,ve=ce,ye="Object already initialized",ge=i.WeakMap;if(se||he.state){var me=he.state||(he.state=new ge),be=me.get,we=me.has,xe=me.set;Xt=function(t,e){if(we.call(me,t))throw new TypeError(ye);return e.facade=t,xe.call(me,t,e),e},Zt=function(t){return be.call(me,t)||{}},Qt=function(t){return we.call(me,t)}}else{var Se=de("state");ve[Se]=!0,Xt=function(t,e){if(pe(t,Se))throw new TypeError(ye);return e.facade=t,fe(t,Se,e),e},Zt=function(t){return pe(t,Se)?t[Se]:{}},Qt=function(t){return pe(t,Se)}}var ke={set:Xt,get:Zt,has:Qt,enforce:function(t){return Qt(t)?Zt(t):Xt(t,{})},getterFor:function(t){return function(e){var r;if(!le(e)||(r=Zt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},Ae=i,Ee=Ht,Oe=et,je=V,Te=te,Le=ke.get,_e=ke.enforce,Re=String(String).split("String");(Yt.exports=function(t,e,r,n){var o,i=!!n&&!!n.unsafe,a=!!n&&!!n.enumerable,u=!!n&&!!n.noTargetGet;"function"==typeof r&&("string"!=typeof e||Oe(r,"name")||Ee(r,"name",e),(o=_e(r)).source||(o.source=Re.join("string"==typeof e?e:""))),t!==Ae?(i?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=r:Ee(t,e,r)):a?t[e]=r:je(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Le(this).source||Te(this)}));var Ie={},Pe=Math.ceil,Ce=Math.floor,De=function(t){return isNaN(t=+t)?0:(t>0?Ce:Pe)(t)},Me=De,Ue=Math.min,Ne=function(t){return t>0?Ue(Me(t),9007199254740991):0},Fe=De,qe=Math.max,Be=Math.min,$e=function(t,e){var r=Fe(t);return r<0?qe(r+e,0):Be(r,e)},Ge=A,We=Ne,ze=$e,Ve=function(t){return function(e,r,n){var o,i=Ge(e),a=We(i.length),u=ze(n,a);if(t&&r!=r){for(;a>u;)if((o=i[u++])!=o)return!0}else for(;a>u;u++)if((t||u in i)&&i[u]===r)return t||u||0;return!t&&-1}},He={includes:Ve(!0),indexOf:Ve(!1)},Ye=et,Je=A,Ke=He.indexOf,Xe=ce,Ze=function(t,e){var r,n=Je(t),o=0,i=[];for(r in n)!Ye(Xe,r)&&Ye(n,r)&&i.push(r);for(;e.length>o;)Ye(n,r=e[o++])&&(~Ke(i,r)||i.push(r));return i},Qe=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tr=Ze,er=Qe.concat("length","prototype");Ie.f=Object.getOwnPropertyNames||function(t){return tr(t,er)};var rr={};rr.f=Object.getOwnPropertySymbols;var nr=Ie,or=rr,ir=Ft,ar=T("Reflect","ownKeys")||function(t){var e=nr.f(ir(t)),r=or.f;return r?e.concat(r(t)):e},ur=et,cr=ar,sr=a,lr=Ut,fr=function(t,e){for(var r=cr(e),n=lr.f,o=sr.f,i=0;i<r.length;i++){var a=r[i];ur(t,a)||n(t,a,o(e,a))}},pr=u,hr=/#|\.prototype\./,dr=function(t,e){var r=yr[vr(t)];return r==mr||r!=gr&&("function"==typeof e?pr(e):!!e)},vr=dr.normalize=function(t){return String(t).replace(hr,".").toLowerCase()},yr=dr.data={},gr=dr.NATIVE="N",mr=dr.POLYFILL="P",br=dr,wr=i,xr=a.f,Sr=Ht,kr=Yt.exports,Ar=V,Er=fr,Or=br,jr=function(t,e){var r,n,o,i,a,u=t.target,c=t.global,s=t.stat;if(r=c?wr:s?wr[u]||Ar(u,{}):(wr[u]||{}).prototype)for(n in e){if(i=e[n],o=t.noTargetGet?(a=xr(r,n))&&a.value:r[n],!Or(c?n:u+(s?".":"#")+n,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Er(i,o)}(t.sham||o&&o.sham)&&Sr(i,"sham",!0),kr(r,n,i,t)}},Tr=i.Promise,Lr=Yt.exports,_r=function(t,e,r){for(var n in e)Lr(t,n,e[n],r);return t},Rr=E,Ir=Ft,Pr=function(t){if(!Rr(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},Cr=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,n){return Ir(r),Pr(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),Dr=Ut.f,Mr=et,Ur=dt("toStringTag"),Nr=function(t,e,r){t&&!Mr(t=r?t:t.prototype,Ur)&&Dr(t,Ur,{configurable:!0,value:e})},Fr=T,qr=Ut,Br=c,$r=dt("species"),Gr=function(t){var e=Fr(t),r=qr.f;Br&&e&&!e[$r]&&r(e,$r,{configurable:!0,get:function(){return this}})},Wr=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},zr=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},Vr={},Hr=Vr,Yr=dt("iterator"),Jr=Array.prototype,Kr=function(t){return void 0!==t&&(Hr.Array===t||Jr[Yr]===t)},Xr=Wr,Zr=function(t,e,r){if(Xr(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},Qr={};Qr[dt("toStringTag")]="z";var tn="[object z]"===String(Qr),en=tn,rn=g,nn=dt("toStringTag"),on="Arguments"==rn(function(){return arguments}()),an=en?rn:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),nn))?r:on?rn(e):"Object"==(n=rn(e))&&"function"==typeof e.callee?"Arguments":n},un=an,cn=Vr,sn=dt("iterator"),ln=function(t){if(null!=t)return t[sn]||t["@@iterator"]||cn[un(t)]},fn=Ft,pn=ln,hn=function(t,e){var r=arguments.length<2?pn(t):e;if("function"!=typeof r)throw TypeError(String(t)+" is not iterable");return fn(r.call(t))},dn=Ft,vn=function(t,e,r){var n,o;dn(t);try{if(void 0===(n=t.return)){if("throw"===e)throw r;return r}n=n.call(t)}catch(t){o=!0,n=t}if("throw"===e)throw r;if(o)throw n;return dn(n),r},yn=Ft,gn=Kr,mn=Ne,bn=Zr,wn=hn,xn=ln,Sn=vn,kn=function(t,e){this.stopped=t,this.result=e},An=function(t,e,r){var n,o,i,a,u,c,s,l=r&&r.that,f=!(!r||!r.AS_ENTRIES),p=!(!r||!r.IS_ITERATOR),h=!(!r||!r.INTERRUPTED),d=bn(e,l,1+f+h),v=function(t){return n&&Sn(n,"normal",t),new kn(!0,t)},y=function(t){return f?(yn(t),h?d(t[0],t[1],v):d(t[0],t[1])):h?d(t,v):d(t)};if(p)n=t;else{if("function"!=typeof(o=xn(t)))throw TypeError("Target is not iterable");if(gn(o)){for(i=0,a=mn(t.length);a>i;i++)if((u=y(t[i]))&&u instanceof kn)return u;return new kn(!1)}n=wn(t,o)}for(c=n.next;!(s=c.call(n)).done;){try{u=y(s.value)}catch(t){Sn(n,"throw",t)}if("object"==typeof u&&u&&u instanceof kn)return u}return new kn(!1)},En=dt("iterator"),On=!1;try{var jn=0,Tn={next:function(){return{done:!!jn++}},return:function(){On=!0}};Tn[En]=function(){return this},Array.from(Tn,(function(){throw 2}))}catch(t){}var Ln,_n,Rn,In,Pn=function(t,e){if(!e&&!On)return!1;var r=!1;try{var n={};n[En]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r},Cn=Ft,Dn=Wr,Mn=dt("species"),Un=function(t,e){var r,n=Cn(t).constructor;return void 0===n||null==(r=Cn(n)[Mn])?e:Dn(r)},Nn=T("document","documentElement"),Fn=/(?:ipad|iphone|ipod).*applewebkit/i.test(L),qn="process"==g(i.process),Bn=i,$n=u,Gn=Zr,Wn=Nn,zn=Ot,Vn=Fn,Hn=qn,Yn=Bn.setImmediate,Jn=Bn.clearImmediate,Kn=Bn.process,Xn=Bn.MessageChannel,Zn=Bn.Dispatch,Qn=0,to={},eo="onreadystatechange";try{Ln=Bn.location}catch(t){}var ro=function(t){if(to.hasOwnProperty(t)){var e=to[t];delete to[t],e()}},no=function(t){return function(){ro(t)}},oo=function(t){ro(t.data)},io=function(t){Bn.postMessage(String(t),Ln.protocol+"//"+Ln.host)};Yn&&Jn||(Yn=function(t){for(var e=[],r=arguments.length,n=1;r>n;)e.push(arguments[n++]);return to[++Qn]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},_n(Qn),Qn},Jn=function(t){delete to[t]},Hn?_n=function(t){Kn.nextTick(no(t))}:Zn&&Zn.now?_n=function(t){Zn.now(no(t))}:Xn&&!Vn?(In=(Rn=new Xn).port2,Rn.port1.onmessage=oo,_n=Gn(In.postMessage,In,1)):Bn.addEventListener&&"function"==typeof postMessage&&!Bn.importScripts&&Ln&&"file:"!==Ln.protocol&&!$n(io)?(_n=io,Bn.addEventListener("message",oo,!1)):_n=eo in zn("script")?function(t){Wn.appendChild(zn("script")).onreadystatechange=function(){Wn.removeChild(this),ro(t)}}:function(t){setTimeout(no(t),0)});var ao,uo,co,so,lo,fo,po,ho,vo={set:Yn,clear:Jn},yo=i,go=/ipad|iphone|ipod/i.test(L)&&void 0!==yo.Pebble,mo=/web0s(?!.*chrome)/i.test(L),bo=i,wo=a.f,xo=vo.set,So=Fn,ko=go,Ao=mo,Eo=qn,Oo=bo.MutationObserver||bo.WebKitMutationObserver,jo=bo.document,To=bo.process,Lo=bo.Promise,_o=wo(bo,"queueMicrotask"),Ro=_o&&_o.value;Ro||(ao=function(){var t,e;for(Eo&&(t=To.domain)&&t.exit();uo;){e=uo.fn,uo=uo.next;try{e()}catch(t){throw uo?so():co=void 0,t}}co=void 0,t&&t.enter()},So||Eo||Ao||!Oo||!jo?!ko&&Lo&&Lo.resolve?((po=Lo.resolve(void 0)).constructor=Lo,ho=po.then,so=function(){ho.call(po,ao)}):so=Eo?function(){To.nextTick(ao)}:function(){xo.call(bo,ao)}:(lo=!0,fo=jo.createTextNode(""),new Oo(ao).observe(fo,{characterData:!0}),so=function(){fo.data=lo=!lo}));var Io=Ro||function(t){var e={fn:t,next:void 0};co&&(co.next=e),uo||(uo=e,so()),co=e},Po={},Co=Wr,Do=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=Co(e),this.reject=Co(r)};Po.f=function(t){return new Do(t)};var Mo,Uo,No,Fo,qo=Ft,Bo=E,$o=Po,Go=i,Wo="object"==typeof window,zo=jr,Vo=i,Ho=T,Yo=Tr,Jo=Yt.exports,Ko=_r,Xo=Cr,Zo=Nr,Qo=Gr,ti=E,ei=Wr,ri=zr,ni=te,oi=An,ii=Pn,ai=Un,ui=vo.set,ci=Io,si=function(t,e){if(qo(t),Bo(e)&&e.constructor===t)return e;var r=$o.f(t);return(0,r.resolve)(e),r.promise},li=function(t,e){var r=Go.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,e))},fi=Po,pi=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},hi=ke,di=br,vi=Wo,yi=qn,gi=M,mi=dt("species"),bi="Promise",wi=hi.get,xi=hi.set,Si=hi.getterFor(bi),ki=Yo&&Yo.prototype,Ai=Yo,Ei=ki,Oi=Vo.TypeError,ji=Vo.document,Ti=Vo.process,Li=fi.f,_i=Li,Ri=!!(ji&&ji.createEvent&&Vo.dispatchEvent),Ii="function"==typeof PromiseRejectionEvent,Pi="unhandledrejection",Ci=!1,Di=di(bi,(function(){var t=ni(Ai),e=t!==String(Ai);if(!e&&66===gi)return!0;if(gi>=51&&/native code/.test(t))return!1;var r=new Ai((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(r.constructor={})[mi]=n,!(Ci=r.then((function(){}))instanceof n)||!e&&vi&&!Ii})),Mi=Di||!ii((function(t){Ai.all(t).catch((function(){}))})),Ui=function(t){var e;return!(!ti(t)||"function"!=typeof(e=t.then))&&e},Ni=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;ci((function(){for(var n=t.value,o=1==t.state,i=0;r.length>i;){var a,u,c,s=r[i++],l=o?s.ok:s.fail,f=s.resolve,p=s.reject,h=s.domain;try{l?(o||(2===t.rejection&&$i(t),t.rejection=1),!0===l?a=n:(h&&h.enter(),a=l(n),h&&(h.exit(),c=!0)),a===s.promise?p(Oi("Promise-chain cycle")):(u=Ui(a))?u.call(a,f,p):f(a)):p(n)}catch(t){h&&!c&&h.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&qi(t)}))}},Fi=function(t,e,r){var n,o;Ri?((n=ji.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),Vo.dispatchEvent(n)):n={promise:e,reason:r},!Ii&&(o=Vo["on"+t])?o(n):t===Pi&&li("Unhandled promise rejection",r)},qi=function(t){ui.call(Vo,(function(){var e,r=t.facade,n=t.value;if(Bi(t)&&(e=pi((function(){yi?Ti.emit("unhandledRejection",n,r):Fi(Pi,r,n)})),t.rejection=yi||Bi(t)?2:1,e.error))throw e.value}))},Bi=function(t){return 1!==t.rejection&&!t.parent},$i=function(t){ui.call(Vo,(function(){var e=t.facade;yi?Ti.emit("rejectionHandled",e):Fi("rejectionhandled",e,t.value)}))},Gi=function(t,e,r){return function(n){t(e,n,r)}},Wi=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,Ni(t,!0))},zi=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw Oi("Promise can't be resolved itself");var n=Ui(e);n?ci((function(){var r={done:!1};try{n.call(e,Gi(zi,r,t),Gi(Wi,r,t))}catch(e){Wi(r,e,t)}})):(t.value=e,t.state=1,Ni(t,!1))}catch(e){Wi({done:!1},e,t)}}};if(Di&&(Ei=(Ai=function(t){ri(this,Ai,bi),ei(t),Mo.call(this);var e=wi(this);try{t(Gi(zi,e),Gi(Wi,e))}catch(t){Wi(e,t)}}).prototype,(Mo=function(t){xi(this,{type:bi,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Ko(Ei,{then:function(t,e){var r=Si(this),n=Li(ai(this,Ai));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=yi?Ti.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&Ni(r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Uo=function(){var t=new Mo,e=wi(t);this.promise=t,this.resolve=Gi(zi,e),this.reject=Gi(Wi,e)},fi.f=Li=function(t){return t===Ai||t===No?new Uo(t):_i(t)},"function"==typeof Yo&&ki!==Object.prototype)){Fo=ki.then,Ci||(Jo(ki,"then",(function(t,e){var r=this;return new Ai((function(t,e){Fo.call(r,t,e)})).then(t,e)}),{unsafe:!0}),Jo(ki,"catch",Ei.catch,{unsafe:!0}));try{delete ki.constructor}catch(t){}Xo&&Xo(ki,Ei)}zo({global:!0,wrap:!0,forced:Di},{Promise:Ai}),Zo(Ai,bi,!1),Qo(bi),No=Ho(bi),zo({target:bi,stat:!0,forced:Di},{reject:function(t){var e=Li(this);return e.reject.call(void 0,t),e.promise}}),zo({target:bi,stat:!0,forced:Di},{resolve:function(t){return si(this,t)}}),zo({target:bi,stat:!0,forced:Mi},{all:function(t){var e=this,r=Li(e),n=r.resolve,o=r.reject,i=pi((function(){var r=ei(e.resolve),i=[],a=0,u=1;oi(t,(function(t){var c=a++,s=!1;i.push(void 0),u++,r.call(e,t).then((function(t){s||(s=!0,i[c]=t,--u||n(i))}),o)})),--u||n(i)}));return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=Li(e),n=r.reject,o=pi((function(){var o=ei(e.resolve);oi(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Vi,Hi=Ze,Yi=Qe,Ji=Object.keys||function(t){return Hi(t,Yi)},Ki=Ut,Xi=Ft,Zi=Ji,Qi=c?Object.defineProperties:function(t,e){Xi(t);for(var r,n=Zi(e),o=n.length,i=0;o>i;)Ki.f(t,r=n[i++],e[r]);return t},ta=Ft,ea=Qi,ra=Qe,na=ce,oa=Nn,ia=Ot,aa=ue("IE_PROTO"),ua=function(){},ca=function(t){return"<script>"+t+"</"+"script>"},sa=function(t){t.write(ca("")),t.close();var e=t.parentWindow.Object;return t=null,e},la=function(){try{Vi=new ActiveXObject("htmlfile")}catch(t){}var t,e;la="undefined"!=typeof document?document.domain&&Vi?sa(Vi):((e=ia("iframe")).style.display="none",oa.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(ca("document.F=Object")),t.close(),t.F):sa(Vi);for(var r=ra.length;r--;)delete la.prototype[ra[r]];return la()};na[aa]=!0;var fa=Object.create||function(t,e){var r;return null!==t?(ua.prototype=ta(t),r=new ua,ua.prototype=null,r[aa]=t):r=la(),void 0===e?r:ea(r,e)},pa=fa,ha=Ut,da=dt("unscopables"),va=Array.prototype;null==va[da]&&ha.f(va,da,{configurable:!0,value:pa(null)});var ya,ga,ma,ba=function(t){va[da][t]=!0},wa=!u((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),xa=et,Sa=Z,ka=wa,Aa=ue("IE_PROTO"),Ea=Object.prototype,Oa=ka?Object.getPrototypeOf:function(t){return t=Sa(t),xa(t,Aa)?t[Aa]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Ea:null},ja=u,Ta=Oa,La=Ht,_a=dt("iterator"),Ra=!1;[].keys&&("next"in(ma=[].keys())?(ga=Ta(Ta(ma)))!==Object.prototype&&(ya=ga):Ra=!0);var Ia=null==ya||ja((function(){var t={};return ya[_a].call(t)!==t}));Ia&&(ya={}),"function"!=typeof ya[_a]&&La(ya,_a,(function(){return this}));var Pa={IteratorPrototype:ya,BUGGY_SAFARI_ITERATORS:Ra},Ca=Pa.IteratorPrototype,Da=fa,Ma=v,Ua=Nr,Na=Vr,Fa=function(){return this},qa=function(t,e,r){var n=e+" Iterator";return t.prototype=Da(Ca,{next:Ma(1,r)}),Ua(t,n,!1),Na[n]=Fa,t},Ba=jr,$a=qa,Ga=Oa,Wa=Cr,za=Nr,Va=Ht,Ha=Yt.exports,Ya=Vr,Ja=Pa.IteratorPrototype,Ka=Pa.BUGGY_SAFARI_ITERATORS,Xa=dt("iterator"),Za="keys",Qa="values",tu="entries",eu=function(){return this},ru=function(t,e,r,n,o,i,a){$a(r,e,n);var u,c,s,l=function(t){if(t===o&&v)return v;if(!Ka&&t in h)return h[t];switch(t){case Za:case Qa:case tu:return function(){return new r(this,t)}}return function(){return new r(this)}},f=e+" Iterator",p=!1,h=t.prototype,d=h[Xa]||h["@@iterator"]||o&&h[o],v=!Ka&&d||l(o),y="Array"==e&&h.entries||d;if(y&&(u=Ga(y.call(new t)))!==Object.prototype&&u.next&&(Ga(u)!==Ja&&(Wa?Wa(u,Ja):"function"!=typeof u[Xa]&&Va(u,Xa,eu)),za(u,f,!0)),o==Qa&&d&&d.name!==Qa&&(p=!0,v=function(){return d.call(this)}),h[Xa]!==v&&Va(h,Xa,v),Ya[e]=v,o)if(c={values:l(Qa),keys:i?v:l(Za),entries:l(tu)},a)for(s in c)(Ka||p||!(s in h))&&Ha(h,s,c[s]);else Ba({target:e,proto:!0,forced:Ka||p},c);return c},nu=A,ou=ba,iu=Vr,au=ke,uu=ru,cu="Array Iterator",su=au.set,lu=au.getterFor(cu),fu=uu(Array,"Array",(function(t,e){su(this,{type:cu,target:nu(t),index:0,kind:e})}),(function(){var t=lu(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");iu.Arguments=iu.Array,ou("keys"),ou("values"),ou("entries");var pu={exports:{}},hu={},du=A,vu=Ie.f,yu={}.toString,gu="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hu.f=function(t){return gu&&"[object Window]"==yu.call(t)?function(t){try{return vu(t)}catch(t){return gu.slice()}}(t):vu(du(t))};var mu=!u((function(){return Object.isExtensible(Object.preventExtensions({}))})),bu=jr,wu=ce,xu=E,Su=et,ku=Ut.f,Au=Ie,Eu=hu,Ou=mu,ju=!1,Tu=ot("meta"),Lu=0,_u=Object.isExtensible||function(){return!0},Ru=function(t){ku(t,Tu,{value:{objectID:"O"+Lu++,weakData:{}}})},Iu=pu.exports={enable:function(){Iu.enable=function(){},ju=!0;var t=Au.f,e=[].splice,r={};r[Tu]=1,t(r).length&&(Au.f=function(r){for(var n=t(r),o=0,i=n.length;o<i;o++)if(n[o]===Tu){e.call(n,o,1);break}return n},bu({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Eu.f}))},fastKey:function(t,e){if(!xu(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Su(t,Tu)){if(!_u(t))return"F";if(!e)return"E";Ru(t)}return t[Tu].objectID},getWeakData:function(t,e){if(!Su(t,Tu)){if(!_u(t))return!0;if(!e)return!1;Ru(t)}return t[Tu].weakData},onFreeze:function(t){return Ou&&ju&&_u(t)&&!Su(t,Tu)&&Ru(t),t}};wu[Tu]=!0;var Pu=E,Cu=Cr,Du=function(t,e,r){var n,o;return Cu&&"function"==typeof(n=e.constructor)&&n!==r&&Pu(o=n.prototype)&&o!==r.prototype&&Cu(t,o),t},Mu=jr,Uu=i,Nu=br,Fu=Yt.exports,qu=pu.exports,Bu=An,$u=zr,Gu=E,Wu=u,zu=Pn,Vu=Nr,Hu=Du,Yu=Ut.f,Ju=fa,Ku=_r,Xu=Zr,Zu=zr,Qu=An,tc=ru,ec=Gr,rc=c,nc=pu.exports.fastKey,oc=ke.set,ic=ke.getterFor,ac={getConstructor:function(t,e,r,n){var o=t((function(t,i){Zu(t,o,e),oc(t,{type:e,index:Ju(null),first:void 0,last:void 0,size:0}),rc||(t.size=0),null!=i&&Qu(i,t[n],{that:t,AS_ENTRIES:r})})),i=ic(e),a=function(t,e,r){var n,o,a=i(t),c=u(t,e);return c?c.value=r:(a.last=c={index:o=nc(e,!0),key:e,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=c),n&&(n.next=c),rc?a.size++:t.size++,"F"!==o&&(a.index[o]=c)),t},u=function(t,e){var r,n=i(t),o=nc(e);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key==e)return r};return Ku(o.prototype,{clear:function(){for(var t=i(this),e=t.index,r=t.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete e[r.index],r=r.next;t.first=t.last=void 0,rc?t.size=0:this.size=0},delete:function(t){var e=this,r=i(e),n=u(e,t);if(n){var o=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=o),o&&(o.previous=a),r.first==n&&(r.first=o),r.last==n&&(r.last=a),rc?r.size--:e.size--}return!!n},forEach:function(t){for(var e,r=i(this),n=Xu(t,arguments.length>1?arguments[1]:void 0,3);e=e?e.next:r.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!u(this,t)}}),Ku(o.prototype,r?{get:function(t){var e=u(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),rc&&Yu(o.prototype,"size",{get:function(){return i(this).size}}),o},setStrong:function(t,e,r){var n=e+" Iterator",o=ic(e),i=ic(n);tc(t,e,(function(t,e){oc(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=i(this),e=t.kind,r=t.last;r&&r.removed;)r=r.previous;return t.target&&(t.last=r=r?r.next:t.state.first)?"keys"==e?{value:r.key,done:!1}:"values"==e?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),ec(e)}},uc=function(t,e,r){var n=-1!==t.indexOf("Map"),o=-1!==t.indexOf("Weak"),i=n?"set":"add",a=Uu[t],u=a&&a.prototype,c=a,s={},l=function(t){var e=u[t];Fu(u,t,"add"==t?function(t){return e.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(o&&!Gu(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!Gu(t)?void 0:e.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!Gu(t))&&e.call(this,0===t?0:t)}:function(t,r){return e.call(this,0===t?0:t,r),this})};if(Nu(t,"function"!=typeof a||!(o||u.forEach&&!Wu((function(){(new a).entries().next()})))))c=r.getConstructor(e,t,n,i),qu.enable();else if(Nu(t,!0)){var f=new c,p=f[i](o?{}:-0,1)!=f,h=Wu((function(){f.has(1)})),d=zu((function(t){new a(t)})),v=!o&&Wu((function(){for(var t=new a,e=5;e--;)t[i](e,e);return!t.has(-0)}));d||((c=e((function(e,r){$u(e,c,t);var o=Hu(new a,e,c);return null!=r&&Bu(r,o[i],{that:o,AS_ENTRIES:n}),o}))).prototype=u,u.constructor=c),(h||v)&&(l("delete"),l("has"),n&&l("get")),(v||p)&&l(i),o&&u.clear&&delete u.clear}return s[t]=c,Mu({global:!0,forced:c!=a},s),Vu(c,t),o||r.setStrong(c,t,n),c};uc("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),ac);var cc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},sc=Ot("span").classList,lc=sc&&sc.constructor&&sc.constructor.prototype,fc=lc===Object.prototype?void 0:lc,pc=i,hc=cc,dc=fc,vc=fu,yc=Ht,gc=dt,mc=gc("iterator"),bc=gc("toStringTag"),wc=vc.values,xc=function(t,e){if(t){if(t[mc]!==wc)try{yc(t,mc,wc)}catch(e){t[mc]=wc}if(t[bc]||yc(t,bc,e),hc[e])for(var r in vc)if(t[r]!==vc[r])try{yc(t,r,vc[r])}catch(e){t[r]=vc[r]}}};for(var Sc in hc)xc(pc[Sc]&&pc[Sc].prototype,Sc);xc(dc,"DOMTokenList");var kc={exports:{}},Ac="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(Ac){var Ec=new Uint8Array(16);kc.exports=function(){return Ac(Ec),Ec}}else{var Oc=new Array(16);kc.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),Oc[e]=t>>>((3&e)<<3)&255;return Oc}}for(var jc=[],Tc=0;Tc<256;++Tc)jc[Tc]=(Tc+256).toString(16).substr(1);var Lc,_c,Rc=function(t,e){var r=e||0,n=jc;return[n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],"-",n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]],n[t[r++]]].join("")},Ic=kc.exports,Pc=Rc,Cc=0,Dc=0;var Mc=function(t,e,r){var n=e&&r||0,o=e||[],i=(t=t||{}).node||Lc,a=void 0!==t.clockseq?t.clockseq:_c;if(null==i||null==a){var u=Ic();null==i&&(i=Lc=[1|u[0],u[1],u[2],u[3],u[4],u[5]]),null==a&&(a=_c=16383&(u[6]<<8|u[7]))}var c=void 0!==t.msecs?t.msecs:(new Date).getTime(),s=void 0!==t.nsecs?t.nsecs:Dc+1,l=c-Cc+(s-Dc)/1e4;if(l<0&&void 0===t.clockseq&&(a=a+1&16383),(l<0||c>Cc)&&void 0===t.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Cc=c,Dc=s,_c=a;var f=(1e4*(268435455&(c+=122192928e5))+s)%4294967296;o[n++]=f>>>24&255,o[n++]=f>>>16&255,o[n++]=f>>>8&255,o[n++]=255&f;var p=c/4294967296*1e4&268435455;o[n++]=p>>>8&255,o[n++]=255&p,o[n++]=p>>>24&15|16,o[n++]=p>>>16&255,o[n++]=a>>>8|128,o[n++]=255&a;for(var h=0;h<6;++h)o[n+h]=i[h];return e||Pc(o)},Uc=kc.exports,Nc=Rc;var Fc=function(t,e,r){var n=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var o=(t=t||{}).random||(t.rng||Uc)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,e)for(var i=0;i<16;++i)e[n+i]=o[i];return e||Nc(o)},qc=Mc,Bc=Fc,$c=Bc;$c.v1=qc,$c.v4=Bc;var Gc=$c;class Wc extends Promise{constructor(t){var e,r=Gc.v4();super(((n,o)=>(e=o,t((t=>{Wc.cancellationMap.delete(r),n(t)}),(t=>{Wc.cancellationMap.delete(r),o(t)}),(t=>{Wc.cancellationMap.set(r,t)}))))),this.id=r,this.rejectPromise=e}cancel(){var t=Wc.cancellationMap.get(this.id);return null==t||t(),this.rejectPromise&&(this.catch((()=>{})),this.rejectPromise(new Error("Promise was cancelled"))),this}}function zc(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Vc(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){zc(i,n,o,a,u,"next",t)}function u(t){zc(i,n,o,a,u,"throw",t)}a(void 0)}))}}r(Wc,"cancellationMap",new Map);var Hc=g,Yc=Array.isArray||function(t){return"Array"==Hc(t)},Jc=E,Kc=Yc,Xc=dt("species"),Zc=function(t){var e;return Kc(t)&&("function"!=typeof(e=t.constructor)||e!==Array&&!Kc(e.prototype)?Jc(e)&&null===(e=e[Xc])&&(e=void 0):e=void 0),void 0===e?Array:e},Qc=function(t,e){return new(Zc(t))(0===e?0:e)},ts=Zr,es=w,rs=Z,ns=Ne,os=Qc,is=[].push,as=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=7==t,u=5==t||i;return function(c,s,l,f){for(var p,h,d=rs(c),v=es(d),y=ts(s,l,3),g=ns(v.length),m=0,b=f||os,w=e?b(c,g):r||a?b(c,0):void 0;g>m;m++)if((u||m in v)&&(h=y(p=v[m],m,d),t))if(e)w[m]=h;else if(h)switch(t){case 3:return!0;case 5:return p;case 6:return m;case 2:is.call(w,p)}else switch(t){case 4:return!1;case 7:is.call(w,p)}return i?-1:n||o?o:w}},us={forEach:as(0),map:as(1),filter:as(2),some:as(3),every:as(4),find:as(5),findIndex:as(6),filterReject:as(7)},cs=u,ss=function(t,e){var r=[][t];return!!r&&cs((function(){r.call(null,e||function(){throw 1},1)}))},ls=us.forEach,fs=ss("forEach")?[].forEach:function(t){return ls(this,t,arguments.length>1?arguments[1]:void 0)},ps=i,hs=cc,ds=fc,vs=fs,ys=Ht,gs=function(t){if(t&&t.forEach!==vs)try{ys(t,"forEach",vs)}catch(e){t.forEach=vs}};for(var ms in hs)gs(ps[ms]&&ps[ms].prototype);gs(ds);var bs,ws=Object.prototype,xs=ws.hasOwnProperty,Ss="function"==typeof Symbol?Symbol:{},ks=Ss.iterator||"@@iterator",As=Ss.asyncIterator||"@@asyncIterator",Es=Ss.toStringTag||"@@toStringTag";function Os(t,e,r,n){var o=e&&e.prototype instanceof Ps?e:Ps,i=Object.create(o.prototype),a=new Vs(n||[]);return i._invoke=function(t,e,r){var n=Ts;return function(o,i){if(n===_s)throw new Error("Generator is already running");if(n===Rs){if("throw"===o)throw i;return Ys()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=Gs(a,r);if(u){if(u===Is)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===Ts)throw n=Rs,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=_s;var c=js(t,e,r);if("normal"===c.type){if(n=r.done?Rs:Ls,c.arg===Is)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=Rs,r.method="throw",r.arg=c.arg)}}}(t,r,a),i}function js(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}var Ts="suspendedStart",Ls="suspendedYield",_s="executing",Rs="completed",Is={};function Ps(){}function Cs(){}function Ds(){}var Ms={};Ms[ks]=function(){return this};var Us=Object.getPrototypeOf,Ns=Us&&Us(Us(Hs([])));Ns&&Ns!==ws&&xs.call(Ns,ks)&&(Ms=Ns);var Fs=Ds.prototype=Ps.prototype=Object.create(Ms);function qs(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function Bs(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===Cs||"GeneratorFunction"===(e.displayName||e.name))}function $s(t,e){function r(n,o,i,a){var u=js(t[n],t,o);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&xs.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,a)}),(function(t){r("throw",t,i,a)})):e.resolve(s).then((function(t){c.value=t,i(c)}),(function(t){return r("throw",t,i,a)}))}a(u.arg)}var n;this._invoke=function(t,o){function i(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(i,i):i()}}function Gs(t,e){var r=t.iterator[e.method];if(r===bs){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=bs,Gs(t,e),"throw"===e.method))return Is;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return Is}var n=js(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,Is;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=bs),e.delegate=null,Is):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,Is)}function Ws(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function zs(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Vs(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(Ws,this),this.reset(!0)}function Hs(t){if(t){var e=t[ks];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(xs.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=bs,e.done=!0,e};return n.next=n}}return{next:Ys}}function Ys(){return{value:bs,done:!0}}Cs.prototype=Fs.constructor=Ds,Ds.constructor=Cs,Ds[Es]=Cs.displayName="GeneratorFunction",qs($s.prototype),$s.prototype[As]=function(){return this},qs(Fs),Fs[Es]="Generator",Fs[ks]=function(){return this},Fs.toString=function(){return"[object Generator]"},Vs.prototype={constructor:Vs,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=bs,this.done=!1,this.delegate=null,this.method="next",this.arg=bs,this.tryEntries.forEach(zs),!t)for(var e in this)"t"===e.charAt(0)&&xs.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=bs)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=bs),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=xs.call(o,"catchLoc"),u=xs.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&xs.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,Is):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),Is},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),zs(r),Is}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;zs(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:Hs(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=bs),Is}};var Js={wrap:Os,isGeneratorFunction:Bs,AsyncIterator:$s,mark:function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,Ds):(t.__proto__=Ds,Es in t||(t[Es]="GeneratorFunction")),t.prototype=Object.create(Fs),t},awrap:function(t){return{__await:t}},async:function(t,e,r,n,o){void 0===o&&(o=Promise);var i=new $s(Os(t,e,r,n),o);return Bs(e)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},keys:function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},values:Hs};function Ks(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function Xs(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}var Zs=Ft,Qs=vn,tl=St,el=Ut,rl=v,nl=function(t,e,r){var n=tl(e);n in t?el.f(t,n,rl(0,r)):t[n]=r},ol=Zr,il=Z,al=function(t,e,r,n){try{return n?e(Zs(r)[0],r[1]):e(r)}catch(e){Qs(t,"throw",e)}},ul=Kr,cl=Ne,sl=nl,ll=hn,fl=ln,pl=function(t){var e,r,n,o,i,a,u=il(t),c="function"==typeof this?this:Array,s=arguments.length,l=s>1?arguments[1]:void 0,f=void 0!==l,p=fl(u),h=0;if(f&&(l=ol(l,s>2?arguments[2]:void 0,2)),null==p||c==Array&&ul(p))for(r=new c(e=cl(u.length));e>h;h++)a=f?l(u[h],h):u[h],sl(r,h,a);else for(i=(o=ll(u,p)).next,r=new c;!(n=i.call(o)).done;h++)a=f?al(o,l,[n.value,h],!0):n.value,sl(r,h,a);return r.length=h,r},hl=pl;jr({target:"Array",stat:!0,forced:!Pn((function(t){Array.from(t)}))},{from:hl});var dl,vl,yl,gl={exports:{}};function ml(t,e){return["".concat((new Date).toISOString()," MCS Client ").concat(t,":")].concat(Array.from(e))}vl=n,yl=function(){var t=function(){},e="undefined",r=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function o(t,e){var r=t[e];if("function"==typeof r.bind)return r.bind(t);try{return Function.prototype.bind.call(r,t)}catch(e){return function(){return Function.prototype.apply.apply(r,[t,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(n){return"debug"===n&&(n="log"),typeof console!==e&&("trace"===n&&r?i:void 0!==console[n]?o(console,n):void 0!==console.log?o(console,"log"):t)}function u(e,r){for(var o=0;o<n.length;o++){var i=n[o];this[i]=o<e?t:this.methodFactory(i,e,r)}this.log=this.debug}function c(t,r,n){return function(){typeof console!==e&&(u.call(this,r,n),this[t].apply(this,arguments))}}function s(t,e,r){return a(t)||c.apply(this,arguments)}function l(t,r,o){var i,a=this;r=null==r?"WARN":r;var c="loglevel";function l(){var t;if(typeof window!==e&&c){try{t=window.localStorage[c]}catch(t){}if(typeof t===e)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(c)+"=");-1!==n&&(t=/^([^;]+)/.exec(r.slice(n))[1])}catch(t){}return void 0===a.levels[t]&&(t=void 0),t}}"string"==typeof t?c+=":"+t:"symbol"==typeof t&&(c=void 0),a.name=t,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=o||s,a.getLevel=function(){return i},a.setLevel=function(r,o){if("string"==typeof r&&void 0!==a.levels[r.toUpperCase()]&&(r=a.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(i=r,!1!==o&&function(t){var r=(n[t]||"silent").toUpperCase();if(typeof window!==e&&c){try{return void(window.localStorage[c]=r)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+r+";"}catch(t){}}}(r),u.call(a,r,t),typeof console===e&&r<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(t){r=t,l()||a.setLevel(t,!1)},a.resetLevel=function(){a.setLevel(r,!1),function(){if(typeof window!==e&&c){try{return void window.localStorage.removeItem(c)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(t){}}}()},a.enableAll=function(t){a.setLevel(a.levels.TRACE,t)},a.disableAll=function(t){a.setLevel(a.levels.SILENT,t)};var f=l();null==f&&(f=r),a.setLevel(f,!1)}var f=new l,p={};f.getLogger=function(t){if("symbol"!=typeof t&&"string"!=typeof t||""===t)throw new TypeError("You must supply a name when creating a logger.");var e=p[t];return e||(e=p[t]=new l(t,f.getLevel(),f.methodFactory)),e};var h=typeof window!==e?window.log:void 0;return f.noConflict=function(){return typeof window!==e&&window.log===f&&(window.log=h),f},f.getLoggers=function(){return p},f.default=f,f},(dl=gl).exports?dl.exports=yl():vl.log=yl();class bl{constructor(t){r(this,"prefix",""),this.prefix=null!=t&&t.length>0?t+" ":""}static scope(t){return new bl(t)}setLevel(t){gl.exports.setLevel(t)}static setLevel(t){gl.exports.setLevel(t)}trace(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.trace.apply(null,ml(this.prefix+"T",e))}debug(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.debug.apply(null,ml(this.prefix+"D",e))}info(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.info.apply(null,ml(this.prefix+"I",e))}warn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.warn.apply(null,ml(this.prefix+"W",e))}error(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.error.apply(null,ml(this.prefix+"E",e))}static trace(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.trace.apply(null,ml("T",e))}static debug(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.debug.apply(null,ml("D",e))}static info(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.info.apply(null,ml("I",e))}static warn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.warn.apply(null,ml("W",e))}static error(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];gl.exports.error.apply(null,ml("E",e))}}var wl,xl=$,Sl=function(t){if(xl(t))throw TypeError("Cannot convert a Symbol value to a string");return String(t)},kl=E,Al=g,El=dt("match"),Ol=function(t){var e;return kl(t)&&(void 0!==(e=t[El])?!!e:"RegExp"==Al(t))},jl=Ol,Tl=dt("match"),Ll=jr,_l=a.f,Rl=Ne,Il=Sl,Pl=function(t){if(jl(t))throw TypeError("The method doesn't accept regular expressions");return t},Cl=x,Dl=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Tl]=!1,"/./"[t](e)}catch(t){}}return!1},Ml="".startsWith,Ul=Math.min,Nl=Dl("startsWith");Ll({target:"String",proto:!0,forced:!!(Nl||(wl=_l(String.prototype,"startsWith"),!wl||wl.writable))&&!Nl},{startsWith:function(t){var e=Il(Cl(this));Pl(t);var r=Rl(Ul(arguments.length>1?arguments[1]:void 0,e.length)),n=Il(t);return Ml?Ml.call(e,n,r):e.slice(r,r+n.length)===n}});var Fl=(t,e)=>{return"".concat((r=t,r.startsWith("http")?"":(t=>"https://mcs.".concat(null!=t?t:"us1",".twilio.com"))(e))).concat(t);var r};class ql{constructor(t,e,r,n){var o,i,a,u,c,s,l=null!==(o=null!==(i=n.MCS)&&void 0!==i?i:n)&&void 0!==o?o:{};this.region=null!==(a=null!==(u=l.region)&&void 0!==u?u:n.region)&&void 0!==a?a:"us1",this.mediaUrl=Fl(e,this.region),this.mediaSetUrl=r?Fl(r):"".concat(this.mediaUrl,"Set"),this.token=t,this.retryWhenThrottledOverride=null===(c=l.retryWhenThrottledOverride)||void 0===c||c,this.backoffConfigOverride=null!==(s=l.backoffConfigOverride)&&void 0!==s?s:ql.backoffConfigDefault}static get backoffConfigDefault(){return{min:1e3,max:4e3,maxAttemptsCount:3}}static get retryWhenThrottledDefault(){return true}updateToken(t){this.token=t}}class Bl{constructor(t,e,r){this.config=t,this.network=e,this._update(r)}get sid(){return this.state.sid}get serviceSid(){return this.state.serviceSid}get dateCreated(){return this.state.dateCreated}get dateUpdated(){return this.state.dateUpdated}get contentType(){return this.state.contentType}get size(){return this.state.size}get fileName(){return this.state.filename}get filename(){return this.state.filename}get category(){return this.state.category}getContentUrl(){var t=this;return new Wc(function(){var e=Vc(Js.mark((function e(r,n,o){var i,a;return Js.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.network.get("".concat(t.config.mediaUrl,"/").concat(t.sid)),o((()=>i.cancel())),e.prev=2,e.next=5,i;case 5:a=e.sent,t._update(a.body),r(t.state.contentDirectUrl),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),n(e.t0);case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(t,r,n){return e.apply(this,arguments)}}())}_update(t){var e,r,n,o;this.state={sid:t.sid,serviceSid:t.service_sid,channelSid:t.channel_sid,messageSid:t.message_sid,dateCreated:t.date_created?new Date(t.date_created):null,dateUploadUpdated:t.date_upload_updated?new Date(t.date_upload_updated):null,dateUpdated:t.date_updated?new Date(t.date_updated):null,size:t.size,contentType:t.content_type,author:t.author,url:t.url,contentUrl:t.links.content,contentDirectUrl:null!==(e=t.links.content_direct_temporary)&&void 0!==e?e:null,filename:null!==(r=t.filename)&&void 0!==r?r:null,category:null!==(n=t.category)&&void 0!==n?n:"media",isMultipartUpstream:null!==(o=t.is_multipart_upstream)&&void 0!==o&&o}}}var $l=Wr,Gl=Z,Wl=w,zl=Ne,Vl=function(t){return function(e,r,n,o){$l(r);var i=Gl(e),a=Wl(i),u=zl(i.length),c=t?u-1:0,s=t?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=s;break}if(c+=s,t?c<0:u<=c)throw TypeError("Reduce of empty array with no initial value")}for(;t?c>=0:u>c;c+=s)c in a&&(o=r(o,a[c],c,i));return o}},Hl={left:Vl(!1),right:Vl(!0)}.left,Yl=M,Jl=qn;jr({target:"Array",proto:!0,forced:!ss("reduce")||!Jl&&Yl>79&&Yl<83},{reduce:function(t){return Hl(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var Kl=Ft,Xl={},Zl=u,Ql=i.RegExp;Xl.UNSUPPORTED_Y=Zl((function(){var t=Ql("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),Xl.BROKEN_CARET=Zl((function(){var t=Ql("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));var tf,ef,rf=u,nf=i.RegExp,of=rf((function(){var t=nf(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)})),af=u,uf=i.RegExp,cf=af((function(){var t=uf("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})),sf=Sl,lf=function(){var t=Kl(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e},ff=Xl,pf=W.exports,hf=fa,df=ke.get,vf=of,yf=cf,gf=RegExp.prototype.exec,mf=pf("native-string-replace",String.prototype.replace),bf=gf,wf=(tf=/a/,ef=/b*/g,gf.call(tf,"a"),gf.call(ef,"a"),0!==tf.lastIndex||0!==ef.lastIndex),xf=ff.UNSUPPORTED_Y||ff.BROKEN_CARET,Sf=void 0!==/()??/.exec("")[1];(wf||Sf||xf||vf||yf)&&(bf=function(t){var e,r,n,o,i,a,u,c=this,s=df(c),l=sf(t),f=s.raw;if(f)return f.lastIndex=c.lastIndex,e=bf.call(f,l),c.lastIndex=f.lastIndex,e;var p=s.groups,h=xf&&c.sticky,d=lf.call(c),v=c.source,y=0,g=l;if(h&&(-1===(d=d.replace("y","")).indexOf("g")&&(d+="g"),g=l.slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==l.charAt(c.lastIndex-1))&&(v="(?: "+v+")",g=" "+g,y++),r=new RegExp("^(?:"+v+")",d)),Sf&&(r=new RegExp("^"+v+"$(?!\\s)",d)),wf&&(n=c.lastIndex),o=gf.call(h?r:c,g),h?o?(o.input=o.input.slice(y),o[0]=o[0].slice(y),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:wf&&o&&(c.lastIndex=c.global?o.index+o[0].length:n),Sf&&o&&o.length>1&&mf.call(o[0],r,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&p)for(o.groups=a=hf(null),i=0;i<p.length;i++)a[(u=p[i])[0]]=o[u[1]];return o});var kf=bf;jr({target:"RegExp",proto:!0,forced:/./.exec!==kf},{exec:kf});var Af=Yt.exports,Ef=kf,Of=u,jf=dt,Tf=Ht,Lf=jf("species"),_f=RegExp.prototype,Rf=function(t,e,r,n){var o=jf(t),i=!Of((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),a=i&&!Of((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[Lf]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return e=!0,null},r[o](""),!e}));if(!i||!a||r){var u=/./[o],c=e(o,""[t],(function(t,e,r,n,o){var a=e.exec;return a===Ef||a===_f.exec?i&&!o?{done:!0,value:u.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}));Af(String.prototype,t,c[0]),Af(_f,o,c[1])}n&&Tf(_f[o],"sham",!0)},If=De,Pf=Sl,Cf=x,Df=function(t){return function(e,r){var n,o,i=Pf(Cf(e)),a=If(r),u=i.length;return a<0||a>=u?t?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===u||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):n:t?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},Mf={codeAt:Df(!1),charAt:Df(!0)},Uf=Mf.charAt,Nf=function(t,e,r){return e+(r?Uf(t,e).length:1)},Ff=g,qf=kf,Bf=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==Ff(t))throw TypeError("RegExp#exec called on incompatible receiver");return qf.call(t,e)},$f=Rf,Gf=Ol,Wf=Ft,zf=x,Vf=Un,Hf=Nf,Yf=Ne,Jf=Sl,Kf=Bf,Xf=kf,Zf=u,Qf=Xl.UNSUPPORTED_Y,tp=[].push,ep=Math.min,rp=4294967295,np=!Zf((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));$f("split",(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=Jf(zf(this)),o=void 0===r?rp:r>>>0;if(0===o)return[];if(void 0===t)return[n];if(!Gf(t))return e.call(n,t,o);for(var i,a,u,c=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,f=new RegExp(t.source,s+"g");(i=Xf.call(f,n))&&!((a=f.lastIndex)>l&&(c.push(n.slice(l,i.index)),i.length>1&&i.index<n.length&&tp.apply(c,i.slice(1)),u=i[0].length,l=a,c.length>=o));)f.lastIndex===i.index&&f.lastIndex++;return l===n.length?!u&&f.test("")||c.push(""):c.push(n.slice(l)),c.length>o?c.slice(0,o):c}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:e.call(this,t,r)}:e,[function(e,r){var o=zf(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,r):n.call(Jf(o),e,r)},function(t,o){var i=Wf(this),a=Jf(t),u=r(n,i,a,o,n!==e);if(u.done)return u.value;var c=Vf(i,RegExp),s=i.unicode,l=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(Qf?"g":"y"),f=new c(Qf?"^(?:"+i.source+")":i,l),p=void 0===o?rp:o>>>0;if(0===p)return[];if(0===a.length)return null===Kf(f,a)?[a]:[];for(var h=0,d=0,v=[];d<a.length;){f.lastIndex=Qf?0:d;var y,g=Kf(f,Qf?a.slice(d):a);if(null===g||(y=ep(Yf(f.lastIndex+(Qf?d:0)),a.length))===h)d=Hf(a,d,s);else{if(v.push(a.slice(h,d)),v.length===p)return v;for(var m=1;m<=g.length-1;m++)if(v.push(g[m]),v.length===p)return v;d=h=y}}return v.push(a.slice(h)),v}]}),!np,Qf);var op=Z,ip=Math.floor,ap="".replace,up=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,cp=/\$([$&'`]|\d{1,2})/g,sp=Rf,lp=u,fp=Ft,pp=De,hp=Ne,dp=Sl,vp=x,yp=Nf,gp=function(t,e,r,n,o,i){var a=r+t.length,u=n.length,c=cp;return void 0!==o&&(o=op(o),c=up),ap.call(i,c,(function(i,c){var s;switch(c.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(a);case"<":s=o[c.slice(1,-1)];break;default:var l=+c;if(0===l)return i;if(l>u){var f=ip(l/10);return 0===f?i:f<=u?void 0===n[f-1]?c.charAt(1):n[f-1]+c.charAt(1):i}s=n[l-1]}return void 0===s?"":s}))},mp=Bf,bp=dt("replace"),wp=Math.max,xp=Math.min,Sp="$0"==="a".replace(/./,"$0"),kp=!!/./[bp]&&""===/./[bp]("a","$0"),Ap=!lp((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}));sp("replace",(function(t,e,r){var n=kp?"$":"$0";return[function(t,r){var n=vp(this),o=null==t?void 0:t[bp];return void 0!==o?o.call(t,n,r):e.call(dp(n),t,r)},function(t,o){var i=fp(this),a=dp(t);if("string"==typeof o&&-1===o.indexOf(n)&&-1===o.indexOf("$<")){var u=r(e,i,a,o);if(u.done)return u.value}var c="function"==typeof o;c||(o=dp(o));var s=i.global;if(s){var l=i.unicode;i.lastIndex=0}for(var f=[];;){var p=mp(i,a);if(null===p)break;if(f.push(p),!s)break;""===dp(p[0])&&(i.lastIndex=yp(a,hp(i.lastIndex),l))}for(var h,d="",v=0,y=0;y<f.length;y++){p=f[y];for(var g=dp(p[0]),m=wp(xp(pp(p.index),a.length),0),b=[],w=1;w<p.length;w++)b.push(void 0===(h=p[w])?h:String(h));var x=p.groups;if(c){var S=[g].concat(b,m,a);void 0!==x&&S.push(x);var k=dp(o.apply(void 0,S))}else k=gp(g,a,m,b,x,o);m>=v&&(d+=a.slice(v,m)+k,v=m+g.length)}return d+a.slice(v)}]}),!Ap||!Sp||kp);var Ep=jr,Op=u,jp=T("JSON","stringify"),Tp=/[\uD800-\uDFFF]/g,Lp=/^[\uD800-\uDBFF]$/,_p=/^[\uDC00-\uDFFF]$/,Rp=function(t,e,r){var n=r.charAt(e-1),o=r.charAt(e+1);return Lp.test(t)&&!_p.test(o)||_p.test(t)&&!Lp.test(n)?"\\u"+t.charCodeAt(0).toString(16):t},Ip=Op((function(){return'"\\udf06\\ud834"'!==jp("\udf06\ud834")||'"\\udead"'!==jp("\udead")}));jp&&Ep({target:"JSON",stat:!0,forced:Ip},{stringify:function(t,e,r){var n=jp.apply(null,arguments);return"string"==typeof n?n.replace(Tp,Rp):n}});class Pp extends Error{constructor(t,e,r,n,o){super(t),this.code=e,this.body=r,this.status=n,this.headers=o}}var Cp=e.XMLHttpRequest||{};class Dp{static request(t,e,r,n){return new Wc(((o,i,a)=>{var u=new Cp,c=!1;for(var s in a((()=>{u.abort(),c=!0})),u.open(t,e,!0),u.onreadystatechange=function(){if(4===u.readyState&&!c){var t,e=(t=u.getAllResponseHeaders())?t.split("\r\n").map((t=>t.split(": "))).filter((t=>2===t.length&&t[1].length>0)).reduce(((t,e)=>(t[e[0]]=e[1],t)),{}):{},r=function(t){var e=t.getResponseHeader("Content-Type");if(!e||0!==e.indexOf("application/json")||0===t.responseText.length)return t.responseText;try{return JSON.parse(t.responseText)}catch(e){return t.responseText}}(u);if(200<=u.status&&u.status<300)o({status:u.status,headers:e,body:r});else{var n,a,s=null!==(n=u.statusText)&&void 0!==n?n:"NONE";if("string"==typeof r)if(r&&1===r.split("\n",2).length)a=r;else{var l,f=null===(l=r.replace(/<.*?>/g,"").split(/\r\n/g).filter((t=>t.length))[0])||void 0===l?void 0:l.split(" ");a=(null==f?void 0:f.length)>2?null==f?void 0:f.slice(1).join(" "):""}else a=JSON.stringify(r);var p="".concat(u.status,": [").concat(s,"] ").concat(a);i(new Pp(p,u.status,r,s,e))}}},r)u.setRequestHeader(s,r[s]),"Content-Type"===s&&"application/json"===r[s]&&(n=JSON.stringify(n));u.send(n)}))}get(t,e){return Dp.request("GET",t,e)}post(t,e,r){return Dp.request("POST",t,e,r)}}var Mp=c,Up=u,Np=Ji,Fp=rr,qp=s,Bp=Z,$p=w,Gp=Object.assign,Wp=Object.defineProperty,zp=!Gp||Up((function(){if(Mp&&1!==Gp({b:1},Gp(Wp({},"a",{enumerable:!0,get:function(){Wp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach((function(t){e[t]=t})),7!=Gp({},t)[r]||Np(Gp({},e)).join("")!=n}))?function(t,e){for(var r=Bp(t),n=arguments.length,o=1,i=Fp.f,a=qp.f;n>o;)for(var u,c=$p(arguments[o++]),s=i?Np(c).concat(i(c)):Np(c),l=s.length,f=0;l>f;)u=s[f++],Mp&&!a.call(c,u)||(r[u]=c[u]);return r}:Gp,Vp=zp;jr({target:"Object",stat:!0,forced:Object.assign!==Vp},{assign:Vp});var Hp=Mf.charAt,Yp=Sl,Jp=ke,Kp=ru,Xp="String Iterator",Zp=Jp.set,Qp=Jp.getterFor(Xp);Kp(String,"String",(function(t){Zp(this,{type:Xp,string:Yp(t),index:0})}),(function(){var t,e=Qp(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=Hp(r,n),e.index+=t.length,{value:t,done:!1})}));var th=u,eh=dt("iterator"),rh=!th((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[eh]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),nh=2147483647,oh=/[^\0-\u007E]/,ih=/[.\u3002\uFF0E\uFF61]/g,ah="Overflow: input needs wider integers to process",uh=Math.floor,ch=String.fromCharCode,sh=function(t){return t+22+75*(t<26)},lh=function(t,e,r){var n=0;for(t=r?uh(t/700):t>>1,t+=uh(t/e);t>455;n+=36)t=uh(t/35);return uh(n+36*t/(t+38))},fh=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=t.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var i=t.charCodeAt(r++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),r--)}else e.push(o)}return e}(t);var r,n,o=t.length,i=128,a=0,u=72;for(r=0;r<t.length;r++)(n=t[r])<128&&e.push(ch(n));var c=e.length,s=c;for(c&&e.push("-");s<o;){var l=nh;for(r=0;r<t.length;r++)(n=t[r])>=i&&n<l&&(l=n);var f=s+1;if(l-i>uh((nh-a)/f))throw RangeError(ah);for(a+=(l-i)*f,i=l,r=0;r<t.length;r++){if((n=t[r])<i&&++a>nh)throw RangeError(ah);if(n==i){for(var p=a,h=36;;h+=36){var d=h<=u?1:h>=u+26?26:h-u;if(p<d)break;var v=p-d,y=36-d;e.push(ch(sh(d+v%y))),p=uh(v/y)}e.push(ch(sh(p))),u=lh(a,f,s==c),a=0,++s}}++a,++i}return e.join("")},ph=jr,hh=T,dh=rh,vh=Yt.exports,yh=_r,gh=Nr,mh=qa,bh=ke,wh=zr,xh=et,Sh=Zr,kh=an,Ah=Ft,Eh=E,Oh=Sl,jh=fa,Th=v,Lh=hn,_h=ln,Rh=dt,Ih=hh("fetch"),Ph=hh("Request"),Ch=Ph&&Ph.prototype,Dh=hh("Headers"),Mh=Rh("iterator"),Uh="URLSearchParams",Nh="URLSearchParamsIterator",Fh=bh.set,qh=bh.getterFor(Uh),Bh=bh.getterFor(Nh),$h=/\+/g,Gh=Array(4),Wh=function(t){return Gh[t-1]||(Gh[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},zh=function(t){try{return decodeURIComponent(t)}catch(e){return t}},Vh=function(t){var e=t.replace($h," "),r=4;try{return decodeURIComponent(e)}catch(t){for(;r;)e=e.replace(Wh(r--),zh);return e}},Hh=/[!'()~]|%20/g,Yh={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},Jh=function(t){return Yh[t]},Kh=function(t){return encodeURIComponent(t).replace(Hh,Jh)},Xh=function(t,e){if(e)for(var r,n,o=e.split("&"),i=0;i<o.length;)(r=o[i++]).length&&(n=r.split("="),t.push({key:Vh(n.shift()),value:Vh(n.join("="))}))},Zh=function(t){this.entries.length=0,Xh(this.entries,t)},Qh=function(t,e){if(t<e)throw TypeError("Not enough arguments")},td=mh((function(t,e){Fh(this,{type:Nh,iterator:Lh(qh(t).entries),kind:e})}),"Iterator",(function(){var t=Bh(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r})),ed=function(){wh(this,ed,Uh);var t,e,r,n,o,i,a,u,c,s=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(Fh(l,{type:Uh,entries:f,updateURL:function(){},updateSearchParams:Zh}),void 0!==s)if(Eh(s))if("function"==typeof(t=_h(s)))for(r=(e=Lh(s,t)).next;!(n=r.call(e)).done;){if((a=(i=(o=Lh(Ah(n.value))).next).call(o)).done||(u=i.call(o)).done||!i.call(o).done)throw TypeError("Expected sequence with length 2");f.push({key:Oh(a.value),value:Oh(u.value)})}else for(c in s)xh(s,c)&&f.push({key:c,value:Oh(s[c])});else Xh(f,"string"==typeof s?"?"===s.charAt(0)?s.slice(1):s:Oh(s))},rd=ed.prototype;if(yh(rd,{append:function(t,e){Qh(arguments.length,2);var r=qh(this);r.entries.push({key:Oh(t),value:Oh(e)}),r.updateURL()},delete:function(t){Qh(arguments.length,1);for(var e=qh(this),r=e.entries,n=Oh(t),o=0;o<r.length;)r[o].key===n?r.splice(o,1):o++;e.updateURL()},get:function(t){Qh(arguments.length,1);for(var e=qh(this).entries,r=Oh(t),n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function(t){Qh(arguments.length,1);for(var e=qh(this).entries,r=Oh(t),n=[],o=0;o<e.length;o++)e[o].key===r&&n.push(e[o].value);return n},has:function(t){Qh(arguments.length,1);for(var e=qh(this).entries,r=Oh(t),n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function(t,e){Qh(arguments.length,1);for(var r,n=qh(this),o=n.entries,i=!1,a=Oh(t),u=Oh(e),c=0;c<o.length;c++)(r=o[c]).key===a&&(i?o.splice(c--,1):(i=!0,r.value=u));i||o.push({key:a,value:u}),n.updateURL()},sort:function(){var t,e,r,n=qh(this),o=n.entries,i=o.slice();for(o.length=0,r=0;r<i.length;r++){for(t=i[r],e=0;e<r;e++)if(o[e].key>t.key){o.splice(e,0,t);break}e===r&&o.push(t)}n.updateURL()},forEach:function(t){for(var e,r=qh(this).entries,n=Sh(t,arguments.length>1?arguments[1]:void 0,3),o=0;o<r.length;)n((e=r[o++]).value,e.key,this)},keys:function(){return new td(this,"keys")},values:function(){return new td(this,"values")},entries:function(){return new td(this,"entries")}},{enumerable:!0}),vh(rd,Mh,rd.entries),vh(rd,"toString",(function(){for(var t,e=qh(this).entries,r=[],n=0;n<e.length;)t=e[n++],r.push(Kh(t.key)+"="+Kh(t.value));return r.join("&")}),{enumerable:!0}),gh(ed,Uh),ph({global:!0,forced:!dh},{URLSearchParams:ed}),!dh&&"function"==typeof Dh){var nd=function(t){if(Eh(t)){var e,r=t.body;if(kh(r)===Uh)return(e=t.headers?new Dh(t.headers):new Dh).has("content-type")||e.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),jh(t,{body:Th(0,String(r)),headers:Th(0,e)})}return t};if("function"==typeof Ih&&ph({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return Ih(t,arguments.length>1?nd(arguments[1]):{})}}),"function"==typeof Ph){var od=function(t){return wh(this,od,"Request"),new Ph(t,arguments.length>1?nd(arguments[1]):{})};Ch.constructor=od,od.prototype=Ch,ph({global:!0,forced:!0},{Request:od})}}var id,ad={URLSearchParams:ed,getState:qh},ud=jr,cd=c,sd=rh,ld=i,fd=Qi,pd=Yt.exports,hd=zr,dd=et,vd=zp,yd=pl,gd=Mf.codeAt,md=function(t){var e,r,n=[],o=t.toLowerCase().replace(ih,".").split(".");for(e=0;e<o.length;e++)r=o[e],n.push(oh.test(r)?"xn--"+fh(r):r);return n.join(".")},bd=Sl,wd=Nr,xd=ad,Sd=ke,kd=ld.URL,Ad=xd.URLSearchParams,Ed=xd.getState,Od=Sd.set,jd=Sd.getterFor("URL"),Td=Math.floor,Ld=Math.pow,_d="Invalid scheme",Rd="Invalid host",Id="Invalid port",Pd=/[A-Za-z]/,Cd=/[\d+-.A-Za-z]/,Dd=/\d/,Md=/^0x/i,Ud=/^[0-7]+$/,Nd=/^\d+$/,Fd=/^[\dA-Fa-f]+$/,qd=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Bd=/[\0\t\n\r #/:<>?@[\\\]^|]/,$d=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,Gd=/[\t\n\r]/g,Wd=function(t,e){var r,n,o;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return Rd;if(!(r=Vd(e.slice(1,-1))))return Rd;t.host=r}else if(tv(t)){if(e=md(e),qd.test(e))return Rd;if(null===(r=zd(e)))return Rd;t.host=r}else{if(Bd.test(e))return Rd;for(r="",n=yd(e),o=0;o<n.length;o++)r+=Zd(n[o],Yd);t.host=r}},zd=function(t){var e,r,n,o,i,a,u,c=t.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(e=c.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(o=c[n]))return t;if(i=10,o.length>1&&"0"==o.charAt(0)&&(i=Md.test(o)?16:8,o=o.slice(8==i?1:2)),""===o)a=0;else{if(!(10==i?Nd:8==i?Ud:Fd).test(o))return t;a=parseInt(o,i)}r.push(a)}for(n=0;n<e;n++)if(a=r[n],n==e-1){if(a>=Ld(256,5-e))return null}else if(a>255)return null;for(u=r.pop(),n=0;n<r.length;n++)u+=r[n]*Ld(256,3-n);return u},Vd=function(t){var e,r,n,o,i,a,u,c=[0,0,0,0,0,0,0,0],s=0,l=null,f=0,p=function(){return t.charAt(f)};if(":"==p()){if(":"!=t.charAt(1))return;f+=2,l=++s}for(;p();){if(8==s)return;if(":"!=p()){for(e=r=0;r<4&&Fd.test(p());)e=16*e+parseInt(p(),16),f++,r++;if("."==p()){if(0==r)return;if(f-=r,s>6)return;for(n=0;p();){if(o=null,n>0){if(!("."==p()&&n<4))return;f++}if(!Dd.test(p()))return;for(;Dd.test(p());){if(i=parseInt(p(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;f++}c[s]=256*c[s]+o,2!=++n&&4!=n||s++}if(4!=n)return;break}if(":"==p()){if(f++,!p())return}else if(p())return;c[s++]=e}else{if(null!==l)return;f++,l=++s}}if(null!==l)for(a=s-l,s=7;0!=s&&a>0;)u=c[s],c[s--]=c[l+a-1],c[l+--a]=u;else if(8!=s)return;return c},Hd=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)e.unshift(t%256),t=Td(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=t[r].toString(16),r<7&&(e+=":")));return"["+e+"]"}return t},Yd={},Jd=vd({},Yd,{" ":1,'"':1,"<":1,">":1,"`":1}),Kd=vd({},Jd,{"#":1,"?":1,"{":1,"}":1}),Xd=vd({},Kd,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Zd=function(t,e){var r=gd(t,0);return r>32&&r<127&&!dd(e,t)?t:encodeURIComponent(t)},Qd={ftp:21,file:null,http:80,https:443,ws:80,wss:443},tv=function(t){return dd(Qd,t.scheme)},ev=function(t){return""!=t.username||""!=t.password},rv=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},nv=function(t,e){var r;return 2==t.length&&Pd.test(t.charAt(0))&&(":"==(r=t.charAt(1))||!e&&"|"==r)},ov=function(t){var e;return t.length>1&&nv(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},iv=function(t){var e=t.path,r=e.length;!r||"file"==t.scheme&&1==r&&nv(e[0],!0)||e.pop()},av=function(t){return"."===t||"%2e"===t.toLowerCase()},uv={},cv={},sv={},lv={},fv={},pv={},hv={},dv={},vv={},yv={},gv={},mv={},bv={},wv={},xv={},Sv={},kv={},Av={},Ev={},Ov={},jv={},Tv=function(t,e,r,n){var o,i,a,u,c,s=r||uv,l=0,f="",p=!1,h=!1,d=!1;for(r||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace($d,"")),e=e.replace(Gd,""),o=yd(e);l<=o.length;){switch(i=o[l],s){case uv:if(!i||!Pd.test(i)){if(r)return _d;s=sv;continue}f+=i.toLowerCase(),s=cv;break;case cv:if(i&&(Cd.test(i)||"+"==i||"-"==i||"."==i))f+=i.toLowerCase();else{if(":"!=i){if(r)return _d;f="",s=sv,l=0;continue}if(r&&(tv(t)!=dd(Qd,f)||"file"==f&&(ev(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=f,r)return void(tv(t)&&Qd[t.scheme]==t.port&&(t.port=null));f="","file"==t.scheme?s=wv:tv(t)&&n&&n.scheme==t.scheme?s=lv:tv(t)?s=dv:"/"==o[l+1]?(s=fv,l++):(t.cannotBeABaseURL=!0,t.path.push(""),s=Ev)}break;case sv:if(!n||n.cannotBeABaseURL&&"#"!=i)return _d;if(n.cannotBeABaseURL&&"#"==i){t.scheme=n.scheme,t.path=n.path.slice(),t.query=n.query,t.fragment="",t.cannotBeABaseURL=!0,s=jv;break}s="file"==n.scheme?wv:pv;continue;case lv:if("/"!=i||"/"!=o[l+1]){s=pv;continue}s=vv,l++;break;case fv:if("/"==i){s=yv;break}s=Av;continue;case pv:if(t.scheme=n.scheme,i==id)t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query=n.query;else if("/"==i||"\\"==i&&tv(t))s=hv;else if("?"==i)t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query="",s=Ov;else{if("#"!=i){t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.path.pop(),s=Av;continue}t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query=n.query,t.fragment="",s=jv}break;case hv:if(!tv(t)||"/"!=i&&"\\"!=i){if("/"!=i){t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,s=Av;continue}s=yv}else s=vv;break;case dv:if(s=vv,"/"!=i||"/"!=f.charAt(l+1))continue;l++;break;case vv:if("/"!=i&&"\\"!=i){s=yv;continue}break;case yv:if("@"==i){p&&(f="%40"+f),p=!0,a=yd(f);for(var v=0;v<a.length;v++){var y=a[v];if(":"!=y||d){var g=Zd(y,Xd);d?t.password+=g:t.username+=g}else d=!0}f=""}else if(i==id||"/"==i||"?"==i||"#"==i||"\\"==i&&tv(t)){if(p&&""==f)return"Invalid authority";l-=yd(f).length+1,f="",s=gv}else f+=i;break;case gv:case mv:if(r&&"file"==t.scheme){s=Sv;continue}if(":"!=i||h){if(i==id||"/"==i||"?"==i||"#"==i||"\\"==i&&tv(t)){if(tv(t)&&""==f)return Rd;if(r&&""==f&&(ev(t)||null!==t.port))return;if(u=Wd(t,f))return u;if(f="",s=kv,r)return;continue}"["==i?h=!0:"]"==i&&(h=!1),f+=i}else{if(""==f)return Rd;if(u=Wd(t,f))return u;if(f="",s=bv,r==mv)return}break;case bv:if(!Dd.test(i)){if(i==id||"/"==i||"?"==i||"#"==i||"\\"==i&&tv(t)||r){if(""!=f){var m=parseInt(f,10);if(m>65535)return Id;t.port=tv(t)&&m===Qd[t.scheme]?null:m,f=""}if(r)return;s=kv;continue}return Id}f+=i;break;case wv:if(t.scheme="file","/"==i||"\\"==i)s=xv;else{if(!n||"file"!=n.scheme){s=Av;continue}if(i==id)t.host=n.host,t.path=n.path.slice(),t.query=n.query;else if("?"==i)t.host=n.host,t.path=n.path.slice(),t.query="",s=Ov;else{if("#"!=i){ov(o.slice(l).join(""))||(t.host=n.host,t.path=n.path.slice(),iv(t)),s=Av;continue}t.host=n.host,t.path=n.path.slice(),t.query=n.query,t.fragment="",s=jv}}break;case xv:if("/"==i||"\\"==i){s=Sv;break}n&&"file"==n.scheme&&!ov(o.slice(l).join(""))&&(nv(n.path[0],!0)?t.path.push(n.path[0]):t.host=n.host),s=Av;continue;case Sv:if(i==id||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&nv(f))s=Av;else if(""==f){if(t.host="",r)return;s=kv}else{if(u=Wd(t,f))return u;if("localhost"==t.host&&(t.host=""),r)return;f="",s=kv}continue}f+=i;break;case kv:if(tv(t)){if(s=Av,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=id&&(s=Av,"/"!=i))continue}else t.fragment="",s=jv;else t.query="",s=Ov;break;case Av:if(i==id||"/"==i||"\\"==i&&tv(t)||!r&&("?"==i||"#"==i)){if(".."===(c=(c=f).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(iv(t),"/"==i||"\\"==i&&tv(t)||t.path.push("")):av(f)?"/"==i||"\\"==i&&tv(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&nv(f)&&(t.host&&(t.host=""),f=f.charAt(0)+":"),t.path.push(f)),f="","file"==t.scheme&&(i==id||"?"==i||"#"==i))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==i?(t.query="",s=Ov):"#"==i&&(t.fragment="",s=jv)}else f+=Zd(i,Kd);break;case Ev:"?"==i?(t.query="",s=Ov):"#"==i?(t.fragment="",s=jv):i!=id&&(t.path[0]+=Zd(i,Yd));break;case Ov:r||"#"!=i?i!=id&&("'"==i&&tv(t)?t.query+="%27":t.query+="#"==i?"%23":Zd(i,Yd)):(t.fragment="",s=jv);break;case jv:i!=id&&(t.fragment+=Zd(i,Jd))}l++}},Lv=function(t){var e,r,n=hd(this,Lv,"URL"),o=arguments.length>1?arguments[1]:void 0,i=bd(t),a=Od(n,{type:"URL"});if(void 0!==o)if(o instanceof Lv)e=jd(o);else if(r=Tv(e={},bd(o)))throw TypeError(r);if(r=Tv(a,i,null,e))throw TypeError(r);var u=a.searchParams=new Ad,c=Ed(u);c.updateSearchParams(a.query),c.updateURL=function(){a.query=String(u)||null},cd||(n.href=Rv.call(n),n.origin=Iv.call(n),n.protocol=Pv.call(n),n.username=Cv.call(n),n.password=Dv.call(n),n.host=Mv.call(n),n.hostname=Uv.call(n),n.port=Nv.call(n),n.pathname=Fv.call(n),n.search=qv.call(n),n.searchParams=Bv.call(n),n.hash=$v.call(n))},_v=Lv.prototype,Rv=function(){var t=jd(this),e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,u=t.query,c=t.fragment,s=e+":";return null!==o?(s+="//",ev(t)&&(s+=r+(n?":"+n:"")+"@"),s+=Hd(o),null!==i&&(s+=":"+i)):"file"==e&&(s+="//"),s+=t.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==u&&(s+="?"+u),null!==c&&(s+="#"+c),s},Iv=function(){var t=jd(this),e=t.scheme,r=t.port;if("blob"==e)try{return new Lv(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&tv(t)?e+"://"+Hd(t.host)+(null!==r?":"+r:""):"null"},Pv=function(){return jd(this).scheme+":"},Cv=function(){return jd(this).username},Dv=function(){return jd(this).password},Mv=function(){var t=jd(this),e=t.host,r=t.port;return null===e?"":null===r?Hd(e):Hd(e)+":"+r},Uv=function(){var t=jd(this).host;return null===t?"":Hd(t)},Nv=function(){var t=jd(this).port;return null===t?"":String(t)},Fv=function(){var t=jd(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},qv=function(){var t=jd(this).query;return t?"?"+t:""},Bv=function(){return jd(this).searchParams},$v=function(){var t=jd(this).fragment;return t?"#"+t:""},Gv=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(cd&&fd(_v,{href:Gv(Rv,(function(t){var e=jd(this),r=bd(t),n=Tv(e,r);if(n)throw TypeError(n);Ed(e.searchParams).updateSearchParams(e.query)})),origin:Gv(Iv),protocol:Gv(Pv,(function(t){var e=jd(this);Tv(e,bd(t)+":",uv)})),username:Gv(Cv,(function(t){var e=jd(this),r=yd(bd(t));if(!rv(e)){e.username="";for(var n=0;n<r.length;n++)e.username+=Zd(r[n],Xd)}})),password:Gv(Dv,(function(t){var e=jd(this),r=yd(bd(t));if(!rv(e)){e.password="";for(var n=0;n<r.length;n++)e.password+=Zd(r[n],Xd)}})),host:Gv(Mv,(function(t){var e=jd(this);e.cannotBeABaseURL||Tv(e,bd(t),gv)})),hostname:Gv(Uv,(function(t){var e=jd(this);e.cannotBeABaseURL||Tv(e,bd(t),mv)})),port:Gv(Nv,(function(t){var e=jd(this);rv(e)||(""==(t=bd(t))?e.port=null:Tv(e,t,bv))})),pathname:Gv(Fv,(function(t){var e=jd(this);e.cannotBeABaseURL||(e.path=[],Tv(e,bd(t),kv))})),search:Gv(qv,(function(t){var e=jd(this);""==(t=bd(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",Tv(e,t,Ov)),Ed(e.searchParams).updateSearchParams(e.query)})),searchParams:Gv(Bv),hash:Gv($v,(function(t){var e=jd(this);""!=(t=bd(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",Tv(e,t,jv)):e.fragment=null}))}),pd(_v,"toJSON",(function(){return Rv.call(this)}),{enumerable:!0}),pd(_v,"toString",(function(){return Rv.call(this)}),{enumerable:!0}),kd){var Wv=kd.createObjectURL,zv=kd.revokeObjectURL;Wv&&pd(Lv,"createObjectURL",(function(t){return Wv.apply(kd,arguments)})),zv&&pd(Lv,"revokeObjectURL",(function(t){return zv.apply(kd,arguments)}))}wd(Lv,"URL"),ud({global:!0,forced:!sd,sham:!cd},{URL:Lv});var Vv={},Hv=i,Yv=Nr;jr({global:!0},{Reflect:{}}),Yv(Hv.Reflect,"Reflect",!0);var Jv=Wr,Kv=E,Xv=[].slice,Zv={},Qv=function(t,e,r){if(!(e in Zv)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";Zv[e]=Function("C,a","return new C("+n.join(",")+")")}return Zv[e](t,r)},ty=Function.bind||function(t){var e=Jv(this),r=Xv.call(arguments,1),n=function(){var o=r.concat(Xv.call(arguments));return this instanceof n?Qv(e,o.length,o):e.apply(t,o)};return Kv(e.prototype)&&(n.prototype=e.prototype),n},ey=jr,ry=Wr,ny=Ft,oy=E,iy=fa,ay=ty,uy=u,cy=T("Reflect","construct"),sy=uy((function(){function t(){}return!(cy((function(){}),[],t)instanceof t)})),ly=!uy((function(){cy((function(){}))})),fy=sy||ly;ey({target:"Reflect",stat:!0,forced:fy,sham:fy},{construct:function(t,e){ry(t),ny(e);var r=arguments.length<3?t:ry(arguments[2]);if(ly&&!sy)return cy(t,e,r);if(t==r){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return n.push.apply(n,e),new(ay.apply(t,n))}var o=r.prototype,i=iy(oy(o)?o:Object.prototype),a=Function.apply.call(t,i,e);return oy(a)?a:i}});var py={exports:{}};!function(t){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports}(py);var hy={exports:{}};!function(t){function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports}(hy);var dy={exports:{}};!function(t){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}(dy);var vy={exports:{}},yy={exports:{}};!function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(yy),function(t){var e=yy.exports;t.exports=function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&e(t,r)},t.exports.__esModule=!0,t.exports.default=t.exports}(vy);var gy={exports:{}},my={exports:{}};!function(t){function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(my),function(t){var e=my.exports.default,r=dy.exports;t.exports=function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return r(t)},t.exports.__esModule=!0,t.exports.default=t.exports}(gy);var by={exports:{}};!function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(by);var wy={exports:{}};!function(t){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t},t.exports.__esModule=!0,t.exports.default=t.exports}(wy);var xy=an,Sy=tn?{}.toString:function(){return"[object "+xy(this)+"]"},ky=tn,Ay=Yt.exports,Ey=Sy;ky||Ay(Object.prototype,"toString",Ey,{unsafe:!0})
|
|
18
|
+
this.Twilio=this.Twilio||{},this.Twilio.McsClient=function(e){"use strict";var t=void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{};function n(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}var o,i,s,a={},l={exports:{}};i=r,s=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function o(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(t,r){for(var o=0;o<n.length;o++){var i=n[o];this[i]=o<t?e:this.methodFactory(i,t,r)}this.log=this.debug}function a(e,r,n){return function(){typeof console!==t&&(s.call(this,r,n),this[e].apply(this,arguments))}}function l(n,s,l){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?i:void 0!==console[n]?o(console,n):void 0!==console.log?o(console,"log"):e)}(n)||a.apply(this,arguments)}function c(e,r,o){var i,a=this;r=null==r?"WARN":r;var c="loglevel";function u(){var e;if(typeof window!==t&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(c)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=o||l,a.getLevel=function(){return i},a.setLevel=function(r,o){if("string"==typeof r&&void 0!==a.levels[r.toUpperCase()]&&(r=a.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(i=r,!1!==o&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&c){try{return void(window.localStorage[c]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+r+";"}catch(e){}}}(r),s.call(a,r,e),typeof console===t&&r<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){r=e,u()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(r,!1),function(){if(typeof window!==t&&c){try{return void window.localStorage.removeItem(c)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var h=u();null==h&&(h=r),a.setLevel(h,!1)}var u=new c,h={};u.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new c(e,u.getLevel(),u.methodFactory)),t};var f=typeof window!==t?window.log:void 0;return u.noConflict=function(){return typeof window!==t&&window.log===u&&(window.log=f),u},u.getLoggers=function(){return h},u.default=u,u},(o=l).exports?o.exports=s():i.log=s();let c=e=>crypto.getRandomValues(new Uint8Array(e)),u=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,s="";for(;;){let t=r(o),a=o;for(;a--;)if(s+=e[t[a]&n]||"",s.length===i)return s}}};var h=Object.freeze({__proto__:null,nanoid:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},customAlphabet:function(e){return u(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:21,c)},customRandom:u,urlAlphabet:"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",random:c}),f=n(h);
|
|
19
19
|
/*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/,Object.defineProperty(Vv,"__esModule",{value:!0});var Oy=hy.exports,jy=dy.exports,Ty=vy.exports,Ly=gy.exports,_y=by.exports,Ry=wy.exports;function Iy(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var Py=Iy(py.exports),Cy=Iy(Oy),Dy=Iy(jy),My=Iy(Ty),Uy=Iy(Ly),Ny=Iy(_y),Fy=Iy(Ry);function qy(){}function By(){By.init.call(this)}function $y(t){return void 0===t._maxListeners?By.defaultMaxListeners:t._maxListeners}function Gy(t,e,r){if(e)t.call(r);else for(var n=t.length,o=Xy(t,n),i=0;i<n;++i)o[i].call(r)}function Wy(t,e,r,n){if(e)t.call(r,n);else for(var o=t.length,i=Xy(t,o),a=0;a<o;++a)i[a].call(r,n)}function zy(t,e,r,n,o){if(e)t.call(r,n,o);else for(var i=t.length,a=Xy(t,i),u=0;u<i;++u)a[u].call(r,n,o)}function Vy(t,e,r,n,o,i){if(e)t.call(r,n,o,i);else for(var a=t.length,u=Xy(t,a),c=0;c<a;++c)u[c].call(r,n,o,i)}function Hy(t,e,r,n){if(e)t.apply(r,n);else for(var o=t.length,i=Xy(t,o),a=0;a<o;++a)i[a].apply(r,n)}function Yy(t,e,r,n){var o,i,a,u;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((i=t._events)?(i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),a=i[e]):(i=t._events=new qy,t._eventsCount=0),a){if("function"==typeof a?a=i[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),!a.warned&&(o=$y(t))&&o>0&&a.length>o){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=a.length,u=c,"function"==typeof console.warn?console.warn(u):console.log(u)}}else a=i[e]=r,++t._eventsCount;return t}function Jy(t,e,r){var n=!1;function o(){t.removeListener(e,o),n||(n=!0,r.apply(t,arguments))}return o.listener=r,o}function Ky(t){var e=this._events;if(e){var r=e[t];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Xy(t,e){for(var r=new Array(e);e--;)r[e]=t[e];return r}function Zy(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ny.default(t);if(e){var o=Ny.default(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Uy.default(this,r)}}qy.prototype=Object.create(null),By.EventEmitter=By,By.usingDomains=!1,By.prototype.domain=void 0,By.prototype._events=void 0,By.prototype._maxListeners=void 0,By.defaultMaxListeners=10,By.init=function(){this.domain=null,By.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new qy,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},By.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},By.prototype.getMaxListeners=function(){return $y(this)},By.prototype.emit=function(t){var e,r,n,o,i,a,u,c="error"===t;if(a=this._events)c=c&&null==a.error;else if(!c)return!1;if(u=this.domain,c){if(e=arguments[1],!u){if(e instanceof Error)throw e;var s=new Error('Uncaught, unspecified "error" event. ('+e+")");throw s.context=e,s}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=u,e.domainThrown=!1,u.emit("error",e),!1}if(!(r=a[t]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:Gy(r,l,this);break;case 2:Wy(r,l,this,arguments[1]);break;case 3:zy(r,l,this,arguments[1],arguments[2]);break;case 4:Vy(r,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(n-1),i=1;i<n;i++)o[i-1]=arguments[i];Hy(r,l,this,o)}return!0},By.prototype.addListener=function(t,e){return Yy(this,t,e,!1)},By.prototype.on=By.prototype.addListener,By.prototype.prependListener=function(t,e){return Yy(this,t,e,!0)},By.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,Jy(this,t,e)),this},By.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,Jy(this,t,e)),this},By.prototype.removeListener=function(t,e){var r,n,o,i,a;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[t]))return this;if(r===e||r.listener&&r.listener===e)0==--this._eventsCount?this._events=new qy:(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length;i-- >0;)if(r[i]===e||r[i].listener&&r[i].listener===e){a=r[i].listener,o=i;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new qy,this;delete n[t]}else!function(t,e){for(var r=e,n=r+1,o=t.length;n<o;r+=1,n+=1)t[r]=t[n];t.pop()}(r,o);n.removeListener&&this.emit("removeListener",t,a||e)}return this},By.prototype.off=function(t,e){return this.removeListener(t,e)},By.prototype.removeAllListeners=function(t){var e,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new qy,this._eventsCount=0):r[t]&&(0==--this._eventsCount?this._events=new qy:delete r[t]),this;if(0===arguments.length){for(var n,o=Object.keys(r),i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new qy,this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},By.prototype.listeners=function(t){var e,r,n=this._events;return r=n&&(e=n[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(e):[],r},By.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):Ky.call(t,e)},By.prototype.listenerCount=Ky,By.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var Qy=function(t){My.default(r,t);var e=Zy(r);function r(t){var n;return Py.default(this,r),n=e.call(this),Fy.default(Dy.default(n),"timeout",null),Fy.default(Dy.default(n),"startTimestamp",-1),n.minDelay=t.min,n.maxDelay=t.max,n.initialDelay=t.initial||0,n.maxAttemptsCount=t.maxAttemptsCount||0,n.maxAttemptsTime=t.maxAttemptsTime||0,n.randomness=t.randomness||0,n.inProgress=!1,n.attemptNum=0,n.prevDelay=0,n.currDelay=0,n}return Cy.default(r,[{key:"attempt",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.attemptNum++,this.emit("attempt",this)}},{key:"nextDelay",value:function(t){if("number"==typeof t)return this.prevDelay=0,this.currDelay=t,t;if(0==this.attemptNum)return this.initialDelay;if(1==this.attemptNum)return this.currDelay=this.minDelay,this.currDelay;this.prevDelay=this.currDelay;var e=this.currDelay+this.prevDelay;return this.maxDelay&&e>this.maxDelay&&(this.currDelay=this.maxDelay,e=this.maxDelay),this.currDelay=e,e}},{key:"randomize",value:function(t){var e=t*this.randomness,r=Math.round(Math.random()*e*2-e);return Math.max(0,t+r)}},{key:"scheduleAttempt",value:function(t){var e=this;if(this.maxAttemptsCount&&this.attemptNum>=this.maxAttemptsCount)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt count limit reached"));var r=this.nextDelay(t);if(r=this.randomize(r),this.maxAttemptsTime&&this.startTimestamp+this.maxAttemptsTime<Date.now()+r)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt time limit reached"));this.timeout=setTimeout((function(){return e.attempt()}),r)}},{key:"cleanup",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.inProgress=!1,this.attemptNum=0,this.prevDelay=0,this.currDelay=0}},{key:"start",value:function(){if(this.inProgress)throw new Error("Retrier is already in progress");this.inProgress=!0,this.startTimestamp=Date.now(),this.scheduleAttempt(this.initialDelay)}},{key:"cancel",value:function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null,this.inProgress=!1,this.emit("cancelled"))}},{key:"succeeded",value:function(t){this.emit("succeeded",t)}},{key:"failed",value:function(t,e){if(this.timeout)throw new Error("Retrier attempt is already in progress");this.scheduleAttempt(e)}}]),r}(By),tg=function(t){My.default(r,t);var e=Zy(r);function r(t){var n;return Py.default(this,r),n=e.call(this),Fy.default(Dy.default(n),"resolve",(function(){})),Fy.default(Dy.default(n),"reject",(function(){})),n.retrier=new Qy(t),n}return Cy.default(r,[{key:"run",value:function(t){var e=this;return this.retrier.on("attempt",(function(){t().then((function(t){return e.retrier.succeeded(t)})).catch((function(t){return e.retrier.failed(t)}))})),this.retrier.on("succeeded",(function(t){return e.resolve(t)})),this.retrier.on("cancelled",(function(){return e.reject(new Error("Cancelled"))})),this.retrier.on("failed",(function(t){return e.reject(t)})),new Promise((function(t,r){e.resolve=t,e.reject=r,e.retrier.start()}))}},{key:"cancel",value:function(){this.retrier.cancel()}}]),r}(By);function eg(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Ny.default(t);if(e){var o=Ny.default(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Uy.default(this,r)}}function rg(t){return null!=t}var ng=function(t){My.default(r,t);var e=eg(r);function r(t){var n;Py.default(this,r),n=e.call(this),Fy.default(Dy.default(n),"backoffDelay",0),Fy.default(Dy.default(n),"nextBackoffDelay",0),Fy.default(Dy.default(n),"backoffNumber",0),Fy.default(Dy.default(n),"timeoutID",null),Fy.default(Dy.default(n),"maxNumberOfRetry",-1);var o=t=t||{},i=o.initialDelay,a=o.maxDelay,u=o.randomisationFactor,c=o.factor;if(rg(i)&&i<1)throw new Error("The initial timeout must be equal to or greater than 1.");if(rg(a)&&a<=1)throw new Error("The maximal timeout must be greater than 1.");if(rg(u)&&(u<0||u>1))throw new Error("The randomisation factor must be between 0 and 1.");if(rg(c)&&c<=1)throw new Error("Exponential factor should be greater than 1.");if(n.initialDelay=i||100,n.maxDelay=a||1e4,n.maxDelay<=n.initialDelay)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");return n.randomisationFactor=u||0,n.factor=c||2,n.reset(),n}return Cy.default(r,[{key:"backoff",value:function(t){null==this.timeoutID&&(this.backoffNumber===this.maxNumberOfRetry?(this.emit("fail",t),this.reset()):(this.backoffDelay=this.next(),this.timeoutID=setTimeout(this.onBackoff.bind(this),this.backoffDelay),this.emit("backoff",this.backoffNumber,this.backoffDelay,t)))}},{key:"reset",value:function(){this.backoffDelay=0,this.nextBackoffDelay=this.initialDelay,this.backoffNumber=0,this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=null}},{key:"failAfter",value:function(t){if(t<=0)throw new Error("Expected a maximum number of retry greater than 0 but got ".concat(t));this.maxNumberOfRetry=t}},{key:"next",value:function(){this.backoffDelay=Math.min(this.nextBackoffDelay,this.maxDelay),this.nextBackoffDelay=this.backoffDelay*this.factor;var t=1+Math.random()*this.randomisationFactor;return Math.min(this.maxDelay,Math.round(this.backoffDelay*t))}},{key:"onBackoff",value:function(){this.timeoutID=null,this.emit("ready",this.backoffNumber,this.backoffDelay),this.backoffNumber++}}],[{key:"exponential",value:function(t){return new r(t)}}]),r}(By);Vv.AsyncRetrier=tg,Vv.Backoff=ng;var og=Vv.Retrier=Qy,ig=bl.scope("Network");class ag{constructor(t,e){this.config=t,this.transport=e}backoffConfig(){return Object.assign(ql.backoffConfigDefault,this.config.backoffConfigOverride)}retryWhenThrottled(){var t,e;return null!==(t=null!==(e=this.config.retryWhenThrottledOverride)&&void 0!==e?e:ql.retryWhenThrottledDefault)&&void 0!==t&&t}executeWithRetry(t,e){var r=this;return new Wc(function(){var n=Vc(Js.mark((function n(o,i,a){var u,c;return Js.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:u=new og(r.backoffConfig()),c=[502,503,504],e&&c.push(429),a((()=>{u.cancel(),u.removeAllListeners()})),u.on("attempt",Vc(Js.mark((function e(){var r,n;return Js.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=t(),a((()=>{r.cancel(),u.cancel(),u.removeAllListeners()})),e.next=5,r;case 5:n=e.sent,u.succeeded(n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),c.indexOf(e.t0.status)>-1||"Twilsock disconnected"===e.t0.message?u.failed(e.t0):(u.removeAllListeners(),u.cancel(),i(e.t0));case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))),u.on("succeeded",(t=>{o(t)})),u.on("cancelled",(t=>i(t))),u.on("failed",(t=>i(t))),u.start();case 9:case"end":return n.stop()}}),n)})));return function(t,e,r){return n.apply(this,arguments)}}())}get(t){var e=this;return new Wc(function(){var r=Vc(Js.mark((function r(n,o,i){var a,u,c;return Js.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a={"X-Twilio-Token":e.config.token},u=e.executeWithRetry((()=>e.transport.get(t,a)),e.retryWhenThrottled()),ig.trace("sending GET request to ",t," headers ",a),i((()=>u.cancel())),r.prev=4,r.next=7,u;case 7:c=r.sent,ig.trace("response",c),n(c),r.next=16;break;case 12:r.prev=12,r.t0=r.catch(4),ig.debug("get() error ".concat(r.t0)),o(r.t0);case 16:case"end":return r.stop()}}),r,null,[[4,12]])})));return function(t,e,n){return r.apply(this,arguments)}}())}post(t,r,n,o,i){var a=this,u={"X-Twilio-Token":this.config.token};"undefined"!=typeof FormData&&n instanceof FormData||!o||Object.assign(u,{"Content-Type":o});var c=new URL(t);return r&&c.searchParams.append("Category",r),i&&c.searchParams.append("Filename",i),new Wc(function(){var r=Vc(Js.mark((function r(o,i,s){var l,f;return Js.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return l=a.transport.post(c.href,u,n),s((()=>l.cancel())),ig.trace("sending POST request to ".concat(t," with headers ").concat(u)),r.prev=3,r.next=6,l;case 6:f=r.sent,r.next=17;break;case 9:if(r.prev=9,r.t0=r.catch(3),!(void 0===e.XMLHttpRequest&&n instanceof FormData)){r.next=14;break}return i(new TypeError("Posting FormData supported only with browser engine's FormData")),r.abrupt("return");case 14:return ig.debug("post() error ".concat(r.t0)),i(r.t0),r.abrupt("return");case 17:ig.trace("response",f),o(f);case 19:case"end":return r.stop()}}),r,null,[[3,9]])})));return function(t,e,n){return r.apply(this,arguments)}}())}}var ug={},cg=u,sg=M,lg=dt("species"),fg=function(t){return sg>=51||!cg((function(){var e=[];return(e.constructor={})[lg]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},pg=jr,hg=E,dg=Yc,vg=$e,yg=Ne,gg=A,mg=nl,bg=dt,wg=fg("slice"),xg=bg("species"),Sg=[].slice,kg=Math.max;pg({target:"Array",proto:!0,forced:!wg},{slice:function(t,e){var r,n,o,i=gg(this),a=yg(i.length),u=vg(t,a),c=vg(void 0===e?a:e,a);if(dg(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!dg(r.prototype)?hg(r)&&null===(r=r[xg])&&(r=void 0):r=void 0,r===Array||void 0===r))return Sg.call(i,u,c);for(n=new(void 0===r?Array:r)(kg(c-u,0)),o=0;u<c;u++,o++)u in i&&mg(n,o,i[u]);return n.length=o,n}});var Ag=jr,Eg=E,Og=function(){var t=!1,e=/[ac]/;return e.exec=function(){return t=!0,/./.exec.apply(this,arguments)},!0===e.test("abc")&&t}(),jg=/./.test;Ag({target:"RegExp",proto:!0,forced:!Og},{test:function(t){if("function"!=typeof this.exec)return jg.call(this,t);var e=this.exec(t);if(null!==e&&!Eg(e))throw new Error("RegExp exec method returned something other than an Object or null");return!!e}});var Tg={},Lg=dt;Tg.f=Lg;var _g=i,Rg=et,Ig=Tg,Pg=Ut.f,Cg=function(t){var e=_g.Symbol||(_g.Symbol={});Rg(e,t)||Pg(e,t,{value:Ig.f(t)})},Dg=jr,Mg=i,Ug=T,Ng=c,Fg=F,qg=u,Bg=et,$g=Yc,Gg=E,Wg=$,zg=Ft,Vg=Z,Hg=A,Yg=St,Jg=Sl,Kg=v,Xg=fa,Zg=Ji,Qg=Ie,tm=hu,em=rr,rm=a,nm=Ut,om=s,im=Ht,am=Yt.exports,um=W.exports,cm=ce,sm=ot,lm=dt,fm=Tg,pm=Cg,hm=Nr,dm=ke,vm=us.forEach,ym=ue("hidden"),gm="Symbol",mm=lm("toPrimitive"),bm=dm.set,wm=dm.getterFor(gm),xm=Object.prototype,Sm=Mg.Symbol,km=Ug("JSON","stringify"),Am=rm.f,Em=nm.f,Om=tm.f,jm=om.f,Tm=um("symbols"),Lm=um("op-symbols"),_m=um("string-to-symbol-registry"),Rm=um("symbol-to-string-registry"),Im=um("wks"),Pm=Mg.QObject,Cm=!Pm||!Pm.prototype||!Pm.prototype.findChild,Dm=Ng&&qg((function(){return 7!=Xg(Em({},"a",{get:function(){return Em(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Am(xm,e);n&&delete xm[e],Em(t,e,r),n&&t!==xm&&Em(xm,e,n)}:Em,Mm=function(t,e){var r=Tm[t]=Xg(Sm.prototype);return bm(r,{type:gm,tag:t,description:e}),Ng||(r.description=e),r},Um=function(t,e,r){t===xm&&Um(Lm,e,r),zg(t);var n=Yg(e);return zg(r),Bg(Tm,n)?(r.enumerable?(Bg(t,ym)&&t[ym][n]&&(t[ym][n]=!1),r=Xg(r,{enumerable:Kg(0,!1)})):(Bg(t,ym)||Em(t,ym,Kg(1,{})),t[ym][n]=!0),Dm(t,n,r)):Em(t,n,r)},Nm=function(t,e){zg(t);var r=Hg(e),n=Zg(r).concat($m(r));return vm(n,(function(e){Ng&&!Fm.call(r,e)||Um(t,e,r[e])})),t},Fm=function(t){var e=Yg(t),r=jm.call(this,e);return!(this===xm&&Bg(Tm,e)&&!Bg(Lm,e))&&(!(r||!Bg(this,e)||!Bg(Tm,e)||Bg(this,ym)&&this[ym][e])||r)},qm=function(t,e){var r=Hg(t),n=Yg(e);if(r!==xm||!Bg(Tm,n)||Bg(Lm,n)){var o=Am(r,n);return!o||!Bg(Tm,n)||Bg(r,ym)&&r[ym][n]||(o.enumerable=!0),o}},Bm=function(t){var e=Om(Hg(t)),r=[];return vm(e,(function(t){Bg(Tm,t)||Bg(cm,t)||r.push(t)})),r},$m=function(t){var e=t===xm,r=Om(e?Lm:Hg(t)),n=[];return vm(r,(function(t){!Bg(Tm,t)||e&&!Bg(xm,t)||n.push(Tm[t])})),n};(Fg||(Sm=function(){if(this instanceof Sm)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?Jg(arguments[0]):void 0,e=sm(t),r=function(t){this===xm&&r.call(Lm,t),Bg(this,ym)&&Bg(this[ym],e)&&(this[ym][e]=!1),Dm(this,e,Kg(1,t))};return Ng&&Cm&&Dm(xm,e,{configurable:!0,set:r}),Mm(e,t)},am(Sm.prototype,"toString",(function(){return wm(this).tag})),am(Sm,"withoutSetter",(function(t){return Mm(sm(t),t)})),om.f=Fm,nm.f=Um,rm.f=qm,Qg.f=tm.f=Bm,em.f=$m,fm.f=function(t){return Mm(lm(t),t)},Ng&&(Em(Sm.prototype,"description",{configurable:!0,get:function(){return wm(this).description}}),am(xm,"propertyIsEnumerable",Fm,{unsafe:!0}))),Dg({global:!0,wrap:!0,forced:!Fg,sham:!Fg},{Symbol:Sm}),vm(Zg(Im),(function(t){pm(t)})),Dg({target:gm,stat:!0,forced:!Fg},{for:function(t){var e=Jg(t);if(Bg(_m,e))return _m[e];var r=Sm(e);return _m[e]=r,Rm[r]=e,r},keyFor:function(t){if(!Wg(t))throw TypeError(t+" is not a symbol");if(Bg(Rm,t))return Rm[t]},useSetter:function(){Cm=!0},useSimple:function(){Cm=!1}}),Dg({target:"Object",stat:!0,forced:!Fg,sham:!Ng},{create:function(t,e){return void 0===e?Xg(t):Nm(Xg(t),e)},defineProperty:Um,defineProperties:Nm,getOwnPropertyDescriptor:qm}),Dg({target:"Object",stat:!0,forced:!Fg},{getOwnPropertyNames:Bm,getOwnPropertySymbols:$m}),Dg({target:"Object",stat:!0,forced:qg((function(){em.f(1)}))},{getOwnPropertySymbols:function(t){return em.f(Vg(t))}}),km)&&Dg({target:"JSON",stat:!0,forced:!Fg||qg((function(){var t=Sm();return"[null]"!=km([t])||"{}"!=km({a:t})||"{}"!=km(Object(t))}))},{stringify:function(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(Gg(e)||void 0!==t)&&!Wg(t))return $g(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Wg(e))return e}),o[1]=e,km.apply(null,o)}});Sm.prototype[mm]||im(Sm.prototype,mm,Sm.prototype.valueOf),hm(Sm,gm),cm[ym]=!0;var Gm=jr,Wm=c,zm=i,Vm=et,Hm=E,Ym=Ut.f,Jm=fr,Km=zm.Symbol;if(Wm&&"function"==typeof Km&&(!("description"in Km.prototype)||void 0!==Km().description)){var Xm={},Zm=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof Zm?new Km(t):void 0===t?Km():Km(t);return""===t&&(Xm[e]=!0),e};Jm(Zm,Km);var Qm=Zm.prototype=Km.prototype;Qm.constructor=Zm;var tb=Qm.toString,eb="Symbol(test)"==String(Km("test")),rb=/^Symbol\((.*)\)[^)]+$/;Ym(Qm,"description",{configurable:!0,get:function(){var t=Hm(this)?this.valueOf():this,e=tb.call(t);if(Vm(Xm,t))return"";var r=eb?e.slice(7,-1):e.replace(rb,"$1");return""===r?void 0:r}}),Gm({global:!0,forced:!0},{Symbol:Zm})}Cg("iterator");var nb=c,ob=Ut.f,ib=Function.prototype,ab=ib.toString,ub=/^\s*function ([^ (]*)/,cb="name";nb&&!(cb in ib)&&ob(ib,cb,{configurable:!0,get:function(){try{return ab.call(this).match(ub)[1]}catch(t){return""}}});var sb={exports:{}},lb={exports:{}};!function(t){t.exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports}(lb);var fb={exports:{}};!function(t){t.exports=function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}},t.exports.__esModule=!0,t.exports.default=t.exports}(fb);var pb={exports:{}},hb={exports:{}};!function(t){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports}(hb),function(t){var e=hb.exports;t.exports=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}(pb);var db={exports:{}};!function(t){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}(db),function(t){var e=lb.exports,r=fb.exports,n=pb.exports,o=db.exports;t.exports=function(t,i){return e(t)||r(t,i)||n(t,i)||o()},t.exports.__esModule=!0,t.exports.default=t.exports}(sb);var vb=jr,yb=u,gb=Yc,mb=E,bb=Z,wb=Ne,xb=nl,Sb=Qc,kb=fg,Ab=M,Eb=dt("isConcatSpreadable"),Ob=9007199254740991,jb="Maximum allowed index exceeded",Tb=Ab>=51||!yb((function(){var t=[];return t[Eb]=!1,t.concat()[0]!==t})),Lb=kb("concat"),_b=function(t){if(!mb(t))return!1;var e=t[Eb];return void 0!==e?!!e:gb(t)};vb({target:"Array",proto:!0,forced:!Tb||!Lb},{concat:function(t){var e,r,n,o,i,a=bb(this),u=Sb(a,0),c=0;for(e=-1,n=arguments.length;e<n;e++)if(_b(i=-1===e?a:arguments[e])){if(c+(o=wb(i.length))>Ob)throw TypeError(jb);for(r=0;r<o;r++,c++)r in i&&xb(u,c,i[r])}else{if(c>=Ob)throw TypeError(jb);xb(u,c++,i)}return u.length=c,u}});var Rb={exports:{}},Ib={exports:{}};!function(t){var e=hb.exports;t.exports=function(t){if(Array.isArray(t))return e(t)},t.exports.__esModule=!0,t.exports.default=t.exports}(Ib);var Pb={exports:{}};!function(t){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports}(Pb);var Cb={exports:{}};!function(t){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}(Cb),function(t){var e=Ib.exports,r=Pb.exports,n=pb.exports,o=Cb.exports;t.exports=function(t){return e(t)||r(t)||n(t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports}(Rb);var Db=He.includes,Mb=ba;jr({target:"Array",proto:!0},{includes:function(t){return Db(this,t,arguments.length>1?arguments[1]:void 0)}}),Mb("includes");var Ub=jr,Nb=A,Fb=[].join,qb=w!=Object,Bb=ss("join",",");Ub({target:"Array",proto:!0,forced:qb||!Bb},{join:function(t){return Fb.call(Nb(this),void 0===t?",":t)}});var $b=E,Gb=Math.floor;jr({target:"Number",stat:!0},{isInteger:function(t){return!$b(t)&&isFinite(t)&&Gb(t)===t}});var Wb=x,zb=Sl,Vb="[\t\n\v\f\r \u2028\u2029\ufeff]",Hb=RegExp("^"+Vb+Vb+"*"),Yb=RegExp(Vb+Vb+"*$"),Jb=function(t){return function(e){var r=zb(Wb(e));return 1&t&&(r=r.replace(Hb,"")),2&t&&(r=r.replace(Yb,"")),r}},Kb={start:Jb(1),end:Jb(2),trim:Jb(3)},Xb=c,Zb=i,Qb=br,tw=Yt.exports,ew=et,rw=g,nw=Du,ow=$,iw=bt,aw=u,uw=fa,cw=Ie.f,sw=a.f,lw=Ut.f,fw=Kb.trim,pw="Number",hw=Zb.Number,dw=hw.prototype,vw=rw(uw(dw))==pw,yw=function(t){if(ow(t))throw TypeError("Cannot convert a Symbol value to a number");var e,r,n,o,i,a,u,c,s=iw(t,"number");if("string"==typeof s&&s.length>2)if(43===(e=(s=fw(s)).charCodeAt(0))||45===e){if(88===(r=s.charCodeAt(2))||120===r)return NaN}else if(48===e){switch(s.charCodeAt(1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+s}for(a=(i=s.slice(2)).length,u=0;u<a;u++)if((c=i.charCodeAt(u))<48||c>o)return NaN;return parseInt(i,n)}return+s};if(Qb(pw,!hw(" 0o1")||!hw("0b1")||hw("+0x1"))){for(var gw,mw=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof mw&&(vw?aw((function(){dw.valueOf.call(r)})):rw(r)!=pw)?nw(new hw(yw(e)),r,mw):yw(e)},bw=Xb?cw(hw):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),ww=0;bw.length>ww;ww++)ew(hw,gw=bw[ww])&&!ew(mw,gw)&&lw(mw,gw,sw(hw,gw));mw.prototype=dw,dw.constructor=mw,tw(Zb,pw,mw)}var xw=c,Sw=Ji,kw=A,Aw=s.f,Ew=function(t){return function(e){for(var r,n=kw(e),o=Sw(n),i=o.length,a=0,u=[];i>a;)r=o[a++],xw&&!Aw.call(n,r)||u.push(t?[r,n[r]]:n[r]);return u}},Ow={entries:Ew(!0),values:Ew(!1)}.entries;jr({target:"Object",stat:!0},{entries:function(t){return Ow(t)}}),
|
|
20
|
+
@license
|
|
21
|
+
Copyright (c) 2022 Twilio Inc.
|
|
22
|
+
|
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
24
|
+
|
|
25
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
26
|
+
|
|
27
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(a,"__esModule",{value:!0});var p=l.exports,d=f;function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y=m(p);const g=e=>{const t=y.default.getLevel();y.default.setLevel("warn"),y.default.warn(e),y.default.setLevel(t)};class v extends Error{constructor(){super("Promise was cancelled")}}class w extends Promise{id;rejectPromise;static onCancelCallbackMap=new Map;constructor(e){const t=d.nanoid();let r;super(((n,o)=>(r=o,e((e=>{w.onCancelCallbackMap.delete(t),n(e)}),(e=>{w.onCancelCallbackMap.delete(t),o(e)}),(e=>{w.onCancelCallbackMap.set(t,e)}))))),this.id=t,this.rejectPromise=r}cancel(){return w.onCancelCallbackMap.get(this.id)?.(),this.rejectPromise&&(this.catch((()=>{})),this.rejectPromise(new v)),this}}const b={unknown:"Unknown error",cancelled:"Job was cancelled",timeout:"Timeout occurred",mediaUploadError:"Media upload error",mediaFetchError:"Media fetch error",tooManyAttachments:"Too many attachments",unsupportedEmailBodyContentType:"Unsupported email body content type",unsupportedEmailHistoryContentType:"Unsupported email history content type",transportDisconnected:"Transport has been disconnected",networkBecameUnreachable:"Network became unreachable",unauthorized:"Unauthorized",tokenExpired:"Token expired",tokenUpdatedLocally:"Transport disconnected, token updated locally and will be used at reconnect",tooManyRequests:"Request failed with 429 reply",hostnameUnverified:"Failed on ssl handshake: CERTIFICATE_VERIFY_FAILED",sslHandshakeError:"Failed on ssl handshake: UNAUTHORIZED",closeMessageReceived:"Twilsock received a close message from the server",cannotParse:"Error while parsing an incoming message"};class x extends Error{errorInfo;constructor(e){super(`${e}`),this.errorInfo=e,Object.freeze(e)}}var _=a.CancellablePromise=w;function D(e,t,r,n){var o,i=arguments.length,s=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function T(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function k(e,t){return[`${(new Date).toISOString()} MCS Client ${e}:`].concat(Array.from(t))}a.CancellationError=v,a.Deferred=class{promise;_resolve;_reject;_isDone=!1;constructor(){this.promise=new Promise(((e,t)=>{this._resolve=t=>{this._isDone=!0,e(t)},this._reject=e=>{this._isDone=!0,t(e)}}))}get resolve(){return this._resolve}get reject(){return this._reject}get isDone(){return this._isDone}},a.ErrorInfo=class{reason;message;status;code;description;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:b[e];this.reason=e,this.message=t,this.status=r,this.code=n,this.description=o}toString(){return`${this.description} ${this.status}:${this.code} ${this.message}`}},a.Logger=class{_prefix;_logger;constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this._prefix=t,this._logger=p.getLogger(e)}setLevel(e){this._logger.setLevel(e)}trace(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger.trace.apply(null,this._prepareLine("T",t))}debug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger.debug.apply(null,this._prepareLine("D",t))}info(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger.info.apply(null,this._prepareLine("I",t))}warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger.warn.apply(null,this._prepareLine("W",t))}error(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this._logger.error.apply(null,this._prepareLine("E",t))}_prepareLine(e,t){return[`${(new Date).toISOString()} ${this._prefix} ${e}:`,...t]}},a.TwilioError=x,a.deprecated=(e,t,r)=>(n,o,i)=>{if("function"!=typeof i.value&&void 0===i?.get)throw new Error("The deprecated decorator can only be applied to methods or getters");if("function"==typeof i.value){const n=i.value;return void(i.value=function(){g(`The method ${e} is deprecated${t?", use "+t+" instead":""}${r?", "+r:"."}`);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return n.apply(this,i)})}const s=i.get;i.get=function(){return g(`The getter ${e} is deprecated${t?", use "+t+" instead":""}${r?", "+r:"."}`),s?.apply(this)}},a.deprecationWarning=g;class A{prefix="";constructor(e){this.prefix=null!=e&&e.length>0?e+" ":""}static scope(e){return new A(e)}setLevel(e){l.exports.setLevel(e)}static setLevel(e){l.exports.setLevel(e)}trace(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.trace.apply(null,k(this.prefix+"T",t))}debug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.debug.apply(null,k(this.prefix+"D",t))}info(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.info.apply(null,k(this.prefix+"I",t))}warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.warn.apply(null,k(this.prefix+"W",t))}error(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.error.apply(null,k(this.prefix+"E",t))}static trace(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.trace.apply(null,k("T",t))}static debug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.debug.apply(null,k("D",t))}static info(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.info.apply(null,k("I",t))}static warn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.warn.apply(null,k("W",t))}static error(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.exports.error.apply(null,k("E",t))}}const L=(e,t)=>{return`${r=e,r.startsWith("http")?"":(e=>`https://mcs.${e??"us1"}.twilio.com`)(t)}${e}`;var r};class C{token;retryWhenThrottledOverride;backoffConfigOverride;mediaUrl;mediaSetUrl;region;constructor(e,t,r,n){const o=n.MCS??n??{};this.region=o.region??n.region??"us1",this.mediaUrl=L(t,this.region),this.mediaSetUrl=r?L(r):`${this.mediaUrl}Set`,this.token=e,this.retryWhenThrottledOverride=o.retryWhenThrottledOverride??true,this.backoffConfigOverride=o.backoffConfigOverride??C.backoffConfigDefault}static get backoffConfigDefault(){return{min:1e3,max:4e3,maxAttemptsCount:3}}static get retryWhenThrottledDefault(){return true}updateToken(e){this.token=e}}class E{state;network;config;constructor(e,t,r){this.config=e,this.network=t,this._update(r)}get sid(){return this.state.sid}get serviceSid(){return this.state.serviceSid}get dateCreated(){return this.state.dateCreated}get dateUpdated(){return this.state.dateUpdated}get contentType(){return this.state.contentType}get size(){return this.state.size}get fileName(){return this.state.filename}get filename(){return this.state.filename}get category(){return this.state.category}getContentUrl(){return new _((async(e,t,r)=>{const n=this.network.get(`${this.config.mediaUrl}/${this.sid}`);r((()=>n.cancel()));try{const t=await n;this._update(t.body),e(this.state.contentDirectUrl)}catch(e){t(e)}}))}_update(e){this.state={sid:e.sid,serviceSid:e.service_sid,channelSid:e.channel_sid,messageSid:e.message_sid,dateCreated:e.date_created?new Date(e.date_created):null,dateUploadUpdated:e.date_upload_updated?new Date(e.date_upload_updated):null,dateUpdated:e.date_updated?new Date(e.date_updated):null,size:e.size,contentType:e.content_type,author:e.author,url:e.url,contentUrl:e.links.content,contentDirectUrl:e.links.content_direct_temporary??null,filename:e.filename??null,category:e.category??"media",isMultipartUpstream:e.is_multipart_upstream??!1}}}class $ extends Error{code;body;status;headers;constructor(e,t,r,n,o){super(e),this.code=t,this.body=r,this.status=n,this.headers=o}}const j=t.XMLHttpRequest||{};class O{static request(e,t,r,n){return new _(((o,i,s)=>{const a=new j;let l=!1;s((()=>{a.abort(),l=!0})),a.open(e,t,!0),a.onreadystatechange=function(){if(4!==a.readyState||l)return;const e=(t=a.getAllResponseHeaders())?t.split("\r\n").map((e=>e.split(": "))).filter((e=>2===e.length&&e[1].length>0)).reduce(((e,t)=>(e[t[0]]=t[1],e)),{}):{};var t;const r=function(e){const t=e.getResponseHeader("Content-Type");if(!t||0!==t.indexOf("application/json")||0===e.responseText.length)return e.responseText;try{return JSON.parse(e.responseText)}catch(t){return e.responseText}}(a);if(200<=a.status&&a.status<300)o({status:a.status,headers:e,body:r});else{const t=a.statusText??"NONE";let n;if("string"==typeof r)if(r&&1===r.split("\n",2).length)n=r;else{const e=r.replace(/<.*?>/g,"").split(/\r\n/g).filter((e=>e.length))[0]?.split(" ");n=e?.length>2?e?.slice(1).join(" "):""}else n=JSON.stringify(r);const o=`${a.status}: [${t}] ${n}`;i(new $(o,a.status,r,t,e))}};for(const e in r)a.setRequestHeader(e,r[e]),"Content-Type"===e&&"application/json"===r[e]&&(n=JSON.stringify(n));a.send(n)}))}get(e,t){return O.request("GET",e,t)}post(e,t,r){return O.request("POST",e,t,r)}}var M={};
|
|
32
|
+
/*
|
|
33
|
+
@license
|
|
34
|
+
Copyright (c) 2016, Twilio, Inc.
|
|
35
|
+
|
|
36
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
37
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
38
|
+
copyright notice and this permission notice appear in all copies.
|
|
39
|
+
|
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
41
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
42
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
43
|
+
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
44
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
45
|
+
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
46
|
+
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
47
|
+
|
|
48
|
+
*/function U(){}function S(){S.init.call(this)}function R(e){return void 0===e._maxListeners?S.defaultMaxListeners:e._maxListeners}function N(e,t,r,n){var o,i,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]):(i=e._events=new U,e._eventsCount=0),s){if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(o=R(e))&&o>0&&s.length>o){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,a=l,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=i[t]=r,++e._eventsCount;return e}function I(e,t,r){var n=!1;function o(){e.removeListener(t,o),n||(n=!0,r.apply(e,arguments))}return o.listener=r,o}function P(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function F(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}Object.defineProperty(M,"__esModule",{value:!0}),U.prototype=Object.create(null),S.EventEmitter=S,S.usingDomains=!1,S.prototype.domain=void 0,S.prototype._events=void 0,S.prototype._maxListeners=void 0,S.defaultMaxListeners=10,S.init=function(){this.domain=null,S.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new U,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},S.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},S.prototype.getMaxListeners=function(){return R(this)},S.prototype.emit=function(e){var t,r,n,o,i,s,a,l="error"===e;if(s=this._events)l=l&&null==s.error;else if(!l)return!1;if(a=this.domain,l){if(t=arguments[1],!a){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=s[e]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(e,t,r){if(t)e.call(r);else for(var n=e.length,o=F(e,n),i=0;i<n;++i)o[i].call(r)}(r,u,this);break;case 2:!function(e,t,r,n){if(t)e.call(r,n);else for(var o=e.length,i=F(e,o),s=0;s<o;++s)i[s].call(r,n)}(r,u,this,arguments[1]);break;case 3:!function(e,t,r,n,o){if(t)e.call(r,n,o);else for(var i=e.length,s=F(e,i),a=0;a<i;++a)s[a].call(r,n,o)}(r,u,this,arguments[1],arguments[2]);break;case 4:!function(e,t,r,n,o,i){if(t)e.call(r,n,o,i);else for(var s=e.length,a=F(e,s),l=0;l<s;++l)a[l].call(r,n,o,i)}(r,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(n-1),i=1;i<n;i++)o[i-1]=arguments[i];!function(e,t,r,n){if(t)e.apply(r,n);else for(var o=e.length,i=F(e,o),s=0;s<o;++s)i[s].apply(r,n)}(r,u,this,o)}return!0},S.prototype.addListener=function(e,t){return N(this,e,t,!1)},S.prototype.on=S.prototype.addListener,S.prototype.prependListener=function(e,t){return N(this,e,t,!0)},S.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,I(this,e,t)),this},S.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,I(this,e,t)),this},S.prototype.removeListener=function(e,t){var r,n,o,i,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new U:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length;i-- >0;)if(r[i]===t||r[i].listener&&r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new U,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;n<o;r+=1,n+=1)e[r]=e[n];e.pop()}(r,o);n.removeListener&&this.emit("removeListener",e,s||t)}return this},S.prototype.off=function(e,t){return this.removeListener(e,t)},S.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new U,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new U:delete r[e]),this;if(0===arguments.length){for(var n,o=Object.keys(r),i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new U,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},S.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},S.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):P.call(e,t)},S.prototype.listenerCount=P,S.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};class W extends S{minDelay;maxDelay;initialDelay;maxAttemptsCount;maxAttemptsTime;randomness;prevDelay;currDelay;timeout=null;inProgress;attemptNum;startTimestamp=-1;constructor(e){super(),this.minDelay=e.min,this.maxDelay=e.max,this.initialDelay=e.initial||0,this.maxAttemptsCount=e.maxAttemptsCount||0,this.maxAttemptsTime=e.maxAttemptsTime||0,this.randomness=e.randomness||0,this.inProgress=!1,this.attemptNum=0,this.prevDelay=0,this.currDelay=0}attempt(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.attemptNum++,this.emit("attempt",this)}nextDelay(e){if("number"==typeof e)return this.prevDelay=0,this.currDelay=e,e;if(0==this.attemptNum)return this.initialDelay;if(1==this.attemptNum)return this.currDelay=this.minDelay,this.currDelay;this.prevDelay=this.currDelay;let t=this.currDelay+this.prevDelay;return this.maxDelay&&t>this.maxDelay&&(this.currDelay=this.maxDelay,t=this.maxDelay),this.currDelay=t,t}randomize(e){const t=e*this.randomness,r=Math.round(Math.random()*t*2-t);return Math.max(0,e+r)}scheduleAttempt(e){if(this.maxAttemptsCount&&this.attemptNum>=this.maxAttemptsCount)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt count limit reached"));let t=this.nextDelay(e);if(t=this.randomize(t),this.maxAttemptsTime&&this.startTimestamp+this.maxAttemptsTime<Date.now()+t)return this.cleanup(),void this.emit("failed",new Error("Maximum attempt time limit reached"));this.timeout=setTimeout((()=>this.attempt()),t)}cleanup(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.inProgress=!1,this.attemptNum=0,this.prevDelay=0,this.currDelay=0}start(){if(this.inProgress)throw new Error("Retrier is already in progress");this.inProgress=!0,this.startTimestamp=Date.now(),this.scheduleAttempt(this.initialDelay)}cancel(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null,this.inProgress=!1,this.emit("cancelled"))}succeeded(e){this.emit("succeeded",e)}failed(e,t){if(this.timeout)throw new Error("Retrier attempt is already in progress");this.scheduleAttempt(t)}}function q(e){return null!=e}class z extends S{maxDelay;initialDelay;factor;randomisationFactor;backoffDelay=0;nextBackoffDelay=0;backoffNumber=0;timeoutID=null;maxNumberOfRetry=-1;constructor(e){super(),e=e||{};const{initialDelay:t,maxDelay:r,randomisationFactor:n,factor:o}=e;if(q(t)&&t<1)throw new Error("The initial timeout must be equal to or greater than 1.");if(q(r)&&r<=1)throw new Error("The maximal timeout must be greater than 1.");if(q(n)&&(n<0||n>1))throw new Error("The randomisation factor must be between 0 and 1.");if(q(o)&&o<=1)throw new Error("Exponential factor should be greater than 1.");if(this.initialDelay=t||100,this.maxDelay=r||1e4,this.maxDelay<=this.initialDelay)throw new Error("The maximal backoff delay must be greater than the initial backoff delay.");this.randomisationFactor=n||0,this.factor=o||2,this.reset()}static exponential(e){return new z(e)}backoff(e){null==this.timeoutID&&(this.backoffNumber===this.maxNumberOfRetry?(this.emit("fail",e),this.reset()):(this.backoffDelay=this.next(),this.timeoutID=setTimeout(this.onBackoff.bind(this),this.backoffDelay),this.emit("backoff",this.backoffNumber,this.backoffDelay,e)))}reset(){this.backoffDelay=0,this.nextBackoffDelay=this.initialDelay,this.backoffNumber=0,this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=null}failAfter(e){if(e<=0)throw new Error(`Expected a maximum number of retry greater than 0 but got ${e}`);this.maxNumberOfRetry=e}next(){this.backoffDelay=Math.min(this.nextBackoffDelay,this.maxDelay),this.nextBackoffDelay=this.backoffDelay*this.factor;const e=1+Math.random()*this.randomisationFactor;return Math.min(this.maxDelay,Math.round(this.backoffDelay*e))}onBackoff(){this.timeoutID=null,this.emit("ready",this.backoffNumber,this.backoffDelay),this.backoffNumber++}}M.AsyncRetrier=class extends S{retrier;resolve=()=>{};reject=()=>{};constructor(e){super(),this.retrier=new W(e)}run(e){return this.retrier.on("attempt",(()=>{e().then((e=>this.retrier.succeeded(e))).catch((e=>this.retrier.failed(e)))})),this.retrier.on("succeeded",(e=>this.resolve(e))),this.retrier.on("cancelled",(()=>this.reject(new Error("Cancelled")))),this.retrier.on("failed",(e=>this.reject(e))),new Promise(((e,t)=>{this.resolve=e,this.reject=t,this.retrier.start()}))}cancel(){this.retrier.cancel()}},M.Backoff=z;var B=M.Retrier=W;const H=A.scope("Network");class G{config;transport;constructor(e,t){this.config=e,this.transport=t}backoffConfig(){return Object.assign(C.backoffConfigDefault,this.config.backoffConfigOverride)}retryWhenThrottled(){return this.config.retryWhenThrottledOverride??C.retryWhenThrottledDefault??!1}executeWithRetry(e,t){return new _((async(r,n,o)=>{const i=new B(this.backoffConfig()),s=[502,503,504];t&&s.push(429),o((()=>{i.cancel(),i.removeAllListeners()})),i.on("attempt",(async()=>{try{const t=e();o((()=>{t.cancel(),i.cancel(),i.removeAllListeners()}));const r=await t;i.succeeded(r)}catch(e){s.indexOf(e.status)>-1||"Twilsock disconnected"===e.message?i.failed(e):(i.removeAllListeners(),i.cancel(),n(e))}})),i.on("succeeded",(e=>{r(e)})),i.on("cancelled",(e=>n(e))),i.on("failed",(e=>n(e))),i.start()}))}get(e){return new _((async(t,r,n)=>{const o={"X-Twilio-Token":this.config.token},i=this.executeWithRetry((()=>this.transport.get(e,o)),this.retryWhenThrottled());H.trace("sending GET request to ",e," headers ",o),n((()=>i.cancel()));try{const e=await i;H.trace("response",e),t(e)}catch(e){H.debug(`get() error ${e}`),r(e)}}))}post(e,r,n,o,i){const s={"X-Twilio-Token":this.config.token};"undefined"!=typeof FormData&&n instanceof FormData||!o||Object.assign(s,{"Content-Type":o});const a=new URL(e);return r&&a.searchParams.append("Category",r),i&&a.searchParams.append("Filename",i),new _((async(r,o,i)=>{const l=this.transport.post(a.href,s,n);let c;i((()=>l.cancel())),H.trace(`sending POST request to ${e} with headers ${s}`);try{c=await l}catch(e){return void 0===t.XMLHttpRequest&&n instanceof FormData?void o(new TypeError("Posting FormData supported only with browser engine's FormData")):(H.debug(`post() error ${e}`),void o(e))}H.trace("response",c),r(c)}))}}var J={};
|
|
36
49
|
/*
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
@license
|
|
51
|
+
Copyright (c) 2021 Twilio Inc.
|
|
39
52
|
|
|
40
|
-
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
43
56
|
|
|
44
|
-
|
|
57
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
45
58
|
|
|
46
59
|
|
|
47
|
-
|
|
48
|
-
Object.defineProperty(ug,"__esModule",{value:!0});var jw=sb.exports,Tw=Rb.exports,Lw=hy.exports,_w=py.exports,Rw=vy.exports,Iw=gy.exports,Pw=by.exports;function Cw(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var Dw=Cw(my.exports),Mw=Cw(jw),Uw=Cw(Tw),Nw=Cw(Lw),Fw=Cw(_w),qw=Cw(Rw),Bw=Cw(Iw),$w=Cw(Pw),Gw=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return{checks:e}};function Ww(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return zw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function zw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Vw=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Gw((function(t){var r,n=!1,o=[],i=Ww(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;"string"!=typeof a?(n=n||t instanceof a,o.push("an instance of ".concat(a.name))):(n=n||Dw.default(t)===a,o.push("of type ".concat(a)))}}catch(t){i.e(t)}finally{i.f()}return[n,o]}))};function Hw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Yw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Yw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Jw(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=$w.default(t);if(e){var o=$w.default(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Bw.default(this,r)}}function Kw(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return Xw(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xw(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Xw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Zw=function(t,e){if(e.length>t.length)throw new Error("Expected at most ".concat(t.length," argument(s), but got ").concat(e.length));for(;e.length<t.length;)e.push(void 0);var r,n=Kw(e.entries());try{for(n.s();!(r=n.n()).done;){var o=Mw.default(r.value,2),i=o[0],a=o[1],u=rx(t[i],a),c=Mw.default(u,4),s=c[0],l=c[1],f=c[2],p=c[3];if(!s)throw new Error("Argument ".concat(i+1," is expected to be ").concat(f).concat(p," but got ").concat(l))}}catch(t){n.e(t)}finally{n.f()}},Qw=function(t){var e,r,n;(["undefined","boolean","number","bigint","string"].includes(Dw.default(t))&&(r="string"==typeof t?'"'.concat(t,'"'):"".concat(t)),"object"===Dw.default(t)&&"Object"!==(null==t||null===(e=t.constructor)||void 0===e?void 0:e.name))&&(r=null===t?"null":"instance of ".concat(null==t||null===(n=t.constructor)||void 0===n?void 0:n.name));return r||(r=Dw.default(t)),r},tx=function(t){var e,r=[],n=Kw(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(ex(o))}}catch(t){n.e(t)}finally{n.f()}return r},ex=function(t){var e,r=[],n=Kw(Array.isArray(t)?t:[t]);try{for(n.s();!(e=n.n()).done;){var o=e.value;"string"!=typeof o&&"function"!=typeof o?r.push(o):r.push(Vw(o))}}catch(t){n.e(t)}finally{n.f()}return r},rx=function(t,e){var r,n,o=[],i=!1,a=Kw(t);try{for(a.s();!(n=a.n()).done;){var u,c=Kw(n.value.checks);try{for(c.s();!(u=c.n()).done;){var s=(0,u.value)(e),l=Mw.default(s,3),f=l[0],p=l[1],h=l[2];i=i||f,!r&&h&&(r=h),p&&(o=[].concat(Uw.default(o),"string"==typeof p?[p]:Uw.default(p)))}}catch(t){c.e(t)}finally{c.f()}}}catch(t){a.e(t)}finally{a.f()}if(i)return[!0];var d=r||Qw(e),v=o.length-1;return[!1,d,v>0?"".concat(o.slice(0,v).join(", ")," or ").concat(o[v]):o.join(", "),v>1?";":","]};function nx(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ox(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ox(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ox(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ix=Gw((function(t){return["string"==typeof t&&t.length>0,"a non-empty string"]})),ax=Gw((function(t){return["number"==typeof t&&Number.isInteger(t)&&t>=0,"a non-negative integer"]})),ux=Gw((function(t){return["object"===Dw.default(t)&&null!==t&&!Array.isArray(t),"a pure object (non-null and non-array)"]}));function cx(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return sx(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sx(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function sx(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}ug.array=function(t,e){return Gw((function(r){if(!Array.isArray(r))return[!1,"an array of ".concat(t)];var n,o=cx(r.entries());try{for(o.s();!(n=o.n()).done;){var i=Mw.default(n.value,2),a=i[0],u=i[1],c=rx(ex(e),u),s=Mw.default(c,3),l=s[0],f=s[1],p=s[2];if(!l)return[!1,"a valid array of ".concat(t," (index ").concat(a," should be ").concat(p,")"),"malformed array of ".concat(t," (index ").concat(a," is ").concat(f,")")]}}catch(t){o.e(t)}finally{o.f()}return[!0]}))},ug.custom=Gw;var lx=ug.literal=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Gw((function(t){var r,n=!1,o=[],i=Hw(e);try{for(i.s();!(r=i.n()).done;){var a=r.value;n=n||t===a,o.push("string"==typeof a?'"'.concat(a,'"'):"".concat(a))}}catch(t){i.e(t)}finally{i.f()}return[n,o]}))};ug.nonEmptyArray=function(t,e){return Gw((function(r){if(!Array.isArray(r)||r.length<1)return[!1,"a non-empty array of ".concat(t)];var n,o=nx(r.entries());try{for(o.s();!(n=o.n()).done;){var i=Mw.default(n.value,2),a=i[0],u=i[1],c=rx(ex(e),u),s=Mw.default(c,3),l=s[0],f=s[1],p=s[2];if(!l)return[!1,"a valid non-empty array of ".concat(t," (index ").concat(a," should be ").concat(p,")"),"malformed array of ".concat(t," (index ").concat(a," is ").concat(f,")")]}}catch(t){o.e(t)}finally{o.f()}return[!0]}))};var fx=ug.nonEmptyString=ix;ug.nonNegativeInteger=ax,ug.objectSchema=function(t,e){return Gw((function(r){if("object"!==Dw.default(r)||null===r||Array.isArray(r))return[!1,"valid ".concat(t," (should be a pure object)")];for(var n=0,o=Object.entries(e);n<o.length;n++){var i=Mw.default(o[n],2),a=i[0],u=i[1],c=rx(ex(u),r[a]),s=Mw.default(c,3),l=s[0],f=s[1],p=s[2];if(!l)return[!1,"valid ".concat(t,' (key "').concat(a,'" should be ').concat(p,")"),"malformed ".concat(t,' (key "').concat(a,'" is ').concat(f,")")]}return[!0]}))};var px=ug.pureObject=ux;ug.runtimeTypeValidation=Zw,ug.stringifyReceivedType=Qw,ug.type=Vw;var hx,dx=ug.validateConstructorTypes=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=tx(e);return function(t){return function(t){qw.default(r,t);var e=Jw(r);function r(){Fw.default(this,r);for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return Zw(n,o),e.call.apply(e,[this].concat(o))}return Nw.default(r)}(t)}},vx=ug.validateTypes=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=tx(e);return function(t,e,r){if("function"!=typeof r.value)throw new Error("The validateTypes decorator can only be applied to methods");var o=r.value;r.value=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Zw(n,e),o.apply(this,e)}}},yx=ug.validateTypesAsync=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=tx(e);return function(t,e,r){if("function"!=typeof r.value)throw new Error("The validateTypesAsync decorator can only be applied to methods");var o=r.value;r.value=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];try{Zw(n,e)}catch(t){return Promise.reject(t)}return o.apply(this,e)}}},gx=bl.scope("");return t.default=(hx=class{constructor(t,e,r){var n,o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.options=i,this.options.logLevel=null!==(n=this.options.logLevel)&&void 0!==n?n:"silent",this.config=new ql(t,e,r,this.options),gx.setLevel(this.options.logLevel),this.options.transport=null!==(o=this.options.transport)&&void 0!==o?o:new Dp,this.transport=this.options.transport,this.network=new ag(this.config,this.transport)}updateToken(t){gx.info("updateToken"),this.config.updateToken(t)}get(t){var e=this;return new Wc(function(){var r=Vc(Js.mark((function r(n,o,i){var a,u;return Js.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.network.get("".concat(e.config.mediaUrl,"/").concat(t)),i((()=>a.cancel())),r.prev=2,r.next=5,a;case 5:u=r.sent,n(new Bl(e.config,e.network,u.body)),r.next=12;break;case 9:r.prev=9,r.t0=r.catch(2),o(r.t0);case 12:case"end":return r.stop()}}),r,null,[[2,9]])})));return function(t,e,n){return r.apply(this,arguments)}}())}post(t,e,r,n){var o=this;return new Wc(function(){var i=Vc(Js.mark((function i(a,u,c){var s,l;return Js.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return s=o.network.post(o.config.mediaUrl,null!=r?r:"media",e,t,n),c((()=>s.cancel())),i.prev=2,i.next=5,s;case 5:l=i.sent,a(new Bl(o.config,o.network,l.body)),i.next=12;break;case 9:i.prev=9,i.t0=i.catch(2),u(i.t0);case 12:case"end":return i.stop()}}),i,null,[[2,9]])})));return function(t,e,r){return i.apply(this,arguments)}}())}postFormData(t,e){var r=this;return new Wc(function(){var n=Vc(Js.mark((function n(o,i,a){var u,c;return Js.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=r.network.post(r.config.mediaUrl,null!=e?e:"media",t),a((()=>u.cancel())),n.prev=2,n.next=5,u;case 5:c=n.sent,o(new Bl(r.config,r.network,c.body)),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(2),i(n.t0);case 12:case"end":return n.stop()}}),n,null,[[2,9]])})));return function(t,e,r){return n.apply(this,arguments)}}())}mediaSetGet(t){var e=this;return new Wc(function(){var r=Vc(Js.mark((function r(n,o,i){var a,u,c,s;return Js.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a={command:"get",list:t.map((t=>({media_sid:t})))},u=e.network.post("".concat(e.config.mediaSetUrl),null,a,"application/json"),i((()=>u.cancel())),r.prev=3,r.next=6,u;case 6:c=r.sent,s=c.body.map((t=>{if(200===t.code)return new Bl(e.config,e.network,t.media_record);o("Failed to obtain detailed information about Media items (failed SID ".concat(t.media_record.sid,")"))})),n(s),r.next=14;break;case 11:r.prev=11,r.t0=r.catch(3),o(r.t0);case 14:case"end":return r.stop()}}),r,null,[[3,11]])})));return function(t,e,n){return r.apply(this,arguments)}}())}mediaSetGetContentUrls(t){var e=this;return new Wc(function(){var r=Vc(Js.mark((function r(n,o,i){var a,u,c,s;return Js.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return a={command:"get",list:t.map((t=>({media_sid:t})))},u=e.network.post("".concat(e.config.mediaSetUrl),null,a,"application/json"),i((()=>u.cancel())),r.prev=3,r.next=6,u;case 6:c=r.sent,s=new Map,c.body.forEach((t=>{200===t.code?s.set(t.media_record.sid,t.media_record.links.content_direct_temporary):o("Failed to obtain detailed information about Media items (failed SID ".concat(t.media_record.sid,")"))})),n(s),r.next=15;break;case 12:r.prev=12,r.t0=r.catch(3),o(r.t0);case 15:case"end":return r.stop()}}),r,null,[[3,12]])})));return function(t,e,n){return r.apply(this,arguments)}}())}},r(hx,"version","0.6.1"),hx),Ks([vx(fx),Xs("design:type",Function),Xs("design:paramtypes",[String]),Xs("design:returntype",void 0)],t.default.prototype,"updateToken",null),Ks([yx(fx),Xs("design:type",Function),Xs("design:paramtypes",[String]),Xs("design:returntype",Wc)],t.default.prototype,"get",null),t.default=Ks([dx(fx,fx,[fx,lx(null)],[px,"undefined"]),Xs("design:paramtypes",[String,String,Object,Object])],t.default),t.CancellablePromise=Wc,t.Client=t.default,t.McsClient=t.default,t.McsMedia=Bl,t.Media=Bl,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
60
|
+
*/
|
|
61
|
+
Object.defineProperty(J,"__esModule",{value:!0});const V=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return{checks:t}},X=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return V((e=>{let r=!1;const n=[];for(const o of t)"string"!=typeof o?(r=r||e instanceof o,n.push(`an instance of ${o.name}`)):(r=r||typeof e===o,n.push(`of type ${o}`));return[r,n]}))},Y=(e,t)=>{if(t.length>e.length)throw new Error(`Expected at most ${e.length} argument(s), but got ${t.length}`);for(;t.length<e.length;)t.push(void 0);for(const[r,n]of t.entries()){const[t,o,i,s]=ee(e[r],n);if(t)continue;throw new Error(`Argument ${r+1} is expected to be ${i}${s} but got ${o}`)}},K=e=>{let t;return["undefined","boolean","number","bigint","string"].includes(typeof e)&&(t="string"==typeof e?`"${e}"`:`${e}`),"object"==typeof e&&"Object"!==e?.constructor?.name&&(t=null===e?"null":`instance of ${e?.constructor?.name}`),t||(t=typeof e),t},Z=e=>{const t=[];for(const r of e)t.push(Q(r));return t},Q=e=>{const t=[],r=Array.isArray(e)?e:[e];for(const e of r)"string"!=typeof e&&"function"!=typeof e?t.push(e):t.push(X(e));return t},ee=(e,t)=>{let r,n=[],o=!1;for(const i of e)for(const e of i.checks){const[i,s,a]=e(t);o=o||i,!r&&a&&(r=a),s&&(n="string"==typeof s?[...n,s]:[...n,...s])}if(o)return[!0];const i=r||K(t),s=n.length-1;return[!1,i,s>0?`${n.slice(0,s).join(", ")} or ${n[s]}`:n.join(", "),s>1?";":","]},te=V((e=>["string"==typeof e&&e.length>0,"a non-empty string"])),re=V((e=>["number"==typeof e&&Number.isInteger(e)&&e>=0,"a non-negative integer"])),ne=V((e=>["object"==typeof e&&null!==e&&!Array.isArray(e),"a pure object (non-null and non-array)"]));J.array=(e,t)=>V((r=>{if(!Array.isArray(r))return[!1,`an array of ${e}`];for(const[n,o]of r.entries()){const[r,i,s]=ee(Q(t),o);if(!r)return[!1,`a valid array of ${e} (index ${n} should be ${s})`,`malformed array of ${e} (index ${n} is ${i})`]}return[!0]})),J.custom=V;var oe=J.literal=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return V((e=>{let r=!1;const n=[];for(const o of t)r=r||e===o,n.push("string"==typeof o?`"${o}"`:`${o}`);return[r,n]}))};J.nonEmptyArray=(e,t)=>V((r=>{if(!Array.isArray(r)||r.length<1)return[!1,`a non-empty array of ${e}`];for(const[n,o]of r.entries()){const[r,i,s]=ee(Q(t),o);if(!r)return[!1,`a valid non-empty array of ${e} (index ${n} should be ${s})`,`malformed array of ${e} (index ${n} is ${i})`]}return[!0]}));var ie=J.nonEmptyString=te;J.nonNegativeInteger=re,J.objectSchema=(e,t)=>V((r=>{if("object"!=typeof r||null===r||Array.isArray(r))return[!1,`valid ${e} (should be a pure object)`];for(const[n,o]of Object.entries(t)){const[t,i,s]=ee(Q(o),r[n]);if(!t)return[!1,`valid ${e} (key "${n}" should be ${s})`,`malformed ${e} (key "${n}" is ${i})`]}return[!0]}));var se=J.pureObject=ne;J.runtimeTypeValidation=Y,J.stringifyReceivedType=K,J.type=X;var ae=J.validateConstructorTypes=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=Z(t);return e=>class extends e{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];Y(n,t),super(...t)}}},le=J.validateTypes=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=Z(t);return(e,t,r)=>{if("function"!=typeof r.value)throw new Error("The validateTypes decorator can only be applied to methods");const o=r.value;r.value=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Y(n,t),o.apply(this,t)}}},ce=J.validateTypesAsync=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=Z(t);return(e,t,r)=>{if("function"!=typeof r.value)throw new Error("The validateTypesAsync decorator can only be applied to methods");const o=r.value;r.value=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];try{Y(n,t)}catch(e){return Promise.reject(e)}return o.apply(this,t)}}};const ue=A.scope("");return e.default=class{transport;options;network;config;static version="1.0.0-rc.3";constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this.options=n,this.options.logLevel=this.options.logLevel??"silent",this.config=new C(e,t,r,this.options),ue.setLevel(this.options.logLevel),this.options.transport=this.options.transport??new O,this.transport=this.options.transport,this.network=new G(this.config,this.transport)}updateToken(e){ue.info("updateToken"),this.config.updateToken(e)}get(e){return new _((async(t,r,n)=>{const o=this.network.get(`${this.config.mediaUrl}/${e}`);n((()=>o.cancel()));try{const e=await o;t(new E(this.config,this.network,e.body))}catch(e){r(e)}}))}post(e,t,r,n){return new _((async(o,i,s)=>{const a=this.network.post(this.config.mediaUrl,r??"media",t,e,n);s((()=>a.cancel()));try{const e=await a;o(new E(this.config,this.network,e.body))}catch(e){i(e)}}))}postFormData(e,t){return new _((async(r,n,o)=>{const i=this.network.post(this.config.mediaUrl,t??"media",e);o((()=>i.cancel()));try{const e=await i;r(new E(this.config,this.network,e.body))}catch(e){n(e)}}))}mediaSetGet(e){return new _((async(t,r,n)=>{const o={command:"get",list:e.map((e=>({media_sid:e})))},i=this.network.post(`${this.config.mediaSetUrl}`,null,o,"application/json");n((()=>i.cancel()));try{const e=await i;t(e.body.map((e=>{if(200===e.code)return new E(this.config,this.network,e.media_record);r(`Failed to obtain detailed information about Media items (failed SID ${e.media_record.sid})`)})))}catch(e){r(e)}}))}mediaSetGetContentUrls(e){return new _((async(t,r,n)=>{const o={command:"get",list:e.map((e=>({media_sid:e})))},i=this.network.post(`${this.config.mediaSetUrl}`,null,o,"application/json");n((()=>i.cancel()));try{const e=await i,n=new Map;e.body.forEach((e=>{200===e.code?n.set(e.media_record.sid,e.media_record.links.content_direct_temporary):r(`Failed to obtain detailed information about Media items (failed SID ${e.media_record.sid})`)})),t(n)}catch(e){r(e)}}))}},D([le(ie),T("design:type",Function),T("design:paramtypes",[String]),T("design:returntype",void 0)],e.default.prototype,"updateToken",null),D([ce(ie),T("design:type",Function),T("design:paramtypes",[String]),T("design:returntype",_)],e.default.prototype,"get",null),e.default=D([ae(ie,ie,[ie,oe(null)],[se,"undefined"]),T("design:paramtypes",[String,String,Object,Object])],e.default),e.CancellablePromise=_,e.Client=e.default,e.McsClient=e.default,e.McsMedia=E,e.Media=E,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|
package/dist/client.js
CHANGED
|
@@ -36,7 +36,7 @@ var transport = require('./services/transport.js');
|
|
|
36
36
|
var network = require('./services/network.js');
|
|
37
37
|
var _package = require('./packages/mcs-client/package.json.js');
|
|
38
38
|
var declarativeTypeValidator = require('@twilio/declarative-type-validator');
|
|
39
|
-
var
|
|
39
|
+
var shared = require('@twilio/shared');
|
|
40
40
|
|
|
41
41
|
const log = logger.Logger.scope("");
|
|
42
42
|
/**
|
|
@@ -82,7 +82,7 @@ exports.Client = class Client {
|
|
|
82
82
|
* @param {String} sid - Media's SID
|
|
83
83
|
*/
|
|
84
84
|
get(sid) {
|
|
85
|
-
return new
|
|
85
|
+
return new shared.CancellablePromise(async (resolve, reject, onCancel) => {
|
|
86
86
|
const request = this.network.get(`${this.config.mediaUrl}/${sid}`);
|
|
87
87
|
onCancel(() => request.cancel());
|
|
88
88
|
try {
|
|
@@ -101,7 +101,7 @@ exports.Client = class Client {
|
|
|
101
101
|
* @param {MediaCategory|null} category - category for the media
|
|
102
102
|
*/
|
|
103
103
|
post(contentType, media$1, category, filename) {
|
|
104
|
-
return new
|
|
104
|
+
return new shared.CancellablePromise(async (resolve, reject, onCancel) => {
|
|
105
105
|
const request = this.network.post(this.config.mediaUrl, category !== null && category !== void 0 ? category : "media", media$1, contentType, filename);
|
|
106
106
|
onCancel(() => request.cancel());
|
|
107
107
|
try {
|
|
@@ -121,7 +121,7 @@ exports.Client = class Client {
|
|
|
121
121
|
* @param {MediaCategory|null} category - category for the media
|
|
122
122
|
*/
|
|
123
123
|
postFormData(formData, category) {
|
|
124
|
-
return new
|
|
124
|
+
return new shared.CancellablePromise(async (resolve, reject, onCancel) => {
|
|
125
125
|
const request = this.network.post(this.config.mediaUrl, category !== null && category !== void 0 ? category : "media", formData);
|
|
126
126
|
onCancel(() => request.cancel());
|
|
127
127
|
try {
|
|
@@ -138,7 +138,7 @@ exports.Client = class Client {
|
|
|
138
138
|
* @param mediaSids Array of Media SIDs to get information from.
|
|
139
139
|
*/
|
|
140
140
|
mediaSetGet(mediaSids) {
|
|
141
|
-
return new
|
|
141
|
+
return new shared.CancellablePromise(async (resolve, reject, onCancel) => {
|
|
142
142
|
const query = {
|
|
143
143
|
command: "get",
|
|
144
144
|
list: mediaSids.map((sid) => ({ media_sid: sid })),
|
|
@@ -166,7 +166,7 @@ exports.Client = class Client {
|
|
|
166
166
|
* @param mediaSids array of the media SIDs to get URLs from.
|
|
167
167
|
*/
|
|
168
168
|
mediaSetGetContentUrls(mediaSids) {
|
|
169
|
-
return new
|
|
169
|
+
return new shared.CancellablePromise(async (resolve, reject, onCancel) => {
|
|
170
170
|
const query = {
|
|
171
171
|
command: "get",
|
|
172
172
|
list: mediaSids.map((sid) => ({ media_sid: sid })),
|
|
@@ -202,7 +202,7 @@ tslib_es6.__decorate([
|
|
|
202
202
|
declarativeTypeValidator.validateTypesAsync(declarativeTypeValidator.nonEmptyString),
|
|
203
203
|
tslib_es6.__metadata("design:type", Function),
|
|
204
204
|
tslib_es6.__metadata("design:paramtypes", [String]),
|
|
205
|
-
tslib_es6.__metadata("design:returntype",
|
|
205
|
+
tslib_es6.__metadata("design:returntype", shared.CancellablePromise)
|
|
206
206
|
], exports.Client.prototype, "get", null);
|
|
207
207
|
exports.Client = tslib_es6.__decorate([
|
|
208
208
|
declarativeTypeValidator.validateConstructorTypes(declarativeTypeValidator.nonEmptyString, declarativeTypeValidator.nonEmptyString, [declarativeTypeValidator.nonEmptyString, declarativeTypeValidator.literal(null)], [declarativeTypeValidator.pureObject, "undefined"]),
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import { Logger } from \"./logger\";\nimport { Configuration } from \"./configuration\";\nimport { Media, MediaCategory } from \"./media\";\nimport { Transport } from \"./services/transport\";\nimport { Network } from \"./services/network\";\nimport { version } from \"../package.json\";\nimport * as loglevel from \"loglevel\";\nimport {\n validateTypesAsync,\n validateTypes,\n nonEmptyString,\n literal,\n pureObject,\n validateConstructorTypes,\n} from \"@twilio/declarative-type-validator\";\nimport { CancellablePromise } from \"./cancellable-promise\";\n\nconst log = Logger.scope(\"\");\n//log.setLevel('trace');\n\nexport type LogLevel = loglevel.LogLevelDesc | null;\n\nexport interface Options {\n region?: string;\n logLevel?: loglevel.LogLevelDesc;\n transport?: Transport;\n}\n\n/**\n * @classdesc A Client provides an interface for Media Content Service\n */\n@validateConstructorTypes(\n nonEmptyString,\n nonEmptyString,\n [nonEmptyString, literal(null)],\n [pureObject, \"undefined\"]\n)\nclass Client {\n // eslint-disable-next-line\n private readonly transport: any;\n private options: Options;\n private network: Network;\n private config: Configuration;\n public static readonly version: string = version;\n\n /**\n * Base URLs must be full URLs with host. If host is not provided it will be generated from a default configuration\n * template using options.region.\n *\n * @param {String} token - Access token\n * @param {String} baseUrl - Base URL for Media Content Service Media resource, i.e. /v1/Services/{serviceSid}/Media\n * @param {String} baseSetUrl - Base URL for Media Content Service MediaSet resource, i.e. /v1/Services/{serviceSid}/MediaSet\n * @param {Client#ClientOptions} [options] - Options to customize the Client\n */\n constructor(\n token: string,\n baseUrl: string,\n baseSetUrl: string | null,\n options: Options = {}\n ) {\n this.options = options;\n this.options.logLevel = this.options.logLevel ?? \"silent\";\n this.config = new Configuration(token, baseUrl, baseSetUrl, this.options);\n\n log.setLevel(this.options.logLevel);\n\n this.options.transport = this.options.transport ?? new Transport();\n\n this.transport = this.options.transport;\n this.network = new Network(this.config, this.transport);\n }\n\n /**\n * These options can be passed to Client constructor\n * @typedef {Object} Client#ClientOptions\n * @property {String} [logLevel='silent'] - The level of logging to enable. Valid options\n * (from strictest to broadest): ['silent', 'error', 'warn', 'info', 'debug', 'trace']\n */\n\n /**\n * Update the token used for Client operations\n * @param {String} token - The JWT string of the new token\n * @returns {void}\n */\n @validateTypes(nonEmptyString)\n public updateToken(token: string): void {\n log.info(\"updateToken\");\n this.config.updateToken(token);\n }\n\n /**\n * Gets media from media service\n * @param {String} sid - Media's SID\n */\n @validateTypesAsync(nonEmptyString)\n public get(sid: string): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.get(`${this.config.mediaUrl}/${sid}`);\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Posts raw content to media service\n * @param {String} contentType - content type of media\n * @param {String|Buffer|Blob} media - content to post\n * @param {MediaCategory|null} category - category for the media\n */\n public post(\n contentType: string,\n media: string | Buffer | Blob,\n category: MediaCategory | null,\n filename?: string\n ): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.post(\n this.config.mediaUrl,\n category ?? \"media\",\n media,\n contentType,\n filename\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Posts FormData to media service. Can be used only with browser engine's FormData.\n * In non-browser FormData case the method will do promise reject with\n * new TypeError(\"Posting FormData supported only with browser engine's FormData\")\n * @param {FormData} formData - form data to post\n * @param {MediaCategory|null} category - category for the media\n */\n public postFormData(\n formData: FormData,\n category?: MediaCategory | null\n ): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.post(\n this.config.mediaUrl,\n category ?? \"media\",\n formData\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Retrieve information about multiple media SIDs at the same time.\n * @param mediaSids Array of Media SIDs to get information from.\n */\n public mediaSetGet(mediaSids: string[]): CancellablePromise<Media[]> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const query = {\n command: \"get\",\n list: mediaSids.map((sid) => ({ media_sid: sid })),\n };\n const request = this.network.post(\n `${this.config.mediaSetUrl}`,\n null,\n query,\n \"application/json\"\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n const media = response.body.map((item) => {\n if (item.code !== 200) {\n reject(\n `Failed to obtain detailed information about Media items (failed SID ${item.media_record.sid})`\n );\n return;\n }\n return new Media(this.config, this.network, item.media_record);\n });\n\n resolve(media);\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Retrieve temporary URLs for a set of media SIDs.\n * @param mediaSids array of the media SIDs to get URLs from.\n */\n public mediaSetGetContentUrls(\n mediaSids: string[]\n ): CancellablePromise<Map<string, string>> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const query = {\n command: \"get\",\n list: mediaSids.map((sid) => ({ media_sid: sid })),\n };\n const request = this.network.post(\n `${this.config.mediaSetUrl}`,\n null,\n query,\n \"application/json\"\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n const urls = new Map();\n response.body.forEach((item) => {\n if (item.code !== 200) {\n reject(\n `Failed to obtain detailed information about Media items (failed SID ${item.media_record.sid})`\n );\n return;\n }\n urls.set(\n item.media_record.sid,\n item.media_record.links.content_direct_temporary\n );\n });\n\n resolve(urls);\n } catch (e) {\n reject(e);\n }\n });\n }\n}\n\n// Proper renames should happen in index.ts,\n// otherwise it might screw up exported TS types information.\nexport { Client, Media, MediaCategory };\n"],"names":["Logger","Client","Configuration","Transport","Network","CancellablePromise","Media","media","version","__decorate","validateTypes","nonEmptyString","validateTypesAsync","validateConstructorTypes","literal","pureObject"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,GAAG,GAAGA,aAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAW7B;;AAEG;AAOGC,cAAM,GAAZ,MAAM,MAAM,CAAA;AAQV;;;;;;;;AAQG;AACH,IAAA,WAAA,CACE,KAAa,EACb,OAAe,EACf,UAAyB,EACzB,UAAmB,EAAE,EAAA;;AAErB,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,QAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,CAAC,QAAQ,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,QAAQ,CAAC;AAC1D,QAAA,IAAI,CAAC,MAAM,GAAG,IAAIC,2BAAa,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAE1E,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEpC,QAAA,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,CAAA,EAAA,GAAA,IAAI,CAAC,OAAO,CAAC,SAAS,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GAAI,IAAIC,mBAAS,EAAE,CAAC;QAEnE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;AACxC,QAAA,IAAI,CAAC,OAAO,GAAG,IAAIC,eAAO,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;KACzD;AAED;;;;;AAKG;AAEH;;;;AAIG;AAEI,IAAA,WAAW,CAAC,KAAa,EAAA;AAC9B,QAAA,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACxB,QAAA,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAChC;AAED;;;AAGG;AAEI,IAAA,GAAG,CAAC,GAAW,EAAA;QACpB,OAAO,IAAIC,qCAAkB,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAI;AAChE,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAA,CAAE,CAAC,CAAC;YAEnE,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjC,IAAI;AACF,gBAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;AAC/B,gBAAA,OAAO,CAAC,IAAIC,WAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,aAAA;AAAC,YAAA,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;AAED;;;;;AAKG;AACI,IAAA,IAAI,CACT,WAAmB,EACnBC,OAA6B,EAC7B,QAA8B,EAC9B,QAAiB,EAAA;QAEjB,OAAO,IAAIF,qCAAkB,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAI;AAChE,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAR,QAAQ,GAAI,OAAO,EACnBE,OAAK,EACL,WAAW,EACX,QAAQ,CACT,CAAC;YAEF,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjC,IAAI;AACF,gBAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;AAC/B,gBAAA,OAAO,CAAC,IAAID,WAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,aAAA;AAAC,YAAA,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;AAED;;;;;;AAMG;IACI,YAAY,CACjB,QAAkB,EAClB,QAA+B,EAAA;QAE/B,OAAO,IAAID,qCAAkB,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAI;YAChE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAC/B,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,QAAQ,KAAR,IAAA,IAAA,QAAQ,KAAR,KAAA,CAAA,GAAA,QAAQ,GAAI,OAAO,EACnB,QAAQ,CACT,CAAC;YAEF,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjC,IAAI;AACF,gBAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;AAC/B,gBAAA,OAAO,CAAC,IAAIC,WAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,aAAA;AAAC,YAAA,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;AAED;;;AAGG;AACI,IAAA,WAAW,CAAC,SAAmB,EAAA;QACpC,OAAO,IAAID,qCAAkB,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAI;AAChE,YAAA,MAAM,KAAK,GAAG;AACZ,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;aACnD,CAAC;YACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAC/B,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAC5B,IAAI,EACJ,KAAK,EACL,kBAAkB,CACnB,CAAC;YAEF,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjC,IAAI;AACF,gBAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;gBAC/B,MAAME,OAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,KAAI;AACvC,oBAAA,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;wBACrB,MAAM,CACJ,uEAAuE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAG,CAAA,CAAA,CAChG,CAAC;wBACF,OAAO;AACR,qBAAA;AACD,oBAAA,OAAO,IAAID,WAAK,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;AACjE,iBAAC,CAAC,CAAC;gBAEH,OAAO,CAACC,OAAK,CAAC,CAAC;AAChB,aAAA;AAAC,YAAA,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;AAED;;;AAGG;AACI,IAAA,sBAAsB,CAC3B,SAAmB,EAAA;QAEnB,OAAO,IAAIF,qCAAkB,CAAC,OAAO,OAAO,EAAE,MAAM,EAAE,QAAQ,KAAI;AAChE,YAAA,MAAM,KAAK,GAAG;AACZ,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;aACnD,CAAC;YACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAC/B,CAAA,EAAG,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,EAC5B,IAAI,EACJ,KAAK,EACL,kBAAkB,CACnB,CAAC;YAEF,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;YAEjC,IAAI;AACF,gBAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC;AAC/B,gBAAA,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;gBACvB,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AAC7B,oBAAA,IAAI,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE;wBACrB,MAAM,CACJ,uEAAuE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAG,CAAA,CAAA,CAChG,CAAC;wBACF,OAAO;AACR,qBAAA;AACD,oBAAA,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,YAAY,CAAC,GAAG,EACrB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CACjD,CAAC;AACJ,iBAAC,CAAC,CAAC;gBAEH,OAAO,CAAC,IAAI,CAAC,CAAC;AACf,aAAA;AAAC,YAAA,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,CAAC,CAAC,CAAC;AACX,aAAA;AACH,SAAC,CAAC,CAAC;KACJ;EACF;AAjNwBJ,cAAO,CAAA,OAAA,GAAWO,gBAAO,CAAC;AA0CjDC,oBAAA,CAAA;IADCC,sCAAa,CAACC,uCAAc,CAAC;;;;AAI7B,CAAA,EAAAV,cAAA,CAAA,SAAA,EAAA,aAAA,EAAA,IAAA,CAAA,CAAA;AAODQ,oBAAA,CAAA;IADCG,2CAAkB,CAACD,uCAAc,CAAC;;;8CACVN,qCAAkB,CAAA;AAa1C,CAAA,EAAAJ,cAAA,CAAA,SAAA,EAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AAvEGA,cAAM,GAAAQ,oBAAA,CAAA;AANX,IAAAI,iDAAwB,CACvBF,uCAAc,EACdA,uCAAc,EACd,CAACA,uCAAc,EAAEG,gCAAO,CAAC,IAAI,CAAC,CAAC,EAC/B,CAACC,mCAAU,EAAE,WAAW,CAAC,CAC1B;;AACK,CAAA,EAAAd,cAAM,CAuNX;;;;"}
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../src/client.ts"],"sourcesContent":["import { Logger } from \"./logger\";\nimport { Configuration } from \"./configuration\";\nimport { Media, MediaCategory } from \"./media\";\nimport { Transport } from \"./services/transport\";\nimport { Network } from \"./services/network\";\nimport { version } from \"../package.json\";\nimport * as loglevel from \"loglevel\";\nimport {\n validateTypesAsync,\n validateTypes,\n nonEmptyString,\n literal,\n pureObject,\n validateConstructorTypes,\n} from \"@twilio/declarative-type-validator\";\nimport { CancellablePromise } from \"@twilio/shared\";\n\nconst log = Logger.scope(\"\");\n//log.setLevel('trace');\n\nexport type LogLevel = loglevel.LogLevelDesc | null;\n\nexport interface Options {\n region?: string;\n logLevel?: loglevel.LogLevelDesc;\n transport?: Transport;\n}\n\n/**\n * @classdesc A Client provides an interface for Media Content Service\n */\n@validateConstructorTypes(\n nonEmptyString,\n nonEmptyString,\n [nonEmptyString, literal(null)],\n [pureObject, \"undefined\"]\n)\nclass Client {\n // eslint-disable-next-line\n private readonly transport: any;\n private options: Options;\n private network: Network;\n private config: Configuration;\n public static readonly version: string = version;\n\n /**\n * Base URLs must be full URLs with host. If host is not provided it will be generated from a default configuration\n * template using options.region.\n *\n * @param {String} token - Access token\n * @param {String} baseUrl - Base URL for Media Content Service Media resource, i.e. /v1/Services/{serviceSid}/Media\n * @param {String} baseSetUrl - Base URL for Media Content Service MediaSet resource, i.e. /v1/Services/{serviceSid}/MediaSet\n * @param {Client#ClientOptions} [options] - Options to customize the Client\n */\n constructor(\n token: string,\n baseUrl: string,\n baseSetUrl: string | null,\n options: Options = {}\n ) {\n this.options = options;\n this.options.logLevel = this.options.logLevel ?? \"silent\";\n this.config = new Configuration(token, baseUrl, baseSetUrl, this.options);\n\n log.setLevel(this.options.logLevel);\n\n this.options.transport = this.options.transport ?? new Transport();\n\n this.transport = this.options.transport;\n this.network = new Network(this.config, this.transport);\n }\n\n /**\n * These options can be passed to Client constructor\n * @typedef {Object} Client#ClientOptions\n * @property {String} [logLevel='silent'] - The level of logging to enable. Valid options\n * (from strictest to broadest): ['silent', 'error', 'warn', 'info', 'debug', 'trace']\n */\n\n /**\n * Update the token used for Client operations\n * @param {String} token - The JWT string of the new token\n * @returns {void}\n */\n @validateTypes(nonEmptyString)\n public updateToken(token: string): void {\n log.info(\"updateToken\");\n this.config.updateToken(token);\n }\n\n /**\n * Gets media from media service\n * @param {String} sid - Media's SID\n */\n @validateTypesAsync(nonEmptyString)\n public get(sid: string): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.get(`${this.config.mediaUrl}/${sid}`);\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Posts raw content to media service\n * @param {String} contentType - content type of media\n * @param {String|Buffer|Blob} media - content to post\n * @param {MediaCategory|null} category - category for the media\n */\n public post(\n contentType: string,\n media: string | Buffer | Blob,\n category: MediaCategory | null,\n filename?: string\n ): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.post(\n this.config.mediaUrl,\n category ?? \"media\",\n media,\n contentType,\n filename\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Posts FormData to media service. Can be used only with browser engine's FormData.\n * In non-browser FormData case the method will do promise reject with\n * new TypeError(\"Posting FormData supported only with browser engine's FormData\")\n * @param {FormData} formData - form data to post\n * @param {MediaCategory|null} category - category for the media\n */\n public postFormData(\n formData: FormData,\n category?: MediaCategory | null\n ): CancellablePromise<Media> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const request = this.network.post(\n this.config.mediaUrl,\n category ?? \"media\",\n formData\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n resolve(new Media(this.config, this.network, response.body));\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Retrieve information about multiple media SIDs at the same time.\n * @param mediaSids Array of Media SIDs to get information from.\n */\n public mediaSetGet(mediaSids: string[]): CancellablePromise<Media[]> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const query = {\n command: \"get\",\n list: mediaSids.map((sid) => ({ media_sid: sid })),\n };\n const request = this.network.post(\n `${this.config.mediaSetUrl}`,\n null,\n query,\n \"application/json\"\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n const media = response.body.map((item) => {\n if (item.code !== 200) {\n reject(\n `Failed to obtain detailed information about Media items (failed SID ${item.media_record.sid})`\n );\n return;\n }\n return new Media(this.config, this.network, item.media_record);\n });\n\n resolve(media);\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Retrieve temporary URLs for a set of media SIDs.\n * @param mediaSids array of the media SIDs to get URLs from.\n */\n public mediaSetGetContentUrls(\n mediaSids: string[]\n ): CancellablePromise<Map<string, string>> {\n return new CancellablePromise(async (resolve, reject, onCancel) => {\n const query = {\n command: \"get\",\n list: mediaSids.map((sid) => ({ media_sid: sid })),\n };\n const request = this.network.post(\n `${this.config.mediaSetUrl}`,\n null,\n query,\n \"application/json\"\n );\n\n onCancel(() => request.cancel());\n\n try {\n const response = await request;\n const urls = new Map();\n response.body.forEach((item) => {\n if (item.code !== 200) {\n reject(\n `Failed to obtain detailed information about Media items (failed SID ${item.media_record.sid})`\n );\n return;\n }\n urls.set(\n item.media_record.sid,\n item.media_record.links.content_direct_temporary\n );\n });\n\n resolve(urls);\n } catch (e) {\n reject(e);\n }\n });\n }\n}\n\n// Proper renames should happen in index.ts,\n// otherwise it might screw up exported TS types information.\nexport { Client, Media, MediaCategory };\n"],"names":["Logger","Client","Configuration","Transport","Network","CancellablePromise","Media","media","version","__decorate","validateTypes","nonEmptyString","validateTypesAsync","validateConstructorTypes","literal","pureObject"],"mappings":"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"}
|