"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _RawText = _interopRequireWildcard(require("./RawText"));
var _TextSt = require("./Text.st.css.js");
var _Ellipsis = _interopRequireWildcard(require("../common/Ellipsis"));
var _excluded = ["ellipsis", "appendTo", "flip", "fixed", "placement", "zIndex", "enterDelay", "exitDelay", "showTooltip", "size", "secondary", "skin", "light", "weight", "tagName", "listStyle", "widows", "overflowWrap", "id"],
  _excluded2 = ["className", "tooltipProps"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Text/Text.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var TextWithEllipsis = _ref => {
  var {
      ellipsis = false,
      appendTo = _Ellipsis.default.defaultProps.appendTo,
      flip = _Ellipsis.default.defaultProps.flip,
      fixed = _Ellipsis.default.defaultProps.fixed,
      placement = _Ellipsis.default.defaultProps.placement,
      zIndex = _Ellipsis.default.defaultProps.zIndex,
      enterDelay = _Ellipsis.default.defaultProps.enterDelay,
      exitDelay = _Ellipsis.default.defaultProps.exitDelay,
      showTooltip = _Ellipsis.default.defaultProps.showTooltip,
      size = _RawText.RawTextDefaultProps.size,
      secondary = _RawText.RawTextDefaultProps.secondary,
      skin = _RawText.RawTextDefaultProps.skin,
      light = _RawText.RawTextDefaultProps.light,
      weight = _RawText.RawTextDefaultProps.weight,
      tagName = _RawText.RawTextDefaultProps.tagName,
      listStyle = _RawText.RawTextDefaultProps.listStyle,
      widows = _RawText.RawTextDefaultProps.widows,
      overflowWrap = _RawText.RawTextDefaultProps.overflowWrap,
      id
    } = _ref,
    propsWithNoDefaults = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var _RawTextDefaultProps$ = _objectSpread(_objectSpread(_objectSpread({}, _RawText.RawTextDefaultProps), _Ellipsis.default.defaultProps), {}, {
      ellipsis,
      appendTo,
      flip,
      fixed,
      placement,
      zIndex,
      enterDelay,
      exitDelay,
      showTooltip,
      size,
      secondary,
      skin,
      light,
      weight,
      tagName,
      listStyle,
      id,
      widows,
      overflowWrap
    }, propsWithNoDefaults),
    {
      className,
      tooltipProps
    } = _RawTextDefaultProps$,
    props = (0, _objectWithoutProperties2.default)(_RawTextDefaultProps$, _excluded2);
  var {
    ellipsisProps,
    componentProps
  } = (0, _Ellipsis.extractEllipsisProps)(props);
  return /*#__PURE__*/_react.default.createElement(_Ellipsis.default, (0, _extends2.default)({}, ellipsisProps, tooltipProps, {
    wrapperClassName: (0, _TextSt.st)(_TextSt.classes.root, {
      size: props.size,
      weight: props.weight,
      listStyle: props.listStyle
    }),
    render: _ref2 => {
      var {
        ref,
        ellipsisClasses,
        ellipsisInlineStyle,
        renderChildren,
        renderElement
      } = _ref2;
      return /*#__PURE__*/_react.default.createElement(_RawText.default, (0, _extends2.default)({}, componentProps, {
        tagName: tagName,
        ref: ref,
        className: ellipsisClasses(className),
        style: ellipsisInlineStyle,
        renderChildren: renderChildren,
        renderElement: renderElement,
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 71,
          columnNumber: 9
        }
      }));
    },
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 56,
      columnNumber: 5
    }
  }));
};
TextWithEllipsis.displayName = 'Text';
var _default = exports.default = TextWithEllipsis;
//# sourceMappingURL=Text.js.map