/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
const o="ion-focused";const t="ion-focusable";const n=["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp","Home","End"];const s=s=>{let c=[];let e=true;const r=s?s.shadowRoot:document;const u=s?s:document.body;const f=t=>{c.forEach((t=>t.classList.remove(o)));t.forEach((t=>t.classList.add(o)));c=t};const i=()=>{e=false;f([])};const d=o=>{e=n.includes(o.key);if(!e){f([])}};const w=o=>{if(e&&o.composedPath){const n=o.composedPath().filter((o=>{if(o.classList){return o.classList.contains(t)}return false}));f(n)}};const a=()=>{if(r.activeElement===u){f([])}};r.addEventListener("keydown",d);r.addEventListener("focusin",w);r.addEventListener("focusout",a);r.addEventListener("touchstart",i);r.addEventListener("mousedown",i);const l=()=>{r.removeEventListener("keydown",d);r.removeEventListener("focusin",w);r.removeEventListener("focusout",a);r.removeEventListener("touchstart",i);r.removeEventListener("mousedown",i)};return{destroy:l,setFocus:f}};export{s as startFocusVisible};
//# sourceMappingURL=p-924b2917.js.map