UNPKG

@logicflow/core

Version:

LogicFlow, help you quickly create flowcharts

1 lines 398 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Core={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r,o={},i={};var a="An invariant failed, however the error is obfuscated because this is a production build.",s=[];Object.freeze(s);var u={};function l(){return++It.mobxGuid}function c(t){throw d(!1,t),"X"}function d(t,e){if(!t)throw new Error("[mobx] "+(e||a))}function p(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(u);var h=function(){};function f(t){return null!==t&&"object"==typeof t}function y(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function v(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function g(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return f(t)&&!0===t[n]}}function _(t){return t instanceof Map}function m(t){return t instanceof Set}function b(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function x(t){return t&&t.toString?t.toString():new String(t).toString()}function E(t){return null===t?null:"object"==typeof t?""+t:t}var M="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,T=Symbol("mobx administration"),S=function(){function t(t){void 0===t&&(t="Atom@"+l()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Q.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return Ht(this)},t.prototype.reportChanged=function(){zt(),function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale()),e.dependenciesState=Q.STALE}))}(this),Ut()},t.prototype.toString=function(){return this.name},t}(),w=g("Atom",S);function A(t,e,n){void 0===e&&(e=h),void 0===n&&(n=h);var r=new S(t);return e!==h&&se(r,e),n!==h&&ue(r,n),r}var O={identity:function(t,e){return t===e},structural:function(t,e){return _n(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return _n(t,e,1)}},D=function(t,e){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},D(t,e)};var N=function(){return N=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},N.apply(this,arguments)};function P(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function C(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function k(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(C(arguments[e]));return t}var L=Symbol("mobx did run lazy initializers"),I=Symbol("mobx pending decorators"),j={},R={};function B(t){var e,n;if(!0!==t[L]){var r=t[I];if(r){v(t,L,!0);var o=k(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=P(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function z(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,I)){var s=r[I];v(r,I,N({},s))}return r[I][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?j:R;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return B(this),this[t]},set:function(e){B(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=s,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function U(t,e,n){return Te(t)?t:Array.isArray(t)?$.array(t,{name:n}):y(t)?$.object(t,void 0,{name:n}):_(t)?$.map(t,{name:n}):m(t)?$.set(t,{name:n}):t}function H(t){return t}function X(t){d(t);var e=z(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;un(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var G={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function W(t){return null==t?G:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(G);var Y=X(U),F=X((function(t,e,n){return null==t||hn(t)||Je(t)||nn(t)||an(t)?t:Array.isArray(t)?$.array(t,{name:n,deep:!1}):y(t)?$.object(t,void 0,{name:n,deep:!1}):_(t)?$.map(t,{name:n,deep:!1}):m(t)?$.set(t,{name:n,deep:!1}):c(!1)})),V=X(H),K=X((function(t,e,n){return _n(t,e)?e:t}));function Z(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?H:U}var q={box:function(t,e){arguments.length>2&&J("box");var n=W(e);return new St(t,Z(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&J("array");var n=W(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+l());void 0===r&&(r=!1);var o=new Ke(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,T,o);var i=new Proxy(o.values,Ve);if(o.proxy=i,t&&t.length){var a=Mt(!0);o.spliceWithArray(0,0,t),Tt(a)}return i}(t,Z(n),n.name)},map:function(t,e){arguments.length>2&&J("map");var n=W(e);return new en(t,Z(n),n.name)},set:function(t,e){arguments.length>2&&J("set");var n=W(e);return new on(t,Z(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&J("object");var r=W(n);if(!1===r.proxy)return de({},t,e,r);var o=pe(r),i=function(t){var e=new Proxy(t,Ue);return t[T].proxy=e,e}(de({},void 0,void 0,r));return he(i,t,e,o),i},ref:V,shallow:F,deep:Y,struct:K},$=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return Y.apply(null,arguments);if(Te(t))return t;var r=y(t)?$.object(t,e,n):Array.isArray(t)?$.array(t,e):_(t)?$.map(t,e):m(t)?$.set(t,e):t;if(r!==t)return r;c(!1)};function J(t){c("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(q).forEach((function(t){return $[t]=q[t]}));var Q,tt,et=z(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};un(t).addComputedProp(t,e,N({get:i,set:a,context:t},s))})),nt=et({equals:O.structural}),rt=function(t,e,n){if("string"==typeof e)return et.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return et.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new At(r)};rt.struct=nt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(Q||(Q={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(tt||(tt={}));var ot=function(t){this.cause=t};function it(t){return t instanceof ot}function at(t){switch(t.dependenciesState){case Q.UP_TO_DATE:return!1;case Q.NOT_TRACKING:case Q.STALE:return!0;case Q.POSSIBLY_STALE:for(var e=ht(!0),n=dt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Ot(a)){if(It.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return pt(n),ft(e),!0}if(t.dependenciesState===Q.STALE)return pt(n),ft(e),!0}}return yt(t),pt(n),ft(e),!1}}function st(t){var e=t.observers.size>0;It.computationDepth>0&&e&&c(!1),It.allowStateChanges||!e&&"strict"!==It.enforceActions||c(!1)}function ut(t,e,n){var r=ht(!0);yt(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++It.runId;var o,i=It.trackingDerivation;if(It.trackingDerivation=t,!0===It.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new ot(t)}return It.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=Q.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&Rt(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,jt(s,t))}r!==Q.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),ft(r),o}function lt(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)Rt(e[n],t);t.dependenciesState=Q.NOT_TRACKING}function ct(t){var e=dt();try{return t()}finally{pt(e)}}function dt(){var t=It.trackingDerivation;return It.trackingDerivation=null,t}function pt(t){It.trackingDerivation=t}function ht(t){var e=It.allowStateReads;return It.allowStateReads=t,e}function ft(t){It.allowStateReads=t}function yt(t){if(t.dependenciesState!==Q.UP_TO_DATE){t.dependenciesState=Q.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=Q.UP_TO_DATE}}var vt=0,gt=1,_t=Object.getOwnPropertyDescriptor((function(){}),"name");function mt(t,e,n){var r=function(){return bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function bt(t,e,n,r){var o=xt();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{Et(o)}}function xt(t,e,n){var r=dt();zt();var o={prevDerivation:r,prevAllowStateChanges:Mt(!0),prevAllowStateReads:ht(!0),notifySpy:false,startTime:0,actionId:gt++,parentActionId:vt};return vt=o.actionId,o}function Et(t){vt!==t.actionId&&c("invalid action stack. did you forget to finish an action?"),vt=t.parentActionId,void 0!==t.error&&(It.suppressReactionErrors=!0),Tt(t.prevAllowStateChanges),ft(t.prevAllowStateReads),Ut(),pt(t.prevDerivation),t.notifySpy,It.suppressReactionErrors=!1}function Mt(t){var e=It.allowStateChanges;return It.allowStateChanges=t,e}function Tt(t){It.allowStateChanges=t}_t&&_t.configurable;var St=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+l()),void 0===o&&(o=!0),void 0===i&&(i=O.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==It.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(st(this),He(this)){var e=Ge(this,{object:this,type:"update",newValue:t});if(!e)return It.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?It.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),We(this)&&Fe(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return Xe(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),Ye(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return E(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(S),wt=g("ObservableValue",St),At=function(){function t(t){this.dependenciesState=Q.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=Q.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+l(),this.value=new ot(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=tt.NONE,d(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+l(),t.set&&(this.setter=mt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?O.structural:O.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==Q.UP_TO_DATE)return;t.lowestObserverState=Q.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===Q.UP_TO_DATE&&(e.dependenciesState=Q.POSSIBLY_STALE,e.isTracing!==tt.NONE&&Xt(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&c("Cycle detected in computation "+this.name+": "+this.derivation),0!==It.inBatch||0!==this.observers.size||this.keepAlive?(Ht(this),at(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===Q.STALE)return;t.lowestObserverState=Q.STALE,t.observers.forEach((function(e){e.dependenciesState===Q.POSSIBLY_STALE?e.dependenciesState=Q.STALE:e.dependenciesState===Q.UP_TO_DATE&&(t.lowestObserverState=Q.UP_TO_DATE)}))}(this)):at(this)&&(this.warnAboutUntrackedRead(),zt(),this.value=this.computeValue(!1),Ut());var t=this.value;if(it(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(it(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){d(!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,t)}finally{this.isRunningSetter=!1}}else d(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===Q.NOT_TRACKING,n=this.computeValue(!0),r=e||it(t)||it(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,It.computationDepth++,t)e=ut(this,this.derivation,this.scope);else if(!0===It.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new ot(t)}return It.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(lt(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return re((function(){var i=n.get();if(!r||e){var a=dt();t({type:"update",object:n,newValue:i,oldValue:o}),pt(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 E(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Ot=g("ComputedValue",At),Dt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Nt=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.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},Pt={};function Ct(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:Pt}var kt=!0,Lt=!1,It=function(){var t=Ct();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(kt=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Nt).version&&(kt=!1),kt?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Nt):(setTimeout((function(){Lt||c("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Nt)}();function jt(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function Rt(t,e){t.observers.delete(e),0===t.observers.size&&Bt(t)}function Bt(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,It.pendingUnobservations.push(t))}function zt(){It.inBatch++}function Ut(){if(0==--It.inBatch){Vt();for(var t=It.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof At&&n.suspend())}It.pendingUnobservations=[]}}function Ht(t){var e=It.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&It.inBatch>0&&Bt(t),!1)}function Xt(t,e){if(t.isTracing===tt.BREAK){var n=[];Gt(fe(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.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"+(t instanceof At?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function Gt(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return Gt(t,e,n+1)})))}var Wt=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+l()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=Q.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=tt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,It.pendingReactions.push(this),Vt())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(zt(),this._isScheduled=!1,at(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}Ut()}},t.prototype.track=function(t){if(!this.isDisposed){zt(),this._isRunning=!0;var e=ut(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&lt(this),it(e)&&this.reportExceptionInDerivation(e.cause),Ut()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(It.disableErrorBoundaries)throw t;It.suppressReactionErrors,It.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(zt(),lt(this),Ut()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[T]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),Ie(this,t)},t}();var Yt=100,Ft=function(t){return t()};function Vt(){It.inBatch>0||It.isRunningReactions||Ft(Kt)}function Kt(){It.isRunningReactions=!0;for(var t=It.pendingReactions,e=0;t.length>0;){++e===Yt&&t.splice(0);for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}It.isRunningReactions=!1}var Zt=g("Reaction",Wt);function qt(t){var e=Ft;Ft=function(n){return t((function(){return e(n)}))}}function $t(t){return function(){}}function Jt(){c(!1)}function Qt(t){return function(e,n,r){if(r){if(r.value)return{value:mt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return mt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){v(this,n,te(t,e))}})}}(t).apply(this,arguments)}}var te=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?mt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?mt(t,e):1===arguments.length&&"string"==typeof t?Qt(t):!0!==r?Qt(e).apply(null,arguments):void v(t,e,mt(t.name||e,n.value,this))};function ee(t,e){"string"==typeof t||t.name;return bt(0,"function"==typeof t?t:e,this,void 0)}function ne(t,e,n){v(t,e,mt(e,n.bind(t)))}function re(t,e){void 0===e&&(e=u);var n,r=e&&e.name||t.name||"Autorun@"+l();if(!e.scheduler&&!e.delay)n=new Wt(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=ie(e),i=!1;n=new Wt(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}te.bound=function(t,e,n,r){return!0===r?(ne(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return ne(this,e,n.value||n.initializer.call(this)),this[e]},set:Jt}:{enumerable:!1,configurable:!0,set:function(t){ne(this,e,t)},get:function(){}}};var oe=function(t){return t()};function ie(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:oe}function ae(t,e,n){void 0===n&&(n=u);var r,o,i,a=n.name||"Reaction@"+l(),s=te(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),c=!n.scheduler&&!n.delay,d=ie(n),p=!0,h=!1,f=n.compareStructural?O.structural:n.equals||O.default,y=new Wt(a,(function(){p||c?v():h||(h=!0,d(v))}),n.onError,n.requiresObservable);function v(){if(h=!1,!y.isDisposed){var e=!1;y.track((function(){var n=t(y);e=p||!f(i,n),i=n})),p&&n.fireImmediately&&s(i,y),p||!0!==e||s(i,y),p&&(p=!1)}}return y.schedule(),y.getDisposer()}function se(t,e,n){return le("onBecomeObserved",t,e,n)}function ue(t,e,n){return le("onBecomeUnobserved",t,e,n)}function le(t,e,n,r){var o="function"==typeof r?fn(e,n):fn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?c(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function ce(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((It.pendingReactions.length||It.inBatch||It.isRunningReactions)&&c("isolateGlobalState should be called before MobX is running any reactions"),Lt=!0,kt&&(0==--Ct().__mobxInstanceCount&&(Ct().__mobxGlobals=void 0),It=new Nt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:c("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}It.enforceActions=u,It.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(It.computedRequiresReaction=!!n),void 0!==a&&(It.reactionRequiresObservable=!!a),void 0!==s&&(It.observableRequiresReaction=!!s,It.allowStateReads=!It.observableRequiresReaction),void 0!==r&&(It.computedConfigurable=!!r),void 0!==o&&(It.disableErrorBoundaries=!!o),i&&qt(i)}function de(t,e,n,r){var o=pe(r=W(r));return B(t),un(t,r.name,o.enhancer),e&&he(t,e,n,o),t}function pe(t){return t.defaultDecorator||(!1===t.deep?V:Y)}function he(t,e,n,r){var o,i;zt();try{var a=M(e);try{for(var s=P(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var d=n&&l in n?n[l]:c.get?et:r;0;var p=d(t,l,c,!0);p&&Object.defineProperty(t,l,p)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{Ut()}}function fe(t,e){return ye(fn(t,e))}function ye(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(ye)),r}function ve(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(ve)),e}var ge=0;function _e(){this.message="FLOW_CANCELLED"}function me(t){"function"==typeof t.cancel&&t.cancel()}function be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===hn(t))return!1;if(!t[T].values.has(e))return!1;var n=fn(t,e);return Ot(n)}return Ot(t)}function xe(t){return arguments.length>1?c(!1):be(t)}function Ee(t,e){return"string"!=typeof e?c(!1):be(t,e)}function Me(t,e){return null!=t&&(void 0!==e?!!hn(t)&&t[T].values.has(e):hn(t)||!!t[T]||w(t)||Zt(t)||Ot(t))}function Te(t){return 1!==arguments.length&&c(!1),Me(t)}function Se(t){return hn(t)?t[T].getKeys():nn(t)||an(t)?Array.from(t.keys()):Je(t)?t.map((function(t,e){return e})):c(!1)}function we(t){return hn(t)?Se(t).map((function(e){return t[e]})):nn(t)?Se(t).map((function(e){return t.get(e)})):an(t)?Array.from(t.values()):Je(t)?t.slice():c(!1)}function Ae(t){return hn(t)?Se(t).map((function(e){return[e,t[e]]})):nn(t)?Se(t).map((function(e){return[e,t.get(e)]})):an(t)?Array.from(t.entries()):Je(t)?t.map((function(t,e){return[e,t]})):c(!1)}function Oe(t,e,n){if(2!==arguments.length||an(t))if(hn(t)){var r=t[T];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(nn(t))t.set(e,n);else if(an(t))t.add(e);else{if(!Je(t))return c(!1);"number"!=typeof e&&(e=parseInt(e,10)),d(e>=0,"Not a valid index: '"+e+"'"),zt(),e>=t.length&&(t.length=e+1),t[e]=n,Ut()}else{zt();var o=e;try{for(var i in o)Oe(t,i,o[i])}finally{Ut()}}}function De(t,e){return hn(t)?yn(t).has(e):nn(t)||an(t)?t.has(e):Je(t)?e>=0&&e<t.length:c(!1)}function Ne(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return yn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return yn(t).observe(e,n)}(t,e,n)}_e.prototype=Object.create(Error.prototype);var Pe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ce(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function ke(t,e,n){if(!e.recurseEverything&&!Te(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(wt(t))return ke(t.get(),e,n);if(Te(t)&&Se(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(Je(t)||Array.isArray(t)){var r=Ce(n,t,[],e),o=t.map((function(t){return ke(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(an(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ce(n,t,new Set,e);return t.forEach((function(t){s.add(ke(t,e,n))})),s}var u=Ce(n,t,[],e);return t.forEach((function(t){u.push(ke(t,e,n))})),u}if(nn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ce(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,ke(t,e,n))})),l}var c=Ce(n,t,{},e);return t.forEach((function(t,r){c[r]=ke(t,e,n)})),c}var d=Ce(n,t,{},e);return b(t).forEach((function(r){d[r]=ke(t[r],e,n)})),d}function Le(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=Pe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),ke(t,e,n)}function Ie(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return It.trackingDerivation;case 1:return fn(t[0]);case 2:return fn(t[0],t[1])}}(t);if(!r)return c(!1);r.isTracing,tt.NONE,r.isTracing=n?tt.BREAK:tt.LOG}function je(t,e){void 0===e&&(e=void 0),zt();try{return t.apply(e)}finally{Ut()}}function Re(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[T].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+l();var o=mt(n.name+"-effect",e),i=re((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function Be(t){return t[T]}function ze(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var Ue={has:function(t,e){if(e===T||"constructor"===e||e===L)return!0;var n=Be(t);return ze(e)?n.has(e):e in t},get:function(t,e){if(e===T||"constructor"===e||e===L)return t[e];var n=Be(t),r=n.values.get(e);if(r instanceof S){var o=r.get();return void 0===o&&n.has(e),o}return ze(e)&&n.has(e),t[e]},set:function(t,e,n){return!!ze(e)&&(Oe(t,e,n),!0)},deleteProperty:function(t,e){return!!ze(e)&&(Be(t).remove(e),!0)},ownKeys:function(t){return Be(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return c("Dynamic observable objects cannot be frozen"),!1}};function He(t){return void 0!==t.interceptors&&t.interceptors.length>0}function Xe(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),p((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Ge(t,e){var n=dt();try{for(var r=k(t.interceptors||[]),o=0,i=r.length;o<i&&(d(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{pt(n)}}function We(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function Ye(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),p((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function Fe(t,e){var n=dt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);pt(n)}}var Ve={get:function(t,e){return e===T?t[T]:"length"===e?t[T].getArrayLength():"number"==typeof e?Ze.get.call(t,e):"string"!=typeof e||isNaN(e)?Ze.hasOwnProperty(e)?Ze[e]:t[e]:Ze.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[T].setArrayLength(n),"number"==typeof e&&Ze.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:Ze.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return c("Observable arrays cannot be frozen"),!1}};var Ke=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new S(t||"ObservableArray@"+l()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),Ye(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;st(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=s),He(this)){var i=Ge(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return s;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,k([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&Fe(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=We(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&Fe(this,i)},t}(),Ze={intercept:function(t){return this[T].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[T].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[T];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[T];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[T].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[T];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[T].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[T];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[T],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[T];if(e&&t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t])},set:function(t,e){var n=this[T],r=n.values;if(t<r.length){st(n.atom);var o=r[t];if(He(n)){var i=Ge(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Ze[t]=function(){var e=this[T];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(Ze[t]=function(e,n){var r=this,o=this[T];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){Ze[t]=function(){var e=this,n=this[T];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var qe,$e=g("ObservableArrayAdministration",Ke);function Je(t){return f(t)&&$e(t[T])}var Qe,tn={},en=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableMap@"+l()),this.enhancer=e,this.name=n,this[qe]=tn,this._keysAtom=A(this.name+".keys()"),this[Symbol.toStringTag]="Map","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(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!It.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new St(this._has(t),H,this.name+"."+x(t)+"?",!1);this._hasMap.set(t,r),ue(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(He(this)){var r=Ge(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((st(this._keysAtom),He(this))&&!(r=Ge(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return je((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&Fe(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==It.UNCHANGED){var r=!1,o=We(this),i=o?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;r,n.setNewValue(e),o&&Fe(this,i)}},t.prototype._addValue=function(t,e){var n=this;st(this._keysAtom),je((function(){var r=new St(e,n.enhancer,n.name+"."+x(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=We(this);r&&Fe(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return En({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return En({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(qe=T,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=C(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return nn(t)&&(t=t.toJS()),je((function(){var n=Mt(!0);try{y(t)?b(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=C(t,2),r=n[0],o=n[1];return e.set(r,o)})):_(t)?(t.constructor!==Map&&c("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&c("Cannot initialize map from "+t)}finally{Tt(n)}})),this},t.prototype.clear=function(){var t=this;je((function(){ct((function(){var e,n;try{for(var r=P(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return je((function(){var n,r,o,i,a=function(t){if(_(t)||nn(t))return t;if(Array.isArray(t))return new Map(t);if(y(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return c("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=P(e._data.keys()),d=l.next();!d.done;d=l.next()){var p=d.value;if(!a.has(p))if(e.delete(p))u=!0;else{var h=e._data.get(p);s.set(p,h)}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var f=P(a.entries()),v=f.next();!v.done;v=f.next()){var g=C(v.value,2),m=(p=g[0],h=g[1],e._data.has(p));if(e.set(p,h),e._data.has(p)){var b=e._data.get(p);s.set(p,b),m||(u=!0)}}}catch(t){o={error:t}}finally{try{v&&!v.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var x=e._data.keys(),E=s.keys(),M=x.next(),T=E.next();!M.done;){if(M.value!==T.value){e._keysAtom.reportChanged();break}M=x.next(),T=E.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=P(this),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:x(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return x(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t}(),nn=g("ObservableMap",en),rn={},on=function(){function t(t,e,n){if(void 0===e&&(e=U),void 0===n&&(n="ObservableSet@"+l()),this.name=n,this[Qe]=rn,this._data=new Set,this._atom=A(this.name),this[Symbol.toStringTag]="Set","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(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;je((function(){ct((function(){var e,n;try{for(var r=P(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=P(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((st(this._atom),He(this))&&!(r=Ge(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){je((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=We(this),r=n?{type:"add",object:this,newValue:t}:null;n&&Fe(this,r)}return this},t.prototype.delete=function(t){var e=this;if(He(this)&&!(r=Ge(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=We(this),r=n?{type:"delete",object:this,oldValue:t}:null;return je((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&Fe(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return En({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return En({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return an(t)&&(t=t.toJS()),je((function(){var n=Mt(!0);try{Array.isArray(t)||m(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&c("Cannot initialize set from "+t)}finally{Tt(n)}})),this},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(Qe=T,Symbol.iterator)]=function(){return this.values()},t}(),an=g("ObservableSet",on),sn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new S(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof At)r.set(e);else{if(He(this)){if(!(a=Ge(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=a.newValue}if((e=r.prepareNewValue(e))!==It.UNCHANGED){var o=We(this),i=!1,a=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;i,r.setNewValue(e),o&&Fe(this,a)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new St(r,H,this.name+"."+x(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(He(this)){var o=Ge(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new St(e,n,this.name+"."+x(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return ln[t]||(ln[t]={configurable:!0,enumerable:!0,get:function(){return this[T].read(t)},set:function(e){this[T].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+x(e),this.values.set(e,new At(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return cn[t]||(cn[t]={configurable:It.computedConfigurable,enumerable:!1,get:function(){return dn(this).read(t)},set:function(e){dn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(He(this))if(!(s=Ge(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{zt();var n=We(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&Fe(this,s)}finally{Ut()}}},t.prototype.illegalAccess=function(t,e){},t.prototype.observe=function(t,e){return Ye(this,t)},t.prototype.intercept=function(t){return Xe(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=We(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&Fe(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=P(this.values),o=r.next();!o.done;o=r.next()){var i=C(o.value,2),a=i[0];i[1]instanceof St&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function un(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=U),Object.prototype.hasOwnProperty.call(t,T))return t[T];y(t)||(e=(t.constructor.name||"ObservableObject")+"@"+l()),e||(e="ObservableObject@"+l());var r=new sn(t,new Map,x(e),n);return v(t,T,r),r}var ln=Object.create(null),cn=Object.create(null);function dn(t){var e=t[T];return e||(B(t),t[T])}var pn=g("ObservableObjectAdministration",sn);function hn(t){return!!f(t)&&(B(t),pn(t[T]))}function fn(t,e){if("object"==typeof t&&null!==t){if(Je(t))return void 0!==e&&c(!1),t[T].atom;if(an(t))return t[T];if(nn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||c(!1),r)}var r;if(B(t),e&&!t[T]&&t[e],hn(t))return e?((r=t[T].values.get(e))||c(!1),r):c(!1);if(w(t)||Ot(t)||Zt(t))return t}else if("function"==typeof t&&Zt(t[T]))return t[T];return c(!1)}function yn(t,e){return t||c("Expecting some object"),void 0!==e?yn(fn(t,e)):w(t)||Ot(t)||Zt(t)||nn(t)||an(t)?t:(B(t),t[T]?t[T]:void c(!1))}function vn(t,e){return(void 0!==e?fn(t,e):hn(t)||nn(t)||an(t)?yn(t):fn(t)).name}var gn=Object.prototype.toString;function _n(t,e,n){return void 0===n&&(n=-1),mn(t,e,n)}function mn(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=gn.call(t);if(a!==gn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=bn(t),e=bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!mn(t[c],e[c],n-1,r,o))return!1}else{var