This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
marbles.min.js
2 lines (2 loc) · 41.4 KB
/
marbles.min.js
1
2
!function(t){"use strict";t["marbles/version"]={};var e="0.0.5";t["marbles/version"].VERSION=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/utils"]={};var e=function(t,e,i){for(var r=i.override,s=0,n=e.length;n>s;s++){var a=e[s];for(var o in a)if(a.hasOwnProperty(o)){if(r===!1)continue;t[o]=a[o]}}return t},i={extend:function(t){var i=Array.prototype.slice.call(arguments,1);return e(t,i,{override:!0})},lazyExtend:function(t){var i=Array.prototype.slice.call(arguments,1);return e(t,i,{override:!1})},assertEqual:function(t,e){if(typeof t!=typeof e)return!1;if("object"!=typeof t)return t===e;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var i=0,r=t.length;r>i;i++)if(!this.assertEqual(t[i],e[i]))return!1;return!0}for(var s in t)if(t.hasOwnProperty(s)&&t[s]!==e[s])return!1;for(s in e)if(e.hasOwnProperty(s)&&e[s]!==t[s])return!1;return!0},inheritPrototype:function(t,e){function r(){this.constructor=t}return i.extend(t,e),r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},createClass:function(t){var e,r,s,n,a,o,l=t.willInitialize,h=t.didInitialize;o={didExtendCtor:[],didExtendProto:[],willInitialize:[],didInitialize:[]},t.hasOwnProperty("willInitialize")&&delete t.willInitialize,t.hasOwnProperty("didInitialize")&&delete t.didInitialize;var u=l;l=function(){var t=arguments;return o.willInitialize.forEach(function(e){e.apply(this,t)}.bind(this)),u?u.apply(this,t):void 0};var c=h;if(h=function(){var t=arguments;o.didInitialize.forEach(function(e){e.apply(this,t)}.bind(this)),c&&c.apply(this,t)},t.hasOwnProperty("parentClass")){var d=t.parentClass;delete t.parentClass,e=function(){var t=l.apply(this,arguments);return t?t:(e.__super__.constructor.apply(this,arguments),h.apply(this,arguments),this)},i.inheritPrototype(e,d)}else e=function(){if("function"==typeof l){var t=l.apply(this,arguments);if(t&&t.constructor===e)return t}return"function"==typeof h&&h.apply(this,arguments),this};t.hasOwnProperty("displayName")&&(e.displayName=t.displayName,delete t.displayName);var p=[];t.hasOwnProperty("mixins")&&(p=t.mixins,delete t.mixins),e.createClass=function(t){var r=i.createClass(i.extend({},t,{parentClass:e}));return["didExtendCtor","didExtendProto"].forEach(function(t){o[t].forEach(function(t){t(r)})}),r};for(r in t)t.hasOwnProperty(r)&&(e.prototype[r]=t[r]);for(s=0,n=p.length;n>s;s++)a=p[s],a.hasOwnProperty("ctor")||a.hasOwnProperty("proto")?(a.hasOwnProperty("ctor")&&(i.extend(e,a.ctor),"function"==typeof a.didExtendCtor&&(o.didExtendCtor.push(a.didExtendCtor),a.didExtendCtor(e))),a.hasOwnProperty("proto")&&(i.extend(e.prototype,a.proto),"function"==typeof a.didExtendProto&&(o.didExtendCtor.push(a.didExtendProto),a.didExtendProto(e))),"function"==typeof a.willInitialize&&o.willInitialize.push(a.willInitialize),"function"==typeof a.didInitialize&&o.didInitialize.push(a.didInitialize)):i.extend(e.prototype,a);return e}},r=i.extend,s=i.lazyExtend,n=i.assertEqual,a=i.createClass;t["marbles/utils"].extend=r,t["marbles/utils"].lazyExtend=s,t["marbles/utils"].assertEqual=n,t["marbles/utils"].createClass=a,t["marbles/utils"]["default"]=i}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/dispatcher"]={};var e=[],i={register:function(t){e.push(t);var i=e.length-1;return i},dispatch:function(t){var i=e.map(function(e){return new Promise(function(i){i(e(t))})});return Promise.all(i)}};t["marbles/dispatcher"]["default"]=i}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/state"]={};var e={addChangeListener:function(t){this.__changeListeners.push(t)},removeChangeListener:function(t){this.__changeListeners=this.__changeListeners.filter(function(e){return e!==t})},withChange:function(t){this.willChange(),t.call(this),this.handleChange(),this.didChange()},setState:function(t){this.withChange(function(){var e=this.state;Object.keys(t).forEach(function(i){e[i]=t[i]})})},setStateWithDelay:function(t,e){this.willChange();var i=this.state;Object.keys(t).forEach(function(e){i[e]=t[e]}),this.handleChangeWithDelay(e)},handleChangeWithDelay:function(t){t=t||10,clearTimeout(this.__handleChangeTimeout),this.__handleChangeTimeout=setTimeout(function(){this.handleChangeDelayed()}.bind(this),2),this.__handleChangeMaxTimeout||(this.__handleChangeMaxTimeout=setTimeout(function(){this.handleChangeDelayed()}.bind(this),t))},handleChangeDelayed:function(){clearTimeout(this.__handleChangeMaxTimeout),clearTimeout(this.__handleChangeTimeout),this.handleChange(),this.didChange()},replaceState:function(t){this.withChange(function(){this.state=t})},handleChange:function(){this.__changeListeners.forEach(function(t){t()})},willChange:function(){},didChange:function(){}};t["marbles/state"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";function e(t){if(t&&"object"==typeof t&&!Array.isArray(t)){var i=Object.keys(t),r=i.map(function(e){return t[e]});return JSON.stringify(i.sort().concat(r.sort()))}return Array.isArray(t)?"["+t.map(e).join(",")+"]":JSON.stringify(t)}t["marbles/store"]={};var i=t["marbles/utils"].Utils||t["marbles/utils"]["default"],r=t["marbles/state"].State||t["marbles/state"]["default"],s=function(t){this.id=t,this.constructor.__trackInstance(this),this.__changeListeners=[],this.willInitialize.apply(this,Array.prototype.slice.call(arguments,1)),this.state=this.getInitialState(),this.didInitialize.apply(this,Array.prototype.slice.call(arguments,1))};s.displayName="Marbles.Store",i.extend(s.prototype,r,{getInitialState:function(){return{}},willInitialize:function(){},didInitialize:function(){},didBecomeActive:function(){},didBecomeInactive:function(){},handleEvent:function(){}}),s.prototype.addChangeListener=function(){this.__changeListenerExpected=!1,r.addChangeListener.apply(this,arguments),this.__active||1!==this.__changeListeners.length||(this.__active=!0,this.didBecomeActive())},s.prototype.removeChangeListener=function(){var t=function(){this.__active=!1}.bind(this);r.removeChangeListener.apply(this,arguments),0!==this.__changeListeners.length||this.__changeListenerExpected||Promise.resolve(this.didBecomeInactive()).then(t)},s.prototype.expectChangeListener=function(){this.__changeListenerExpected=!0},s.prototype.unexpectChangeListener=function(){this.__changeListenerExpected=!1,0===this.__changeListeners.length&&Promise.resolve(this.didBecomeInactive()).then(function(){this.__active=!1}.bind(this))},s.__instances={},s.__getInstance=function(t,i){i=i||{};var r=e(t);return this.__instances[r]||(i.allowNull?null:new this(t))},s.__trackInstance=function(t){var i=e(t.id);this.__instances[i]=t},s.discardInstance=function(t){var i=e(t.id);delete this.__instances[i]},s.addChangeListener=function(t){var e=this.__getInstance(t);return e.addChangeListener.apply(e,Array.prototype.slice.call(arguments,1))},s.removeChangeListener=function(t){var e=this.__getInstance(t);return e.removeChangeListener.apply(e,Array.prototype.slice.call(arguments,1))},s.expectChangeListener=function(t){var e=this.__getInstance(t,{allowNull:!0});e&&e.expectChangeListener()},s.unexpectChangeListener=function(t){var e=this.__getInstance(t,{allowNull:!0});e&&e.unexpectChangeListener()},s.dispatcherIndex=null,s.registerWithDispatcher=function(t){this.dispatcherIndex=t.register(function(t){if(!t.storeId||this.isValidId&&!this.isValidId(t.storeId))return Promise.all(Object.keys(this.__instances).sort().map(function(e){var i=this.__instances[e];return new Promise(function(e){e(i.handleEvent(t))})}.bind(this)));var e=this.__getInstance(t.storeId),i=Promise.resolve(e.handleEvent(t)),r=function(t,i){return 0===e.__changeListeners.length&&e.didBecomeInactive(),t?Promise.reject(i):Promise.resolve(i)};return i.then(r.bind(null,!1),r.bind(null,!0)),i}.bind(this))},s.createClass=function(t){function e(t,e){var i=this.__getInstance(e),r=i[t].apply(i,Array.prototype.slice.call(arguments,2)),s=function(t,e){return 0===i.__changeListeners.length&&i.didBecomeInactive(),t?Promise.reject(e):Promise.resolve(e)};return Promise.resolve(r).then(s.bind(null,!1),s.bind(null,!0)),r}var r=this,s=i.inheritPrototype(function(){r.apply(this,arguments)},r);s.__instances={},t.hasOwnProperty("displayName")&&(s.displayName=t.displayName,delete t.displayName),i.extend(s.prototype,t);for(var n in t)t.hasOwnProperty(n)&&"_"!==n.slice(0,1)&&"function"==typeof t[n]&&(s[n]=e.bind(s,n));return s},t["marbles/store"]["default"]=s}(window.____modules____=window.____modules____||{}),function(t){"use strict";function e(t){t.__events||(t.__events={})}t["marbles/events"]={};var i=/\s+/,r={on:function(t,r,s,n){e(this),Array.isArray(t)||(t=t.split(i));for(var a,o=0,l=t.length;l>o;o++)a=t[o],this.__events[a]||(this.__events[a]=[]),this.__events[a].push({callback:r,context:s||this,options:n||{}});return this},once:function(t,e,r,s){Array.isArray(t)||(t=t.split(i));for(var n=function(t){var i=function(){this.off(t,i,this),e.apply(r,arguments)};this.on(t,i,this,s)}.bind(this),a=0,o=t.length;o>a;a++)n(t[a]);return this},off:function(t,e,r){if(0===arguments.length)return this.hasOwnProperty("__events")&&delete this.__events,this;if(Array.isArray(t)||(t=t.split(i)),!this.__events)return this;var s,n,a,o,l=function(t){return r&&r!==t.context?!0:e&&e!==t.callback?!0:!1};for(n=0,a=t.length;a>n;n++)s=t[n],void 0!==e||void 0!==r?(o=this.__events[s],o&&(this.__events[s]=Array.prototype.filter.call(o,l))):this.__events.hasOwnProperty(s)&&delete this.__events[s];return this},trigger:function(t){var e=Array.prototype.slice.call(arguments,1);if(Array.isArray(t)||(t=t.split(i)),!this.__events)return this;var r,s,n,a,o,l;for(n=0,o=t.length;o>n;n++)if(r=this.__events[t[n]])for(a=0,l=r.length;l>a;a++)s=r[a],s.options.args===!1?s.callback.call(s.context):s.callback.apply(s.context,e);return this}};t["marbles/events"]["default"]=r}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/query_params"]={};var e={deserializeParams:function(t){t="?"===t.substr(0,1)?t.substring(1).split("&"):t.split("&");for(var e=[{}],i=0,r=t.length;r>i;i++){var s=t[i].split("="),n=decodeURIComponent(s[0]),a=decodeURIComponent(s[1]||"").replace("+"," ").trim();if("string"!=typeof a||a){-1!==a.indexOf(",")&&(a=a.split(","));for(var o=0,l=e.length;l>o;o++){if(!e[o].hasOwnProperty(n)){e[o][n]=a;break}o===l-1&&(e.push({}),l++)}}}return e},combineParams:function(t){function e(e,i){for(var r=0,s=t.length;s>r;r++){if(!t[r].hasOwnProperty(e)){t[r][e]=i;break}r===s-1&&(t.push({}),s++)}}for(var i,r=Array.prototype.slice.call(arguments,1),s=0,n=r.length;n>s;s++)for(i in r[s])r[s].hasOwnProperty(i)&&e(i,r[s][i]);return t},replaceParams:function(t){function e(e,i,r){t[e]=t[e]||{},t[e][i]=r}for(var i,r=Array.prototype.slice.call(arguments,1),s=0,n=r.length;n>s;s++)for(i in r[s])r[s].hasOwnProperty(i)&&e(s,i,r[s][i]);return t},serializeParams:function(t){for(var e=[],i=0,r=t.length;r>i;i++)for(var s in t[i])if(t[i].hasOwnProperty(s)){var n=t[i][s];if("string"==typeof n&&!n||void 0===n||null===n)continue;"object"==typeof n&&n.hasOwnProperty("length")&&(n=n.join(",")),e.push(encodeURIComponent(s)+"="+encodeURIComponent(n))}return"?"+e.join("&")}};t["marbles/query_params"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/history"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/dispatcher"].Dispatcher||t["marbles/dispatcher"]["default"],r=t["marbles/query_params"].QueryParams||t["marbles/query_params"]["default"],s=function(t,i){if(0===i.length)return t;i=[].concat(i),i[0]=e.extend({},i[0]),t=t.replace(/:([^\/]+)/g,function(t,e){var r=i[0];if(r.hasOwnProperty(e)){var s=r[e];return delete r[e],encodeURIComponent(s)}return":"+e});var s=r.serializeParams(i);return s.length>1&&(-1!==t.indexOf("?")?t=t+"&"+s.substring(1):t+=s),t},n=e.createClass({displayName:"Marbles.History",willInitialize:function(){this.started=!1,this.handlers=[],this.options={},this.path=null,this.prevPath=null,this.handlePopState=this.handlePopState.bind(this)},register:function(t){t.history=this,t.routes.forEach(function(e){this.route(e.route,e.name,e.handler,e.paramNames,e.opts,t)}.bind(this))},route:function(t,e,i,r,s,n){if("function"!=typeof i)throw new Error(this.constructor.displayName+".prototype.route(): callback is not a function: "+JSON.stringify(i));if("function"!=typeof t.test)throw new Error(this.constructor.displayName+".prototype.route(): expected route to be a RegExp: "+JSON.stringify(t));this.handlers.push({route:t,name:e,paramNames:r,callback:i,opts:s,router:n})},navigate:function(t,e){if(!this.started)throw new Error("history has not been started");if(e||(e={}),e.hasOwnProperty("trigger")||(e.trigger=!0),e.hasOwnProperty("replace")||(e.replace=!1),e.hasOwnProperty("force")||(e.force=!1),"/"===t[0]&&(t=t.substring(1)),e.params&&(t=s(t,e.params)),t!==this.path||e.force){if(t=this.pathWithRoot(t),!this.options.pushState)return void(window.location.href=t);var i="pushState";e.replace&&(i="replaceState"),window.history[i]({},document.title,t),e.trigger&&this.loadURL({replace:e.replace})}},pathWithRoot:function(t){var e=this.options.root;return e&&t.substr(0,e.length)!==e&&("/"!==e.substring(e.length-1)&&"/"!==t.substr(0,1)&&(t="/"+t),t=e+t),t},getURLFromPath:function(t,e){return e&&0!==e.length&&(t=s(t,e)),window.location.protocol+"//"+window.location.host+this.pathWithRoot(t)},start:function(t){if(this.started)throw new Error("history has already been started");t||(t={}),t.hasOwnProperty("trigger")||(t.trigger=!0),this.dispatcher=t.dispatcher||i,this.context=t.context||{},this.options=e.extend({root:"/",pushState:!0},t),this.path=this.getPath(),this.options.pushState&&(this.options.pushState=!(!window.history||!window.history.pushState)),this.options.pushState&&window.addEventListener("popstate",this.handlePopState,!1),this.started=!0,this.trigger("start"),t.trigger&&this.loadURL()},stop:function(){this.options.pushState&&window.removeEventListener("popstate",this.handlePopState,!1),this.started=!1,this.trigger("stop")},getPath:function(){var t=window.location.pathname;window.location.search&&(t+=window.location.search);var e=this.options.root.replace(/([^\/])\/$/,"$1");return-1!==t.indexOf(e)&&(t=t.substr(e.length)),t.replace(this.constructor.regex.routeStripper,"")},handlePopState:function(){this.checkURL()},checkURL:function(){var t=this.getPath();t!==this.path&&this.loadURL()},getHandler:function(t){t=t||this.getPath(),t=t.split("?")[0];for(var e=null,i=0,r=this.handlers.length;r>i;i++)if(this.handlers[i].route.test(t)){e=this.handlers[i];break}return e},loadURL:function(t){t=t||{};var e=this.path,i=this.pathParams;t.replace||(this.prevPath=e,this.prevParams=i);var s=this.path=this.getPath(),n=s.match(this.constructor.regex.routeParts);s=n[1];var a=r.deserializeParams(n[2]||"");this.pathParams=a;var o;this.path!==this.prevPath&&(o=this.getHandler(e));var l=this.getHandler(s),h=!1,u=function(){h=!0};if(o){var c={handler:o,nextHandler:l,path:e,nextPath:s,params:i,nextParams:a,abort:u,context:this.context};o.router.beforeHandlerUnload&&o.router.beforeHandlerUnload.call(o.router,c),h||this.trigger("handler:before-unload",c)}if(l&&!h){var d=l.router;a=r.combineParams(a,d.extractNamedParams.call(d,l.route,s,l.paramNames));var p={handler:l,path:s,params:a,abort:u,context:this.context};l.router.beforeHandler&&l.router.beforeHandler.call(l.router,p),h||this.trigger("handler:before",p),h||(l.callback.call(d,a,l.opts,this.context),this.trigger("handler:after",{handler:l,path:s,params:a}))}return l},trigger:function(t,i){return this.dispatcher.dispatch(e.extend({source:"Marbles.History",name:t},i))}});n.regex={routeStripper:/^[\/]/,routeParts:/^([^?]*)(?:\?(.*))?$/},t["marbles/history"].pathWithParams=s,t["marbles/history"]["default"]=n}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/router"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=e.createClass({displayName:"Marbles.Router",willInitialize:function(t){t=t||{},this.context=t.context,this.compileRoutes()},route:function(t,e,i){var r=[];"function"!=typeof t.test&&(r=this.routeParamNames(t),t=this.routeToRegExp(t));var s;"function"==typeof e?s=e.name||e.displayName||null:(s=e,e=this[e]),this.routes.push({route:t,name:s,handler:e,paramNames:r,opts:i})},compileRoutes:function(){this.routes=[];var t=this.constructor;if(!t.routes)throw new Error("You need to define "+t.displayName||t.name+".routes");for(var e,i,r=0,s=t.routes,n=s.length;n>r;r++){e={};for(i in s[r])s[r].hasOwnProperty(i)&&"path"!==i&&"handler"!==i&&(e[i]=s[r][i]);this.route(s[r].path,s[r].handler,e)}},routeToRegExp:function(t){"/"===t[0]&&(t=t.substring(1));var e=this.constructor;return t=t.replace(e.regex.escape,"\\$&").replace(e.regex.namedParam,"([^/]+)").replace(e.regex.splatParam,"(.*?)"),new RegExp("^"+t+"$")},routeParamNames:function(t){var e=this.constructor,i=[],r=t.match(e.regex.namedParam);if(r&&r.length)for(var s=0,n=r.length;n>s;s++)i.push(r[s].slice(1));if(r=t.match(e.regex.splatParam),r&&r.length)for(s=0,n=r.length;n>s;s++)i.push("splat"+(s>0?s+1:""));return i},extractNamedParams:function(t,e,i){for(var r=[],s={},n=0,a=this.extractParams(t,e),o=a.length;o>n;n++)r.push(decodeURIComponent(a[n]));for(n=0,o=i.length;o>n;n++)s[i[n]]=r[n];return s},extractParams:function(t,e){return t.exec(e).slice(1)}});i.regex={namedParam:/:\w+/g,splatParam:/\*\w*/g,escape:/[-[\]{}()+?.,\\^$|#\s]/g},i.routes=[],i.createClass=function(t){t.hasOwnProperty("displayName")||(t.displayName=this.displayName);var r=this.routes;t.hasOwnProperty("routes")&&(r=t.routes,delete t.routes),t.parentClass=this;var s=e.createClass(t);return s.routes=r,s.createClass=i.createClass.bind(s),s},t["marbles/router"]["default"]=i}(window.____modules____=window.____modules____||{}),function(t){"use strict";function e(t,e){e=e||{};var r;return r=e.hasOwnProperty("keypath")&&e.keypath!==!0?[t]:t.split(i)}t["marbles/accessors"]={};var i=".",r="Marbles.Accessors",s={set:function(t,i,r){var s,n,a,o=e(t,r),l=o.pop(),h=this;for(n=0,a=o.length;a>n;n++)s=o[n],h[s]=h[s]||{},h=h[s];var u=h[l];h[l]=i,(r||{}).silent!==!0&&i!==u&&"function"==typeof this.trigger&&(this.trigger("change",i,u,t,r),this.trigger("change:"+t,i,u,t,r))},get:function(t,i){var r,s,n,a=e(t,i),o=a.pop(),l=this;for(s=0,n=a.length;n>s&&l;s++)r=a[s],l=l[r];return l&&l.hasOwnProperty(o)?l[o]:void 0},remove:function(t,s){if(this.hasKey(t,s)){var n=e(t,s),a=n.pop(),o=this;if(n.length&&(o=this.get(n.join(i))),!o)throw new Error(r+"("+this.constructor.displayName+"): Can't remove property "+JSON.stringify(a)+" from undefined keypath: "+n.join(i));var l=o[a];o.hasOwnProperty(a)&&delete o[a],(s||{}).silent!==!0&&void 0!==l&&"function"==typeof this.trigger&&(this.trigger("change",void 0,l,t,s),this.trigger("change:"+t,void 0,l,t,s))}},hasKey:function(t,r){var s=e(t,r),n=s.pop(),a=this.get(s.join(i));return a&&a.hasOwnProperty(n)?!0:!1}};t["marbles/accessors"]["default"]=s}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/transaction"]={};var e={transaction:function(t){var e=Object.create(this),i=[];e.trigger=function(){i.push(arguments)};var r=!1;return e.abortTransaction=function(){r=!0},e.finalizeTransaction=function(){if(!r){delete e.trigger,delete e.abortTransaction,delete e.finalizeTransaction;for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);for(var s,n=0,a=i.length;a>n;n++)s=i.shift(),this.trigger.apply(this,s)}}.bind(this),arguments.length>0?(t.call(e,e),void e.finalizeTransaction()):e},abortTransaction:function(){throw new Error("Must be inside a transaction to abort one.")},finalizeTransaction:function(){throw new Error("Must be inside a transaction to finalize one.")}};t["marbles/transaction"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/dirty_tracking"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=function(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(!t||!e)return!1;if("object"==typeof t){for(var r in t)if(t.hasOwnProperty(r)&&!i(t[r],e[r]))return!1;for(r in e)if(e.hasOwnProperty(r)&&!i(e[r],t[r]))return!1;return!0}return t===e},r=function(t,r){var s=e.extend({},this.__hasChanges);s[t]=i(this.__originalValues[t],r)?!1:!0,this.set("__hasChanges",s)},s={willInitialize:function(){var t=this.constructor.dirtyTrackingKeypaths;if(!Array.isArray(t))throw new Error(this.constructor.displayName+": `dirtyTrackingKeypaths` property (Array) on ctor required, is "+JSON.stringify(t)+"!");this.resetDirtyTracking(),t.forEach(function(t){var e=t.split("."),i="";e.forEach(function(e){i=i?i+"."+e:e,this.on("change:"+i,function(){r.call(this,t,this.get(t))}.bind(this))}.bind(this)),this.on("change",function(e,i,s){var n,a;s!==t&&s.substr(0,t.length)===t&&(a=s.substring(t.length+1),n=this.get(t),r.call(this,t,n))}.bind(this))}.bind(this))},didInitialize:function(){this.resetDirtyTracking()},proto:{resetDirtyTracking:function(t){var e;t?e=[t]:(e=this.constructor.dirtyTrackingKeypaths,this.__originalValues={},this.__hasChanges={}),e.forEach(function(t){this.__originalValues[t]=this.get(t),this.__hasChanges[t]=!1}.bind(this))},isDirty:function(t){if(t)return!!this.__hasChanges[t];for(var e in this.__hasChanges)if(this.__hasChanges.hasOwnProperty(e)&&this.isDirty(e))return!0;return!1}}};t["marbles/dirty_tracking"]["default"]=s}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/validation"]={};var e=function(t){return t.replace(".","_")},i={didInitialize:function(){var t=this.constructor.validation;if(!t)throw new Error(this.constructor.displayName+": `validation` property (Object) on ctor required, is "+JSON.stringify(t)+"!");Object.keys(t).forEach(function(t){var e=t.split("."),i="";e.forEach(function(e){i=i?i+"."+e:e,this.on("change:"+i,function(){this.performValidation(t,this.get(t))}.bind(this))}.bind(this)),this.on("change",function(e,i,r){var s,n;r!==t&&r.substr(0,t.length)===t&&(n=r.substring(t.length+1),s=this.get(t),this.performValidation(t,s))}.bind(this));var r=this.get(t);void 0!==r&&this.performValidation(t,r)}.bind(this))},proto:{performValidation:function(t,i){var r,s;t?(s=this.constructor.validation[t],r=e(t),s.call(this,i,function(t,e){this.set("validation."+r+".valid",t),this.set("validation."+r+".msg",e)}.bind(this))):Object.keys(this.constructor.validation).forEach(function(t){this.performValidation(t,this.get(t))}.bind(this))},getValidation:function(t){var i=e(t),r=this.get("validation."+i+".valid",r),s=this.get("validation."+i+".msg",s);return{valid:r,msg:s}},isValid:function(){for(var t=!0,e=this.constructor.validationRequiredKeypaths||[],i=0,r=e.length;r>i;i++)if(void 0===this.get(e[i])){t=!1;break}if(t)for(var s in this.validation)if(this.validation.hasOwnProperty(s)&&this.validation[s].valid===!1){t=!1;break}return t}}};t["marbles/validation"]["default"]=i}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/uri"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/query_params"].QueryParams||t["marbles/query_params"]["default"],r=e.createClass({displayName:"Marbles.URI",mixins:[i],willInitialize:function(t,e){this.url=t.trim(),this.params=e||[{}],this.parse(),this.isURI=!0},toString:function(){var t="";443!==this.port&&80!==this.port&&(t=":"+this.port);var e="";this.scheme&&(e=this.scheme+"://");var i=this.serializeParams(this.params);"?"===i&&(i="");var r="";return this.hash&&(r="#"+this.hash),(e+this.hostname+t+this.path+i+r).replace(/\/$/,"")},assertEqual:function(t){var e=t;return t.isURI!==!0&&(e=new this.constructor(t)),e.scheme===this.scheme&&e.hostname===this.hostname&&e.port===this.port&&e.path===this.path&&e.params===this.params&&e.hash===this.hash},parse:function(){var t=this.url.match(this.constructor.REGEX);if(this.hostname=t[2]||this.defaultHost(),this.scheme=(t[1]||this.defaultScheme()).replace(/:\/\/$/,""),this.port=Number(t[3])||this.defaultPort(),this.path=t[4]||"",t[5]){var e=this.deserializeParams(t[5]);this.replaceParams.apply(this,[this.params].concat(e))}this.hash=t[6]},defaultScheme:function(){return"undefined"!=typeof window?window.location.protocol+"//":this.hostname?"http://":""},defaultHost:function(){return"undefined"!=typeof window?window.location.hostname:""},defaultPort:function(){return this.hostname===this.defaultHost()&&"undefined"!=typeof window&&window.location.port?window.location.port:"https"===this.scheme?443:80}});r.REGEX=/^(https?:\/\/)?([^\/]+(:\d+)?)?([^\?#]+)?(\?[^#]+)?(#.+)?$/,t["marbles/uri"]["default"]=r}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/events"].Events||t["marbles/events"]["default"],r=t["marbles/uri"].URI||t["marbles/uri"]["default"],s=e.createClass({displayName:"Marbles.HTTPRequest",mixins:[i],willInitialize:function(t){if(t||(t={}),this.middleware=t.middleware||[],this.method=t.method||"GET",this.method=this.method.toUpperCase(),this.uri=new r(t.url,t.params||[{}]),this.requestHeaders=t.headers||{},this.requestBody=t.body||null,"GET"===this.method||"HEAD"===this.method){if(this.id=this.method+":"+this.uri.toString(),this.constructor.activeRequests[this.id])return this.constructor.activeRequests[this.id];this.on("before:send",this.trackRequest,this),this.on("complete",this.untrackRequest,this),this.on("terminated",this.untrackRequest,this)}this.on("before:send",this.callRequestMiddleware,this),this.on("before:send",this.setXMLHTTPRequestHeaders,this),this.on("before:complete",this.callResponseMiddleware,this),this.on("complete",this.untrackRequest,this),this.on("before:send",function(){var t,e;this.completePromise=new Promise(function(i,r){t=i,e=r});var i=function(e,i){this.off("terminated",r,this),this.completePromise=null,t([e,i])},r=function(t){this.off("complete",i,this),this.completePromise=null,e(t)};this.once("complete",i,this),this.once("terminated",r,this)},this),this.completePromise=null},then:function(){var t=this.completePromise||new Promise(function(t,e){e(new Error("Request not started!"))});return t.then.apply(t,arguments)},"catch":function(){var t=this.completePromise||new Promise(function(t,e){e(new Error("Request not started!"))});return t["catch"].apply(t,arguments)},setRequestHeader:function(t,e){this.requestHeaders[t]=e},getRequestHeader:function(t){return this.requestHeaders[t]},getResponseHeader:function(t){return this.xhr.getResponseHeader(t)},terminate:function(t){this.terminated=!0,this.trigger("terminated",t)},resend:function(t){this.terminate(t||"resend"),this.open(),this.send()},callRequestMiddleware:function(){for(var t=0,e=this.middleware,i=e.length;i>t&&!this.terminated;t++)"function"==typeof e[t].willSendRequest&&e[t].willSendRequest(this)},callResponseMiddleware:function(){for(var t=0,e=this.middleware,i=e.length;i>t&&!this.terminated;t++)"function"==typeof e[t].didReceiveResponse&&e[t].didReceiveResponse(this)},trackRequest:function(){this.constructor.activeRequests[this.id]=this},untrackRequest:function(){this.constructor.activeRequests.hasOwnProperty(this.id)&&delete this.constructor.activeRequests[this.id]},setXMLHTTPRequest:function(){this.xhr=new XMLHttpRequest,this.xhr.onreadystatechange=this.handleReadyStateChange.bind(this)},setXMLHTTPRequestHeaders:function(){for(var t in this.requestHeaders)this.requestHeaders.hasOwnProperty(t)&&this.xhr.setRequestHeader(t,this.requestHeaders[t])},handleReadyStateChange:function(){if(4===this.xhr.readyState){this.trigger("before:complete",this.xhr);var t=this.responseData||this.xhr.response;this.xhr.status>=200&&this.xhr.status<400&&0!==this.xhr.status?this.trigger("success",t,this.xhr):this.trigger("failure",t,this.xhr),this.trigger("complete",t,this.xhr)}},open:function(){if(!this.xhr||4===this.xhr.readyState){this.setXMLHTTPRequest();var t=this.uri.toString(),e=!0;this.xhr.open(this.method,t,e),this.trigger("open",this.method,t,e)}},send:function(){if(1===this.xhr.readyState){this.trigger("before:send");try{this.xhr.send(this.requestBody)}catch(t){setTimeout(function(){throw t},0)}this.trigger("after:send")}}});s.activeRequests={};var n=function(t){var e=new s({method:t.method,url:t.url,params:t.params,body:t.body,headers:t.headers,middleware:t.middleware});return"function"==typeof t.callback&&e.once("complete",t.callback),e.xhr||(e.open(),e.send()),e};t["marbles/http"].Request=s,t["marbles/http"].HTTP=n,t["marbles/http"]["default"]=n}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/middleware/basic_auth"]={};var e=function(t,e){var i="Basic "+window.btoa((t||"")+":"+(e||""));return{willSendRequest:function(t){try{t.setRequestHeader("Authorization",i)}catch(e){setTimeout(function(){throw e},0)}}}};t["marbles/http/middleware/basic_auth"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/middleware/form_encoded"]={};var e=t["marbles/query_params"].QueryParams||t["marbles/query_params"]["default"],i="application/x-www-form-urlencoded",r={willSendRequest:function(t){if(!t.multipart&&t.requestBody){var r=t.getRequestHeader("Content-Type");if(r===i){var s=t.requestBody;Array.isArray(s)||(s=[s]),t.requestBody=e.serializeParams(s).substring(1)}}},didReceiveResponse:function(t){var r=t.getResponseHeader("Content-Type");if(r===i){var s=t.xhr.response,n=null;s&&"string"==typeof s&&(Array.isArray(n)||(n=[n]),t.responseData=e.deserializeParams(n))}}};t["marbles/http/middleware/form_encoded"].CONTENT_TYPE=i,t["marbles/http/middleware/form_encoded"]["default"]=r}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/middleware/serialize_json"]={};var e={willSendRequest:function(t){if(!t.multipart){var e=t.getRequestHeader("Content-Type");if(/\bjson/i.test(e)){var i=t.requestBody;t.requestBody=i?JSON.stringify(i):null}}},didReceiveResponse:function(t){var e=t.getResponseHeader("Content-Type");if(/\bjson/i.test(e)){var i=t.xhr.response;if(t.responseData=null,i)try{t.responseData=JSON.parse(i)}catch(r){t.terminate(r)}}}};t["marbles/http/middleware/serialize_json"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/middleware/with_credentials"]={};var e={willSendRequest:function(t){try{t.xhr.withCredentials=!0}catch(e){setTimeout(function(){throw e},0)}}};t["marbles/http/middleware/with_credentials"]["default"]=e}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/middleware"]={};var e=t["marbles/http/middleware/basic_auth"].BasicAuth||t["marbles/http/middleware/basic_auth"]["default"],i=t["marbles/http/middleware/form_encoded"].FormEncoded||t["marbles/http/middleware/form_encoded"]["default"],r=t["marbles/http/middleware/serialize_json"].SerializeJSON||t["marbles/http/middleware/serialize_json"]["default"],s=t["marbles/http/middleware/with_credentials"].WithCredentials||t["marbles/http/middleware/with_credentials"]["default"],n={BasicAuth:e,FormEncoded:i,SerializeJSON:r,WithCredentials:s};t["marbles/http/middleware"]["default"]=n}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/http/link_header"]={};var e=/,[\s\r\n]*/,i=/<([^>]+)>((?:[\s\r\n]|.)*)/,r=/[\s\r\n]*;[\s\r\n]*/,s=/([^=]+)=['"]?([^'"]+)['"]?/,n={parse:function(t){var n,a,o,l,h,u,c,d=[],p=t.split(e);for(n=0,a=p.length;a>n;n++)if(o=p[n].match(i)){for(l={href:o[1]},u=o[2].split(r),h=0,c=u.length;c>h;h++)o=u[h].match(s),o&&(l[o[1]]=o[2]);d.push(l)}return d}};t["marbles/http/link_header"]["default"]=n}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/object"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/accessors"].Accessors||t["marbles/accessors"]["default"],r=t["marbles/events"].Events||t["marbles/events"]["default"],s=e.createClass({displayName:"Marbles.Object",mixins:[i,r],willInitialize:function(t){this.parseAttributes(t)},parseAttributes:function(t){for(var e in t)t.hasOwnProperty(e)&&this.set(e,t[e])}});t["marbles/object"]["default"]=s}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/id_counter"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=e.createClass({displayName:"Marbles.IDCounter",willInitialize:function(t,e){e||(e=0),this.scope=t,this.count=e},incrementCounter:function(){return this.count++},nextID:function(){return this.scope+"_"+this.incrementCounter()}});i.counterScopeMapping={},i.counterForScope=function(t){var e=this.counterScopeMapping[t];return e||(e=new this(t),this.counterScopeMapping[t]=e),e
},t["marbles/id_counter"]["default"]=i}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/id_mapping"]={};var e,i,r,s,n=t["marbles/id_counter"].IDCounter||t["marbles/id_counter"]["default"],a={didExtendCtor:function(t){t.instances={},t.__cidMapping={},void 0===t.cidMappingScope&&(t.cidMappingScope=[]),t.__cidName=t.cidScope?e.call(t):"_default",t.__cidCounter=new n(t.__cidName)},ctor:{find:function(t,e){var r,s,n=i.call(this,t),a=this.__cidMapping,o=this.__cidName,l=!e||e.fetch!==!1;return e||(e={}),t.hasOwnProperty("cid")?(r=t.cid,l=!1):n&&(r=(a[o]||{})[n]),void 0!==r&&null!==r&&(s=this.instances[r])?s:(l===!0&&this.fetch(t,e),null)},findOrNew:function(t){var e=this.find(t,{fetch:!1});return e||(e=new this(t)),e},fetch:function(){throw new Error("You need to define "+this.displayName+".fetch(params, options)")},detach:function(t){var e,i,r=this.instances,s=r[t],n=this.__cidName,a=this.__cidMapping;s&&s.willDetach&&s.willDetach(),r.hasOwnProperty(t)&&delete r[t],a.hasOwnProperty(t)&&delete a[t],r[n]&&(e=r[n].indexOf(t),-1!==e&&(i=r[n],i=i.slice(0,e).concat(i.slice(e+1,i.length)),r[n]=i)),s&&(s.trigger("detach"),s.didDetach&&s.didDetach()),this.trigger("detach",t,s),this.off()}},proto:{initCIDMapping:function(){void 0===this.cid&&(this.cid=this.constructor.__cidCounter.nextID()),r.call(this)},detach:function(){this.constructor.detach(this.cid)}}};e=function(){var t,e,i=[],r=this.cidScope;for(t=0,e=r.length;e>t;t++)i.push(this[r[t]]);return i.join(":")},i=function(t){var e,i,r=[],s=this.cidMappingScope;for(e=0,i=s.length;i>e;e++){if(!t.hasOwnProperty(s[e]))return null;r.push(t[s[e]])}return r.join(":")},r=function(){var t,e,i=this.constructor,r=i.instances,n=i.cidMappingScope;for(r[this.cid]=this,t=0,e=n.length;e>t;t++)this.on("change:"+n[t],s,this)},s=function(t,e,i){var r,s,n,a,o=[],l=[],h=this.constructor,u=h.__cidMapping,c=h.__cidName;for(s=h.cidMappingScope,r=0,n=s.length;n>r;r++)s[r]===i?(o.push(e),l.push(t)):(a=this.get(s[r]),o.push(a),l.push(a));o=o.join(":"),l=l.join(":"),void 0===u[c]&&(u[c]={}),u[c][l]=this.cid,u[c].hasOwnProperty(o)&&delete u[c][o]},t["marbles/id_mapping"]["default"]=a}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/model"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/transaction"].Transaction||t["marbles/transaction"]["default"],r=t["marbles/id_mapping"].CIDMapping||t["marbles/id_mapping"]["default"],s=t["marbles/accessors"].Accessors||t["marbles/accessors"]["default"],n=t["marbles/events"].Events||t["marbles/events"]["default"],a=e.createClass({displayName:"Marbles.Model",mixins:[{ctor:{modelName:"model",cidScope:["modelName"],cidMappingScope:["id"],JSONKeys:"all"}},{ctor:n,proto:n},s,i,r],willInitialize:function(t,e){return t||(t={}),e||(e={}),e.cid&&(this.cid=e.cid),this.initCIDMapping(),this.transaction(function(){this.parseAttributes(t)}),this},parseAttributes:function(t){for(var e in t)t.hasOwnProperty(e)&&this.set(e,t[e],{keypath:!1})},toJSON:function(){var t,e,i,r,s={};for(t="all"===this.constructor.JSONKeys?Object.keys(this):this.constructor.JSONKeys,e=0,i=t.length;i>e;e++)r=t[e],this.hasOwnProperty(r)&&(s[r]=this[r]);return s}});t["marbles/model"]["default"]=a}(window.____modules____=window.____modules____||{}),function(t){"use strict";t["marbles/collection"]={};var e=t["marbles/utils"].Utils||t["marbles/utils"]["default"],i=t["marbles/model"].Model||t["marbles/model"]["default"],r=t["marbles/accessors"].Accessors||t["marbles/accessors"]["default"],s=t["marbles/events"].Events||t["marbles/events"]["default"],n=t["marbles/id_mapping"].CIDMapping||t["marbles/id_mapping"]["default"],a=e.createClass({displayName:"Marbles.Collection",mixins:[{ctor:{collectionName:"collection",cidScope:["collectionName"],model:i,buildModel:function(t,e){var i=(e||{}).model||this.model,r=i.find(t,{fetch:!1});return r?r.parseAttributes(t):r=new i(t),r}}},{ctor:s,proto:s},r,n],willInitialize:function(t){this.modelCIDs=[],this.options={unique:!!t.unique},t.cid&&(this.cid=t.cid),this.initCIDMapping(),this.watchModelMortality(),this.on("reset prepend append remove",function(){this.trigger("change:models",this.models)},this)},watchModelMortality:function(){this.constructor.model.on("detach",function(t){this.removeCIDs([t])},this)},indexOf:function(t){return this.modelCIDs.indexOf(t.cid)},first:function(){return this.constructor.model.find({cid:this.modelCIDs[0]})},last:function(){return this.constructor.model.find({cid:this.modelCIDs[this.modelCIDs.length-1]})},forEach:function(t,e){for(var i,r=this.modelCIDs,s=0,n=r.length;n>s;s++)i=this.constructor.model.find({cid:r[s]}),i&&t.call(e||this,i,s)},models:function(){for(var t,e=this.modelCIDs,i=[],r=0,s=e.length;s>r;r++)t=this.constructor.model.find({cid:e[r]}),t&&i.push(t);return i},resetJSON:function(t,e){e||(e={}),this.modelCIDs=[];var i=this.appendJSON(t,{silent:!0});return e.silent||this.trigger("reset",i),i},resetModels:function(t,e){return e||(e={}),this.modelCIDs=[],t=this.appendModels(t,{silent:!0}),e.silent||this.trigger("reset",t),t},reset:function(t){t||(t={}),this.modelCIDs=[],t.silent||this.trigger("reset",[])},removeAtIndex:function(t){var e=this.modelCIDs[t];return this.modelCIDs=this.modelCIDs.slice(0,t).concat(this.modelCIDs.slice(t+1,this.modelCIDs.length)),this.trigger("remove",e),this.modelCIDs.length},removeCIDs:function(t){for(var e,i=0,r=t.length;r>i;i++)e=this.modelCIDs.indexOf(t[i]),-1!==e&&this.removeAtIndex(e);return this.modelCIDs.length},remove:function(){for(var t=Array.prototype.slice.call(arguments,0),e=0,i=t.length;i>e;e++)this.removeCIDs([t[e].cid]);return this.modelCIDs.length},prependJSON:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r=[],s=t.length-1;s>=0;s--)i=this.constructor.buildModel(t[s]),this.options.unique&&-1!==this.modelCIDs.indexOf(i.cid)||(this.modelCIDs.unshift(i.cid),r.unshift(i));return e.silent||this.trigger("prepend",r),r},prependModels:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r=[],s=t.length-1;s>=0;s--)i=t[s],this.options.unique&&-1!==this.modelCIDs.indexOf(i.cid)||(this.modelCIDs.unshift(i.cid),r.unshift(i));return e.silent||this.trigger("prepend",r),r},prependCIDs:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r,s=[],n=t.length;n>=0;n--)if(i=t[n],!this.options.unique||-1===this.modelCIDs.indexOf(i)){if(r=this.constructor.find({cid:i}),!r)continue;this.modelCIDs.unshift(i),s.unshift(r)}return e.silent||this.trigger("prepend",s),s},unshift:function(){return this.prependModels(Array.prototype.slice.call(arguments,0))},appendJSON:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r=[],s=0,n=t.length;n>s;s++)i=this.constructor.buildModel(t[s]),this.options.unique&&-1!==this.modelCIDs.indexOf(i.cid)||(this.modelCIDs.push(i.cid),r.push(i));return e.silent||this.trigger("append",r),r},appendModels:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r=[],s=0,n=t.length;n>s;s++)i=t[s],this.options.unique&&-1!==this.modelCIDs.indexOf(i.cid)||(this.modelCIDs.push(i.cid),r.push(i));return e.silent||this.trigger("append",r),r},appendCIDs:function(t,e){if(!t||!t.length)return[];e||(e={});for(var i,r,s=[],n=0,a=t.length;a>n;n++)if(i=t[n],!this.options.unique||-1===this.modelCIDs.indexOf(i)){if(r=this.constructor.find({cid:i}),!r)continue;this.modelCIDs.push(i),s.push(r)}return e.silent||this.trigger("append",s),s},push:function(){return this.appendModels(Array.prototype.slice.call(arguments,0))}});t["marbles/collection"]["default"]=a}(window.____modules____=window.____modules____||{}),function(t){"use strict";t.marbles={};var e=t["marbles/version"].VERSION||t["marbles/version"]["default"],i=t["marbles/utils"].Utils||t["marbles/utils"]["default"],r=t["marbles/dispatcher"].Dispatcher||t["marbles/dispatcher"]["default"],s=t["marbles/state"].State||t["marbles/state"]["default"],n=t["marbles/store"].Store||t["marbles/store"]["default"],a=t["marbles/events"].Events||t["marbles/events"]["default"],o=t["marbles/history"].History||t["marbles/history"]["default"],l=t["marbles/router"].Router||t["marbles/router"]["default"],h=t["marbles/accessors"].Accessors||t["marbles/accessors"]["default"],u=t["marbles/transaction"].Transaction||t["marbles/transaction"]["default"],c=t["marbles/dirty_tracking"].DirtyTracking||t["marbles/dirty_tracking"]["default"],d=t["marbles/validation"].Validation||t["marbles/validation"]["default"],p=t["marbles/http"].HTTPRequest||t["marbles/http"]["default"],f=t["marbles/http"].HTTP||t["marbles/http"]["default"],_=t["marbles/http/middleware"].HTTPMiddleware||t["marbles/http/middleware"]["default"],m=t["marbles/http/link_header"].HTTPLinkHeader||t["marbles/http/link_header"]["default"],g=t["marbles/object"].MarblesObject||t["marbles/object"]["default"],w=t["marbles/model"].Model||t["marbles/model"]["default"],b=t["marbles/collection"].Collection||t["marbles/collection"]["default"];t.marbles.Utils=i,t.marbles.Dispatcher=r,t.marbles.State=s,t.marbles.Store=n,t.marbles.Events=a,t.marbles.History=o,t.marbles.Router=l,t.marbles.Accessors=h,t.marbles.Transaction=u,t.marbles.DirtyTracking=c,t.marbles.Validation=d,t.marbles.HTTP=f,t.marbles.HTTPRequest=p,t.marbles.HTTPMiddleware=_,t.marbles.HTTPLinkHeader=m,t.marbles.Object=g,t.marbles.Model=w,t.marbles.Collection=b;var v={VERSION:e,Utils:i,Dispatcher:r,State:s,Store:n,Events:a,History:o,Router:l,Accessors:h,Transaction:u,DirtyTracking:c,Validation:d,HTTP:f,HTTPRequest:p,Object:g,Model:w,Collection:b};v.HTTP.Middleware=_,v.HTTP.LinkHeader=m,t.marbles["default"]=v}(window.____modules____=window.____modules____||{});