!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):t.ES6Promise=e()}(this,function(){"use strict";functiont(t){vare=typeoft;returnnull!==t&&("object"===e||"function"===e)}functione(t){return"function"==typeoft}functionn(t){I=t}functionr(t){J=t}functiono(){returnfunction(){returnprocess.nextTick(a)}}functioni(){return"undefined"!=typeofH?function(){H(a)}:c()}functions(){vart=0,e=newV(a),n=document.createTextNode("");returne.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}functionu(){vart=newMessageChannel;returnt.port1.onmessage=a,function(){returnt.port2.postMessage(0)}}functionc(){vart=setTimeout;returnfunction(){returnt(a,1)}}functiona(){for(vart=0;t<G;t+=2){vare=$[t],n=$[t+1];e(n),$[t]=void0,$[t+1]=void0}G=0}functionf(){try{vart=require,e=t("vertx");returnH=e.runOnLoop||e.runOnContext,i()}catch(n){returnc()}}functionl(t,e){varn=arguments,r=this,o=newthis.constructor(p);void0===o[et]&&k(o);vari=r._state;returni?!function(){vart=n[i-1];J(function(){returnx(i,o,t,r._result)})}():E(r,o,t,e),o}functionh(t){vare=this;if(t&&"object"==typeoft&&t.constructor===e)returnt;varn=newe(p);returng(n,t),n}functionp(){}functionv(){returnnewTypeError("You cannot resolve a promise with itself")}functiond(){returnnewTypeError("A promises callback cannot return that same promise.")}function_(t){try{returnt.then}catch(e){returnit.error=e,it}}functiony(t,e,n,r){try{t.call(e,n,r)}catch(o){returno}}functionm(t,e,n){J(function(t){varr=!1,o=y(n,e,function(n){r||(r=!0,e!==n?g(t,n):S(t,n))},function(e){r||(r=!0,j(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&o&&(r=!0,j(t,o))},t)}functionb(t,e){e._state===rt?S(t,e._result):e._state===ot?j(t,e._result):E(e,void0,function(e){returng(t,e)},function(e){returnj(t,e)})}functionw(t,n,r){n.constructor===t.constructor&&r===l&&n.constructor.resolve===h?b(t,n):r===it?(j(t,it.error),it.error=null):void0===r?S(t,n):e(r)?m(t,n,r):S(t,n)}functiong(e,n){e===n?j(e,v()):t(n)?w(e,n,_(n)):S(e,n)}functionA(t){t._onerror&&t._onerror(t._result),T(t)}functionS(t,e){t._state===nt&&(t._result=e,t._state=rt,0!==t._subscribers.length&&J(T,t))}functionj(t,e){t._state===nt&&(t._state=ot,t._result=e,J(A,t))}functionE(t,e,n,r){varo=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+rt]=n,o[i+ot]=r,0===i&&t._state&&J(T,t)}functionT(t){vare=t._subscribers,n=t._state;if(0!==e.length){for(varr=void0,o=void0,i=t._result,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?x(n,r,o,i):o(i);t._subscribers.length=0}}functionM(){this.error=null}functionP(t,e){try{returnt(e)}catch(n){returnst.error=n,st}}functionx(t,n,r,o){vari=e(r),s=void0,u=void0,c=void0,a=void0;if(i){if(s=P(r,o),s===st?(a=!0,u=s.error,s.error=null):c=!0,n===s)returnvoidj(n,d())}elses=o,c=!0;n._state!==nt||(i&&c?g(n,s):a?j(n,u):t===rt?S(n,s):t===ot&&j(n,s))}functionC(t,e){try{e(function(e){g(t,e)},function(e){j(t,e)})}catch(n){j(t,n)}}functionO(){returnut++}functionk(t){t[et]=ut++,t._state=void0,t._result=void0,t._subscribers=[]}functionY(t,e){this._instanceConstructor=t,this.promise=newt(p),this.promise[et]||k(this.promise),B(e)?(this.length=e.length,this._remaining=e.length,this._result=newArray(this.length),0===this.length?S(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&S(this.promise,this._result))):j(this.promise,q())}functionq(){returnnewError("Array Methods must be provided an Array")}functionF(t){returnnewY(this,t).promise}functionD(t){vare=this;returnnewe(B(t)?function(n,r){for(varo=t.length,i=0;i<o;i++)e.resolve(t[i]).then(n,r)}:function(t,e){returne(newTypeError("You must pass an array to race."))})}functionK(t){vare=this,n=newe(p);returnj(n,t),n}functionL(){thrownewTypeError("You must pass a resolver function as the first argument to the promise constructor")}functionN(){thrownewTypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}functionU(t){this[et]=O(),this._result=this._state=void0,this._subscribers=[],p!==t&&("function"!=typeoft&&L(),thisinstanceofU?C(this,t):N())}functionW(){vart=void0;if("undefined"!=typeofglobal)t=global;elseif("undefined"!=typeofself)t=self;elsetry{t=Function("return this")()}catch(e){thrownewError("polyfill failed because global object is unavailable in this environment")}varn=t.Promise;if(n){varr=null;try{r=Object.prototype.toString.call(n.resolve())}catch(e){}if("[object Promise]"===r&&!n.cast)return}t.Promise=U}varz=void0;z=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};varB=z,G=0,H=void0,I=void0,J=function(t,e){$[G]=t,$[G+1]=e,G+=2,2===G&&(I?I(a):tt())},Q="undefined"!=typeofwindow?window:void0,R=Q||{},V=R.MutationObserver||R.WebKitMutationObserver,X="undefined"==typeofself&&"undefined"!=typeofprocess&&"[object process]"==={}.toString.call(process),Z="undefined"!=typeofUint8ClampedArray&&"undefined"!=typeofimportScripts&&"undefined"!=typeofMessageChannel,$=newArray(1e3),tt=void0;tt=X?o():V?s():Z?u():void0===Q&&"function"==typeofrequire?f():c();varet=Math.random().toString(36).substring(16),nt=void0,rt=1,ot=2,it=newM,st=newM,ut=0;returnY.prototype._enumerate=function(t){for(vare=0;this._state===nt&&e<t.length;e++)this._eachEntry(t[e],e)},Y.prototype._eachEntry=function(t,e){varn=this._instanceConstructor,r=n.resolve;if(r===h){varo=_(t);if(o===l&&t._state!==nt)this._settledAt(t._state,e,t._result);elseif("function"!=typeofo)this._remaining--,this._result[e]=t;elseif(n===U){vari=newn(p);w(i,t,o),this._willSettleAt(i,e)}elsethis._willSettleAt(newn(function(e){returne(t)}),e)}elsethis._willSettleAt(r(t),e)},Y.prototype._settledAt=function(t,e,n){varr=this.promise;r._state===nt&&(this._remaining--,t===ot?j(r,n):this._result[e]=n),0===this._remaining&&S(r,this._result)},Y.prototype._willSettleAt=function(t,e){varn=this;E(t,void0,function(t){returnn._settledAt(rt,e,t)},function(t){returnn._settledAt(ot,e,t)})},U.all=F,U.race=D,U.resolve=h,U.reject=K,U._setScheduler=n,U._setAsap=r,U._asap=J,U.prototype={constructor:U,then:l,"catch":function(t){returnthis.then(null,t)}},U.polyfill=W,U.Promise=U,U.polyfill(),U});