-
Notifications
You must be signed in to change notification settings - Fork 6
/
nbd.min.js
1 lines (1 loc) · 21.4 KB
/
nbd.min.js
1
define("nbd/util/mixin",[],function(){"use strict";return function(a,b){var c={};Object.keys(b).forEach(function(a){c[a]=Object.getOwnPropertyDescriptor(b,a)}),Object.defineProperties(a,c)}}),define("nbd/Class",["./util/mixin"],function(a){"use strict";var b,c,d,e=function(){},f=/xyz/.test(function(){return xyz})?/\b_super\b/:/.*/;return c=function(){for(var b=0;b<arguments.length;++b)a(this.prototype,arguments[b]);return this},d=function(a){var b,c=!1;if("function"==typeof a)return a.prototype.isPrototypeOf(this.prototype);if("object"==typeof a)for(b in a){if(a.hasOwnProperty(b)&&a[b]!==this.prototype[b])return!1;c=!0}return c},b=function(a,e){function g(a,b){var c=function(){return i[a].apply(this,arguments)};return function(){var a=this.hasOwnProperty("_super"),d=this._super;this._super=c;try{return b.apply(this,arguments)}catch(e){throw e}finally{a?this._super=d:delete this._super}}}function h(){var a,b=this instanceof h?this:Object.create(k);return"function"==typeof b.init?(a=b.init.apply(b,arguments),Object(a)===a?a:b):b}var i=this.prototype,j=function(a){h[a]=this[a]},k=Object.create(i);return a=a||{},e=e||{},Object.keys(a).forEach(function(b){var c=a[b];k[b]="function"==typeof c&&"function"==typeof i[b]&&f.test(c)?g(b,c):c}),Object.keys(this).forEach(j,this),Object.keys(e).forEach(j,e),h.prototype=k,Object.defineProperty(h.prototype,"constructor",{value:h}),Object.defineProperties(h,{extend:{value:b,enumerable:!1},mixin:{value:c},inherits:{value:d}}),h},e.extend=b,e}),define("nbd/util/async",[],function(){"use strict";function canUseNextTick(){return"object"==typeof process&&"[object process]"===Object.prototype.toString.call(process)}function canUseMessageChannel(){return!!global.MessageChannel}function canUsePostMessage(){if(!global.postMessage||global.importScripts)return!1;var a=!0,b=global.onmessage;return global.onmessage=function(){a=!1},global.postMessage("","*"),global.onmessage=b,a}function canUseReadyStateChange(){return"document"in global&&"onreadystatechange"in global.document.createElement("script")}function nextTickImplementation(){return function(){var a=tasks.addFromSetImmediateArguments(arguments);return process.nextTick(function(){tasks.runIfPresent(a)}),a}}function messageChannelImplementation(){var a=new global.MessageChannel;return a.port1.onmessage=function(a){var b=a.data;tasks.runIfPresent(b)},function(){var b=tasks.addFromSetImmediateArguments(arguments);return a.port2.postMessage(b),b}}function postMessageImplementation(){function a(a,b){return"string"==typeof a&&a.substring(0,b.length)===b}function b(b){if(b.source===global&&a(b.data,c)){var d=b.data.substring(c.length);tasks.runIfPresent(d)}}var c="async-message"+Math.random();return global.addEventListener?global.addEventListener("message",b,!1):global.attachEvent("onmessage",b),function(){var a=tasks.addFromSetImmediateArguments(arguments);return global.postMessage(c+a,"*"),a}}function readyStateChangeImplementation(){return function(){var a=tasks.addFromSetImmediateArguments(arguments),b=global.document.createElement("script");return b.onreadystatechange=function(){tasks.runIfPresent(a),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},global.document.documentElement.appendChild(b),a}}function setTimeoutImplementation(){return function(){var a=tasks.addFromSetImmediateArguments(arguments);return global.setTimeout(function(){tasks.runIfPresent(a)},0),a}}var global="undefined"!=typeof global?global:"undefined"!=typeof window?window:this,async,tasks=function(){function Task(a,b){this.handler=a,this.args=b}Task.prototype.run=function(){if("function"==typeof this.handler)this.handler.apply(void 0,this.args);else{var scriptSource=String(this.handler);eval(scriptSource)}};var nextHandle=1,tasksByHandle={},currentlyRunningATask=!1;return{addFromSetImmediateArguments:function(a){var b=a[0],c=Array.prototype.slice.call(a,1),d=new Task(b,c),e=nextHandle++;return tasksByHandle[e]=d,e},runIfPresent:function(a){if(currentlyRunningATask)global.setTimeout(function(){tasks.runIfPresent(a)},0);else{var b=tasksByHandle[a];if(b){currentlyRunningATask=!0;try{b.run()}finally{delete tasksByHandle[a],currentlyRunningATask=!1}}}},remove:function(a){delete tasksByHandle[a]}}}();return global.setImmediate?(async=global.setImmediate,async.clearImmediate=global.clearImmediate.bind(null)):(async=canUseNextTick()?nextTickImplementation():canUsePostMessage()?postMessageImplementation():canUseMessageChannel()?messageChannelImplementation():canUseReadyStateChange()?readyStateChangeImplementation():setTimeoutImplementation(),async.clearImmediate=tasks.remove),async}),define("nbd/util/extend",[],function(){"use strict";return function(a){var b,c,d;for(b=1;b<arguments.length;++b){d=arguments[b];for(c in d)a[c]=d[c]}return a}}),define("nbd/util/diff",["./extend"],function(a){"use strict";function b(a){var b;return a&&"object"==typeof a&&(b=Object.getPrototypeOf(a),b===Object.prototype||b===Array.prototype)}function c(a,e){var f,g=!0;if(!b(a)||!b(e))return!1;for(f in a)if(a[f]!==e[f]){if(b(a[f])&&a[f]&&b(e[f])&&e[f]){if(~d.indexOf(a[f]))continue;try{d.push(a[f]),g=g&&c(a[f],e[f])}catch(h){}finally{d.pop()}}else g=!1;if(!g)return g}for(f in e)if(!(f in a))return!1;return g}var d=[];return function(d,e,f){var g,h,i,j={};if(!b(d)||!b(e))throw new TypeError("Arguments must be objects");e=a({},e);for(g in d)if(d.hasOwnProperty(g)){if(h=d[g],i=e[g],delete e[g],h===i)continue;"object"==typeof h&&"object"==typeof i&&h&&i&&c(h,i)||(j[g]=[h,i],f&&f.call(this,g,h,i))}for(g in e)e.hasOwnProperty(g)&&void 0!==e[g]&&(j[g]=[d[g],e[g]],f&&f.call(this,g,void 0,e[g]));return j}}),define("nbd/util/curry",[],function(){"use strict";var a=Object.prototype.toString;return function(){var b=this,c=arguments,d=a.call(b);if("[object Function]"!==d)throw new TypeError("curry called on incompatible "+d);return function(){return Array.prototype.unshift.apply(arguments,c),b.apply(this,arguments)}}}),define("nbd/trait/pubsub",["../util/curry"],function(a){"use strict";var b=Array.prototype.slice,c=/\s+/,d=a.bind(function(a,d){if(null==d)return a.apply(this,b.call(arguments,1)),this;var e,f,g=b.call(arguments,2),h="object"==typeof d?Object.keys(d):[d],i=[];for(f=0;f<h.length;++f)for(e=h[f].split(c),"object"==typeof d&&(i[1]=d[h[f]]);i[0]=e.shift();)a.apply(this,i.concat(g));return this}),e=function(a,b,c,d){return this._events||Object.defineProperty(this,"_events",{configurable:!0,value:{},writable:!0}),this._events[a]=(this._events[a]||[]).concat({fn:b,ctxt:c,self:this,once:d}),this},f=function g(a){return g.i=g.i||0,(a||"")+ ++g.i};return{on:d(function(a,b,c){return b?e.call(this,a,b,c):this}),one:d(function(a,b,c){return b?e.call(this,a,b,c,!0):this}),off:d(function(a,b,c){function d(a){return b&&a.fn!==b||c&&a.ctxt!==c}var e,f,g;if(!(e=this._events))return this;if(!(a||b||c))return delete this._events,this;for(f=a?[a]:Object.keys(e),g=0;g<f.length;++g)(a=f[g])&&e[a]&&(e[a]=e[a].filter(d),e[a].length||delete e[a])}),trigger:d(function(a){if(!this._events)return this;var c,d,e=this._events[a],f=this._events.all,g=b.call(arguments,1);if(e)for(d=0;c=e[d];++d)c.once&&e.splice(d--,1),c.fn.apply(c.ctxt||c.self,g);if(f)for(d=0;c=f[d];++d)c.once&&f.splice(d--,1),c.fn.apply(c.ctxt||c.self,arguments);return this}),listenTo:function(a,b,c){var d=this._listeners||(this._listeners={}),e=a._listenerId||(a._listenerId=f("l"));return d[e]=a,a.on(b,c||this,this),this},listenOnce:function(a,b,c){var d=this._listeners||(this._listeners={}),e=a._listenerId||(a._listenerId=f("l"));return d[e]=a,a.one(b,c||this,this),this},stopListening:function(a,b,c){var d=this._listeners;if(!d)return this;if(a)a.off(b,c,this),b||c||delete d[a._listenerId];else{for(var e in d)d[e].off(null,null,this);this._listeners={}}return this},relay:function(a,b){b=b.split(c);var d;for(d=0;d<b.length;++d)"all"===b[d]&&this.listenTo(a,b[d],this.trigger),this.listenTo(a,b[d],this.trigger.bind(this,b[d]));return this}}}),define("nbd/Model",["./Class","./util/async","./util/extend","./util/diff","./trait/pubsub"],function(a,b,c,d,e){"use strict";function f(a){return null!=a&&"object"==typeof a?Array.isArray(a)?Array.prototype.slice.call(a):a.constructor===Object?c({},a):a:a}function g(a){return!(isNaN(a)||0!==a&&!a)}var h=function(a,b){this._dirty=0,d.call(this,b||this._data,a,this.trigger)},i=a.extend({init:function(a,b){g(a)&&(a=+a),void 0===b&&"object"==typeof a&&(b=a,a=void 0),this.get=this.get.bind(this),this.set=this.set.bind(this);try{Object.defineProperties(this,{_id:{value:a},_dirty:{value:0,writable:!0},_data:{enumerable:!1,configurable:!0,value:c({},this["default"],b),writable:!0}})}catch(d){this._dirty=0,this._data=b||{}}},destroy:function(){this.stopListening().off(),b.clearImmediate(this._dirty),this._data=null},id:function(){return this._id},data:function(){var a,c=this._data;return this._dirty||(a=Object.keys(c).reduce(function(a,b){return a[b]=f(c[b]),a},{}),this._dirty=b(h.bind(this,a))),this._data},get:function(a){var b=this._data[a];return Array.isArray(b)?this.data()[a]:b},set:function(a,b){var c,d=this.data();if("string"==typeof a)return d[a]=f(b),this;if("object"==typeof a){for(c in a)a.hasOwnProperty(c)&&(d[c]=f(a[c]));return this}},toJSON:function(){return this._data}},{displayName:"Model"}).mixin(e);return i}),define("nbd/View",["./Class","./trait/pubsub"],function(a,b){"use strict";var c=document.createDocumentFragment(),d=function(a){if(this.$view){var b=this.nests[a],c=this._model.get?this._model.get(a):this._model[a],d=this.constructor.find(this.$view,b);d&&c&&c.render&&c.render(d)}},e=a.extend({init:function(a){this._model=a||{},a&&"function"==typeof a.id&&(this.id=function(){return a.id()}),a&&a.on&&this.listenTo(this._model,"all",this._switchNested),this.on({prerender:function(){"function"==typeof this.prerender&&this.prerender()},postrender:function(a){this.nests&&Object.keys(this.nests).forEach(d,this),"function"==typeof this.rendered&&this.rendered(a),"function"==typeof this.postrender&&this.postrender(a)}})},destroy:function(){this.constructor.remove(this.$view),this.$view=null,this.off().stopListening()},template:function(){},templateData:function(){return this._model&&this._model.data?this._model.data():this._model},render:function(a){var b=this.$view,c=!(b&&a);return c&&(this.trigger("prerender",b),this.$view=this.constructor.domify(this.template(this.templateData()))),a?this.constructor.appendTo(this.$view,a):this.constructor.replace(b,this.$view),c&&this.trigger("postrender",this.$view),this.$view},_switchNested:function(a,b,e){null!=this.nests&&a in this.nests&&(e&&e.render&&e.render(c),d.call(this,a))}},{displayName:"View",domify:function(a){var b;return"string"==typeof a?(b=document.createElement("div"),b.innerHTML=a,b.removeChild(b.childNodes[0])):a},appendTo:function(a,b){return a&&b?a.appendTo?a.appendTo(b):(b.append||b.appendChild).call(b,a):void 0},find:function(a,b){return a?b?(a.find||a.querySelector).call(a,b):a:void 0},replace:function(a,b){return a?a.replaceWith?a.replaceWith(b):a.parentNode&&a.parentNode.replaceChild(b,a):void 0},remove:function(a){return a?a.remove?a.remove():a.parentNode&&a.parentNode.removeChild(a):void 0}}).mixin(b);return e}),define("nbd/View/Entity",["../View"],function(a){"use strict";return console.warn("nbd/View/Entity is deprecated. Use nbd/View"),a.extend()}),define("nbd/View/Element",["../View"],function(a){"use strict";var b=a.extend({$parent:null,init:function(a){this._super(),this.$parent=a},render:function(a){var b=this.$view;return this.trigger("prerender",b),this.$view=this.constructor.domify(this.template(a||this.templateData())),b?this.constructor.replace(b,this.$view):this.constructor.appendTo(this.$view,this.$parent),this.trigger("postrender",this.$view),this.$view}},{displayName:"View/Element"});return b}),define("nbd/util/construct",[],function(){"use strict";var a=Object.prototype.toString;return function(){if(!~a.call(this).indexOf("Function"))throw new TypeError("construct called on incompatible Object");var b=Object.create(this.prototype),c=this.apply(b,arguments);return Object(c)===c?c:b}}),define("nbd/Logger",["./Class","./trait/pubsub","./util/construct","./util/extend"],function(a,b,c){"use strict";var d=[],e={debug:!0,log:!0,info:!0,warn:!0,error:!0},f=a.extend({init:function(a){"string"==typeof a?this.name=a:this.container=a,this.levels.forEach(function(a){this[a]=this._log.bind(this,a)},this),Object.defineProperty(this,"level",{writable:!0,value:0}),this.hasOwnProperty("log")||(this.log=this[this.levels[0]])},destroy:function(){this.off(),this.container=null},levels:["debug","log","info","warn","error"],setLevel:function(a){var b;~(b=this.levels.indexOf(a))&&(this.level=b)},attach:function(a){this.on("all",a)},remove:function(a){this.off(null,a)},_log:function(a){var b,c;(b=this.levels.indexOf(a))<this.level||(c=Array.prototype.slice.call(arguments,1),this.trigger(this.levels[b],{context:this._name(),params:c}))},_name:function(){var a=this.container&&Object.getPrototypeOf(this.container).constructor;return this.name||a&&(a.displayName||a.name)}},{displayName:"Logger",get:function(a){var b=c.call(this,a);return b.attach(this.global),b},attach:function(a){"function"==typeof a&&d.push(a)},setLevel:function g(a,b){var c;if("string"==typeof a)e[a]="function"==typeof b?b:!!b;else if("object"==typeof a)for(c in a)g(c,a[c])},global:function(a,b){var c=e[a];return c=!!("function"==typeof c?c(b):c),c&&d.forEach(function(c){c(a,b)})},console:function(a,b){var c=b.params;return b.context&&(c=["%c"+b.context,"color:gray"].concat(c)),console[a]&&console[a].apply(console,c)}}).mixin(b);return f.attach(f.console),f}),define("nbd/Promise",["./util/async","./util/construct","./util/extend","./Logger"],function(a,b,c,d){"use strict";function e(b){function c(b,c){a(function(){for(var a=0;a<b.length;++a)b[a](c);m||-1!==l||h.warn("Unhandled rejection",c),j.length=k.length=0})}function d(a){l||(l=1,i=a,c(j,i))}function e(a){l||(l=-1,i=a,c(k,i),m|=k.length)}function g(a){if(a===b&&e(new TypeError("Cannot resolve with self")),f.isPromise(a))return void a.then(g,e);if(("object"==typeof a||"function"==typeof a)&&null!==a){var c,h=!1;try{c=a.then}catch(i){return void e(i)}if("function"==typeof c){try{c.call(a,function(b){h||((b===a?d:g)(b),h=!0)},function(a){h||(e(a),h=!0)})}catch(i){h||e(i)}return}}d(a)}var i,j=[],k=[],l=0,m=0;b.then=function(b,c){function d(a){return function(b){var c;try{c=a(b)}catch(d){e.reject(d)}e.resolve(c)}}var e=new f;if(l){var g=~l?b:c;"function"==typeof g?(g=d(g),m|=-1===l,a(function(){g(i)})):e[~l?"resolve":"reject"](i)}else j.push("function"==typeof b?d(b):e.resolve),k.push("function"==typeof c?d(c):e.reject);return e},Object.defineProperties(this,{fulfill:{enumerable:!0,value:d},reject:{enumerable:!0,value:e},resolve:{enumerable:!0,value:g}})}function f(a){if(!(this instanceof f))return new f(a);var b=new e(this);if("function"==typeof a)try{a(b.resolve,b.reject)}catch(c){b.reject(c)}else this.resolve=b.resolve,this.reject=b.reject}function g(a,b){return a.then(function(){return b})}var h=d.get("Promise"),i=Array.prototype.forEach;return c(f.prototype,{"catch":function(a){return this.then(void 0,a)},"finally":function(a){return this.then(a,a)},done:function(a,b){return this.then(a,b)["catch"](function(a){setTimeout(function(){throw a},0)})},spread:function(a,b){return this.then(function(b){return a.apply(this,b)},b)},get:function(a){return this.then(function(b){return b[a]})},set:function(a,b){return this.then(function(c){return c[a]=b,c})},"delete":function(a){return this.then(function(b){return delete b[a],b})},send:function(a){var b=Array.prototype.slice.call(arguments,1);return this.then(function(c){return c[a].apply(c,b)})},fcall:function(){var a=arguments;return this.then(function(b){return b.apply(void 0,a)})},thenable:function(){return{then:this.then}},promise:function(){var a=this.then,b=function(){return c},c={done:function(){return i.call(arguments,function(b){a(b)}),c},fail:function(){return i.call(arguments,function(b){a(void 0,b)}),c},always:function(){return i.call(arguments,function(b){a(b,b)}),c},then:a,progress:b,promise:b};return c}}),c(f,{from:function(a){return f.isPromise(a)?a:f.resolve(a)},resolve:function(a){return new this(function(b){b(a)})},reject:function(a){return new this(function(b,c){c(a)})},race:function(a){var b,c,d=new this(function(a,d){b=a,c=d});if(!arguments.length)throw new Error("Not enough arguments to Promise.race");return a.length?(Array.prototype.map.call(a,function(a){this.from(a).then(b,c)},this),d):(b(),d)},all:function(a){function b(a,b){h[a]=b}var c,d,e=new this(function(a,b){c=a,d=b}),h=[];if(!arguments.length)throw new Error("Not enough arguments to Promise.all");return a.length?(h.map.call(a,function(a,c){return f.from(a).then(b.bind(null,c))}).reduce(g).then(c.bind(null,h),d),e):(c(),e)},isPromise:function(a){return a instanceof f},isThenable:function(a){if(("object"==typeof a||"function"==typeof a)&&null!==a){var b=a.then;return"function"==typeof b}return!1}}),f}),define("nbd/Controller",["./util/construct","./Class","./View","./Model","./Promise","./trait/pubsub"],function(a,b,c,d,e,f){"use strict";var g=b.extend({init:function(){this._initModel.apply(this,arguments),this.requestView()},render:function(a,b){return this.requestView(b),new e(function(b){b(this._view.render(a))}.bind(this))},destroy:function(){this._view&&this._view.destroy(),this._model.destroy(),this._model=this._view=null,this.trigger("destroy").stopListening().off()},_initModel:function(){var b=this.Model||this.constructor.MODEL_CLASS;this._model=a.apply(b,arguments)},_initView:function(){var b=Array.prototype.shift.call(arguments);this._view=a.apply(b,arguments),this._view._controller=this},switchView:function(){var a=this._view;this._initView.apply(this,arguments),a&&(a.$view&&(this._view.$view=a.$view,this._view.render()),a.destroy&&a.destroy())},requestView:function(a){a=a||this.View||this.constructor.VIEW_CLASS,"string"==typeof a&&(a=this.constructor.VIEW_CLASS[a]),"function"!=typeof a||this._view instanceof a||this.switchView(a,this._model)},toJSON:function(){return this._model.toJSON()}},{displayName:"Controller",VIEW_CLASS:c,MODEL_CLASS:d}).mixin(f).mixin({get id(){return this._model.id()},get data(){return this._model.data()}});return g}),define("nbd/Controller/Entity",["../Controller"],function(a){"use strict";return console.warn("nbd/Controller/Entity is deprecated. Use nbd/Controller"),a.extend()}),define("nbd/util/media",["./extend","../trait/pubsub"],function(a,b){"use strict";function c(a,b){var c;(c=g[a])&&c.removeListener(c.listener),c=h(b),c.listener=f.bind(c,a),c.addListener(c.listener),g[a]=c,c.matches&&f.call(c,a)}function d(a){return g[a]&&g[a].matches}function e(a,b){if(!h)throw new Error("Media queries not supported.");return"string"==typeof a?(c(a,b),e):("object"==typeof a&&Object.keys(a).forEach(function(a){c(a,this[a])},a),e)}var f,g={},h="undefined"!=typeof matchMedia?matchMedia:"undefined"!=typeof msMatchMedia?msMatchMedia:null;return a(e,b),f=function(a){e.trigger(a+(this.matches?":enter":":exit")),e.trigger(a,this.matches)},e.is=d,e.getState=function(a){return a?d(a):Object.keys(g).filter(d)},e}),define("nbd/trait/responsive",["../util/media"],function(a){"use strict";return{requestView:function b(c){null==c&&"object"==typeof this.constructor.VIEW_CLASS&&(this._isMediaBound||(this.listenTo(a,"all",function(a,b){b&&this.requestView(a)})._isMediaBound=!0),a.getState().some(function(a){return this[a]&&(c=a)},this.constructor.VIEW_CLASS));var d=this,e=!1;do d=Object.getPrototypeOf(d),e=e||d.requestView===b;while(!e||d.requestView===b);d.requestView.call(this,c)}}}),define("nbd/Controller/Responsive",["./Entity","../trait/responsive"],function(a,b){"use strict";return console.warn("nbd/Controller/Responsive is deprecated. Use nbd/Controller with nbd/trait/responsive"),a.extend().mixin(b)}),define("nbd/trait/log",["../Logger"],function(a){"use strict";var b;try{b={get log(){return this._logger||Object.defineProperty(this,"_logger",{value:a.get()}),this._logger.container=this,this._logger}}}catch(c){b={log:a.get()}}return b}),define("nbd/trait/promise",["../Promise","../util/extend"],function(a,b){"use strict";var c=function(){return this._promise||Object.defineProperty(this,"_promise",{value:new a}),this._promise};return b(c,{then:function(a,b){return c.call(this).then(a,b)},"catch":function(a){return c.call(this)["catch"](a)},"finally":function(a){return c.call(this)["finally"](a)},resolve:function(a){return c.call(this).resolve(a),this},reject:function(a){return c.call(this).reject(a),this},thenable:function(){return c.call(this).thenable()},promise:function(){return c.call(this).promise()}})}),define("nbd/util/deparam",[],function(){"use strict";return function(a,b){var c={},d={"true":!0,"false":!1,"null":null};return a.replace(/\+/g," ").split("&").forEach(function(a){var e,f=a.split("="),g=decodeURIComponent(f[0]),h=c,i=0,j=g.split("]["),k=j.length-1;if(/\[/.test(j[0])&&/\]$/.test(j[k])?(j[k]=j[k].replace(/\]$/,""),j=j.shift().split("[").concat(j),k=j.length-1):k=0,2===f.length)if(e=decodeURIComponent(f[1]),b&&(e=e&&!isNaN(e)?+e:"undefined"===e?void 0:void 0!==d[e]?d[e]:e),k)for(i;k>=i;i++)g=""===j[i]?h.length:j[i],h=h[g]=k>i?h[g]||(j[i+1]&&isNaN(j[i+1])?{}:[]):e;else Array.isArray(c[g])?c[g].push(e):c[g]=void 0!==c[g]?[c[g],e]:e;else g&&(c[g]=b?void 0:"")}),c}}),define("nbd/util/pipe",[],function(){"use strict";return function(){var a=arguments;return function(){var b,c;for(b=0;b<a.length;++b)c=a[b].apply(this,0===b?arguments:[c]);return c}}}),define("nbd/util/throttle",[],function(){"use strict";return function(a){function b(){delete a._blocking}if(!a._blocking){a._blocking=!0;var c=a.apply(this,Array.prototype.slice.call(arguments,1));return c&&"function"==typeof c.then?c.then(b,b):delete a._blocking,c}}});