"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.IncidentRespondentsOption = exports.IncidentRespondentsMultiValueLabel = exports.IncidentPrioritySingleValue = exports.IncidentPriorityOption = exports.IncidentCommandersSingleValue = exports.IncidentCommandersOption = void 0;

var _reactSelect = require("react-select");

var _react = _interopRequireDefault(require("react"));

var _Avatar = require("../Avatar");

var _jsxRuntime = require("react/jsx-runtime");

var _excluded = ["children"],
    _excluded2 = ["children"];

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: 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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

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 _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 IncidentPrioritySingleValue = function IncidentPrioritySingleValue(_ref) {
  var children = _ref.children,
      props = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.SingleValue, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-wrap",
      children: [props.data.icon({
        className: "mr-2 mt-1"
      }), children]
    })
  }));
};

exports.IncidentPrioritySingleValue = IncidentPrioritySingleValue;

var IncidentPriorityOption = function IncidentPriorityOption(_ref2) {
  var children = _ref2.children,
      props = _objectWithoutProperties(_ref2, _excluded2);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-row",
      children: [props.data.icon({
        className: "mr-2 mt-1"
      }), children]
    })
  }));
};

exports.IncidentPriorityOption = IncidentPriorityOption;

var IncidentCommandersSingleValue = function IncidentCommandersSingleValue(_ref3) {
  var props = _extends({}, _ref3);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.SingleValue, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-wrap gap-1.5 text-sm align-baseline",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
        user: props.data,
        size: "sm"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
        className: "mt-0.5",
        children: props.data.label.split(" ")[0]
      })]
    })
  }));
};

exports.IncidentCommandersSingleValue = IncidentCommandersSingleValue;

var IncidentCommandersOption = function IncidentCommandersOption(_ref4) {
  var props = _extends({}, _ref4);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-row gap-1.5 text-sm",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
        user: props.data,
        size: "sm"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
        className: "mt-0.5",
        children: props.data.label.split(" ")[0]
      })]
    })
  }));
};

exports.IncidentCommandersOption = IncidentCommandersOption;

var IncidentRespondentsMultiValueLabel = function IncidentRespondentsMultiValueLabel(_ref5) {
  var props = _extends({}, _ref5);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.MultiValueLabel, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-wrap gap-1.5 text-sm",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
        user: props.data,
        size: "sm"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
        className: "mt-0.5",
        children: props.data.label.split(" ")[0]
      })]
    })
  }));
};

exports.IncidentRespondentsMultiValueLabel = IncidentRespondentsMultiValueLabel;

var IncidentRespondentsOption = function IncidentRespondentsOption(_ref6) {
  var props = _extends({}, _ref6);

  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactSelect.components.Option, _objectSpread(_objectSpread({}, props), {}, {
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: "flex flex-row gap-1.5 text-sm",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.Avatar, {
        user: props.data,
        size: "sm"
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
        className: "mt-0.5",
        children: props.data.label.split(" ")[0]
      })]
    })
  }));
};

exports.IncidentRespondentsOption = IncidentRespondentsOption;