1!function(){var e=function(e){"use strict";var t=MoyaContainer.get("core.toggle"),n=0;MoyaContainer.register("ext.accordion",(function(){return{init:o.create,getStylesheetUrl:o.getStylesheetUrl}}));var o=function(){function e(){}return e.create=function(){return(new e).run()},e.getLocalThemePath=function(){var e="/static/themes/main";return Array.from(document.styleSheets).filter((function(e){return e.href&&-1!==e.href.indexOf("/static/themes")})).filter((function(e){return e.href&&-1!==e.href.indexOf("theme.css")})).map((function(e){return e.href})).forEach((function(t){e=t.substring(0,t.lastIndexOf("/")).replace(location.origin,"")})),e},e.getStylesheetUrl=function(){var t=e.getAccordionLayout();if(t)return"local"===t?e.getLocalThemePath()+"/accordion.css":"/static/local/ext-accordion/css/"+t+".css"},e.prototype.run=function(){var t=this;e.loadStyles().then((function(){t.createAccordions(),t.checkInitHash()}))},e.loadStyles=function(){var t=e.getStylesheetUrl();return t?MoyaLoader.css(t):Promise.resolve()},e.getAccordionLayout=function(){if(document.body.dataset.accordion)return document.body.dataset.accordion;var e="";return document.body.classList.forEach((function(t){t.startsWith("accordion")&&(e=t.replace("accordion-",""))})),e},e.prototype.createAccordions=function(){var t=this;document.querySelectorAll(".accordion:not(.ready)").forEach((function(n){var o=e.wrapTitleInButton(n),r=t.wrapContent(n);t.createToggle(o,r),t.fixNestedMaxHeight(r),n.classList.add("ready")}))},e.wrapTitleInButton=function(t){var n=t.querySelector("*:first-child"),o=document.createElement("button");return o.innerHTML=n.innerHTML,t.id="accordion-"+e.getAnchorIdFromTitle(o.innerText),n.innerHTML="",n.parentNode.insertBefore(o,n),n.remove(),o},e.prototype.wrapContent=function(e){var t=document.createElement("div");return t.classList.add("wrap"),t.id="accordion-"+ ++n,t.dataset.moyaComponent="core.max-height",MoyaComponents.run(t),this.wrapElements(e.querySelectorAll(":scope >*:not(:first-child)"),t),t},e.prototype.wrapElements=function(e,t){e&&e.length&&(e[0].parentNode.insertBefore(t,e[0]),e.forEach((function(e){return t.appendChild(e)})))},e.prototype.createToggle=function(o,r){t.create(o,r,"accordion"+n,{onOpen:function(t){t.getOpenElement().parentElement.classList.add("open"),e.updateHash(e.getAnchorIdFromTitle(o.innerText))},onClose:function(t){t.getOpenElement().parentElement.classList.remove("open"),e.updateHash("")},closeOnBodyClick:!1})},e.prototype.fixNestedMaxHeight=function(e){e.addEventListener("transitionend",(function(){window.dispatchEvent(new Event("resize"))}))},e.updateHash=function(e){history.replaceState(null,null,"#"+e)},e.getAnchorIdFromTitle=function(e){var t,n=e.trim().toLowerCase(),o={"á":"a","ð":"d","é":"e","Ã":"i","ó":"o","ú":"u","ý":"y","þ":"th","æ":"ae","ö":"o"};for(var r in o)t=new RegExp(r,"g"),n=n.replace(t,o[r]);return n.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-")},e.prototype.checkInitHash=function(){var e=this;document.querySelectorAll(".accordion").length&&(location.hash&&this.scrollToAccordion(location.hash),document.querySelectorAll('a[href*="#"]:not([href="#"])').forEach((function(t){t.addEventListener("click",(function(){location.pathname.replace(/^\//,"")===t.pathname.replace(/^\//,"")&&location.hostname===t.hostname&&e.scrollToAccordion(t.hash)}))})))},e.prototype.scrollToAccordion=function(e){var t,n=e.replace("#","#accordion-"),o=document.querySelector(n);if(o){var r=o.querySelector("button[aria-haspopup]");if(r){o.classList.contains("open")||r.click();var c=document.querySelector("header"),a=c?parseInt(null!=(t=c.dataset.offset)?t:"0"):0;setTimeout((function(){window.scrollTo({top:o.getBoundingClientRect().top+window.scrollY-a,behavior:"smooth"})}),200)}}},e}();return e.Accordion=o,e}({});"function"==typeof e&&e()}(); 2//# sourceMappingURL=accordion.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.