{"version":3,"sources":["jsdelivr-header.js","/npm/@yamada-ui/select@1.8.12/src/index.ts","/npm/@yamada-ui/select@1.8.12/src/multi-select.tsx","/npm/@yamada-ui/select@1.8.12/src/select-icon.tsx","/npm/@yamada-ui/select@1.8.12/src/use-select.tsx","/npm/@yamada-ui/select@1.8.12/src/option.tsx","/npm/@yamada-ui/select@1.8.12/src/use-select-option.ts","/npm/@yamada-ui/select@1.8.12/src/option-group.tsx","/npm/@yamada-ui/select@1.8.12/src/use-select-option-group.ts","/npm/@yamada-ui/select@1.8.12/src/select-list.tsx","/npm/@yamada-ui/select@1.8.12/src/use-select-list.ts","/npm/@yamada-ui/select@1.8.12/src/select.tsx"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,8iBCNA,cAAA,GAAA,SAAA,cAAA,CAAA,YAAA,IAAA,YAAA,OAAA,IAAA,OAAA,YAAA,IAAA,YAAA,OAAA,IAAA,SAAA,OAAA,QAAA,aAAA,eCYA,IAAA,aAKO,QAAA,mBACP,gBAAwC,QAAA,sBACxC,cAAuB,QAAA,qBACvB,cAA0C,QAAA,oBAC1C,cAAsC,QAAA,SChBtC,aAA+B,QAAA,mBAC/B,YAAuC,QAAA,mBACvC,qBAA6B,QAAA,4BAC7B,cAAqD,QAAA,oBACrD,cAAqC,QAAA,SCOrC,aAAsC,QAAA,mBACtC,oBAGO,QAAA,2BACP,8BAAqC,QAAA,qCACrC,sBAAiC,QAAA,6BACjC,sBAA8B,QAAA,6BAC9B,yBAAgC,QAAA,gCAChC,cAiBO,QAAA,oBACP,cAAkE,QAAA,SCxClE,YAA+B,QAAA,mBAC/B,cAAmB,QAAA,oBCFnB,aAUO,QAAA,oBACP,aAAoD,QAAA,SAG9C,eAAkB,IAhBxB,IAAA,EAiBE,SAAA,aAAA,eAAc,OAAa,OAAA,EAAA,EAAO,aAAa,cAApB,EAAA,EAA6B,WAAW,YA2CxD,gBAAmB,IAC9B,MAAM,cACJ,EAAA,SACA,EAAA,aACA,E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,YAAO,EAAA,OAAa,GAAW,mBAEjC,EAAmB,CACvB,WAAY,SACZ,QAAS,OACT,GAAI,UACD,EAAO,OAGZ,OACE,EAAA,oBAAA,KAAC,aAAA,GAAG,IAAH,CACC,MACA,WAAA,EAAW,eAAA,IAAG,mBAAoB,GAClC,MAAO,KACH,EAEJ,UAAA,EAAA,oBAAA,KAAC,aAAA,GAAG,KAAH,CACC,wBAAyB,CACvB,OAAQ,OAAA,EAAA,MAAA,IAAS,GAAT,EAAwB,IAElC,cACA,eAEJ,IAKN,YAAY,YAAc,cAC1B,YAAY,OAAS","file":"/npm/@yamada-ui/select@1.8.12/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@yamada-ui/select@1.8.12/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export { MultiSelect } from \"./multi-select\"\nexport type { MultiSelectProps } from \"./multi-select\"\nexport { Option } from \"./option\"\nexport type { OptionProps } from \"./option\"\nexport { OptionGroup } from \"./option-group\"\nexport type { OptionGroupProps } from \"./option-group\"\nexport { Select } from \"./select\"\nexport type { SelectProps } from \"./select\"\nexport type { SelectItem } from \"./use-select\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type {\n  CSSProperties,\n  FC,\n  MouseEventHandler,\n  ReactElement,\n  ReactNode,\n} from \"react\"\nimport type { SelectIconProps } from \"./select-icon\"\nimport type { SelectListProps } from \"./select-list\"\nimport type { UseSelectProps } from \"./use-select\"\nimport {\n  forwardRef,\n  omitThemeProps,\n  ui,\n  useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { cx, handlerAll, runIfFunc } from \"@yamada-ui/utils\"\nimport { cloneElement, useMemo } from \"react\"\nimport { SelectClearIcon, SelectIcon } from \"./select-icon\"\nimport { SelectList } from \"./select-list\"\nimport {\n  SelectDescendantsContextProvider,\n  SelectProvider,\n  useSelect,\n  useSelectContext,\n} from \"./use-select\"\n\ninterface MultiSelectOptions {\n  /**\n   * If `true`, display the multi select clear icon.\n   *\n   * @default true\n   */\n  clearable?: boolean\n  /**\n   * The custom display value to use.\n   */\n  component?: FC<{\n    index: number\n    label: string\n    value: string\n    onRemove: MouseEventHandler<HTMLElement>\n  }>\n  /**\n   * The border color when the input is invalid.\n   */\n  errorBorderColor?: string\n  /**\n   * The border color when the input is focused.\n   */\n  focusBorderColor?: string\n  /**\n   * The footer of the multi select content element.\n   */\n  footer?: FC<{ value: string[] | undefined; onClose: () => void }> | ReactNode\n  /**\n   * The header of the multi select content element.\n   */\n  header?: FC<{ value: string[] | undefined; onClose: () => void }> | ReactNode\n  /**\n   * If `true`, display the multi select clear icon.\n   *\n   * @default true\n   *\n   * @deprecated Use `clearable` instead.\n   */\n  isClearable?: boolean\n  /**\n   * The visual separator between each value.\n   *\n   * @default ','\n   */\n  separator?: string\n  /**\n   * Props for multi select clear icon element.\n   */\n  clearIconProps?: SelectIconProps\n  /**\n   * Props for multi select container element.\n   */\n  containerProps?: Omit<HTMLUIProps, \"children\">\n  /**\n   * Props for multi select field element.\n   */\n  fieldProps?: Omit<MultiSelectFieldProps, \"children\">\n  /**\n   * Props for multi select icon element.\n   */\n  iconProps?: SelectIconProps\n  /**\n   * Props for multi select list element.\n   */\n  listProps?: Omit<SelectListProps, \"children\">\n  /**\n   * Props to be forwarded to the portal component.\n   *\n   * @default '{ disabled: true }'\n   */\n  portalProps?: Omit<PortalProps, \"children\">\n}\n\nexport interface MultiSelectProps\n  extends ThemeProps<\"MultiSelect\">,\n    Omit<UseSelectProps<string[]>, \"placeholderInOptions\">,\n    MultiSelectOptions {}\n\n/**\n * `MultiSelect` is a component used for allowing users to select multiple values from a list of options.\n *\n * @see Docs https://yamada-ui.com/components/forms/multi-select\n */\nexport const MultiSelect = forwardRef<MultiSelectProps, \"div\">((props, ref) => {\n  const [styles, mergedProps] = useComponentMultiStyle(\"MultiSelect\", props)\n  const {\n    className,\n    isClearable = true,\n    clearable = isClearable,\n    closeOnSelect = false,\n    color,\n    component,\n    defaultValue = [],\n    footer,\n    h,\n    header,\n    height = h,\n    minH,\n    minHeight = minH,\n    separator,\n    clearIconProps,\n    containerProps,\n    fieldProps,\n    iconProps,\n    listProps,\n    portalProps = { disabled: true },\n    ...computedProps\n  } = omitThemeProps(mergedProps)\n  const {\n    children,\n    descendants,\n    empty,\n    placeholder,\n    value,\n    formControlProps,\n    getContainerProps,\n    getFieldProps,\n    getPopoverProps,\n    onClear,\n    onClose,\n    ...rest\n  } = useSelect<string[]>({\n    ...computedProps,\n    closeOnSelect,\n    defaultValue,\n    placeholderInOptions: false,\n  })\n  const css: CSSUIObject = {\n    color,\n    h: \"fit-content\",\n    w: \"100%\",\n    ...styles.container,\n  }\n\n  return (\n    <SelectDescendantsContextProvider value={descendants}>\n      <SelectProvider value={{ ...rest, placeholder, styles, value, onClose }}>\n        <Popover {...getPopoverProps()}>\n          <ui.div\n            className={cx(\"ui-multi-select\", className)}\n            __css={css}\n            {...getContainerProps(containerProps)}\n          >\n            <ui.div\n              className=\"ui-multi-select__inner\"\n              __css={{ position: \"relative\", ...styles.inner }}\n            >\n              <PopoverTrigger>\n                <MultiSelectField\n                  component={component}\n                  height={height}\n                  minHeight={minHeight}\n                  separator={separator}\n                  {...getFieldProps(fieldProps, ref)}\n                />\n              </PopoverTrigger>\n\n              {clearable && value.length ? (\n                <SelectClearIcon\n                  {...clearIconProps}\n                  onClick={handlerAll(clearIconProps?.onClick, onClear)}\n                  {...formControlProps}\n                />\n              ) : (\n                <SelectIcon {...iconProps} {...formControlProps} />\n              )}\n            </ui.div>\n\n            {!empty ? (\n              <Portal {...portalProps}>\n                <SelectList\n                  footer={runIfFunc(footer, { value, onClose })}\n                  header={runIfFunc(header, { value, onClose })}\n                  {...listProps}\n                >\n                  {children}\n                </SelectList>\n              </Portal>\n            ) : null}\n          </ui.div>\n        </Popover>\n      </SelectProvider>\n    </SelectDescendantsContextProvider>\n  )\n})\n\nMultiSelect.displayName = \"MultiSelect\"\nMultiSelect.__ui__ = \"MultiSelect\"\n\ninterface MultiSelectFieldProps\n  extends HTMLUIProps,\n    Pick<MultiSelectOptions, \"component\" | \"separator\"> {}\n\nconst MultiSelectField = forwardRef<MultiSelectFieldProps, \"div\">(\n  (\n    {\n      className,\n      component,\n      isTruncated,\n      lineClamp = 1,\n      separator = \",\",\n      ...rest\n    },\n    ref,\n  ) => {\n    const { label, placeholder, styles, value, onChange } = useSelectContext()\n\n    const cloneChildren = useMemo(() => {\n      if (!label?.length)\n        return <ui.span lineClamp={lineClamp}>{placeholder}</ui.span>\n\n      if (component) {\n        return (\n          <ui.span isTruncated={isTruncated} lineClamp={lineClamp}>\n            {(label as string[]).map((label, index) => {\n              const onRemove: MouseEventHandler<HTMLElement> = (e) => {\n                e.stopPropagation()\n\n                onChange(value[index] ?? \"\")\n              }\n\n              const el = component({\n                index,\n                label,\n                value: value[index] ?? \"\",\n                onRemove,\n              }) as null | ReactElement\n\n              const style: CSSProperties = {\n                marginBlockEnd: \"0.125rem\",\n                marginBlockStart: \"0.125rem\",\n                marginInlineEnd: \"0.25rem\",\n              }\n\n              return el\n                ? cloneElement(el as ReactElement, { key: index, style })\n                : null\n            })}\n          </ui.span>\n        )\n      } else {\n        return (\n          <ui.span isTruncated={isTruncated} lineClamp={lineClamp}>\n            {(label as string[]).map((value, index) => {\n              const isLast = label.length === index + 1\n\n              return (\n                <ui.span\n                  key={index}\n                  dangerouslySetInnerHTML={{\n                    __html: `${value}${!isLast ? separator : \"\"}`,\n                  }}\n                  display=\"inline\"\n                  me=\"0.25rem\"\n                />\n              )\n            })}\n          </ui.span>\n        )\n      }\n    }, [\n      label,\n      isTruncated,\n      lineClamp,\n      onChange,\n      placeholder,\n      separator,\n      component,\n      value,\n    ])\n\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      display: \"flex\",\n      pe: \"2rem\",\n      ...styles.field,\n    }\n\n    if (label?.length && component) css.py = \"0.125rem\"\n\n    return (\n      <ui.div\n        ref={ref}\n        className={cx(\"ui-multi-select__field\", className)}\n        __css={css}\n        {...rest}\n      >\n        {cloneChildren}\n      </ui.div>\n    )\n  },\n)\n\nMultiSelectField.displayName = \"MultiSelectField\"\nMultiSelectField.__ui__ = \"MultiSelectField\"\n","import type {\n  CSSUIObject,\n  FunctionComponent,\n  HTMLUIProps,\n} from \"@yamada-ui/core\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { ChevronIcon, CloseIcon } from \"@yamada-ui/icon\"\nimport { useClickable } from \"@yamada-ui/use-clickable\"\nimport { cx, getValidChildren, isValidElement } from \"@yamada-ui/utils\"\nimport { cloneElement, useRef } from \"react\"\nimport { useSelectContext } from \"./use-select\"\n\nexport interface SelectIconProps extends HTMLUIProps {}\n\nexport const SelectIcon = forwardRef<SelectIconProps, \"div\">(\n  ({ className, children, __css, ...rest }, ref) => {\n    const { styles } = useSelectContext()\n\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      cursor: \"pointer\",\n      display: \"inline-flex\",\n      justifyContent: \"center\",\n      pointerEvents: \"none\",\n      position: \"absolute\",\n      top: \"50%\",\n      transform: \"translateY(-50%)\",\n      ...styles.icon,\n      ...__css,\n    }\n\n    const validChildren = getValidChildren(children)\n\n    const cloneChildren = validChildren.map((child) =>\n      cloneElement(child, {\n        style: {\n          color: \"currentColor\",\n          maxHeight: \"1em\",\n          maxWidth: \"1em\",\n        },\n        \"aria-hidden\": true,\n        focusable: false,\n      }),\n    )\n\n    return (\n      <ui.div\n        ref={ref}\n        className={cx(\"ui-select__icon\", className)}\n        __css={css}\n        {...rest}\n      >\n        {isValidElement(children) ? cloneChildren : <ChevronIcon />}\n      </ui.div>\n    )\n  },\n)\n\nSelectIcon.displayName = \"SelectIcon\"\nSelectIcon.__ui__ = \"SelectIcon\"\n\nexport interface SelectClearIconProps extends SelectIconProps {\n  disabled?: boolean\n}\n\nexport const SelectClearIcon: FunctionComponent<SelectClearIconProps> = ({\n  className,\n  children,\n  ...props\n}) => {\n  const ref = useRef<HTMLDivElement>(null)\n  const { styles } = useSelectContext()\n\n  const rest = useClickable({\n    ref,\n    ...props,\n  })\n\n  return (\n    <SelectIcon\n      className={cx(\"ui-select__clear-icon\", className)}\n      aria-label=\"Clear value\"\n      __css={styles.clearIcon}\n      {...rest}\n    >\n      {children ?? <CloseIcon h=\"0.5em\" w=\"0.5em\" />}\n    </SelectIcon>\n  )\n}\n\nSelectClearIcon.displayName = \"SelectClearIcon\"\nSelectClearIcon.__ui__ = \"SelectClearIcon\"\n","import type { CSSUIObject, HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { ComboBoxProps, PopoverProps } from \"@yamada-ui/popover\"\nimport type { Merge } from \"@yamada-ui/utils\"\nimport type {\n  Dispatch,\n  FocusEvent,\n  KeyboardEvent,\n  MouseEvent,\n  ReactElement,\n  ReactNode,\n  RefObject,\n  SetStateAction,\n} from \"react\"\nimport type { OptionProps } from \"./option\"\nimport type { OptionGroupProps } from \"./option-group\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport {\n  formControlProperties,\n  useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport { useDisclosure } from \"@yamada-ui/use-disclosure\"\nimport { useOutsideClick } from \"@yamada-ui/use-outside-click\"\nimport {\n  createContext,\n  dataAttr,\n  funcAll,\n  getEventRelatedTarget,\n  getValidChildren,\n  handlerAll,\n  isArray,\n  isContains,\n  isUndefined,\n  mergeRefs,\n  omitObject,\n  pickObject,\n  splitObject,\n  useSafeLayoutEffect,\n  useUnmountEffect,\n  useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useMemo, useRef, useState } from \"react\"\nimport { Option } from \"./option\"\nimport { OptionGroup } from \"./option-group\"\n\nexport const {\n  DescendantsContextProvider: SelectDescendantsContextProvider,\n  useDescendant: useSelectDescendant,\n  useDescendants: useSelectDescendants,\n  useDescendantsContext: useSelectDescendantsContext,\n} = createDescendant()\n\ninterface SelectItemWithValue extends OptionProps {\n  label?: ReactNode\n  value?: string\n}\n\ninterface SelectItemWithItems extends OptionGroupProps {\n  items?: SelectItemWithValue[]\n}\n\nexport type SelectItem = SelectItemWithItems | SelectItemWithValue\n\nexport type MaybeValue = string | string[]\n\ninterface SelectContext\n  extends Omit<UseSelectProps, \"defaultValue\" | \"onChange\" | \"value\"> {\n  containerRef: RefObject<HTMLDivElement>\n  fieldRef: RefObject<HTMLDivElement>\n  focusedIndex: number\n  label: MaybeValue | undefined\n  open: boolean\n  setFocusedIndex: Dispatch<SetStateAction<number>>\n  styles: { [key: string]: CSSUIObject | undefined }\n  value: MaybeValue\n  onChange: (newValue: string) => void\n  onClose: () => void\n  onFocusFirst: () => void\n  onFocusLast: () => void\n  onFocusNext: () => void\n  onFocusPrev: () => void\n  onOpen: () => void\n}\n\nexport const [SelectProvider, useSelectContext] = createContext<SelectContext>({\n  name: \"SelectContext\",\n  errorMessage: `useSelectContext returned is 'undefined'. Seems you forgot to wrap the components in \"<Select />\"`,\n})\n\nexport interface UseSelectProps<T extends MaybeValue = string>\n  extends Merge<Omit<HTMLUIProps, \"defaultValue\" | \"onChange\">, ComboBoxProps>,\n    FormControlOptions {\n  /**\n   * The HTML `name` attribute used for forms.\n   */\n  name?: string\n  /**\n   * If `true`, the list element will be closed when value is selected.\n   *\n   * @default true\n   */\n  closeOnSelect?: boolean\n  /**\n   * The initial value of the select.\n   */\n  defaultValue?: T\n  /**\n   * If provided, generate options based on items.\n   */\n  items?: SelectItem[]\n  /**\n   * The maximum selectable value.\n   */\n  maxSelectValues?: number\n  /**\n   * If `true`, the selected item(s) will be excluded from the list.\n   *\n   * @default false\n   */\n  omitSelectedValues?: boolean\n  /**\n   * The placeholder of the select.\n   */\n  placeholder?: string\n  /**\n   * If `true`, include placeholders in options.\n   *\n   * @default true\n   */\n  placeholderInOptions?: boolean\n  /**\n   * The value of the select.\n   */\n  value?: T\n  /**\n   * Props for select option element.\n   */\n  optionProps?: Omit<OptionProps, \"children\" | \"value\">\n  /**\n   * The callback invoked when value state changes.\n   */\n  onChange?: (value: T) => void\n}\n\nexport const useSelect = <T extends MaybeValue = string>(\n  props: UseSelectProps<T>,\n) => {\n  const {\n    animation,\n    boundary,\n    children,\n    closeDelay,\n    closeOnBlur = true,\n    closeOnEsc = true,\n    closeOnSelect = true,\n    defaultIsOpen,\n    defaultOpen,\n    defaultValue,\n    duration = 0.2,\n    eventListeners,\n    flip,\n    gutter,\n    isLazy,\n    isOpen,\n    items = [],\n    lazy = isLazy,\n    lazyBehavior,\n    matchWidth = true,\n    maxSelectValues,\n    modifiers,\n    offset,\n    omitSelectedValues = false,\n    open: openProp,\n    openDelay,\n    placeholder,\n    placeholderInOptions = true,\n    placement = \"bottom-start\",\n    preventOverflow,\n    strategy,\n    value: valueProp,\n    optionProps,\n    onChange: onChangeProp,\n    onClose: onCloseProp,\n    onOpen: onOpenProp,\n    ...rest\n  } = useFormControlProps(props)\n  const { \"aria-readonly\": _ariaReadonly, ...formControlProps } = pickObject(\n    rest,\n    formControlProperties,\n  )\n  const [containerProps, fieldProps] = splitObject(\n    omitObject(rest, [\"aria-readonly\"]),\n    layoutStyleProperties,\n  )\n\n  const descendants = useSelectDescendants()\n\n  const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n  const [allSelected, setAllSelected] = useState<boolean>(false)\n\n  const containerRef = useRef<HTMLDivElement>(null)\n  const fieldRef = useRef<HTMLDivElement>(null)\n  const timeoutIds = useRef<Set<any>>(new Set([]))\n\n  const [value, setValue] = useControllableState({\n    defaultValue,\n    value: valueProp,\n    onChange: onChangeProp,\n  })\n  const [label, setLabel] = useState<T | undefined>(undefined)\n\n  const hasPlaceholder = !!placeholder && placeholderInOptions\n  const focused = focusedIndex > -1\n  const multi = isArray(value)\n  const emptyValue = (!multi ? !value : !value.length) && !hasPlaceholder\n  const selectedValues = descendants.values(\n    ({ node }) => multi && value.includes(node.dataset.value ?? \"\"),\n  )\n  const selectedIndexes = selectedValues.map(({ index }) => index)\n  const enabledValues = descendants.enabledValues(\n    ({ index }) => !selectedIndexes.includes(index),\n  )\n  const activedescendantId = descendants.value(focusedIndex)?.node.id\n\n  const validChildren = getValidChildren(children)\n\n  const computedChildren = useMemo(() => {\n    if (!validChildren.length && items.length) {\n      return items\n        .map((item, index) => {\n          if (\"value\" in item) {\n            const { label, value, ...props } = item\n\n            return (\n              <Option key={index} value={value} {...props}>\n                {label}\n              </Option>\n            )\n          } else if (\"items\" in item) {\n            const { items = [], label, ...props } = item\n\n            return (\n              <OptionGroup key={index} label={label} {...props}>\n                {items.map(({ label, value, ...props }, index) => (\n                  <Option key={index} value={value} {...props}>\n                    {label}\n                  </Option>\n                ))}\n              </OptionGroup>\n            )\n          }\n        })\n        .filter(Boolean) as ReactElement[]\n    } else {\n      return validChildren\n    }\n  }, [validChildren, items])\n\n  const empty =\n    !validChildren.length &&\n    !computedChildren.length &&\n    (!multi ? !hasPlaceholder : true)\n\n  const onFocusFirst = useCallback(() => {\n    const id = setTimeout(() => {\n      const first = descendants.enabledFirstValue()\n\n      if (!first) return\n\n      if (!multi || !omitSelectedValues) {\n        setFocusedIndex(first.index)\n      } else {\n        if (selectedIndexes.includes(first.index)) {\n          const enabledFirst = enabledValues[0]\n\n          setFocusedIndex(enabledFirst?.index ?? -1)\n        } else {\n          setFocusedIndex(first.index)\n        }\n      }\n    })\n\n    timeoutIds.current.add(id)\n  }, [descendants, enabledValues, multi, omitSelectedValues, selectedIndexes])\n\n  const onFocusLast = useCallback(() => {\n    const id = setTimeout(() => {\n      const last = descendants.enabledLastValue()\n\n      if (!last) return\n\n      if (!multi || !omitSelectedValues) {\n        setFocusedIndex(last.index)\n      } else {\n        if (selectedIndexes.includes(last.index)) {\n          const enabledLast = enabledValues.reverse()[0]\n\n          setFocusedIndex(enabledLast?.index ?? -1)\n        } else {\n          setFocusedIndex(last.index)\n        }\n      }\n    })\n\n    timeoutIds.current.add(id)\n  }, [descendants, enabledValues, multi, omitSelectedValues, selectedIndexes])\n\n  const onFocusSelected = useCallback(() => {\n    const id = setTimeout(() => {\n      const values = descendants.enabledValues()\n\n      const selected = values.find(({ node }) =>\n        !multi\n          ? node.dataset.value === value\n          : value.includes(node.dataset.value ?? \"\"),\n      )\n\n      if (selected) setFocusedIndex(selected.index)\n    })\n\n    timeoutIds.current.add(id)\n  }, [descendants, multi, value])\n\n  const onFocusNext = useCallback(() => {\n    const id = setTimeout(() => {\n      const next = descendants.enabledNextValue(focusedIndex)\n\n      if (!next) return\n\n      if (!multi || !omitSelectedValues) {\n        setFocusedIndex(next.index)\n      } else {\n        if (selectedIndexes.includes(next.index)) {\n          const enabledNext =\n            enabledValues.find(({ index }) => next.index < index) ??\n            enabledValues[0]\n\n          setFocusedIndex(enabledNext?.index ?? -1)\n        } else {\n          setFocusedIndex(next.index)\n        }\n      }\n    })\n\n    timeoutIds.current.add(id)\n  }, [\n    descendants,\n    enabledValues,\n    focusedIndex,\n    multi,\n    omitSelectedValues,\n    selectedIndexes,\n    setFocusedIndex,\n  ])\n\n  const onFocusPrev = useCallback(() => {\n    const id = setTimeout(() => {\n      const prev = descendants.enabledPrevValue(focusedIndex)\n\n      if (!prev) return\n\n      if (!multi || !omitSelectedValues) {\n        setFocusedIndex(prev.index)\n      } else {\n        if (selectedIndexes.includes(prev.index)) {\n          const enabledPrev =\n            enabledValues.reverse().find(({ index }) => index < prev.index) ??\n            enabledValues[0]\n\n          setFocusedIndex(enabledPrev?.index ?? -1)\n        } else {\n          setFocusedIndex(prev.index)\n        }\n      }\n    })\n\n    timeoutIds.current.add(id)\n  }, [\n    descendants,\n    enabledValues,\n    focusedIndex,\n    multi,\n    omitSelectedValues,\n    selectedIndexes,\n    setFocusedIndex,\n  ])\n\n  const onFocusFirstOrSelected =\n    emptyValue || omitSelectedValues ? onFocusFirst : onFocusSelected\n  const onFocusLastOrSelected =\n    emptyValue || omitSelectedValues ? onFocusLast : onFocusSelected\n\n  const onChangeLabel = useCallback(\n    (newValue: MaybeValue) => {\n      const values = descendants.values()\n\n      if (!values.length) return\n\n      const resolvedValues = isArray(newValue) ? newValue : [newValue]\n\n      const selectedLabel = resolvedValues\n        .map((value) => {\n          const { index, node } =\n            values.find(({ node }) => node.dataset.value === value) ?? {}\n\n          if (!node || (hasPlaceholder && index === 0)) return\n\n          const { innerHTML } =\n            Array.from(node.children).find(\n              (child) => child.getAttribute(\"data-label\") !== null,\n            ) ?? {}\n\n          return innerHTML\n        })\n        .filter((label) => !isUndefined(label))\n\n      setLabel((!multi ? selectedLabel[0] : selectedLabel) as T)\n    },\n    [descendants, multi, hasPlaceholder],\n  )\n\n  const onChange = useCallback(\n    (newValue: string) => {\n      setValue((prev) => {\n        if (!isArray(prev)) {\n          return newValue as T\n        } else {\n          const selected = prev.includes(newValue)\n\n          if (!selected) {\n            return [...prev, newValue] as T\n          } else {\n            return prev.filter((value) => value !== newValue) as T\n          }\n        }\n      })\n    },\n    [setValue],\n  )\n\n  const onClear = useCallback(\n    (ev: MouseEvent<HTMLDivElement>) => {\n      ev.stopPropagation()\n\n      setValue([] as unknown as T)\n      setLabel(undefined)\n    },\n    [setLabel, setValue],\n  )\n\n  const {\n    open,\n    onClose,\n    onOpen: onInternalOpen,\n  } = useDisclosure({\n    defaultIsOpen,\n    defaultOpen,\n    isOpen,\n    open: openProp,\n    onClose: onCloseProp,\n    onOpen: onOpenProp,\n  })\n\n  const onOpen = useCallback(() => {\n    if (formControlProps.disabled || formControlProps.readOnly) return\n\n    if (empty || allSelected) return\n\n    onInternalOpen()\n  }, [formControlProps, empty, allSelected, onInternalOpen])\n\n  const onSelect = useCallback(() => {\n    let enabledValue = descendants.value(focusedIndex)\n\n    if (\"disabled\" in (enabledValue?.node.dataset ?? {}))\n      enabledValue = undefined\n\n    if (!enabledValue) return\n\n    const value = enabledValue.node.dataset.value ?? \"\"\n\n    onChange(value)\n\n    if (closeOnSelect) onClose()\n\n    if (omitSelectedValues) onFocusNext()\n  }, [\n    closeOnSelect,\n    descendants,\n    focusedIndex,\n    omitSelectedValues,\n    onChange,\n    onClose,\n    onFocusNext,\n  ])\n\n  const onClick = useCallback(() => {\n    if (open) return\n\n    onOpen()\n\n    onFocusFirstOrSelected()\n  }, [open, onFocusFirstOrSelected, onOpen])\n\n  const onFocus = useCallback(() => {\n    if (open) return\n\n    onOpen()\n\n    onFocusFirstOrSelected()\n  }, [open, onFocusFirstOrSelected, onOpen])\n\n  const onBlur = useCallback(\n    (ev: FocusEvent<HTMLDivElement>) => {\n      const relatedTarget = getEventRelatedTarget(ev)\n\n      if (isContains(containerRef.current, relatedTarget)) return\n\n      if (!closeOnBlur) return\n\n      if (open) onClose()\n    },\n    [closeOnBlur, open, onClose],\n  )\n\n  const onKeyDown = useCallback(\n    (ev: KeyboardEvent<HTMLDivElement>) => {\n      if (ev.key === \" \") ev.key = ev.code\n\n      if (formControlProps.disabled || formControlProps.readOnly) return\n\n      const actions: { [key: string]: Function | undefined } = {\n        ArrowDown: focused\n          ? () => onFocusNext()\n          : !open\n            ? funcAll(onOpen, onFocusFirstOrSelected)\n            : undefined,\n        ArrowUp:\n          ev.altKey && open\n            ? onClose\n            : focused\n              ? () => onFocusPrev()\n              : !open\n                ? funcAll(onOpen, onFocusLastOrSelected)\n                : undefined,\n        End: open ? onFocusLast : undefined,\n        Enter: focused\n          ? onSelect\n          : !open\n            ? funcAll(onOpen, onFocusFirstOrSelected)\n            : undefined,\n        Escape: closeOnEsc ? onClose : undefined,\n        Home: open ? onFocusFirst : undefined,\n        Space: focused\n          ? onSelect\n          : !open\n            ? funcAll(onOpen, onFocusFirstOrSelected)\n            : undefined,\n      }\n\n      const action = actions[ev.key]\n\n      if (!action) return\n\n      ev.preventDefault()\n      ev.stopPropagation()\n      action()\n    },\n    [\n      formControlProps.disabled,\n      formControlProps.readOnly,\n      focused,\n      open,\n      onOpen,\n      onFocusFirstOrSelected,\n      onFocusLastOrSelected,\n      onSelect,\n      onFocusFirst,\n      onFocusLast,\n      closeOnEsc,\n      onClose,\n      onFocusNext,\n      onFocusPrev,\n    ],\n  )\n\n  useOutsideClick({\n    ref: containerRef,\n    enabled: open && closeOnBlur,\n    handler: onClose,\n  })\n\n  useEffect(() => {\n    if (!multi) return\n\n    if (!omitSelectedValues && isUndefined(maxSelectValues)) return\n\n    const all = value.length > 0 && value.length === descendants.count()\n    const max = value.length === maxSelectValues\n\n    if (all || max) {\n      onClose()\n      setAllSelected(true)\n    } else {\n      setAllSelected(false)\n    }\n  }, [omitSelectedValues, value, descendants, multi, onClose, maxSelectValues])\n\n  useSafeLayoutEffect(() => {\n    onChangeLabel(value)\n  }, [value])\n\n  useUpdateEffect(() => {\n    if (!open) setFocusedIndex(-1)\n  }, [open])\n\n  useUnmountEffect(() => {\n    timeoutIds.current.forEach((id) => clearTimeout(id))\n    timeoutIds.current.clear()\n  })\n\n  const getPopoverProps = useCallback(\n    (props?: PopoverProps): PopoverProps => ({\n      animation,\n      boundary,\n      closeDelay,\n      closeOnBlur,\n      duration,\n      eventListeners,\n      flip,\n      gutter,\n      lazy,\n      lazyBehavior,\n      matchWidth,\n      modifiers,\n      offset,\n      openDelay,\n      placement,\n      preventOverflow,\n      strategy,\n      ...props,\n      closeOnButton: false,\n      open,\n      trigger: \"never\",\n      onClose,\n      onOpen,\n    }),\n    [\n      closeOnBlur,\n      openDelay,\n      closeDelay,\n      lazy,\n      lazyBehavior,\n      animation,\n      duration,\n      offset,\n      gutter,\n      preventOverflow,\n      flip,\n      matchWidth,\n      boundary,\n      eventListeners,\n      strategy,\n      placement,\n      modifiers,\n      open,\n      onOpen,\n      onClose,\n    ],\n  )\n\n  const getContainerProps: PropGetter = useCallback(\n    (props = {}, ref = null) => ({\n      ref: mergeRefs(containerRef, ref),\n      ...containerProps,\n      ...props,\n      ...formControlProps,\n      onBlur: handlerAll(props.onBlur, rest.onBlur, onBlur),\n      onClick: handlerAll(props.onClick, rest.onClick, onClick),\n    }),\n    [containerProps, formControlProps, onBlur, onClick, rest],\n  )\n\n  const getFieldProps: PropGetter = useCallback(\n    (\n      {\n        \"aria-label\": ariaLabel = placeholder ??\n          `Select ${multi ? \"one or more options.\" : \"an option.\"}`,\n        ...props\n      } = {},\n      ref = null,\n    ) => {\n      return {\n        ref: mergeRefs(fieldRef, ref),\n        \"aria-activedescendant\": activedescendantId,\n        \"aria-haspopup\": \"listbox\",\n        \"aria-label\": ariaLabel,\n        role: \"combobox\",\n        tabIndex: 0,\n        ...fieldProps,\n        ...props,\n        \"data-active\": dataAttr(open),\n        \"data-placeholder\": dataAttr(\n          !multi ? label === undefined : !label?.length,\n        ),\n        onFocus: handlerAll(props.onFocus, rest.onFocus, onFocus),\n        onKeyDown: handlerAll(props.onKeyDown, rest.onKeyDown, onKeyDown),\n      }\n    },\n    [\n      activedescendantId,\n      fieldProps,\n      open,\n      multi,\n      label,\n      placeholder,\n      rest,\n      onFocus,\n      onKeyDown,\n    ],\n  )\n\n  return {\n    children: computedChildren,\n    closeOnSelect,\n    containerRef,\n    descendants,\n    empty,\n    fieldRef,\n    focusedIndex,\n    label,\n    omitSelectedValues,\n    open,\n    placeholder,\n    placeholderInOptions,\n    setFocusedIndex,\n    value,\n    formControlProps,\n    getContainerProps,\n    getFieldProps,\n    getPopoverProps,\n    optionProps,\n    onChange,\n    onClear,\n    onClose,\n    onFocusFirst,\n    onFocusLast,\n    onFocusNext,\n    onFocusPrev,\n    onFocusSelected,\n    onOpen,\n  }\n}\n\nexport type UseSelectReturn = ReturnType<typeof useSelect>\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { FC, ReactElement } from \"react\"\nimport type { UseSelectOptionProps } from \"./use-select-option\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useSelectContext } from \"./use-select\"\nimport { useSelectOption } from \"./use-select-option\"\n\ninterface OptionOptions {\n  /**\n   * The select option icon to use.\n   */\n  icon?: null | ReactElement\n}\n\nexport interface OptionProps extends UseSelectOptionProps, OptionOptions {}\n\nexport const Option = forwardRef<OptionProps, \"div\">(\n  ({ className, icon, ...rest }, ref) => {\n    const { styles } = useSelectContext()\n    const { children, customIcon, selected, getOptionProps } =\n      useSelectOption(rest)\n\n    icon ??= customIcon\n\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      color: \"inherit\",\n      display: \"flex\",\n      flex: \"0 0 auto\",\n      gap: \"0.75rem\",\n      outline: 0,\n      textAlign: \"start\",\n      textDecoration: \"none\",\n      userSelect: \"none\",\n      width: \"100%\",\n      ...styles.item,\n    }\n\n    return (\n      <ui.div\n        className={cx(\"ui-select__item\", className)}\n        __css={css}\n        {...getOptionProps({}, ref)}\n      >\n        {icon !== null ? (\n          <OptionIcon opacity={selected ? 1 : 0}>\n            {icon || <CheckIcon />}\n          </OptionIcon>\n        ) : null}\n\n        <ui.span style={{ flex: 1 }} data-label>\n          {children}\n        </ui.span>\n      </ui.div>\n    )\n  },\n)\n\nOption.displayName = \"Option\"\nOption.__ui__ = \"Option\"\n\ninterface OptionIconProps extends HTMLUIProps<\"span\"> {}\n\nconst OptionIcon = forwardRef<OptionIconProps, \"span\">(\n  ({ className, ...rest }, ref) => {\n    const { styles } = useSelectContext()\n\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      display: \"inline-flex\",\n      flexShrink: 0,\n      fontSize: \"0.85em\",\n      justifyContent: \"center\",\n      ...styles.itemIcon,\n    }\n\n    return (\n      <ui.span\n        ref={ref}\n        className={cx(\"ui-select__item__icon\", className)}\n        __css={css}\n        {...rest}\n      />\n    )\n  },\n)\n\nOptionIcon.displayName = \"OptionIcon\"\nOptionIcon.__ui__ = \"OptionIcon\"\n\nconst CheckIcon: FC = () => (\n  <svg height=\"1em\" viewBox=\"0 0 14 14\" width=\"1em\">\n    <polygon\n      fill=\"currentColor\"\n      points=\"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039\"\n    />\n  </svg>\n)\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { CSSProperties, MouseEvent } from \"react\"\nimport {\n  ariaAttr,\n  dataAttr,\n  handlerAll,\n  isArray,\n  isHTMLElement,\n  isNumber,\n  isString,\n  isUndefined,\n  mergeRefs,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useId, useMemo, useRef } from \"react\"\nimport { useSelectContext, useSelectDescendant } from \"./use-select\"\n\nconst isTargetOption = (target: EventTarget | null): boolean =>\n  isHTMLElement(target) && !!target.getAttribute(\"role\")?.startsWith(\"option\")\n\nexport interface UseSelectOptionProps extends Omit<HTMLUIProps, \"value\"> {\n  /**\n   * If `true`, the list element will be closed when selected.\n   *\n   * @default false\n   */\n  closeOnSelect?: boolean\n  /**\n   * If `true`, the select option will be disabled.\n   *\n   * @default false\n   */\n  disabled?: boolean\n  /**\n   * If `true`, the select option will be focusable.\n   *\n   * @default false\n   */\n  focusable?: boolean\n  /**\n   * If `true`, the select option will be disabled.\n   *\n   * @default false\n   *\n   * @deprecated Use `disabled` instead.\n   */\n  isDisabled?: boolean\n  /**\n   * If `true`, the select option will be focusable.\n   *\n   * @default false\n   *\n   * @deprecated Use `focusable` instead.\n   */\n  isFocusable?: boolean\n  /**\n   * The value of the select option.\n   */\n  value?: string\n}\n\nexport const useSelectOption = (props: UseSelectOptionProps) => {\n  const {\n    closeOnSelect,\n    fieldRef,\n    focusedIndex,\n    omitSelectedValues,\n    placeholder,\n    placeholderInOptions,\n    setFocusedIndex,\n    value: selectedValue,\n    optionProps,\n    onChange,\n    onClose,\n    onFocusNext,\n  } = useSelectContext()\n  const uuid = useId()\n  const itemRef = useRef<HTMLLIElement>(null)\n  const {\n    id = uuid,\n    children,\n    closeOnSelect: customCloseOnSelect,\n    isDisabled,\n    disabled = isDisabled,\n    isFocusable,\n    focusable = isFocusable,\n    icon: customIcon,\n    value: optionValue,\n    ...computedProps\n  } = { ...optionProps, ...props }\n  const trulyDisabled = !!disabled && !focusable\n  const { descendants, index, register } = useSelectDescendant({\n    disabled: trulyDisabled,\n  })\n  const values = descendants.values()\n  const frontValues = values.slice(0, index)\n  const hasPlaceholder = !!placeholder && placeholderInOptions\n  const optionPlaceholder = hasPlaceholder && index === 0\n  const multi = isArray(selectedValue)\n  const focused = index === focusedIndex\n\n  const value = useMemo(() => {\n    let value = optionValue\n\n    if (!optionPlaceholder && isUndefined(optionValue)) {\n      if (isString(children) || isNumber(children)) {\n        value = children.toString()\n      } else {\n        console.warn(\n          `${\n            !multi ? \"Select\" : \"MultiSelect\"\n          }: Cannot infer the option value of complex children. Pass a \\`value\\` prop or use a plain string as children to <Option>.`,\n        )\n      }\n    }\n\n    if (hasPlaceholder && index > 0 && !optionValue) {\n      console.warn(\n        `${\n          !multi ? \"Select\" : \"MultiSelect\"\n        }: If placeholders are present, All options must be set value. If want to set an empty value, either don't set the placeholder or set \\`placeholderInOptions\\` to false.`,\n      )\n    }\n\n    return value ?? \"\"\n  }, [children, hasPlaceholder, index, multi, optionPlaceholder, optionValue])\n\n  const duplicated = !multi\n    ? frontValues.some(({ node }) => node.dataset.selectedValue === value)\n    : false\n  const selected =\n    !duplicated &&\n    (!multi ? value === selectedValue : selectedValue.includes(value))\n\n  const onClick = useCallback(\n    (ev: MouseEvent<HTMLDivElement>) => {\n      ev.preventDefault()\n      ev.stopPropagation()\n\n      if (disabled || !isTargetOption(ev.currentTarget)) {\n        if (fieldRef.current) fieldRef.current.focus()\n\n        return\n      }\n\n      if (!duplicated) setFocusedIndex(index)\n\n      onChange(value)\n\n      if (fieldRef.current) fieldRef.current.focus()\n\n      if (customCloseOnSelect ?? closeOnSelect) onClose()\n\n      if (omitSelectedValues) onFocusNext()\n    },\n    [\n      disabled,\n      duplicated,\n      setFocusedIndex,\n      index,\n      onChange,\n      value,\n      fieldRef,\n      customCloseOnSelect,\n      closeOnSelect,\n      onClose,\n      omitSelectedValues,\n      onFocusNext,\n    ],\n  )\n\n  const getOptionProps: PropGetter = useCallback(\n    (props = {}, ref = null) => {\n      const style: CSSProperties = {\n        border: \"0px\",\n        clip: \"rect(0px, 0px, 0px, 0px)\",\n        height: \"1px\",\n        margin: \"-1px\",\n        overflow: \"hidden\",\n        padding: \"0px\",\n        position: \"absolute\",\n        whiteSpace: \"nowrap\",\n        width: \"1px\",\n      }\n\n      return {\n        ref: mergeRefs(itemRef, ref, register),\n        role: \"option\",\n        ...computedProps,\n        ...props,\n        id,\n        style: omitSelectedValues && selected ? style : undefined,\n        \"aria-disabled\": ariaAttr(disabled),\n        \"aria-selected\": selected,\n        \"data-disabled\": dataAttr(disabled),\n        \"data-duplicated\": dataAttr(duplicated),\n        \"data-focus\": dataAttr(focused),\n        \"data-value\": value,\n        tabIndex: -1,\n        onClick: handlerAll(computedProps.onClick, props.onClick, onClick),\n      }\n    },\n    [\n      id,\n      value,\n      computedProps,\n      disabled,\n      focused,\n      duplicated,\n      selected,\n      omitSelectedValues,\n      onClick,\n      register,\n    ],\n  )\n\n  return {\n    children,\n    customIcon,\n    focused,\n    selected,\n    getOptionProps,\n  }\n}\n\nexport type UseSelectOptionReturn = ReturnType<typeof useSelectOption>\n","import type { HTMLUIProps } from \"@yamada-ui/core\"\nimport type { UseSelectOptionGroupProps } from \"./use-select-option-group\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useSelectContext } from \"./use-select\"\nimport { useSelectOptionGroup } from \"./use-select-option-group\"\n\ninterface OptionGroupOptions extends UseSelectOptionGroupProps {}\n\nexport interface OptionGroupProps extends HTMLUIProps, OptionGroupOptions {\n  /**\n   * Props for option group element.\n   */\n  labelProps?: HTMLUIProps<\"header\">\n}\n\nexport const OptionGroup = forwardRef<OptionGroupProps, \"div\">(\n  (\n    {\n      className,\n      children,\n      color,\n      h,\n      height = h,\n      minH,\n      minHeight = minH,\n      labelProps,\n      ...rest\n    },\n    ref,\n  ) => {\n    const { styles } = useSelectContext()\n    const { label, getContainerProps, getGroupProps, getLabelProps } =\n      useSelectOptionGroup(rest)\n\n    return (\n      <ui.section\n        className={cx(\"ui-select__item\", \"ui-select__item--group\", className)}\n        __css={{ color, h: \"fit-content\", w: \"100%\" }}\n        {...getContainerProps()}\n      >\n        <ui.header\n          className=\"ui-select__item__group-label\"\n          lineClamp={1}\n          __css={styles.groupLabel}\n          {...getLabelProps(labelProps)}\n        >\n          {label}\n        </ui.header>\n\n        <ui.div\n          {...getGroupProps({}, ref)}\n          className=\"ui-select__item__group\"\n          height={height}\n          minHeight={minHeight}\n          __css={styles.group}\n        >\n          {children}\n        </ui.div>\n      </ui.section>\n    )\n  },\n)\n\nOptionGroup.displayName = \"OptionGroup\"\nOptionGroup.__ui__ = \"OptionGroup\"\n","import type { HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { CSSProperties } from \"react\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport { isArray, mergeRefs, splitObject } from \"@yamada-ui/utils\"\nimport { useCallback, useId, useRef } from \"react\"\nimport { useSelectContext, useSelectDescendantsContext } from \"./use-select\"\n\nexport interface UseSelectOptionGroupProps extends HTMLUIProps {\n  /**\n   * The label of the option group.\n   */\n  label: string\n}\n\nexport const useSelectOptionGroup = ({\n  label,\n  ...rest\n}: UseSelectOptionGroupProps) => {\n  const { omitSelectedValues, value } = useSelectContext()\n  const descendants = useSelectDescendantsContext()\n  const labelRef = useRef<HTMLDivElement>(null)\n  const labelId = useId()\n  const values = descendants.values()\n  const multi = isArray(value)\n  const selectedValues =\n    multi && omitSelectedValues\n      ? descendants.values(({ node }) =>\n          value.includes(node.dataset.value ?? \"\"),\n        )\n      : []\n  const selectedIndexes = selectedValues.map(({ index }) => index)\n  const childValues = values.filter(\n    ({ index, node }) =>\n      node.parentElement?.dataset.label === label &&\n      !selectedIndexes.includes(index),\n  )\n  const empty = !childValues.length\n\n  const [containerProps, groupProps] = splitObject(rest, layoutStyleProperties)\n\n  const getContainerProps: PropGetter = useCallback(\n    (props = {}, ref = null) => {\n      const style: CSSProperties = {\n        border: \"0px\",\n        clip: \"rect(0px, 0px, 0px, 0px)\",\n        height: \"1px\",\n        margin: \"-1px\",\n        overflow: \"hidden\",\n        padding: \"0px\",\n        position: \"absolute\",\n        whiteSpace: \"nowrap\",\n        width: \"1px\",\n      }\n\n      return {\n        ref,\n        \"aria-labelledby\": labelRef.current?.id,\n        role: \"group\",\n        ...props,\n        ...containerProps,\n        style: empty ? style : undefined,\n      }\n    },\n    [containerProps, empty],\n  )\n\n  const getLabelProps: PropGetter = useCallback(\n    ({ id, ...props } = {}, ref = null) => {\n      return {\n        id: id ?? labelId,\n        ref: mergeRefs(ref, labelRef),\n        role: \"presentation\",\n        ...props,\n      }\n    },\n    [labelId],\n  )\n\n  const getGroupProps: PropGetter = useCallback(\n    (props = {}, ref = null) => {\n      return {\n        ref,\n        ...props,\n        ...groupProps,\n        \"data-label\": label,\n      }\n    },\n    [groupProps, label],\n  )\n\n  return {\n    label,\n    getContainerProps,\n    getGroupProps,\n    getLabelProps,\n  }\n}\n\nexport type UseSelectOptionGroupReturn = ReturnType<typeof useSelectOptionGroup>\n","import type { CSSUIProps, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { MotionPropsWithoutChildren } from \"@yamada-ui/motion\"\nimport type { ReactNode } from \"react\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { PopoverContent } from \"@yamada-ui/popover\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useSelectContext } from \"./use-select\"\nimport { useSelectList } from \"./use-select-list\"\n\nexport interface SelectListProps extends HTMLUIProps {\n  footer?: ReactNode\n  header?: ReactNode\n  contentProps?: MotionPropsWithoutChildren\n}\n\nexport const SelectList = forwardRef<SelectListProps, \"div\">(\n  (\n    {\n      className,\n      children,\n      footer,\n      header,\n      maxW,\n      maxWidth = maxW,\n      minW,\n      minWidth = minW,\n      w,\n      width = w,\n      contentProps,\n      ...rest\n    },\n    ref,\n  ) => {\n    const { styles } = useSelectContext()\n    const { getContainerProps, getListProps } = useSelectList()\n\n    width ??= (styles.list?.width ?? styles.list?.w) as CSSUIProps[\"width\"]\n    minWidth ??= (styles.list?.minWidth ??\n      styles.list?.minW) as CSSUIProps[\"minWidth\"]\n    maxWidth ??= (styles.list?.maxWidth ??\n      styles.list?.maxW) as CSSUIProps[\"maxWidth\"]\n\n    return (\n      <PopoverContent\n        as=\"div\"\n        className=\"ui-select__content\"\n        maxWidth={maxWidth}\n        minWidth={minWidth}\n        width={width}\n        __css={styles.content}\n        {...getContainerProps(contentProps)}\n      >\n        {header ? (\n          <ui.header className=\"ui-select__header\" __css={styles.header}>\n            {header}\n          </ui.header>\n        ) : null}\n\n        <ui.div\n          className={cx(\"ui-select__list\", className)}\n          __css={styles.list}\n          {...getListProps(rest, ref)}\n        >\n          {children}\n        </ui.div>\n\n        {footer ? (\n          <ui.footer className=\"ui-select__footer\" __css={styles.footer}>\n            {footer}\n          </ui.footer>\n        ) : null}\n      </PopoverContent>\n    )\n  },\n)\n\nSelectList.displayName = \"SelectList\"\nSelectList.__ui__ = \"SelectList\"\n","import type { PropGetter } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport { ariaAttr, handlerAll, isArray, mergeRefs } from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useRef } from \"react\"\nimport { useSelectContext, useSelectDescendantsContext } from \"./use-select\"\n\nexport const useSelectList = () => {\n  const { focusedIndex, open, value } = useSelectContext()\n  const descendants = useSelectDescendantsContext()\n  const listRef = useRef<HTMLDivElement>(null)\n  const beforeFocusedIndex = useRef<number>(-1)\n  const selectedValue = descendants.value(focusedIndex)\n  const multi = isArray(value)\n\n  const onAnimationComplete = useCallback(() => {\n    if (!open) listRef.current?.scrollTo({ top: 0 })\n  }, [open])\n\n  useEffect(() => {\n    if (!listRef.current || !selectedValue) return\n\n    if (beforeFocusedIndex.current === selectedValue.index) return\n\n    const parent = listRef.current\n    const child = selectedValue.node\n\n    const parentHeight = parent.clientHeight\n    const viewTop = parent.scrollTop\n    const viewBottom = viewTop + parentHeight\n\n    const childHeight = child.clientHeight\n    const childTop = child.offsetTop\n    const childBottom = childTop + childHeight\n\n    const inView = viewTop <= childTop && childBottom <= viewBottom\n\n    const scrollBottom = beforeFocusedIndex.current < selectedValue.index\n\n    if (!inView) {\n      if (childBottom <= parentHeight) {\n        listRef.current.scrollTo({ top: 0 })\n      } else {\n        if (!scrollBottom) {\n          listRef.current.scrollTo({ top: childTop + 1 })\n        } else {\n          listRef.current.scrollTo({ top: childBottom - parentHeight })\n        }\n      }\n    }\n\n    beforeFocusedIndex.current = selectedValue.index\n  }, [listRef, selectedValue])\n\n  const getContainerProps: PropGetter<MotionProps, MotionProps> = useCallback(\n    (props = {}, ref = null) => ({\n      ref,\n      \"aria-multiselectable\": ariaAttr(multi),\n      role: \"listbox\",\n      ...props,\n      onAnimationComplete: handlerAll(\n        props.onAnimationComplete,\n        onAnimationComplete,\n      ),\n    }),\n    [multi, onAnimationComplete],\n  )\n\n  const getListProps: PropGetter = useCallback(\n    (props = {}, ref = null) => ({\n      ref: mergeRefs(listRef, ref),\n      position: \"relative\",\n      tabIndex: -1,\n      ...props,\n    }),\n    [listRef],\n  )\n\n  return {\n    getContainerProps,\n    getListProps,\n  }\n}\n\nexport type UseSelectListReturn = ReturnType<typeof useSelectList>\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { MotionProps } from \"@yamada-ui/motion\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type { FC, ReactNode } from \"react\"\nimport type { SelectIconProps } from \"./select-icon\"\nimport type { SelectListProps } from \"./select-list\"\nimport type { UseSelectProps } from \"./use-select\"\nimport {\n  forwardRef,\n  omitThemeProps,\n  ui,\n  useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { Popover, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport { Option } from \"./option\"\nimport { SelectIcon } from \"./select-icon\"\nimport { SelectList } from \"./select-list\"\nimport {\n  SelectDescendantsContextProvider,\n  SelectProvider,\n  useSelect,\n  useSelectContext,\n} from \"./use-select\"\n\ninterface SelectOptions {\n  /**\n   * The border color when the input is invalid.\n   */\n  errorBorderColor?: string\n  /**\n   * The border color when the input is focused.\n   */\n  focusBorderColor?: string\n  /**\n   * The footer of the select content element.\n   */\n  footer?: FC<{ value: string | undefined; onClose: () => void }> | ReactNode\n  /**\n   * The header of the select content element.\n   */\n  header?: FC<{ value: string | undefined; onClose: () => void }> | ReactNode\n  /**\n   * Props for select container element.\n   */\n  containerProps?: Omit<HTMLUIProps, \"children\">\n  /**\n   * Props for select content element.\n   */\n  contentProps?: Omit<MotionProps, \"children\">\n  /**\n   * Props for select field element.\n   */\n  fieldProps?: Omit<SelectFieldProps, \"children\">\n  /**\n   * Props for select icon element.\n   */\n  iconProps?: SelectIconProps\n  /**\n   * Props for select list element.\n   */\n  listProps?: Omit<SelectListProps, \"children\">\n  /**\n   * Props to be forwarded to the portal component.\n   *\n   * @default '{ disabled: true }'\n   */\n  portalProps?: Omit<PortalProps, \"children\">\n}\n\nexport type SelectProps = Omit<\n  UseSelectProps,\n  \"maxSelectValues\" | \"omitSelectedValues\"\n> &\n  SelectOptions &\n  ThemeProps<\"Select\">\n\n/**\n * `Select` is a component used for allowing a user to choose one option from a list.\n *\n * @see Docs https://yamada-ui.com/components/forms/select\n */\nexport const Select = forwardRef<SelectProps, \"div\">((props, ref) => {\n  const [styles, mergedProps] = useComponentMultiStyle(\"Select\", props)\n  const {\n    className,\n    color,\n    defaultValue = \"\",\n    footer,\n    h,\n    header,\n    height = h,\n    minH,\n    minHeight = minH,\n    placeholder,\n    placeholderInOptions = true,\n    containerProps,\n    contentProps,\n    fieldProps,\n    iconProps,\n    listProps,\n    portalProps = { disabled: true },\n    ...computedProps\n  } = omitThemeProps(mergedProps)\n\n  const {\n    children,\n    descendants,\n    empty,\n    value,\n    formControlProps,\n    getContainerProps,\n    getFieldProps,\n    getPopoverProps,\n    onClose,\n    ...rest\n  } = useSelect({\n    ...computedProps,\n    defaultValue,\n    placeholder,\n    placeholderInOptions,\n  })\n  const css: CSSUIObject = {\n    color,\n    h: \"fit-content\",\n    w: \"100%\",\n    ...styles.container,\n  }\n\n  return (\n    <SelectDescendantsContextProvider value={descendants}>\n      <SelectProvider\n        value={{\n          ...rest,\n          placeholder,\n          placeholderInOptions,\n          styles,\n          value,\n          onClose,\n        }}\n      >\n        <Popover {...getPopoverProps()}>\n          <ui.div\n            className={cx(\"ui-select\", className)}\n            __css={css}\n            {...getContainerProps(containerProps)}\n          >\n            <ui.div\n              className=\"ui-select__inner\"\n              __css={{ position: \"relative\", ...styles.inner }}\n            >\n              <PopoverTrigger>\n                <SelectField\n                  height={height}\n                  minHeight={minHeight}\n                  {...getFieldProps(fieldProps, ref)}\n                />\n              </PopoverTrigger>\n\n              <SelectIcon {...iconProps} {...formControlProps} />\n            </ui.div>\n\n            {!empty ? (\n              <Portal {...portalProps}>\n                <SelectList\n                  footer={runIfFunc(footer, { value, onClose })}\n                  header={runIfFunc(header, { value, onClose })}\n                  contentProps={contentProps}\n                  {...listProps}\n                >\n                  {!!placeholder && placeholderInOptions ? (\n                    <Option>{placeholder}</Option>\n                  ) : null}\n\n                  {children}\n                </SelectList>\n              </Portal>\n            ) : null}\n          </ui.div>\n        </Popover>\n      </SelectProvider>\n    </SelectDescendantsContextProvider>\n  )\n})\n\nSelect.displayName = \"Select\"\nSelect.__ui__ = \"Select\"\n\ninterface SelectFieldProps extends HTMLUIProps {}\n\nconst SelectField = forwardRef<SelectFieldProps, \"div\">(\n  ({ className, isTruncated = true, lineClamp, ...rest }, ref) => {\n    const { label, placeholder, styles } = useSelectContext()\n\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      display: \"flex\",\n      pe: \"2rem\",\n      ...styles.field,\n    }\n\n    return (\n      <ui.div\n        ref={ref}\n        className={cx(\"ui-select__field\", className)}\n        __css={css}\n        {...rest}\n      >\n        <ui.span\n          dangerouslySetInnerHTML={{\n            __html: label ?? placeholder ?? \"\",\n          }}\n          isTruncated={isTruncated}\n          lineClamp={lineClamp}\n        />\n      </ui.div>\n    )\n  },\n)\n\nSelectField.displayName = \"SelectField\"\nSelectField.__ui__ = \"SelectField\"\n"]}