'use strict';

Liferay.Loader.define('frontend-taglib-clay$clay-radio@2.24.1/lib/ClayRadio.soy', ['module', 'exports', 'require', 'frontend-js-metal-web$metal-component', 'frontend-js-metal-web$metal-soy'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.templates = exports.ClayRadio = undefined;

    var _metalComponent = require('frontend-js-metal-web$metal-component');

    var _metalComponent2 = _interopRequireDefault(_metalComponent);

    var _metalSoy = require('frontend-js-metal-web$metal-soy');

    var _metalSoy2 = _interopRequireDefault(_metalSoy);

    function _interopRequireDefault(obj) {
      return obj && obj.__esModule ? obj : { default: obj };
    }

    function _classCallCheck(instance, Constructor) {
      if (!(instance instanceof Constructor)) {
        throw new TypeError("Cannot call a class as a function");
      }
    }

    function _possibleConstructorReturn(self, call) {
      if (!self) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return call && (typeof call === "object" || typeof call === "function") ? call : self;
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
    } /* jshint ignore:start */

    var templates;
    goog.loadModule(function (exports) {
      var soy = goog.require('soy');

      goog.require('soydata');

      // This file was automatically generated from ClayRadio.soy.
      // Please don't edit this file by hand.

      /**
       * @fileoverview Templates in namespace ClayRadio.
       * @public
       */

      goog.module('ClayRadio.incrementaldom');

      goog.require('goog.soy.data.SanitizedContent');
      var incrementalDom = goog.require('incrementaldom');
      goog.require('soy.asserts');

      goog.require('soy.idom');

      var $templateAlias1 = _metalSoy2.default.getTemplate('ClayRadioLabel.incrementaldom', 'render');

      /**
       * @param {{
       *  checked: (boolean|null|undefined),
       *  disabled: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  inline: (boolean|null|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  labelContent: (function()|null|undefined),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showLabel: (boolean|null|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $render(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        var $$temp;
        opt_data = opt_data || {};
        /** @type {boolean|null|undefined} */
        var checked = soy.asserts.assertType(opt_data.checked == null || goog.isBoolean(opt_data.checked) || opt_data.checked === 1 || opt_data.checked === 0, 'checked', opt_data.checked, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */
        var disabled = soy.asserts.assertType(opt_data.disabled == null || goog.isBoolean(opt_data.disabled) || opt_data.disabled === 1 || opt_data.disabled === 0, 'disabled', opt_data.disabled, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var elementClasses = soy.asserts.assertType(opt_data.elementClasses == null || goog.isString(opt_data.elementClasses) || opt_data.elementClasses instanceof goog.soy.data.SanitizedContent, 'elementClasses', opt_data.elementClasses, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var id = soy.asserts.assertType(opt_data.id == null || goog.isString(opt_data.id) || opt_data.id instanceof goog.soy.data.SanitizedContent, 'id', opt_data.id, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var inline = soy.asserts.assertType(opt_data.inline == null || goog.isBoolean(opt_data.inline) || opt_data.inline === 1 || opt_data.inline === 0, 'inline', opt_data.inline, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var label = soy.asserts.assertType(opt_data.label == null || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {function()|null|undefined} */
        var labelContent = soy.asserts.assertType(opt_data.labelContent == null || goog.isFunction(opt_data.labelContent), 'labelContent', opt_data.labelContent, 'function()|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var name = soy.asserts.assertType(opt_data.name == null || goog.isString(opt_data.name) || opt_data.name instanceof goog.soy.data.SanitizedContent, 'name', opt_data.name, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var showLabel = soy.asserts.assertType(opt_data.showLabel == null || goog.isBoolean(opt_data.showLabel) || opt_data.showLabel === 1 || opt_data.showLabel === 0, 'showLabel', opt_data.showLabel, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var value = soy.asserts.assertType(opt_data.value == null || goog.isString(opt_data.value) || opt_data.value instanceof goog.soy.data.SanitizedContent, 'value', opt_data.value, '!goog.soy.data.SanitizedContent|null|string|undefined');

        incrementalDom.elementOpenStart('div');
        (function attributes__soy14() {
          incrementalDom.attr('class', 'custom-control custom-radio' + (inline ? ' custom-control-inline' : '') + (elementClasses ? ' ' + elementClasses : ''));
          if (id) {
            incrementalDom.attr('id', id);
          }
        })();
        incrementalDom.elementOpenEnd();
        $input({ checked: checked, disabled: disabled, label: label, labelContent: labelContent, name: name, showLabel: ($$temp = showLabel) == null ? true : $$temp, value: value }, null, opt_ijData);
        incrementalDom.elementClose('div');
      }
      exports.render = $render;
      /**
       * @typedef {{
       *  checked: (boolean|null|undefined),
       *  disabled: (boolean|null|undefined),
       *  elementClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  inline: (boolean|null|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  labelContent: (function()|null|undefined),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showLabel: (boolean|null|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */
      $render.Params;
      if (goog.DEBUG) {
        $render.soyTemplateName = 'ClayRadio.render';
      }

      /**
       * @param {{
       *  checked: (boolean|null|undefined),
       *  disabled: (boolean|null|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  labelContent: (function()|null|undefined),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showLabel: (boolean|null|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */
      function $input(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        opt_data = opt_data || {};
        /** @type {boolean|null|undefined} */
        var checked = soy.asserts.assertType(opt_data.checked == null || goog.isBoolean(opt_data.checked) || opt_data.checked === 1 || opt_data.checked === 0, 'checked', opt_data.checked, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */
        var disabled = soy.asserts.assertType(opt_data.disabled == null || goog.isBoolean(opt_data.disabled) || opt_data.disabled === 1 || opt_data.disabled === 0, 'disabled', opt_data.disabled, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var label = soy.asserts.assertType(opt_data.label == null || goog.isString(opt_data.label) || opt_data.label instanceof goog.soy.data.SanitizedContent, 'label', opt_data.label, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {function()|null|undefined} */
        var labelContent = soy.asserts.assertType(opt_data.labelContent == null || goog.isFunction(opt_data.labelContent), 'labelContent', opt_data.labelContent, 'function()|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var name = soy.asserts.assertType(opt_data.name == null || goog.isString(opt_data.name) || opt_data.name instanceof goog.soy.data.SanitizedContent, 'name', opt_data.name, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */
        var showLabel = soy.asserts.assertType(opt_data.showLabel == null || goog.isBoolean(opt_data.showLabel) || opt_data.showLabel === 1 || opt_data.showLabel === 0, 'showLabel', opt_data.showLabel, 'boolean|null|undefined');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */
        var value = soy.asserts.assertType(opt_data.value == null || goog.isString(opt_data.value) || opt_data.value instanceof goog.soy.data.SanitizedContent, 'value', opt_data.value, '!goog.soy.data.SanitizedContent|null|string|undefined');
        incrementalDom.elementOpen('label');

        incrementalDom.elementOpenStart('input');
        (function inputAttributes__soy54() {
          if (checked) {
            incrementalDom.attr('checked', 'checked');
          }
          if (disabled) {
            incrementalDom.attr('disabled', 'disabled');
          }
          incrementalDom.attr('class', 'custom-control-input');
          if (name) {
            incrementalDom.attr('name', name);
          }
          if (value) {
            incrementalDom.attr('value', value);
          }
          incrementalDom.attr('ref', 'input');
          incrementalDom.attr('type', 'radio');
          incrementalDom.attr('role', 'radio');
        })();
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('input');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'custom-control-label');
        incrementalDom.elementOpenEnd();
        if (label) {
          var spanLabelClasses__soy82 = '';
          spanLabelClasses__soy82 += 'custom-control-label-text';
          spanLabelClasses__soy82 += !showLabel ? ' sr-only' : '';
          incrementalDom.elementOpenStart('span');
          incrementalDom.attr('class', spanLabelClasses__soy82);
          incrementalDom.elementOpenEnd();
          $templateAlias1(opt_data, null, opt_ijData);
          incrementalDom.elementClose('span');
        }
        incrementalDom.elementClose('span');
        if (labelContent) {
          labelContent();
        }
        incrementalDom.elementClose('label');
      }
      exports.input = $input;
      /**
       * @typedef {{
       *  checked: (boolean|null|undefined),
       *  disabled: (boolean|null|undefined),
       *  label: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  labelContent: (function()|null|undefined),
       *  name: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showLabel: (boolean|null|undefined),
       *  value: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */
      $input.Params;
      if (goog.DEBUG) {
        $input.soyTemplateName = 'ClayRadio.input';
      }

      exports.render.params = ["checked", "disabled", "elementClasses", "id", "inline", "label", "labelContent", "name", "showLabel", "value"];
      exports.render.types = { "checked": "bool", "disabled": "bool", "elementClasses": "string", "id": "string", "inline": "bool", "label": "string", "labelContent": "html", "name": "string", "showLabel": "bool", "value": "string" };
      exports.input.params = ["checked", "disabled", "label", "labelContent", "name", "showLabel", "value"];
      exports.input.types = { "checked": "bool", "disabled": "bool", "label": "string", "labelContent": "html", "name": "string", "showLabel": "bool", "value": "string" };
      exports.templates = templates = exports;
      return exports;
    });

    var ClayRadio = function (_Component) {
      _inherits(ClayRadio, _Component);

      function ClayRadio() {
        _classCallCheck(this, ClayRadio);

        return _possibleConstructorReturn(this, (ClayRadio.__proto__ || Object.getPrototypeOf(ClayRadio)).apply(this, arguments));
      }

      return ClayRadio;
    }(_metalComponent2.default);

    _metalSoy2.default.register(ClayRadio, templates);
    exports.ClayRadio = ClayRadio;
    exports.templates = templates;
    exports.default = templates;
    /* jshint ignore:end */
    //# sourceMappingURL=ClayRadio.soy.js.map
  }
});
//# sourceMappingURL=ClayRadio.soy.js.map