'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var normalizeComponent = require('./normalize-component-6fa50395.js');
var ThemeMixin = require('./ThemeMixin-a2f817cd.js');
var svgAtom = require('./svg-atom-d2541b7d.js');

var script = {
  name: 'IconControlAtom',
  props: {
    href: {
      type: String,
      default: null
    },
    icon: {
      type: String,
      default: null
    },
    isActive: {
      type: Boolean,
      default: false
    },
    skin: {
      type: String,
      default: 'primary',
      validator: function validator(value) {
        return ['primary', 'secondary'].indexOf(value) !== -1;
      }
    }
  },
  computed: {
    controlCssClass: function controlCssClass() {
      return Object.assign(this.themeCssClass, ThemeMixin._defineProperty({
        'icon-control-molecule': true,
        'is-active': this.isActive
      }, this.skin, !!this.skin));
    },
    controlRole: function controlRole() {
      return this.href ? null : 'button';
    },
    isIconSlotFilled: function isIconSlotFilled() {
      return !!this.$slots.icon;
    }
  },
  methods: {
    emitClick: function emitClick() {
      this.$emit('click');
    }
  },
  mixins: [ThemeMixin.ThemeMixin],
  components: {
    SvgAtom: svgAtom.SvgAtom
  }
};

/* script */
const __vue_script__ = script;

/* template */
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a',{class:_vm.controlCssClass,attrs:{"href":_vm.href,"role":_vm.controlRole},on:{"click":_vm.emitClick}},[_c('span',{staticClass:"icon-control-molecule-icon"},[(!_vm.isIconSlotFilled)?_c('svg-atom',{attrs:{"name":_vm.icon}}):_vm._e(),_vm._v(" "),_vm._t("icon")],2),_vm._v(" "),_c('span',{staticClass:"icon-control-molecule-label"},[_vm._t("default")],2)])};
var __vue_staticRenderFns__ = [];

  /* style */
  const __vue_inject_styles__ = undefined;
  /* scoped */
  const __vue_scope_id__ = undefined;
  /* module identifier */
  const __vue_module_identifier__ = undefined;
  /* functional template */
  const __vue_is_functional_template__ = false;
  /* style inject */
  
  /* style inject SSR */
  

  
  var IconControlAtom = normalizeComponent.__vue_normalize__(
    { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
    __vue_inject_styles__,
    __vue_script__,
    __vue_scope_id__,
    __vue_is_functional_template__,
    __vue_module_identifier__,
    undefined,
    undefined
  );

var script$1 = {
  name: 'VIconControl',
  extends: IconControlAtom
};

/* script */
const __vue_script__$1 = script$1;

/* template */

  /* style */
  const __vue_inject_styles__$1 = undefined;
  /* scoped */
  const __vue_scope_id__$1 = undefined;
  /* module identifier */
  const __vue_module_identifier__$1 = undefined;
  /* functional template */
  const __vue_is_functional_template__$1 = undefined;
  /* style inject */
  
  /* style inject SSR */
  

  
  var VIconControl = normalizeComponent.__vue_normalize__(
    {},
    __vue_inject_styles__$1,
    __vue_script__$1,
    __vue_scope_id__$1,
    __vue_is_functional_template__$1,
    __vue_module_identifier__$1,
    undefined,
    undefined
  );

exports.default = VIconControl;
