!function(e,n){"object"==typeofexports&&"undefined"!=typeofmodule?n():"function"==typeofdefine&&define.amd?define(n):n()}(0,function(){"use strict";functione(){}functionn(e){if(!(thisinstanceofn))thrownewTypeError("Promises must be constructed via new");if("function"!=typeofe)thrownewTypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(e,this)}functiont(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,n._immediateFn(function(){varn=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){vari;try{i=n(e._value)}catch(f){returnvoidr(t.promise,f)}o(t.promise,i)}else(1===e._state?o:r)(t.promise,e._value)})):e._deferreds.push(t)}functiono(e,t){try{if(t===e)thrownewTypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeoft||"function"==typeoft)){varo=t.then;if(tinstanceofn)returne._state=3,e._value=t,voidi(e);if("function"==typeofo)returnvoidf(function(e,n){returnfunction(){e.apply(n,arguments)}}(o,t),e)}e._state=1,e._value=t,i(e)}catch(u){r(e,u)}}functionr(e,n){e._state=2,e._value=n,i(e)}functioni(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(varo=0,r=e._deferreds.length;r>o;o++)t(e,e._deferreds[o]);e._deferreds=null}functionf(e,n){vart=!1;try{e(function(e){t||(t=!0,o(n,e))},function(e){t||(t=!0,r(n,e))})}catch(i){if(t)return;t=!0,r(n,i)}}varu=setTimeout;n.prototype["catch"]=function(e){returnthis.then(null,e)},n.prototype.then=function(n,o){varr=newthis.constructor(e);returnt(this,newfunction(e,n,t){this.onFulfilled="function"==typeofe?e:null,this.onRejected="function"==typeofn?n:null,this.promise=t}(n,o,r)),r},n.prototype["finally"]=function(e){varn=this.constructor;returnthis.then(function(t){returnn.resolve(e()).then(function(){returnt})},function(t){returnn.resolve(e()).then(function(){returnn.reject(t)})})},n.all=function(e){returnnewn(function(n,t){functiono(e,f){try{if(f&&("object"==typeoff||"function"==typeoff)){varu=f.then;if("function"==typeofu)returnvoidu.call(f,function(n){o(e,n)},t)}r[e]=f,0==--i&&n(r)}catch(c){t(c)}}if(!e||"undefined"==typeofe.length)thrownewTypeError("Promise.all accepts an array");varr=Array.prototype.slice.call(e);if(0===r.length)returnn([]);for(vari=r.length,f=0;r.length>f;f++)o(f,r[f])})},n.resolve=function(e){returne&&"object"==typeofe&&e.constructor===n?e:newn(function(n){n(e)})},n.reject=function(e){returnnewn(function(n,t){t(e)})},n.race=function(e){returnnewn(function(n,t){for(varo=0,r=e.length;r>o;o++)e[o].then(n,t)})},n._immediateFn="function"==typeofsetImmediate&&function(e){setImmediate(e)}||function(e){u(e,0)},n._unhandledRejectionFn=function(e){void0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};varc=function(){if("undefined"!=typeofself)returnself;if("undefined"!=typeofwindow)returnwindow;if(void0!==c)returnc;throwError("unable to locate global object")}();c.Promise||(c.Promise=n)});