"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _InputWithOptions = _interopRequireDefault(require("../InputWithOptions/InputWithOptions.driver"));
var multiSelectCheckboxDriverFactory = _ref => {
  var {
    element
  } = _ref;
  var {
    driver,
    inputDriver,
    dropdownLayoutDriver
  } = (0, _InputWithOptions.default)({
    element
  });
  var _getLabels = function getLabels() {
    var delimiter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ", ";
    return inputDriver.getValue().split(delimiter);
  };
  var multiSelectCheckboxDriver = Object.assign(driver, {
    getNumOfLabels: () => _getLabels().length,
    getLabels: delimiter => _getLabels(delimiter),
    getLabelAt: (index, delimiters) => _getLabels(delimiters)[index]
  });
  return {
    exists: () => !!element,
    driver: multiSelectCheckboxDriver,
    inputDriver,
    dropdownLayoutDriver
  };
};
var _default = exports.default = multiSelectCheckboxDriverFactory;
//# sourceMappingURL=MultiSelectCheckbox.driver.js.map