qivopay-sdk
Version:
SDK de pagamentos com MercadoPago e PagarMe
25 lines (19 loc) • 769 kB
JavaScript
"use strict";var ar=Object.create;var qt=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var sr=Object.getPrototypeOf,ur=Object.prototype.hasOwnProperty;var Wt=(c,h)=>()=>(h||c((h={exports:{}}).exports,h),h.exports),cr=(c,h)=>{for(var t in h)qt(c,t,{get:h[t],enumerable:!0})},Te=(c,h,t,e)=>{if(h&&typeof h=="object"||typeof h=="function")for(let o of or(h))!ur.call(c,o)&&o!==t&&qt(c,o,{get:()=>h[o],enumerable:!(e=ir(h,o))||e.enumerable});return c};var fr=(c,h,t)=>(t=c!=null?ar(sr(c)):{},Te(h||!c||!c.__esModule?qt(t,"default",{value:c,enumerable:!0}):t,c)),lr=c=>Te(qt({},"__esModule",{value:!0}),c);var we=Wt((exports,module)=>{module.exports=function(c){var h={};function t(e){if(h[e])return h[e].exports;var o=h[e]={exports:{},id:e,loaded:!1};return c[e].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}return t.m=c,t.c=h,t.p="",t(0)}([function(c,h,t){"use strict";Object.defineProperty(h,"__esModule",{value:!0});var e=t(1),o=p(e),i=t(8),u=p(i),s=t(252),a=p(s),d=t(233),f=p(d),r=t(149),n=p(r);function p(v){return v&&v.__esModule?v:{default:v}}h.default=(0,o.default)({client:u.default,validate:a.default,postback:f.default},n.default),c.exports=h.default},function(c,h,t){var e=t(2),o=t(5);c.exports=o(function(u,s){return e({},u,s)})},function(c,h,t){var e=t(3);c.exports=typeof Object.assign=="function"?Object.assign:e},function(c,h,t){var e=t(4);c.exports=function(i){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var u=Object(i),s=1,a=arguments.length;s<a;){var d=arguments[s];if(d!=null)for(var f in d)e(f,d)&&(u[f]=d[f]);s+=1}return u}},function(c,h){c.exports=function(e,o){return Object.prototype.hasOwnProperty.call(o,e)}},function(c,h,t){var e=t(6),o=t(7);c.exports=function(u){return function s(a,d){switch(arguments.length){case 0:return s;case 1:return o(a)?s:e(function(f){return u(a,f)});default:return o(a)&&o(d)?s:o(a)?e(function(f){return u(f,d)}):o(d)?e(function(f){return u(a,f)}):u(a,d)}}}},function(c,h,t){var e=t(7);c.exports=function(i){return function u(s){return arguments.length===0||e(s)?u:i.apply(this,arguments)}}},function(c,h){c.exports=function(e){return e!=null&&typeof e=="object"&&e["@@functional/placeholder"]===!0}},function(c,h,t){"use strict";Object.defineProperty(h,"__esModule",{value:!0});var e=t(1),o=x(e),i=t(9),u=x(i),s=t(13),a=x(s),d=t(17),f=x(d),r=t(31),n=x(r),p=t(32),v=x(p),m=t(33),g=x(m),y=t(149),b=x(y);function x(L){return L&&L.__esModule?L:{default:L}}var w=function(M){return function(P){return P.bind(null,M)}},A=function L(M){return(0,v.default)((0,n.default)(Function),w(M),function(P){return(0,f.default)(L(M),P)})},E=(0,a.default)(function(L,M){var P=(0,u.default)(["headers","X-PagarMe-Version"],M,L),H=(0,f.default)(A(P),b.default);return H});function S(L){var M=L.options,P=L.authentication,H=(0,f.default)(A(M),b.default);return(0,o.default)(H,{authentication:P,withVersion:E(M)})}function C(L){return g.default.find(L).then(function(M){return M.execute()}).then(S)}var D=(0,o.default)({connect:C},b.default);h.default=D,c.exports=h.default},function(c,h,t){var e=t(10),o=t(11),i=t(12);c.exports=e(function u(s,a,d){switch(s.length){case 0:return a;case 1:return i(s[0],a,d);default:return i(s[0],u(o(s,1),a,Object(d[s[0]])),d)}})},function(c,h,t){var e=t(6),o=t(5),i=t(7);c.exports=function(s){return function a(d,f,r){switch(arguments.length){case 0:return a;case 1:return i(d)?a:o(function(n,p){return s(d,n,p)});case 2:return i(d)&&i(f)?a:i(d)?o(function(n,p){return s(n,f,p)}):i(f)?o(function(n,p){return s(d,n,p)}):e(function(n){return s(d,f,n)});default:return i(d)&&i(f)&&i(r)?a:i(d)&&i(f)?o(function(n,p){return s(n,p,r)}):i(d)&&i(r)?o(function(n,p){return s(n,f,p)}):i(f)&&i(r)?o(function(n,p){return s(d,n,p)}):i(d)?e(function(n){return s(n,f,r)}):i(f)?e(function(n){return s(d,n,r)}):i(r)?e(function(n){return s(d,f,n)}):s(d,f,r)}}}},function(c,h){c.exports=function t(e,o,i){switch(arguments.length){case 1:return t(e,0,e.length);case 2:return t(e,o,e.length);default:for(var u=[],s=0,a=Math.max(0,Math.min(e.length,i)-o);s<a;)u[s]=e[o+s],s+=1;return u}}},function(c,h,t){var e=t(10);c.exports=e(function(i,u,s){var a={};for(var d in s)a[d]=s[d];return a[i]=u,a})},function(c,h,t){var e=t(6),o=t(14);c.exports=e(function(u){return o(u.length,u)})},function(c,h,t){var e=t(15),o=t(6),i=t(5),u=t(16);c.exports=i(function(a,d){return a===1?o(d):e(a,u(a,[],d))})},function(c,h){c.exports=function(e,o){switch(e){case 0:return function(){return o.apply(this,arguments)};case 1:return function(i){return o.apply(this,arguments)};case 2:return function(i,u){return o.apply(this,arguments)};case 3:return function(i,u,s){return o.apply(this,arguments)};case 4:return function(i,u,s,a){return o.apply(this,arguments)};case 5:return function(i,u,s,a,d){return o.apply(this,arguments)};case 6:return function(i,u,s,a,d,f){return o.apply(this,arguments)};case 7:return function(i,u,s,a,d,f,r){return o.apply(this,arguments)};case 8:return function(i,u,s,a,d,f,r,n){return o.apply(this,arguments)};case 9:return function(i,u,s,a,d,f,r,n,p){return o.apply(this,arguments)};case 10:return function(i,u,s,a,d,f,r,n,p,v){return o.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}},function(c,h,t){var e=t(15),o=t(7);c.exports=function i(u,s,a){return function(){for(var d=[],f=0,r=u,n=0;n<s.length||f<arguments.length;){var p;n<s.length&&(!o(s[n])||f>=arguments.length)?p=s[n]:(p=arguments[f],f+=1),d[n]=p,o(p)||(r-=1),n+=1}return r<=0?a.apply(this,d):e(r,i(u,d,a))}}},function(c,h,t){var e=t(5),o=t(18),i=t(21),u=t(22),s=t(27),a=t(14),d=t(29);c.exports=e(o("map",s,function(r,n){switch(Object.prototype.toString.call(n)){case"[object Function]":return a(n.length,function(){return r.call(this,n.apply(this,arguments))});case"[object Object]":return u(function(p,v){return p[v]=r(n[v]),p},{},d(n));default:return i(r,n)}}))},function(c,h,t){var e=t(19),o=t(20),i=t(11);c.exports=function(s,a,d){return function(){var f=arguments.length;if(f===0)return d();var r=arguments[f-1];if(!e(r)){var n=i(arguments,0,f-1);if(typeof r[s]=="function")return r[s].apply(r,n);if(o(r)){var p=a.apply(null,n);return p(r)}}return d.apply(this,arguments)}}},function(c,h){c.exports=Array.isArray||function(e){return e!=null&&e.length>=0&&Object.prototype.toString.call(e)==="[object Array]"}},function(c,h){c.exports=function(e){return typeof e["@@transducer/step"]=="function"}},function(c,h){c.exports=function(e,o){for(var i=0,u=o.length,s=Array(u);i<u;)s[i]=e(o[i]),i+=1;return s}},function(c,h,t){var e=t(23),o=t(24),i=t(25);c.exports=function(){function u(f,r,n){for(var p=0,v=n.length;p<v;){if(r=f["@@transducer/step"](r,n[p]),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}p+=1}return f["@@transducer/result"](r)}function s(f,r,n){for(var p=n.next();!p.done;){if(r=f["@@transducer/step"](r,p.value),r&&r["@@transducer/reduced"]){r=r["@@transducer/value"];break}p=n.next()}return f["@@transducer/result"](r)}function a(f,r,n){return f["@@transducer/result"](n.reduce(o(f["@@transducer/step"],f),r))}var d=typeof Symbol<"u"?Symbol.iterator:"@@iterator";return function(r,n,p){if(typeof r=="function"&&(r=e(r)),i(p))return u(r,n,p);if(typeof p.reduce=="function")return a(r,n,p);if(p[d]!=null)return s(r,n,p[d]());if(typeof p.next=="function")return s(r,n,p);throw new TypeError("reduce: list must be array or iterable")}}()},function(c,h){c.exports=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,o){return this.f(e,o)},function(o){return new t(o)}}()},function(c,h,t){var e=t(15),o=t(5);c.exports=o(function(u,s){return e(u.length,function(){return u.apply(s,arguments)})})},function(c,h,t){var e=t(6),o=t(19),i=t(26);c.exports=e(function(s){return o(s)?!0:!s||typeof s!="object"||i(s)?!1:s.nodeType===1?!!s.length:s.length===0?!0:s.length>0?s.hasOwnProperty(0)&&s.hasOwnProperty(s.length-1):!1})},function(c,h){c.exports=function(e){return Object.prototype.toString.call(e)==="[object String]"}},function(c,h,t){var e=t(5),o=t(28);c.exports=function(){function i(u,s){this.xf=s,this.f=u}return i.prototype["@@transducer/init"]=o.init,i.prototype["@@transducer/result"]=o.result,i.prototype["@@transducer/step"]=function(u,s){return this.xf["@@transducer/step"](u,this.f(s))},e(function(s,a){return new i(s,a)})}()},function(c,h){c.exports={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}}},function(c,h,t){var e=t(6),o=t(4),i=t(30);c.exports=function(){var u=!{toString:null}.propertyIsEnumerable("toString"),s=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],a=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),d=function(r,n){for(var p=0;p<r.length;){if(r[p]===n)return!0;p+=1}return!1};return e(typeof Object.keys=="function"&&!a?function(r){return Object(r)!==r?[]:Object.keys(r)}:function(r){if(Object(r)!==r)return[];var n,p,v=[],m=a&&i(r);for(n in r)o(n,r)&&(!m||n!=="length")&&(v[v.length]=n);if(u)for(p=s.length-1;p>=0;)n=s[p],o(n,r)&&!d(v,n)&&(v[v.length]=n),p-=1;return v})}()},function(c,h,t){var e=t(4);c.exports=function(){var o=Object.prototype.toString;return o.call(arguments)==="[object Arguments]"?function(u){return o.call(u)==="[object Arguments]"}:function(u){return e("callee",u)}}()},function(c,h,t){var e=t(5);c.exports=e(function(i,u){return u!=null&&u.constructor===i||u instanceof i})},function(c,h,t){var e=t(10),o=t(14);c.exports=e(function(u,s,a){return o(Math.max(u.length,s.length,a.length),function(){return u.apply(this,arguments)?s.apply(this,arguments):a.apply(this,arguments)})})},function(c,h,t){"use strict";Object.defineProperty(h,"__esModule",{value:!0});var e=t(34),o=M(e),i=t(35),u=M(i),s=t(36),a=M(s),d=t(38),f=M(d),r=t(43),n=M(r),p=t(44),v=M(p),m=t(50),g=M(m),y=t(51),b=M(y),x=t(140),w=M(x),A=t(142),E=M(A),S=t(147),C=M(S),D=t(148),L=M(D);function M(z){return z&&z.__esModule?z:{default:z}}var P=typeof global>"u";function H(){return Promise.reject(new Error("You must supply a valid authentication object"))}function K(){return Promise.reject(new Error("You cannot use an api key in the browser!"))}var I=(0,g.default)([[(0,v.default)((0,n.default)("email"),(0,n.default)("password")),w.default.build],[(0,n.default)("api_key"),E.default.build],[(0,n.default)("encryption_key"),b.default.build],[(0,n.default)("session_id"),C.default.build],[(0,f.default)([(0,n.default)("account_id"),(0,n.default)("jwt"),(0,n.default)("merchant_id")]),L.default.build],[(0,f.default)([(0,n.default)("jwt"),(0,n.default)("company_id")]),L.default.build],[a.default,H]]);function j(z){return(0,u.default)(z)?H():(0,o.default)((0,n.default)("api_key",z),P)?K():Promise.resolve(I(z))}h.default={find:j},c.exports=h.default},function(c,h,t){var e=t(5);c.exports=e(function(i,u){return i&&u})},function(c,h,t){var e=t(6);c.exports=e(function(i){return i==null})},function(c,h,t){var e=t(37);c.exports=e(!0)},function(c,h,t){var e=t(6);c.exports=e(function(i){return function(){return i}})},function(c,h,t){var e=t(6),o=t(14),i=t(39),u=t(40),s=t(42);c.exports=e(function(d){return o(s(i,0,u("length",d)),function(){for(var f=0,r=d.length;f<r;){if(!d[f].apply(this,arguments))return!1;f+=1}return!0})})},function(c,h,t){var e=t(5);c.exports=e(function(i,u){return u>i?u:i})},function(c,h,t){var e=t(5),o=t(17),i=t(41);c.exports=e(function(s,a){return o(i(s),a)})},function(c,h,t){var e=t(5);c.exports=e(function(i,u){return u[i]})},function(c,h,t){var e=t(10),o=t(22);c.exports=e(o)},function(c,h,t){var e=t(5),o=t(4);c.exports=e(o)},function(c,h,t){var e=t(5),o=t(45),i=t(34),u=t(46);c.exports=e(function(a,d){return o(a)?function(){return a.apply(this,arguments)&&d.apply(this,arguments)}:u(i)(a,d)})},function(c,h){c.exports=function(e){return Object.prototype.toString.call(e)==="[object Function]"}},function(c,h,t){var e=t(6),o=t(47);c.exports=e(function(u){return o(u.length,u)})},function(c,h,t){var e=t(5),o=t(22),i=t(11),u=t(48),s=t(14),a=t(17);c.exports=e(function(f,r){var n=s(f,r);return s(f,function(){return o(u,a(n,arguments[0]),i(arguments,1))})})},function(c,h,t){var e=t(49),o=t(5),i=t(22),u=t(17);c.exports=o(function(a,d){return typeof a.ap=="function"?a.ap(d):typeof a=="function"?function(f){return a(f)(d(f))}:i(function(f,r){return e(f,u(r,d))},[],a)})},function(c,h){c.exports=function(e,o){e=e||[],o=o||[];var i,u=e.length,s=o.length,a=[];for(i=0;i<u;)a[a.length]=e[i],i+=1;for(i=0;i<s;)a[a.length]=o[i],i+=1;return a}},function(c,h,t){var e=t(15),o=t(6),i=t(17),u=t(39),s=t(42);c.exports=o(function(d){var f=s(u,0,i(function(r){return r[0].length},d));return e(f,function(){for(var r=0;r<d.length;){if(d[r][0].apply(this,arguments))return d[r][1].apply(this,arguments);r+=1}})})},function(c,h,t){"use strict";Object.defineProperty(h,"__esModule",{value:!0});var e=t(1),o=a(e),i=t(52),u=t(88),s=a(u);function a(r){return r&&r.__esModule?r:{default:r}}function d(r){var n=r.encryption_key,p=r.options,v=(0,o.default)({body:{encryption_key:n}},p&&p.baseURL?{baseURL:p.baseURL}:{});return s.default.calculateInstallmentsAmount(v,{amount:1,interest_rate:100}).catch(function(m){return r.skipAuthentication?(0,i.resolve)(r.options):(0,i.reject)(m)}).catch(function(m){return m.name==="ApiError"},function(){return(0,i.reject)(new Error("You must supply a valid encryption key"))}).then((0,o.default)(v)).then(function(m){return{authentication:{encryption_key:n},options:m}})}function f(r){return(0,o.default)(r,{execute:d.bind(null,r)})}h.default={build:f},c.exports=h.default},function(c,h,t){"use strict";var e;typeof Promise<"u"&&(e=Promise);function o(){try{Promise===i&&(Promise=e)}catch{}return i}var i=t(53)();i.noConflict=o,c.exports=i},function(c,h,t){"use strict";c.exports=function(){var e=function(){return new v(`circular promise resolution chain
See http://goo.gl/MqrFmX
`)},o=function(){return new I.PromiseInspection(this._target())},i=function(F){return I.reject(new v(F))};function u(){}var s={},a=t(54),d;a.isNode?d=function(){var F=process.domain;return F===void 0&&(F=null),F}:d=function(){return null},a.notEnumerableProp(I,"_getDomain",d);var f=t(55),r=t(56),n=new r;f.defineProperty(I,"_async",{value:n});var p=t(59),v=I.TypeError=p.TypeError;I.RangeError=p.RangeError;var m=I.CancellationError=p.CancellationError;I.TimeoutError=p.TimeoutError,I.OperationalError=p.OperationalError,I.RejectionError=p.OperationalError,I.AggregateError=p.AggregateError;var g=function(){},y={},b={},x=t(60)(I,g),w=t(61)(I,g,x,i,u),A=t(62)(I),E=A.create,S=t(63)(I,A),C=S.CapturedTrace,D=t(64)(I,x,b),L=t(65)(b),M=t(66),P=a.errorObj,H=a.tryCatch;function K(F,$){if(F==null||F.constructor!==I)throw new v(`the promise constructor cannot be invoked directly
See http://goo.gl/MqrFmX
`);if(typeof $!="function")throw new v("expecting a function but got "+a.classString($))}function I(F){F!==g&&K(this,F),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(F),this._promiseCreated(),this._fireEvent("promiseCreated",this)}I.prototype.toString=function(){return"[object Promise]"},I.prototype.caught=I.prototype.catch=function(F){var $=arguments.length;if($>1){var G=new Array($-1),_=0,Y;for(Y=0;Y<$-1;++Y){var X=arguments[Y];if(a.isObject(X))G[_++]=X;else return i("Catch statement predicate: expecting an object but got "+a.classString(X))}return G.length=_,F=arguments[Y],this.then(void 0,L(G,F,this))}return this.then(void 0,F)},I.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},I.prototype.then=function(F,$){if(S.warnings()&&arguments.length>0&&typeof F!="function"&&typeof $!="function"){var G=".then() only accepts functions but was passed: "+a.classString(F);arguments.length>1&&(G+=", "+a.classString($)),this._warn(G)}return this._then(F,$,void 0,void 0,void 0)},I.prototype.done=function(F,$){var G=this._then(F,$,void 0,void 0,void 0);G._setIsFinal()},I.prototype.spread=function(F){return typeof F!="function"?i("expecting a function but got "+a.classString(F)):this.all()._then(F,void 0,void 0,y,void 0)},I.prototype.toJSON=function(){var F={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(F.fulfillmentValue=this.value(),F.isFulfilled=!0):this.isRejected()&&(F.rejectionReason=this.reason(),F.isRejected=!0),F},I.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new w(this).promise()},I.prototype.error=function(F){return this.caught(a.originatesFromRejection,F)},I.getNewLibraryCopy=c.exports,I.is=function(F){return F instanceof I},I.fromNode=I.fromCallback=function(F){var $=new I(g);$._captureStackTrace();var G=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,_=H(F)(M($,G));return _===P&&$._rejectCallback(_.e,!0),$._isFateSealed()||$._setAsyncGuaranteed(),$},I.all=function(F){return new w(F).promise()},I.cast=function(F){var $=x(F);return $ instanceof I||($=new I(g),$._captureStackTrace(),$._setFulfilled(),$._rejectionHandler0=F),$},I.resolve=I.fulfilled=I.cast,I.reject=I.rejected=function(F){var $=new I(g);return $._captureStackTrace(),$._rejectCallback(F,!0),$},I.setScheduler=function(F){if(typeof F!="function")throw new v("expecting a function but got "+a.classString(F));return n.setScheduler(F)},I.prototype._then=function(F,$,G,_,Y){var X=Y!==void 0,rt=X?Y:new I(g),at=this._target(),nt=at._bitField;X||(rt._propagateFrom(this,3),rt._captureStackTrace(),_===void 0&&(this._bitField&2097152)!==0&&((nt&50397184)!==0?_=this._boundValue():_=at===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,rt));var lt=d();if((nt&50397184)!==0){var st,ot,vt=at._settlePromiseCtx;(nt&33554432)!==0?(ot=at._rejectionHandler0,st=F):(nt&16777216)!==0?(ot=at._fulfillmentHandler0,st=$,at._unsetRejectionIsUnhandled()):(vt=at._settlePromiseLateCancellationObserver,ot=new m("late cancellation observer"),at._attachExtraTrace(ot),st=$),n.invoke(vt,at,{handler:lt===null?st:typeof st=="function"&&a.domainBind(lt,st),promise:rt,receiver:_,value:ot})}else at._addCallbacks(F,$,rt,_,lt);return rt},I.prototype._length=function(){return this._bitField&65535},I.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},I.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},I.prototype._setLength=function(F){this._bitField=this._bitField&-65536|F&65535},I.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},I.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},I.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},I.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},I.prototype._isFinal=function(){return(this._bitField&4194304)>0},I.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},I.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},I.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},I.prototype._setAsyncGuaranteed=function(){n.hasCustomScheduler()||(this._bitField=this._bitField|134217728)},I.prototype._receiverAt=function(F){var $=F===0?this._receiver0:this[F*4-4+3];if($!==s)return $===void 0&&this._isBound()?this._boundValue():$},I.prototype._promiseAt=function(F){return this[F*4-4+2]},I.prototype._fulfillmentHandlerAt=function(F){return this[F*4-4+0]},I.prototype._rejectionHandlerAt=function(F){return this[F*4-4+1]},I.prototype._boundValue=function(){},I.prototype._migrateCallback0=function(F){var $=F._bitField,G=F._fulfillmentHandler0,_=F._rejectionHandler0,Y=F._promise0,X=F._receiverAt(0);X===void 0&&(X=s),this._addCallbacks(G,_,Y,X,null)},I.prototype._migrateCallbackAt=function(F,$){var G=F._fulfillmentHandlerAt($),_=F._rejectionHandlerAt($),Y=F._promiseAt($),X=F._receiverAt($);X===void 0&&(X=s),this._addCallbacks(G,_,Y,X,null)},I.prototype._addCallbacks=function(F,$,G,_,Y){var X=this._length();if(X>=65531&&(X=0,this._setLength(0)),X===0)this._promise0=G,this._receiver0=_,typeof F=="function"&&(this._fulfillmentHandler0=Y===null?F:a.domainBind(Y,F)),typeof $=="function"&&(this._rejectionHandler0=Y===null?$:a.domainBind(Y,$));else{var rt=X*4-4;this[rt+2]=G,this[rt+3]=_,typeof F=="function"&&(this[rt+0]=Y===null?F:a.domainBind(Y,F)),typeof $=="function"&&(this[rt+1]=Y===null?$:a.domainBind(Y,$))}return this._setLength(X+1),X},I.prototype._proxy=function(F,$){this._addCallbacks(void 0,void 0,$,F,null)},I.prototype._resolveCallback=function(F,$){if((this._bitField&117506048)===0){if(F===this)return this._rejectCallback(e(),!1);var G=x(F,this);if(!(G instanceof I))return this._fulfill(F);$&&this._propagateFrom(G,2);var _=G._target();if(_===this){this._reject(e());return}var Y=_._bitField;if((Y&50397184)===0){var X=this._length();X>0&&_._migrateCallback0(this);for(var rt=1;rt<X;++rt)_._migrateCallbackAt(this,rt);this._setFollowing(),this._setLength(0),this._setFollowee(_)}else if((Y&33554432)!==0)this._fulfill(_._value());else if((Y&16777216)!==0)this._reject(_._reason());else{var at=new m("late cancellation observer");_._attachExtraTrace(at),this._reject(at)}}},I.prototype._rejectCallback=function(F,$,G){var _=a.ensureErrorObject(F),Y=_===F;if(!Y&&!G&&S.warnings()){var X="a promise was rejected with a non-error: "+a.classString(F);this._warn(X,!0)}this._attachExtraTrace(_,$?Y:!1),this._reject(F)},I.prototype._resolveFromExecutor=function(F){if(F!==g){var $=this;this._captureStackTrace(),this._pushContext();var G=!0,_=this._execute(F,function(Y){$._resolveCallback(Y)},function(Y){$._rejectCallback(Y,G)});G=!1,this._popContext(),_!==void 0&&$._rejectCallback(_,!0)}},I.prototype._settlePromiseFromHandler=function(F,$,G,_){var Y=_._bitField;if((Y&65536)===0){_._pushContext();var X;$===y?!G||typeof G.length!="number"?(X=P,X.e=new v("cannot .spread() a non-array: "+a.classString(G))):X=H(F).apply(this._boundValue(),G):X=H(F).call($,G);var rt=_._popContext();Y=_._bitField,(Y&65536)===0&&(X===b?_._reject(G):X===P?_._rejectCallback(X.e,!1):(S.checkForgottenReturns(X,rt,"",_,this),_._resolveCallback(X)))}},I.prototype._target=function(){for(var F=this;F._isFollowing();)F=F._followee();return F},I.prototype._followee=function(){return this._rejectionHandler0},I.prototype._setFollowee=function(F){this._rejectionHandler0=F},I.prototype._settlePromise=function(F,$,G,_){var Y=F instanceof I,X=this._bitField,rt=(X&134217728)!==0;(X&65536)!==0?(Y&&F._invokeInternalOnCancel(),G instanceof D&&G.isFinallyHandler()?(G.cancelPromise=F,H($).call(G,_)===P&&F._reject(P.e)):$===o?F._fulfill(o.call(G)):G instanceof u?G._promiseCancelled(F):Y||F instanceof w?F._cancel():G.cancel()):typeof $=="function"?Y?(rt&&F._setAsyncGuaranteed(),this._settlePromiseFromHandler($,G,_,F)):$.call(G,_,F):G instanceof u?G._isResolved()||((X&33554432)!==0?G._promiseFulfilled(_,F):G._promiseRejected(_,F)):Y&&(rt&&F._setAsyncGuaranteed(),(X&33554432)!==0?F._fulfill(_):F._reject(_))},I.prototype._settlePromiseLateCancellationObserver=function(F){var $=F.handler,G=F.promise,_=F.receiver,Y=F.value;typeof $=="function"?G instanceof I?this._settlePromiseFromHandler($,_,Y,G):$.call(_,Y,G):G instanceof I&&G._reject(Y)},I.prototype._settlePromiseCtx=function(F){this._settlePromise(F.promise,F.handler,F.receiver,F.value)},I.prototype._settlePromise0=function(F,$,G){var _=this._promise0,Y=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(_,F,Y,$)},I.prototype._clearCallbackDataAtIndex=function(F){var $=F*4-4;this[$+2]=this[$+3]=this[$+0]=this[$+1]=void 0},I.prototype._fulfill=function(F){var $=this._bitField;if(!(($&117506048)>>>16)){if(F===this){var G=e();return this._attachExtraTrace(G),this._reject(G)}this._setFulfilled(),this._rejectionHandler0=F,($&65535)>0&&(($&134217728)!==0?this._settlePromises():n.settlePromises(this))}},I.prototype._reject=function(F){var $=this._bitField;if(!(($&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=F,this._isFinal())return n.fatalError(F,a.isNode);($&65535)>0?n.settlePromises(this):this._ensurePossibleRejectionHandled()}},I.prototype._fulfillPromises=function(F,$){for(var G=1;G<F;G++){var _=this._fulfillmentHandlerAt(G),Y=this._promiseAt(G),X=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(Y,_,X,$)}},I.prototype._rejectPromises=function(F,$){for(var G=1;G<F;G++){var _=this._rejectionHandlerAt(G),Y=this._promiseAt(G),X=this._receiverAt(G);this._clearCallbackDataAtIndex(G),this._settlePromise(Y,_,X,$)}},I.prototype._settlePromises=function(){var F=this._bitField,$=F&65535;if($>0){if((F&16842752)!==0){var G=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,G,F),this._rejectPromises($,G)}else{var _=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,_,F),this._fulfillPromises($,_)}this._setLength(0)}this._clearCancellationData()},I.prototype._settledValue=function(){var F=this._bitField;if((F&33554432)!==0)return this._rejectionHandler0;if((F&16777216)!==0)return this._fulfillmentHandler0};function j(F){this.promise._resolveCallback(F)}function z(F){this.promise._rejectCallback(F,!1)}I.defer=I.pending=function(){S.deprecated("Promise.defer","new Promise");var F=new I(g);return{promise:F,resolve:j,reject:z}},a.notEnumerableProp(I,"_makeSelfResolutionError",e),t(67)(I,g,x,i,S),t(68)(I,g,x,S),t(69)(I,w,i,S),t(70)(I),t(71)(I),t(72)(I,w,x,g,n,d),I.Promise=I,I.version="3.5.1",t(73)(I,w,i,x,g,S),t(74)(I),t(75)(I,i,x,E,g,S),t(76)(I,g,S),t(77)(I,i,g,x,u,S),t(78)(I),t(79)(I,g),t(80)(I,w,x,i),t(81)(I,g,x,i),t(82)(I,w,i,x,g,S),t(83)(I,w,S),t(84)(I,w,i),t(85)(I,g),t(86)(I,g),t(87)(I),a.toFastProperties(I),a.toFastProperties(I.prototype);function et(F){var $=new I(g);$._fulfillmentHandler0=F,$._rejectionHandler0=F,$._promise0=F,$._receiver0=F}return et({a:1}),et({b:2}),et({c:3}),et(1),et(function(){}),et(void 0),et(!1),et(new I(g)),S.setBounds(r.firstLineError,a.lastLineError),I}},function(module,exports,__webpack_require__){"use strict";var es5=__webpack_require__(55),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:this!==void 0?this:null;function tryCatcher(){try{var c=tryCatchTarget;return tryCatchTarget=null,c.apply(this,arguments)}catch(h){return errorObj.e=h,errorObj}}function tryCatch(c){return tryCatchTarget=c,tryCatcher}var inherits=function(c,h){var t={}.hasOwnProperty;function e(){this.constructor=c,this.constructor$=h;for(var o in h.prototype)t.call(h.prototype,o)&&o.charAt(o.length-1)!=="$"&&(this[o+"$"]=h.prototype[o])}return e.prototype=h.prototype,c.prototype=new e,c.prototype};function isPrimitive(c){return c==null||c===!0||c===!1||typeof c=="string"||typeof c=="number"}function isObject(c){return typeof c=="function"||typeof c=="object"&&c!==null}function maybeWrapAsError(c){return isPrimitive(c)?new Error(safeToString(c)):c}function withAppended(c,h){var t=c.length,e=new Array(t+1),o;for(o=0;o<t;++o)e[o]=c[o];return e[o]=h,e}function getDataPropertyOrDefault(c,h,t){if(es5.isES5){var e=Object.getOwnPropertyDescriptor(c,h);if(e!=null)return e.get==null&&e.set==null?e.value:t}else return{}.hasOwnProperty.call(c,h)?c[h]:void 0}function notEnumerableProp(c,h,t){if(isPrimitive(c))return c;var e={value:t,configurable:!0,enumerable:!1,writable:!0};return es5.defineProperty(c,h,e),c}function thrower(c){throw c}var inheritedDataKeys=function(){var c=[Array.prototype,Object.prototype,Function.prototype],h=function(o){for(var i=0;i<c.length;++i)if(c[i]===o)return!0;return!1};if(es5.isES5){var t=Object.getOwnPropertyNames;return function(o){for(var i=[],u=Object.create(null);o!=null&&!h(o);){var s;try{s=t(o)}catch{return i}for(var a=0;a<s.length;++a){var d=s[a];if(!u[d]){u[d]=!0;var f=Object.getOwnPropertyDescriptor(o,d);f!=null&&f.get==null&&f.set==null&&i.push(d)}}o=es5.getPrototypeOf(o)}return i}}else{var e={}.hasOwnProperty;return function(o){if(h(o))return[];var i=[];t:for(var u in o)if(e.call(o,u))i.push(u);else{for(var s=0;s<c.length;++s)if(e.call(c[s],u))continue t;i.push(u)}return i}}}(),thisAssignmentPattern=/this\s*\.\s*\S+\s*=/;function isClass(c){try{if(typeof c=="function"){var h=es5.names(c.prototype),t=es5.isES5&&h.length>1,e=h.length>0&&!(h.length===1&&h[0]==="constructor"),o=thisAssignmentPattern.test(c+"")&&es5.names(c).length>0;if(t||e||o)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;for(var l=8;l--;)new FakeConstructor;return obj}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(c){return rident.test(c)}function filledRange(c,h,t){for(var e=new Array(c),o=0;o<c;++o)e[o]=h+o+t;return e}function safeToString(c){try{return c+""}catch{return"[no string representation]"}}function isError(c){return c instanceof Error||c!==null&&typeof c=="object"&&typeof c.message=="string"&&typeof c.name=="string"}function markAsOriginatingFromRejection(c){try{notEnumerableProp(c,"isOperational",!0)}catch{}}function originatesFromRejection(c){return c==null?!1:c instanceof Error.__BluebirdErrorTypes__.OperationalError||c.isOperational===!0}function canAttachTrace(c){return isError(c)&&es5.propertyIsWritable(c,"stack")}var ensureErrorObject=function(){return"stack"in new Error?function(c){return canAttachTrace(c)?c:new Error(safeToString(c))}:function(c){if(canAttachTrace(c))return c;try{throw new Error(safeToString(c))}catch(h){return h}}}();function classString(c){return{}.toString.call(c)}function copyDescriptors(c,h,t){for(var e=es5.names(c),o=0;o<e.length;++o){var i=e[o];if(t(i))try{es5.defineProperty(h,i,es5.getDescriptor(c,i))}catch{}}}var asArray=function(c){return es5.isArray(c)?c:null};if(typeof Symbol<"u"&&Symbol.iterator){var ArrayFrom=typeof Array.from=="function"?function(c){return Array.from(c)}:function(c){for(var h=[],t=c[Symbol.iterator](),e;!(e=t.next()).done;)h.push(e.value);return h};asArray=function(c){return es5.isArray(c)?c:c!=null&&typeof c[Symbol.iterator]=="function"?ArrayFrom(c):null}}var isNode=typeof process<"u"&&classString(process).toLowerCase()==="[object process]",hasEnvVariables=typeof process<"u"&&typeof process.env<"u";function env(c){return hasEnvVariables?process.env[c]:void 0}function getNativePromise(){if(typeof Promise=="function")try{var c=new Promise(function(){});if({}.toString.call(c)==="[object Promise]")return Promise}catch{}}function domainBind(c,h){return c.bind(h)}var ret={isClass,isIdentifier,inheritedDataKeys,getDataPropertyOrDefault,thrower,isArray:es5.isArray,asArray,notEnumerableProp,isPrimitive,isObject,isError,canEvaluate,errorObj,tryCatch,inherits,withAppended,maybeWrapAsError,toFastProperties,filledRange,toString:safeToString,canAttachTrace,ensureErrorObject,originatesFromRejection,markAsOriginatingFromRejection,classString,copyDescriptors,hasDevTools:typeof chrome<"u"&&chrome&&typeof chrome.loadTimes=="function",isNode,hasEnvVariables,env,global:globalObject,getNativePromise,domainBind};ret.isRecentNode=ret.isNode&&function(){var c=process.versions.node.split(".").map(Number);return c[0]===0&&c[1]>10||c[0]>0}(),ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(c){ret.lastLineError=c}module.exports=ret},function(c,h){var t=function(){"use strict";return this===void 0}();if(t)c.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:t,propertyIsWritable:function(n,p){var v=Object.getOwnPropertyDescriptor(n,p);return!!(!v||v.writable||v.set)}};else{var e={}.hasOwnProperty,o={}.toString,i={}.constructor.prototype,u=function(n){var p=[];for(var v in n)e.call(n,v)&&p.push(v);return p},s=function(n,p){return{value:n[p]}},a=function(n,p,v){return n[p]=v.value,n},d=function(n){return n},f=function(n){try{return Object(n).constructor.prototype}catch{return i}},r=function(n){try{return o.call(n)==="[object Array]"}catch{return!1}};c.exports={isArray:r,keys:u,names:u,defineProperty:a,getDescriptor:s,freeze:d,getPrototypeOf:f,isES5:t,propertyIsWritable:function(){return!0}}}},function(c,h,t){"use strict";var e;try{throw new Error}catch(r){e=r}var o=t(57),i=t(58),u=t(54);function s(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new i(16),this._normalQueue=new i(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var r=this;this.drainQueues=function(){r._drainQueues()},this._schedule=o}s.prototype.setScheduler=function(r){var n=this._schedule;return this._schedule=r,this._customScheduler=!0,n},s.prototype.hasCustomScheduler=function(){return this._customScheduler},s.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},s.prototype.disableTrampolineIfNecessary=function(){u.hasDevTools&&(this._trampolineEnabled=!1)},s.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},s.prototype.fatalError=function(r,n){n?(process.stderr.write("Fatal "+(r instanceof Error?r.stack:r)+`
`),process.exit(2)):this.throwLater(r)},s.prototype.throwLater=function(r,n){if(arguments.length===1&&(n=r,r=function(){throw n}),typeof setTimeout<"u")setTimeout(function(){r(n)},0);else try{this._schedule(function(){r(n)})}catch{throw new Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)}};function a(r,n,p){this._lateQueue.push(r,n,p),this._queueTick()}function d(r,n,p){this._normalQueue.push(r,n,p),this._queueTick()}function f(r){this._normalQueue._pushOne(r),this._queueTick()}u.hasDevTools?(s.prototype.invokeLater=function(r,n,p){this._trampolineEnabled?a.call(this,r,n,p):this._schedule(function(){setTimeout(function(){r.call(n,p)},100)})},s.prototype.invoke=function(r,n,p){this._trampolineEnabled?d.call(this,r,n,p):this._schedule(function(){r.call(n,p)})},s.prototype.settlePromises=function(r){this._trampolineEnabled?f.call(this,r):this._schedule(function(){r._settlePromises()})}):(s.prototype.invokeLater=a,s.prototype.invoke=d,s.prototype.settlePromises=f),s.prototype._drainQueue=function(r){for(;r.length()>0;){var n=r.shift();if(typeof n!="function"){n._settlePromises();continue}var p=r.shift(),v=r.shift();n.call(p,v)}},s.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},s.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},s.prototype._reset=function(){this._isTickUsed=!1},c.exports=s,c.exports.firstLineError=e},function(c,h,t){"use strict";var e=t(54),o,i=function(){throw new Error(`No async scheduler available
See http://goo.gl/MqrFmX
`)},u=e.getNativePromise();if(e.isNode&&typeof MutationObserver>"u"){var s=global.setImmediate,a=process.nextTick;o=e.isRecentNode?function(f){s.call(global,f)}:function(f){a.call(process,f)}}else if(typeof u=="function"&&typeof u.resolve=="function"){var d=u.resolve();o=function(f){d.then(f)}}else typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))?o=function(){var f=document.createElement("div"),r={attributes:!0},n=!1,p=document.createElement("div"),v=new MutationObserver(function(){f.classList.toggle("foo"),n=!1});v.observe(p,r);var m=function(){n||(n=!0,p.classList.toggle("foo"))};return function(y){var b=new MutationObserver(function(){b.disconnect(),y()});b.observe(f,r),m()}}():typeof setImmediate<"u"?o=function(f){setImmediate(f)}:typeof setTimeout<"u"?o=function(f){setTimeout(f,0)}:o=i;c.exports=o},function(c,h){"use strict";function t(o,i,u,s,a){for(var d=0;d<a;++d)u[d+s]=o[d+i],o[d+i]=void 0}function e(o){this._capacity=o,this._length=0,this._front=0}e.prototype._willBeOverCapacity=function(o){return this._capacity<o},e.prototype._pushOne=function(o){var i=this.length();this._checkCapacity(i+1);var u=this._front+i&this._capacity-1;this[u]=o,this._length=i+1},e.prototype.push=function(o,i,u){var s=this.length()+3;if(this._willBeOverCapacity(s)){this._pushOne(o),this._pushOne(i),this._pushOne(u);return}var a=this._front+s-3;this._checkCapacity(s);var d=this._capacity-1;this[a+0&d]=o,this[a+1&d]=i,this[a+2&d]=u,this._length=s},e.prototype.shift=function(){var o=this._front,i=this[o];return this[o]=void 0,this._front=o+1&this._capacity-1,this._length--,i},e.prototype.length=function(){return this._length},e.prototype._checkCapacity=function(o){this._capacity<o&&this._resizeTo(this._capacity<<1)},e.prototype._resizeTo=function(o){var i=this._capacity;this._capacity=o;var u=this._front,s=this._length,a=u+s&i-1;t(this,0,this,i,a)},c.exports=e},function(c,h,t){"use strict";var e=t(55),o=e.freeze,i=t(54),u=i.inherits,s=i.notEnumerableProp;function a(w,A){function E(S){if(!(this instanceof E))return new E(S);s(this,"message",typeof S=="string"?S:A),s(this,"name",w),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(E,Error),E}var d,f,r=a("Warning","warning"),n=a("CancellationError","cancellation error"),p=a("TimeoutError","timeout error"),v=a("AggregateError","aggregate error");try{d=TypeError,f=RangeError}catch{d=a("TypeError","type error"),f=a("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g<m.length;++g)typeof Array.prototype[m[g]]=="function"&&(v.prototype[m[g]]=Array.prototype[m[g]]);e.defineProperty(v.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),v.prototype.isOperational=!0;var y=0;v.prototype.toString=function(){var w=Array(y*4+1).join(" "),A=`
`+w+`AggregateError of:
`;y++,w=Array(y*4+1).join(" ");for(var E=0;E<this.length;++E){for(var S=this[E]===this?"[Circular AggregateError]":this[E]+"",C=S.split(`
`),D=0;D<C.length;++D)C[D]=w+C[D];S=C.join(`
`),A+=S+`
`}return y--,A};function b(w){if(!(this instanceof b))return new b(w);s(this,"name","OperationalError"),s(this,"message",w),this.cause=w,this.isOperational=!0,w instanceof Error?(s(this,"message",w.message),s(this,"stack",w.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}u(b,Error);var x=Error.__BluebirdErrorTypes__;x||(x=o({CancellationError:n,TimeoutError:p,OperationalError:b,RejectionError:b,AggregateError:v}),e.defineProperty(Error,"__BluebirdErrorTypes__",{value:x,writable:!1,enumerable:!1,configurable:!1})),c.exports={Error,TypeError:d,RangeError:f,CancellationError:x.CancellationError,OperationalError:x.OperationalError,TimeoutError:x.TimeoutError,AggregateError:x.AggregateError,Warning:r}},function(c,h,t){"use strict";c.exports=function(e,o){var i=t(54),u=i.errorObj,s=i.isObject;function a(v,m){if(s(v)){if(v instanceof e)return v;var g=f(v);if(g===u){m&&m._pushContext();var y=e.reject(g.e);return m&&m._popContext(),y}else if(typeof g=="function"){if(n(v)){var y=new e(o);return v._then(y._fulfill,y._reject,void 0,y,null),y}return p(v,g,m)}}return v}function d(v){return v.then}function f(v){try{return d(v)}catch(m){return u.e=m,u}}var r={}.hasOwnProperty;function n(v){try{return r.call(v,"_promise0")}catch{return!1}}function p(v,m,g){var y=new e(o),b=y;g&&g._pushContext(),y._captureStackTrace(),g&&g._popContext();var x=!0,w=i.tryCatch(m).call(v,A,E);x=!1,y&&w===u&&(y._rejectCallback(w.e,!0,!0),y=null);function A(S){y&&(y._resolveCallback(S),y=null)}function E(S){y&&(y._rejectCallback(S,x,!0),y=null)}return b}return a}},function(c,h,t){"use strict";c.exports=function(e,o,i,u,s){var a=t(54),d=a.isArray;function f(n){switch(n){case-2:return[];case-3:return{};case-6:return new Map}}function r(n){var p=this._promise=new e(o);n instanceof e&&p._propagateFrom(n,3),p._setOnCancel(this),this._values=n,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(r,s),r.prototype.length=function(){return this._length},r.prototype.promise=function(){return this._promise},r.prototype._init=function n(p,v){var m=i(this._values,this._promise);if(m instanceof e){m=m._target();var g=m._bitField;if(this._values=m,(g&50397184)===0)return this._promise._setAsyncGuaranteed(),m._then(n,this._reject,void 0,this,v);if((g&33554432)!==0)m=m._value();else return(g&16777216)!==0?this._reject(m._reason()):this._cancel()}if(m=a.asArray(m),m===null){var y=u("expecting an array or an iterable object but got "+a.classString(m)).reason();this._promise._rejectCallback(y,!1);return}if(m.length===0){v===-5?this._resolveEmptyArray():this._resolve(f(v));return}this._iterate(m)},r.prototype._iterate=function(n){var p=this.getActualLength(n.length);this._length=p,this._values=this.shouldCopyValues()?new Array(p):this._values;for(var v=this._promise,m=!1,g=null,y=0;y<p;++y){var b=i(n[y],v);b instanceof e?(b=b._target(),g=b._bitField):g=null,m?g!==null&&b.suppressUnhandledRejections():g!==null?(g&50397184)===0?(b._proxy(this,y),this._values[y]=b):(g&33554432)!==0?m=this._promiseFulfilled(b._value(),y):(g&16777216)!==0?m=this._promiseRejected(b._reason(),y):m=this._promiseCancelled(y):m=this._promiseFulfilled(b,y)}m||v._setAsyncGuaranteed()},r.prototype._isResolved=function(){return this._values===null},r.prototype._resolve=function(n){this._values=null,this._promise._fulfill(n)},r.prototype._cancel=function(){this._isResolved()||!this._promise._isCancellable()||(this._values=null,this._promise._cancel())},r.prototype._reject=function(n){this._values=null,this._promise._rejectCallback(n,!1)},r.prototype._promiseFulfilled=function(n,p){this._values[p]=n;var v=++this._totalResolved;return v>=this._length?(this._resolve(this._values),!0):!1},r.prototype._promiseCancelled=function(){return this._cancel(),!0},r.prototype._promiseRejected=function(n){return this._totalResolved++,this._reject(n),!0},r.prototype._resultCancelled=function(){if(!this._isResolved()){var n=this._values;if(this._cancel(),n instanceof e)n.cancel();else for(var p=0;p<n.length;++p)n[p]instanceof e&&n[p].cancel()}},r.prototype.shouldCopyValues=function(){return!0},r.prototype.getActualLength=function(n){return n},r}},function(c,h){"use strict";c.exports=function(t){var e=!1,o=[];t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){};function i(){this._trace=new i.CapturedTrace(s())}i.prototype._pushContext=function(){this._trace!==void 0&&(this._trace._promiseCreated=null,o.push(this._trace))},i.prototype._popContext=function(){if(this._trace!==void 0){var a=o.pop(),d=a._promiseCreated;return a._promiseCreated=null,d}return null};function u(){if(e)return new i}function s(){var a=o.length-1;if(a>=0)return o[a]}return i.CapturedTrace=null,i.create=u,i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var a=t.prototype._pushContext,d=t.prototype._popContext,f=t._peekContext,r=t.prototype._peekContext,n=t.prototype._promiseCreated;i.deactivateLongStackTraces=function(){t.prototype._pushContext=a,t.prototype._popContext=d,t._peekContext=f,t.prototype._peekContext=r,t.prototype._promiseCreated=n,e=!1},e=!0,t.prototype._pushContext=i.prototype._pushContext,t.prototype._popContext=i.prototype._popContext,t._peekContext=t.prototype._peekContext=s,t.prototype._promiseCreated=function(){var p=this._peekContext();p&&p._promiseCreated==null&&(p._promiseCreated=this)}},i}},function(c,h,t){"use strict";c.exports=function(e,o){var i=e._getDomain,u=e._async,s=t(59).Warning,a=t(54),d=a.canAttachTrace,f,r,n=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,p=/\((?:timers\.js):\d+:\d+\)/,v=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,m=null,g=null,y=!1,b,x=!!(a.env("BLUEBIRD_DEBUG")!=0&&(a.env("BLUEBIRD_DEBUG")||a.env("NODE_ENV")==="development")),w=!!(a.env("BLUEBIRD_WARNINGS")!=0&&(x||a.env("BLUEBIRD_WARNINGS"))),A=!!(a.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(x||a.env("BLUEBIRD_LONG_STACK_TRACES"))),E=a.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(w||!!a.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var U=this._target();U._bitField=U._bitField&-1048577|524288},e.prototype._ensurePossibleRejectionHandled=function(){if((this._bitField&524288)===0){this._setRejectionIsUnhandled();var U=this;setTimeout(function(){U._notifyUnhandledRejection()},1)}},e.prototype._notifyUnhandledRejectionIsHandled=function(){Pt("rejectionHandled",f,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=this._bitField|268435456},e.prototype._returnedNonUndefined=function(){return(this._bitField&268435456)!==0},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var U=this._settledValue();this._setUnhandledRejectionIsNotified(),Pt("unhandledRejection",r,U,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=this._bitField|262144},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},e.prototype._isUnhandledRejectionNotified=function(){return(this._bitField&262144)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},e.prototype._warn=function(U,V,k){return nt(U,V,k||this)},e.onPossiblyUnhandledRejection=function(U){var V=i();r=typeof U=="function"?V===null?U:a.domainBind(V,U):void 0},e.onUnhandledRejectionHandled=function(U){var V=i();f=typeof U=="function"?V===null?U:a.domainBind(V,U):void 0};var S=function(){};e.longStackTraces=function(){if(u.haveItemsQueued()&&!gt.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);if(!gt.longStackTraces&&xt()){var U=e.prototype._captureStackTrace,V=e.prototype._attachExtraTrace;gt.longStackTraces=!0,S=function(){if(u.haveItemsQueued()&&!gt.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created
See http://goo.gl/MqrFmX
`);e.prototype._captureStackTrace=U,e.prototype._attachExtraTrace=V,o.deactivateLongStackTraces(),u.enableTrampoline(),gt.longStackTraces=!1},e.prototype._captureStackTrace=Y,e.prototype._attachExtraTrace=X,o.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return gt.longStackTraces&&xt()};var C=function(){try{if(typeof CustomEvent=="function"){var U=new CustomEvent("CustomEvent");return a.global.dispatchEvent(U),function(V,k){var Z=new CustomEvent(V.toLowerCase(),{detail:k,cancelable:!0});return!a.global.dispatchEvent(Z)}}else if(typeof Event=="function"){var U=new Event("CustomEvent");return a.global.dispatchEvent(U),function(k,Z){var it=new Event(k.toLowerCase(),{cancelable:!0});return it.detail=Z,!a.global.dispatchEvent(it)}}else{var U=document.createEvent("CustomEvent");return U.initCustomEvent("testingtheevent",!1,!0,{}),a.global.dispatchEvent(U),function(k,Z){var it=document.createEvent("CustomEvent");return it.initCustomEvent(k.toLowerCase(),!1,!0,Z),!a.global.dispatchEvent(it)}}}catch{}return function(){return!1}}(),D=function(){return a.isNode?function(){return process.emit.apply(process,arguments)}:a.global?function(U){var V="on"+U.toLowerCase(),k=a.global[V];return k?(k.apply(a.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}();function L(U,V){return{promise:V}}var M={promiseCreated:L,promiseFulfilled:L,promiseRejected:L,promiseResolved:L,promiseCancelled:L,promiseChained:function(U,V,k){return{promise:V,child:k}},warning:function(U,V){return{warning:V}},unhandledRejection:function(U,V,k){return{reason:V,promise:k}},rejectionHandled:L},P=function(U){var V=!1;try{V=D.apply(null,arguments)}catch(Z){u.throwLater(Z),V=!0}var k=!1;try{k=C(U,M[U].apply(null,arguments))}catch(Z){u.throwLater(Z),k=!0}return k||V};e.config=function(U){if(U=Object(U),"longStackTraces"in U&&(U.longStackTraces?e.longStackTraces():!U.longStackTraces&&e.hasLongStackTraces()&&S()),"warnings"in U){var V=U.warnings;gt.warnings=!!V,E=gt.warnings,a.isObject(V)&&"wForgottenReturn"in V&&(E=!!V.wForgottenReturn)}if("cancellation"in U&&U.cancellation&&!gt.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=et,e.prototype._propagateFrom=F,e.prototype._onCancel=j,e.prototype._setOnCancel=z,e.prototype._attachCancellationCallback=I,e.prototype._execute=K,G=F,gt.cancellation=!0}return"monitoring"in U&&(U.monitoring&&!gt.monitoring?(gt.monitoring=!0,e.prototype._fireEvent=P):!U.monitoring&>.monitoring&&(gt.monitoring=!1,e.prototype._fireEvent=H)),e};function H(){return!1}e.prototype._fireEvent=H,e.prototype._execute=function(U,V,k){try{U(V,k)}catch(Z){return Z}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(U){},e.prototype._attachCancellationCallback=function(U){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(U,V){};function K(U,V,k){var Z=this;try{U(V,k,function(it){if(typeof it!="function")throw new TypeError("onCancel must be a function, got: "+a.toString(it));Z._attachCancellationCallback(it)})}catch(it){return it}}function I(U){if(!this._isCancellable())return this;var V=this._onCancel();V!==void 0?a.isArray(V)?V.push(U):this._setOnCancel([V,U]):this.