"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[442],{76442:(t,i,a)=>{a.r(i);var e=a(78673),s={};class n extends e.A{constructor(t){super(t);var i=t.orig;this.origElem=i,this.divid=i.id,this.inactive=!1,$(this.origElem).is("[data-inactive]")&&(this.inactive=!0),this.togglesList=[],this.childTabs=[],this.populateChildTabs(),this.activeTab=0,this.findActiveTab(),this.createTabContainer(),this.indicate_component_ready()}populateChildTabs(){for(var t=0;t<this.origElem.childNodes.length;t++)"tab"===$(this.origElem.childNodes[t]).data("component")&&this.childTabs.push(this.origElem.childNodes[t])}findActiveTab(){for(var t=0;t<this.childTabs.length;t++)$(this.childTabs[t]).is("[data-active]")&&(this.activeTab=t)}createTabContainer(){this.containerDiv=document.createElement("div"),this.containerDiv.id=this.divid,$(this.containerDiv).addClass(this.origElem.getAttribute("class")),$(this.containerDiv).attr({role:"tabpanel"}),this.tabsUL=document.createElement("ul"),this.tabsUL.id=this.divid+"_tab",$(this.tabsUL).addClass("nav nav-tabs"),$(this.tabsUL).attr({role:"tablist"}),this.tabContentDiv=document.createElement("div"),$(this.tabContentDiv).addClass("tab-content"),this.createTabs(),this.containerDiv.appendChild(this.tabsUL),this.containerDiv.appendChild(this.tabContentDiv),this.addCMD(),$(this.origElem).replaceWith(this.containerDiv)}createTabs(){for(var t=0;t<this.childTabs.length;t++){var i=document.createElement("li");$(i).attr({role:"presentation","aria-controls":this.divid+"-"+t});var a=document.createElement("a");$(a).attr({"data-toggle":"tab",href:"#"+this.divid+"-"+t,role:"tab"});var e=document.createElement("span");e.textContent=$(this.childTabs[t]).data("tabname"),a.appendChild(e),i.appendChild(a),this.tabsUL.appendChild(i);var s=document.createElement("div");s.id=this.divid+"-"+t,$(s).addClass("tab-pane"),$(s).attr({role:"tabpanel"}),s.appendChild(this.childTabs[t]),this.inactive||this.activeTab===t&&($(i).addClass("active"),$(s).addClass("active")),this.togglesList.push(a),this.tabContentDiv.appendChild(s)}}addCMD(){$(this.togglesList).on("shown.bs.tab",(function(t){var i=$(t.target.attributes.href.value);i.find(".disqus_thread_link").each((function(){$(this).click()})),i.find(".CodeMirror").each((function(t,i){i.CodeMirror.refresh()}))}))}}$("load",(function(){$("[data-component=tabbedStuff]").each((function(t){s[this.id]=new n({orig:this})}))}))}}]);
//# sourceMappingURL=442.js.map