UNPKG

alt

Version:
1 lines 24.3 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Alt=e():t.Alt=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){t.exports=n(6)},function(t,e){"use strict";function n(t){var e=t.constructor;return!!t&&"[object Object]"===Object.prototype.toString.call(t)&&o(e)&&!Object.isFrozen(t)&&(e instanceof e||"AltStore"===t.type)}function r(t,e){e.forEach(function(e){Object.keys(Object(e)).forEach(function(n){t(n,e[n])})})}function i(t){for(var e=arguments.length,n=Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return r(function(e,n){return t[e]=n},n),t}Object.defineProperty(e,"__esModule",{value:!0}),e.isMutableObject=n,e.eachObject=r,e.assign=i;var o=e.isFunction=function(t){return"function"==typeof t}},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e){var n=e?g:v,r=e?t.prototype:t;return Object.getOwnPropertyNames(r).reduce(function(t,e){return n.indexOf(e)!==-1?t:(t[e]=r[e],t)},{})}function o(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return t===Function.prototype?e:o(Object.getPrototypeOf(t),y.assign(i(t,!0),e))}function a(t){"undefined"!=typeof console&&console.warn(new ReferenceError(t))}function s(t,e){for(var n=0,r=e;Object.hasOwnProperty.call(t,r);)r=e+String(++n);return r}function c(t){return t.replace(/[a-z]([A-Z])/g,function(t){return String(t[0])+"_"+String(t[1].toLowerCase())}).toUpperCase()}function u(t){if(void 0===t)return null;for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.length?[t].concat(n):t}function f(t,e,n,r){return{type:e,payload:n,meta:h({dispatchId:t},r),id:t,action:e,data:n,details:r}}function l(t,e,n,r){var i=e.dispatch(n);if(void 0===i)return null;var o=e.id,a=o,s=o,c={id:o,namespace:a,name:s},u=function(t){return r.dispatch(o,t,c)};return y.isFunction(i)?i(u,r):r.dispatcher.dispatch(f(t,o,i,c))}function p(){}Object.defineProperty(e,"__esModule",{value:!0});var h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};e.getInternalMethods=i,e.getPrototypeChain=o,e.warn=a,e.uid=s,e.formatAsConstant=c,e.dispatchIdentity=u,e.fsa=f,e.dispatch=l;var d=n(1),y=r(d),v=Object.getOwnPropertyNames(p),g=Object.getOwnPropertyNames(p.prototype)},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(e){try{return l.call(null,t)}catch(e){return l.call(this,t)}}}function a(){y&&h&&(y=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!y){var t=i(a);y=!0;for(var e=d.length;e;){for(h=d,d=[];++v<e;)h&&h[v].run();v=-1,e=d.length}h=null,y=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var f,l,p=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(t){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var h,d=[],y=!1,v=-1;p.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||y||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=u,p.addListener=u,p.once=u,p.off=u,p.removeListener=u,p.removeAllListeners=u,p.emit=u,p.binding=function(t){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(t){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(t,e){"use strict";function n(){var t=[],e=!1,n={},r=function(r){var i=t.indexOf(r);if(!(i<0))return e?void(n[i]=r):void t.splice(i,1)},i=function(e){var n=(t.push(e),function(){return r(e)});return{dispose:n}},o=function(){for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];e=!0;try{t.forEach(function(t,e){return n[e]||t.apply(void 0,o)})}finally{e=!1,Object.keys(n).forEach(function(t){return r(n[t])}),n={}}};return{publish:o,subscribe:i,$subscriptions:t}}t.exports=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e,n,r,i){var o=u.uid(t._actionsRegistry,String(e)+"."+String(n));t._actionsRegistry[o]=1;var a={id:o,namespace:e,name:n},c=function(e){return t.dispatch(o,e,a)},f=function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];var a=r.apply(i,n),f=a;return void 0===a||(0,l["default"])(a)||(s.isFunction(a)?f=a(c,t):c(a)),void 0===a&&u.warn("An action was called but nothing was dispatched"),f};f.defer=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return setTimeout(function(){return f.apply(null,e)})},f.id=o,f.data=a;var p=t.actions[e],h=u.uid(p,n);p[h]=f;var d=u.formatAsConstant(h);return p[d]=o,f}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var a=n(1),s=i(a),c=n(2),u=i(c),f=n(14),l=r(f);t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var c=n(12),u=n(10),f=i(u),l=n(1),p=i(l),h=n(9),d=i(h),y=n(2),v=i(y),g=n(5),b=r(g),w=function(){function t(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];s(this,t),this.config=e,this.serialize=e.serialize||JSON.stringify,this.deserialize=e.deserialize||JSON.parse,this.dispatcher=e.dispatcher||new c.Dispatcher,this.batchingFunction=e.batchingFunction||function(t){return t()},this.actions={global:{}},this.stores={},this.storeTransforms=e.storeTransforms||[],this.trapAsync=!1,this._actionsRegistry={},this._initSnapshot={},this._lastSnapshot={}}return t.prototype.dispatch=function(){function t(t,e,n){var r=this;this.batchingFunction(function(){var i=Math.random().toString(18).substr(2,16);if(t.hasOwnProperty("type")&&t.hasOwnProperty("payload")){var o={id:t.type,namespace:t.type,name:t.type};return r.dispatcher.dispatch(v.fsa(i,t.type,t.payload,o))}return t.id&&t.dispatch?v.dispatch(i,t,e,r):r.dispatcher.dispatch(v.fsa(i,t,e,n))})}return t}(),t.prototype.createUnsavedStore=function(){function t(t){var e=t.displayName||"";d.createStoreConfig(this.config,t);for(var n=d.transformStore(this.storeTransforms,t),r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return p.isFunction(n)?d.createStoreFromClass.apply(d,[this,n,e].concat(i)):d.createStoreFromObject(this,n,e)}return t}(),t.prototype.createStore=function(){function t(t,e){var n=e||t.displayName||t.name||"";d.createStoreConfig(this.config,t);var r=d.transformStore(this.storeTransforms,t);!this.stores[n]&&n||(this.stores[n]?v.warn("A store named "+String(n)+" already exists, double check your store names or pass in your own custom identifier for each store"):v.warn("Store name was not specified"),n=v.uid(this.stores,n));for(var i=arguments.length,o=Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];var s=p.isFunction(r)?d.createStoreFromClass.apply(d,[this,r,n].concat(o)):d.createStoreFromObject(this,r,n);return this.stores[n]=s,f.saveInitialSnapshot(this,n),s}return t}(),t.prototype.generateActions=function(){function t(){for(var t={name:"global"},e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.createActions(n.reduce(function(t,e){return t[e]=v.dispatchIdentity,t},t))}return t}(),t.prototype.createAction=function(){function t(t,e,n){return(0,b["default"])(this,"global",t,e,n)}return t}(),t.prototype.createActions=function(){function t(t){var e=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r={},i=v.uid(this._actionsRegistry,t.displayName||t.name||"Unknown");if(p.isFunction(t)){p.assign(r,v.getPrototypeChain(t));for(var c=function(t){function e(){s(this,e);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return o(this,t.call.apply(t,[this].concat(r)))}return a(e,t),e.prototype.generateActions=function(){function t(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(function(t){r[t]=v.dispatchIdentity})}return t}(),e}(t),u=arguments.length,f=Array(u>2?u-2:0),l=2;l<u;l++)f[l-2]=arguments[l];p.assign(r,new(Function.prototype.bind.apply(c,[null].concat(f))))}else p.assign(r,t);return this.actions[i]=this.actions[i]||{},p.eachObject(function(t,r){if(!p.isFunction(r))return void(n[t]=r);n[t]=(0,b["default"])(e,i,t,r,n);var o=v.formatAsConstant(t);n[o]=n[t].id},[r]),n}return t}(),t.prototype.takeSnapshot=function(){function t(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=f.snapshot(this,e);return p.assign(this._lastSnapshot,r),this.serialize(r)}return t}(),t.prototype.rollback=function(){function t(){f.setAppState(this,this.serialize(this._lastSnapshot),function(t){t.lifecycle("rollback"),t.emitChange()})}return t}(),t.prototype.recycle=function(){function t(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e.length?f.filterSnapshots(this,this._initSnapshot,e):this._initSnapshot;f.setAppState(this,this.serialize(r),function(t){t.lifecycle("init"),t.emitChange()})}return t}(),t.prototype.flush=function(){function t(){var t=this.serialize(f.snapshot(this));return this.recycle(),t}return t}(),t.prototype.bootstrap=function(){function t(t){f.setAppState(this,t,function(t,e){t.lifecycle("bootstrap",e),t.emitChange()})}return t}(),t.prototype.prepare=function(){function t(t,e){var n={};if(!t.displayName)throw new ReferenceError("Store provided does not have a name");return n[t.displayName]=e,this.serialize(n)}return t}(),t.prototype.addActions=function(){function t(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];this.actions[t]=Array.isArray(e)?this.generateActions.apply(this,e):this.createActions.apply(this,[e].concat(r))}return t}(),t.prototype.addStore=function(){function t(t,e){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];this.createStore.apply(this,[e,t].concat(r))}return t}(),t.prototype.getActions=function(){function t(t){return this.actions[t]}return t}(),t.prototype.getStore=function(){function t(t){return this.stores[t]}return t}(),t.debug=function(){function t(t,e,n){var r="alt.js.org",i=n;return i||"undefined"==typeof window||(i=window),"undefined"!=typeof i&&(i[r]=i[r]||[],i[r].push({name:t,alt:e})),e}return t}(),t}();e["default"]=w,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),s=i(a),c=n(4),u=r(c),f=function(){function t(e,n,r,i){var a=this;o(this,t);var c=n.lifecycleEvents;this.transmitter=(0,u["default"])(),this.lifecycle=function(t,e){c[t]&&c[t].publish(e)},this.state=r,this.alt=e,this.preventDefault=!1,this.displayName=n.displayName,this.boundListeners=n.boundListeners,this.StoreModel=i,this.reduce=n.reduce||function(t){return t},this.subscriptions=[];var f=n.output||function(t){return t};this.emitChange=function(){return a.transmitter.publish(f(a.state))};var l=function(t,e){try{return t()}catch(r){if(n.handlesOwnErrors)return a.lifecycle("error",{error:r,payload:e,state:a.state}),!1;throw r}};s.assign(this,n.publicMethods),this.dispatchToken=e.dispatcher.register(function(t){a.preventDefault=!1,a.lifecycle("beforeEach",{payload:t,state:a.state});var e=n.actionListeners[t.action];if(e||n.otherwise){var r=void 0;r=e?l(function(){return e.filter(Boolean).every(function(e){return e.call(n,t.data,t.action)!==!1})},t):l(function(){return n.otherwise(t.data,t.action)},t),r===!1||a.preventDefault||a.emitChange()}n.reduce&&(l(function(){var e=n.reduce(a.state,t);void 0!==e&&(a.state=e)},t),a.preventDefault||a.emitChange()),a.lifecycle("afterEach",{payload:t,state:a.state})}),this.lifecycle("init")}return t.prototype.listen=function(){function t(t){var e=this;if(!s.isFunction(t))throw new TypeError("listen expects a function");var n=this.transmitter.subscribe(t),r=n.dispose;return this.subscriptions.push({cb:t,dispose:r}),function(){e.lifecycle("unlisten"),r()}}return t}(),t.prototype.unlisten=function(){function t(t){this.lifecycle("unlisten"),this.subscriptions.filter(function(e){return e.cb===t}).forEach(function(t){return t.dispose()})}return t}(),t.prototype.getState=function(){function t(){return this.StoreModel.config.getState.call(this,this.state)}return t}(),t}();e["default"]=f,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),a=i(o),s=n(1),c=r(s),u={waitFor:function(){function t(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];if(!e.length)throw new ReferenceError("Dispatch tokens not provided");var r=e;1===e.length&&(r=Array.isArray(e[0])?e[0]:e);var i=r.map(function(t){return t.dispatchToken||t});this.dispatcher.waitFor(i)}return t}(),exportAsync:function(){function t(t){this.registerAsync(t)}return t}(),registerAsync:function(){function t(t){var e=this,n=0,r=c.isFunction(t)?t(this.alt):t,i=Object.keys(r).reduce(function(t,i){var o=r[i],a=c.isFunction(o)?o(e):o,s=["success","error","loading"];return s.forEach(function(t){if(a[t]&&!a[t].id)throw new Error(String(t)+" handler must be an action function")}),t[i]=function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var o=e.getInstance().getState(),s=a.local&&a.local.apply(a,[o].concat(r)),c=a.shouldFetch?a.shouldFetch.apply(a,[o].concat(r)):null==s,u=a.interceptResponse||function(t){return t},f=function(){function t(t,i){return function(o){var a=function(){function e(){if(n-=1,t(u(o,t,r)),i)throw o;return o}return e}();return e.alt.trapAsync?function(){return a()}:a()}}return t}();return c?(n+=1,a.loading&&a.loading(u(null,a.loading,r)),a.remote.apply(a,[o].concat(r)).then(f(a.success),f(a.error,1))):(e.emitChange(),s)},t},{});this.exportPublicMethods(i),this.exportPublicMethods({isLoading:function(){function t(){return n>0}return t}()})}return t}(),exportPublicMethods:function(){function t(t){var e=this;c.eachObject(function(t,n){if(!c.isFunction(n))throw new TypeError("exportPublicMethods expects a function");e.publicMethods[t]=n},[t])}return t}(),emitChange:function(){function t(){this.getInstance().emitChange()}return t}(),on:function(){function t(t,e){"error"===t&&(this.handlesOwnErrors=!0);var n=this.lifecycleEvents[t]||(0,a["default"])();return this.lifecycleEvents[t]=n,n.subscribe(e.bind(this))}return t}(),bindAction:function(){function t(t,e){if(!t)throw new ReferenceError("Invalid action reference passed in");if(!c.isFunction(e))throw new TypeError("bindAction expects a function");var n=t.id?t.id:t;this.actionListeners[n]=this.actionListeners[n]||[],this.actionListeners[n].push(e.bind(this)),this.boundListeners.push(n)}return t}(),bindActions:function(){function t(t){var e=this;c.eachObject(function(t,n){var r=/./,i=t.replace(r,function(t){return"on"+String(t[0].toUpperCase())});if(e[t]&&e[i])throw new ReferenceError("You have multiple action handlers bound to an action: "+(String(t)+" and "+String(i)));var o=e[t]||e[i];o&&e.bindAction(n,o)},[t])}return t}(),bindListeners:function(){function t(t){var e=this;c.eachObject(function(t,n){var r=e[t];if(!r)throw new ReferenceError(String(t)+" defined but does not exist in "+String(e.displayName));Array.isArray(n)?n.forEach(function(t){e.bindAction(t,r)}):e.bindAction(n,r)},[t])}return t}()};e["default"]=u,t.exports=e["default"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(t,e,n){if(n){var r=e.StoreModel.config,i=g.isFunction(n)?n(e.state):n;e.state=r.setState.call(t,e.state,i),t.alt.dispatcher.isDispatching()||t.emitChange()}}function u(t,e,n,r){return g.assign(t,m["default"],{displayName:n,alt:e,dispatcher:e.dispatcher,preventDefault:function(){function t(){this.getInstance().preventDefault=!0}return t}(),boundListeners:[],lifecycleEvents:{},actionListeners:{},publicMethods:{},handlesOwnErrors:!1},r)}function f(t,e){e.config=g.assign({getState:function(){function t(t){return Array.isArray(t)?t.slice():g.isMutableObject(t)?g.assign({},t):t}return t}(),setState:function(){function t(t,e){return g.isMutableObject(e)?g.assign(t,e):e}return t}()},t,e.config)}function l(t,e){return t.reduce(function(t,e){return e(t)},e)}function p(t,e,n){var r=void 0,i=u({},t,n,g.assign({getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){c(this,r,t)}return t}()},e));return i.bindListeners&&m["default"].bindListeners.call(i,i.bindListeners),i.observe&&m["default"].bindListeners.call(i,i.observe(t)),i.lifecycle&&g.eachObject(function(t,e){m["default"].on.call(i,t,e)},[i.lifecycle]),r=g.assign(new w["default"](t,i,void 0!==i.state?i.state:{},e),i.publicMethods,{displayName:n,config:e.config})}function h(t,e,n){var r=void 0,i=e.config,f=function(t){function e(){o(this,e);for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return a(this,t.call.apply(t,[this].concat(r)))}return s(e,t),e}(e);u(f.prototype,t,n,{type:"AltStore",getInstance:function(){function t(){return r}return t}(),setState:function(){function t(t){c(this,r,t)}return t}()});for(var l=arguments.length,p=Array(l>3?l-3:0),h=3;h<l;h++)p[h-3]=arguments[h];var d=new(Function.prototype.bind.apply(f,[null].concat(p)));return i.bindListeners&&d.bindListeners(i.bindListeners),i.datasource&&d.registerAsync(i.datasource),r=g.assign(new w["default"](t,d,void 0!==d.state?d.state:d,e),y.getInternalMethods(e),i.publicMethods,{displayName:n})}Object.defineProperty(e,"__esModule",{value:!0}),e.createStoreConfig=f,e.transformStore=l,e.createStoreFromObject=p,e.createStoreFromClass=h;var d=n(2),y=i(d),v=n(1),g=i(v),b=n(7),w=r(b),_=n(8),m=r(_)},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t,e,n){var r=t.deserialize(e);u.eachObject(function(e,i){var o=t.stores[e];o&&!function(){var t=o.StoreModel.config,a=o.state;t.onDeserialize&&(r[e]=t.onDeserialize(i)||i),u.isMutableObject(a)?(u.eachObject(function(t){return delete a[t]},[a]),u.assign(a,r[e])):o.state=r[e],n(o,o.state)}()},[r])}function o(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],n=e.length?e:Object.keys(t.stores);return n.reduce(function(e,n){var r=n.displayName||n,i=t.stores[r],o=i.StoreModel.config;i.lifecycle("snapshot");var a=o.onSerialize&&o.onSerialize(i.state);return e[r]=a?a:i.getState(),e},{})}function a(t,e){var n=t.deserialize(t.serialize(t.stores[e].state));t._initSnapshot[e]=n,t._lastSnapshot[e]=n}function s(t,e,n){return n.reduce(function(t,n){var r=n.displayName||n;if(!e[r])throw new ReferenceError(String(r)+" is not a valid store");return t[r]=e[r],t},{})}Object.defineProperty(e,"__esModule",{value:!0}),e.setAppState=i,e.snapshot=o,e.saveInitialSnapshot=a,e.filterSnapshots=s;var c=n(1),u=r(c)},function(t,e,n){(function(e){"use strict";var n=function(t,n,r,i,o,a,s,c){if("production"!==e.env.NODE_ENV&&void 0===n)throw new Error("invariant requires an error message argument");if(!t){var u;if(void 0===n)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[r,i,o,a,s,c],l=0;u=new Error("Invariant Violation: "+n.replace(/%s/g,function(){return f[l++]}))}throw u.framesToPop=1,u}};t.exports=n}).call(e,n(3))},function(t,e,n){t.exports.Dispatcher=n(13)},function(t,e,n){(function(r){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}e.__esModule=!0;var o=n(11),a="ID_",s=function(){function t(){i(this,t),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}return t.prototype.register=function(t){var e=a+this._lastID++;return this._callbacks[e]=t,e},t.prototype.unregister=function(t){this._callbacks[t]?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.unregister(...): `%s` does not map to a registered callback.",t):o(!1),delete this._callbacks[t]},t.prototype.waitFor=function(t){this._isDispatching?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.waitFor(...): Must be invoked while dispatching."):o(!1);for(var e=0;e<t.length;e++){var n=t[e];this._isPending[n]?this._isHandled[n]?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.waitFor(...): Circular dependency detected while waiting for `%s`.",n):o(!1):(this._callbacks[n]?void 0:"production"!==r.env.NODE_ENV?o(!1,"Dispatcher.waitFor(...): `%s` does not map to a registered callback.",n):o(!1),this._invokeCallback(n))}},t.prototype.dispatch=function(t){this._isDispatching?"production"!==r.env.NODE_ENV?o(!1,"Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch."):o(!1):void 0,this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},t.prototype.isDispatching=function(){return this._isDispatching},t.prototype._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},t.prototype._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},t.prototype._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},t}();t.exports=s}).call(e,n(3))},function(t,e){function n(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then}t.exports=n}])});