{"version":3,"file":"Select.cjs","names":["_styled","_interopRequireDefault","require","_react","_Field","_index","_inputUtils","_OdysseyDesignTokensContext","_useNormalizedKey","_jsxRuntime","e","__esModule","default","SelectContainer","styled","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","alignItems","display","insetBlockEnd","insetBlockStart","insetInlineEnd","insetInlineStart","marginInlineStart","BorderWidthMain","opacity","pointerEvents","position","NonInteractiveIcon","CloseCircleFilledIcon","fontSize","marginBlockEnd","marginInlineEnd","Spacing1","Spacing2","ChipsInnerContainer","_Box2","isVisible","flexWrap","gap","marginBlock","minHeight","Spacing6","CONTROLLED","ComponentControlledState","Select","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","isReadOnly","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","selectRef","useRef","useMemo","undefined","controlledStateRef","getControlState","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","useState","current","localInputRef","useOdysseyDesignTokens","menuPaperMinWidth","setMenuPaperMinWidth","handleMenuOpen","useCallback","anchor","parentNode","offsetWidth","useImperativeHandle","focus","useEffect","inputValues","useInputValues","controlState","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","lang","language","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","ariaLabel","isDismissable","stopPropagation","hasNonInteractiveIcon","jsx","role","children","item","length","_Chip2","deleteIcon","onMouseDown","sx","jsxs","Fragment","get","onDelete","tabIndex","renderedOptions","index","_ListSubheader2","isSelected","includes","_MenuItem2","selected","_Checkbox2","checked","_ListItemSecondaryAction2","CheckIcon","normalizedKey","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select2","disabled","displayEmpty","inputProps","readOnly","el","labelId","MenuProps","PaperProps","style","minWidth","maxHeight","multiple","onOpen","Field","fieldType","hasVisibleLabel","MemoizedSelect","exports","memo","displayName"],"sources":["../../src/Select.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n  ListItemSecondaryAction,\n  ListSubheader,\n  Box as MuiBox,\n  Checkbox as MuiCheckbox,\n  Chip as MuiChip,\n  MenuItem as MuiMenuItem,\n  Select as MuiSelect,\n  SelectProps as MuiSelectProps,\n  SelectChangeEvent,\n} from \"@mui/material\";\nimport {\n  memo,\n  useCallback,\n  useEffect,\n  useImperativeHandle,\n  useMemo,\n  useRef,\n  useState,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Field } from \"./Field.js\";\nimport {\n  FieldComponentProps,\n  FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated/index.js\";\nimport {\n  ComponentControlledState,\n  FocusHandle,\n  getControlState,\n  useInputValues,\n} from \"./inputUtils.js\";\nimport {\n  DesignTokens,\n  useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { normalizedKey } from \"./useNormalizedKey.js\";\n\nexport type SelectOption = {\n  language?: string;\n  text: string;\n  type?: \"heading\" | \"option\";\n  value?: string;\n};\n\nconst SelectContainer = styled.div`\n  position: relative;\n  width: 100%;\n  display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n  shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n  odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => {\n  return {\n    alignItems: \"center\",\n    display: \"flex\",\n    insetBlockEnd: 0,\n    insetBlockStart: 0,\n    insetInlineEnd: \"25px\", // This 25px is used to align with MUI's default chip positioning logic.\n    insetInlineStart: \"4px\",\n    marginInlineStart: odysseyDesignTokens.BorderWidthMain,\n    opacity: 1,\n    pointerEvents: \"none\",\n    position: \"absolute\",\n  };\n});\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n  shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n  odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n  fontSize: \"1em\",\n  marginBlockEnd: \"-1px\",\n  marginInlineEnd: `-${odysseyDesignTokens.Spacing1}`,\n  marginInlineStart: odysseyDesignTokens.Spacing2,\n}));\n\nconst ChipsInnerContainer = styled(MuiBox, {\n  shouldForwardProp: (prop) =>\n    prop !== \"odysseyDesignTokens\" && prop !== \"isVisible\",\n})<{\n  isVisible?: boolean;\n  odysseyDesignTokens: DesignTokens;\n}>(({ isVisible, odysseyDesignTokens }) => ({\n  display: \"flex\",\n  flexWrap: \"wrap\",\n  gap: odysseyDesignTokens.Spacing1,\n  marginBlock: `-${odysseyDesignTokens.Spacing2}`,\n  marginInlineEnd: odysseyDesignTokens.Spacing1,\n  minHeight: odysseyDesignTokens.Spacing6,\n  opacity: isVisible ? 1 : 0,\n  pointerEvents: \"none\",\n}));\n\nexport type SelectValueType<HasMultipleChoices> =\n  HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n  Value extends SelectValueType<HasMultipleChoices>,\n  HasMultipleChoices extends boolean,\n> = {\n  /**\n   * The default value. Use when the component is not controlled.\n   */\n  defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n  /**\n   * If `true`, the Select allows multiple options to be selected simultaneously.\n   */\n  hasMultipleChoices?: HasMultipleChoices;\n  /**\n   * Ref attached to the underlying <select> element.\n   */\n  inputRef?: React.RefObject<FocusHandle>;\n  /**\n   * @deprecated Use `hasMultipleChoices` instead.\n   */\n  isMultiSelect?: HasMultipleChoices;\n  /**\n   * The label text for the Select\n   */\n  label: string;\n  /**\n   * Called when the Select loses focus.\n   */\n  onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n  /**\n   * Called when the selected value changes.\n   */\n  onChange?: MuiSelectProps<Value>[\"onChange\"];\n  /**\n   * Called when the Select gains focus.\n   */\n  onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n  /**\n   * The options for the Select\n   */\n  options: (string | SelectOption)[];\n  /**\n   * The value or values selected in the Select\n   */\n  value?: Value;\n} & Pick<\n  FieldComponentProps,\n  | \"errorMessage\"\n  | \"errorMessageList\"\n  | \"hint\"\n  | \"HintLinkComponent\"\n  | \"id\"\n  | \"isDisabled\"\n  | \"isFullWidth\"\n  | \"isOptional\"\n  | \"isReadOnly\"\n  | \"name\"\n> &\n  Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n  Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n  Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination of the following:\n *   - string —\n *     A simple string. The string will be both the text and the value of the resulting option. <option value=\"string\">string</option>\n *\n *   - { text: string } —\n *     Same as above, but the string is contained within an object.\n *     <option value=\"text\">text</option>\n *\n *   - { text: string, value: string } —\n *     The option text will be text, and the option value will be value.\n *     <option value=\"value\">text</option>\n *\n *   - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\n/**\n * A form field that lets users choose one or more options from a dropdown list. Supports single and multi-select modes, grouped options, and controlled or uncontrolled usage.\n */\nconst Select = <\n  Value extends SelectValueType<HasMultipleChoices>,\n  HasMultipleChoices extends boolean,\n>({\n  ariaDescribedBy,\n  defaultValue,\n  errorMessage,\n  errorMessageList,\n  hasMultipleChoices: hasMultipleChoicesProp,\n  hint,\n  HintLinkComponent,\n  id: idOverride,\n  inputRef,\n  isDisabled = false,\n  isFullWidth = false,\n  isMultiSelect,\n  isOptional = false,\n  isReadOnly = false,\n  label,\n  name: nameOverride,\n  onBlur,\n  onChange: onChangeProp,\n  onFocus,\n  options,\n  testId,\n  translate,\n  value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n  const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n  const hasMultipleChoices = useMemo(\n    () =>\n      hasMultipleChoicesProp === undefined\n        ? isMultiSelect\n        : hasMultipleChoicesProp,\n    [hasMultipleChoicesProp, isMultiSelect],\n  );\n\n  const controlledStateRef = useRef(\n    getControlState({\n      controlledValue: value,\n      uncontrolledValue: defaultValue,\n    }),\n  );\n  const [internalSelectedValues, setInternalSelectedValues] = useState(\n    controlledStateRef.current === CONTROLLED ? value : defaultValue,\n  );\n\n  const localInputRef = useRef<HTMLSelectElement>(null);\n  const odysseyDesignTokens = useOdysseyDesignTokens();\n\n  const [menuPaperMinWidth, setMenuPaperMinWidth] = useState<\n    number | undefined\n  >(undefined);\n\n  // MUI measures anchorElement.clientWidth (excludes border) for the paper's minWidth, making the paper ~2px narrower than the field. Capturing offsetWidth (includes border) on open keeps both edges flush with the field.\n  const handleMenuOpen = useCallback(() => {\n    const anchor = selectRef.current?.parentNode as HTMLElement | null;\n    if (anchor) {\n      setMenuPaperMinWidth(anchor.offsetWidth);\n    }\n  }, []);\n\n  useImperativeHandle(inputRef, () => {\n    return {\n      focus: () => {\n        localInputRef.current?.focus();\n      },\n    };\n  }, []);\n\n  useEffect(() => {\n    if (controlledStateRef.current === CONTROLLED) {\n      setInternalSelectedValues(value);\n    }\n  }, [value]);\n\n  const inputValues = useInputValues({\n    defaultValue,\n    value,\n    controlState: controlledStateRef.current,\n  });\n\n  const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n    (event, child) => {\n      if (isDisabled || isReadOnly) {\n        event.preventDefault();\n      } else {\n        const {\n          target: { value },\n        } = event;\n        if (controlledStateRef.current !== CONTROLLED) {\n          setInternalSelectedValues(\n            (typeof value === \"string\" && hasMultipleChoices\n              ? value.split(\",\")\n              : value) as Value,\n          );\n        }\n        onChangeProp?.(event, child);\n      }\n    },\n    [hasMultipleChoices, isDisabled, onChangeProp, isReadOnly],\n  );\n  // Normalize the options array to accommodate the various data types that might be passed\n  const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n    const normalizedOptions = options.map((option) => {\n      if (typeof option === \"object\") {\n        /**\n         * If the value of `option?.value is an empty string, we need to make sure that we set an empty string to `value` in the normalized option so that the select component can potentially set it as the selected one in the text input\n         */\n        const value =\n          option?.value === \"\" ? option.value : option.value || option.text;\n        return {\n          text: option.text,\n          value,\n          type: option.type === \"heading\" ? \"heading\" : \"option\",\n          lang: option.language,\n        };\n      }\n\n      return { text: option, value: option, type: \"option\" };\n    });\n\n    const normalizedOptionsMap = new Map(\n      normalizedOptions.map((option) => [option.value, option]),\n    );\n    return [normalizedOptions, normalizedOptionsMap];\n  }, [options]);\n\n  const removeSelectedValue = useCallback(\n    (selectedValue: string) => {\n      if (Array.isArray(internalSelectedValues)) {\n        const newValue = internalSelectedValues.filter(\n          (internalSelectedValue) => internalSelectedValue !== selectedValue,\n        );\n\n        const syntheticEvent = {\n          target: { value: newValue },\n        } as SelectChangeEvent<Value>;\n\n        onChange(syntheticEvent, null);\n      }\n    },\n    [internalSelectedValues, onChange],\n  );\n\n  const Chips = useCallback(\n    ({\n      ariaLabel,\n      isDismissable,\n      isVisible,\n    }: {\n      ariaLabel?: string;\n      isDismissable: boolean;\n      isVisible?: boolean;\n    }) => {\n      const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n        event.stopPropagation();\n\n      const hasNonInteractiveIcon =\n        !isDismissable &&\n        !isVisible &&\n        controlledStateRef.current === CONTROLLED &&\n        hasMultipleChoices;\n\n      return (\n        Array.isArray(internalSelectedValues) && (\n          <ChipsInnerContainer\n            aria-label={ariaLabel}\n            isVisible={isVisible}\n            odysseyDesignTokens={odysseyDesignTokens}\n            role=\"list\"\n          >\n            {internalSelectedValues.map(\n              (item) =>\n                item?.length > 0 && (\n                  <MuiChip\n                    deleteIcon={\n                      <CloseCircleFilledIcon\n                        // We need to stop event propagation on mouse down to prevent the deletion from being blocked by the Select list opening, and also ensure that the pointerEvent is registered even when the parent's are not\n                        onMouseDown={stopPropagation}\n                        sx={{ pointerEvents: \"auto\" }}\n                      />\n                    }\n                    key={item}\n                    label={\n                      <>\n                        {normalizedOptionsMap.get(item)?.text}\n                        {hasNonInteractiveIcon && (\n                          <NonInteractiveIcon\n                            odysseyDesignTokens={odysseyDesignTokens}\n                          />\n                        )}\n                      </>\n                    }\n                    onDelete={\n                      isDismissable && controlledStateRef.current === CONTROLLED\n                        ? () => removeSelectedValue(item)\n                        : undefined\n                    }\n                    role=\"listitem\"\n                    tabIndex={-1}\n                  />\n                ),\n            )}\n          </ChipsInnerContainer>\n        )\n      );\n    },\n    [\n      controlledStateRef,\n      hasMultipleChoices,\n      internalSelectedValues,\n      odysseyDesignTokens,\n      removeSelectedValue,\n      normalizedOptionsMap,\n    ],\n  );\n\n  // Convert the options into the ReactNode children that will populate the <Select>\n  const renderedOptions = useMemo(\n    () =>\n      normalizedOptions.map((option, index) => {\n        if (option.type === \"heading\") {\n          return (\n            <ListSubheader key={option.text}> {option.text} </ListSubheader>\n          );\n        }\n\n        const isSelected = hasMultipleChoices\n          ? internalSelectedValues?.includes(option.value)\n          : internalSelectedValues === option.value;\n\n        return (\n          <MuiMenuItem\n            data-empty={!option.text}\n            key={normalizedKey(option.text, index.toString())}\n            lang={option.lang}\n            selected={isSelected}\n            value={option.value}\n          >\n            {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n            {option.text}\n            {!hasMultipleChoices && internalSelectedValues === option.value && (\n              <ListItemSecondaryAction>\n                <CheckIcon />\n              </ListItemSecondaryAction>\n            )}\n          </MuiMenuItem>\n        );\n      }),\n    [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n  );\n\n  const renderValue = useCallback(\n    (value: Value) => Array.isArray(value) && <Chips isDismissable={false} />,\n    [Chips],\n  );\n\n  const renderFieldComponent = useCallback(\n    ({\n      ariaDescribedBy,\n      errorMessageElementId,\n      id,\n      labelElementId,\n    }: SelectRenderProps) => (\n      <SelectContainer>\n        <MuiSelect\n          {...inputValues}\n          aria-describedby={ariaDescribedBy}\n          aria-errormessage={errorMessageElementId}\n          disabled={isDisabled}\n          displayEmpty\n          id={id}\n          inputProps={{\n            \"data-se\": testId,\n            \"aria-disabled\": isDisabled,\n            \"aria-readonly\": isReadOnly,\n            readOnly: isReadOnly,\n          }}\n          inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n            if (localInputRef.current !== el) {\n              (localInputRef as React.MutableRefObject<typeof el>).current = el;\n            }\n            selectRef.current = el;\n          }}\n          labelId={labelElementId}\n          MenuProps={{\n            PaperProps:\n              menuPaperMinWidth !== undefined\n                ? { style: { minWidth: menuPaperMinWidth } }\n                : undefined,\n            sx: {\n              \".MuiPaper-root\": {\n                maxHeight: \"50vh\",\n              },\n            },\n          }}\n          multiple={hasMultipleChoices}\n          name={nameOverride ?? id}\n          onBlur={onBlur}\n          onChange={onChange}\n          onFocus={onFocus}\n          onOpen={handleMenuOpen}\n          renderValue={hasMultipleChoices ? renderValue : undefined}\n          translate={translate}\n        >\n          {renderedOptions}\n        </MuiSelect>\n        {hasMultipleChoices && (\n          <>\n            <ChipsPositioningContainer\n              odysseyDesignTokens={odysseyDesignTokens}\n            >\n              <Chips\n                ariaLabel=\"Selected options\"\n                isDismissable={!isReadOnly && !isDisabled}\n                isVisible\n              />\n            </ChipsPositioningContainer>\n          </>\n        )}\n      </SelectContainer>\n    ),\n    [\n      Chips,\n      inputValues,\n      hasMultipleChoices,\n      isDisabled,\n      isReadOnly,\n      nameOverride,\n      odysseyDesignTokens,\n      onBlur,\n      onChange,\n      onFocus,\n      renderedOptions,\n      renderValue,\n      testId,\n      translate,\n    ],\n  );\n\n  return (\n    <Field\n      ariaDescribedBy={ariaDescribedBy}\n      errorMessage={errorMessage}\n      errorMessageList={errorMessageList}\n      fieldType=\"single\"\n      hasVisibleLabel\n      hint={hint}\n      HintLinkComponent={HintLinkComponent}\n      id={idOverride}\n      isDisabled={isDisabled}\n      isFullWidth={isFullWidth}\n      isOptional={isOptional}\n      isReadOnly={isReadOnly}\n      label={label}\n      renderFieldComponent={renderFieldComponent}\n    />\n  );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAYA,IAAAC,MAAA,GAAAD,OAAA;AAYA,IAAAE,MAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,IAAAK,2BAAA,GAAAL,OAAA;AAIA,IAAAM,iBAAA,GAAAN,OAAA;AAAsD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApDtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAmDA,MAAMG,eAAe,GAAGC,eAAM,CAACC,GAAG;AAClC;AACA;AACA;AACA,CAAC;AAED,MAAMC,yBAAyB,GAAG,IAAAF,eAAM,EAAC,KAAK,EAAE;EAC9CG,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAEC,CAAC;EAAEC;AAAoB,CAAC,KAAK;EAC9B,OAAO;IACLC,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE,MAAM;IACfC,aAAa,EAAE,CAAC;IAChBC,eAAe,EAAE,CAAC;IAClBC,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