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9B,MAAO+B,EAEX,CAlBwB3L,OAAOuL,IAAI,kBAoBnC9M,EAAQ8L,IAAMiB,EACd/M,EAAQsN,KAAOP,mBC9BbQ,EAAOvN,QAAU,EAAjB","sources":["webpack://app/./node_modules/@seznam/compose-react-refs/composeRefs.js","webpack://app/./node_modules/@vtaits/use-lazy-ref/dist/index.js","webpack://app/./node_modules/use-latest/dist/use-latest.esm.js","webpack://app/./node_modules/krustykrab/dist/index.mjs","webpack://app/./node_modules/sleep-promise/build/esm.mjs","webpack://app/./node_modules/react-select-async-paginate/dist/esm/index.js","webpack://app/./node_modules/use-is-mounted-ref/dist/use-is-mounted-ref.es.js","webpack://app/./node_modules/react/cjs/react-jsx-runtime.production.js","webpack://app/./node_modules/react/jsx-runtime.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction composeRefs() {\n var refs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n refs[_i] = arguments[_i];\n }\n if (refs.length === 2) { // micro-optimize the hot path\n return composeTwoRefs(refs[0], refs[1]) || null;\n }\n var composedRef = refs.slice(1).reduce(function (semiCombinedRef, refToInclude) { return composeTwoRefs(semiCombinedRef, refToInclude); }, refs[0]);\n return composedRef || null;\n}\nexports.default = composeRefs;\nvar composedRefCache = new WeakMap();\nfunction composeTwoRefs(ref1, ref2) {\n if (ref1 && ref2) {\n var ref1Cache = composedRefCache.get(ref1) || new WeakMap();\n composedRefCache.set(ref1, ref1Cache);\n var composedRef = ref1Cache.get(ref2) || (function (instance) {\n updateRef(ref1, instance);\n updateRef(ref2, instance);\n });\n ref1Cache.set(ref2, composedRef);\n return composedRef;\n }\n if (!ref1) {\n return ref2;\n }\n else {\n return ref1;\n }\n}\nfunction updateRef(ref, instance) {\n if (typeof ref === 'function') {\n ref(instance);\n }\n else {\n ref.current = instance;\n }\n}\n//# sourceMappingURL=composeRefs.js.map","// src/index.ts\nimport { useRef } from \"react\";\nvar EMPTY_VALUE = Symbol(\"useLazyRef empty value\");\nvar useLazyRef = (init) => {\n const resultRef = useRef(EMPTY_VALUE);\n if (resultRef.current === EMPTY_VALUE) {\n resultRef.current = init();\n }\n return resultRef;\n};\nexport {\n EMPTY_VALUE,\n useLazyRef\n};\n//# sourceMappingURL=index.js.map","import * as React from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\n\nvar useLatest = function useLatest(value) {\n var ref = React.useRef(value);\n useIsomorphicLayoutEffect(function () {\n ref.current = value;\n });\n return ref;\n};\n\nexport { useLatest as default };\n","// src/option_result.ts\nfunction Ok(result) {\n const self = {\n isOk: () => true,\n isOkAnd: (fn) => fn(result),\n isErr: () => false,\n isErrAnd: () => false,\n ok: () => Some(result),\n err: () => None(),\n map: (fn) => Ok(fn(result)),\n mapOr: (_, fn) => fn(result),\n mapOrElse: (_, fn) => fn(result),\n mapErr: () => Ok(result),\n expect: () => result,\n expectErr: (msg) => {\n throw new Error(msg);\n },\n unwrap: () => result,\n unwrapErr: () => {\n throw new Error(`${result}`);\n },\n unwrapOr: () => result,\n unwrapOrElse: () => result,\n and: (res) => res,\n andThen: (getRes) => getRes(result),\n or: () => Ok(result),\n orElse: () => Ok(result)\n };\n return self;\n}\nfunction Err(err) {\n const self = {\n isOk: () => false,\n isOkAnd: () => false,\n isErr: () => true,\n isErrAnd: (fn) => fn(err),\n ok: () => None(),\n err: () => Some(err),\n map: () => Err(err),\n mapOr: (defaultValue) => defaultValue,\n mapOrElse: (getDefaultValue) => getDefaultValue(err),\n mapErr: (fn) => Err(fn(err)),\n expect: (msg) => {\n throw new Error(msg);\n },\n expectErr: () => err,\n unwrap: () => {\n throw new Error(`${err}`);\n },\n unwrapErr: () => err,\n unwrapOr: (defaultValue) => defaultValue,\n unwrapOrElse: (getDefaultValue) => getDefaultValue(err),\n and: () => Err(err),\n andThen: () => Err(err),\n or: (res) => res,\n orElse: (getRes) => getRes(err)\n };\n return self;\n}\nfunction None() {\n const self = {\n and: () => None(),\n andThen: () => None(),\n expect: (msg) => {\n throw new Error(msg);\n },\n filter: () => self,\n isSome: () => false,\n isSomeAnd: () => false,\n isNone: () => true,\n map: () => None(),\n mapOr: (defaultValue) => defaultValue,\n mapOrElse: (getDefaultValue) => getDefaultValue(),\n okOr: (err) => Err(err),\n okOrElse: (getErr) => Err(getErr()),\n or: (opt) => opt,\n orElse: (fn) => fn(),\n unwrap: () => {\n throw new Error(\"panic! call `unwrap` on a `None` value\");\n },\n unwrapOr: (defaultValue) => defaultValue,\n unwrapOrElse: (getDefaultValue) => getDefaultValue(),\n xor: (opt) => {\n if (opt.isSome()) {\n return opt;\n }\n return self;\n }\n };\n return self;\n}\nfunction Some(value) {\n const self = {\n and: (opt) => opt,\n andThen: (fn) => fn(value),\n expect: () => value,\n filter: (fn) => {\n if (fn(value)) {\n return self;\n }\n return None();\n },\n isSome: () => true,\n isSomeAnd: (fn) => fn(value),\n isNone: () => false,\n map: (fn) => Some(fn(value)),\n mapOr: (_, fn) => fn(value),\n mapOrElse: (_, fn) => fn(value),\n okOr: () => Ok(value),\n okOrElse: () => Ok(value),\n or: () => self,\n orElse: () => self,\n unwrap: () => value,\n unwrapOr: () => value,\n unwrapOrElse: () => value,\n xor: (opt) => {\n if (opt.isNone()) {\n return self;\n }\n return None();\n }\n };\n return self;\n}\n\n// src/to_option.ts\nfunction toOption(arg) {\n if (arg === null || arg === void 0) {\n return None();\n }\n return Some(arg);\n}\n\n// src/get_result.ts\nfunction getResult(promise) {\n return promise.then(\n (response) => Ok(response),\n (err) => Err(err)\n );\n}\n\n// src/unwrap.ts\nfunction unwrap(value) {\n if (value === null || value === void 0) {\n throw new Error(`panic! call \\`unwrap\\` on a \\`${value}\\` value`);\n }\n return value;\n}\n\n// src/unwrap_or.ts\nfunction unwrapOr(value, defaultValue) {\n if (value === null || value === void 0) {\n return defaultValue;\n }\n return value;\n}\n\n// src/unwrap_or_else.ts\nfunction unwrapOrElse(value, getDefaultValue) {\n if (value === null || value === void 0) {\n return getDefaultValue();\n }\n return value;\n}\n\n// src/try_catch.ts\nfunction tryCatch(fn) {\n let result;\n try {\n result = fn();\n } catch (e) {\n return Err(e);\n }\n return Ok(result);\n}\nexport {\n Err,\n None,\n Ok,\n Some,\n getResult,\n toOption,\n tryCatch,\n unwrap,\n unwrapOr,\n unwrapOrElse\n};\n//# sourceMappingURL=index.mjs.map","var e=setTimeout;function t(t,n){var u=n.useCachedSetTimeout?e:setTimeout;return new Promise((function(e){u(e,t)}))}function n(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=n.useCachedSetTimeout,r=t(e,{useCachedSetTimeout:u});function o(e){return r.then((function(){return e}))}return o.then=function(){return r.then.apply(r,arguments)},o.catch=Promise.resolve().catch,o}export default n;\n","// src/index.ts\nimport Select from \"react-select\";\n\n// src/useAsyncPaginate.ts\nimport { useCallback as useCallback2, useState as useState2 } from \"react\";\n\n// src/useAsyncPaginateBase.ts\nimport { useLazyRef } from \"@vtaits/use-lazy-ref\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport useIsMountedRef from \"use-is-mounted-ref\";\nimport useLatest from \"use-latest\";\n\n// src/defaultReduceOptions.ts\nvar defaultReduceOptions = (prevOptions, loadedOptions) => [...prevOptions, ...loadedOptions];\n\n// src/defaultShouldLoadMore.ts\nvar AVAILABLE_DELTA = 10;\nvar defaultShouldLoadMore = (scrollHeight, clientHeight, scrollTop) => {\n const bottomBorder = scrollHeight - clientHeight - AVAILABLE_DELTA;\n return bottomBorder < scrollTop;\n};\n\n// src/getInitialCache.ts\nvar getInitialCache = (params) => ({\n isFirstLoad: true,\n options: [],\n hasMore: true,\n isLoading: false,\n lockedUntil: 0,\n additional: params.additional\n});\n\n// src/getInitialOptionsCache.ts\nvar getInitialOptionsCache = ({\n options,\n defaultOptions,\n additional,\n defaultAdditional\n}) => {\n const initialOptions = defaultOptions === true ? null : Array.isArray(defaultOptions) ? defaultOptions : options;\n if (initialOptions) {\n return {\n \"\": {\n isFirstLoad: false,\n isLoading: false,\n options: initialOptions,\n hasMore: true,\n lockedUntil: 0,\n additional: defaultAdditional || additional\n }\n };\n }\n return {};\n};\n\n// src/requestOptions.ts\nimport { getResult } from \"krustykrab\";\nimport sleep from \"sleep-promise\";\n\n// src/validateResponse.ts\nvar errorText = '[react-select-async-paginate] response of \"loadOptions\" should be an object with \"options\" prop, which contains array of options.';\nvar checkIsResponse = (response) => {\n if (!response) {\n return false;\n }\n const { options, hasMore } = response;\n if (!Array.isArray(options)) {\n return false;\n }\n if (typeof hasMore !== \"boolean\" && typeof hasMore !== \"undefined\") {\n return false;\n }\n return true;\n};\nvar validateResponse = (response) => {\n if (!checkIsResponse(response)) {\n console.error(errorText, \"Received:\", response);\n throw new Error(errorText);\n }\n return true;\n};\n\n// src/requestOptions.ts\nvar requestOptions = async (caller, paramsRef, optionsCacheRef, debounceTimeout, setOptionsCache, reduceOptions, isMountedRef) => {\n const currentInputValue = paramsRef.current.inputValue;\n const isCacheEmpty = !optionsCacheRef.current[currentInputValue];\n const currentOptions = isCacheEmpty ? getInitialCache(paramsRef.current) : optionsCacheRef.current[currentInputValue];\n if (currentOptions.isLoading || !currentOptions.hasMore || currentOptions.lockedUntil > Date.now()) {\n return;\n }\n setOptionsCache(\n (prevOptionsCache) => ({\n ...prevOptionsCache,\n [currentInputValue]: {\n ...currentOptions,\n isLoading: true\n }\n })\n );\n if (debounceTimeout > 0 && caller === \"input-change\") {\n await sleep(debounceTimeout);\n const newInputValue = paramsRef.current.inputValue;\n if (currentInputValue !== newInputValue) {\n setOptionsCache((prevOptionsCache) => {\n if (isCacheEmpty) {\n const { [currentInputValue]: itemForDelete, ...restCache } = prevOptionsCache;\n return restCache;\n }\n return {\n ...prevOptionsCache,\n [currentInputValue]: {\n ...currentOptions,\n isLoading: false\n }\n };\n });\n return;\n }\n }\n const { loadOptions, reloadOnErrorTimeout = 0 } = paramsRef.current;\n const result = await getResult(\n Promise.resolve().then(\n () => loadOptions(\n currentInputValue,\n currentOptions.options,\n currentOptions.additional\n )\n )\n );\n if (!isMountedRef.current) {\n return;\n }\n if (result.isErr()) {\n setOptionsCache((prevOptionsCache) => ({\n ...prevOptionsCache,\n [currentInputValue]: {\n ...currentOptions,\n isLoading: false,\n lockedUntil: Date.now() + reloadOnErrorTimeout\n }\n }));\n return;\n }\n const response = result.unwrap();\n if (validateResponse(response)) {\n const { options, hasMore } = response;\n const newAdditional = Object.hasOwn(response, \"additional\") ? response.additional : currentOptions.additional;\n setOptionsCache((prevOptionsCache) => ({\n ...prevOptionsCache,\n [currentInputValue]: {\n ...currentOptions,\n options: reduceOptions(currentOptions.options, options, newAdditional),\n hasMore: !!hasMore,\n isLoading: false,\n isFirstLoad: false,\n additional: newAdditional\n }\n }));\n }\n};\n\n// src/useAsyncPaginateBase.ts\nvar increaseStateId = (prevStateId) => prevStateId + 1;\nvar useAsyncPaginateBase = (params, deps = []) => {\n const {\n defaultOptions,\n loadOptionsOnMenuOpen = true,\n debounceTimeout = 0,\n inputValue,\n menuIsOpen,\n filterOption = null,\n reduceOptions = defaultReduceOptions,\n shouldLoadMore = defaultShouldLoadMore\n } = params;\n const isMountedRef = useIsMountedRef();\n const reduceOptionsRef = useLatest(reduceOptions);\n const loadOptionsOnMenuOpenRef = useLatest(loadOptionsOnMenuOpen);\n const isInitRef = useRef(true);\n const paramsRef = useRef(params);\n paramsRef.current = params;\n const [_stateId, setStateId] = useState(0);\n const optionsCacheRef = useLazyRef(() => getInitialOptionsCache(params));\n const callRequestOptionsRef = useLatest(\n (caller) => {\n requestOptions(\n caller,\n paramsRef,\n optionsCacheRef,\n debounceTimeout,\n (reduceState) => {\n optionsCacheRef.current = reduceState(optionsCacheRef.current);\n if (isMountedRef.current) {\n setStateId(increaseStateId);\n }\n },\n reduceOptionsRef.current,\n isMountedRef\n );\n }\n );\n const handleScrolledToBottom = useCallback(() => {\n const currentInputValue = paramsRef.current.inputValue;\n const currentOptions2 = optionsCacheRef.current[currentInputValue];\n if (currentOptions2) {\n callRequestOptionsRef.current(\"menu-scroll\");\n }\n }, [callRequestOptionsRef, optionsCacheRef]);\n useEffect(() => {\n if (isInitRef.current) {\n isInitRef.current = false;\n } else {\n optionsCacheRef.current = {};\n setStateId(increaseStateId);\n }\n if (defaultOptions === true) {\n callRequestOptionsRef.current(\"autoload\");\n }\n }, deps);\n useEffect(() => {\n if (menuIsOpen && !optionsCacheRef.current[inputValue]) {\n callRequestOptionsRef.current(\"input-change\");\n }\n }, [callRequestOptionsRef, inputValue, menuIsOpen, optionsCacheRef]);\n useEffect(() => {\n if (menuIsOpen && !optionsCacheRef.current[\"\"] && loadOptionsOnMenuOpenRef.current) {\n callRequestOptionsRef.current(\"menu-toggle\");\n }\n }, [\n callRequestOptionsRef,\n loadOptionsOnMenuOpenRef,\n menuIsOpen,\n optionsCacheRef\n ]);\n const currentOptions = optionsCacheRef.current[inputValue] || getInitialCache(params);\n return {\n handleScrolledToBottom,\n shouldLoadMore,\n filterOption,\n isLoading: currentOptions.isLoading || currentOptions.lockedUntil > Date.now(),\n isFirstLoad: currentOptions.isFirstLoad,\n options: currentOptions.options\n };\n};\n\n// src/useAsyncPaginate.ts\nvar useAsyncPaginate = (params, deps = []) => {\n const {\n inputValue: inputValueParam,\n menuIsOpen: menuIsOpenParam,\n defaultInputValue: defaultInputValueParam,\n defaultMenuIsOpen: defaultMenuIsOpenParam,\n onInputChange: onInputChangeParam,\n onMenuClose: onMenuCloseParam,\n onMenuOpen: onMenuOpenParam\n } = params;\n const [inputValueState, setInputValue] = useState2(\n defaultInputValueParam || \"\"\n );\n const [menuIsOpenState, setMenuIsOpen] = useState2(!!defaultMenuIsOpenParam);\n const inputValue = typeof inputValueParam === \"string\" ? inputValueParam : inputValueState;\n const menuIsOpen = typeof menuIsOpenParam === \"boolean\" ? menuIsOpenParam : menuIsOpenState;\n const onInputChange = useCallback2(\n (nextInputValue, actionMeta) => {\n if (onInputChangeParam) {\n onInputChangeParam(nextInputValue, actionMeta);\n }\n setInputValue(nextInputValue);\n },\n [onInputChangeParam]\n );\n const onMenuClose = useCallback2(() => {\n if (onMenuCloseParam) {\n onMenuCloseParam();\n }\n setMenuIsOpen(false);\n }, [onMenuCloseParam]);\n const onMenuOpen = useCallback2(() => {\n if (onMenuOpenParam) {\n onMenuOpenParam();\n }\n setMenuIsOpen(true);\n }, [onMenuOpenParam]);\n const baseResult = useAsyncPaginateBase(\n {\n ...params,\n inputValue,\n menuIsOpen\n },\n deps\n );\n return {\n ...baseResult,\n inputValue,\n menuIsOpen,\n onInputChange,\n onMenuClose,\n onMenuOpen\n };\n};\n\n// src/useComponents.ts\nimport { useMemo as useMemo2 } from \"react\";\nimport { components as defaultComponents } from \"react-select\";\n\n// src/wrapMenuList.tsx\nimport composeRefs from \"@seznam/compose-react-refs\";\nimport { useCallback as useCallback3, useEffect as useEffect2, useMemo, useRef as useRef2 } from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar CHECK_TIMEOUT = 300;\nfunction wrapMenuList(MenuList2) {\n function WrappedMenuList(props) {\n const { selectProps, innerRef } = props;\n const { handleScrolledToBottom, shouldLoadMore } = selectProps;\n const checkTimeoutRef = useRef2(null);\n const menuListRef = useRef2(null);\n const shouldHandle = useCallback3(() => {\n const el = menuListRef.current;\n if (!el) {\n return false;\n }\n const { scrollTop, scrollHeight, clientHeight } = el;\n return shouldLoadMore(scrollHeight, clientHeight, scrollTop);\n }, [shouldLoadMore]);\n const checkAndHandle = useCallback3(() => {\n if (shouldHandle()) {\n if (handleScrolledToBottom) {\n handleScrolledToBottom();\n }\n }\n }, [shouldHandle, handleScrolledToBottom]);\n const setCheckAndHandleTimeout = useMemo(() => {\n const res = () => {\n checkAndHandle();\n checkTimeoutRef.current = setTimeout(res, CHECK_TIMEOUT);\n };\n return res;\n }, [checkAndHandle]);\n useEffect2(() => {\n setCheckAndHandleTimeout();\n return () => {\n if (checkTimeoutRef.current) {\n clearTimeout(checkTimeoutRef.current);\n }\n };\n }, []);\n return /* @__PURE__ */ jsx(\n MenuList2,\n {\n ...props,\n innerRef: composeRefs(innerRef, menuListRef)\n }\n );\n }\n return WrappedMenuList;\n}\n\n// src/useComponents.ts\nvar MenuList = wrapMenuList(\n // biome-ignore lint/suspicious/noExplicitAny: fix types\n defaultComponents.MenuList\n);\nvar useComponents = (components) => useMemo2(\n () => ({\n MenuList,\n ...components\n }),\n [components]\n);\n\n// src/withAsyncPaginate.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nvar defaultCacheUniqs = [];\nvar defaultComponents2 = {};\nfunction withAsyncPaginate(SelectComponent) {\n function WithAsyncPaginate(props) {\n const {\n components = defaultComponents2,\n selectRef = void 0,\n isLoading: isLoadingProp,\n cacheUniqs = defaultCacheUniqs,\n ...rest\n } = props;\n const asyncPaginateProps = useAsyncPaginate(rest, cacheUniqs);\n const processedComponents = useComponents(\n components\n );\n const isLoading = typeof isLoadingProp === \"boolean\" ? isLoadingProp : asyncPaginateProps.isLoading;\n return /* @__PURE__ */ jsx2(\n SelectComponent,\n {\n ...props,\n ...asyncPaginateProps,\n isLoading,\n components: processedComponents,\n ref: selectRef\n }\n );\n }\n return WithAsyncPaginate;\n}\n\n// src/reduceGroupedOptions.ts\nvar checkGroup = (group) => {\n if (!group) {\n return false;\n }\n const { label, options } = group;\n if (typeof label !== \"string\" && typeof label !== \"undefined\") {\n return false;\n }\n if (!Array.isArray(options)) {\n return false;\n }\n return true;\n};\nvar reduceGroupedOptions = (prevOptions, loadedOptions) => {\n const res = prevOptions.slice();\n const mapLabelToIndex = {};\n let prevOptionsIndex = 0;\n const prevOptionsLength = prevOptions.length;\n for (const optionOrGroup of loadedOptions) {\n const group = checkGroup(optionOrGroup) ? optionOrGroup : {\n options: [optionOrGroup]\n };\n const { label = \"\" } = group;\n let groupIndex = mapLabelToIndex[label];\n if (typeof groupIndex !== \"number\") {\n for (; prevOptionsIndex < prevOptionsLength && typeof mapLabelToIndex[label] !== \"number\"; ++prevOptionsIndex) {\n const prevGroup = prevOptions[prevOptionsIndex];\n if (checkGroup(prevGroup)) {\n mapLabelToIndex[prevGroup.label || \"\"] = prevOptionsIndex;\n }\n }\n groupIndex = mapLabelToIndex[label];\n }\n if (typeof groupIndex !== \"number\") {\n mapLabelToIndex[label] = res.length;\n res.push(group);\n } else {\n res[groupIndex] = {\n ...res[groupIndex],\n options: [...res[groupIndex].options, ...group.options]\n };\n }\n }\n return res;\n};\n\n// src/index.ts\nvar AsyncPaginate = withAsyncPaginate(Select);\nexport {\n AsyncPaginate,\n checkIsResponse,\n reduceGroupedOptions,\n useAsyncPaginate,\n useAsyncPaginateBase,\n useComponents,\n validateResponse,\n withAsyncPaginate,\n wrapMenuList\n};\n//# sourceMappingURL=index.js.map","import { useRef, useEffect } from 'react';\n\nfunction useIsMountedRef() {\r\n var isMountedRef = useRef(false);\r\n useEffect(function () {\r\n isMountedRef.current = true;\r\n return function () {\r\n isMountedRef.current = false;\r\n };\r\n }, []);\r\n return isMountedRef;\r\n}\n\nexport { useIsMountedRef as default };\n//# sourceMappingURL=use-is-mounted-ref.es.js.map\n","/**\n * @license React\n * react-jsx-runtime.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar REACT_ELEMENT_TYPE = Symbol.for(\"react.transitional.element\"),\n REACT_FRAGMENT_TYPE = Symbol.for(\"react.fragment\");\nfunction jsxProd(type, config, maybeKey) {\n var key = null;\n void 0 !== maybeKey && (key = \"\" + maybeKey);\n void 0 !== config.key && (key = \"\" + config.key);\n if (\"key\" in config) {\n maybeKey = {};\n for (var propName in config)\n \"key\" !== propName && (maybeKey[propName] = config[propName]);\n } else maybeKey = config;\n config = maybeKey.ref;\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key,\n ref: void 0 !== config ? config : null,\n props: maybeKey\n };\n}\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsxProd;\nexports.jsxs = jsxProd;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["exports","refs","_i","arguments","length","composeTwoRefs","slice","reduce","semiCombinedRef","refToInclude","composedRefCache","WeakMap","ref1","ref2","ref1Cache","get","set","composedRef","instance","updateRef","ref","current","EMPTY_VALUE","Symbol","useLatest","value","Ok","result","isOk","isOkAnd","fn","isErr","isErrAnd","ok","Some","err","None","map","mapOr","_","mapOrElse","mapErr","expect","expectErr","msg","Error","unwrap","unwrapErr","unwrapOr","unwrapOrElse","and","res","andThen","getRes","or","orElse","Err","defaultValue","getDefaultValue","self","filter","isSome","isSomeAnd","isNone","okOr","okOrElse","getErr","opt","xor","e","setTimeout","t","n","u","useCachedSetTimeout","Promise","r","o","then","apply","catch","resolve","defaultReduceOptions","prevOptions","loadedOptions","defaultShouldLoadMore","scrollHeight","clientHeight","scrollTop","getInitialCache","params","isFirstLoad","options","hasMore","isLoading","lockedUntil","additional","errorText","validateResponse","response","Array","isArray","checkIsResponse","console","error","requestOptions","async","caller","paramsRef","optionsCacheRef","debounceTimeout","setOptionsCache","reduceOptions","isMountedRef","currentInputValue","inputValue","isCacheEmpty","currentOptions","Date","now","prevOptionsCache","newInputValue","itemForDelete","restCache","loadOptions","reloadOnErrorTimeout","promise","newAdditional","Object","hasOwn","increaseStateId","prevStateId","useAsyncPaginateBase","deps","defaultOptions","loadOptionsOnMenuOpen","menuIsOpen","filterOption","shouldLoadMore","useRef","useEffect","useIsMountedRef","reduceOptionsRef","loadOptionsOnMenuOpenRef","isInitRef","_stateId","setStateId","useState","init","resultRef","useLazyRef","defaultAdditional","initialOptions","getInitialOptionsCache","callRequestOptionsRef","reduceState","handleScrolledToBottom","useCallback","useAsyncPaginate","inputValueParam","menuIsOpenParam","defaultInputValue","defaultInputValueParam","defaultMenuIsOpen","defaultMenuIsOpenParam","onInputChange","onInputChangeParam","onMenuClose","onMenuCloseParam","onMenuOpen","onMenuOpenParam","inputValueState","setInputValue","menuIsOpenState","setMenuIsOpen","nextInputValue","actionMeta","MenuList2","MenuList","props","selectProps","innerRef","checkTimeoutRef","menuListRef","shouldHandle","el","checkAndHandle","setCheckAndHandleTimeout","useMemo","clearTimeout","jsx","composeRefs","useComponents","components","defaultCacheUniqs","defaultComponents2","withAsyncPaginate","SelectComponent","selectRef","isLoadingProp","cacheUniqs","rest","asyncPaginateProps","processedComponents","AsyncPaginate","REACT_ELEMENT_TYPE","for","jsxProd","type","config","maybeKey","key","propName","$$typeof","jsxs","module"],"sourceRoot":""}