Liferay.Loader.define("commerce-frontend-taglib@10.1.5/price/Price.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.Price = 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 Price.soy.
      // Please don't edit this file by hand.

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

      goog.module('Price.incrementaldom');

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

      goog.require('goog.string');

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

      goog.require('soy.asserts');

      var soyIdom = goog.require('soy.idom');
      /**
       * @param {{
       *  prices: {discountPercentage: (!goog.soy.data.SanitizedContent|null|string|undefined), discountPercentages: (?), finalPrice: (!goog.soy.data.SanitizedContent|null|string|undefined), price: (!goog.soy.data.SanitizedContent|string), promoPrice: (!goog.soy.data.SanitizedContent|null|string|undefined)},
       *  additionalDiscountClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  additionalPromoPriceClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  displayDiscountLevels: (boolean|null|undefined),
       *  netPrice: (boolean|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;
        /** @type {{discountPercentage: (!goog.soy.data.SanitizedContent|null|string|undefined), discountPercentages: (?), finalPrice: (!goog.soy.data.SanitizedContent|null|string|undefined), price: (!goog.soy.data.SanitizedContent|string), promoPrice: (!goog.soy.data.SanitizedContent|null|string|undefined)}} */

        var prices = soy.asserts.assertType(goog.isObject(opt_data.prices), 'prices', opt_data.prices, '{discountPercentage: (!goog.soy.data.SanitizedContent|null|string|undefined), discountPercentages: (?), finalPrice: (!goog.soy.data.SanitizedContent|null|string|undefined), price: (!goog.soy.data.SanitizedContent|string), promoPrice: (!goog.soy.data.SanitizedContent|null|string|undefined)}');
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

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

        var displayDiscountLevels = soy.asserts.assertType(opt_data.displayDiscountLevels == null || goog.isBoolean(opt_data.displayDiscountLevels) || opt_data.displayDiscountLevels === 1 || opt_data.displayDiscountLevels === 0, 'displayDiscountLevels', opt_data.displayDiscountLevels, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var netPrice = soy.asserts.assertType(opt_data.netPrice == null || goog.isBoolean(opt_data.netPrice) || opt_data.netPrice === 1 || opt_data.netPrice === 0, 'netPrice', opt_data.netPrice, 'boolean|null|undefined');
        var inactiveClass__soy2600 = '';
        inactiveClass__soy2600 += prices.promoPrice != null || prices.discountPercentage != null && prices.finalPrice != null ? ' price-value-inactive' : '';
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'price');
        incrementalDom.elementOpenEnd();
        $default({
          price: prices.price,
          additionalPriceClasses: inactiveClass__soy2600
        }, null, opt_ijData);

        if (prices.promoPrice != null && prices.finalPrice != null) {
          $promoPrice({
            promoPrice: prices.promoPrice,
            additionalPromoPriceClasses: inactiveClass__soy2600
          }, null, opt_ijData);
        } else if (prices.promoPrice != null) {
          $promoPrice({
            promoPrice: prices.promoPrice,
            additionalPromoPriceClasses: additionalPromoPriceClasses
          }, null, opt_ijData);
        }

        if (prices.finalPrice != null && (prices.discountPercentage != null || prices.discountPercentages != null)) {
          $discount({
            percentage: prices.discountPercentage,
            percentages: prices.discountPercentages,
            displayDiscountLevels: displayDiscountLevels,
            netPrice: netPrice,
            finalPrice: prices.finalPrice,
            additionalDiscountClasses: additionalDiscountClasses
          }, null, opt_ijData);
        }

        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  prices: {discountPercentage: (!goog.soy.data.SanitizedContent|null|string|undefined), discountPercentages: (?), finalPrice: (!goog.soy.data.SanitizedContent|null|string|undefined), price: (!goog.soy.data.SanitizedContent|string), promoPrice: (!goog.soy.data.SanitizedContent|null|string|undefined)},
       *  additionalDiscountClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  additionalPromoPriceClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  displayDiscountLevels: (boolean|null|undefined),
       *  netPrice: (boolean|null|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'Price.render';
      }
      /**
       * @param {{
       *  promoPrice: (!goog.soy.data.SanitizedContent|string),
       *  additionalPromoPriceClasses: (!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 $promoPrice(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

        var additionalPromoPriceClasses = soy.asserts.assertType(opt_data.additionalPromoPriceClasses == null || goog.isString(opt_data.additionalPromoPriceClasses) || opt_data.additionalPromoPriceClasses instanceof goog.soy.data.SanitizedContent, 'additionalPromoPriceClasses', opt_data.additionalPromoPriceClasses, '!goog.soy.data.SanitizedContent|null|string|undefined');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-label');
        incrementalDom.elementOpenEnd();
        /** @desc Sale Price */

        var MSG_EXTERNAL_8774360476335784969 = Liferay.Language.get('sale-price');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_8774360476335784969));
        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-value price-value-promo ' + additionalPromoPriceClasses);
        incrementalDom.elementOpenEnd();
        soyIdom.print(promoPrice);
        incrementalDom.elementClose('span');
      }

      exports.promoPrice = $promoPrice;
      /**
       * @typedef {{
       *  promoPrice: (!goog.soy.data.SanitizedContent|string),
       *  additionalPromoPriceClasses: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $promoPrice.Params;

      if (goog.DEBUG) {
        $promoPrice.soyTemplateName = 'Price.promoPrice';
      }
      /**
       * @param {{
       *  finalPrice: (!goog.soy.data.SanitizedContent|string),
       *  percentage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  percentages: (?),
       *  additionalDiscountClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  displayDiscountLevels: (boolean|null|undefined),
       *  netPrice: (boolean|null|undefined)
       * }} opt_data
       * @param {Object<string, *>=} opt_ijData
       * @param {Object<string, *>=} opt_ijData_deprecated
       * @return {void}
       * @suppress {checkTypes}
       */

      function $discount(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

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

        var percentages = opt_data.percentages;
        /** @type {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

        var displayDiscountLevels = soy.asserts.assertType(opt_data.displayDiscountLevels == null || goog.isBoolean(opt_data.displayDiscountLevels) || opt_data.displayDiscountLevels === 1 || opt_data.displayDiscountLevels === 0, 'displayDiscountLevels', opt_data.displayDiscountLevels, 'boolean|null|undefined');
        /** @type {boolean|null|undefined} */

        var netPrice = soy.asserts.assertType(opt_data.netPrice == null || goog.isBoolean(opt_data.netPrice) || opt_data.netPrice === 1 || opt_data.netPrice === 0, 'netPrice', opt_data.netPrice, 'boolean|null|undefined');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-label');
        incrementalDom.elementOpenEnd();
        /** @desc Discount */

        var MSG_EXTERNAL_2488517531111496503 = Liferay.Language.get('discount');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2488517531111496503));
        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-value price-value-discount');
        incrementalDom.elementOpenEnd();

        if (percentages != null && displayDiscountLevels == true) {
          var value2669List = percentages;
          var value2669ListLen = value2669List.length;

          for (var value2669Index = 0; value2669Index < value2669ListLen; value2669Index++) {
            var value2669Data = value2669List[value2669Index];
            incrementalDom.elementOpenStart('span');
            incrementalDom.attr('class', 'price-value-percentages');
            incrementalDom.elementOpenEnd();
            soyIdom.print(value2669Data);
            incrementalDom.elementClose('span');
          }
        } else {
          incrementalDom.text("\u2013");
          soyIdom.print(percentage);
          incrementalDom.text('%');
        }

        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-label');
        incrementalDom.elementOpenEnd();

        if (netPrice == true) {
          /** @desc Net Price */
          var MSG_EXTERNAL_2521905681851283145 = Liferay.Language.get('net-price');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2521905681851283145));
        } else {
          /** @desc Gross Price */
          var MSG_EXTERNAL_8721371572543711893 = Liferay.Language.get('gross-price');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_8721371572543711893));
        }

        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-value price-value-final ' + additionalDiscountClasses);
        incrementalDom.elementOpenEnd();
        soyIdom.print(finalPrice);
        incrementalDom.elementClose('span');
      }

      exports.discount = $discount;
      /**
       * @typedef {{
       *  finalPrice: (!goog.soy.data.SanitizedContent|string),
       *  percentage: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  percentages: (?),
       *  additionalDiscountClasses: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  displayDiscountLevels: (boolean|null|undefined),
       *  netPrice: (boolean|null|undefined)
       * }}
       */

      $discount.Params;

      if (goog.DEBUG) {
        $discount.soyTemplateName = 'Price.discount';
      }
      /**
       * @param {{
       *  price: (!goog.soy.data.SanitizedContent|string),
       *  additionalPriceClasses: (!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 $default(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;
        /** @type {!goog.soy.data.SanitizedContent|string} */

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

        var additionalPriceClasses = soy.asserts.assertType(opt_data.additionalPriceClasses == null || goog.isString(opt_data.additionalPriceClasses) || opt_data.additionalPriceClasses instanceof goog.soy.data.SanitizedContent, 'additionalPriceClasses', opt_data.additionalPriceClasses, '!goog.soy.data.SanitizedContent|null|string|undefined');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-label');
        incrementalDom.elementOpenEnd();
        /** @desc List Price */

        var MSG_EXTERNAL_7163255960210191949 = Liferay.Language.get('list-price');
        incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_7163255960210191949));
        incrementalDom.elementClose('span');
        incrementalDom.elementOpenStart('span');
        incrementalDom.attr('class', 'price-value ' + additionalPriceClasses);
        incrementalDom.elementOpenEnd();
        soyIdom.print(price);
        incrementalDom.elementClose('span');
      }

      exports.default = $default;
      /**
       * @typedef {{
       *  price: (!goog.soy.data.SanitizedContent|string),
       *  additionalPriceClasses: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $default.Params;

      if (goog.DEBUG) {
        $default.soyTemplateName = 'Price.default';
      }

      exports.render.params = ["prices", "additionalDiscountClasses", "additionalPromoPriceClasses", "displayDiscountLevels", "netPrice"];
      exports.render.types = {
        "prices": "[\n\t\tprice: string,\n\t\tpromoPrice: string|null,\n\t\tdiscountPercentage: string|null,\n\t\tdiscountPercentages: ?,\n\t\tfinalPrice: string|null\n\t]",
        "additionalDiscountClasses": "string",
        "additionalPromoPriceClasses": "string",
        "displayDiscountLevels": "bool",
        "netPrice": "bool"
      };
      exports.promoPrice.params = ["promoPrice", "additionalPromoPriceClasses"];
      exports.promoPrice.types = {
        "promoPrice": "string",
        "additionalPromoPriceClasses": "string"
      };
      exports.discount.params = ["finalPrice", "percentage", "percentages", "additionalDiscountClasses", "displayDiscountLevels", "netPrice"];
      exports.discount.types = {
        "finalPrice": "string",
        "percentage": "string",
        "percentages": "? ",
        "additionalDiscountClasses": "string",
        "displayDiscountLevels": "bool",
        "netPrice": "bool"
      };
      exports.default.params = ["price", "additionalPriceClasses"];
      exports.default.types = {
        "price": "string",
        "additionalPriceClasses": "string"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return Price;
    }(_metalComponent.default);

    exports.Price = Price;

    _metalSoy.default.register(Price, templates);

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

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