"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }








var _chunkAEJ7VTL4cjs = require('./chunk-AEJ7VTL4.cjs');


var _chunkZU72XWNEcjs = require('./chunk-ZU72XWNE.cjs');


var _chunkWF7Z2VITcjs = require('./chunk-WF7Z2VIT.cjs');



var _chunkOBHJBBPCcjs = require('./chunk-OBHJBBPC.cjs');




var _chunkZ6EUSUADcjs = require('./chunk-Z6EUSUAD.cjs');

// src/components/Select.tsx
var _react = require('@emotion/react');
var _styled = require('@emotion/styled'); var _styled2 = _interopRequireDefault(_styled);
var _reactselect = require('react-select'); var _reactselect2 = _interopRequireDefault(_reactselect);
var _jsxruntime = require('@emotion/react/jsx-runtime');
function Select(_a) {
  var _b = _a, {
    zIndex,
    selectRef,
    label,
    openMenuOnFocus = true,
    tabSelectsValue = false,
    getOptionStyles,
    getControlStyles
  } = _b, rest = _chunkZ6EUSUADcjs.__objRest.call(void 0, _b, [
    "zIndex",
    "selectRef",
    "label",
    "openMenuOnFocus",
    "tabSelectsValue",
    "getOptionStyles",
    "getControlStyles"
  ]);
  const theme = _react.useTheme.call(void 0, );
  const styles = {
    container: (styles2, state) => {
      return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
        width: _chunkAEJ7VTL4cjs.fieldWidth,
        maxWidth: _chunkAEJ7VTL4cjs.maxFieldWidth,
        zIndex: _chunkZU72XWNEcjs.z.select
      });
    },
    control: (styles2, state) => {
      const controlStyles = getControlStyles ? getControlStyles(styles2, state) : {};
      return _chunkZ6EUSUADcjs.__spreadValues.call(void 0, _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
        transition: "none",
        padding: state.menuIsOpen || state.isFocused ? `${_chunkAEJ7VTL4cjs.textInputPaddingPx - 1}px` : _chunkAEJ7VTL4cjs.textInputPadding,
        boxShadow: "none",
        background: theme.bg,
        minHeight: 0,
        fontSize: 14,
        borderWidth: state.menuIsOpen || state.isFocused ? "2px" : "1px",
        "&:hover": {
          borderColor: state.menuIsOpen ? _chunkAEJ7VTL4cjs.textInputBorderColorFocused.call(void 0, { theme }) : _chunkAEJ7VTL4cjs.textInputBorderColor.call(void 0, { theme })
        },
        borderColor: state.menuIsOpen || state.isFocused ? _chunkAEJ7VTL4cjs.textInputBorderColorFocused.call(void 0, { theme }) : _chunkAEJ7VTL4cjs.textInputBorderColor.call(void 0, { theme })
      }), controlStyles);
    },
    indicatorsContainer: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      padding: "0 8px"
    }),
    indicatorSeparator: (styles2) => ({
      display: "none"
    }),
    menu: (styles2, state) => {
      return _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
        overflow: "hidden",
        border: `2px solid ${theme.lcNeutral}`,
        backgroundColor: theme.bg,
        boxShadow: "0px 3px 6px 1px rgba(0,0,0,0.05)",
        borderColor: theme.hcNeutral,
        width: "max-content",
        minWidth: "100%"
      });
    },
    option: (styles2, props) => {
      const optionStyles = getOptionStyles ? getOptionStyles(styles2, props) : {};
      return _chunkZ6EUSUADcjs.__spreadValues.call(void 0, _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
        color: props.isFocused ? _chunkOBHJBBPCcjs.getColor.call(void 0, theme, _chunkAEJ7VTL4cjs.defaultTextInputTypography.color) : props.isDisabled ? _chunkAEJ7VTL4cjs.textInputPlaceholderColor.call(void 0, { theme }) : _chunkOBHJBBPCcjs.getColor.call(void 0, theme, _chunkAEJ7VTL4cjs.defaultTextInputTypography.color),
        fontWeight: 600,
        cursor: "pointer",
        backgroundColor: props.isFocused ? _chunkOBHJBBPCcjs.themeOr.call(void 0, theme.c05Neutral, theme.c2Neutral)({ theme }) : theme.bg,
        WebkitTapHighlightColor: theme.c1Neutral,
        "&:active": {
          backgroundColor: _chunkOBHJBBPCcjs.themeOr.call(void 0, 
            theme.c05Neutral,
            theme.c5Neutral
          )({ theme })
        }
      }), optionStyles);
    },
    menuPortal: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      fontSize: 14,
      zIndex: zIndex || _chunkZU72XWNEcjs.z.selectFocused
    }),
    singleValue: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      color: theme.text,
      fontWeight: 600,
      fontSize: 14
    }),
    placeholder: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      color: theme.mcNeutral
    }),
    valueContainer: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      padding: 0
    }),
    input: (styles2) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, styles2), {
      color: theme.text,
      fontWeight: 600,
      fontSize: 14
    })
  };
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, StyledSelect, { children: [
    label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SelectLabel, { hasError: false, children: label }),
    /* @__PURE__ */ _jsxruntime.jsx.call(void 0, 
      _reactselect2.default,
      _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, rest), {
        styles,
        openMenuOnFocus,
        tabSelectsValue,
        menuPortalTarget: document.body,
        ref: selectRef,
        components: _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {
          DropdownIndicator: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWF7Z2VITcjs.Icon, { name: "Chevron", width: 16 })
        }, rest.components),
        theme: (selectTheme) => _chunkZ6EUSUADcjs.__spreadProps.call(void 0, _chunkZ6EUSUADcjs.__spreadValues.call(void 0, {}, selectTheme), {
          borderRadius: 8,
          colors: {
            danger: theme.danger,
            dangerLight: "#ff8",
            primary: theme.text,
            primary75: "#ccc",
            primary50: "#888",
            primary25: "#444",
            neutral0: "#000",
            neutral5: "#111",
            neutral10: "#222",
            neutral20: "#999",
            neutral30: "#aaa",
            neutral40: "#bbb",
            neutral50: "#bbb",
            neutral60: "#ccc",
            neutral70: "#ccc",
            neutral80: "#ddd",
            neutral90: "#ddd"
          }
        })
      })
    )
  ] });
}
var SelectLabel = _styled2.default.label`
  font-size: 10px;
  position: absolute;
  z-index: ${_chunkZU72XWNEcjs.z.select + 1};
  background-color: ${({ theme }) => theme.bg};
  color: ${({ theme, hasError }) => hasError ? theme.danger : theme.mcNeutral};
  font-weight: 600;
  padding: 0px 6px;
  left: 12px;
  top: -6px;
`;
var StyledSelect = _styled2.default.div`
  position: relative;
  & + & {
    margin-top: 8px;
  }
`;
var Select_default = Select;





exports.Select = Select; exports.StyledSelect = StyledSelect; exports.Select_default = Select_default;
