!function(){var moduleFactory=function($){var module=this,jQuery=$;$.require().script("ui/core","ui/widget").stylesheet("ui/accordion").done(function(){var exports=function(){!function($){var uid=0,hideProps={},showProps={},showPropsAdjust={};hideProps.height=hideProps.paddingTop=hideProps.paddingBottom=hideProps.borderTopWidth=hideProps.borderBottomWidth="hide",showProps.height=showProps.paddingTop=showProps.paddingBottom=showProps.borderTopWidth=showProps.borderBottomWidth="show",$.extend(showPropsAdjust,showProps,{accordionHeight:"show"}),$.fx.step.accordionHeight=function(fx){var elem=$(fx.elem),data=elem.data("ui-accordion-height");
elem.height(data.total-elem.outerHeight()-data.toHide.outerHeight()+elem.height())},$.widget("ui.accordion",{version:"1.9.0pre",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var accordionId=this.accordionId="ui-accordion-"+(this.element.attr("id")||++uid),options=this.options;this.prevShow=this.prevHide=$(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),options.collapsible||options.active!==!1||(options.active=0),options.active<0&&(options.active+=this.headers.length),this.active=this._findActive(options.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.originalHeight=this.element[0].style.height,this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(i){var header=$(this),headerId=header.attr("id"),panel=header.next(),panelId=panel.attr("id");
headerId||(headerId=accordionId+"-header-"+i,header.attr("id",headerId)),panelId||(panelId=accordionId+"-panel-"+i,panel.attr("id",panelId)),header.attr("aria-controls",panelId),panel.attr("aria-labelledby",headerId)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(options.event)
},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():$()}},_createIcons:function(){var icons=this.options.icons;icons&&($("<span>").addClass("ui-accordion-header-icon ui-icon "+icons.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(icons.header).addClass(icons.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()
},_destroy:function(){var contents;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),contents=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")
}),"content"!==this.options.heightStyle&&(this.element.css("height",this.originalHeight),contents.css("height",""))},_setOption:function(key,value){return"active"===key?(this._activate(value),void 0):("event"===key&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(value)),this._super(key,value),"collapsible"!==key||value||this.options.active!==!1||this._activate(0),"icons"===key&&(this._destroyIcons(),value&&this._createIcons()),"disabled"===key&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!value),void 0)
},_keydown:function(event){if(!event.altKey&&!event.ctrlKey){var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),toFocus=!1;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event);break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1]
}toFocus&&($(event.target).attr("tabIndex",-1),$(toFocus).attr("tabIndex",0),toFocus.focus(),event.preventDefault())}},_panelKeyDown:function(event){event.keyCode===$.ui.keyCode.UP&&event.ctrlKey&&$(event.currentTarget).prev().focus()},refresh:function(){var maxHeight,overflow,heightStyle=this.options.heightStyle,parent=this.element.parent();this.element.css("height",this.originalHeight),"fill"===heightStyle?($.support.minHeight||(overflow=parent.css("overflow"),parent.css("overflow","hidden")),maxHeight=parent.height(),this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");
"absolute"!==position&&"fixed"!==position&&(maxHeight-=elem.outerHeight(!0))}),overflow&&parent.css("overflow",overflow),this.headers.each(function(){maxHeight-=$(this).outerHeight(!0)}),this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(this).height()))}).css("overflow","auto")):"auto"===heightStyle&&(maxHeight=0,this.headers.next().each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height())}).height(maxHeight)),"content"!==heightStyle&&this.element.height(this.element.height())
},_activate:function(index){var active=this._findActive(index)[0];active!==this.active[0]&&(active=active||this.active[0],this._eventHandler({target:active,currentTarget:active,preventDefault:$.noop}))},_findActive:function(selector){return"number"==typeof selector?this.headers.eq(selector):$()},_setupEvents:function(event){var events={};event&&($.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler"}),this._on(this.headers,events))},_eventHandler:function(event){var options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,newPanel:toShow};
event.preventDefault(),clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,eventData)===!1||(options.active=collapsing?!1:this.headers.index(clicked),this.active=clickedIsActive?$():clicked,this._toggle(eventData),active.removeClass("ui-accordion-header-active ui-state-active"),options.icons&&active.children(".ui-accordion-header-icon").removeClass(options.icons.activeHeader).addClass(options.icons.header),clickedIsActive||(clicked.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),options.icons&&clicked.children(".ui-accordion-header-icon").removeClass(options.icons.header).addClass(options.icons.activeHeader),clicked.next().addClass("ui-accordion-content-active")))
},_toggle:function(data){var toShow=data.newPanel,toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=toShow,this.prevHide=toHide,this.options.animate?this._animate(toShow,toHide,data):(toHide.hide(),toShow.show(),this._toggleComplete(data)),toHide.attr({"aria-expanded":"false","aria-hidden":"true"}),toHide.prev().attr("aria-selected","false"),toShow.length&&toHide.length?toHide.prev().attr("tabIndex",-1):toShow.length&&this.headers.filter(function(){return 0===$(this).attr("tabIndex")
}).attr("tabIndex",-1),toShow.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(toShow,toHide,data){var total,easing,duration,that=this,down=toShow.length&&(!toHide.length||toShow.index()<toHide.index()),animate=this.options.animate||{},options=down&&animate.down||animate,complete=function(){toShow.removeData("ui-accordion-height"),that._toggleComplete(data)};return"number"==typeof options&&(duration=options),"string"==typeof options&&(easing=options),easing=easing||options.easing||animate.easing,duration=duration||options.duration||animate.duration,toHide.length?toShow.length?(total=toShow.show().outerHeight(),toHide.animate(hideProps,duration,easing),toShow.hide().data("ui-accordion-height",{total:total,toHide:toHide}).animate("content"===this.options.heightStyle?showProps:showPropsAdjust,duration,easing,complete),void 0):toHide.animate(hideProps,duration,easing,complete):toShow.animate(showProps,duration,easing,complete)
},_toggleComplete:function(data){var toHide=data.oldPanel;toHide.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),toHide.length&&(toHide.parent()[0].className=toHide.parent()[0].className),this._trigger("activate",null,data)}}),$.uiBackCompat!==!1&&(function($,prototype){$.extend(prototype.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var _create=prototype._create;prototype._create=function(){if(this.options.navigation){var that=this,headers=this.element.find(this.options.header),content=headers.next(),current=headers.add(content).find("a").filter(this.options.navigationFilter)[0];
current&&headers.add(content).each(function(index){return $.contains(this,current)?(that.options.active=Math.floor(index/2),!1):void 0})}_create.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function($,prototype){$.extend(prototype.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var _create=prototype._create,_setOption=prototype._setOption;$.extend(prototype,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),_create.call(this)},_setOption:function(key){("autoHeight"===key||"clearStyle"===key||"fillSpace"===key)&&(this.options.heightStyle=this._mergeHeightStyle()),_setOption.apply(this,arguments)
},_mergeHeightStyle:function(){var options=this.options;return options.fillSpace?"fill":options.clearStyle?"content":options.autoHeight?"auto":void 0}})}(jQuery,jQuery.ui.accordion.prototype),function($,prototype){$.extend(prototype.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var _createIcons=prototype._createIcons;prototype._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),_createIcons.call(this)
}}(jQuery,jQuery.ui.accordion.prototype),function($,prototype){prototype.activate=prototype._activate;var _findActive=prototype._findActive;prototype._findActive=function(index){return-1===index&&(index=!1),index&&"number"!=typeof index&&(index=this.headers.index(this.headers.filter(index)),-1===index&&(index=!1)),_findActive.call(this,index)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function($,prototype){$.extend(prototype.options,{change:null,changestart:null});
var _trigger=prototype._trigger;prototype._trigger=function(type,event,data){var ret=_trigger.apply(this,arguments);return ret?("beforeActivate"===type?ret=_trigger.call(this,"changestart",event,{oldHeader:data.oldHeader,oldContent:data.oldPanel,newHeader:data.newHeader,newContent:data.newPanel}):"activate"===type&&(ret=_trigger.call(this,"change",event,{oldHeader:data.oldHeader,oldContent:data.oldPanel,newHeader:data.newHeader,newContent:data.newPanel})),ret):!1}}(jQuery,jQuery.ui.accordion.prototype),function($,prototype){$.extend(prototype.options,{animate:null,animated:"slide"});
var _create=prototype._create;prototype._create=function(){var options=this.options;null===options.animate&&(options.animate=options.animated?"slide"===options.animated?300:"bounceslide"===options.animated?{duration:200,down:{easing:"easeOutBounce",duration:1e3}}:options.animated:!1),_create.call(this)}}(jQuery,jQuery.ui.accordion.prototype))}(jQuery)};exports(),module.resolveWith(exports)})};dispatch("ui/accordion").containing(moduleFactory).to("Foundry/2.1 Modules")}();