YUI.add("event-custom-complex",function(f,t){var p,e,a=f.Object,s={},i=f.CustomEvent.prototype,n=f.EventTarget.prototype;for(e in f.EventFacade=function(t,e){this._event=t=t||s,this.details=t.details,this.type=t.type,this._type=t.type,this.target=t.target,this.currentTarget=e,this.relatedTarget=t.relatedTarget},f.mix(f.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(t){this._event.halt(t),this.prevented=1,this.stopped=t?2:1}}),i.fireComplex=function(t){var e,a,s,i,n,r,p,o,u,d,h,l=!0,c=this,g=c.host||c,b=c.stack,v=g._yuievt;if(b&&c.queuable&&c.type!==b.next.type)return b.queue||(b.queue=[]),b.queue.push([c,t]),!0;if(h=c.hasSubs()||v.hasTargets||c.broadcast,c.target=c.target||g,c.currentTarget=g,c.details=t.concat(),h){if(e=b||{id:c.id,next:c,silent:c.silent,stopped:0,prevented:0,bubbling:null,type:c.type,defaultTargetOnly:c.defaultTargetOnly},b=(h=c.getSubs())[0],h=h[1],c.stopped=c.type!==e.type?0:e.stopped,c.prevented=c.type!==e.type?0:e.prevented,c.stoppedFn&&(d=new f.EventTarget({fireOnce:!0,context:g}),(c.events=d).on("stopped",c.stoppedFn)),c._facade=null,a=c._createFacade(t),b&&c._procSubs(b,t,a),c.bubbles&&g.bubble&&!c.stopped&&(d=e.bubbling,e.bubbling=c.type,e.type!==c.type&&(e.stopped=0,e.prevented=0),l=g.bubble(c,t,null,e),c.stopped=Math.max(c.stopped,e.stopped),c.prevented=Math.max(c.prevented,e.prevented),e.bubbling=d),c.prevented?(b=c.preventedFn)&&b.apply(g,t):!(o=c.defaultFn)||(c.defaultTargetOnly||e.defaultTargetOnly)&&g!==a.target||o.apply(g,t),c.broadcast&&c._broadcast(t),h&&!c.prevented&&c.stopped<2)if(r=e.afterQueue,e.id===c.id||c.type!==v.bubbling){if(c._procSubs(h,t,a),r)for(;u=r.last();)u()}else p=h,e.execDefaultCnt&&(p=f.merge(p),f.each(p,function(t){t.postponed=!0})),r||(e.afterQueue=new f.Queue),e.afterQueue.add(function(){c._procSubs(p,t,a)});if(c.target=null,e.id===c.id){if(i=e.queue)for(;i.length;)n=(s=i.pop())[0],(e.next=n)._fire(s[1]);c.stack=null}l=!c.stopped,c.type!==v.bubbling&&(e.stopped=0,e.prevented=0,c.stopped=0,c.prevented=0)}else(o=c.defaultFn)&&(a=c._createFacade(t),c.defaultTargetOnly&&g!==a.target||o.apply(g,t));return c._facade=null,l},i._hasPotentialSubscribers=function(){return this.hasSubs()||this.host._yuievt.hasTargets||this.broadcast},i._createFacade=i._getFacade=function(t){var e=this.details,e=e&&e[0],a=e&&"object"==typeof e,s=(s=this._facade)||new f.EventFacade(this,this.currentTarget);if(a){var i,n=s,r=e;for(i in r)p.hasOwnProperty(i)||(n[i]=r[i]);e.type&&(s.type=e.type),t&&(t[0]=s)}else t&&t.unshift(s);return s.details=this.details,s.target=this.originalTarget||this.target,s.currentTarget=this.currentTarget,s.stopped=0,s.prevented=0,this._facade=s,this._facade},i._addFacadeToArgs=function(t){var e=t[0];e&&e.halt&&e.stopImmediatePropagation&&e.stopPropagation&&e._event||this._createFacade(t)},i.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},i.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},i.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},i.halt=function(t){t?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},n.addTarget=function(t){var e=this._yuievt;return e.targets||(e.targets={}),e.targets[f.stamp(t)]=t,e.hasTargets=!0,this},n.getTargets=function(){var t=this._yuievt.targets;return t?a.values(t):[]},n.removeTarget=function(t){var e=this._yuievt.targets;return e&&(delete e[f.stamp(t,!0)],0===a.size(e)&&(this._yuievt.hasTargets=!1)),this},n.bubble=function(t,e,a,s){var i,n,r,p,o,u,d=this._yuievt.targets,h=!0,l=t&&t.type,c=a||t&&t.target||this;if(!t||!t.stopped&&d)for(r in d)if(d.hasOwnProperty(r)){if(n=(i=d[r])._yuievt.events[l],(o=i._hasSiblings?i.getSibling(l,n):o)&&!n&&(n=i.publish(l)),u=i._yuievt.bubbling,i._yuievt.bubbling=l,n){if(o&&(n.sibling=o),n.target=c,n.originalTarget=c,n.currentTarget=i,p=n.broadcast,n.broadcast=!1,n.emitFacade=!0,n.stack=s,h=h&&n.fire.apply(n,e||t.details||[]),n.broadcast=p,n.originalTarget=null,n.stopped)break}else i._yuievt.hasTargets&&i.bubble(t,e,c,s);i._yuievt.bubbling=u}return h},n._hasPotentialSubscribers=function(t){var e=this._yuievt,t=e.events[t];return!!t&&(t.hasSubs()||e.hasTargets||t.broadcast)},i=new f.EventFacade,p={},i)p[e]=!0},"patched-v3.18.3",{requires:["event-custom-base"]});