import { n } from './inject-css-C2dztUxs.js';
import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import classnames from 'classnames';
import Check from '@bigbinary/neeto-icons/Check';
import Typography from '@bigbinary/neetoui/Typography';
import Avatar from '@bigbinary/neetoui/Avatar';
import { jsxs, jsx } from 'react/jsx-runtime';
import { useRef } from 'react';
import NeetoUISearchIcon from '@bigbinary/neeto-icons/Search';
import Close from '@bigbinary/neeto-icons/Close';
import Input from '@bigbinary/neetoui/Input';

var css = ".ntm-assign-droplist__item{border:none;flex-shrink:0;min-height:2rem;outline:none}.ntm-assign-droplist__item:last-child{margin-bottom:0!important}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3NyYy9zdHlsZXNoZWV0cy9jb21wb25lbnRzL2Ryb3Bkb3duLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwyQkFJRSxXQUFZLENBRlosYUFBYyxDQURkLGVBQWdCLENBRWhCLFlBRUYsQ0FFQSxzQ0FDRSx5QkFDRiIsInNvdXJjZXNDb250ZW50IjpbIi5udG0tYXNzaWduLWRyb3BsaXN0X19pdGVtIHtcbiAgbWluLWhlaWdodDogMnJlbTtcbiAgZmxleC1zaHJpbms6IDA7XG4gIG91dGxpbmU6IG5vbmU7XG4gIGJvcmRlcjogbm9uZTtcbn1cblxuLm50bS1hc3NpZ24tZHJvcGxpc3RfX2l0ZW06bGFzdC1jaGlsZCB7XG4gIG1hcmdpbi1ib3R0b206IDAgIWltcG9ydGFudDtcbn1cbiJdfQ== */";
n(css,{});

var CHECK_ICON_SIZE = 20;

var _excluded$3 = ["active", "memberName", "imageUrl"];
function ownKeys$3(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$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var MembersListItem = function MembersListItem(_ref) {
  var active = _ref.active,
    memberName = _ref.memberName,
    imageUrl = _ref.imageUrl,
    otherProps = _objectWithoutProperties(_ref, _excluded$3);
  var buttonClassNames = classnames("ntm-assign-droplist__item neeto-ui-rounded mb-2 flex transform cursor-pointer select-none items-center gap-2 px-2 py-1 pe-7 text-start transition-colors", {
    "neeto-ui-bg-primary-500 neeto-ui-text-white focus:neeto-ui-bg-primary-500 hover:neeto-ui-bg-primary-500": active,
    "hover:neeto-ui-bg-gray-200 focus:neeto-ui-bg-gray-100": !active
  });
  return /*#__PURE__*/jsxs("button", _objectSpread$3(_objectSpread$3({
    className: buttonClassNames
  }, otherProps), {}, {
    "data-testid": "inbox-member-list-item",
    children: [memberName && /*#__PURE__*/jsx(Avatar, {
      className: "shrink-0",
      size: "small",
      user: {
        name: memberName,
        imageUrl: imageUrl
      }
    }), /*#__PURE__*/jsx(Typography, {
      className: "min-w-0 break-words",
      component: "span",
      style: "h5",
      weight: "normal",
      children: memberName
    }), active && /*#__PURE__*/jsx("div", {
      className: "absolute end-0 top-0 flex h-full items-center pe-2",
      children: /*#__PURE__*/jsx(Check, {
        size: CHECK_ICON_SIZE
      })
    })]
  }));
};

var _excluded$2 = ["placeholder", "searchTerm", "handleClearSearchTerm"];
function ownKeys$2(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$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var Search = function Search(_ref) {
  var placeholder = _ref.placeholder,
    searchTerm = _ref.searchTerm,
    handleClearSearchTerm = _ref.handleClearSearchTerm,
    otherProps = _objectWithoutProperties(_ref, _excluded$2);
  var inputRef = useRef(null);
  var renderClose = function renderClose() {
    return /*#__PURE__*/jsx(Close, {
      className: "cursor-pointer",
      onClick: function onClick() {
        inputRef.current.focus();
        handleClearSearchTerm();
      }
    });
  };
  return /*#__PURE__*/jsx("div", {
    className: "neeto-ui-bg-white ntm-assign-droplist__search sticky top-0 z-10 w-full p-3",
    onClick: function onClick(e) {
      return e.stopPropagation();
    },
    children: /*#__PURE__*/jsx(Input, _objectSpread$2({
      autoFocus: true,
      prefix: /*#__PURE__*/jsx(NeetoUISearchIcon, {}),
      ref: inputRef,
      suffix: renderClose(),
      value: searchTerm
    }, _objectSpread$2({
      placeholder: placeholder
    }, otherProps)))
  });
};

var _excluded$1 = ["active", "teamName"];
function ownKeys$1(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$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var TeamsListItem = function TeamsListItem(_ref) {
  var active = _ref.active,
    teamName = _ref.teamName,
    otherProps = _objectWithoutProperties(_ref, _excluded$1);
  var buttonClassNames = classnames("ntm-assign-droplist__item neeto-ui-rounded mb-2 flex transform cursor-pointer select-none items-center gap-2 p-2 pe-8 text-start transition-colors", {
    "neeto-ui-bg-primary-500 neeto-ui-text-white focus:neeto-ui-bg-primary-500 hover:neeto-ui-bg-primary-500": active,
    "hover:neeto-ui-bg-gray-200 focus:neeto-ui-bg-gray-200": !active
  });
  return /*#__PURE__*/jsxs("button", _objectSpread$1(_objectSpread$1({
    className: buttonClassNames
  }, otherProps), {}, {
    "data-testid": "inbox-group-list-item",
    children: [/*#__PURE__*/jsx(Typography, {
      className: "flex min-w-0 grow flex-wrap items-center break-words",
      component: "span",
      style: "h5",
      weight: "normal",
      children: teamName
    }), active && /*#__PURE__*/jsx("div", {
      className: "absolute end-0 top-0 flex h-full items-center pe-2",
      children: /*#__PURE__*/jsx(Check, {
        size: CHECK_ICON_SIZE
      })
    })]
  }));
};

var _excluded = ["children"];
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), true).forEach(function (r) { _defineProperty(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 AssignList = function AssignList(_ref) {
  var children = _ref.children,
    otherProps = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
    className: "ntm-assign-droplist w-64 pb-3"
  }, otherProps), {}, {
    children: /*#__PURE__*/jsx("div", {
      className: "ntm-assign-droplist__col flex w-full flex-col",
      children: children
    })
  }));
};
AssignList.Search = Search;
AssignList.MembersListItem = MembersListItem;
AssignList.TeamsListItem = TeamsListItem;

export { AssignList as A };
//# sourceMappingURL=index-Be5r1Jcl.js.map
