"use strict";(self.webpackChunkWebComponents=self.webpackChunkWebComponents||[]).push([[442],{76442:(t,e,i)=>{i.r(e),i.d(e,{TabbedStuff:()=>n});var a=i(78673),s={};class n extends a.A{constructor(t){super(t);var e=t.orig;this.origElem=e,this.divid=e.id,this.inactive=e.hasAttribute("data-inactive"),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++){const e=this.origElem.childNodes[t];e.nodeType===Node.ELEMENT_NODE&&"tab"===e.dataset.component&&this.childTabs.push(e)}}findActiveTab(){for(var t=0;t<this.childTabs.length;t++)this.childTabs[t].hasAttribute("data-active")&&(this.activeTab=t)}createTabContainer(){this.containerDiv=document.createElement("div"),this.containerDiv.id=this.divid;const t=this.origElem.getAttribute("class");t&&this.containerDiv.classList.add(...t.split(" ").filter(Boolean)),this.containerDiv.setAttribute("role","tabpanel"),this.tabsUL=document.createElement("ul"),this.tabsUL.id=this.divid+"_tab",this.tabsUL.classList.add("nav","nav-tabs"),this.tabsUL.setAttribute("role","tablist"),this.tabContentDiv=document.createElement("div"),this.tabContentDiv.classList.add("tab-content"),this.createTabs(),this.containerDiv.appendChild(this.tabsUL),this.containerDiv.appendChild(this.tabContentDiv),this.origElem.replaceWith(this.containerDiv)}createTabs(){for(var t=0;t<this.childTabs.length;t++){var e=document.createElement("li");e.setAttribute("role","presentation"),e.setAttribute("aria-controls",this.divid+"-"+t);var i=document.createElement("a");i.setAttribute("href","#"+this.divid+"-"+t),i.setAttribute("role","tab"),i.addEventListener("click",this.handleTabClick(t));var a=document.createElement("span");a.textContent=this.childTabs[t].dataset.tabname,i.appendChild(a),e.appendChild(i),this.tabsUL.appendChild(e);var s=document.createElement("div");s.id=this.divid+"-"+t,s.classList.add("tab-pane"),s.setAttribute("role","tabpanel"),s.appendChild(this.childTabs[t]),this.inactive||this.activeTab===t&&(e.classList.add("active"),s.classList.add("active")),this.togglesList.push(i),this.tabContentDiv.appendChild(s)}}handleTabClick(t){return e=>{e.preventDefault(),this.showTab(t)}}showTab(t){for(const t of this.tabsUL.children)t.classList.remove("active");for(const t of this.tabContentDiv.children)t.classList.remove("active");this.tabsUL.children[t].classList.add("active");const e=this.tabContentDiv.children[t];e.classList.add("active");for(const t of e.querySelectorAll(".disqus_thread_link"))t.click();for(const t of e.querySelectorAll(".CodeMirror"))t.CodeMirror.refresh()}}function d(){for(const t of document.querySelectorAll("[data-component=tabbedStuff]"))s[t.id]=new n({orig:t})}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",d):d()}}]);
//# sourceMappingURL=442.c5b39f87e637839b.js.map