1import{findElementsByStepId,findElementsByStepDataKey}from"onboarding-step-tree";import{getCurrentStepState}from"onboarding-storage-utils";import{NAVIGATION_MODES}from"onboarding-step-constants";export function announceStepChange(e,t,n=null){findElementsByStepId(e,t).forEach((t=>{const i=t.querySelector('[id^="step-announcements-"]');if(i){const s=t.closest(".onboarding-step");let o="";if(s&&s.dataset.sectionId){const e=s.dataset.sectionId,t=window.onboardingBlockSettings?.[e],n=t?.blockSettings?.find((e=>"text"===e._type&&"title"===e.key))||t?.blockSettings?.find((e=>"title"===e._type));n&&n.title?o=` - ${n.title}`:n&&n.value&&(o=` - ${n.value}`)}const a=n?`Navigated from step ${n} to step ${e}${o}`:`Now on step ${e}${o}`;i.textContent=a}}))}export function manageFocusTransition(e,t,n){setTimeout((()=>{const n=findElementsByStepId(e,t).find((e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility}));if(n){const e=n.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');if(e.length>0)e[0].focus();else{const e=n.querySelector('[id^="step-heading-"]');e&&(e.setAttribute("tabindex","-1"),e.focus(),setTimeout((()=>e.removeAttribute("tabindex")),100))}}}),n===NAVIGATION_MODES.SCROLLING?300:100)}const accessibilityEventListeners=new Map;export function initializeKeyboardNavigation(e){const t=t=>{const n=document.activeElement.closest(".onboarding-step");if(!n||n.dataset.namespace!==e)return;const i=n.dataset.stepId;if(!i)return;let s=null;switch(t.key){case"ArrowLeft":case"ArrowUp":{const n=getCurrentStepState(e);n&&n.previousStepId&&(s=n.previousStepId,t.preventDefault());break}case"ArrowRight":case"ArrowDown":{const n=getNextAvailableStep(i,e);n&&(s=n,t.preventDefault());break}case"Home":s="1",t.preventDefault();break;case"End":{const n=getLastAvailableStep(e);n&&(s=n,t.preventDefault());break}}s&&s!==i&&import("onboarding-step-global").then((t=>{t.scrollToStepById&&t.scrollToStepById(s,e)}))};document.addEventListener("keydown",t),accessibilityEventListeners.has(e)||accessibilityEventListeners.set(e,[]),accessibilityEventListeners.get(e).push({element:document,event:"keydown",handler:t})}export function getNextAvailableStep(e,t){const n=(parseInt(e)+1).toString();return findElementsByStepId(n,t).length>0?n:null}export function getLastAvailableStep(e){const t=findElementsByStepDataKey(e),n=[...new Set(t.map((e=>e.dataset.stepId)))].sort(((e,t)=>parseInt(t)-parseInt(e)));return n.length>0?n[0]:null}export function initializeAccessibility(e){initializeKeyboardNavigation(e);const t=t=>{const{stepId:n,previousStepId:i}=t.detail;announceStepChange(n,e,i)};document.addEventListener(`${e}:currentStepUpdated`,t),accessibilityEventListeners.has(e)||accessibilityEventListeners.set(e,[]),accessibilityEventListeners.get(e).push({element:document,event:`${e}:currentStepUpdated`,handler:t})}export function destroyAccessibility(e){const t=accessibilityEventListeners.get(e);t&&(t.forEach((({element:e,event:t,handler:n})=>{e.removeEventListener(t,n)}
1)),accessibilityEventListeners.delete(e))}
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.