define(["exports","./../../layoutmanager.js","./../../input/keyboard.js"],function(_exports,_layoutmanager,_keyboard){function onKeyDown(e){if("Enter"===_keyboard.default.normalizeKeyFromEvent(e))return e.preventDefault(),this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),!1}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,require(["css!modules/emby-elements/emby-toggle/emby-toggle.css"]);var EmbyToggle=function(_HTMLInputElement){babelHelpers.inherits(EmbyToggle,_HTMLInputElement);var _super=_createSuper(EmbyToggle);function EmbyToggle(){var _this;babelHelpers.classCallCheck(this,EmbyToggle),_this=_super.call(this);return babelHelpers.possibleConstructorReturn(_this,_this)}return babelHelpers.createClass(EmbyToggle,[{key:"connectedCallback",value:function(){!function(){this.classList.add("emby-toggle","emby-toggle-focusring"),_layoutmanager.default.tv&&this.classList.add("emby-toggle-tv");var labelElement=this.parentNode;labelElement.classList.add("emby-toggle-label"),(labelElement=labelElement.querySelector("span"))&&(labelElement.classList.add("toggleLabel"),_layoutmanager.default.tv)&&labelElement.classList.add("toggleLabel-tv"),this.addEventListener("keydown",onKeyDown)}.call(this)}},{key:"disconnectedCallback",value:function(){!function(){this.removeEventListener("keydown",onKeyDown)}.call(this)}}]),EmbyToggle}(babelHelpers.wrapNativeSuper(HTMLInputElement));customElements.define("emby-toggle",EmbyToggle,{extends:"input"}),_exports.default=EmbyToggle});