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-checkbox/emby-checkbox.css"]);var EmbyCheckbox=function(_HTMLInputElement){babelHelpers.inherits(EmbyCheckbox,_HTMLInputElement);var _super=_createSuper(EmbyCheckbox);function EmbyCheckbox(){var _this;babelHelpers.classCallCheck(this,EmbyCheckbox),_this=_super.call(this);return babelHelpers.possibleConstructorReturn(_this,_this)}return babelHelpers.createClass(EmbyCheckbox,[{key:"connectedCallback",value:function(){var labelElement;!this.hasAttribute("data-classes")&&(_layoutmanager.default.tv?this.classList.add("emby-checkbox","emby-checkbox-tv"):this.classList.add("emby-checkbox"),(labelElement=this.parentNode).classList.add("emby-checkbox-label"),labelElement=labelElement.querySelector("span"))&&(labelElement.classList.add("checkboxLabel"),labelElement.insertAdjacentHTML("afterend",'<div class="emby-checkbox-focusoutline"></div>')),-1!==this.tabIndex&&this.addEventListener("keydown",onKeyDown)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("keydown",onKeyDown)}}]),EmbyCheckbox}(babelHelpers.wrapNativeSuper(HTMLInputElement));customElements.define("emby-checkbox",EmbyCheckbox,{extends:"input"}),_exports.default=EmbyCheckbox});