text: YUI.add("tabview",function(d,e){var t=d.Base.create("tabView",d.Widget,[d.WidgetParent],{_afterChildAdded:function(){this.get("contentBox").focusManager.refresh()},_defListNodeValueFn:function(){var e=d.Node.create(this.LIST_TEMPLATE);return e.addClass(d.TabviewBase._classNames.tabviewList),e},_defPanelNodeValueFn:function(){var e=d.Node.create(this.PANEL_TEMPLATE);return e.addClass(d.TabviewBase._classNames.tabviewPanel),e},_afterChildRemoved:function(e){var e=e.index,t=this.get("selection");t||(t=this.item(e-1)||this.item(0))&&t.set("selected",1),this.get("contentBox").focusManager.refresh()},_initAria:function(e){e=e.one(d.TabviewBase._queries.tabviewList);e&&e.setAttrs({role:"tablist"})},bindUI:function(){this.get("contentBox").plug(d.Plugin.NodeFocusManager,{descendants:"."+d.TabviewBase._classNames.tabLabel,keys:{next:"down:39",previous:"down:37"},circular:!0}),this.after("render",this._setDefSelection),this.after("addChild",this._afterChildAdded),this.after("removeChild",this._afterChildRemoved)},renderUI:function(){var e=this.get("contentBox");this._renderListBox(e),this._renderPanelBox(e),this._childrenContainer=this.get("listNode"),this._renderTabs(e),this._initAria(e)},_setDefSelection:function(){var t=this.get("selection")||this.item(0);this.some(function(e){if(e.get("selected"))return t=e,!0}),t&&(this.set("selection",t),t.set("selected",1))},_renderListBox:function(e){var t=this.get("listNode");t.inDoc()||e.append(t)},_renderPanelBox:function(e){var t=this.get("panelNode");t.inDoc()||e.append(t)},_renderTabs:function(e){var a=d.TabviewBase._classNames,t=d.TabviewBase._queries,n=e.all(t.tab),i=this.get("panelNode")?this.get("panelNode").get("children"):null,s=this;n&&(n.addClass(a.tab),e.all(t.tabLabel).addClass(a.tabLabel),e.all(t.tabPanel).addClass(a.tabPanel),n.each(function(e,t){t=i?i.item(t):null;s.add({boundingBox:e,contentBox:e.one("."+a.tabLabel),panelNode:t})}))}},{ATTRS:{defaultChildType:{value:"Tab"},listNode:{setter:function(e){return(e=d.one(e))&&e.addClass(d.TabviewBase._classNames.tabviewList),e},valueFn:"_defListNodeValueFn"},panelNode:{setter:function(e){return(e=d.one(e))&&e.addClass(d.TabviewBase._classNames.tabviewPanel),e},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null}},HTML_PARSER:{listNode:function(e){return e.one(d.TabviewBase._queries.tabviewList)},panelNode:function(e){return e.one(d.TabviewBase._queries.tabviewPanel)}},LIST_TEMPLATE:"<ul></ul>",PANEL_TEMPLATE:"<div></div>"});t.prototype.LIST_TEMPLATE=t.LIST_TEMPLATE,t.prototype.PANEL_TEMPLATE=t.PANEL_TEMPLATE,d.TabView=t,d.Tab=d.Base.create("tab",d.Widget,[d.WidgetChild],{BOUNDING_TEMPLATE:"<li></li>",CONTENT_TEMPLATE:"<a></a>",PANEL_TEMPLATE:"<div></div>",_uiSetSelectedPanel:function(e){this.get("panelNode").toggleClass(d.TabviewBase._classNames.selectedPanel,e)},_afterTabSelectedChange:function(e){this._uiSetSelectedPanel(e.newVal)},_afterParentChange:function(e){e.newVal?this._add():this._remove()},_initAria:function(){var e=this.get("contentBox"),t=e.get("id"),a=this.get("panelNode");t||(t=d.guid(),e.set("id",t)),e.set("role","tab"),e.get("parentNode").set("role","presentation"),a.setAttrs({role:"tabpanel","aria-labelledby":t})},syncUI:function(){var e=d.TabviewBase._classNames;this.get("boundingBox").addClass(e.tab),this.get("contentBox").addClass(e.tabLabel),this.set("label",this.get("label")),this.set("content",this.get("content")),this._uiSetSelectedPanel(this.get("selected"))},bindUI:function(){this.after("selectedChange",this._afterTabSelectedChange),this.after("parentChange",this._afterParentChange)},renderUI:function(){this._renderPanel(),this._initAria()},_renderPanel:function(){this.get("parent").get("panelNode").appendChild(this.get("panelNode"))},_add:function(){var e=this.get("parent").get("contentBox"),t=e.get("listNode"),e=e.get("panelNode");t&&t.appendChild(this.get("boundingBox")),e&&e.appendChild(this.get("panelNode"))},_remove:function(){this.get("boundingBox").remove(),this.get("panelNode").remove()},_onActivate:function(e){e.target===this&&(e.domEvent.preventDefault(),e.target.set("selected",1))},initializer:function(){this.publish(this.get("triggerEvent"),{defaultFn:this._onActivate})},_defLabelGetter:function(){return this.get("contentBox").getHTML()},_defLabelSetter:function(e){var t=this.get("contentBox");return t.getHTML()!==e&&t.setHTML(e),e},_defContentSetter:function(e){var t=this.get("panelNode");return t.getHTML()!==e&&t.setHTML(e),e},_defContentGetter:function(){return this.get("panelNode").getHTML()},_defPanelNodeValueFn:function(){var e,t=d.TabviewBase._classNames,a=this.get("contentBox").get("href")||"",n=this.get("parent"),i=a.indexOf("#");return"#"===(a=a.substr(i)).charAt(0)&&(e=d.one(a))&&e.addClass(t.tabPanel),(e=!e&&n?n.get("panelNode").get("children").item(this.get("index")):e)||(e=d.Node.create(this.PANEL_TEMPLATE)).addClass(t.tabPanel),e}},{ATTRS:{triggerEvent:{value:"click"},label:{setter:"_defLabelSetter",getter:"_defLabelGetter"},content:{setter:"_defContentSetter",getter:"_defContentGetter"},panelNode:{setter:function(e){return(e=d.one(e))&&e.addClass(d.TabviewBase._classNames.tabPanel),e},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null,validator:"_validTabIndex"}},HTML_PARSER:{selected:function(){return this.get("boundingBox").hasClass(d.TabviewBase._classNames.selectedTab)?1:0}}})},"@VERSION@",{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0});