mobx 4.9.4 → 4.13.0

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.
@@ -1,4 +1 @@
1
- /** MobX - (c) Michel Weststrate 2015, 2016 - MIT Licensed */
2
- !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.mobx=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n||e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){(function(e,t){"use strict";function r(e,t){function n(){this.constructor=e}pn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}function a(){return"undefined"!=typeof window?window:t}function s(){return++qn.mobxGuid}function u(e){throw c(!1,e),"X"}function c(e,t){if(!e)throw new Error("[mobx] "+(t||dn))}function l(e,t){return!1}function f(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function p(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function h(e){return null!==e&&"object"==typeof e}function d(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function v(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function y(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function b(e,t){}function m(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return h(e)&&!0===e[n]}}function g(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}function w(e){return Array.isArray(e)||Wt(e)}function _(e){return void 0!==a().Map&&e instanceof a().Map}function O(e){return e instanceof Set}function S(e){return d(e)?Object.keys(e):Array.isArray(e)?e.map(function(e){return o(e,1)[0]}):_(e)||cr(e)?x(e.keys()):u("Cannot get keys from '"+e+"'")}function x(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function A(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function E(e){return null===e?null:"object"==typeof e?""+e:e}function D(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function j(e,t){y(e,D(),t)}function T(e){return e[D()]=I,e}function k(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function I(){return this}function C(e,t,n){void 0===t&&(t=bn),void 0===n&&(n=bn);var r=new mn(e);return Ye(r,t),Fe(r,n),r}function V(e,t){return e===t}function N(e,t){return sn(e,t)}function R(e,t){return g(e,t)||V(e,t)}function L(e,t){var n=t?_n:On;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return P(this),this[e]},set:function(t){P(this),this[e]=t}})}function P(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t){v(e,"__mobxDidRunLazyInitializers",!0);for(var n in t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}}function B(e,t){return function(){var n,r=function(r,o,i,a){if(!0===a)return t(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,"__mobxDecorators")){var s=r.__mobxDecorators;v(r,"__mobxDecorators",hn({},s))}return r.__mobxDecorators[o]={prop:o,propertyCreator:t,descriptor:i,decoratorTarget:r,decoratorArguments:n},L(o,e)};return $(arguments)?(n=vn,r.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),r)}}function $(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]||4===e.length&&!0===e[3]}function M(e,t,n){return bt(e)?e:Array.isArray(e)?kn.array(e,{name:n}):d(e)?kn.object(e,void 0,{name:n}):_(e)?kn.map(e,{name:n}):O(e)?kn.set(e,{name:n}):e}function U(e,t,n){return void 0===e||null===e?e:nn(e)||Wt(e)||cr(e)||pr(e)?e:Array.isArray(e)?kn.array(e,{name:n,deep:!1}):d(e)?kn.object(e,void 0,{name:n,deep:!1}):_(e)?kn.map(e,{name:n,deep:!1}):O(e)?kn.set(e,{name:n,deep:!1}):u(!1)}function G(e){return e}function H(e,t,n){return sn(e,t)?t:e}function q(t){var n=B(!0,function(e,n,r,o,i){Yt(e,n,r?r.initializer?r.initializer.call(e):r.value:void 0,t)}),r=(void 0!==e&&e.env,n);return r.enhancer=t,r}function z(e){return null===e||void 0===e?Sn:"string"==typeof e?{name:e,deep:!0}:e}function K(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?G:M}function W(e,t,n){if("string"==typeof arguments[1])return An.apply(null,arguments);if(bt(e))return e;var r=d(e)?kn.object(e,t,n):Array.isArray(e)?kn.array(e,t):_(e)?kn.map(e,t):O(e)?kn.set(e,t):e;if(r!==e)return r;u(!1)}function J(e){u("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function X(e,t){var n=function(){return Y(e,t,this,arguments)};return n.isMobxAction=!0,n}function Y(e,t,n,r){var o=F(e,t,n,r),i=!0;try{var a=t.apply(n,r);return i=!1,a}finally{i?(qn.suppressReactionErrors=i,Q(o),qn.suppressReactionErrors=!1):Q(o)}}function F(e,t,n,r){var o=Ne()&&!!e,i=0;if(o){i=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];Le({type:"action",name:e,object:n,arguments:s})}var c=fe();return Oe(),{prevDerivation:c,prevAllowStateChanges:ee(!0),notifySpy:o,startTime:i}}function Q(e){te(e.prevAllowStateChanges),Se(),pe(e.prevDerivation),e.notifySpy&&Pe({time:Date.now()-e.startTime})}function Z(e,t){var n,r=ee(e);try{n=t()}finally{te(r)}return n}function ee(e){var t=qn.allowStateChanges;return qn.allowStateChanges=e,t}function te(e){qn.allowStateChanges=e}function ne(e){var t=qn.computationDepth;qn.computationDepth=0;var n;try{n=e()}finally{qn.computationDepth=t}return n}function re(e){return e instanceof $n}function oe(e){switch(e.dependenciesState){case n.IDerivationState.UP_TO_DATE:return!1;case n.IDerivationState.NOT_TRACKING:case n.IDerivationState.STALE:return!0;case n.IDerivationState.POSSIBLY_STALE:for(var t=fe(),r=e.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Pn(a)){if(qn.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return pe(t),!0}if(e.dependenciesState===n.IDerivationState.STALE)return pe(t),!0}}return he(e),pe(t),!1}}function ie(){return null!==qn.trackingDerivation}function ae(e){var t=e.observers.length>0;qn.computationDepth>0&&t&&u(!1),qn.allowStateChanges||!t&&"strict"!==qn.enforceActions||u(!1)}function se(e,t,n){he(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++qn.runId;var r=qn.trackingDerivation;qn.trackingDerivation=e;var o;if(!0===qn.disableErrorBoundaries)o=t.call(n);else try{o=t.call(n)}catch(e){o=new $n(e)}return qn.trackingDerivation=r,ue(e),o}function ue(e){for(var t=e.observing,r=e.observing=e.newObserving,o=n.IDerivationState.UP_TO_DATE,i=0,a=e.unboundDepsCount,s=0;s<a;s++){var u=r[s];0===u.diffValue&&(u.diffValue=1,i!==s&&(r[i]=u),i++),u.dependenciesState>o&&(o=u.dependenciesState)}for(r.length=i,e.newObserving=null,a=t.length;a--;){var u=t[a];0===u.diffValue&&we(u,e),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,ge(u,e))}o!==n.IDerivationState.UP_TO_DATE&&(e.dependenciesState=o,e.onBecomeStale())}function ce(e){var t=e.observing;e.observing=[];for(var r=t.length;r--;)we(t[r],e);e.dependenciesState=n.IDerivationState.NOT_TRACKING}function le(e){var t=fe(),n=e();return pe(t),n}function fe(){var e=qn.trackingDerivation;return qn.trackingDerivation=null,e}function pe(e){qn.trackingDerivation=e}function he(e){if(e.dependenciesState!==n.IDerivationState.UP_TO_DATE){e.dependenciesState=n.IDerivationState.UP_TO_DATE;for(var t=e.observing,r=t.length;r--;)t[r].lowestObserverState=n.IDerivationState.UP_TO_DATE}}function de(){(qn.pendingReactions.length||qn.inBatch||qn.isRunningReactions)&&u("isolateGlobalState should be called before MobX is running any reactions"),Hn=!0,Gn&&(0==--a().__mobxInstanceCount&&(a().__mobxGlobals=void 0),qn=new Un)}function ve(){return qn}function ye(){var e=new Un;for(var t in e)-1===Mn.indexOf(t)&&(qn[t]=e[t]);qn.allowStateChanges=!qn.enforceActions}function be(e){return e.observers&&e.observers.length>0}function me(e){return e.observers}function ge(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function we(e,t){if(1===e.observers.length)e.observers.length=0,_e(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function _e(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,qn.pendingUnobservations.push(e))}function Oe(){qn.inBatch++}function Se(){if(0==--qn.inBatch){Ie();for(var e=qn.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ln&&n.suspend())}qn.pendingUnobservations=[]}}function xe(e){var t=qn.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&qn.inBatch>0&&_e(e),!1)}function Ae(e){if(e.lowestObserverState!==n.IDerivationState.STALE){e.lowestObserverState=n.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(o.isTracing!==Bn.NONE&&je(o,e),o.onBecomeStale()),o.dependenciesState=n.IDerivationState.STALE}}}function Ee(e){if(e.lowestObserverState!==n.IDerivationState.STALE){e.lowestObserverState=n.IDerivationState.STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.POSSIBLY_STALE?o.dependenciesState=n.IDerivationState.STALE:o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(e.lowestObserverState=n.IDerivationState.UP_TO_DATE)}}}function De(e){if(e.lowestObserverState===n.IDerivationState.UP_TO_DATE){e.lowestObserverState=n.IDerivationState.POSSIBLY_STALE;for(var t=e.observers,r=t.length;r--;){var o=t[r];o.dependenciesState===n.IDerivationState.UP_TO_DATE&&(o.dependenciesState=n.IDerivationState.POSSIBLY_STALE,o.isTracing!==Bn.NONE&&je(o,e),o.onBecomeStale())}}}function je(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===Bn.BREAK){var n=[];Te(rt(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof Ln?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Te(e,t,n){if(t.length>=1e3)return void t.push("(and many more)");t.push(""+new Array(n).join("\t")+e.name),e.dependencies&&e.dependencies.forEach(function(e){return Te(e,t,n+1)})}function ke(e){return qn.globalReactionErrorHandlers.push(e),function(){var t=qn.globalReactionErrorHandlers.indexOf(e);t>=0&&qn.globalReactionErrorHandlers.splice(t,1)}}function Ie(){qn.inBatch>0||qn.isRunningReactions||Wn(Ce)}function Ce(){qn.isRunningReactions=!0;for(var e=qn.pendingReactions,t=0;e.length>0;){++t===Kn&&(console.error("Reaction doesn't converge to a stable state after "+Kn+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}qn.isRunningReactions=!1}function Ve(e){var t=Wn;Wn=function(n){return e(function(){return t(n)})}}function Ne(){return!!qn.spyListeners.length}function Re(e){if(qn.spyListeners.length)for(var t=qn.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function Le(e){Re(hn({},e,{spyReportStart:!0}))}function Pe(e){Re(e?hn({},e,{spyReportEnd:!0}):Xn)}function Be(e){return qn.spyListeners.push(e),f(function(){qn.spyListeners=qn.spyListeners.filter(function(t){return t!==e})})}function $e(){u(!1)}function Me(e){return function(t,n,r){if(r){if(r.value)return{value:X(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return X(e,o.call(this))}}}return Ue(e).apply(this,arguments)}}function Ue(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){v(this,n,Yn(e,t))}})}}function Ge(e,t,n,r){return!0===r?(ze(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ze(this,t,n.value||n.initializer.call(this)),this[t]},set:$e}:{enumerable:!1,configurable:!0,set:function(e){ze(this,t,e)},get:function(){}}}function He(e,t){var n="string"==typeof e?e:e.name||"<unnamed action>",r="function"==typeof e?e:t;return Y(n,r,this,void 0)}function qe(e){return"function"==typeof e&&!0===e.isMobxAction}function ze(e,t,n){v(e,t,X(t,n.bind(e)))}function Ke(e,t){function n(){e(r)}void 0===t&&(t=yn);var r,o=t&&t.name||e.name||"Autorun@"+s(),i=!t.scheduler&&!t.delay;if(i)r=new zn(o,function(){this.track(n)},t.onError);else{var a=We(t),u=!1;r=new zn(o,function(){u||(u=!0,a(function(){u=!1,r.isDisposed||r.track(n)}))},t.onError)}return r.schedule(),r.getDisposer()}function We(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Fn}function Je(e,t,n){function r(){if(p=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=f||!h(o,n),o=n}),f&&n.fireImmediately&&a(o,d),f||!0!==t||a(o,d),f&&(f=!1)}}void 0===n&&(n=yn),"boolean"==typeof n&&(n={fireImmediately:n},l("Using fireImmediately as argument is deprecated. Use '{ fireImmediately: true }' instead"));var o,i=n.name||"Reaction@"+s(),a=Yn(i,n.onError?Xe(n.onError,t):t),u=!n.scheduler&&!n.delay,c=We(n),f=!0,p=!1,h=n.compareStructural?wn.structural:n.equals||wn.default,d=new zn(i,function(){f||u?r():p||(p=!0,c(r))},n.onError);return d.schedule(),d.getDisposer()}function Xe(e,t){return function(){try{return t.apply(this,arguments)}catch(t){e.call(this,t)}}}function Ye(e,t,n){return Qe("onBecomeObserved",e,t,n)}function Fe(e,t,n){return Qe("onBecomeUnobserved",e,t,n)}function Qe(e,t,n,r){var o="string"==typeof n?rn(t,n):rn(t),i="string"==typeof n?r:n,a=o[e];return"function"!=typeof a?u(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function Ze(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.disableErrorBoundaries,o=e.arrayBuffer,i=e.reactionScheduler;if(!0===e.isolateGlobalState&&de(),void 0!==t){"boolean"!=typeof t&&"strict"!==t||l("Deprecated value for 'enforceActions', use 'false' => '\"never\"', 'true' => '\"observed\"', '\"strict\"' => \"'always'\" instead");var a=void 0;switch(t){case!0:case"observed":a=!0;break;case!1:case"never":a=!1;break;case"strict":case"always":a="strict";break;default:u("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}qn.enforceActions=a,qn.allowStateChanges=!0!==a&&"strict"!==a}void 0!==n&&(qn.computedRequiresReaction=!!n),void 0!==r&&(!0===r&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),qn.disableErrorBoundaries=!!r),"number"==typeof o&&Kt(o),i&&Ve(i)}function et(e,t){var n="function"==typeof e?e.prototype:e;for(var r in t)!function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),i=r.reduce(function(t,r){return r(n,e,t)},o);i&&Object.defineProperty(n,e,i)}(r);return e}function tt(e,t,n){return l("'extendShallowObservable' is deprecated, use 'extendObservable(target, props, { deep: false })' instead"),nt(e,t,n,xn)}function nt(e,t,n,r){var o;r=z(r);var i=r.defaultDecorator||(!1===r.deep?Dn:An);P(e),Xt(e,r.name,i.enhancer),Oe();try{for(var o in t){var a=Object.getOwnPropertyDescriptor(t,o),s=n&&o in n?n[o]:a.get?In:i,u=s(e,o,a,!0);u&&Object.defineProperty(e,o,u)}}finally{Se()}return e}function rt(e,t){return ot(rn(e,t))}function ot(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=p(e.observing).map(ot)),t}function it(e,t){return at(rn(e,t))}function at(e){var t={name:e.name};return be(e)&&(t.observers=me(e).map(at)),t}function st(e){1!==arguments.length&&u("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var n,r=this,o=arguments,i=++Qn,a=Yn(t+" - runid: "+i+" - init",e).apply(r,o),s=void 0,u=new Promise(function(e,r){function o(e){s=void 0;var n;try{n=Yn(t+" - runid: "+i+" - yield "+l++,a.next).call(a,e)}catch(e){return r(e)}c(n)}function u(e){s=void 0;var n;try{n=Yn(t+" - runid: "+i+" - yield "+l++,a.throw).call(a,e)}catch(e){return r(e)}c(n)}function c(t){return t&&"function"==typeof t.then?void t.then(c,r):t.done?e(t.value):(s=Promise.resolve(t.value),s.then(o,u))}var l=0;n=r,o(void 0)});return u.cancel=Yn(t+" - runid: "+i+" - cancel",function(){try{s&&ut(s);var e=a.return(),t=Promise.resolve(e.value);t.then(bn,bn),ut(t),n(new Error("FLOW_CANCELLED"))}catch(e){n(e)}}),u}}function ut(e){"function"==typeof e.cancel&&e.cancel()}function ct(e,t,n){var r;if(cr(e)||Wt(e)||Rn(e))r=on(e);else{if(!nn(e))return u(!1);if("string"!=typeof t)return u(!1);r=on(e,t)}return void 0!==r.dehancer?u(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})}function lt(e,t,n){return"function"==typeof n?pt(e,t,n):ft(e,t)}function ft(e,t){return on(e).intercept(t)}function pt(e,t,n){return on(e,t).intercept(n)}function ht(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===nn(e))return!1;if(!e.$mobx.values[t])return!1;var n=rn(e,t);return Pn(n)}return Pn(e)}function dt(e){return arguments.length>1?u(!1):ht(e)}function vt(e,t){return"string"!=typeof t?u(!1):ht(e,t)}function yt(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(nn(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return nn(e)||!!e.$mobx||gn(e)||Jn(e)||Pn(e)}function bt(e){return 1!==arguments.length&&u(!1),yt(e)}function mt(e,t){return"string"!=typeof t?u(!1):yt(e,t)}function gt(e){return nn(e)?e.$mobx.getKeys():cr(e)?e._keys.slice():pr(e)?x(e.keys()):Wt(e)?e.map(function(e,t){return t}):u(!1)}function wt(e){return nn(e)?gt(e).map(function(t){return e[t]}):cr(e)?gt(e).map(function(t){return e.get(t)}):pr(e)?x(e.values()):Wt(e)?e.slice():u(!1)}function _t(e){return nn(e)?gt(e).map(function(t){return[t,e[t]]}):cr(e)?gt(e).map(function(t){return[t,e.get(t)]}):pr(e)?x(e.entries()):Wt(e)?e.map(function(e,t){return[t,e]}):u(!1)}function Ot(e,t,n){if(2!==arguments.length)if(nn(e)){var r=e.$mobx,o=r.values[t];o?r.write(e,t,n):Yt(e,t,n,r.defaultEnhancer)}else if(cr(e))e.set(t,n);else{if(!Wt(e))return u(!1);"number"!=typeof t&&(t=parseInt(t,10)),c(t>=0,"Not a valid index: '"+t+"'"),Oe(),t>=e.length&&(e.length=t+1),e[t]=n,Se()}else{Oe();var i=t;try{for(var a in i)Ot(e,a,i[a])}finally{Se()}}}function St(e,t){if(nn(e))e.$mobx.remove(t);else if(cr(e))e.delete(t);else if(pr(e))e.delete(t);else{if(!Wt(e))return u(!1);"number"!=typeof t&&(t=parseInt(t,10)),c(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}}function xt(e,t){if(nn(e)){var n=on(e);return n.getKeys(),!!n.values[t]}return cr(e)?e.has(t):pr(e)?e.has(t):Wt(e)?t>=0&&t<e.length:u(!1)}function At(e,t){if(xt(e,t))return nn(e)?e[t]:cr(e)?e.get(t):Wt(e)?e[t]:u(!1)}function Et(e,t,n,r){return"function"==typeof n?jt(e,t,n,r):Dt(e,t,n)}function Dt(e,t,n){return on(e).observe(t,n)}function jt(e,t,n,r){return on(e,t).observe(n,r)}function Tt(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function kt(e,t,n){if(!t.recurseEverything&&!bt(e))return e;if("object"!=typeof e)return e;if(null===e)return null;if(e instanceof Date)return e;if(Rn(e))return kt(e.get(),t,n);if(bt(e)&&gt(e),!0===t.detectCycles&&null!==e&&n.has(e))return n.get(e);if(Wt(e)||Array.isArray(e)){var r=Tt(n,e,[],t),o=e.map(function(e){return kt(e,t,n)});r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(pr(e)||Object.getPrototypeOf(e)===Set.prototype){if(!1===t.exportMapsAsObjects){var s=Tt(n,e,new Set,t);return e.forEach(function(e){s.add(kt(e,t,n))}),s}var u=Tt(n,e,[],t);return e.forEach(function(e){u.push(kt(e,t,n))}),u}if(cr(e)||Object.getPrototypeOf(e)===Map.prototype){if(!1===t.exportMapsAsObjects){var c=Tt(n,e,new Map,t);return e.forEach(function(e,r){c.set(r,kt(e,t,n))}),c}var l=Tt(n,e,{},t);return e.forEach(function(e,r){l[r]=kt(e,t,n)}),l}var f=Tt(n,e,{},t);for(var p in e)f[p]=kt(e[p],t,n);return f}function It(e,t){"boolean"==typeof t&&(t={detectCycles:t}),t||(t=Zn),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles;var n;return t.detectCycles&&(n=new Map),kt(e,t,n)}function Ct(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var r=Vt(e);if(!r)return u(!1);r.isTracing===Bn.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?Bn.BREAK:Bn.LOG}function Vt(e){switch(e.length){case 0:return qn.trackingDerivation;case 1:return rn(e[0]);case 2:return rn(e[0],e[1])}}function Nt(e,t){void 0===t&&(t=void 0),Oe();try{return e.apply(t)}finally{Se()}}function Rt(e,t,n){return 1===arguments.length||t&&"object"==typeof t?Pt(e,t):Lt(e,t,n||{})}function Lt(e,t,n){var r;"number"==typeof n.timeout&&(r=setTimeout(function(){if(!i.$mobx.isDisposed){i();var e=new Error("WHEN_TIMEOUT");if(!n.onError)throw e;n.onError(e)}},n.timeout)),n.name=n.name||"When@"+s();var o=X(n.name+"-effect",t),i=Ke(function(t){e()&&(t.dispose(),r&&clearTimeout(r),o())},n);return i}function Pt(e,t){var n,r=new Promise(function(r,o){var i=Lt(e,r,hn({},t,{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}});return r.cancel=n,r}function Bt(e){return void 0!==e.interceptors&&e.interceptors.length>0}function $t(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),f(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Mt(e,t){var n=fe();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(t=r[o](t),c(!t||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{pe(n)}}function Ut(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function Gt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),f(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function Ht(e,t){var n=fe(),r=e.changeListeners;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)r[o](t);pe(n)}}function qt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function zt(e){Object.defineProperty(or.prototype,""+e,qt(e))}function Kt(e){for(var t=tr;t<e;t++)zt(t);tr=e}function Wt(e){return h(e)&&ar(e.$mobx)}function Jt(e){return e&&e.toString?e.toString():new String(e).toString()}function Xt(e,t,n){void 0===t&&(t=""),void 0===n&&(n=M);var r=e.$mobx;return r||(d(e)||(t=(e.constructor.name||"ObservableObject")+"@"+s()),t||(t="ObservableObject@"+s()),r=new hr(e,t,n),y(e,"$mobx",r),r)}function Yt(e,t,n,r){var o=Xt(e);if(b(e,t),Bt(o)){var i=Mt(o,{object:e,name:t,type:"add",newValue:n});if(!i)return;n=i.newValue}n=(o.values[t]=new Nn(n,r,o.name+"."+t,!1)).value,Object.defineProperty(e,t,Qt(t)),o.keys&&o.keys.push(t),tn(o,e,t,n)}function Ft(e,t,n){var r=Xt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new Ln(n),Object.defineProperty(e,t,en(t))}function Qt(e){return dr[e]||(dr[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}function Zt(e){var t=e.$mobx;return t||(P(e),e.$mobx)}function en(e){return vr[e]||(vr[e]={configurable:!1,enumerable:!1,get:function(){return Zt(this).read(this,e)},set:function(t){Zt(this).write(this,e,t)}})}function tn(e,t,n,r){var o=Ut(e),i=Ne(),a=o||i?{type:"add",object:t,name:n,newValue:r}:null;i&&Le(hn({},a,{name:e.name,key:n})),o&&Ht(e,a),i&&Pe()}function nn(e){return!!h(e)&&(P(e),yr(e.$mobx))}function rn(e,t){if("object"==typeof e&&null!==e){if(Wt(e))return void 0!==t&&u(!1),e.$mobx.atom;if(pr(e))return e.$mobx;if(cr(e)){var n=e;if(void 0===t)return rn(n._keys);var r=n._data.get(t)||n._hasMap.get(t);return r||u(!1),r}if(P(e),t&&!e.$mobx&&e[t],nn(e)){if(!t)return u(!1);var r=e.$mobx.values[t];return r||u(!1),r}if(gn(e)||Pn(e)||Jn(e))return e}else if("function"==typeof e&&Jn(e.$mobx))return e.$mobx;return u(!1)}function on(e,t){return e||u("Expecting some object"),void 0!==t?on(rn(e,t)):gn(e)||Pn(e)||Jn(e)?e:cr(e)||pr(e)?e:(P(e),e.$mobx?e.$mobx:void u(!1))}function an(e,t){var n;return n=void 0!==t?rn(e,t):nn(e)||cr(e)||pr(e)?on(e):rn(e),n.name}function sn(e,t){return un(e,t)}function un(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!==e)return t!==t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&cn(e,t,n,r)}function cn(e,t,n,r){e=ln(e),t=ln(t);var o=br.call(e);if(o!==br.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if((u=e.length)!==t.length)return!1;for(;u--;)if(!un(e[u],t[u],n,r))return!1}else{var c=Object.keys(e),l=void 0;if(u=c.length,Object.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!fn(t,l)||!un(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0}function ln(e){return Wt(e)?e.peek():_(e)||cr(e)?x(e.entries()):O(e)||pr(e)?x(e.entries()):e}function fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}Object.defineProperty(n,"__esModule",{value:!0});var pn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},hn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},dn="An invariant failed, however the error is obfuscated because this is an production build.",vn=[];Object.freeze(vn);var yn={};Object.freeze(yn);var bn=function(){},mn=function(){function e(e){void 0===e&&(e="Atom@"+s()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=n.IDerivationState.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.reportObserved=function(){return xe(this)},e.prototype.reportChanged=function(){Oe(),Ae(this),Se()},e.prototype.toString=function(){return this.name},e}(),gn=m("Atom",mn),wn={identity:V,structural:N,default:R},_n={},On={},Sn={deep:!0,name:void 0,defaultDecorator:void 0},xn={deep:!1,name:void 0,defaultDecorator:void 0};Object.freeze(Sn),Object.freeze(xn);var An=q(M),En=q(U),Dn=q(G),jn=q(H),Tn={box:function(e,t){arguments.length>2&&J("box");var n=z(t);return new Nn(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&J("shallowBox"),l("observable.shallowBox","observable.box(value, { deep: false })"),kn.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&J("array");var n=z(t);return new or(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&J("shallowArray"),l("observable.shallowArray","observable.array(values, { deep: false })"),kn.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&J("map");var n=z(t);return new ur(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&J("shallowMap"),l("observable.shallowMap","observable.map(values, { deep: false })"),kn.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&J("set");var n=z(t);return new fr(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&J("object"),nt({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&J("shallowObject"),l("observable.shallowObject","observable.object(values, {}, { deep: false })"),kn.object(e,{},{name:t,deep:!1})},ref:Dn,shallow:En,deep:An,struct:jn},kn=W;Object.keys(Tn).forEach(function(e){return kn[e]=Tn[e]});var In=B(!1,function(e,t,n,r,o){var i=n.get,a=n.set,s=o[0]||{};Ft(e,t,hn({get:i,set:a},s))}),Cn=In({equals:wn.structural}),Vn=function(e,t,n){if("string"==typeof t)return In.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return In.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new Ln(r)};Vn.struct=Cn;var Nn=function(e){function t(t,n,r,o,i){void 0===r&&(r="ObservableValue@"+s()),void 0===o&&(o=!0),void 0===i&&(i=wn.default);var a=e.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(t,void 0,r),o&&Ne()&&Re({type:"create",name:a.name,newValue:""+a.value}),a}return r(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==qn.UNCHANGED){var n=Ne();n&&Le({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&Pe()}},t.prototype.prepareNewValue=function(e){if(ae(this),Bt(this)){var t=Mt(this,{object:this,type:"update",newValue:e});if(!t)return qn.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?qn.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),Ut(this)&&Ht(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return $t(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),Gt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return E(this.get())},t}(mn);Nn.prototype[A()]=Nn.prototype.valueOf;var Rn=m("ObservableValue",Nn),Ln=function(){function e(e){this.dependenciesState=n.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=n.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+s(),this.value=new $n(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=Bn.NONE,this.derivation=e.get,this.name=e.name||"ComputedValue@"+s(),e.set&&(this.setter=X(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?wn.structural:wn.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return e.prototype.onBecomeStale=function(){De(this)},e.prototype.onBecomeUnobserved=function(){},e.prototype.onBecomeObserved=function(){},e.prototype.get=function(){this.isComputing&&u("Cycle detected in computation "+this.name+": "+this.derivation),0!==qn.inBatch||0!==this.observers.length||this.keepAlive?(xe(this),
3
- oe(this)&&this.trackAndCompute()&&Ee(this)):oe(this)&&(this.warnAboutUntrackedRead(),Oe(),this.value=this.computeValue(!1),Se());var e=this.value;if(re(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(re(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){c(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else c(!1,!1)},e.prototype.trackAndCompute=function(){Ne()&&Re({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===n.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),o=t||re(e)||re(r)||!this.equals(e,r);return o&&(this.value=r),o},e.prototype.computeValue=function(e){this.isComputing=!0,qn.computationDepth++;var t;if(e)t=se(this,this.derivation,this.scope);else if(!0===qn.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new $n(e)}return qn.computationDepth--,this.isComputing=!1,t},e.prototype.suspend=function(){this.keepAlive||(ce(this),this.value=void 0)},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return Ke(function(){var i=n.get();if(!r||t){var a=fe();e({type:"update",object:n,newValue:i,oldValue:o}),pe(a)}r=!1,o=i})},e.prototype.warnAboutUntrackedRead=function(){},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return E(this.get())},e}();Ln.prototype[A()]=Ln.prototype.valueOf;var Pn=m("ComputedValue",Ln);!function(e){e[e.NOT_TRACKING=-1]="NOT_TRACKING",e[e.UP_TO_DATE=0]="UP_TO_DATE",e[e.POSSIBLY_STALE=1]="POSSIBLY_STALE",e[e.STALE=2]="STALE"}(n.IDerivationState||(n.IDerivationState={}));var Bn;!function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(Bn||(Bn={}));var $n=function(){function e(e){this.cause=e}return e}(),Mn=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","disableErrorBoundaries","runId","UNCHANGED"],Un=function(){function e(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}return e}(),Gn=!0,Hn=!1,qn=function(){var e=a();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Gn=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new Un).version&&(Gn=!1),Gn?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Un):(setTimeout(function(){Hn||u("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new Un)}(),zn=function(){function e(e,t,r){void 0===e&&(e="Reaction@"+s()),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.observing=[],this.newObserving=[],this.dependenciesState=n.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+s(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=Bn.NONE}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,qn.pendingReactions.push(this),Ie())},e.prototype.isScheduled=function(){return this._isScheduled},e.prototype.runReaction=function(){if(!this.isDisposed){if(Oe(),this._isScheduled=!1,oe(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ne()&&Re({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Se()}},e.prototype.track=function(e){Oe();var t,n=Ne();n&&(t=Date.now(),Le({name:this.name,type:"reaction"})),this._isRunning=!0;var r=se(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ce(this),re(r)&&this.reportExceptionInDerivation(r.cause),n&&Pe({time:Date.now()-t}),Se()},e.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)return void this.errorHandler(e,this);if(qn.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";qn.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ne()&&Re({type:"error",name:this.name,message:n,error:""+e}),qn.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Oe(),ce(this),Se()))},e.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},e.prototype.toString=function(){return"Reaction["+this.name+"]"},e.prototype.trace=function(e){void 0===e&&(e=!1),Ct(this,e)},e}(),Kn=100,Wn=function(e){return e()},Jn=m("Reaction",zn),Xn={spyReportEnd:!0},Yn=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?X(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?X(e,t):1===arguments.length&&"string"==typeof e?Me(e):!0!==r?Me(t).apply(null,arguments):void(e[t]=X(e.name||t,n.value))};Yn.bound=Ge;var Fn=function(e){return e()},Qn=0,Zn={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1},er=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),tr=0,nr=function(){function e(){}return e}();!function(e,t){void 0!==Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):void 0!==e.prototype.__proto__?e.prototype.__proto__=t:e.prototype=t}(nr,Array.prototype),Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(nr.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var rr=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new mn(e||"ObservableArray@"+s()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return $t(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Gt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>tr&&Kt(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ae(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:void 0===t||null===t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=vn),Bt(this)){var i=Mt(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return vn;t=i.removedCount,n=i.added}n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)});var a=n.length-t;this.updateArrayLength(o,a);var s=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,s),this.dehanceValues(s)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&Ne(),o=Ut(this),i=o||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&Le(hn({},i,{name:this.atom.name})),this.atom.reportChanged(),o&&Ht(this,i),r&&Pe()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&Ne(),o=Ut(this),i=o||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&Le(hn({},i,{name:this.atom.name})),this.atom.reportChanged(),o&&Ht(this,i),r&&Pe()},e}(),or=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+s()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new rr(r,n,i,o);if(y(i,"$mobx",a),t&&t.length){var u=ee(!0);i.spliceWithArray(0,0,t),te(u)}return er&&Object.defineProperty(a.array,"0",ir),i}return r(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Wt(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0),3===arguments.length&&l("The array.find fromIndex argument to find will not be supported anymore in the next major");var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),3===arguments.length&&l("The array.findIndex fromIndex argument to find will not be supported anymore in the next major");for(var r=this.peek(),o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return i;return-1},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(l("observableArray.move is deprecated, use .slice() & .replace() instead"),n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e<t?i(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):i(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){ae(n.atom);var o=r[e];if(Bt(n)){var i=Mt(n,{type:"update",object:this,index:e,newValue:t});if(!i)return;t=i.newValue}t=n.enhancer(t,o);t!==o&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}(nr);j(or.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return T({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(or.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),v(or.prototype,k(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];c("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),v(or.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)v(e,t[n],e[t[n]])}(or.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var ir=qt(0);Kt(1e3);var ar=m("ObservableArrayAdministration",rr),sr={},ur=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableMap@"+s()),this.enhancer=t,this.name=n,this.$mobx=sr,this._keys=new or(void 0,G,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){return this._hasMap.has(e)?this._hasMap.get(e).get():this._updateHasMapEntry(e,!1).get()},e.prototype.set=function(e,t){var n=this._has(e);if(Bt(this)){var r=Mt(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(Bt(this)){var n=Mt(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var r=Ne(),o=Ut(this),n=o||r?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return r&&Le(hn({},n,{name:this.name,key:e})),Nt(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),o&&Ht(this,n),r&&Pe(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);return n?n.setNewValue(t):(n=new Nn(t,G,this.name+"."+Jt(e)+"?",!1),this._hasMap.set(e,n)),n},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==qn.UNCHANGED){var r=Ne(),o=Ut(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&Le(hn({},i,{name:this.name,key:e})),n.setNewValue(t),o&&Ht(this,i),r&&Pe()}},e.prototype._addValue=function(e,t){var n=this;Nt(function(){var r=new Nn(t,n.enhancer,n.name+"."+Jt(e),!1);n._data.set(e,r),t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var r=Ne(),o=Ut(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&Le(hn({},i,{name:this.name,key:e})),o&&Ht(this,i),r&&Pe()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[D()]()},e.prototype.values=function(){var e=this,t=0;return T({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return T({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return cr(e)&&(e=e.toJS()),Nt(function(){d(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.set(r,i)}):_(e)?e.constructor!==Map?u("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!==e&&void 0!==e&&u("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;Nt(function(){le(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return Nt(function(){var n=S(e);t._keys.filter(function(e){return-1===n.indexOf(e)}).forEach(function(e){return t.delete(e)}),t.merge(e)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Jt(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Jt(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return Gt(this,e)},e.prototype.intercept=function(e){return $t(this,e)},e}();j(ur.prototype,function(){return this.entries()}),y(ur.prototype,k(),"Map");var cr=m("ObservableMap",ur),lr={},fr=function(){function e(e,t,n){if(void 0===t&&(t=M),void 0===n&&(n="ObservableSet@"+s()),this.name=n,this.$mobx=lr,this._data=new Set,this._atom=C(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,r){return t(e,r,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;Nt(function(){le(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(r){e.call(t,r,r,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if(ae(this._atom),Bt(this)){var n=Mt(this,{type:"add",object:this,newValue:e});if(!n)return this}if(!this.has(e)){Nt(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var r=Ne(),o=Ut(this),n=o||r?{type:"add",object:this,newValue:e}:null;o&&Ht(this,n)}return this},e.prototype.delete=function(e){var t=this;if(Bt(this)){var n=Mt(this,{type:"delete",object:this,oldValue:e});if(!n)return!1}if(this.has(e)){var r=Ne(),o=Ut(this),n=o||r?{type:"delete",object:this,oldValue:e}:null;return Nt(function(){t._atom.reportChanged(),t._data.delete(e)}),o&&Ht(this,n),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=x(this.keys()),n=x(this.values());return T({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=x(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),T({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return pr(e)&&(e=e.toJS()),Nt(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):O(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!==e&&void 0!==e&&u("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return Gt(this,e)},e.prototype.intercept=function(e){return $t(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+x(this.keys()).join(", ")+" ]"},e}();j(fr.prototype,function(){return this.values()}),y(fr.prototype,k(),"Set");var pr=m("ObservableSet",fr),hr=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var r=this.target;r!==e&&this.illegalAccess(e,t);var o=this.values[t];if(o instanceof Ln)return void o.set(n);if(Bt(this)){var i=Mt(this,{type:"update",object:r,name:t,newValue:n});if(!i)return;n=i.newValue}if((n=o.prepareNewValue(n))!==qn.UNCHANGED){var a=Ut(this),s=Ne(),i=a||s?{type:"update",object:r,oldValue:o.value,name:t,newValue:n}:null;s&&Le(hn({},i,{name:this.name,key:t})),o.setNewValue(n),a&&Ht(this,i),s&&Pe()}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(Bt(this)){var n=Mt(this,{object:t,name:e,type:"remove"});if(!n)return}try{Oe();var r=Ut(this),o=Ne(),i=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var n=r||o?{type:"remove",object:t,oldValue:i,name:e}:null;o&&Le(hn({},n,{name:this.name,key:e})),r&&Ht(this,n),o&&Pe()}finally{Se()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return Gt(this,e)},e.prototype.intercept=function(e){return $t(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new or(Object.keys(this.values).filter(function(t){return e.values[t]instanceof Nn}),G,"keys("+this.name+")",!0)),this.keys.slice()},e}(),dr=Object.create(null),vr=Object.create(null),yr=m("ObservableObjectAdministration",hr),br=Object.prototype.toString;!function(){function e(){}e.name}();"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Be,extras:{getDebugName:an},$mobx:"$mobx"});n.$mobx="$mobx",n.Reaction=zn,n.untracked=le,n.createAtom=C,n.spy=Be,n.comparer=wn,n.isObservableObject=nn,n.isBoxedObservable=Rn,n.isObservableArray=Wt,n.ObservableMap=ur,n.isObservableMap=cr,n.ObservableSet=fr,n.isObservableSet=pr,n.transaction=Nt,n.observable=kn,n.computed=Vn,n.isObservable=bt,n.isObservableProp=mt,n.isComputed=dt,n.isComputedProp=vt,n.extendObservable=nt,n.extendShallowObservable=tt,n.observe=Et,n.intercept=lt,n.autorun=Ke,n.reaction=Je,n.when=Rt,n.action=Yn,n.isAction=qe,n.runInAction=He,n.keys=gt,n.values=wt,n.entries=_t,n.set=Ot,n.remove=St,n.has=xt,n.get=At,n.decorate=et,n.configure=Ze,n.onBecomeObserved=Ye,n.onBecomeUnobserved=Fe,n.flow=st,n.toJS=It,n.trace=Ct,n.getDependencyTree=rt,n.getObserverTree=it,n._resetGlobalState=ye,n._getGlobalState=ve,n.getDebugName=an,n.getAtom=rn,n._getAdministration=on,n._allowStateChanges=Z,n._allowStateChangesInsideComputed=ne,n.isArrayLike=w,n._isComputingDerivation=ie,n.onReactionError=ke,n._interceptReads=ct}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:2}],2:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(f===setTimeout)return setTimeout(e,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function a(e){if(p===clearTimeout)return clearTimeout(e);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function s(){y&&d&&(y=!1,d.length?v=d.concat(v):b=-1,v.length&&u())}function u(){if(!y){var e=i(s);y=!0;for(var t=v.length;t;){for(d=v,v=[];++b<t;)d&&d[b].run();b=-1,t=v.length}d=null,y=!1,a(e)}}function c(e,t){this.fun=e,this.array=t}function l(){}var f,p,h=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(e){f=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(e){p=o}}();var d,v=[],y=!1,b=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];v.push(new c(e,t)),1!==v.length||y||i(u)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.prependListener=l,h.prependOnceListener=l,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}]},{},[1])(1)});
4
- //# sourceMappingURL=lib/mobx.umd.min.js.map
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).mobx={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}var a="An invariant failed, however the error is obfuscated because this is an production build.",s=[];Object.freeze(s);var u={};function c(){return"undefined"!=typeof window?window:global}function l(){return++De.mobxGuid}function f(e){throw p(!1,e),"X"}function p(e,t){if(!e)throw new Error("[mobx] "+(t||a))}Object.freeze(u);function h(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var v=function(){};function d(e){return null!==e&&"object"==typeof e}function y(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function b(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function m(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function g(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return d(e)&&!0===e[n]}}function _(e){return void 0!==c().Map&&e instanceof c().Map}function O(e){return e instanceof Set}function w(e){for(var t=[];;){var n=e.next();if(n.done)break;t.push(n.value)}return t}function S(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function x(e){return null===e?null:"object"==typeof e?""+e:e}function A(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function E(e,t){m(e,A(),t)}function D(e){return e[A()]=k,e}function j(){return"function"==typeof Symbol&&Symbol.toStringTag||"@@toStringTag"}function k(){return this}var T=function(){function t(t){void 0===t&&(t="Atom@"+l()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.NOT_TRACKING}return t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.reportObserved=function(){return Ve(this)},t.prototype.reportChanged=function(){Ie(),function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.isTracing!==fe.NONE&&Ne(o,t),o.onBecomeStale()),o.dependenciesState=e.IDerivationState.STALE}}(this),Ce()},t.prototype.toString=function(){return this.name},t}(),I=g("Atom",T);function C(e,t,n){void 0===t&&(t=v),void 0===n&&(n=v);var r=new T(e);return tt(r,t),nt(r,n),r}function V(e,t){return e===t}var N={identity:V,structural:function(e,t){return sn(e,t)},default:function(e,t){return function(e,t){return"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)}(e,t)||V(e,t)}},R={},P={};function L(e){if(!0!==e.__mobxDidRunLazyInitializers){var t=e.__mobxDecorators;if(t)for(var n in b(e,"__mobxDidRunLazyInitializers",!0),t){var r=t[n];r.propertyCreator(e,r.prop,r.descriptor,r.decoratorTarget,r.decoratorArguments)}}}function B(e,t){return function(){var n,o,i=function(o,i,a,s){if(!0===s)return t(o,i,a,o,n),null;if(!Object.prototype.hasOwnProperty.call(o,"__mobxDecorators")){var u=o.__mobxDecorators;b(o,"__mobxDecorators",r({},u))}return o.__mobxDecorators[i]={prop:i,propertyCreator:t,descriptor:a,decoratorTarget:o,decoratorArguments:n},function(e,t){var n=t?R:P;return n[e]||(n[e]={configurable:!0,enumerable:t,get:function(){return L(this),this[e]},set:function(t){L(this),this[e]=t}})}(i,e)};return(2===(o=arguments).length||3===o.length)&&"string"==typeof o[1]||4===o.length&&!0===o[3]?(n=s,i.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),i)}}function $(e,t,n){return pt(e)?e:Array.isArray(e)?F.array(e,{name:n}):y(e)?F.object(e,void 0,{name:n}):_(e)?F.map(e,{name:n}):O(e)?F.set(e,{name:n}):e}function M(e){return e}function U(e){var t=B(!0,function(t,n,r,o,i){Yt(t,n,r?r.initializer?r.initializer.call(t):r.value:void 0,e)}),n=("undefined"!=typeof process&&process.env,t);return n.enhancer=e,n}var G={deep:!0,name:void 0,defaultDecorator:void 0},H={deep:!1,name:void 0,defaultDecorator:void 0};function z(e){return null==e?G:"string"==typeof e?{name:e,deep:!0}:e}function K(e){return e.defaultDecorator?e.defaultDecorator.enhancer:!1===e.deep?M:$}Object.freeze(G),Object.freeze(H);var W=U($),q=U(function(e,t,n){return null==e?e:tn(e)||Mt(e)||zt(e)||qt(e)?e:Array.isArray(e)?F.array(e,{name:n,deep:!1}):y(e)?F.object(e,void 0,{name:n,deep:!1}):_(e)?F.map(e,{name:n,deep:!1}):O(e)?F.set(e,{name:n,deep:!1}):f(!1)}),J=U(M),X=U(function(e,t,n){return sn(e,t)?t:e});var Y={box:function(e,t){arguments.length>2&&Q("box");var n=z(t);return new se(e,K(n),n.name,!0,n.equals)},shallowBox:function(e,t){return arguments.length>2&&Q("shallowBox"),F.box(e,{name:t,deep:!1})},array:function(e,t){arguments.length>2&&Q("array");var n=z(t);return new Nt(e,K(n),n.name)},shallowArray:function(e,t){return arguments.length>2&&Q("shallowArray"),F.array(e,{name:t,deep:!1})},map:function(e,t){arguments.length>2&&Q("map");var n=z(t);return new Gt(e,K(n),n.name)},shallowMap:function(e,t){return arguments.length>2&&Q("shallowMap"),F.map(e,{name:t,deep:!1})},set:function(e,t){arguments.length>2&&Q("set");var n=z(t);return new Wt(e,K(n),n.name)},object:function(e,t,n){return"string"==typeof arguments[1]&&Q("object"),ot({},e,t,z(n))},shallowObject:function(e,t){return"string"==typeof arguments[1]&&Q("shallowObject"),F.object(e,{},{name:t,deep:!1})},ref:J,shallow:q,deep:W,struct:X},F=function(e,t,n){if("string"==typeof arguments[1])return W.apply(null,arguments);if(pt(e))return e;var r=y(e)?F.object(e,t,n):Array.isArray(e)?F.array(e,t):_(e)?F.map(e,t):O(e)?F.set(e,t):e;if(r!==e)return r;f(!1)};function Q(e){f("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}Object.keys(Y).forEach(function(e){return F[e]=Y[e]});var Z=B(!1,function(e,t,n,o,i){var a=n.get,s=n.set,u=i[0]||{};!function(e,t,n){var r=Xt(e);n.name=r.name+"."+t,n.context=e,r.values[t]=new ce(n),Object.defineProperty(e,t,function(e){return Qt[e]||(Qt[e]={configurable:De.computedConfigurable,enumerable:!1,get:function(){return Zt(this).read(this,e)},set:function(t){Zt(this).write(this,e,t)}})}(t))}(e,t,r({get:a,set:s},u))}),ee=Z({equals:N.structural}),te=function(e,t,n){if("string"==typeof t)return Z.apply(null,arguments);if(null!==e&&"object"==typeof e&&1===arguments.length)return Z.apply(null,arguments);var r="object"==typeof t?t:{};return r.get=e,r.set="function"==typeof t?t:r.set,r.name=r.name||e.name||"",new ce(r)};function ne(e,t){var n=function(){return re(e,t,this,arguments)};return n.isMobxAction=!0,n}function re(e,t,n,r){var o=function(e,t,n,r){var o=Ge()&&!!e,i=0;if(o){i=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];ze({type:"action",name:e,object:n,arguments:s})}var c=_e();Ie();var l=ie(!0);return{prevDerivation:c,prevAllowStateChanges:l,notifySpy:o,startTime:i}}(e,0,n,r),i=!0;try{var a=t.apply(n,r);return i=!1,a}finally{i?(De.suppressReactionErrors=i,oe(o),De.suppressReactionErrors=!1):oe(o)}}function oe(e){ae(e.prevAllowStateChanges),Ce(),Oe(e.prevDerivation),e.notifySpy&&We({time:Date.now()-e.startTime})}function ie(e){var t=De.allowStateChanges;return De.allowStateChanges=e,t}function ae(e){De.allowStateChanges=e}te.struct=ee;var se=function(e){function t(t,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=N.default);var a=e.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(t,void 0,r),o&&Ge()&&He({type:"create",name:a.name,newValue:""+a.value}),a}return n(t,e),t.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==De.UNCHANGED){var n=Ge();n&&ze({type:"update",name:this.name,newValue:e,oldValue:t}),this.setNewValue(e),n&&We()}},t.prototype.prepareNewValue=function(e){if(ye(this),_t(this)){var t=wt(this,{object:this,type:"update",newValue:e});if(!t)return De.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.equals(this.value,e)?De.UNCHANGED:e},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),St(this)&&At(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},t.prototype.intercept=function(e){return Ot(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),xt(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return x(this.get())},t}(T);se.prototype[S()]=se.prototype.valueOf;var ue=g("ObservableValue",se),ce=function(){function t(t){this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=e.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new he(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=fe.NONE,this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=ne(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?N.structural:N.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==e.IDerivationState.UP_TO_DATE)return;t.lowestObserverState=e.IDerivationState.POSSIBLY_STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(o.dependenciesState=e.IDerivationState.POSSIBLY_STALE,o.isTracing!==fe.NONE&&Ne(o,t),o.onBecomeStale())}}(this)},t.prototype.onBecomeUnobserved=function(){},t.prototype.onBecomeObserved=function(){},t.prototype.get=function(){this.isComputing&&f("Cycle detected in computation "+this.name+": "+this.derivation),0!==De.inBatch||0!==this.observers.length||this.keepAlive?(Ve(this),de(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===e.IDerivationState.STALE)return;t.lowestObserverState=e.IDerivationState.STALE;var n=t.observers,r=n.length;for(;r--;){var o=n[r];o.dependenciesState===e.IDerivationState.POSSIBLY_STALE?o.dependenciesState=e.IDerivationState.STALE:o.dependenciesState===e.IDerivationState.UP_TO_DATE&&(t.lowestObserverState=e.IDerivationState.UP_TO_DATE)}}(this)):de(this)&&(this.warnAboutUntrackedRead(),Ie(),this.value=this.computeValue(!1),Ce());var t=this.value;if(ve(t))throw t.cause;return t},t.prototype.peek=function(){var e=this.computeValue(!1);if(ve(e))throw e.cause;return e},t.prototype.set=function(e){if(this.setter){p(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,e)}finally{this.isRunningSetter=!1}}else p(!1,!1)},t.prototype.trackAndCompute=function(){Ge()&&He({object:this.scope,type:"compute",name:this.name});var t=this.value,n=this.dependenciesState===e.IDerivationState.NOT_TRACKING,r=this.computeValue(!0),o=n||ve(t)||ve(r)||!this.equals(t,r);return o&&(this.value=r),o},t.prototype.computeValue=function(e){var t;if(this.isComputing=!0,De.computationDepth++,e)t=be(this,this.derivation,this.scope);else if(!0===De.disableErrorBoundaries)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new he(e)}return De.computationDepth--,this.isComputing=!1,t},t.prototype.suspend=function(){this.keepAlive||(me(this),this.value=void 0)},t.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return Qe(function(){var i=n.get();if(!r||t){var a=_e();e({type:"update",object:n,newValue:i,oldValue:o}),Oe(a)}r=!1,o=i})},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return x(this.get())},t}();ce.prototype[S()]=ce.prototype.valueOf;var le,fe,pe=g("ComputedValue",ce);(le=e.IDerivationState||(e.IDerivationState={}))[le.NOT_TRACKING=-1]="NOT_TRACKING",le[le.UP_TO_DATE=0]="UP_TO_DATE",le[le.POSSIBLY_STALE=1]="POSSIBLY_STALE",le[le.STALE=2]="STALE",function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(fe||(fe={}));var he=function(){return function(e){this.cause=e}}();function ve(e){return e instanceof he}function de(t){switch(t.dependenciesState){case e.IDerivationState.UP_TO_DATE:return!1;case e.IDerivationState.NOT_TRACKING:case e.IDerivationState.STALE:return!0;case e.IDerivationState.POSSIBLY_STALE:for(var n=_e(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(pe(a)){if(De.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return Oe(n),!0}if(t.dependenciesState===e.IDerivationState.STALE)return Oe(n),!0}}return we(t),Oe(n),!1}}function ye(e){var t=e.observers.length>0;De.computationDepth>0&&t&&f(!1),De.allowStateChanges||!t&&"strict"!==De.enforceActions||f(!1)}function be(t,n,r){we(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++De.runId;var o,i=De.trackingDerivation;if(De.trackingDerivation=t,!0===De.disableErrorBoundaries)o=n.call(r);else try{o=n.call(r)}catch(e){o=new he(e)}return De.trackingDerivation=i,function(t){for(var n=t.observing,r=t.observing=t.newObserving,o=e.IDerivationState.UP_TO_DATE,i=0,a=t.unboundDepsCount,s=0;s<a;s++){var u=r[s];0===u.diffValue&&(u.diffValue=1,i!==s&&(r[i]=u),i++),u.dependenciesState>o&&(o=u.dependenciesState)}r.length=i,t.newObserving=null,a=n.length;for(;a--;){var u=n[a];0===u.diffValue&&ke(u,t),u.diffValue=0}for(;i--;){var u=r[i];1===u.diffValue&&(u.diffValue=0,je(u,t))}o!==e.IDerivationState.UP_TO_DATE&&(t.dependenciesState=o,t.onBecomeStale())}(t),o}function me(t){var n=t.observing;t.observing=[];for(var r=n.length;r--;)ke(n[r],t);t.dependenciesState=e.IDerivationState.NOT_TRACKING}function ge(e){var t=_e(),n=e();return Oe(t),n}function _e(){var e=De.trackingDerivation;return De.trackingDerivation=null,e}function Oe(e){De.trackingDerivation=e}function we(t){if(t.dependenciesState!==e.IDerivationState.UP_TO_DATE){t.dependenciesState=e.IDerivationState.UP_TO_DATE;for(var n=t.observing,r=n.length;r--;)n[r].lowestObserverState=e.IDerivationState.UP_TO_DATE}}var Se=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","disableErrorBoundaries","runId","UNCHANGED"],xe=function(){return function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1}}(),Ae=!0,Ee=!1,De=function(){var e=c();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ae=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new xe).version&&(Ae=!1),Ae?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xe):(setTimeout(function(){Ee||f("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new xe)}();function je(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function ke(e,t){if(1===e.observers.length)e.observers.length=0,Te(e);else{var n=e.observers,r=e.observersIndexes,o=n.pop();if(o!==t){var i=r[t.__mapid]||0;i?r[o.__mapid]=i:delete r[o.__mapid],n[i]=o}delete r[t.__mapid]}}function Te(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,De.pendingUnobservations.push(e))}function Ie(){De.inBatch++}function Ce(){if(0==--De.inBatch){Be();for(var e=De.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof ce&&n.suspend())}De.pendingUnobservations=[]}}function Ve(e){var t=De.trackingDerivation;return null!==t?(t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e,e.isBeingObserved||(e.isBeingObserved=!0,e.onBecomeObserved())),!0):(0===e.observers.length&&De.inBatch>0&&Te(e),!1)}function Ne(e,t){if(console.log("[mobx.trace] '"+e.name+"' is invalidated due to a change in: '"+t.name+"'"),e.isTracing===fe.BREAK){var n=[];!function e(t,n,r){if(n.length>=1e3)return void n.push("(and many more)");n.push(""+new Array(r).join("\t")+t.name);t.dependencies&&t.dependencies.forEach(function(t){return e(t,n,r+1)})}(it(e),n,1),new Function("debugger;\n/*\nTracing '"+e.name+"'\n\nYou are entering this break point because derivation '"+e.name+"' is being traced and '"+t.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(e instanceof ce?e.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}var Re=function(){function t(t,n,r){void 0===t&&(t="Reaction@"+l()),this.name=t,this.onInvalidate=n,this.errorHandler=r,this.observing=[],this.newObserving=[],this.dependenciesState=e.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+l(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=fe.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,De.pendingReactions.push(this),Be())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(Ie(),this._isScheduled=!1,de(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ge()&&He({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}Ce()}},t.prototype.track=function(e){Ie();var t,n=Ge();n&&(t=Date.now(),ze({name:this.name,type:"reaction"})),this._isRunning=!0;var r=be(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&me(this),ve(r)&&this.reportExceptionInDerivation(r.cause),n&&We({time:Date.now()-t}),Ce()},t.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler)this.errorHandler(e,this);else{if(De.disableErrorBoundaries)throw e;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";De.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,e),Ge()&&He({type:"error",name:this.name,message:n,error:""+e}),De.globalReactionErrorHandlers.forEach(function(n){return n(e,t)})}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(Ie(),me(this),Ce()))},t.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e.$mobx=this,e},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(e){void 0===e&&(e=!1),bt(this,e)},t}();var Pe=100,Le=function(e){return e()};function Be(){De.inBatch>0||De.isRunningReactions||Le($e)}function $e(){De.isRunningReactions=!0;for(var e=De.pendingReactions,t=0;e.length>0;){++t===Pe&&(console.error("Reaction doesn't converge to a stable state after "+Pe+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}De.isRunningReactions=!1}var Me=g("Reaction",Re);function Ue(e){var t=Le;Le=function(n){return e(function(){return t(n)})}}function Ge(){return!!De.spyListeners.length}function He(e){if(De.spyListeners.length)for(var t=De.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function ze(e){He(r({},e,{spyReportStart:!0}))}var Ke={spyReportEnd:!0};function We(e){He(e?r({},e,{spyReportEnd:!0}):Ke)}function qe(e){return De.spyListeners.push(e),h(function(){De.spyListeners=De.spyListeners.filter(function(t){return t!==e})})}function Je(){f(!1)}function Xe(e){return function(t,n,r){if(r){if(r.value)return{value:ne(e,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return ne(e,o.call(this))}}}return function(e){return function(t,n,r){Object.defineProperty(t,n,{configurable:!0,enumerable:!1,get:function(){},set:function(t){b(this,n,Ye(e,t))}})}}(e).apply(this,arguments)}}var Ye=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?ne(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?ne(e,t):1===arguments.length&&"string"==typeof e?Xe(e):!0!==r?Xe(t).apply(null,arguments):void(e[t]=ne(e.name||t,n.value))};function Fe(e,t,n){b(e,t,ne(t,n.bind(e)))}function Qe(e,t){void 0===t&&(t=u);var n,r=t&&t.name||e.name||"Autorun@"+l();if(!t.scheduler&&!t.delay)n=new Re(r,function(){this.track(a)},t.onError);else{var o=et(t),i=!1;n=new Re(r,function(){i||(i=!0,o(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError)}function a(){e(n)}return n.schedule(),n.getDisposer()}Ye.bound=function(e,t,n,r){return!0===r?(Fe(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Fe(this,t,n.value||n.initializer.call(this)),this[t]},set:Je}:{enumerable:!1,configurable:!0,set:function(e){Fe(this,t,e)},get:function(){}}};var Ze=function(e){return e()};function et(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Ze}function tt(e,t,n){return rt("onBecomeObserved",e,t,n)}function nt(e,t,n){return rt("onBecomeUnobserved",e,t,n)}function rt(e,t,n,r){var o="string"==typeof n?nn(t,n):nn(t),i="string"==typeof n?r:n,a=o[e];return"function"!=typeof a?f(!1):(o[e]=function(){a.call(this),i.call(this)},function(){o[e]=a})}function ot(e,t,n,r){var o=(r=z(r)).defaultDecorator||(!1===r.deep?J:W);L(e),Xt(e,r.name,o.enhancer),Ie();try{for(var i in t){var a=Object.getOwnPropertyDescriptor(t,i),s=(n&&i in n?n[i]:a.get?Z:o)(e,i,a,!0);s&&Object.defineProperty(e,i,s)}}finally{Ce()}return e}function it(e,t){return at(nn(e,t))}function at(e){var t,n,r={name:e.name};return e.observing&&e.observing.length>0&&(r.dependencies=(t=e.observing,n=[],t.forEach(function(e){-1===n.indexOf(e)&&n.push(e)}),n).map(at)),r}function st(e){var t,n={name:e.name};return(t=e).observers&&t.observers.length>0&&(n.observers=function(e){return e.observers}(e).map(st)),n}var ut=0;function ct(e){"function"==typeof e.cancel&&e.cancel()}function lt(e,t){if(null==e)return!1;if(void 0!==t){if(!1===tn(e))return!1;if(!e.$mobx.values[t])return!1;var n=nn(e,t);return pe(n)}return pe(e)}function ft(e,t){if(null==e)return!1;if(void 0!==t){if(tn(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return tn(e)||!!e.$mobx||I(e)||Me(e)||pe(e)}function pt(e){return 1!==arguments.length&&f(!1),ft(e)}function ht(e){return tn(e)?e.$mobx.getKeys():zt(e)?e._keys.slice():qt(e)?w(e.keys()):Mt(e)?e.map(function(e,t){return t}):f(!1)}function vt(e,t){if(tn(e)){var n=rn(e);return n.getKeys(),!!n.values[t]}return zt(e)?e.has(t):qt(e)?e.has(t):Mt(e)?t>=0&&t<e.length:f(!1)}var dt={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function yt(e,t,n,r){return r.detectCycles&&e.set(t,n),n}function bt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;"boolean"==typeof e[e.length-1]&&(n=e.pop());var r=function(e){switch(e.length){case 0:return De.trackingDerivation;case 1:return nn(e[0]);case 2:return nn(e[0],e[1])}}(e);if(!r)return f(!1);r.isTracing===fe.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?fe.BREAK:fe.LOG}function mt(e,t){void 0===t&&(t=void 0),Ie();try{return e.apply(t)}finally{Ce()}}function gt(e,t,n){var r;"number"==typeof n.timeout&&(r=setTimeout(function(){if(!i.$mobx.isDisposed){i();var e=new Error("WHEN_TIMEOUT");if(!n.onError)throw e;n.onError(e)}},n.timeout)),n.name=n.name||"When@"+l();var o=ne(n.name+"-effect",t),i=Qe(function(t){e()&&(t.dispose(),r&&clearTimeout(r),o())},n);return i}function _t(e){return void 0!==e.interceptors&&e.interceptors.length>0}function Ot(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),h(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function wt(e,t){var n=_e();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(p(!(t=r[o](t))||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{Oe(n)}}function St(e){return void 0!==e.changeListeners&&e.changeListeners.length>0}function xt(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),h(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function At(e,t){var n=_e(),r=e.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](t);Oe(n)}}var Et,Dt,jt,kt,Tt=(Et=!1,Dt={},Object.defineProperty(Dt,"0",{set:function(){Et=!0}}),Object.create(Dt)[0]=1,!1===Et),It=0,Ct=function(){return function(){}}();jt=Ct,kt=Array.prototype,void 0!==Object.setPrototypeOf?Object.setPrototypeOf(jt.prototype,kt):void 0!==jt.prototype.__proto__?jt.prototype.__proto__=kt:jt.prototype=kt,Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(Ct.prototype,e,{configurable:!0,writable:!0,value:Array.prototype[e]})});var Vt=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.values=[],this.lastKnownLength=0,this.atom=new T(e||"ObservableArray@"+l()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.dehanceValues=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},e.prototype.intercept=function(e){return Ot(this,e)},e.prototype.observe=function(e,t){return void 0===t&&(t=!1),t&&e({object:this.array,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),xt(this,e)},e.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},e.prototype.setArrayLength=function(e){if("number"!=typeof e||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var n=new Array(e-t),r=0;r<e-t;r++)n[r]=void 0;this.spliceWithArray(t,0,n)}else this.spliceWithArray(e,t-e)},e.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?");this.lastKnownLength+=t,t>0&&e+t+1>It&&Bt(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var r=this;ye(this.atom);var o=this.values.length;if(void 0===e?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),t=1===arguments.length?o-e:null==t?0:Math.max(0,Math.min(t,o-e)),void 0===n&&(n=s),_t(this)){var i=wt(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!i)return s;t=i.removedCount,n=i.added}var a=(n=0===n.length?n:n.map(function(e){return r.enhancer(e,void 0)})).length-t;this.updateArrayLength(o,a);var u=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,u),this.dehanceValues(u)},e.prototype.spliceItemsIntoValues=function(e,t,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,i([e,t],n));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var o=!this.owned&&Ge(),i=St(this),a=i||o?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;o&&ze(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&At(this,a),o&&We()},e.prototype.notifyArraySplice=function(e,t,n){var o=!this.owned&&Ge(),i=St(this),a=i||o?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;o&&ze(r({},a,{name:this.atom.name})),this.atom.reportChanged(),i&&At(this,a),o&&We()},e}(),Nt=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+l()),void 0===o&&(o=!1);var i=e.call(this)||this,a=new Vt(r,n,i,o);if(m(i,"$mobx",a),t&&t.length){var s=ie(!0);i.spliceWithArray(0,0,t),ae(s)}return Tt&&Object.defineProperty(a.array,"0",Rt),i}return n(t,e),t.prototype.intercept=function(e){return this.$mobx.intercept(e)},t.prototype.observe=function(e,t){return void 0===t&&(t=!1),this.$mobx.observe(e,t)},t.prototype.clear=function(){return this.splice(0)},t.prototype.concat=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.$mobx.atom.reportObserved(),Array.prototype.concat.apply(this.peek(),e.map(function(e){return Mt(e)?e.peek():e}))},t.prototype.replace=function(e){return this.$mobx.spliceWithArray(0,this.$mobx.values.length,e)},t.prototype.toJS=function(){return this.slice()},t.prototype.toJSON=function(){return this.toJS()},t.prototype.peek=function(){return this.$mobx.atom.reportObserved(),this.$mobx.dehanceValues(this.$mobx.values)},t.prototype.find=function(e,t,n){void 0===n&&(n=0),arguments.length;var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.get(r)},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),arguments.length;for(var r=this.peek(),o=r.length,i=n;i<o;i++)if(e.call(t,r[i],i,this))return i;return-1},t.prototype.splice=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];switch(arguments.length){case 0:return[];case 1:return this.$mobx.spliceWithArray(e);case 2:return this.$mobx.spliceWithArray(e,t)}return this.$mobx.spliceWithArray(e,t,n)},t.prototype.spliceWithArray=function(e,t,n){return this.$mobx.spliceWithArray(e,t,n)},t.prototype.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(n.values.length,0,e),n.values.length},t.prototype.pop=function(){return this.splice(Math.max(this.$mobx.values.length-1,0),1)[0]},t.prototype.shift=function(){return this.splice(0,1)[0]},t.prototype.unshift=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.$mobx;return n.spliceWithArray(0,0,e),n.values.length},t.prototype.reverse=function(){var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=this.$mobx.dehanceValues(this.$mobx.values).indexOf(e);return t>-1&&(this.splice(t,1),!0)},t.prototype.move=function(e,t){function n(e){if(e<0)throw new Error("[mobx.array] Index out of bounds: "+e+" is negative");var t=this.$mobx.values.length;if(e>=t)throw new Error("[mobx.array] Index out of bounds: "+e+" is not smaller than "+t)}if(n.call(this,e),n.call(this,t),e!==t){var r,o=this.$mobx.values;r=e<t?i(o.slice(0,e),o.slice(e+1,t+1),[o[e]],o.slice(t+1)):i(o.slice(0,t),[o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),t.dehanceValue(t.values[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+t.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},t.prototype.set=function(e,t){var n=this.$mobx,r=n.values;if(e<r.length){ye(n.atom);var o=r[e];if(_t(n)){var i=wt(n,{type:"update",object:this,index:e,newValue:t});if(!i)return;t=i.newValue}(t=n.enhancer(t,o))!==o&&(r[e]=t,n.notifyArrayChildUpdate(e,t,o))}else{if(e!==r.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+r.length);n.spliceWithArray(e,0,[t])}},t}(Ct);E(Nt.prototype,function(){this.$mobx.atom.reportObserved();var e=this,t=0;return D({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})}),Object.defineProperty(Nt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),b(Nt.prototype,j(),"Array"),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some","toString","toLocaleString"].forEach(function(e){var t=Array.prototype[e];p("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),b(Nt.prototype,e,function(){return t.apply(this.peek(),arguments)})}),function(e,t){for(var n=0;n<t.length;n++)b(e,t[n],e[t[n]])}(Nt.prototype,["constructor","intercept","observe","clear","concat","get","replace","toJS","toJSON","peek","find","findIndex","splice","spliceWithArray","push","pop","set","shift","unshift","reverse","sort","remove","move","toString","toLocaleString"]);var Rt=Pt(0);function Pt(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function Lt(e){Object.defineProperty(Nt.prototype,""+e,Pt(e))}function Bt(e){for(var t=It;t<e;t++)Lt(t);It=e}Bt(1e3);var $t=g("ObservableArrayAdministration",Vt);function Mt(e){return d(e)&&$t(e.$mobx)}var Ut={},Gt=function(){function e(e,t,n){if(void 0===t&&(t=$),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=t,this.name=n,this.$mobx=Ut,this._keys=new Nt(void 0,M,this.name+".keys()",!0),"function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(e)}return e.prototype._has=function(e){return this._data.has(e)},e.prototype.has=function(e){var t=this;if(!De.trackingDerivation)return this._has(e);var n=this._hasMap.get(e);if(!n){var r=n=new se(this._has(e),M,this.name+"."+Ht(e)+"?",!1);this._hasMap.set(e,r),nt(r,function(){return t._hasMap.delete(e)})}return n.get()},e.prototype.set=function(e,t){var n=this._has(e);if(_t(this)){var r=wt(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!r)return this;t=r.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(_t(this)&&!(i=wt(this,{type:"delete",object:this,name:e})))return!1;if(this._has(e)){var n=Ge(),o=St(this),i=o||n?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return n&&ze(r({},i,{name:this.name,key:e})),mt(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data.get(e).setNewValue(void 0),t._data.delete(e)}),o&&At(this,i),n&&We(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap.get(e);n&&n.setNewValue(t)},e.prototype._updateValue=function(e,t){var n=this._data.get(e);if((t=n.prepareNewValue(t))!==De.UNCHANGED){var o=Ge(),i=St(this),a=i||o?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;o&&ze(r({},a,{name:this.name,key:e})),n.setNewValue(t),i&&At(this,a),o&&We()}},e.prototype._addValue=function(e,t){var n=this;mt(function(){var r=new se(t,n.enhancer,n.name+"."+Ht(e),!1);n._data.set(e,r),t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var o=Ge(),i=St(this),a=i||o?{type:"add",object:this,name:e,newValue:t}:null;o&&ze(r({},a,{name:this.name,key:e})),i&&At(this,a),o&&We()},e.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.keys=function(){return this._keys[A()]()},e.prototype.values=function(){var e=this,t=0;return D({next:function(){return t<e._keys.length?{value:e.get(e._keys[t++]),done:!1}:{value:void 0,done:!0}}})},e.prototype.entries=function(){var e=this,t=0;return D({next:function(){if(t<e._keys.length){var n=e._keys[t++];return{value:[n,e.get(n)],done:!1}}return{done:!0}}})},e.prototype.forEach=function(e,t){var n=this;this._keys.forEach(function(r){return e.call(t,n.get(r),r,n)})},e.prototype.merge=function(e){var t=this;return zt(e)&&(e=e.toJS()),mt(function(){y(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.set(r,i)}):_(e)?e.constructor!==Map?f("Cannot initialize from classes that inherit from Map: "+e.constructor.name):e.forEach(function(e,n){return t.set(n,e)}):null!=e&&f("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;mt(function(){ge(function(){e._keys.slice().forEach(function(t){return e.delete(t)})})})},e.prototype.replace=function(e){var t=this;return mt(function(){var n,r=y(n=e)?Object.keys(n):Array.isArray(n)?n.map(function(e){return o(e,1)[0]}):_(n)||zt(n)?w(n.keys()):f("Cannot get keys from '"+n+"'");t._keys.filter(function(e){return-1===r.indexOf(e)}).forEach(function(e){return t.delete(e)}),t.merge(e)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toPOJO=function(){var e=this,t={};return this._keys.forEach(function(n){return t["symbol"==typeof n?n:Ht(n)]=e.get(n)}),t},e.prototype.toJS=function(){var e=this,t=new Map;return this._keys.forEach(function(n){return t.set(n,e.get(n))}),t},e.prototype.toJSON=function(){return this.toPOJO()},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this._keys.map(function(t){return Ht(t)+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return xt(this,e)},e.prototype.intercept=function(e){return Ot(this,e)},e}();function Ht(e){return e&&e.toString?e.toString():new String(e).toString()}E(Gt.prototype,function(){return this.entries()}),m(Gt.prototype,j(),"Map");var zt=g("ObservableMap",Gt),Kt={},Wt=function(){function e(e,t,n){if(void 0===t&&(t=$),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this.$mobx=Kt,this._data=new Set,this._atom=C(this.name),"function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(e,r){return t(e,r,n)},e&&this.replace(e)}return e.prototype.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},e.prototype.clear=function(){var e=this;mt(function(){ge(function(){e._data.forEach(function(t){e.delete(t)})})})},e.prototype.forEach=function(e,t){var n=this;this._data.forEach(function(r){e.call(t,r,r,n)})},Object.defineProperty(e.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),e.prototype.add=function(e){var t=this;if((ye(this._atom),_t(this))&&!(o=wt(this,{type:"add",object:this,newValue:e})))return this;if(!this.has(e)){mt(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var n=Ge(),r=St(this),o=r||n?{type:"add",object:this,newValue:e}:null;0,r&&At(this,o)}return this},e.prototype.delete=function(e){var t=this;if(_t(this)&&!(o=wt(this,{type:"delete",object:this,oldValue:e})))return!1;if(this.has(e)){var n=Ge(),r=St(this),o=r||n?{type:"delete",object:this,oldValue:e}:null;return mt(function(){t._atom.reportChanged(),t._data.delete(e)}),r&&At(this,o),!0}return!1},e.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},e.prototype.entries=function(){var e=0,t=w(this.keys()),n=w(this.values());return D({next:function(){var r=e;return e+=1,r<n.length?{value:[t[r],n[r]],done:!1}:{done:!0}}})},e.prototype.keys=function(){return this.values()},e.prototype.values=function(){this._atom.reportObserved();var e,t=this,n=0;return void 0!==this._data.values?e=w(this._data.values()):(e=[],this._data.forEach(function(t){return e.push(t)})),D({next:function(){return n<e.length?{value:t.dehanceValue(e[n++]),done:!1}:{done:!0}}})},e.prototype.replace=function(e){var t=this;return qt(e)&&(e=e.toJS()),mt(function(){Array.isArray(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):O(e)?(t.clear(),e.forEach(function(e){return t.add(e)})):null!=e&&f("Cannot initialize set from "+e)}),this},e.prototype.observe=function(e,t){return xt(this,e)},e.prototype.intercept=function(e){return Ot(this,e)},e.prototype.toJS=function(){return new Set(this)},e.prototype.toString=function(){return this.name+"[ "+w(this.keys()).join(", ")+" ]"},e}();E(Wt.prototype,function(){return this.values()}),m(Wt.prototype,j(),"Set");var qt=g("ObservableSet",Wt),Jt=function(){function e(e,t,n){this.target=e,this.name=t,this.defaultEnhancer=n,this.values={}}return e.prototype.read=function(e,t){if(this.target===e||(this.illegalAccess(e,t),this.values[t]))return this.values[t].get()},e.prototype.write=function(e,t,n){var o=this.target;o!==e&&this.illegalAccess(e,t);var i=this.values[t];if(i instanceof ce)i.set(n);else{if(_t(this)){if(!(u=wt(this,{type:"update",object:o,name:t,newValue:n})))return;n=u.newValue}if((n=i.prepareNewValue(n))!==De.UNCHANGED){var a=St(this),s=Ge(),u=a||s?{type:"update",object:o,oldValue:i.value,name:t,newValue:n}:null;s&&ze(r({},u,{name:this.name,key:t})),i.setNewValue(n),a&&At(this,u),s&&We()}}},e.prototype.remove=function(e){if(this.values[e]){var t=this.target;if(_t(this))if(!(a=wt(this,{object:t,name:e,type:"remove"})))return;try{Ie();var n=St(this),o=Ge(),i=this.values[e].get();this.keys&&this.keys.remove(e),delete this.values[e],delete this.target[e];var a=n||o?{type:"remove",object:t,oldValue:i,name:e}:null;o&&ze(r({},a,{name:this.name,key:e})),n&&At(this,a),o&&We()}finally{Ce()}}},e.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},e.prototype.observe=function(e,t){return xt(this,e)},e.prototype.intercept=function(e){return Ot(this,e)},e.prototype.getKeys=function(){var e=this;return void 0===this.keys&&(this.keys=new Nt(Object.keys(this.values).filter(function(t){return e.values[t]instanceof se}),M,"keys("+this.name+")",!0)),this.keys.slice()},e}();function Xt(e,t,n){void 0===t&&(t=""),void 0===n&&(n=$);var r=e.$mobx;return r||(y(e)||(t=(e.constructor.name||"ObservableObject")+"@"+l()),t||(t="ObservableObject@"+l()),m(e,"$mobx",r=new Jt(e,t,n)),r)}function Yt(e,t,n,o){var i=Xt(e);if(_t(i)){var a=wt(i,{object:e,name:t,type:"add",newValue:n});if(!a)return;n=a.newValue}n=(i.values[t]=new se(n,o,i.name+"."+t,!1)).value,Object.defineProperty(e,t,function(e){return Ft[e]||(Ft[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.read(this,e)},set:function(t){this.$mobx.write(this,e,t)}})}(t)),i.keys&&i.keys.push(t),function(e,t,n,o){var i=St(e),a=Ge(),s=i||a?{type:"add",object:t,name:n,newValue:o}:null;a&&ze(r({},s,{name:e.name,key:n}));i&&At(e,s);a&&We()}(i,e,t,n)}var Ft=Object.create(null),Qt=Object.create(null);function Zt(e){var t=e.$mobx;return t||(L(e),e.$mobx)}var en=g("ObservableObjectAdministration",Jt);function tn(e){return!!d(e)&&(L(e),en(e.$mobx))}function nn(e,t){if("object"==typeof e&&null!==e){if(Mt(e))return void 0!==t&&f(!1),e.$mobx.atom;if(qt(e))return e.$mobx;if(zt(e)){var n=e;return void 0===t?nn(n._keys):((r=n._data.get(t)||n._hasMap.get(t))||f(!1),r)}var r;if(L(e),t&&!e.$mobx&&e[t],tn(e))return t?((r=e.$mobx.values[t])||f(!1),r):f(!1);if(I(e)||pe(e)||Me(e))return e}else if("function"==typeof e&&Me(e.$mobx))return e.$mobx;return f(!1)}function rn(e,t){return e||f("Expecting some object"),void 0!==t?rn(nn(e,t)):I(e)||pe(e)||Me(e)?e:zt(e)||qt(e)?e:(L(e),e.$mobx?e.$mobx:void f(!1))}function on(e,t){return(void 0!==t?nn(e,t):tn(e)||zt(e)||qt(e)?rn(e):nn(e)).name}var an=Object.prototype.toString;function sn(e,t){return un(e,t)}function un(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&function(e,t,n,r){e=cn(e),t=cn(t);var o=an.call(e);if(o!==an.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t)}var i="[object Array]"===o;if(!i){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!("function"==typeof a&&a instanceof a&&"function"==typeof s&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];var u=(n=n||[]).length;for(;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),i){if((u=e.length)!==t.length)return!1;for(;u--;)if(!un(e[u],t[u],n,r))return!1}else{var c=Object.keys(e),l=void 0;if(u=c.length,Object.keys(t).length!==u)return!1;for(;u--;)if(l=c[u],!ln(t,l)||!un(e[l],t[l],n,r))return!1}return n.pop(),r.pop(),!0}(e,t,n,r)}function cn(e){return Mt(e)?e.peek():_(e)||zt(e)?w(e.entries()):O(e)||qt(e)?w(e.entries()):e}function ln(e,t){return Object.prototype.hasOwnProperty.call(e,t)}"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:qe,extras:{getDebugName:on},$mobx:"$mobx"}),e.$mobx="$mobx",e.ObservableMap=Gt,e.ObservableSet=Wt,e.Reaction=Re,e._allowStateChanges=function(e,t){var n,r=ie(e);try{n=t()}finally{ae(r)}return n},e._allowStateChangesInsideComputed=function(e){var t,n=De.computationDepth;De.computationDepth=0;try{t=e()}finally{De.computationDepth=n}return t},e._getAdministration=rn,e._getGlobalState=function(){return De},e._interceptReads=function(e,t,n){var r;if(zt(e)||Mt(e)||ue(e))r=rn(e);else{if(!tn(e))return f(!1);if("string"!=typeof t)return f(!1);r=rn(e,t)}return void 0!==r.dehancer?f(!1):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})},e._isComputingDerivation=function(){return null!==De.trackingDerivation},e._resetGlobalState=function(){var e=new xe;for(var t in e)-1===Se.indexOf(t)&&(De[t]=e[t]);De.allowStateChanges=!De.enforceActions},e.action=Ye,e.autorun=Qe,e.comparer=N,e.computed=te,e.configure=function(e){var t=e.enforceActions,n=e.computedRequiresReaction,r=e.computedConfigurable,o=e.disableErrorBoundaries,i=e.arrayBuffer,a=e.reactionScheduler;if(!0===e.isolateGlobalState&&((De.pendingReactions.length||De.inBatch||De.isRunningReactions)&&f("isolateGlobalState should be called before MobX is running any reactions"),Ee=!0,Ae&&(0==--c().__mobxInstanceCount&&(c().__mobxGlobals=void 0),De=new xe)),void 0!==t){var s=void 0;switch(t){case!0:case"observed":s=!0;break;case!1:case"never":s=!1;break;case"strict":case"always":s="strict";break;default:f("Invalid value for 'enforceActions': '"+t+"', expected 'never', 'always' or 'observed'")}De.enforceActions=s,De.allowStateChanges=!0!==s&&"strict"!==s}void 0!==n&&(De.computedRequiresReaction=!!n),void 0!==r&&(De.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors if this is on."),De.disableErrorBoundaries=!!o),"number"==typeof i&&Bt(i),a&&Ue(a)},e.createAtom=C,e.decorate=function(e,t){var n="function"==typeof e?e.prototype:e,r=function(e){var r=t[e];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,e),i=r.reduce(function(t,r){return r(n,e,t)},o);i&&Object.defineProperty(n,e,i)};for(var o in t)r(o);return e},e.entries=function(e){return tn(e)?ht(e).map(function(t){return[t,e[t]]}):zt(e)?ht(e).map(function(t){return[t,e.get(t)]}):qt(e)?w(e.entries()):Mt(e)?e.map(function(e,t){return[t,e]}):f(!1)},e.extendObservable=ot,e.extendShallowObservable=function(e,t,n){return ot(e,t,n,H)},e.flow=function(e){1!==arguments.length&&f("Flow expects one 1 argument and cannot be used as decorator");var t=e.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ut,i=Ye(t+" - runid: "+o+" - init",e).apply(this,r),a=void 0,s=new Promise(function(e,r){var s=0;function u(e){var n;a=void 0;try{n=Ye(t+" - runid: "+o+" - yield "+s++,i.next).call(i,e)}catch(e){return r(e)}l(n)}function c(e){var n;a=void 0;try{n=Ye(t+" - runid: "+o+" - yield "+s++,i.throw).call(i,e)}catch(e){return r(e)}l(n)}function l(t){if(!t||"function"!=typeof t.then)return t.done?e(t.value):(a=Promise.resolve(t.value)).then(u,c);t.then(l,r)}n=r,u(void 0)});return s.cancel=Ye(t+" - runid: "+o+" - cancel",function(){try{a&&ct(a);var e=i.return(),t=Promise.resolve(e.value);t.then(v,v),ct(t),n(new Error("FLOW_CANCELLED"))}catch(e){n(e)}}),s}},e.get=function(e,t){if(vt(e,t))return tn(e)?e[t]:zt(e)?e.get(t):Mt(e)?e[t]:f(!1)},e.getAtom=nn,e.getDebugName=on,e.getDependencyTree=it,e.getObserverTree=function(e,t){return st(nn(e,t))},e.has=vt,e.intercept=function(e,t,n){return"function"==typeof n?function(e,t,n){return rn(e,t).intercept(n)}(e,t,n):function(e,t){return rn(e).intercept(t)}(e,t)},e.isAction=function(e){return"function"==typeof e&&!0===e.isMobxAction},e.isArrayLike=function(e){return Array.isArray(e)||Mt(e)},e.isBoxedObservable=ue,e.isComputed=function(e){return arguments.length>1?f(!1):lt(e)},e.isComputedProp=function(e,t){return"string"!=typeof t?f(!1):lt(e,t)},e.isObservable=pt,e.isObservableArray=Mt,e.isObservableMap=zt,e.isObservableObject=tn,e.isObservableProp=function(e,t){return"string"!=typeof t?f(!1):ft(e,t)},e.isObservableSet=qt,e.keys=ht,e.observable=F,e.observe=function(e,t,n,r){return"function"==typeof n?function(e,t,n,r){return rn(e,t).observe(n,r)}(e,t,n,r):function(e,t,n){return rn(e).observe(t,n)}(e,t,n)},e.onBecomeObserved=tt,e.onBecomeUnobserved=nt,e.onReactionError=function(e){return De.globalReactionErrorHandlers.push(e),function(){var t=De.globalReactionErrorHandlers.indexOf(e);t>=0&&De.globalReactionErrorHandlers.splice(t,1)}},e.reaction=function(e,t,n){void 0===n&&(n=u),"boolean"==typeof n&&(n={fireImmediately:n});var r,o,i,a=n.name||"Reaction@"+l(),s=Ye(a,n.onError?(r=n.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){r.call(this,e)}}):t),c=!n.scheduler&&!n.delay,f=et(n),p=!0,h=!1,v=n.compareStructural?N.structural:n.equals||N.default,d=new Re(a,function(){p||c?y():h||(h=!0,f(y))},n.onError);function y(){if(h=!1,!d.isDisposed){var t=!1;d.track(function(){var n=e(d);t=p||!v(i,n),i=n}),p&&n.fireImmediately&&s(i,d),p||!0!==t||s(i,d),p&&(p=!1)}}return d.schedule(),d.getDisposer()},e.remove=function(e,t){if(tn(e))e.$mobx.remove(t);else if(zt(e))e.delete(t);else if(qt(e))e.delete(t);else{if(!Mt(e))return f(!1);"number"!=typeof t&&(t=parseInt(t,10)),p(t>=0,"Not a valid index: '"+t+"'"),e.splice(t,1)}},e.runInAction=function(e,t){return re("string"==typeof e?e:e.name||"<unnamed action>","function"==typeof e?e:t,this,void 0)},e.set=function e(t,n,r){if(2!==arguments.length||qt(t))if(tn(t)){var o=t.$mobx;o.values[n]?o.write(t,n,r):Yt(t,n,r,o.defaultEnhancer)}else if(zt(t))t.set(n,r);else if(qt(t))t.add(n);else{if(!Mt(t))return f(!1);"number"!=typeof n&&(n=parseInt(n,10)),p(n>=0,"Not a valid index: '"+n+"'"),Ie(),n>=t.length&&(t.length=n+1),t[n]=r,Ce()}else{Ie();var i=n;try{for(var a in i)e(t,a,i[a])}finally{Ce()}}},e.spy=qe,e.toJS=function(e,t){var n;return"boolean"==typeof t&&(t={detectCycles:t}),t||(t=dt),t.detectCycles=void 0===t.detectCycles?!0===t.recurseEverything:!0===t.detectCycles,t.detectCycles&&(n=new Map),function e(t,n,r){if(!n.recurseEverything&&!pt(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(ue(t))return e(t.get(),n,r);if(pt(t)&&ht(t),!0===n.detectCycles&&null!==t&&r.has(t))return r.get(t);if(Mt(t)||Array.isArray(t)){var o=yt(r,t,[],n),i=t.map(function(t){return e(t,n,r)});o.length=i.length;for(var a=0,s=i.length;a<s;a++)o[a]=i[a];return o}if(qt(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===n.exportMapsAsObjects){var u=yt(r,t,new Set,n);return t.forEach(function(t){u.add(e(t,n,r))}),u}var c=yt(r,t,[],n);return t.forEach(function(t){c.push(e(t,n,r))}),c}if(zt(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===n.exportMapsAsObjects){var l=yt(r,t,new Map,n);return t.forEach(function(t,o){l.set(o,e(t,n,r))}),l}var f=yt(r,t,{},n);return t.forEach(function(t,o){f[o]=e(t,n,r)}),f}var p=yt(r,t,{},n);for(var h in t)p[h]=e(t[h],n,r);return p}(e,t,n)},e.trace=bt,e.transaction=mt,e.untracked=ge,e.values=function(e){return tn(e)?ht(e).map(function(t){return e[t]}):zt(e)?ht(e).map(function(t){return e.get(t)}):qt(e)?w(e.values()):Mt(e)?e.slice():f(!1)},e.when=function(e,t,n){return 1===arguments.length||t&&"object"==typeof t?function(e,t){var n,o=new Promise(function(o,i){var a=gt(e,o,r({},t,{onError:i}));n=function(){a(),i("WHEN_CANCELLED")}});return o.cancel=n,o}(e,t):gt(e,t,n||{})},Object.defineProperty(e,"__esModule",{value:!0})});
@@ -28,7 +28,7 @@ export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<IS
28
28
  dehancer: any;
29
29
  enhancer: (newV: any, oldV: any | undefined) => any;
30
30
  [Symbol.iterator]: () => IterableIterator<T>;
31
- [Symbol.toStringTag]: 'Set';
31
+ [Symbol.toStringTag]: "Set";
32
32
  constructor(initialData?: IObservableSetInitialValues<T>, enhancer?: IEnhancer<T>, name?: string);
33
33
  private dehanceValue;
34
34
  clear(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx",
3
- "version": "4.9.4",
3
+ "version": "4.13.0",
4
4
  "description": "Simple, scalable state management.",
5
5
  "main": "lib/mobx.js",
6
6
  "umd:main": "lib/mobx.umd.js",
@@ -17,19 +17,18 @@
17
17
  "test": "jest",
18
18
  "watch": "jest --watch",
19
19
  "test:mixed-versions": "jest --testRegex mixed-versions",
20
- "test:all": "yarn lint && yarn small-build && yarn jest -i && yarn test:flow && yarn test:mixed-versions",
20
+ "test:all": "yarn lint && yarn jest -i && yarn test:flow && yarn test:mixed-versions",
21
21
  "test:webpack": "node scripts/webpack-regression-tests.js",
22
22
  "test:flow": "node_modules/.bin/flow check",
23
23
  "test:performance": "npm run small-build && PERSIST=true time node --expose-gc test/perf/index.js",
24
- "test:travis": "yarn test:all && yarn test:performance && yarn test -i --coverage && yarn test:es5 && yarn test:webpack && yarn size",
25
- "test:es5": "yarn small-build && es-check es5 lib/mobx.js",
26
- "prettier": "prettier --write --print-width 100 --tab-width 4 --no-semi \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.ts\"",
27
- "_prepublish": "npm run small-build",
24
+ "test:ci": "yarn test:all && yarn test:performance && yarn test -i --coverage && test:es5 && yarn test:webpack && yarn size",
25
+ "test:es5": "yarn es-check es5 lib/mobx.js",
26
+ "prettier": "prettier \"**/*.js\" \"**/*.jsx\" \"**/*.tsx\" \"**/*.ts\"",
27
+ "_prepublish": "yarn small-build",
28
28
  "quick-build": "tsc --pretty",
29
29
  "small-build": "node scripts/build.js",
30
- "lint": "eslint src/*.ts src/types/*.ts src/api/*.ts src/core/*.ts src/utils/*.ts",
30
+ "lint": "eslint src/**/*.ts",
31
31
  "size": "size-limit --babili 20KB lib/mobx.js",
32
- "precommit": "lint-staged",
33
32
  "publish-script": "node scripts/publish.js"
34
33
  },
35
34
  "repository": {
@@ -47,42 +46,39 @@
47
46
  ],
48
47
  "homepage": "https://mobx.js.org/",
49
48
  "devDependencies": {
50
- "@babel/core": "^7.1.0",
51
- "@babel/plugin-proposal-class-properties": "^7.1.0",
52
- "@babel/plugin-proposal-decorators": "^7.1.0",
53
- "@babel/preset-env": "^7.1.0",
54
- "@types/jest": "^21.1.9",
55
- "@types/node": "^7.0.22",
56
- "@typescript-eslint/eslint-plugin": "^1.3.0",
57
- "babel-core": "^7.0.0-bridge.0",
58
- "babel-jest": "^23.6.0",
59
- "browserify": "^12.0.1",
49
+ "@babel/core": "^7.3.4",
50
+ "@babel/plugin-proposal-class-properties": "^7.3.4",
51
+ "@babel/plugin-proposal-decorators": "^7.3.0",
52
+ "@babel/plugin-transform-runtime": "^7.3.4",
53
+ "@babel/preset-env": "^7.3.4",
54
+ "@babel/runtime": "^7.3.4",
55
+ "@types/jest": "^24.0.11",
56
+ "@types/node": "^11.11.3",
57
+ "@typescript-eslint/eslint-plugin": "^1.4.2",
58
+ "babel-jest": "^24.5.0",
60
59
  "chalk": "^1.1.3",
61
- "coveralls": "^2.11.4",
62
- "envify": "^4.1.0",
60
+ "coveralls": "^3.0.3",
63
61
  "es-check": "^5.0.0",
64
- "eslint": "^5.13.0",
62
+ "eslint": "^5.15.2",
65
63
  "flow-bin": "^0.59.0",
66
- "fs-extra": "^3.0.1",
67
- "husky": "^0.14.3",
68
- "iterall": "^1.0.2",
69
- "jest": "^22.0.4",
70
- "lint-staged": "^3.6.1",
71
- "lodash.intersection": "^3.2.0",
72
- "ncp": "^2.0.0",
73
- "prettier": "^1.12.1",
74
- "regenerator-runtime": "^0.11.1",
75
- "rollup": "^0.41.6",
76
- "rollup-plugin-filesize": "^1.3.2",
77
- "rollup-plugin-node-resolve": "^3.0.0",
78
- "serializr": "^1.3.0",
79
- "shelljs": "^0.8.2",
80
- "size-limit": "^0.2.0",
81
- "tape": "^4.2.2",
82
- "ts-jest": "^22.0.0",
83
- "tslib": "^1.7.1",
84
- "typescript": "^3.2.1",
85
- "uglify-js": "^2.6.1"
64
+ "fs-extra": "^7.0.1",
65
+ "husky": "^1.3.1",
66
+ "iterall": "^1.2.2",
67
+ "jest": "^24.5.0",
68
+ "lint-staged": "^8.1.5",
69
+ "prettier": "^1.16.4",
70
+ "rollup": "^1.6.0",
71
+ "rollup-plugin-filesize": "^6.0.1",
72
+ "rollup-plugin-node-resolve": "^4.0.1",
73
+ "rollup-plugin-replace": "^2.1.0",
74
+ "rollup-plugin-terser": "^4.0.4",
75
+ "serializr": "^1.5.1",
76
+ "shelljs": "^0.8.3",
77
+ "size-limit": "^1.0.1",
78
+ "tape": "^4.10.1",
79
+ "ts-jest": "^24.0.0",
80
+ "tslib": "^1.9.3",
81
+ "typescript": "^3.3.3333"
86
82
  },
87
83
  "dependencies": {},
88
84
  "keywords": [
@@ -101,11 +97,16 @@
101
97
  ],
102
98
  "lint-staged": {
103
99
  "*.{ts,tsx,js,jsx}": [
104
- "prettier --write --print-width 100 --tab-width 4 --no-semi",
100
+ "prettier --write",
105
101
  "git add"
106
102
  ]
107
103
  },
108
104
  "jest": {
105
+ "globals": {
106
+ "ts-jest": {
107
+ "tsConfig": "tsconfig.test.json"
108
+ }
109
+ },
109
110
  "transform": {
110
111
  "^.+\\.tsx?$": "ts-jest",
111
112
  "^.+\\.jsx?$": "babel-jest"
@@ -125,5 +126,10 @@
125
126
  "watchPathIgnorePatterns": [
126
127
  "<rootDir>/node_modules/"
127
128
  ]
129
+ },
130
+ "husky": {
131
+ "hooks": {
132
+ "pre-commit": "lint-staged"
133
+ }
128
134
  }
129
135
  }