/* ======================================================================== * Version: 5.2.1 * Copyright (c) 2022, 2023 Jon Gunderson; Licensed BSD * Copyright (c) 2021 PayPal Accessibility Team and University of Illinois; Licensed BSD * All rights reserved. * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of PayPal or any of its subsidiaries or affiliates, nor the name of the University of Illinois, nor the names of any other contributors contributors may be used to endorse or promote products derived from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Documenation: https://skipto-landmarks-headings.github.io/page-script-5 * Code: https://github.com/skipto-landmarks-headings/page-script-5 * Report Issues: https://github.com/skipto-landmarks-headings/page-script-5/issues * ======================================================================== */ !function(){"use strict";class e{constructor(...e){this._flag=!1,this._label="debug";for(const[t,n]of e.entries())if(t<2)switch(typeof n){case"boolean":this._flag=n;break;case"string":this._label=n}}get flag(){return this._flag}set flag(e){"boolean"==typeof e&&(this._flag=e)}get label(){return this._label}set label(e){"string"==typeof e&&(this._label=e)}log(e,t){const n=t?"\n":"";console.log(`${n}[${this._label}] ${e}`)}tag(e,t){if(e&&e.tagName){const n=e.textContent.trim().replace(/\s+/g," ");this.log(`[${e.tagName}]: ${n.substring(0,40)}`,t)}}separator(e){this.log("-----------------------------",e)}}new e("style",!1).flag=!1;const t=document.createElement("template");function n(e,t){if("object"==typeof e[t])return e[t];let n="",o="",i="";const s=new URL(location.href).hostname,r=location.pathname;for(let t in e){const a=e[t].hostnameSelector,l=e[t].pathnameSelector;let d=!1,u=!1;a&&s.indexOf(a)>=0&&(!n||e[n].hostnameSelector.length=0&&(!o||e[o].pathnameSelector.length=0&&l=0&&(t.displayOption=i.displayOption),o("$fontFamily",t.fontFamily,i.fontFamily,s.fontFamily),o("$fontSize",t.fontSize,i.fontSize,s.fontSize),o("$positionLeft",t.positionLeft,i.positionLeft,s.positionLeft),o("$mediaBreakPoint",t.mediaBreakPoint,i.mediaBreakPoint,s.mediaBreakPoint),o("$menuTextColor",t.menuTextColor,i.menuTextColor,s.menuTextColor),o("$menuBackgroundColor",t.menuBackgroundColor,i.menuBackgroundColor,s.menuBackgroundColor),o("$menuitemFocusTextColor",t.menuitemFocusTextColor,i.menuitemFocusTextColor,s.menuitemFocusTextColor),o("$menuitemFocusBackgroundColor",t.menuitemFocusBackgroundColor,i.menuitemFocusBackgroundColor,s.menuitemFocusBackgroundColor),o("$focusBorderColor",t.focusBorderColor,i.focusBorderColor,s.focusBorderColor),o("$buttonTextColor",t.buttonTextColor,i.buttonTextColor,s.buttonTextColor),o("$buttonBackgroundColor",t.buttonBackgroundColor,i.buttonBackgroundColor,s.buttonBackgroundColor),o("$zIndex",t.zIndex,i.zIndex,s.zIndex)}(e,i);const r=t.content.cloneNode(!0);r.id=`${s}-style`,document.getElementsByTagName("head")[0].appendChild(r)}function s(e,t){let n=e.getAttribute(t);return null===n?"":r(n)}function r(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+/g," ")}function a(e){return"string"==typeof e&&e.length&&e.trim()&&" "!==e}function l(e){let t=window.getComputedStyle(e).getPropertyValue("visibility");return"hidden"!==t&&"collapse"!==t&&!function e(t){if(!t||t.nodeType!==Node.ELEMENT_NODE)return!1;if(t.hasAttribute("hidden"))return!0;return"none"===window.getComputedStyle(t,null).getPropertyValue("display")||!!t.parentNode&&e(t.parentNode)}(e)}function d(e){return function(e){return!!e&&(e.nodeType===Node.TEXT_NODE&&(e=e.parentNode),e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("aria-hidden")&&"false"===e.getAttribute("aria-hidden").toLowerCase())}(e)||!function(e){if(!e)return!1;if(e.nodeType===Node.TEXT_NODE&&(e=e.parentNode),e.nodeType===Node.ELEMENT_NODE){const t=window.getComputedStyle(e,null).getPropertyValue("visibility");if(t)return"hidden"===t||"collapse"===t}return!1}(e)&&!function(e){if(!e)return!1;if(e.nodeType===Node.TEXT_NODE&&(e=e.parentNode),e.nodeType===Node.ELEMENT_NODE){if(e.hasAttribute("hidden"))return!0;if(e.hasAttribute("aria-hidden")&&"true"===e.getAttribute("aria-hidden").toLowerCase())return!0;const t=window.getComputedStyle(e,null).getPropertyValue("display");if(t)return"none"===t}return!1}(e)}function u(e){let t,n="",o=[];switch(e.nodeType){case Node.ELEMENT_NODE:if(e.hasAttribute("aria-label"))d(e)&&(n=e.getAttribute("aria-label"));else if(e instanceof HTMLSlotElement){(e.assignedNodes().length?e.assignedNodes():e.assignedNodes({flatten:!0})).forEach(e=>{(t=u(e)).length&&o.push(t)}),n=o.length?o.join(" "):""}else if(function(e){switch(e.tagName.toLowerCase()){case"img":case"area":return!0;case"input":return e.type&&"image"===e.type}return!1}(e)&&d(e))n=s(e,"alt");else if(e.hasChildNodes()){Array.from(e.childNodes).forEach(e=>{(t=u(e)).length&&o.push(t)}),n=o.length?o.join(" "):""}n=function(e,t){let n=t,o=getComputedStyle(e,":before").content,i=getComputedStyle(e,":after").content;'"'!==o[0]||o.toLowerCase().includes("moz-")||(n=o.substring(1,o.length-1)+n);'"'!==i[0]||i.toLowerCase().includes("moz-")||(n+=i.substring(1,i.length-1));return n}(e,n);break;case Node.TEXT_NODE:d(e)&&(n=r(e.textContent))}return n}function c(e,t,n=!1){let o="";return""===(o=function(e,t,n){const o=s(t,n),i=[];if(o.length){const t=o.split(" ");for(let n=0;n\n$skipToId.popup {\n position: absolute;\n top: -34px;\n transition: top 0.35s ease;\n}\n\n$skipToId button .text {\n padding: 6px 8px 6px 8px;\n display: inline-block;\n}\n\n$skipToId button img {\n height: 24px;\n padding: 2px 4px 2px 4px;\n display: none;\n background-color: #e8e9ea;\n}\n\n$skipToId,\n$skipToId.popup.focus,\n$skipToId.popup:hover {\n position: absolute;\n top: 0;\n left: $positionLeft;\n font-family: $fontFamily;\n font-size: $fontSize;\n display: block;\n border: none;\n margin-bottom: 4px;\n transition: left 1s ease;\n z-index: $zIndex !important;\n}\n\n$skipToId button {\n position: relative;\n margin: 0;\n padding: 0;\n border-width: 0px 1px 1px 1px;\n border-style: solid;\n border-radius: 0px 0px 6px 6px;\n border-color: $buttonBackgroundColor;\n color: $buttonTextColor;\n background-color: $buttonBackgroundColor;\n z-index: 100000 !important;\n font-family: $fontFamily;\n font-size: $fontSize;\n z-index: $zIndex !important;\n}\n\n@media screen and (max-width: $mediaBreakPointpx) {\n $skipToId button img {\n display: block;\n }\n\n $skipToId button {\n border-color: #e8e9ea;\n }\n\n $skipToId button .text {\n display: none;\n }\n}\n\n$skipToId.fixed {\n position: fixed;\n}\n\n\n$skipToId [role="menu"] {\n position: absolute;\n min-width: 17em;\n display: none;\n margin: 0;\n padding: 0.25rem;\n background-color: $menuBackgroundColor;\n border-width: 2px;\n border-style: solid;\n border-color: $focusBorderColor;\n border-radius: 5px;\n overflow-x: hidden;\n z-index: $zIndex !important;\n}\n\n$skipToId [role="group"] {\n display: grid;\n grid-auto-rows: min-content;\n grid-row-gap: 1px;\n}\n\n$skipToId [role="separator"]:first-child {\n border-radius: 5px 5px 0 0;\n}\n\n$skipToId [role="menuitem"] {\n padding: 3px;\n width: auto;\n border-width: 0px;\n border-style: solid;\n color: $menuTextColor;\n background-color: $menuBackgroundColor;\n display: grid;\n overflow-y: clip;\n grid-template-columns: repeat(6, 1.2rem) 1fr;\n grid-column-gap: 2px;\n font-size: 1em;\n z-index: $zIndex !important; \n}\n\n$skipToId [role="menuitem"] .level,\n$skipToId [role="menuitem"] .label {\n font-size: 100%;\n font-weight: normal;\n color: $menuTextColor;\n background-color: $menuBackgroundColor;\n display: inline-block;\n line-height: inherit;\n display: inline-block;\n white-space: nowrap;\n}\n\n$skipToId [role="menuitem"] .level {\n text-align: right;\n padding-right: 4px;\n}\n\n$skipToId [role="menuitem"] .label {\n text-align: left;\n margin: 0;\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n$skipToId [role="menuitem"] .level:first-letter,\n$skipToId [role="menuitem"] .label:first-letter {\n text-decoration: underline;\n text-transform: uppercase;\n}\n\n\n$skipToId [role="menuitem"].skip-to-h1 .level { grid-column: 1; }\n$skipToId [role="menuitem"].skip-to-h2 .level { grid-column: 2; }\n$skipToId [role="menuitem"].skip-to-h3 .level { grid-column: 3; }\n$skipToId [role="menuitem"].skip-to-h4 .level { grid-column: 4; }\n$skipToId [role="menuitem"].skip-to-h5 .level { grid-column: 5; }\n$skipToId [role="menuitem"].skip-to-h6 .level { grid-column: 8;}\n\n$skipToId [role="menuitem"].skip-to-h1 .label { grid-column: 2 / 8; }\n$skipToId [role="menuitem"].skip-to-h2 .label { grid-column: 3 / 8; }\n$skipToId [role="menuitem"].skip-to-h3 .label { grid-column: 4 / 8; }\n$skipToId [role="menuitem"].skip-to-h4 .label { grid-column: 5 / 8; }\n$skipToId [role="menuitem"].skip-to-h5 .label { grid-column: 6 / 8; }\n$skipToId [role="menuitem"].skip-to-h6 .label { grid-column: 7 / 8;}\n\n$skipToId [role="menuitem"].skip-to-h1.no-level .label { grid-column: 1 / 8; }\n$skipToId [role="menuitem"].skip-to-h2.no-level .label { grid-column: 2 / 8; }\n$skipToId [role="menuitem"].skip-to-h3.no-level .label { grid-column: 3 / 8; }\n$skipToId [role="menuitem"].skip-to-h4.no-level .label { grid-column: 4 / 8; }\n$skipToId [role="menuitem"].skip-to-h5.no-level .label { grid-column: 5 / 8; }\n$skipToId [role="menuitem"].skip-to-h6.no-level .label { grid-column: 6 / 8; }\n\n$skipToId [role="menuitem"].skip-to-nesting-level-1 .nesting { grid-column: 1; }\n$skipToId [role="menuitem"].skip-to-nesting-level-2 .nesting { grid-column: 2; }\n$skipToId [role="menuitem"].skip-to-nesting-level-3 .nesting { grid-column: 3; }\n\n$skipToId [role="menuitem"].skip-to-nesting-level-0 .label { grid-column: 1 / 8; }\n$skipToId [role="menuitem"].skip-to-nesting-level-1 .label { grid-column: 2 / 8; }\n$skipToId [role="menuitem"].skip-to-nesting-level-2 .label { grid-column: 3 / 8; }\n$skipToId [role="menuitem"].skip-to-nesting-level-3 .label { grid-column: 4 / 8; }\n\n$skipToId [role="menuitem"].no-items .label,\n$skipToId [role="menuitem"].action .label {\n grid-column: 1 / 8;\n}\n\n$skipToId [role="separator"] {\n margin: 1px 0px 1px 0px;\n padding: 3px;\n display: block;\n width: auto;\n font-weight: bold;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: $menuTextColor;\n background-color: $menuBackgroundColor;\n color: $menuTextColor;\n z-index: $zIndex !important;\n}\n\n$skipToId [role="separator"] .mofn {\n font-weight: normal;\n font-size: 85%;\n}\n\n$skipToId [role="separator"]:first-child {\n border-radius: 5px 5px 0 0;\n}\n\n$skipToId [role="menuitem"].last {\n border-radius: 0 0 5px 5px;\n}\n\n/* focus styling */\n\n$skipToId.focus {\n display: block;\n}\n\n$skipToId button:focus,\n$skipToId button:hover {\n background-color: $menuBackgroundColor;\n color: $menuTextColor;\n outline: none;\n}\n\n$skipToId button:focus,\n$skipToId button:hover {\n border-width: 0px 2px 2px 2px;\n border-color: $focusBorderColor;\n}\n\n$skipToId button:focus .text,\n$skipToId button:hover .text {\n padding: 6px 7px 5px 7px;\n}\n\n$skipToId button:focus img,\n$skipToId button:hover img {\n padding: 2px 3px 4px 3px;\n}\n\n\n$skipToId [role="menuitem"]:focus {\n padding: 1px;\n border-width: 2px;\n border-style: solid;\n border-color: $focusBorderColor;\n background-color: $menuitemFocusBackgroundColor;\n color: $menuitemFocusTextColor;\n outline: none;\n}\n\n$skipToId [role="menuitem"]:focus .level,\n$skipToId [role="menuitem"]:focus .label {\n background-color: $menuitemFocusBackgroundColor;\n color: $menuitemFocusTextColor;\n}\n\n',new e("Utils",!1).flag=!1,new e("nameFrom",!1).flag=!1,new e("accName",!1).flag=!1,new e("landmarksHeadings",!1).flag=!1;const m=["base","content","frame","iframe","input[type=hidden]","link","meta","noscript","script","style","template","shadow","title"],p=["banner","complementary","contentinfo","form","main","navigation","region","search"],h=["article","aside","footer","header","main","nav","region","section"];let g=0;function f(){return g}function b(){g+=1}function k(e){const t=e.tagName.toLowerCase(),n=e.hasAttribute("type")?e.getAttribute("type"):"",o="input"===t&&n.length?`${t}[type=${n}]`:t;return m.includes(o)}function C(e){return e.tagName.indexOf("-")>=0}function T(e){return e instanceof HTMLSlotElement}function N(e){for(e=e&&e.parentNode;e&&e.nodeType===Node.ELEMENT_NODE;){const t=e.tagName.toLowerCase();let n=e.getAttribute("role");if(n&&(n=n.toLowerCase()),h.includes(t)||p.includes(n))return!1;e=e.parentNode}return!0}function x(e){if(e.hasAttribute("role")){const t=e.getAttribute("role").toLowerCase();if(p.indexOf(t)>=0)return t}else{switch(e.tagName.toLowerCase()){case"aside":return"complementary";case"main":return"main";case"nav":return"navigation";case"header":if(N(e))return"banner";break;case"footer":if(N(e))return"contentinfo";break;case"section":if(e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby"))return"region"}}return""}function y(e,t){function n(e,t){var o=null;for(let i=e.firstChild;null!==i;i=i.nextSibling)if(i.nodeType===Node.ELEMENT_NODE&&!k(i))if(T(i)){const e=i.assignedNodes().length?i.assignedNodes():i.assignedNodes({flatten:!0});for(let i=0;i=0?n.focus():(n.tabIndex=0,n.focus(),n.tabIndex=-1),n.scrollIntoView({block:"center"})):(a&&(o=y(t,r))&&(t=o),t.tabIndex>=0?t.focus():(t.tabIndex=0,t.focus(),t.tabIndex=-1),t.scrollIntoView({block:"center"})))}function A(e){const t=e.tagName.toLowerCase(),n=e.hasAttribute("role")?e.getAttribute("role").toLowerCase():"";return"main"===t||"main"===n}function w(e,t){let n=e.landmarks;"string"!=typeof n&&(console.warn("[skipto.js]: Error in landmark configuration"),n="main search navigation");let o=e.headings;"string"!=typeof o&&(console.warn("[skipto.js]: Error in heading configuration"),o="h1 h2");const[i,s]=function(e,t,n){let o=[],i=[],s=function(e){let t=[];return(e=e.toLowerCase()).includes("main")&&t.push("main"),e.includes("search")&&t.push("search"),e.includes("nav")&&t.push("navigation"),(e.includes("complementary")||e.includes("aside"))&&t.push("complementary"),(e.includes("banner")||e.includes("header"))&&t.push("banner"),(e.includes("contentinfo")||e.includes("footer"))&&t.push("contentinfo"),(e.includes("region")||e.includes("section"))&&t.push("region"),t}(e.toLowerCase()),r=function(e){let t=[];return["h1","h2","h3","h4","h5","h6"].forEach(n=>{e.includes(n)&&t.push(n)}),t}(t.toLowerCase()),a=t.includes("main");function l(e,t,d=null,u=!1){for(let m=e.firstChild;null!==m;m=m.nextSibling)if(m.nodeType===Node.ELEMENT_NODE){const e=m.tagName.toLowerCase();if(s.indexOf(x(m))>=0&&m.id!==n&&i.push({node:m,name:c(t,m)}),r.indexOf(e)>=0&&(a&&!u||o.push({node:m,name:c(t,m,!0)})),A(m)&&(u=!0),!k(m))if(T(m)){const e=m.assignedNodes().length>0,n=e?m.assignedNodes():m.assignedNodes({flatten:!0}),p=e?d:t;for(let m=0;m=0&&i.push({node:h,name:c(p,h)}),r.indexOf(g)>=0&&(a&&!u||o.push({node:h,name:c(p,h,!0)})),e?l(h,d,null,u):l(h,t,d,u)}}}else C(m)?m.shadowRoot&&l(m.shadowRoot,m.shadowRoot,t,u):l(m,t,d,u)}}return l(document.body,document),0===o.length&&a&&(a=!1,i=[],l(document.body,document),0===o.length?console.warn("[skipTo.js]: no headings found on page"):console.warn(`[skipTo.js]: no headings found in main landmark, but ${o.length} found in page.`)),0===i.length&&console.warn("[skipTo.js]: no landmarks found on page"),[i,o]}(n,o,t);return[I(e,i),E(e,s)]}function E(e,t){let n,o,i=[];for(let s=0,r=t.length;s0,t.name=v(e,h,m.name),t.tagName=h,t.nestingLevel=0,b(),h){case"main":n.push(t);break;case"search":o.push(t);break;case"nav":i.push(t);break;case"aside":s.push(t);break;case"footer":r.push(t);break;case"section":t.hasName&&a.push(t);break;default:d.push(t)}}}return[].concat(n,o,i,s,a,r,d)}new e("SkipToButton",!1).flag=!1;class B{constructor(e,t,n){this.config=t,this.skiptoId=n,this.containerNode=document.createElement(t.containerElement),"nav"===t.containerElement&&this.containerNode.setAttribute("aria-label",t.buttonLabel),this.containerNode.id=n,a(t.customClass)&&this.containerNode.classList.add(t.customClass);let o=t.displayOption;if("string"==typeof o&&(o=o.trim().toLowerCase()).length)switch(t.displayOption){case"fixed":this.containerNode.classList.add("fixed");break;case"onfocus":case"popup":this.containerNode.classList.add("popup")}const[i,s]=this.getBrowserSpecificShortcut(t);this.buttonNode=document.createElement("button"),this.buttonNode.setAttribute("aria-label",s),this.buttonNode.addEventListener("keydown",this.handleButtonKeydown.bind(this)),this.buttonNode.addEventListener("click",this.handleButtonClick.bind(this)),this.containerNode.appendChild(this.buttonNode),this.buttonTextNode=document.createElement("span"),this.buttonTextNode.classList.add("text"),this.buttonTextNode.textContent=i,this.buttonNode.appendChild(this.buttonTextNode);const r=document.createElement("img");r.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh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f3lqh/9iV1cXZpuV6z8QFu9El3GwrAAAAABJRU5ErkJggg==",r.setAttribute("alt",""),this.buttonNode.appendChild(r),this.menuNode=document.createElement("div"),this.menuNode.id="id-skip-to-menu",this.menuNode.setAttribute("role","menu"),this.menuNode.setAttribute("aria-label",t.menuLabel),this.menuNode.setAttribute("aria-busy","true"),this.containerNode.appendChild(this.menuNode);const l=document.createElement("div");l.id="id-skip-to-menu-landmark-group-label",l.setAttribute("role","separator"),l.textContent=this.config.landmarkGroupLabel,this.menuNode.appendChild(l),this.landmarkGroupNode=document.createElement("div"),this.landmarkGroupNode.setAttribute("role","group"),this.landmarkGroupNode.setAttribute("aria-labelledby",l.id),this.landmarkGroupNode.id="#id-skip-to-menu-landmark-group",this.menuNode.appendChild(this.landmarkGroupNode);const d=document.createElement("div");return d.id="id-skip-to-menu-heading-group-label",d.setAttribute("role","separator"),d.textContent=this.config.headingGroupLabel,this.menuNode.appendChild(d),this.headingGroupNode=document.createElement("div"),this.headingGroupNode.setAttribute("role","group"),this.headingGroupNode.setAttribute("aria-labelledby",d.id),this.headingGroupNode.id="#id-skip-to-menu-heading-group",this.menuNode.appendChild(this.headingGroupNode),this.containerNode.addEventListener("focusin",this.handleFocusin.bind(this)),this.containerNode.addEventListener("focusout",this.handleFocusout.bind(this)),window.addEventListener("pointerdown",this.handleBackgroundPointerdown.bind(this),!0),(this.usesAltKey||this.usesOptionKey)&&document.addEventListener("keydown",this.handleDocumentKeydown.bind(this)),e.insertBefore(this.containerNode,e.firstElementChild),this.containerNode}getBrowserSpecificShortcut(e){const t=navigator.platform.toLowerCase(),n=navigator.userAgent.toLowerCase(),o=t.indexOf("win")>=0,i=t.indexOf("mac")>=0,s=t.indexOf("linux")>=0||t.indexOf("bsd")>=0,r=n.indexOf("android")>=0;this.usesAltKey=o||s&&!r,this.usesOptionKey=i;let a,l=e.buttonLabel,d=e.buttonLabel;return e.altShortcut&&e.optionShortcut&&((this.usesAltKey||this.usesOptionKey)&&(a=e.buttonShortcut.replace("$key",e.altShortcut)),this.usesAltKey&&(l+=a=a.replace("$modifier",e.altLabel),d=e.altButtonAriaLabel.replace("$key",e.altShortcut)),this.usesOptionKey&&(l+=a=a.replace("$modifier",e.optionLabel),d=e.optionButtonAriaLabel.replace("$key",e.altShortcut))),[l,d]}getFirstChar(e){const t=e.querySelector(".label");return t&&a(t.textContent)?t.textContent.trim()[0].toLowerCase():""}getHeadingLevelFromAttribute(e){return e.hasAttribute("data-level")?e.getAttribute("data-level"):""}updateKeyboardShortCuts(){let e;this.firstChars=[],this.headingLevels=[];for(let t=0;t0&&t.nestingLevel>this.lastNestingLevel&&((s=document.createElement("span")).classList.add("nesting"),r.append(s)),this.lastNestingLevel=t.nestingLevel),(i=document.createElement("span")).appendChild(document.createTextNode(t.name)),i.classList.add("label"),r.append(i),r}renderMenuitemsToGroup(e,t,n){if(e.innerHTML="",this.lastNestingLevel=0,0===t.length){const t={};t.name=n,t.tagName="",t.class="no-items",t.dataId="",this.renderMenuitemToGroup(e,t)}else for(let n=0;n1||(t=t.toLowerCase(),(n=this.menuitemNodes.indexOf(e)+1)>=this.menuitemNodes.length&&(n=0),-1===(o=this.firstChars.indexOf(t,n))&&(o=this.headingLevels.indexOf(t,n)),-1===o&&(o=this.firstChars.indexOf(t,0)),-1===o&&(o=this.headingLevels.indexOf(t,0)),o>-1&&this.setFocusToMenuitem(this.menuitemNodes[o]))}getIndexFirstChars(e,t){for(let n=e;n0||"boolean"==typeof n[t])?e[t]=n[t]:console.warn("[SkipTo]: Unsupported or deprecated configuration option in global configuration object: "+t);return e},setupConfigFromDataAttribute:function(e){let t={};const n=document.querySelector("[data-skipto]");if(n){const e=n.getAttribute("data-skipto");if(e){e.split(";").forEach(e=>{let[n,o]=e.split(":");n&&(n=n.trim()),o&&(o=o.trim()),n&&o&&(t[n]=o)})}}for(const n in t)void 0!==e[n]&&("string"==typeof t[n]&&t[n].length>0||"boolean"==typeof t[n])?e[n]=t[n]:console.warn("[SkipTo]: Unsupported or deprecated configuration option in data-skipto attribute: "+n);return e}};window.addEventListener("load",function(){e.init(window.SkipToConfig)})}()}();