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

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

      goog.module('OrdersTable.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');

      var $templateAlias2 = _metalSoy.default.getTemplate('AutocompleteItem.incrementaldom', 'render');

      var $templateAlias1 = _metalSoy.default.getTemplate('ClayIcon.incrementaldom', 'render');
      /**
       * @param {{
       *  currentAccountName: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showBack: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  filterString: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  isVisible: (boolean|null|undefined),
       *  createNewOrderLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  viewAllOrdersLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  orders: (!Array<{addOrderLink: (!goog.soy.data.SanitizedContent|string), id: (!goog.soy.data.SanitizedContent|number|string), lastEdit: (!goog.soy.data.SanitizedContent|string), status: (!goog.soy.data.SanitizedContent|string)}>|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 {!goog.soy.data.SanitizedContent|null|string|undefined} */

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

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

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

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

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

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

        var viewAllOrdersLink = soy.asserts.assertType(opt_data.viewAllOrdersLink == null || goog.isString(opt_data.viewAllOrdersLink) || opt_data.viewAllOrdersLink instanceof goog.soy.data.SanitizedContent, 'viewAllOrdersLink', opt_data.viewAllOrdersLink, '!goog.soy.data.SanitizedContent|null|string|undefined');
        /** @type {!Array<{addOrderLink: (!goog.soy.data.SanitizedContent|string), id: (!goog.soy.data.SanitizedContent|number|string), lastEdit: (!goog.soy.data.SanitizedContent|string), status: (!goog.soy.data.SanitizedContent|string)}>|null|undefined} */

        var orders = soy.asserts.assertType(opt_data.orders == null || goog.isArray(opt_data.orders), 'orders', opt_data.orders, '!Array<{addOrderLink: (!goog.soy.data.SanitizedContent|string), id: (!goog.soy.data.SanitizedContent|number|string), lastEdit: (!goog.soy.data.SanitizedContent|string), status: (!goog.soy.data.SanitizedContent|string)}>|null|undefined');
        var msg_17961__soy17962 = '';
        /** @desc Search Order... */

        var MSG_EXTERNAL_6416471168211389442 = Liferay.Language.get('search-order');
        msg_17961__soy17962 += goog.string.unescapeEntities(MSG_EXTERNAL_6416471168211389442);
        var orderSwitcherClasses__soy431 = '';
        orderSwitcherClasses__soy431 += 'commerce-account-switcher commerce-account-switcher--orders';
        orderSwitcherClasses__soy431 += isVisible ? ' is-visible' : '';
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', orderSwitcherClasses__soy431);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-account-switcher__section commerce-account-switcher__section--header');
        incrementalDom.elementOpenEnd();

        if (showBack) {
          incrementalDom.elementOpenStart('button');
          incrementalDom.attr('class', 'commerce-account-switcher__back');
          incrementalDom.attr('data-onclick', '_handleBackButtonClick');
          incrementalDom.elementOpenEnd();
          $templateAlias1({
            spritemap: spritemap,
            symbol: 'arrow-back'
          }, null, opt_ijData);
          /** @desc Back */

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

        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-account-switcher__title');
        incrementalDom.elementOpenEnd();

        if (currentAccountName != null) {
          soyIdom.print(currentAccountName);
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-account-switcher__section');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('form');
        incrementalDom.attr('class', 'commerce-search');
        incrementalDom.attr('data-onsubmit', '_handleSubmitFilter');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-search__input');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('input');
        incrementalDom.attr('type', 'text');
        incrementalDom.attr('data-onkeyup', '_handleFilterChange');
        incrementalDom.attr('placeholder', msg_17961__soy17962);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('input');
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('form');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-account-switcher__section commerce-account-switcher__section--fill commerce-account-switcher__section--padded');
        incrementalDom.elementOpenEnd();

        if (orders != null && orders.length > 0) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-small-table d-table');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-head-group');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-row');
          incrementalDom.elementOpenEnd();
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-cell');
          incrementalDom.elementOpenEnd();
          /** @desc Select Order */

          var MSG_EXTERNAL_7686339709588125772 = Liferay.Language.get('select-order');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_7686339709588125772));
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-cell u-tac');
          incrementalDom.elementOpenEnd();
          /** @desc Status */

          var MSG_EXTERNAL_3336682057311020015 = Liferay.Language.get('status');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_3336682057311020015));
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-cell u-tar');
          incrementalDom.elementOpenEnd();
          /** @desc Last Modified */

          var MSG_EXTERNAL_1357259265837765608 = Liferay.Language.get('last-modified');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_1357259265837765608));
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'd-table-row-group');
          incrementalDom.elementOpenEnd();
          var order485List = orders;
          var order485ListLen = order485List.length;

          for (var order485Index = 0; order485Index < order485ListLen; order485Index++) {
            var order485Data = order485List[order485Index];
            $order({
              id: order485Data.id,
              status: order485Data.status,
              lastEdit: order485Data.lastEdit,
              addOrderLink: order485Data.addOrderLink,
              query: filterString
            }, null, opt_ijData);
          }

          incrementalDom.elementClose('div');
          incrementalDom.elementClose('div');
        }

        if (orders != null && orders.length == 0) {
          incrementalDom.elementOpenStart('div');
          incrementalDom.attr('class', 'commerce-account-switcher__empty-table p-0');
          incrementalDom.elementOpenEnd();
          /** @desc No orders were found. */

          var MSG_EXTERNAL_4580875699676601391 = Liferay.Language.get('no-orders-were-found');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_4580875699676601391));
          incrementalDom.elementClose('div');
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'commerce-account-switcher__section');
        incrementalDom.elementOpenEnd();

        if (createNewOrderLink != null) {
          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('href', createNewOrderLink);
          incrementalDom.attr('class', 'commerce-account-switcher__button commerce-button commerce-button--block commerce-button--link');
          incrementalDom.elementOpenEnd();
          /** @desc Create New Order */

          var MSG_EXTERNAL_655212862483054153 = Liferay.Language.get('create-new-order');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_655212862483054153));
          incrementalDom.elementClose('a');
        }

        if (viewAllOrdersLink != null) {
          incrementalDom.elementOpenStart('a');
          incrementalDom.attr('href', viewAllOrdersLink);
          incrementalDom.attr('class', 'commerce-account-switcher__button commerce-button commerce-button--block');
          incrementalDom.elementOpenEnd();
          /** @desc View All Orders */

          var MSG_EXTERNAL_2930087101612836553 = Liferay.Language.get('view-all-orders');
          incrementalDom.text(goog.string.unescapeEntities(MSG_EXTERNAL_2930087101612836553));
          incrementalDom.elementClose('a');
        }

        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
      }

      exports.render = $render;
      /**
       * @typedef {{
       *  currentAccountName: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  showBack: (boolean|null|undefined),
       *  spritemap: (!goog.soy.data.SanitizedContent|string),
       *  filterString: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  isVisible: (boolean|null|undefined),
       *  createNewOrderLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  viewAllOrdersLink: (!goog.soy.data.SanitizedContent|null|string|undefined),
       *  orders: (!Array<{addOrderLink: (!goog.soy.data.SanitizedContent|string), id: (!goog.soy.data.SanitizedContent|number|string), lastEdit: (!goog.soy.data.SanitizedContent|string), status: (!goog.soy.data.SanitizedContent|string)}>|null|undefined)
       * }}
       */

      $render.Params;

      if (goog.DEBUG) {
        $render.soyTemplateName = 'OrdersTable.render';
      }
      /**
       * @param {{
       *  id: (!goog.soy.data.SanitizedContent|number|string),
       *  status: (!goog.soy.data.SanitizedContent|string),
       *  lastEdit: (!goog.soy.data.SanitizedContent|string),
       *  addOrderLink: (!goog.soy.data.SanitizedContent|string),
       *  query: (!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 $order(opt_data, opt_ijData, opt_ijData_deprecated) {
        opt_ijData = opt_ijData_deprecated || opt_ijData;

        /** @type {!goog.soy.data.SanitizedContent|number|string} */

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

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

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

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

        var query = soy.asserts.assertType(opt_data.query == null || goog.isString(opt_data.query) || opt_data.query instanceof goog.soy.data.SanitizedContent, 'query', opt_data.query, '!goog.soy.data.SanitizedContent|null|string|undefined');
        var statusClasses__soy524 = '';
        statusClasses__soy524 += 'd-inline-block commerce-dot commerce-dot--';
        var $tmp = status;

        switch (goog.isObject($tmp) ? $tmp.toString() : $tmp) {
          case 'approved':
            statusClasses__soy524 += 'good';
            break;

          case 'pending':
            statusClasses__soy524 += 'neutral';
            break;

          default:
            statusClasses__soy524 += 'bad';
        }

        incrementalDom.elementOpenStart('a');
        incrementalDom.attr('class', 'd-table-row');
        incrementalDom.attr('href', addOrderLink);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'd-table-cell');
        incrementalDom.elementOpenEnd();
        $templateAlias2({
          text: id,
          query: query
        }, null, opt_ijData);
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'd-table-cell u-tac');
        incrementalDom.elementOpenEnd();
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', statusClasses__soy524);
        incrementalDom.elementOpenEnd();
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('div');
        incrementalDom.elementOpenStart('div');
        incrementalDom.attr('class', 'd-table-cell u-tar');
        incrementalDom.elementOpenEnd();
        soyIdom.print(lastEdit);
        incrementalDom.elementClose('div');
        incrementalDom.elementClose('a');
      }

      exports.order = $order;
      /**
       * @typedef {{
       *  id: (!goog.soy.data.SanitizedContent|number|string),
       *  status: (!goog.soy.data.SanitizedContent|string),
       *  lastEdit: (!goog.soy.data.SanitizedContent|string),
       *  addOrderLink: (!goog.soy.data.SanitizedContent|string),
       *  query: (!goog.soy.data.SanitizedContent|null|string|undefined)
       * }}
       */

      $order.Params;

      if (goog.DEBUG) {
        $order.soyTemplateName = 'OrdersTable.order';
      }

      exports.render.params = ["currentAccountName", "showBack", "spritemap", "filterString", "isVisible", "createNewOrderLink", "viewAllOrdersLink", "orders"];
      exports.render.types = {
        "currentAccountName": "string",
        "showBack": "bool",
        "spritemap": "string",
        "filterString": "string",
        "isVisible": "bool",
        "createNewOrderLink": "string",
        "viewAllOrdersLink": "string",
        "orders": "list<[\n\t\tid: string|number,\n\t\tstatus: string,\n\t\tlastEdit: string,\n\t\taddOrderLink: string\n\t]>"
      };
      exports.order.params = ["id", "status", "lastEdit", "addOrderLink", "query"];
      exports.order.types = {
        "id": "number|string",
        "status": "string",
        "lastEdit": "string",
        "addOrderLink": "string",
        "query": "string"
      };
      exports.templates = templates = exports;
      return exports;
    });

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

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

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

      return OrdersTable;
    }(_metalComponent.default);

    exports.OrdersTable = OrdersTable;

    _metalSoy.default.register(OrdersTable, templates);

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

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