ecl
Version:
Evented Components Library
1 lines • 4.41 kB
JavaScript
!function t(e,n,r){function i(s,u){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!u&&c)return c(s,!0);if(o)return o(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){var r,i={}.hasOwnProperty;e.exports=r=function(){function t(t){var e,n;for(e in t)i.call(t,e)&&(n=t[e],this[e]=n);Object.defineProperty(this,"___runtime",{enumerable:!1,writable:!1,configurable:!1,value:(null!=t?t.___runtime:void 0)||{}})}return t}()},{}],2:[function(t,e,n){window.ecl=t(5)},{5:5}],3:[function(t,e,n){{var r,i=t(7);({}).hasOwnProperty}e.exports=r=function(t){function e(t,n){var r,i,o;r="string"==typeof t?{type:t}:t||{},"function"==typeof n&&(r.callback=n),e.__super__.constructor.call(this,r),this.timestamp===!0&&(i=Date.now(),o=("undefined"!=typeof performance&&null!==performance?performance.now():void 0)||0,this.timestamp=1e3*i+Math.floor(1e3*(o-Math.floor(o))))}return i(e,t),e.prototype.cancel=function(){return this.___runtime.cancel=!0,this},e.prototype.stop=function(){return this.___runtime.stop=!0,this},e.prototype.abort=function(){return this.aborted=!0,this},e}(t(1))},{1:1,7:7}],4:[function(t,e,n){{var r,i,o=t(7);({}).hasOwnProperty}r=t(3),e.exports=i=function(t){function e(){e.__super__.constructor.apply(this,arguments),this.listeners=[{},{}]}return o(e,t),e.prototype.addListener=function(t,e,n){var r,i,o,s;return null==n&&(n=!1),"object"==typeof t&&(i=t,t=i.type,e=i.listener,n=i.capture),(null!=(o=this.events)?o[t]:void 0)&&"function"==typeof e&&(r=null!=(s=this.listeners[n?1:0])?s[t]||(s[t]=[]):void 0,-1===r.indexOf(e)&&r.push(e)),this},e.prototype.removeListener=function(t,e,n){var r,i,o,s;return null==n&&(n=!1),t instanceof Object&&(o=t,t=o.type,e=o.listener,n=o.capture),t&&"function"==typeof e&&(i=null!=(s=this.listeners[n?1:0])?s[t]:void 0)&&-1!==(r=i.indexOf(e))&&i.splice(r,1),this},e.prototype.dispatchEvent=function(t){var e,n,r,i,o,s,u,c;if(!((null!=t?t.aborted:void 0)||(null!=t?t.canceled:void 0))&&(c=null!=t?t.type:void 0)&&this.events[c]&&(o=t.phase,3>o&&o>0&&(i=null!=(s=this.listeners)?s[2-o][c]:void 0)))for(e=0,n=i.length;n>e&&(r=i[e],!((null!=(u=t.___runtime)?u.canceled:void 0)||t.aborted));e++)r.call(this,t);return this},e.prototype.broadcastEvent=function(t,e){var n,r,i,o,s,u,c,p;if((p=null!=t?t.type:void 0)&&(t.phase||0)<3&&!t.aborted&&!t.___runtime.stopped){if((n=t.___runtime).source||(n.source=this),s=t.phase||(t.phase=1),t.target===this&&(t.phase=2),1===t.phase&&(this.dispatchEvent(t),this.children))for(u=this.children,i=0,o=u.length;o>i&&(r=u[i],!t.aborted&&!t.___runtime.canceled);i++)r.broadcastEvent(t);t.target===this&&(t.phase=2),2===t.phase&&this.dispatchEvent(t),t.___runtime.source===this&&t.phase<4&&(null!=(c=t.callback)&&"function"==typeof c.call&&c.call(this,t),t.phase=4)}return this},e}(t(6))},{3:3,6:6,7:7}],5:[function(t,e,n){e.exports={Base:t(1),Node:t(6),Event:t(3),Evented:t(4)}},{1:1,3:3,4:4,6:6}],6:[function(t,e,n){{var r,i=t(7);({}).hasOwnProperty}e.exports=r=function(t){function e(){e.__super__.constructor.apply(this,arguments)}return i(e,t),e.prototype.appendChild=function(t){var e;return t!==this&&(this.children||(this.children=[]),-1===this.children.indexOf(t)&&(null!=(e=t.parent)&&"function"==typeof e.removeChild&&e.removeChild(t),t.parent=this,this.children.push(t))),this},e.prototype.removeChild=function(t){var e,n;return(null!=(n=this.children)?n.length:void 0)&&-1!==(e=this.children.indexOf(t))&&(delete t.parent,this.children.splice(e,1),0===this.children.length&&delete this.children),this},e}(t(1))},{1:1,7:7}],7:[function(t,e,n){var r=function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;e.exports=function(t,e){var n,o,s,u,c,p,l;if(e instanceof Array&&e.length)for(o=function(t){function n(){var t,r,i;for(n.__super__.constructor.apply(this,arguments),r=0,i=e.length;i>r;r++)t=e[r],t.apply(this,arguments)}return r(n,t),n}(e.shift()),s=0,c=e.length;c>s;s++){n=e[s],p=n.prototype;for(u in p)i.call(p,u)&&(l=p[u],"constructor"!==u&&(o.prototype[u]=l))}else o=e;return r(t,o)}},{}]},{},[2]);