UNPKG

dbit-lu-angular-tree-component

Version:

A simple yet powerful tree component for Angular2

2 lines 186 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],t):t(e["angular-tree-component"]=e["angular-tree-component"]||{},e._angular_core,e._angular_common)}(this,function(e,t,n){"use strict";function r(e,t){return t={exports:{}},e(t,t.exports),t.exports}function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return b.apply(void 0,e)}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.apply(void 0,e)}function u(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.apply(void 0,e)}function a(){return Math.floor(1e13*Math.random())}function s(e,t,n){void 0===n&&(n=0);for(var r=n,o=e.length-1;r!==o;){var i=Math.floor((r+o)/2);t(e[i])?o=i:r=r===i?o:i}return r}var c="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},l=r(function(e,t){function n(e,t){function n(){this.constructor=e}$t(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function r(e){return e.interceptors&&e.interceptors.length>0}function o(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),xe(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function i(e,t){var n=lt();try{var r=e.interceptors;if(r)for(var o=0,i=r.length;o<i&&(t=r[o](t),_e(!t||t.type,"Intercept handlers should return nothing or a change object"),t);o++);return t}finally{pt(n)}}function u(e){return e.changeListeners&&e.changeListeners.length>0}function a(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),xe(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function s(e,t){var n=lt(),r=e.changeListeners;if(r){r=r.slice();for(var o=0,i=r.length;o<i;o++)r[o](t);pt(n)}}function l(){return!!Cn.spyListeners.length}function p(e){if(Cn.spyListeners.length)for(var t=Cn.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function f(e){p(je({},e,{spyReportStart:!0}))}function d(e){p(e?je({},e,Zt):Zt)}function h(e){return Cn.spyListeners.push(e),xe(function(){var t=Cn.spyListeners.indexOf(e);-1!==t&&Cn.spyListeners.splice(t,1)})}function v(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function g(e){_e(!0!==e[Yt],"Illegal state: cannot recycle array as iterator"),Re(e,Yt,!0);var t=-1;return Re(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function y(e,t){Re(e,v(),t)}function m(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function b(e){Object.defineProperty(qt.prototype,""+e,m(e))}function _(e){for(var t=Kt;t<e;t++)b(t);Kt=e}function w(e){return Ae(e)&&tn(e.$mobx)}function x(e){return un[e]}function O(e,t){_e("function"==typeof t,x("m026")),_e("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return E(e,t,this,arguments)};return n.originalFn=t,n.isMobxAction=!0,n}function E(e,t,n,r){var o=A(e,t,n,r);try{return t.apply(n,r)}finally{I(o)}}function A(e,t,n,r){var o=l()&&!!e,i=0;if(o){i=Date.now();var u=r&&r.length||0,a=new Array(u);if(u>0)for(var s=0;s<u;s++)a[s]=r[s];f({type:"action",name:e,fn:t,object:n,arguments:a})}var c=lt();return Ke(),{prevDerivation:c,prevAllowStateChanges:N(!0),notifySpy:o,startTime:i}}function I(e){R(e.prevAllowStateChanges),Xe(),pt(e.prevDerivation),e.notifySpy&&d({time:Date.now()-e.startTime})}function j(e){_e(null===Cn.trackingDerivation,x("m028")),Cn.strictMode=e,Cn.allowStateChanges=!e}function D(){return Cn.strictMode}function S(e,t){var n,r=N(e);try{n=t()}finally{R(r)}return n}function N(e){var t=Cn.allowStateChanges;return Cn.allowStateChanges=e,t}function R(e){Cn.allowStateChanges=e}function C(e,t,n,r,o){function i(i,u,a,s,c){if(void 0===c&&(c=0),_e(o||P(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),a){Se(i,"__mobxLazyInitializers")||Ne(i,"__mobxLazyInitializers",i.__mobxLazyInitializers&&i.__mobxLazyInitializers.slice()||[]);var l=a.value,p=a.initializer;return i.__mobxLazyInitializers.push(function(t){e(t,u,p?p.call(t):l,s,a)}),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&T(this),t.call(this,u)},set:function(e){!0!==this.__mobxDidRunLazyInitializers&&T(this),n.call(this,u,e)}}}var f={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[u]||k(this,u,void 0,e,s,a),t.call(this,u)},set:function(t){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[u]?n.call(this,u,t):k(this,u,t,e,s,a)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(i,u,f),f}return o?function(){if(P(arguments))return i.apply(null,arguments);var e=arguments,t=arguments.length;return function(n,r,o){return i(n,r,o,e,t)}}:i}function k(e,t,n,r,o,i){Se(e,"__mobxInitializedProps")||Ne(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,o,i)}function T(e){!0!==e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers&&(Ne(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function P(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function M(e){return function(t,n,r){return r&&"function"==typeof r.value?(r.value=O(e,r.value),r.enumerable=!1,r.configurable=!0,r):an(e).apply(this,arguments)}}function L(e,t,n){var r="string"==typeof e?e:e.name||"<unnamed action>",o="function"==typeof e?e:t,i="function"==typeof e?t:n;return _e("function"==typeof o,x("m002")),_e(0===o.length,x("m003")),_e("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),E(r,o,i,void 0)}function V(e){return"function"==typeof e&&!0===e.isMobxAction}function F(e,t,n){var r=function(){return E(t,n,e,arguments)};r.isMobxAction=!0,Ne(e,t,r)}function B(e,t,n){function r(){i(a)}var o,i,u;"string"==typeof e?(o=e,i=t,u=n):(o=e.name||"Autorun@"+me(),i=e,u=t),_e("function"==typeof i,x("m004")),_e(!1===V(i),x("m005")),u&&(i=i.bind(u));var a=new Tn(o,function(){this.track(r)});return a.schedule(),a.getDisposer()}function z(e,t,n,r){var o,i,u,a;return"string"==typeof e?(o=e,i=t,u=n,a=r):(o="When@"+me(),i=e,u=t,a=n),B(o,function(e){if(i.call(a)){e.dispose();var t=lt();u.call(a),pt(t)}})}function U(e,t,n,r){function o(){u(l)}var i,u,a,s;"string"==typeof e?(i=e,u=t,a=n,s=r):(i=e.name||"AutorunAsync@"+me(),u=e,a=t,s=n),_e(!1===V(u),x("m006")),void 0===a&&(a=1),s&&(u=u.bind(s));var c=!1,l=new Tn(i,function(){c||(c=!0,setTimeout(function(){c=!1,l.isDisposed||l.track(o)},a))});return l.schedule(),l.getDisposer()}function $(e,t,n){function r(){if(!s.isDisposed){var n=!1;s.track(function(){var t=e(s);n=De(o.compareStructural,i,t),i=t}),u&&o.fireImmediately&&t(i,s),u||!0!==n||t(i,s),u&&(u=!1)}}arguments.length>3&&be(x("m007")),ae(e)&&be(x("m008"));var o;o="object"==typeof n?n:{},o.name=o.name||e.name||t.name||"Reaction@"+me(),o.fireImmediately=!0===n||!0===o.fireImmediately,o.delay=o.delay||0,o.compareStructural=o.compareStructural||o.struct||!1,t=cn(o.name,o.context?t.bind(o.context):t),o.context&&(e=e.bind(o.context));var i,u=!0,a=!1,s=new Tn(o.name,function(){u||o.delay<1?r():a||(a=!0,setTimeout(function(){a=!1,r()},o.delay))});return s.schedule(),s.getDisposer()}function W(e,t){if(q(e))return e.$mobx;_e(Object.isExtensible(e),x("m035")),Ie(e)||(t=(e.constructor.name||"ObservableObject")+"@"+me()),t||(t="ObservableObject@"+me());var n=new fn(e,t);return Re(e,"$mobx",n),n}function H(e,t,n,r){if(e.values[t])return _e("value"in n,"The property "+t+" in "+e.name+" is already observable, cannot redefine it as computed property"),void(e.target[t]=n.value);if("value"in n)if(ae(n.value)){var o=n.value;G(e,t,o.initialValue,o.enhancer)}else V(n.value)&&!0===n.value.autoBind?F(e.target,t,n.value.originalFn):pn(n.value)?Y(e,t,n.value):G(e,t,n.value,r);else Z(e,t,n.get,n.set,!1,!0)}function G(e,t,n,o){if(ke(e.target,t),r(e)){var u=i(e,{object:e.target,name:t,type:"add",newValue:n});if(!u)return;n=u.newValue}n=(e.values[t]=new rn(n,o,e.name+"."+t,!1)).value,Object.defineProperty(e.target,t,J(t)),Q(e,e.target,t,n)}function Z(e,t,n,r,o,i){i&&ke(e.target,t),e.values[t]=new ln(n,e.target,o,e.name+"."+t,r),i&&Object.defineProperty(e.target,t,K(t))}function Y(e,t,n){var r=e.name+"."+t;n.name=r,n.scope||(n.scope=e.target),e.values[t]=n,Object.defineProperty(e.target,t,K(t))}function J(e){return dn[e]||(dn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){X(this,e,t)}})}function K(e){return hn[e]||(hn[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}})}function X(e,t,n){var o=e.$mobx,a=o.values[t];if(r(o)){var c=i(o,{type:"update",object:e,name:t,newValue:n});if(!c)return;n=c.newValue}if((n=a.prepareNewValue(n))!==nn){var p=u(o),h=l(),c=p||h?{type:"update",object:e,oldValue:a.value,name:t,newValue:n}:null;h&&f(c),a.setNewValue(n),p&&s(o,c),h&&d()}}function Q(e,t,n,r){var o=u(e),i=l(),a=o||i?{type:"add",object:t,name:n,newValue:r}:null;i&&f(a),o&&s(e,a),i&&d()}function q(e){return!!Ae(e)&&(T(e),vn(e.$mobx))}function ee(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(w(e)||An(e))throw new Error(x("m019"));if(q(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return q(e)||!!e.$mobx||Gt(e)||Ln(e)||pn(e)}function te(e){return _e(!!e,":("),C(function(t,n,r,o,i){ke(t,n),_e(!i||!i.get,x("m022")),G(W(t,void 0),n,r,e)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){X(this,e,t)},!0,!1)}function ne(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return oe(e,ce,t)}function re(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return oe(e,pe,t)}function oe(e,t,n){_e(arguments.length>=2,x("m014")),_e("object"==typeof e,x("m015")),_e(!An(e),x("m016")),n.forEach(function(e){_e("object"==typeof e,x("m017")),_e(!ee(e),x("m018"))});for(var r=W(e),o={},i=n.length-1;i>=0;i--){var u=n[i];for(var a in u)if(!0!==o[a]&&Se(u,a)){if(o[a]=!0,e===u&&!Ce(e,a))continue;var s=Object.getOwnPropertyDescriptor(u,a);H(r,a,s,t)}}return e}function ie(e){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return gn.apply(null,arguments);if(_e(arguments.length<=1,x("m021")),_e(!ae(e),x("m020")),ee(e))return e;var t=ce(e,void 0,void 0);return t!==e?t:xn.box(e)}function ue(e){be("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function ae(e){return"object"==typeof e&&null!==e&&!0===e.isMobxModifierDescriptor}function se(e,t){return _e(!ae(t),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:t,enhancer:e}}function ce(e,t,n){return ae(e)&&be("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),ee(e)?e:Array.isArray(e)?xn.array(e,n):Ie(e)?xn.object(e,n):Fe(e)?xn.map(e,n):e}function le(e,t,n){return ae(e)&&be("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),void 0===e||null===e?e:q(e)||w(e)||An(e)?e:Array.isArray(e)?xn.shallowArray(e,n):Ie(e)?xn.shallowObject(e,n):Fe(e)?xn.shallowMap(e,n):be("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function pe(e){return e}function fe(e,t,n){if(Pe(e,t))return t;if(ee(e))return e;if(Array.isArray(e))return new qt(e,fe,n);if(Fe(e))return new En(e,fe,n);if(Ie(e)){var r={};return W(r,n),oe(r,fe,[e]),r}return e}function de(e,t,n){return Pe(e,t)?t:e}function he(e,t){return void 0===t&&(t=void 0),we(x("m023")),ve.apply(void 0,arguments)}function ve(e,t){return void 0===t&&(t=void 0),E("",e)}function ge(e){return we("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),xn.map(e)}function ye(){return c}function me(){return++Cn.mobxGuid}function be(e,t){throw _e(!1,e,t),"X"}function _e(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function we(e){return-1===jn.indexOf(e)&&(jn.push(e),console.error("[mobx] Deprecated: "+e),!0)}function xe(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function Oe(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function Ee(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=" - "),e?e.slice(0,t).join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":""):""}function Ae(e){return null!==e&&"object"==typeof e}function Ie(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function je(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var o in r)Se(r,o)&&(e[o]=r[o])}return e}function De(e,t,n){return"number"==typeof t&&isNaN(t)?"number"!=typeof n||!isNaN(n):e?!Pe(t,n):t!==n}function Se(e,t){return Sn.call(e,t)}function Ne(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Re(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ce(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||!1!==n.configurable&&!1!==n.writable}function ke(e,t){_e(Ce(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function Te(e){var t=[];for(var n in e)t.push(n);return t}function Pe(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;if("object"!=typeof e)return e===t;var n=Le(e),r=Ve(e);if(n!==Le(t))return!1;if(r!==Ve(t))return!1;if(n){if(e.length!==t.length)return!1;for(var o=e.length-1;o>=0;o--)if(!Pe(e[o],t[o]))return!1;return!0}if(r){if(e.size!==t.size)return!1;var i=!0;return e.forEach(function(e,n){i=i&&Pe(t.get(n),e)}),i}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Ve(e)&&Ve(t))return e.size===t.size&&Pe(xn.shallowMap(e).entries(),xn.shallowMap(t).entries());if(Te(e).length!==Te(t).length)return!1;for(var u in e){if(!(u in t))return!1;if(!Pe(e[u],t[u]))return!1}return!0}return!1}function Me(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return Ae(e)&&!0===e[n]}}function Le(e){return Array.isArray(e)||w(e)}function Ve(e){return Fe(e)||An(e)}function Fe(e){return void 0!==ye().Map&&e instanceof ye().Map}function Be(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function ze(e){return null===e?null:"object"==typeof e?""+e:e}function Ue(){var e=ye(),t=Cn;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?Cn=e.__mobxGlobal:e.__mobxGlobal=t}function $e(){return Cn}function We(){Cn.resetId++;var e=new Rn;for(var t in e)-1===Nn.indexOf(t)&&(Cn[t]=e[t]);Cn.allowStateChanges=!Cn.strictMode}function He(e){return e.observers&&e.observers.length>0}function Ge(e){return e.observers}function Ze(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 Ye(e,t){if(1===e.observers.length)e.observers.length=0,Je(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 Je(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,Cn.pendingUnobservations.push(e))}function Ke(){Cn.inBatch++}function Xe(){if(0==--Cn.inBatch){vt();for(var e=Cn.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Cn.pendingUnobservations=[]}}function Qe(e){var t=Cn.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&Je(e)}function qe(e){if(e.lowestObserverState!==t.IDerivationState.STALE){e.lowestObserverState=t.IDerivationState.STALE;for(var n=e.observers,r=n.length;r--;){var o=n[r];o.dependenciesState===t.IDerivationState.UP_TO_DATE&&o.onBecomeStale(),o.dependenciesState=t.IDerivationState.STALE}}}function et(e){if(e.lowestObserverState!==t.IDerivationState.STALE){e.lowestObserverState=t.IDerivationState.STALE;for(var n=e.observers,r=n.length;r--;){var o=n[r];o.dependenciesState===t.IDerivationState.POSSIBLY_STALE?o.dependenciesState=t.IDerivationState.STALE:o.dependenciesState===t.IDerivationState.UP_TO_DATE&&(e.lowestObserverState=t.IDerivationState.UP_TO_DATE)}}}function tt(e){if(e.lowestObserverState===t.IDerivationState.UP_TO_DATE){e.lowestObserverState=t.IDerivationState.POSSIBLY_STALE;for(var n=e.observers,r=n.length;r--;){var o=n[r];o.dependenciesState===t.IDerivationState.UP_TO_DATE&&(o.dependenciesState=t.IDerivationState.POSSIBLY_STALE,o.onBecomeStale())}}}function nt(e){return e instanceof kn}function rt(e){switch(e.dependenciesState){case t.IDerivationState.UP_TO_DATE:return!1;case t.IDerivationState.NOT_TRACKING:case t.IDerivationState.STALE:return!0;case t.IDerivationState.POSSIBLY_STALE:for(var n=lt(),r=e.observing,o=r.length,i=0;i<o;i++){var u=r[i];if(pn(u)){try{u.get()}catch(e){return pt(n),!0}if(e.dependenciesState===t.IDerivationState.STALE)return pt(n),!0}}return ft(e),pt(n),!1}}function ot(){return null!==Cn.trackingDerivation}function it(e){var t=e.observers.length>0;Cn.computationDepth>0&&t&&be(x("m031")+e.name),!Cn.allowStateChanges&&t&&be(x(Cn.strictMode?"m030a":"m030b")+e.name)}function ut(e,t,n){ft(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Cn.runId;var r=Cn.trackingDerivation;Cn.trackingDerivation=e;var o;try{o=t.call(n)}catch(e){o=new kn(e)}return Cn.trackingDerivation=r,at(e),o}function at(e){var n=e.observing,r=e.observing=e.newObserving,o=t.IDerivationState.UP_TO_DATE;e.newObserving=null;for(var i=0,u=e.unboundDepsCount,a=0;a<u;a++){var s=r[a];0===s.diffValue&&(s.diffValue=1,i!==a&&(r[i]=s),i++),s.dependenciesState>o&&(o=s.dependenciesState)}for(r.length=i,u=n.length;u--;){var s=n[u];0===s.diffValue&&Ye(s,e),s.diffValue=0}for(;i--;){var s=r[i];1===s.diffValue&&(s.diffValue=0,Ze(s,e))}o!==t.IDerivationState.UP_TO_DATE&&(e.dependenciesState=o,e.onBecomeStale())}function st(e){var n=e.observing;e.observing=[];for(var r=n.length;r--;)Ye(n[r],e);e.dependenciesState=t.IDerivationState.NOT_TRACKING}function ct(e){var t=lt(),n=e();return pt(t),n}function lt(){var e=Cn.trackingDerivation;return Cn.trackingDerivation=null,e}function pt(e){Cn.trackingDerivation=e}function ft(e){if(e.dependenciesState!==t.IDerivationState.UP_TO_DATE){e.dependenciesState=t.IDerivationState.UP_TO_DATE;for(var n=e.observing,r=n.length;r--;)n[r].lowestObserverState=t.IDerivationState.UP_TO_DATE}}function dt(e){_e(this&&this.$mobx&&Ln(this.$mobx),"Invalid `this`"),_e(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=e}function ht(e){return Cn.globalReactionErrorHandlers.push(e),function(){var t=Cn.globalReactionErrorHandlers.indexOf(e);t>=0&&Cn.globalReactionErrorHandlers.splice(t,1)}}function vt(){Cn.inBatch>0||Cn.isRunningReactions||Mn(gt)}function gt(){Cn.isRunningReactions=!0;for(var e=Cn.pendingReactions,t=0;e.length>0;){++t===Pn&&(console.error("Reaction doesn't converge to a stable state after "+Pn+" 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()}Cn.isRunningReactions=!1}function yt(e){var t=Mn;Mn=function(n){return e(function(){return t(n)})}}function mt(e){return we("asReference is deprecated, use observable.ref instead"),xn.ref(e)}function bt(e){return we("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),xn.struct(e)}function _t(e){return we("asFlat is deprecated, use observable.shallow instead"),xn.shallow(e)}function wt(e){return we("asMap is deprecated, use observable.map or observable.shallowMap instead"),xn.map(e||{})}function xt(e){return C(function(t,n,r,o,i){_e(void 0!==i,x("m009")),_e("function"==typeof i.get,x("m010")),Z(W(t,""),n,i.get,i.set,e,!1)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!1)}function Ot(e,t){if("object"==typeof e&&null!==e){if(w(e))return _e(void 0===t,x("m036")),e.$mobx.atom;if(An(e)){var n=e;if(void 0===t)return Ot(n._keys);var r=n._data[t]||n._hasMap[t];return _e(!!r,"the entry '"+t+"' does not exist in the observable map '"+At(e)+"'"),r}if(T(e),q(e)){if(!t)return be("please specify a property");var r=e.$mobx.values[t];return _e(!!r,"no observable property '"+t+"' found on the observable object '"+At(e)+"'"),r}if(Gt(e)||pn(e)||Ln(e))return e}else if("function"==typeof e&&Ln(e.$mobx))return e.$mobx;return be("Cannot obtain atom from "+e)}function Et(e,t){return _e(e,"Expecting some object"),void 0!==t?Et(Ot(e,t)):Gt(e)||pn(e)||Ln(e)?e:An(e)?e:(T(e),e.$mobx?e.$mobx:void _e(!1,"Cannot obtain administration from "+e))}function At(e,t){var n;return n=void 0!==t?Ot(e,t):q(e)||An(e)?Et(e):Ot(e),n.name}function It(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===q(e))return!1;var n=Ot(e,t);return pn(n)}return pn(e)}function jt(e,t,n,r){return"function"==typeof n?St(e,t,n,r):Dt(e,t,n)}function Dt(e,t,n){return Et(e).observe(t,n)}function St(e,t,n,r){return Et(e,t).observe(n,r)}function Nt(e,t,n){return"function"==typeof n?Ct(e,t,n):Rt(e,t)}function Rt(e,t){return Et(e).intercept(t)}function Ct(e,t,n){return Et(e,t).intercept(n)}function kt(e,t){return ot()||console.warn(x("m013")),Bn(e,{context:t}).get()}function Tt(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=[]),ee(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var o=0,i=n.length;o<i;o++)if(n[o][0]===e)return n[o][1];if(w(e)){var u=r([]),a=e.map(function(e){return Tt(e,t,n)});u.length=a.length;for(var o=0,i=a.length;o<i;o++)u[o]=a[o];return u}if(q(e)){var u=r({});for(var s in e)u[s]=Tt(e[s],t,n);return u}if(An(e)){var c=r({});return e.forEach(function(e,r){return c[r]=Tt(e,t,n)}),c}if(on(e))return Tt(e.get(),t,n)}return e}function Pt(e,t){_e("function"==typeof e&&e.length<2,"createTransformer expects a function that accepts one argument");var r={},o=Cn.resetId,i=function(o){function i(t,n){var r=o.call(this,function(){return e(n)},void 0,!1,"Transformer-"+e.name+"-"+t,void 0)||this;return r.sourceIdentifier=t,r.sourceObject=n,r}return n(i,o),i.prototype.onBecomeUnobserved=function(){var e=this.value;o.prototype.onBecomeUnobserved.call(this),delete r[this.sourceIdentifier],t&&t(e,this.sourceObject)},i}(ln);return function(e){o!==Cn.resetId&&(r={},o=Cn.resetId);var t=Mt(e),n=r[t];return n?n.get():(n=r[t]=new i(t,e),n.get())}}function Mt(e){if("string"==typeof e||"number"==typeof e)return e;if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+e);var t=e.$transformId;return void 0===t&&(t=me(),Ne(e,"$transformId",t)),t}function Lt(e){return console.log(e),e}function Vt(e,t){switch(arguments.length){case 0:if(!(e=Cn.trackingDerivation))return Lt(x("m024"));break;case 2:e=Ot(e,t)}return e=Ot(e),pn(e)?Lt(e.whyRun()):Ln(e)?Lt(e.whyRun()):be(x("m025"))}function Ft(e,t){return Bt(Ot(e,t))}function Bt(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=Oe(e.observing).map(Bt)),t}function zt(e,t){return Ut(Ot(e,t))}function Ut(e){var t={name:e.name};return He(e)&&(t.observers=Ge(e).map(Ut)),t}Object.defineProperty(t,"__esModule",{value:!0});var $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])},Wt=function(){function e(e){void 0===e&&(e="Atom@"+me()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=t.IDerivationState.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){Qe(this)},e.prototype.reportChanged=function(){Ke(),qe(this),Xe()},e.prototype.toString=function(){return this.name},e}(),Ht=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+me()),void 0===n&&(n=Dn),void 0===r&&(r=Dn);var o=e.call(this,t)||this;return o.name=t,o.onBecomeObservedHandler=n,o.onBecomeUnobservedHandler=r,o.isPendingUnobservation=!1,o.isBeingTracked=!1,o}return n(t,e),t.prototype.reportObserved=function(){return Ke(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),Xe(),!!Cn.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(Wt),Gt=Me("Atom",Wt),Zt={spyReportEnd:!0},Yt="__$$iterating",Jt=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),Kt=0,Xt=function(){function e(){}return e}();Xt.prototype=[];var Qt=function(){function e(e,t,n,r){this.array=n,this.owned=r,this.lastKnownLength=0,this.interceptors=null,this.changeListeners=null,this.atom=new Wt(e||"ObservableArray@"+me()),this.enhancer=function(n,r){return t(n,r,e+"[..]")}}return e.prototype.intercept=function(e){return o(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}),a(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>Kt&&_(e+t+1)},e.prototype.spliceWithArray=function(e,t,n){var o=this;it(this.atom);var u=this.values.length;if(void 0===e?e=0:e>u?e=u:e<0&&(e=Math.max(0,u+e)),t=1===arguments.length?u-e:void 0===t||null===t?0:Math.max(0,Math.min(t,u-e)),void 0===n&&(n=[]),r(this)){var a=i(this,{object:this.array,type:"splice",index:e,removedCount:t,added:n});if(!a)return In;t=a.removedCount,n=a.added}n=n.map(function(e){return o.enhancer(e,void 0)});var s=n.length-t;this.updateArrayLength(u,s);var c=this.spliceItemsIntoValues(e,t,n);return 0===t&&0===n.length||this.notifyArraySplice(e,n,c),c},e.prototype.spliceItemsIntoValues=function(e,t,n){if(n.length<1e4)return(o=this.values).splice.apply(o,[e,t].concat(n));var r=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(n,this.values.slice(e+t)),r;var o},e.prototype.notifyArrayChildUpdate=function(e,t,n){var r=!this.owned&&l(),o=u(this),i=o||r?{object:this.array,type:"update",index:e,newValue:t,oldValue:n}:null;r&&f(i),this.atom.reportChanged(),o&&s(this,i),r&&d()},e.prototype.notifyArraySplice=function(e,t,n){var r=!this.owned&&l(),o=u(this),i=o||r?{object:this.array,type:"splice",index:e,removed:n,added:t,removedCount:n.length,addedCount:t.length}:null;r&&f(i),this.atom.reportChanged(),o&&s(this,i),r&&d()},e}(),qt=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableArray@"+me()),void 0===o&&(o=!1);var i=e.call(this)||this,u=new Qt(r,n,i,o);return Re(i,"$mobx",u),t&&t.length?(u.updateArrayLength(0,t.length),u.values=t.map(function(e){return n(e,void 0,r+"[..]")}),u.notifyArraySplice(0,u.values.slice(),In)):u.values=[],Jt&&Object.defineProperty(u.array,"0",en),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 w(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.values},t.prototype.find=function(e,t,n){void 0===n&&(n=0);var r=this.findIndex.apply(this,arguments);return-1===r?void 0:this.$mobx.values[r]},t.prototype.findIndex=function(e,t,n){void 0===n&&(n=0),this.$mobx.atom.reportObserved();for(var r=this.$mobx.values,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(){this.$mobx.atom.reportObserved();var e=this.slice();return e.reverse.apply(e,arguments)},t.prototype.sort=function(e){this.$mobx.atom.reportObserved();var t=this.slice();return t.sort.apply(t,arguments)},t.prototype.remove=function(e){var t=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?o.slice(0,e).concat(o.slice(e+1,t+1),[o[e]],o.slice(t+1)):o.slice(0,t).concat([o[e]],o.slice(t,e),o.slice(e+1)),this.replace(r)}},t.prototype.toString=function(){return this.$mobx.atom.reportObserved(),Array.prototype.toString.apply(this.$mobx.values,arguments)},t.prototype.toLocaleString=function(){return this.$mobx.atom.reportObserved(),Array.prototype.toLocaleString.apply(this.$mobx.values,arguments)},t.prototype.get=function(e){var t=this.$mobx;if(t){if(e<t.values.length)return t.atom.reportObserved(),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,o=n.values;if(e<o.length){it(n.atom);var u=o[e];if(r(n)){var a=i(n,{type:"update",object:this,index:e,newValue:t});if(!a)return;t=a.newValue}t=n.enhancer(t,u);t!==u&&(o[e]=t,n.notifyArrayChildUpdate(e,t,u))}else{if(e!==o.length)throw new Error("[mobx.array] Index out of bounds, "+e+" is larger than "+o.length);n.spliceWithArray(e,0,[t])}},t}(Xt);y(qt.prototype,function(){return g(this.slice())}),function(e,t){for(var n=0;n<t.length;n++)Ne(e,t[n],e[t[n]])}(qt.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"]),Object.defineProperty(qt.prototype,"length",{enumerable:!1,configurable:!0,get:function(){ return this.$mobx.getArrayLength()},set:function(e){this.$mobx.setArrayLength(e)}}),["every","filter","forEach","indexOf","join","lastIndexOf","map","reduce","reduceRight","slice","some"].forEach(function(e){var t=Array.prototype[e];_e("function"==typeof t,"Base function not defined on Array prototype: '"+e+"'"),Ne(qt.prototype,e,function(){return this.$mobx.atom.reportObserved(),t.apply(this.$mobx.values,arguments)})});var en=m(0);_(1e3);var tn=Me("ObservableArrayAdministration",Qt),nn={},rn=function(e){function t(t,n,r,o){void 0===r&&(r="ObservableValue@"+me()),void 0===o&&(o=!0);var i=e.call(this,r)||this;return i.enhancer=n,i.hasUnreportedChange=!1,i.value=n(t,void 0,r),o&&l()&&p({type:"create",object:i,newValue:i.value}),i}return n(t,e),t.prototype.set=function(e){var t=this.value;if((e=this.prepareNewValue(e))!==nn){var n=l();n&&f({type:"update",object:this,newValue:e,oldValue:t}),this.setNewValue(e),n&&d()}},t.prototype.prepareNewValue=function(e){if(it(this),r(this)){var t=i(this,{object:this,type:"update",newValue:e});if(!t)return nn;e=t.newValue}return e=this.enhancer(e,this.value,this.name),this.value!==e?e:nn},t.prototype.setNewValue=function(e){var t=this.value;this.value=e,this.reportChanged(),u(this)&&s(this,{type:"update",object:this,newValue:e,oldValue:t})},t.prototype.get=function(){return this.reportObserved(),this.value},t.prototype.intercept=function(e){return o(this,e)},t.prototype.observe=function(e,t){return t&&e({object:this,type:"update",newValue:this.value,oldValue:void 0}),a(this,e)},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.value+"]"},t.prototype.valueOf=function(){return ze(this.get())},t}(Wt);rn.prototype[Be()]=rn.prototype.valueOf;var on=Me("ObservableValue",rn),un={m001:"It is not allowed to assign new values to @action fields",m002:"`runInAction` expects a function",m003:"`runInAction` expects a function without arguments",m004:"autorun expects a function",m005:"Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m006:"Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.",m007:"reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object",m008:"wrapping reaction expression in `asReference` is no longer supported, use options object instead",m009:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.",m010:"@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'",m011:"First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments",m012:"computed takes one or two arguments if used as function",m013:"[mobx.expr] 'expr' should only be used inside other reactive functions.",m014:"extendObservable expected 2 or more arguments",m015:"extendObservable expects an object as first argument",m016:"extendObservable should not be used on maps, use map.merge instead",m017:"all arguments of extendObservable should be objects",m018:"extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540",m019:"[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.",m020:"modifiers can only be used for individual object properties",m021:"observable expects zero or one arguments",m022:"@observable can not be used on getters, use @computed instead",m023:"Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.",m024:"whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.",m025:"whyRun can only be used on reactions and computed values",m026:"`action` can only be invoked on functions",m028:"It is not allowed to set `useStrict` when a derivation is running",m029:"INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row",m030a:"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ",m030b:"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ",m031:"Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ",m032:"* This computation is suspended (not in use by any reaction) and won't run automatically.\n\tDidn't expect this computation to be suspended at this point?\n\t 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n\t 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).",m033:"`observe` doesn't support the fire immediately property for observable maps.",m034:"`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead",m035:"Cannot make the designated object observable; it is not extensible",m036:"It is not possible to get index atoms from arrays",m037:'Hi there! I\'m sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle "(...)" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error("Oops")` instead of `throw "Oops"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling "Pause on caught exception".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn\'t help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n',m038:"Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n"},an=C(function(e,t,n,r,o){var i=r&&1===r.length?r[0]:n.name||t||"<unnamed action>";Ne(e,t,cn(i,n))},function(e){return this[e]},function(){_e(!1,x("m001"))},!1,!0),sn=C(function(e,t,n){F(e,t,n)},function(e){return this[e]},function(){_e(!1,x("m001"))},!1,!1),cn=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?O(e.name||"<unnamed action>",e):2===arguments.length&&"function"==typeof t?O(e,t):1===arguments.length&&"string"==typeof e?M(e):M(t).apply(null,arguments)};cn.bound=function(e,t,n){if("function"==typeof e){var r=O("<not yet bound action>",e);return r.autoBind=!0,r}return sn.apply(null,arguments)};var ln=function(){function e(e,n,r,o,i){this.derivation=e,this.scope=n,this.compareStructural=r,this.dependenciesState=t.IDerivationState.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isPendingUnobservation=!1,this.observers=[],this.observersIndexes={},this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=t.IDerivationState.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+me(),this.value=void 0,this.isComputing=!1,this.isRunningSetter=!1,this.name=o||"ComputedValue@"+me(),i&&(this.setter=O(o+"-setter",i))}return e.prototype.onBecomeStale=function(){tt(this)},e.prototype.onBecomeUnobserved=function(){st(this),this.value=void 0},e.prototype.get=function(){_e(!this.isComputing,"Cycle detected in computation "+this.name,this.derivation),0===Cn.inBatch?(Ke(),rt(this)&&(this.value=this.computeValue(!1)),Xe()):(Qe(this),rt(this)&&this.trackAndCompute()&&et(this));var e=this.value;if(nt(e))throw e.cause;return e},e.prototype.peek=function(){var e=this.computeValue(!1);if(nt(e))throw e.cause;return e},e.prototype.set=function(e){if(this.setter){_e(!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 _e(!1,"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},e.prototype.trackAndCompute=function(){l()&&p({object:this.scope,type:"compute",fn:this.derivation});var e=this.value,t=this.value=this.computeValue(!0);return nt(t)||De(this.compareStructural,t,e)},e.prototype.computeValue=function(e){this.isComputing=!0,Cn.computationDepth++;var t;if(e)t=ut(this,this.derivation,this.scope);else try{t=this.derivation.call(this.scope)}catch(e){t=new kn(e)}return Cn.computationDepth--,this.isComputing=!1,t},e.prototype.observe=function(e,t){var n=this,r=!0,o=void 0;return B(function(){var i=n.get();if(!r||t){var u=lt();e({type:"update",object:n,newValue:i,oldValue:o}),pt(u)}r=!1,o=i})},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},e.prototype.valueOf=function(){return ze(this.get())},e.prototype.whyRun=function(){var e=Boolean(Cn.trackingDerivation),n=Oe(this.isComputing?this.newObserving:this.observing).map(function(e){return e.name}),r=Oe(Ge(this).map(function(e){return e.name}));return"\nWhyRun? computation '"+this.name+"':\n * Running because: "+(e?"[active] the value of this computation is needed by a reaction":this.isComputing?"[get] The value of this computed was requested outside a reaction":"[idle] not running at the moment")+"\n"+(this.dependenciesState===t.IDerivationState.NOT_TRACKING?x("m032"):" * This computation will re-run if any of the following observables changes:\n "+Ee(n)+"\n "+(this.isComputing&&e?" (... or any observable accessed during the remainder of the current run)":"")+"\n\t"+x("m038")+"\n\n * If the outcome of this computation changes, the following observers will be re-run:\n "+Ee(r)+"\n")},e}();ln.prototype[Be()]=ln.prototype.valueOf;var pn=Me("ComputedValue",ln),fn=function(){function e(e,t){this.target=e,this.name=t,this.values={},this.changeListeners=null,this.interceptors=null}return e.prototype.observe=function(e,t){return _e(!0!==t,"`observe` doesn't support the fire immediately property for observable objects."),a(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}(),dn={},hn={},vn=Me("ObservableObjectAdministration",fn),gn=te(ce),yn=te(le),mn=te(pe),bn=te(fe),_n=te(de),wn=function(){function e(){}return e.prototype.box=function(e,t){return arguments.length>2&&ue("box"),new rn(e,ce,t)},e.prototype.shallowBox=function(e,t){return arguments.length>2&&ue("shallowBox"),new rn(e,pe,t)},e.prototype.array=function(e,t){return arguments.length>2&&ue("array"),new qt(e,ce,t)},e.prototype.shallowArray=function(e,t){return arguments.length>2&&ue("shallowArray"),new qt(e,pe,t)},e.prototype.map=function(e,t){return arguments.length>2&&ue("map"),new En(e,ce,t)},e.prototype.shallowMap=function(e,t){return arguments.length>2&&ue("shallowMap"),new En(e,pe,t)},e.prototype.object=function(e,t){arguments.length>2&&ue("object");var n={};return W(n,t),ne(n,e),n},e.prototype.shallowObject=function(e,t){arguments.length>2&&ue("shallowObject");var n={};return W(n,t),re(n,e),n},e.prototype.ref=function(){return arguments.length<2?se(pe,arguments[0]):mn.apply(null,arguments)},e.prototype.shallow=function(){return arguments.length<2?se(le,arguments[0]):yn.apply(null,arguments)},e.prototype.deep=function(){return arguments.length<2?se(ce,arguments[0]):gn.apply(null,arguments)},e.prototype.struct=function(){return arguments.length<2?se(fe,arguments[0]):bn.apply(null,arguments)},e}(),xn=ie;Object.keys(wn.prototype).forEach(function(e){return xn[e]=wn.prototype[e]}),xn.deep.struct=xn.struct,xn.ref.struct=function(){return arguments.length<2?se(de,arguments[0]):_n.apply(null,arguments)};var On={},En=function(){function e(e,t,n){void 0===t&&(t=ce),void 0===n&&(n="ObservableMap@"+me()),this.enhancer=t,this.name=n,this.$mobx=On,this._data=Object.create(null),this._hasMap=Object.create(null),this._keys=new qt(void 0,pe,this.name+".keys()",!0),this.interceptors=null,this.changeListeners=null,this.merge(e)}return e.prototype._has=function(e){return void 0!==this._data[e]},e.prototype.has=function(e){return!!this.isValidKey(e)&&(e=""+e,this._hasMap[e]?this._hasMap[e].get():this._updateHasMapEntry(e,!1).get())},e.prototype.set=function(e,t){this.assertValidKey(e),e=""+e;var n=this._has(e);if(r(this)){var o=i(this,{type:n?"update":"add",object:this,newValue:t,name:e});if(!o)return this;t=o.newValue}return n?this._updateValue(e,t):this._addValue(e,t),this},e.prototype.delete=function(e){var t=this;if(this.assertValidKey(e),e=""+e,r(this)){var n=i(this,{type:"delete",object:this,name:e});if(!n)return!1}if(this._has(e)){var o=l(),a=u(this),n=a||o?{type:"delete",object:this,oldValue:this._data[e].value,name:e}:null;return o&&f(n),ve(function(){t._keys.remove(e),t._updateHasMapEntry(e,!1),t._data[e].setNewValue(void 0),t._data[e]=void 0}),a&&s(this,n),o&&d(),!0}return!1},e.prototype._updateHasMapEntry=function(e,t){var n=this._hasMap[e];return n?n.setNewValue(t):n=this._hasMap[e]=new rn(t,pe,this.name+"."+e+"?",!1),n},e.prototype._updateValue=function(e,t){var n=this._data[e];if((t=n.prepareNewValue(t))!==nn){var r=l(),o=u(this),i=o||r?{type:"update",object:this,oldValue:n.value,name:e,newValue:t}:null;r&&f(i),n.setNewValue(t),o&&s(this,i),r&&d()}},e.prototype._addValue=function(e,t){var n=this;ve(function(){var r=n._data[e]=new rn(t,n.enhancer,n.name+"."+e,!1);t=r.value,n._updateHasMapEntry(e,!0),n._keys.push(e)});var r=l(),o=u(this),i=o||r?{type:"add",object:this,name:e,newValue:t}:null;r&&f(i),o&&s(this,i),r&&d()},e.prototype.get=function(e){if(e=""+e,this.has(e))return this._data[e].get()},e.prototype.keys=function(){return g(this._keys.slice())},e.prototype.values=function(){return g(this._keys.map(this.get,this))},e.prototype.entries=function(){var e=this;return g(this._keys.map(function(t){return[t,e.get(t)]}))},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 An(e)&&(e=e.toJS()),ve(function(){Ie(e)?Object.keys(e).forEach(function(n){return t.set(n,e[n])}):Array.isArray(e)?e.forEach(function(e){var n=e[0],r=e[1];return t.set(n,r)}):Fe(e)?e.forEach(function(e,n){return t.set(n,e)}):null!==e&&void 0!==e&&be("Cannot initialize map from "+e)}),this},e.prototype.clear=function(){var e=this;ve(function(){ct(function(){e.keys().forEach(e.delete,e)})})},e.prototype.replace=function(e){var t=this;return ve(function(){t.clear(),t.merge(e)}),this},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.toJS=function(){var e=this,t={};return this.keys().forEach(function(n){return t[n]=e.get(n)}),t},e.prototype.toJSON=function(){return this.toJS()},e.prototype.isValidKey=function(e){return null!==e&&void 0!==e&&("string"==typeof e||"number"==typeof e||"boolean"==typeof e)},e.prototype.assertValidKey=function(e){if(!this.isValidKey(e))throw new Error("[mobx.map] Invalid key: '"+e+"', only strings, numbers and booleans are accepted as key in observable maps.")},e.prototype.toString=function(){var e=this;return this.name+"[{ "+this.keys().map(function(t){return t+": "+e.get(t)}).join(", ")+" }]"},e.prototype.observe=function(e,t){return _e(!0!==t,x("m033")),a(this,e)},e.prototype.intercept=function(e){return o(this,e)},e}();y(En.prototype,function(){return this.entries()});var An=Me("ObservableMap",En),In=[];Object.freeze(In);var jn=[],Dn=function(){},Sn=Object.prototype.hasOwnProperty,Nn=["mobxGuid","resetId","spyListeners","strictMode","runId"],Rn=function(){function e(){this.version=5,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.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]}return e}(),Cn=new Rn;!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"}(t.IDerivationState||(t.IDerivationState={}));var kn=function(){function e(e){this.cause=e}return e}(),Tn=function(){function e(e,n){void 0===e&&(e="Reaction@"+me()),this.name=e,this.onInvalidate=n,this.observing=[],this.newObserving=[],this.dependenciesState=t.IDerivationState.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+me(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1}return e.prototype.onBecomeStale=function(){this.schedule()},e.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Cn.pendingReactions.push(this),vt())},e.pr