/*! Noder.io | (c) 2014 Nicolas Tallefourtane | http://noder.io */ !function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";if(!Array.isArray){var n=Object.prototype.toString();Array.isArray=function(t){return"[object Array]"===n.call(t)?!0:"function"==typeof t.slice&&"number"==typeof t.length?!0:!1}}window.noder=r(2)},function(t,e,r){"use strict";function n(t){if(this._container=t||{},t&&"object"!=typeof t)throw new TypeError("Argument #1 passed to Collection must be an object")}var o=r(3);n.prototype.keys=function(){return Object.keys(this._container)},n.prototype.has=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.has() must be a string identifier, "+Object.prototype.toString(t)+" given");return t in this._container==!0},n.prototype.remove=function(t){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.remove() must be a string identifier");return delete this._container[t],this},n.prototype.set=function(t,e){if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.set() must be a string identifier");return this._container[t]=e,this},n.prototype.setAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.setAll() must be an object");return this._container=t,this},n.prototype.addAll=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addAll() must be an object");for(var e in t)this.set(e,t[e]);return this},n.prototype.addOnce=function(t,e,r){if(this.has(t)){if(r)return this;throw new Error("Identifier "+t+" passed to Collection.addOnce() is already defined")}return this.set(t,e)},n.prototype.addOnceAll=function(t,e){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.addOnceAll() must be an object");for(var r in t)this.addOnce(r,t[r],e);return this},n.prototype.merge=function(t){if("object"!=typeof t)throw new TypeError("Argument #1 passed to Collection.merge() must be an object");var e=Array.prototype.concat.apply([this._container],arguments);return this._container=o.mergeRecursive.apply(o,e),this},n.prototype.getAll=function(){return this._container},n.prototype.get=function(t,e,r){return"function"==typeof this._container[t]?this._container[t]():this.has(t)?this._container[t]:"function"==typeof e?this.raw(t,e,r)():this.raw(t,e,r)},n.prototype.raw=function(t,e,r){if(this.has(t))return this._container[t];if(r)throw new Error("Identifier "+t+" is not defined");return e},n.prototype.inject=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.raw(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.raw(t))},n.prototype.invoke=function(t,e){if(Array.isArray(t)){for(var r in t)t[r]=this.get(t[r]);return e.apply(null,t)}return"function"==typeof t?t(this._container):e(this.get(t))},n.prototype.apply=function(t){if(arguments.length>1){var e=Array.prototype.slice.call(arguments,1);return t.apply(this._container,e)}return t.call(this._container)},n.prototype.wrap=function(t){return function(){return t}},n.prototype.singleton=function(t,e){var r,n;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.singleton() must be a string identifier");if("function"!=typeof e)throw new TypeError("Argument #2 passed to Collection.singleton() must be a function");return this._container[t]=function(){return r||(r=!0,n=arguments.length?e.apply(null,arguments):e()),n},this},n.prototype.provider=function(t,e,r){var n,o,i=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.provider() must be a string identifier");return this._container[t]=function(){return n||(n=!0,o=i.inject(e,r)),o},this},n.prototype.factory=function(t,e,r){var n,o,i=this;if("string"!=typeof t)throw new TypeError("Argument #1 passed to Collection.factory() must be a string identifier");return this._container[t]=function(){return n||(n=!0,o=i.invoke(e,r)),o},this},t.exports=n},function(t,e,r){"use strict";function n(){this.$di=new n.prototype.$di,this.$di.addAll({$api:this,$di:this.$di,$container:this.$di._container,$invoke:this.$wrap(this.$invoke),$inject:this.$wrap(this.$inject),$provider:this.$wrap(this.$provider),$factory:this.$wrap(this.$factory),$singleton:this.$wrap(this.$singleton),$apply:this.$wrap(this.$apply),$wrap:this.$wrap(this.$wrap)})}var o=r(1),i={};n.prototype.Noder=n,n.prototype.$di=o,n.prototype.Collection=o,n.prototype.createCollection=function(t){return t?new this.Collection(t):new this.Collection},n.prototype.createNoder=function(){return new this.Noder},n.prototype.use=function(t){var e=function(t,e){if("function"!=typeof t.__noder)throw new TypeError("Argument #1 passed to Noder.use() is not a valid plugin for Noder.io.A plugin must implement a method named `__noder()` that is used for initialization. Example: `module.exports.__noder = function MyPlugin(noder) {\n // here, the bootstrap\n};`\n\nAPI doc: http://noder.io/api/noder.html#use");t=t.__noder,e.length>1?t.apply(null,Array.prototype.concat.apply([this],Array.prototype.slice.call(e,1))):t(this)}.bind(this);return"string"==typeof t?e(r(4)(t),arguments):e(t,arguments),this},n.prototype.$invoke=function(t,e){return this.$di.invoke(t,e)},n.prototype.$inject=function(t,e){return this.$di.inject(t,e)},n.prototype.$provider=function(t,e,r){return this.$di.provider(t,e,r),this},n.prototype.$factory=function(t,e,r){return this.$di.factory(t,e,r),this},n.prototype.$singleton=function(t,e){return this.$di.singleton(t,e),this},n.prototype.$apply=function(t){return this.$di.apply(t)},n.prototype.$wrap=function(t){return this.$di.wrap(t)},n.prototype.$require=function(t,e,n){var o,s=this;return n=n||this,Object.defineProperty(n,t,{enumerable:!0,configurable:!1,get:function(){return"undefined"!=typeof o?o:s.$require.isLoaded(t,n)?o:(e||(e=t),o="function"==typeof e?e.call(s.$di._container):r(4)(e),i[t]||(i[t]=[]),i[t].push(n),o)},set:function(){throw new Error('"'+t+'" property is not writable because is a placeholder of a property of a lazy loading module.')}}),this},n.prototype.$require.isLoaded=function(t,e){return e?i[t]?(e=e||this,-1!==i[t].indexOf(e)):!1:i[t]?!0:!1},t.exports=new n},function(t){"use strict";function e(t,e){if(t&&e)for(var r in e)t[r]=e[r];return t}function r(t){var e=arguments.length;if(2>e)throw new Error("There should be at least 2 arguments passed to utils.mergeRecursive()");for(var n=1;e>n;n++)for(var o in arguments[n])t[o]=t[o]&&"object"==typeof t[o]?r(t[o],arguments[n][o]):arguments[n][o];return t}t.exports.merge=e,t.exports.mergeRecursive=r},function(t,e,r){function n(t){return r(o(t))}function o(t){return i[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var i={"./collection":1,"./collection.js":1,"./index":2,"./index.js":2,"./utils":3,"./utils.js":3};n.keys=function(){return Object.keys(i)},n.resolve=o,t.exports=n}]);