System.register([],(function(t){"use strict";return{execute:function(){var n="bal-focused";var o="bal-focusable";var e=t("FOCUS_KEYS",["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp","Home","End"]);var r=t("focusableQueryString",'[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .bal-focusable:not([tabindex^="-"])');var u=t("startFocusVisible",(function(t){var r=[];var u=true;var a=t?t.shadowRoot:document;var i=t?t:document.body;var c=function(t){r.forEach((function(t){return t.classList.remove(n)}));t.forEach((function(t){return t.classList.add(n)}));r=t};var f=function(){u=false;c([])};var s=function(t){u=e.includes(t.key);if(!u){c([])}};var d=function(t){if(u&&t.composedPath!==undefined){var n=t.composedPath().filter((function(t){if(t.classList){return t.classList.contains(o)}return false}));c(n)}};var b=function(){if(a.activeElement===i){c([])}};a.addEventListener("keydown",s);a.addEventListener("focusin",d);a.addEventListener("focusout",b);a.addEventListener("touchstart",f);a.addEventListener("mousedown",f);var v=function(){a.removeEventListener("keydown",s);a.removeEventListener("focusin",d);a.removeEventListener("focusout",b);a.removeEventListener("touchstart",f);a.removeEventListener("mousedown",f)};return{destroy:v,setFocus:c}}))}}}));