"use strict";function registerGlobalStoreController(r){if(!(r instanceof StoreController))throw new Error("Invalid global store controller");globalStoreController=r,r.onConnected()}function getGlobalData(){if(!globalStoreController)throw new Error("No global store controller set");return globalStoreController.render()}function aggregate(){if(!currentViewController)throw new Error('"aggregate" called before first route');currentViewController.render(currentStoreController.render())}function dispatch(r){var e=!1;globalStoreController&&(globalStoreController[$traceurRuntime.toProperty(internalDispatch)](r),e=!0),currentLinkController&&(currentLinkController[$traceurRuntime.toProperty(internalDispatch)](r),e=!0),currentStoreController&&(currentStoreController[$traceurRuntime.toProperty(internalDispatch)](r),e=!0),e||console.warn("Dispatch called with nothing to dispatch to")}function registerRoute(r,e){if(!(e.storeController instanceof StoreController))throw new Error("Invalid store controller");if(!(e.viewController instanceof ViewController))throw new Error("Invalid view controller");if(e.linkController&&!(e.linkController instanceof LinkController))throw new Error("Invalid link controller");$traceurRuntime.setProperty(routes,r,e)}function route(r,e){var t=routes[$traceurRuntime.toProperty(r)];if(!t)throw new Error('Unknown route "'+route+'"');e=e||{},currentStoreController&¤tStoreController[$traceurRuntime.toProperty(internalOnDisconnected)](),currentLinkController&¤tLinkController[$traceurRuntime.toProperty(internalOnDisconnected)](),currentStoreController=t.storeController,currentLinkController=t.linkController,currentViewController=t.viewController,currentStoreController[$traceurRuntime.toProperty(internalOnConnected)](e),currentLinkController&¤tLinkController[$traceurRuntime.toProperty(internalOnConnected)]()}var $__1;Object.defineProperties(exports,{StoreController:{get:function(){return StoreController}},Store:{get:function(){return Store}},LinkController:{get:function(){return LinkController}},Link:{get:function(){return Link}},ViewController:{get:function(){return ViewController}},registerGlobalStoreController:{get:function(){return registerGlobalStoreController}},getGlobalData:{get:function(){return getGlobalData}},aggregate:{get:function(){return aggregate}},dispatch:{get:function(){return dispatch}},registerRoute:{get:function(){return registerRoute}},route:{get:function(){return route}},__esModule:{value:!0}});var children=Symbol(),internalDispatch=Symbol(),internalOnConnected=Symbol(),internalOnDisconnected=Symbol(),Dispatchable=function(){};$traceurRuntime.createClass(Dispatchable,($__1={},Object.defineProperty($__1,internalDispatch,{value:function(r){if(this.dispatch(r),this[$traceurRuntime.toProperty(children)])for(var e,t=this[$traceurRuntime.toProperty(children)][$traceurRuntime.toProperty(Symbol.iterator)]();!(e=t.next()).done;)try{throw void 0}catch(n){n=e.value,n[$traceurRuntime.toProperty(internalDispatch)](r)}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,internalOnConnected,{value:function(r){if(this.onConnected(r),this[$traceurRuntime.toProperty(children)])for(var e,t=this[$traceurRuntime.toProperty(children)][$traceurRuntime.toProperty(Symbol.iterator)]();!(e=t.next()).done;)try{throw void 0}catch(n){n=e.value,n[$traceurRuntime.toProperty(internalOnConnected)](r)}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,internalOnDisconnected,{value:function(r){if(this.onDisconnected(r),this[$traceurRuntime.toProperty(children)])for(var e,t=this[$traceurRuntime.toProperty(children)][$traceurRuntime.toProperty(Symbol.iterator)]();!(e=t.next()).done;)try{throw void 0}catch(n){n=e.value,n[$traceurRuntime.toProperty(internalOnDisconnected)](r)}},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,"register",{value:function(r){this[$traceurRuntime.toProperty(children)]||$traceurRuntime.setProperty(this,children,[]),this[$traceurRuntime.toProperty(children)].push(r)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,"dispatch",{value:function(){},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,"onConnected",{value:function(){},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty($__1,"onDisconnected",{value:function(){},configurable:!0,enumerable:!0,writable:!0}),$__1),{});var StoreController=function(){$traceurRuntime.defaultSuperCall(this,$StoreController.prototype,arguments)},$StoreController=StoreController;$traceurRuntime.createClass(StoreController,{render:function(){throw new Error('"render" must be implemented by a derived store controller')},register:function(r){if(!(r instanceof Store))throw new Error("Invalid child");$traceurRuntime.superCall(this,$StoreController.prototype,"register",[r])}},{},Dispatchable);var Store=function(){$traceurRuntime.defaultSuperCall(this,$Store.prototype,arguments)},$Store=Store;$traceurRuntime.createClass(Store,{render:function(){throw new Error('"render" must be implemented by a derived store')},register:function(r){if(!(r instanceof $Store))throw new Error("Invalid child");$traceurRuntime.superCall(this,$Store.prototype,"register",[r])}},{},Dispatchable);var LinkController=function(){$traceurRuntime.defaultSuperCall(this,$LinkController.prototype,arguments)},$LinkController=LinkController;$traceurRuntime.createClass(LinkController,{register:function(r){if(!(r instanceof Link))throw new Error("Invalid child");$traceurRuntime.superCall(this,$LinkController.prototype,"register",[r])}},{},Dispatchable);var Link=function(){$traceurRuntime.defaultSuperCall(this,$Link.prototype,arguments)},$Link=Link;$traceurRuntime.createClass(Link,{register:function(r){if(!(r instanceof $Link))throw new Error("Invalid child");$traceurRuntime.superCall(this,$Link.prototype,"register",[r])}},{},Dispatchable);var ViewController=function(){};$traceurRuntime.createClass(ViewController,{render:function(){throw new Error('"render" must be implemented by a derived view controller')}},{});var currentStoreController=null,currentViewController=null,currentLinkController=null,globalStoreController=null,routes={}; //# sourceMappingURL=maps/flvx.commonjs.min.js.map