Liferay.Loader.define("commerce-product-options-web@3.0.22/CPOptionDetail.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.default = exports.templates = exports.CPOptionDetail = void 0;

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

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

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

    function _typeof(obj) {
      "@babel/helpers - typeof";
      if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
        _typeof = function _typeof(obj) {
          return typeof obj;
        };
      } else {
        _typeof = function _typeof(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
      }return _typeof(obj);
    }

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

    function _possibleConstructorReturn(self, call) {
      if (call && (_typeof(call) === "object" || typeof call === "function")) {
        return call;
      }return _assertThisInitialized(self);
    }

    function _assertThisInitialized(self) {
      if (self === void 0) {
        throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      }return self;
    }

    function _getPrototypeOf(o) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
        return o.__proto__ || Object.getPrototypeOf(o);
      };return _getPrototypeOf(o);
    }

    function _inherits(subClass, superClass) {
      if (typeof superClass !== "function" && superClass !== null) {
        throw new TypeError("Super expression must either be null or a function");
      }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);
    }

    function _setPrototypeOf(o, p) {
      _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
        o.__proto__ = p;return o;
      };return _setPrototypeOf(o, p);
    }

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

      goog.require('soydata');

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

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

      goog.module('CPOptionDetail.incrementaldom');

      goog.require('goog.soy.data.SanitizedContent');

      goog.require('goog.string');

      var incrementalDom = goog.require('incrementaldom');

      goog.require('soy.asserts');

      goog.require('soy.idom');

      /**
       * @param {{
       *  cpOptionId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  hasEditPermission: (boolean|null|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleDeleteOption: (*|null|undefined),
       *  _handleSaveOption: (*|null|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;
        opt_data = opt_data || {};
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

        var cpOptionId = soy.asserts.assertType(opt_data.cpOptionId == null || goog.isString(opt_data.cpOptionId) || opt_data.cpOptionId instanceof goog.soy.data.SanitizedContent, 'cpOptionId', opt_data.cpOptionId, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {boolean|null|undefined} */

        var hasEditPermission = soy.asserts.assertType(opt_data.hasEditPermission == null || goog.isBoolean(opt_data.hasEditPermission) || opt_data.hasEditPermission === 1 || opt_data.hasEditPermission === 0, 'hasEditPermission', opt_data.hasEditPermission, 'boolean|null|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 {*|null|undefined} */

        var _handleDeleteOption = opt_data._handleDeleteOption;
        /** @type {*|null|undefined} */

        var _handleSaveOption = opt_data._handleSaveOption;
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('id', id);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('h4');
        incrementalDom.attr('class', 'section-header');
        incrementalDom.elementOpenEnd();
        /** @desc  */

        var MSG_EXTERNAL_835466812404043376 = Liferay.Language.get('option-template-detail');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_835466812404043376));
        incrementalDom.elementClose('h4');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'option-detail');
        incrementalDom.attr('ref', 'option-detail');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('div');

        if (hasEditPermission) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'option-rel-button-row');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('button');
          incrementalDom.attr('class', 'btn btn-primary');
          incrementalDom.attr('onclick', _handleSaveOption);
          incrementalDom.attr('type', 'button');
          incrementalDom.elementOpenEnd();
          /** @desc  */

          var MSG_EXTERNAL_8640257554156088424 = Liferay.Language.get('save');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_8640257554156088424));
          incrementalDom.elementClose('button');

          if (cpOptionId != '0') {
            incrementalDom.elementOpenStart('button');
            incrementalDom.attr('class', 'btn btn-secondary');
            incrementalDom.attr('onclick', _handleDeleteOption);
            incrementalDom.attr('type', 'button');
            incrementalDom.elementOpenEnd();
            /** @desc  */

            var MSG_EXTERNAL_2456043080471762298 = Liferay.Language.get('delete');
            incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2456043080471762298));
            incrementalDom.elementClose('button');
          }

          incrementalDom.elementClose('div');
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  cpOptionId: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  hasEditPermission: (boolean|null|undefined),
       *  id: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  _handleDeleteOption: (*|null|undefined),
       *  _handleSaveOption: (*|null|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'CPOptionDetail.render';
      }

      exports.render.params = ["cpOptionId", "hasEditPermission", "id", "_handleDeleteOption", "_handleSaveOption"];
      exports.render.types = {
        "cpOptionId": "string",
        "hasEditPermission": "bool",
        "id": "string",
        "_handleDeleteOption": "any ",
        "_handleSaveOption": "any "
      };
      exports.templates = templates = exports;
      return exports;
    });

    var CPOptionDetail = /*#__PURE__*/function (_Component) {
      _inherits(CPOptionDetail, _Component);

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

        return _possibleConstructorReturn(this, _getPrototypeOf(CPOptionDetail).apply(this, arguments));
      }

      return CPOptionDetail;
    }(_metalComponent.default);

    exports.CPOptionDetail = CPOptionDetail;

    _metalSoy.default.register(CPOptionDetail, templates);

    var _default = templates;
    /* jshint ignore:end */

    exports.default = _default;
    //# sourceMappingURL=CPOptionDetail.soy.js.map
  }
});
//# sourceMappingURL=CPOptionDetail.soy.js.map