'use strict';var normalizeComponent=require('./normalize-component-ebe0c011.js'),BaseIcon=require('./BaseIcon-7f18dc39.js');require('./es.array.includes-ec502589.js'),require('./well-known-symbol-08f3111a.js'),require('./object-keys-5cf8040b.js'),require('./es.array.concat-2f004403.js'),require('./array-species-create-447f37c0.js'),require('./create-property-8fd8ad81.js'),require('./array-method-has-species-support-9fe8fcbb.js'),require('./es.array.join-821b566c.js'),require('./array-method-is-strict-46936434.js');//
/**
 * Toggle Component
 */

var script = {
  name: 'BaseToggle',
  components: {
    BaseIcon: BaseIcon["default"]
  },
  model: {
    prop: 'checked',
    event: 'clicked'
  },
  props: {
    /**
     * specify a descriptive name <br>
     * this will not be displayed but is only there for usability purposes
     */
    name: {
      type: String,
      default: 'baseToggle'
    },

    /**
     * specify label
     */
    label: {
      type: String,
      default: 'baseToggle'
    },

    /**
     * disable the toggle button
     */
    disabled: {
      type: Boolean,
      default: false
    },

    /**
     * checkbox checked or radio button checked can be set from outside, <br>
     * default value depending on type of selector
     *
     * @model
     */
    checked: {
      type: [Boolean, String],
      default: false
    },

    /**
     * specify visibility of the label
     */
    hideLabel: {
      type: Boolean,
      default: false
    },

    /**
     * bind visibility of slot content to components checked state<br>
     */
    bindSlotToState: {
      type: Boolean,
      default: false
    }
  },
  data: function data() {
    return {
      checkedInt: false,
      animate: false
    };
  },
  watch: {
    checked: {
      handler: function handler(val) {
        if (val !== this.checkedInt) {
          this.checkedInt = val;
        }
      },
      immediate: true
    },
    checkedInt: function checkedInt(val) {
      /**
       * event emitted on radio button / checkmark click, <br>
       * emitting input value
       *
       * @type {string | boolean}
       */
      this.$emit('clicked', val);
    }
  }
};var __vue_script__ = script;
/* template */

var __vue_render__ = function __vue_render__() {
  var _vm = this;

  var _h = _vm.$createElement;

  var _c = _vm._self._c || _h;

  return _c('div', {
    class: ['base-toggle', {
      'base-toggle--checked': _vm.checkedInt
    }, {
      'base-toggle--disabled': _vm.disabled
    }],
    on: {
      "mouseover": function mouseover($event) {
        _vm.animate = true;
      },
      "mouseleave": function mouseleave($event) {
        _vm.animate = false;
      }
    }
  }, [_vm._ssrNode("<label class=\"base-toggle__container\" data-v-04c03067>", "</label>", [_vm._ssrNode(("<input" + _vm._ssrAttr("name", _vm.name) + _vm._ssrAttr("disabled", _vm.disabled) + _vm._ssrAttr("aria-checked", _vm.checkedInt) + _vm._ssrAttr("aria-disabled", _vm.disabled) + " value type=\"checkbox\"" + _vm._ssrAttr("checked", _vm.checkedInt) + _vm._ssrAttr("checked", Array.isArray(_vm.checkedInt) ? _vm._i(_vm.checkedInt, "") > -1 : _vm.checkedInt) + " class=\"base-toggle__input\" data-v-04c03067>" ) + " "), _vm._ssrNode("<div class=\"base-switch\" data-v-04c03067>", "</div>", [_vm._ssrNode("<span" + _vm._ssrClass(null, ['base-switch__control', {
    'base-switch__control--animate': _vm.animate
  }]) + " data-v-04c03067>", "</span>", [_vm.checkedInt ? _c('base-icon', {
    attrs: {
      "title": _vm.hideLabel ? _vm.label : '',
      "name": "check-mark"
    }
  }) : _vm._e(), _vm._ssrNode(" "), !_vm.checkedInt ? _c('base-icon', {
    attrs: {
      "title": _vm.hideLabel ? _vm.label : '',
      "name": "remove"
    }
  }) : _vm._e()], 2)]), _vm._ssrNode(" " + (!_vm.hideLabel ? "<span class=\"base-toggle__label\" data-v-04c03067>" + _vm._ssrEscape("\n      " + _vm._s(_vm.label) + "\n    ") + "</span>" : "<!---->"))], 2), _vm._ssrNode(" "), !!_vm.$slots.default && _vm.checked && _vm.bindSlotToState || !!_vm.$slots.default && !_vm.bindSlotToState ? _vm._ssrNode("<span class=\"base-toggle__subtext\" data-v-04c03067>", "</span>", [_vm._t("default")], 2) : _vm._e()], 2);
};

var __vue_staticRenderFns__ = [];
/* style */

var __vue_inject_styles__ = undefined;
/* scoped */

var __vue_scope_id__ = "data-v-04c03067";
/* module identifier */

var __vue_module_identifier__ = "data-v-04c03067";
/* functional template */

var __vue_is_functional_template__ = false;
/* style inject */

/* style inject SSR */

/* style inject shadow dom */

var __vue_component__ = /*#__PURE__*/normalizeComponent.n({
  render: __vue_render__,
  staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);

var BaseToggle = __vue_component__;exports["default"]=BaseToggle;