"use strict";

Liferay.Loader.define("@frontend-taglib-clay$clayui/label@3.56.0/lib/index", ['module', 'exports', 'require', '@frontend-taglib-clay$clayui/icon', '@frontend-taglib-clay$clayui/link', 'frontend-taglib-clay$classnames', 'frontend-js-react-web$react'], function (module, exports, require) {
  var define = undefined;
  var global = window;
  {
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = void 0;

    var _icon = _interopRequireDefault(require("@frontend-taglib-clay$clayui/icon"));

    var _link = _interopRequireDefault(require("@frontend-taglib-clay$clayui/link"));

    var _classnames = _interopRequireDefault(require("frontend-taglib-clay$classnames"));

    var _react = _interopRequireDefault(require("frontend-js-react-web$react"));

    var _excluded = ["children", "className"],
        _excluded2 = ["children", "className"],
        _excluded3 = ["children", "className", "href"],
        _excluded4 = ["children", "className", "dismissible", "displayType", "large"],
        _excluded5 = ["children", "closeButtonProps", "href", "innerElementProps", "withClose", "spritemap"];

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

    function _defineProperty(obj, key, value) {
      if (key in obj) {
        Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });
      } else {
        obj[key] = value;
      }return obj;
    }

    function _extends() {
      _extends = Object.assign || function (target) {
        for (var i = 1; i < arguments.length; i++) {
          var source = arguments[i];for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }return target;
      };return _extends.apply(this, arguments);
    }

    function _objectWithoutProperties(source, excluded) {
      if (source == null) return {};var target = _objectWithoutPropertiesLoose(source, excluded);var key, i;if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);for (i = 0; i < sourceSymbolKeys.length; i++) {
          key = sourceSymbolKeys[i];if (excluded.indexOf(key) >= 0) continue;if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;target[key] = source[key];
        }
      }return target;
    }

    function _objectWithoutPropertiesLoose(source, excluded) {
      if (source == null) return {};var target = {};var sourceKeys = Object.keys(source);var key, i;for (i = 0; i < sourceKeys.length; i++) {
        key = sourceKeys[i];if (excluded.indexOf(key) >= 0) continue;target[key] = source[key];
      }return target;
    }

    var ClayLabelItemAfter = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
      var children = _ref.children,
          className = _ref.className,
          otherProps = _objectWithoutProperties(_ref, _excluded);

      return (/*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
          className: (0, _classnames.default)(className, 'label-item label-item-after'),
          ref: ref
        }), children)
      );
    });

    ClayLabelItemAfter.displayName = 'ClayLabelItemAfter';

    var ClayLabelItemBefore = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
      var children = _ref2.children,
          className = _ref2.className,
          otherProps = _objectWithoutProperties(_ref2, _excluded2);

      return (/*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
          className: (0, _classnames.default)(className, 'label-item label-item-before'),
          ref: ref
        }), children)
      );
    });

    ClayLabelItemBefore.displayName = 'ClayLabelItemBefore';

    var ClayLabelItemExpand = /*#__PURE__*/_react.default.forwardRef(function (_ref3, ref) {
      var children = _ref3.children,
          className = _ref3.className,
          href = _ref3.href,
          otherProps = _objectWithoutProperties(_ref3, _excluded3);

      var TagName = href ? _link.default : 'span';
      return (/*#__PURE__*/_react.default.createElement(TagName, _extends({}, otherProps, {
          className: (0, _classnames.default)(className, 'label-item label-item-expand'),
          href: href,
          ref: ref
        }), children)
      );
    });

    ClayLabelItemExpand.displayName = 'ClayLabelItemExpand';

    var ClayLabel = /*#__PURE__*/_react.default.forwardRef(function (_ref4, ref) {
      var children = _ref4.children,
          className = _ref4.className,
          dismissible = _ref4.dismissible,
          _ref4$displayType = _ref4.displayType,
          displayType = _ref4$displayType === void 0 ? 'secondary' : _ref4$displayType,
          _ref4$large = _ref4.large,
          large = _ref4$large === void 0 ? false : _ref4$large,
          otherProps = _objectWithoutProperties(_ref4, _excluded4);

      return (/*#__PURE__*/_react.default.createElement("span", _extends({}, otherProps, {
          className: (0, _classnames.default)('label', className, _defineProperty({
            'label-dismissible': dismissible,
            'label-lg': large
          }, "label-".concat(displayType), displayType)),
          ref: ref
        }), children)
      );
    });

    ClayLabel.displayName = 'ClayLabel';

    var ClayLabelHybrid = /*#__PURE__*/_react.default.forwardRef(function (_ref5, ref) {
      var children = _ref5.children,
          closeButtonProps = _ref5.closeButtonProps,
          href = _ref5.href,
          _ref5$innerElementPro = _ref5.innerElementProps,
          innerElementProps = _ref5$innerElementPro === void 0 ? {} : _ref5$innerElementPro,
          _ref5$withClose = _ref5.withClose,
          withClose = _ref5$withClose === void 0 ? true : _ref5$withClose,
          spritemap = _ref5.spritemap,
          otherProps = _objectWithoutProperties(_ref5, _excluded5);

      return (/*#__PURE__*/_react.default.createElement(ClayLabel, _extends({
          dismissible: withClose && !!closeButtonProps
        }, otherProps, {
          ref: ref
        }), !withClose && children, withClose && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(ClayLabelItemExpand, _extends({}, innerElementProps, {
          href: href
        }), children), closeButtonProps && /*#__PURE__*/_react.default.createElement(ClayLabelItemAfter, null, /*#__PURE__*/_react.default.createElement("button", _extends({}, closeButtonProps, {
          className: (0, _classnames.default)(closeButtonProps.className, 'close'),
          type: "button"
        }), /*#__PURE__*/_react.default.createElement(_icon.default, {
          spritemap: spritemap,
          symbol: "times-small"
        })))))
      );
    });

    ClayLabelHybrid.displayName = 'ClayLabel';

    var _default = Object.assign(ClayLabelHybrid, {
      ItemAfter: ClayLabelItemAfter,
      ItemBefore: ClayLabelItemBefore,
      ItemExpand: ClayLabelItemExpand
    });

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