"use strict";!function(a,b){"object"==typeofexports&&"undefined"!=typeofmodule?b(exports):"function"==typeofdefine&&define.amd?define(["exports"],b):b(a.RSVP=a.RSVP||{})}(this,function(a){functionb(a,b){for(varc=0,d=a.length;c<d;c++)if(a[c]===b)returnc;return-1}functionc(a){varb=a._promiseCallbacks;returnb||(b=a._promiseCallbacks={}),b}functiond(a,b){return"onerror"===a?voidva.on("error",b):2!==arguments.length?va[a]:void(va[a]=b)}functione(a){return"function"==typeofa||"object"==typeofa&&null!==a}functionf(a){return"function"==typeofa}functiong(a){return"object"==typeofa&&null!==a}functionh(){}functioni(){setTimeout(function(){for(vara=0;a<Aa.length;a++){varb=Aa[a],c=b.payload;c.guid=c.key+c.id,c.childGuid=c.key+c.childId,c.error&&(c.stack=c.error.stack),va.trigger(b.name,b.payload)}Aa.length=0},50)}functionj(a,b,c){1===Aa.push({name:a,payload:{key:b._guidKey,id:b._id,eventName:a,detail:b._result,childId:c&&c._id,label:b._label,timeStamp:ya(),error:va["instrument-with-stack"]?newError(b._label):null}})&&i()}functionk(a,b){varc=this;if(a&&"object"==typeofa&&a.constructor===c)returna;vard=newc(m,b);returns(d,a),d}functionl(){returnnewTypeError("A promises callback cannot return that same promise.")}functionm(){}functionn(a){try{returna.then}catch(a){returnEa.error=a,Ea}}functiono(a,b,c,d){try{a.call(b,c,d)}catch(a){returna}}functionp(a,b,c){va.async(function(a){vard=!1,e=o(c,b,function(c){d||(d=!0,b!==c?s(a,c,void0):u(a,c))},function(b){d||(d=!0,v(a,b))},"Settle: "+(a._label||" unknown promise"));!d&&e&&(d=!0,v(a,e))},a)}functionq(a,b){b._state===Ca?u(a,b._result):b._state===Da?(b._onError=null,v(a,b._result)):w(b,void0,function(c){b!==c?s(a,c,void0):u(a,c)},function(b){returnv(a,b)})}functionr(a,b,c){b.constructor===a.constructor&&c===C&&a.constructor.resolve===k?q(a,b):c===Ea?(v(a,Ea.error),Ea.error=null):void0===c?u(a,b):f(c)?p(a,b,c):u(a,b)}functions(a,b){a===b?u(a,b):e(b)?r(a,b,n(b)):u(a,b)}functiont(a){a._onError&&a._onError(a._result),x(a)}functionu(a,b){a._state===Ba&&(a._result=b,a._state=Ca,0===a._subscribers.length?va.instrument&&j("fulfilled",a):va.async(x,a))}functionv(a,b){a._state===Ba&&(a._state=Da,a._result=b,va.async(t,a))}functionw(a,b,c,d){vare=a._subscribers,f=e.length;a._onError=null,e[f]=b,e[f+Ca]=c,e[f+Da]=d,0===f&&a._state&&va.async(x,a)}functionx(a){varb=a._subscribers,c=a._state;if(va.instrument&&j(c===Ca?"fulfilled":"rejected",a),0!==b.length){for(vard=void0,e=void0,f=a._result,g=0;g<b.length;g+=3)d=b[g],e=b[g+c],d?A(c,d,e,f):e(f);a._subscribers.length=0}}functiony(){this.error=null}functionz(a,b){try{returna(b)}catch(a){returnFa.error=a,Fa}}functionA(a,b,c,d){vare=f(c),g=void0,h=void0,i=void0,j=void0;if(e){if(g=z(c,d),g===Fa?(j=!0,h=g.error,g.error=null):i=!0,b===g)returnvoidv(b,l())}elseg=d,i=!0;b._state!==Ba||(e&&i?s(b,g):j?v(b,h):a===Ca?u(b,g):a===Da&&v(b,g))}functionB(a,b){varc=!1;try{b(function(b){c||(c=!0,s(a,b))},function(b){c||(c=!0,v(a,b))})}catch(b){v(a,b)}}functionC(a,b,c){vard=arguments,e=this,f=e._state;if(f===Ca&&!a||f===Da&&!b)returnva.instrument&&j("chained",e,e),e;e._onError=null;varg=newe.constructor(m,c),h=e._result;returnva.instrument&&j("chained",e,g),f?function(){vara=d[f-1];va.async(function(){returnA(f,g,a,h)})}():w(e,g,a,b),g}functionD(a,b,c){returna===Ca?{state:"fulfilled",value:c}:{state:"rejected",reason:c}}functionE(a,b,c,d){this._instanceConstructor=a,this.promise=newa(m,d),this._abortOnReject=c,this._validateInput(b)?(this._input=b,this.length=b.length,this._remaining=b.length,this._init(),0===this.length?u(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&u(this.promise,this._result))):v(this.promise,this._validationError())}functionF(a,b){returnnewE(this,a,!0,b).promise}functionG(a,b){varc=this,d=newc(m,b);if(!xa(a))returnv(d,newTypeError("You must pass an array to race.")),d;for(vare=0;d._state===Ba&&e<a.length;e++)w(c.resolve(a[e]),void0,function(a){returns(d,a)},function(a){returnv(d,a)});returnd}functionH(a,b){var