"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Map"===(r="Object"===r&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);t=r.call(e,t||"default");if("object"!=_typeof(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}try{new simpleDatatables.DataTable("#datatable_1",{searchable:!1,fixedHeight:!0})}catch(e){}var CheckboxController=function(){return _createClass(function e(t,r,o){var n=this;_classCallCheck(this,e),this.table=document.getElementById(t),this.selectAll=document.getElementById(r),this.rowCheckboxes=function(){return n.table.querySelectorAll(".".concat(o))},this.init()},[{key:"init",value:function(){var t=this;this.table&&this.selectAll&&(this.selectAll.addEventListener("change",function(){t.toggleAll(t.selectAll.checked)}),this.table.addEventListener("change",function(e){e.target.classList.contains("row-checkbox")&&t.updateSelectAll()}))}},{key:"toggleAll",value:function(t){this.rowCheckboxes().forEach(function(e){return e.checked=t})}},{key:"updateSelectAll",value:function(){var e=_toConsumableArray(this.rowCheckboxes()).every(function(e){return e.checked});this.selectAll.checked=e}}])}();document.addEventListener("DOMContentLoaded",function(){new CheckboxController("datatable_1","select-all","row-checkbox")});