(function(){Tracy=window.Tracy||{};Tracy.Toggle=Tracy.Toggle||{};Tracy.Toggle.init=function(){document.body.addEventListener("click",function(a){var d=Tracy.closest(a.target,".tracy-toggle");!d||(a.shiftKey||a.altKey||a.ctrlKey||a.metaKey)||Tracy.Toggle.toggle(d)});this.init=function(){}};Tracy.Toggle.toggle=function(a,d){var e=a.classList.contains("tracy-collapsed"),b=a.getAttribute("data-tracy-ref")||a.getAttribute("href",2),c=a;if("undefined"===typeof d)d=e;else if(!d===e)return;b&&"#"!==b?"#"===
b.substr(0,1)&&(c=document):b="+";b=b.match(/(\^\s*([^+\s]*)\s*)?(\+\s*(\S*)\s*)?(.*)/);c=b[1]?Tracy.closest(c.parentNode,b[2]):c;c=b[3]?Tracy.closest(c.nextElementSibling,b[4],"nextElementSibling"):c;c=b[5]?c.querySelector(b[5]):c;a.classList.toggle("tracy-collapsed",!d);c.classList.toggle("tracy-collapsed",!d);"function"===typeof window.Event?e=new Event("tracy-toggle",{bubbles:!0}):(e=document.createEvent("Event"),e.initEvent("tracy-toggle",!0,!1));a.dispatchEvent(e)};Tracy.Toggle.persist=function(a,
d){var e=[];a.addEventListener("tracy-toggle",function(a){0>e.indexOf(a.target)&&e.push(a.target)});var b=JSON.parse(sessionStorage.getItem("tracy-toggles-"+a.id));b&&!1!==d&&b.forEach(function(c){var b=a,d;for(d in c.path)if(!(b=b.children[c.path[d]]))return;b.textContent===c.text&&Tracy.Toggle.toggle(b,c.show)});window.addEventListener("unload",function(){b=[].map.call(e,function(c){var b={path:[],text:c.textContent,show:!c.classList.contains("tracy-collapsed")};do b.path.unshift([].indexOf.call(c.parentNode.children,
c)),c=c.parentNode;while(c&&c!==a);return b});sessionStorage.setItem("tracy-toggles-"+a.id,JSON.stringify(b))})};Tracy.closest=function(a,d,e){for(var b=a.matches||a.matchesSelector||a.msMatchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.oMatchesSelector;a&&d&&(1!==a.nodeType||!b.call(a,d));)a=a[e||"parentNode"];return a}})();